SAP R/3 форум ABAP консультантов
Russian ABAP Developer's Club

Home - FAQ - Search - Memberlist - Usergroups - Profile - Log in to check your private messages - Register - Log in - English
Blogs - Weblogs News

Форматирование даты



 
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP
View previous topic :: View next topic  
Author Message
seal
Участник
Участник



Joined: 25 Sep 2007
Posts: 18

PostPosted: Fri Dec 07, 2007 10:28 am    Post subject: Форматирование даты Reply with quote

Пишу программу, в которой на селекционном экране
есть поле с датой и цифровое поле с количеством дней, которое нужно вычесть из этой даты.
Как мне в запросе использовать эти два поля, чтобы выбирать записи только в указанном интервале? В таблице только одно поле с датой.
Спасибо за советы.
Back to top
View user's profile Send private message
John Doe
Модератор
Модератор


Age: 46
Joined: 05 Nov 2007
Posts: 725
Location: КраснАдар

PostPosted: Fri Dec 07, 2007 11:36 am    Post subject: Reply with quote

Сделай range. В нижнее значение положи свою дату минус кол-во дней, в верхнее - просто дату.
Пример:
Code:
DATA: RDATE TYPE RANGE OF DATUM WITH HEADER LINE,
      LT_SFLIGHT TYPE TABLE OF SFLIGHT WITH HEADER LINE.

PARAMETERS: LDATE TYPE SY-DATUM,
            NUMDAYS(2) TYPE N.

AT SELECTION-SCREEN.
  RDATE-SIGN   = 'I'.
  RDATE-OPTION = 'BT'.
  RDATE-LOW    = LDATE - NUMDAYS.
  RDATE-HIGH   = LDATE.
  APPEND RDATE.

  SELECT * FROM SFLIGHT INTO TABLE LT_SFLIGHT
    WHERE FLDATE IN RDATE.
Back to top
View user's profile Send private message Blog
Display posts from previous:   
Post new topic   Reply to topic    Russian ABAP Developer's Club Forum Index -> ABAP All times are GMT + 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


All product names are trademarks of their respective companies. SAPNET.RU websites are in no way affiliated with SAP AG.
SAP, SAP R/3, R/3 software, mySAP, ABAP, BAPI, xApps, SAP NetWeaver and any other are registered trademarks of SAP AG.
Every effort is made to ensure content integrity. Use information on this site at your own risk.