‎2007 Jun 12 6:51 PM
Hy guys,
I have a date type variable, is there any function or a way to sum or substract months, days ??
I need to substract, 3, 6 and 12 months to a given date.
Thanks,
‎2007 Jun 12 6:57 PM
‎2007 Jun 12 7:03 PM
Here is an example.
report zrich_0001 .
data: months type i.
data: new_date type sy-datum.
write:/ sy-datum.
do 3 times.
months = abs( months - 3 ) * -1.
call function 'RE_ADD_MONTH_TO_DATE'
exporting
months = months
olddate = sy-datum
importing
newdate = new_date.
write:/ new_date.
enddo.
Regards,
Rich Heilman
‎2007 Jun 12 7:29 PM
Hi,
Please try this FM RP_CALC_DATE_IN_INTERVAL.
data: wa_date like sy-datum.
call function 'RP_CALC_DATE_IN_INTERVAL'
exporting
date = sy-datum
days = 0
months = 3
signum = '-'
years = 0
importing
calc_date = wa_date.
write: / wa_date.
Regards,
Ferry Lianto
‎2007 Jun 12 9:11 PM