hi Rahul,
data : lv_date type sy-datum.
lv_date = sy-datum + 115.
hope this helps
ec
sy-datum stores the value in this format YYYYMMDD .
use this code and it will work automatically for you, The system handles the no of days in the month.
data: wf_datu like sy-datum.
wf_datu = sy-datum.
wf_datu = wf_datu - 120 + 5.
write: wf_datu.
thanks,
Amit
data : v_date1 like sy-datum , v_date2 like sy-datum.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = sy-datum
days = 120
months = 0
SIGNUM = '+'
years = 0
IMPORTING
calc_date = v_date1.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = v_date1
days = 5
months = 0
SIGNUM = '-'
years = 0
IMPORTING
calc_date = v_date2.
hi! Rahul
get the day, month, year separately and then add 120 to day
date1 = sy-datum
day = date1+6(2).
month = date1+4(2) .
year = date+0(4).
add_date1 = day + 120.
concatenate year month add_date1 to add_date. " as per sap default format
final_date1 = add_date1 - 5.
concatenate year moth final_date1 to final_date.
why you have add and subtract instead you can directly add by 115.
Reward me if its useful
Regards,
Nagulan
Hi Rahul,
You can use this function:
call function 'RP_CALC_DATE_IN_INTERVAL'
exporting
date = sy-datum
days = 25 -
> give the no of days to be added
months = 3 -
> give the no of months to be added
years = 0 -
> give the no of years to be added
signum = '+'
importing
calc_date = wa_date.
Reward useful answers.
Add a comment