Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Standard FM to find a past date

Former Member
0 Likes
620

Is there a standard FM to find out the date before a few months from a particular date?

For example, if i enter date 01.06.2009 and number of months as 3, i must get a result 01.03.2009 which is three months before the specified date.

1 ACCEPTED SOLUTION
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
588

Date Related Fm pl search for it in forums once before posting...

CCM_GO_BACK_MONTHS

3 REPLIES 3
Read only

kesavadas_thekkillath
Active Contributor
0 Likes
589

Date Related Fm pl search for it in forums once before posting...

CCM_GO_BACK_MONTHS

Read only

former_member302911
Active Participant
0 Likes
588

HI,

try this:


DATA: VA_DATA LIKE SY-DATUM.

        CALL FUNCTION 'RE_ADD_MONTH_TO_DATE'
             EXPORTING
                  MONTHS  = -3
                  OLDDATE = SY-DATUM
             IMPORTING
                  NEWDATE = VA_DATA
             EXCEPTIONS
                  OTHERS  = 1.
WRITE VA_DATA.

Read only

Former Member
0 Likes
588

Hi,

Use the Fm OIL_DATE_SUBTRACT_MONTH.

Regards,

Ankur Parab