‎2008 Feb 22 6:45 AM
hi everyone,
my requirement:
DATA : DAT TYPE SY-DATUM.
DAT = SY-DATUM.
I am provided with a data from a table which has a value like 36 months.
DAT is the current date and i want to subtract the value of 36 months from this current date. The result must be again displayed in date format.
Could you please suggest any relevent code.
Thanks in Advance.
‎2008 Feb 22 6:56 AM
‎2008 Feb 22 6:56 AM
‎2008 Feb 22 7:12 AM
lets say that dat is the current date.
dat is 22.02.2008
i am provided with the number 36 months.
now i have to subtract 36 months from dat so that my output will be 22.02.2005.
‎2008 Feb 22 7:15 AM
use fm
CCM_GO_BACK_MONTHS
Provide date and month...u will get the result
‎2008 Feb 22 7:17 AM
Hi,
There is a fm MONTH_PLUS_DETERMINE exactly for your requirement. see the use below
CALL FUNCTION 'MONTH_PLUS_DETERMINE'
EXPORTING
months = 36
olddate = <your current date>
IMPORTING
NEWDATE = < your future date>
.
The result format will be exactly what you have desired.
<REMOVED BY MODERATOR>
Harikrishna.
Edited by: Alvaro Tejada Galindo on Feb 22, 2008 5:09 PM