‎2007 Feb 21 1:39 AM
Hello all,
I have a report with a date range at the selection screen.
select-options: s_date for afko-gltrp obligatory.
I want to do something like this. At the selection screen when I pick any start date for s_date-low I should get the date 4 weeks from s_date-low into s_date-high. For example if I select 02/01/2007 for s_date-low, I should get 02/28/2007 into s_date-high.
Any ideas please................
‎2007 Feb 21 2:00 AM
‎2007 Feb 21 2:30 AM
In the AT SELECTION-SCREEN event,
write the below code:
loop at s_date.
s_date-high = s_date-low + 28.
modify s_date.
endloop.
Thus after entering the low value if you press enter, the respective high value will appear in the output.
Thanks
‎2007 Feb 21 2:31 AM
Hi Raju
You can try this way:
SELECT-OPTIONS S_DATE FOR SY-DATUM MODIF ID ABC.
DATA: DUR TYPE PSEN_DURATION_DEC.
AT SELECTION-SCREEN OUTPUT.
IF NOT S_DATE-LOW IS INITIAL.
DUR-CALDD = 28.
CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'
EXPORTING
ID_DATE = S_DATE-LOW
ID_OPERATOR = '+'
IS_DURATION = DUR
IMPORTING
ED_DATE = S_DATE-HIGH
EXCEPTIONS
CONVERSION_NOT_SPECIFIED = 1
CONVERSION_NOT_POSSIBLE = 2
OTHERS = 3.
MODIFY S_DATE INDEX 1.
ENDIF.Kind Regards
Eswar
‎2007 Feb 21 2:39 AM
Hi Raju,
press f4 for date-low and then press enter or execute.
selection-screen begin of block b1.
select-options: s_date for sy-datum.
selection-screen end of block b1.
at selection-screen on value-request for s_date-low.
*
CALL FUNCTION 'F4_DATE'
EXPORTING
DATE_FOR_FIRST_MONTH = SY-DATUM
DISPLAY = ' '
FACTORY_CALENDAR_ID = ' '
GREGORIAN_CALENDAR_FLAG = ' '
HOLIDAY_CALENDAR_ID = ' '
PROGNAME_FOR_FIRST_MONTH = ' '
IMPORTING
SELECT_DATE = s_DATE-low
SELECT_WEEK = SELECT_WEEK
SELECT_WEEK_BEGIN = SELECT_WEEK_BEGIN
SELECT_WEEK_END = SELECT_WEEK_END
EXCEPTIONS
CALENDAR_BUFFER_NOT_LOADABLE = 1
DATE_AFTER_RANGE = 2
DATE_BEFORE_RANGE = 3
DATE_INVALID = 4
FACTORY_CALENDAR_NOT_FOUND = 5
HOLIDAY_CALENDAR_NOT_FOUND = 6
PARAMETER_CONFLICT = 7
OTHERS = 8
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CALL FUNCTION 'CALCULATE_DATE'
EXPORTING
DAYS = '28'
MONTHS = '0'
START_DATE = s_date-low
IMPORTING
RESULT_DATE = s_date-high .
reward if helpful,
keerthi
‎2007 Feb 21 3:07 AM
Raju,
IF you select the date ,no event will get fire.so your logic never works.What i mean is whenever you select the date into "low " based on your date "high" date has to calculate.for that one event has to get trigger.But here no event will get trigger.So change your requiremnet.