‎2009 Mar 03 12:04 PM
Hi,
I need days calculation.I have to enter 50 days in selection screen.
But it has to be executed from todays date.(ex 03.03.2009 + 50 days).
how to write syntax.
‎2009 Mar 03 12:06 PM
you have write the code in the program saying
sy-datum + no.of days given in sel.secreen.
you can use the FM HR_99S_DATE_ADD_SUB_DURATION for adding the no.of days given in sel.scr
Edited by: Sravan Kumar on Mar 3, 2009 1:07 PM
‎2009 Mar 03 12:14 PM
Hi,
in the selection screen, populate the low value of the select-option as sy-datum,
and use FM BKK_ADD_WORKINGDAY to add 50 days to sy-datum and populate the result as the high value of the select option.
Regards,
Kiran
‎2009 Mar 03 12:19 PM
hi,
u can use the fm ADD_TIME_TO_DATE
simply pass the sy-datum and no of days to be added it will add the no of days and give the date after 50 days.
hope this helps you .
regards,
prashanti
‎2009 Mar 03 12:20 PM
Hi Bathrinath,
Use the FM:
DATE_IN_FUTURE
Calculate a date N days in the future.
RP_CALC_DATE_IN_INTERVAL
Add/subtract years/months/days from a date
or do it this way:
Parameter:
days type i default 50.
Data:
date type sy-datum.
At selection-screen.
date = sy-datum + days.
Start-of-selection.
Write:
date.With luck,
Pritam.
Edited by: Pritam Ghosh on Mar 3, 2009 1:21 PM
Edited by: Pritam Ghosh on Mar 3, 2009 1:41 PM
‎2009 Mar 03 12:24 PM
data v_date type sy-datum.
v_date = sy-datum + no_of_days ( value from the selection screen).
‎2009 Mar 03 12:25 PM
data v_date type sy-datum.
v_date = sy-datum + no_of_days ( value from the selection screen).
‎2009 Mar 03 12:28 PM
Hi,
You can use the simple addition to achieve this.
ie:
data: w_dat type sy-datum.
w_dat = sy-datum + 50. "This gives the current date -+ 50 daysEdited by: Manoj Kumar on Mar 3, 2009 1:28 PM
‎2009 Mar 03 12:32 PM
hi,
try this..
data: var1 type sy-datum,
var2 type sy-datum.
var1= sy-datum.
var2 = var1 + 50.
"use this var2
regards
Ritesh J
‎2009 Mar 03 12:35 PM
hi.
test this sample code
REPORT ztn_test .
PARAMETERS: adddays type i,
newdate
like sy-datum.
AT SELECTION-SCREEN OUTPUT.
IF adddays IS INITIAL.
clear newdate.
else.
newdate = sy-datum.
add: adddays to newdate.
endif.