‎2008 May 09 6:19 AM
Hi Gurus,
I am searching for a function to get the exact date for certain year.
For example, I would like to know the exact date after 3 years from today.
Because we need to consider the leap year, therefore I cannot do it in this way:
365 (days) * 3 Year(s)
Any suggestion which function I can use here?
All ideas and suggestion are greatly appreciated.
Thanks.
‎2008 May 09 6:23 AM
Hi,
You can use the FM RE_ADD_MONTH_TO_DATE
code
DATA: V_DATE TYPE SYDATUM.
V_DATE = SY-DATUM.
CALL FUNCTION 'RE_ADD_MONTH_TO_DATE'
EXPORTING
MONTHS = '36'
OLDDATE = V_DATE
IMPORTING
NEWDATE = V_DATE.
WRITE: / 'After 3 Years', V_DATE.
Thanks
‎2008 May 09 6:21 AM
‎2008 May 09 6:23 AM
Hi,
You can use the FM RE_ADD_MONTH_TO_DATE
code
DATA: V_DATE TYPE SYDATUM.
V_DATE = SY-DATUM.
CALL FUNCTION 'RE_ADD_MONTH_TO_DATE'
EXPORTING
MONTHS = '36'
OLDDATE = V_DATE
IMPORTING
NEWDATE = V_DATE.
WRITE: / 'After 3 Years', V_DATE.
Thanks
‎2008 May 09 6:27 AM
Thank you so much for the answers.
Especially to Anurodh Jindal, whose provide the example to me as well.
Thanks to all.
‎2008 May 09 8:36 AM
Hi Gurus,
I understand that the above function is used for calculate the date after added certain month(s).
But, how do I do it in the other way. What I mean here is I want to substract the date.
For example my current date is 09.05.2008, substract 3 years is 09.05.2005.
All ideas and suggestion are greatly appreciated.
Thanks.