Application Development 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: 

Fm to get the previous date by month from the current date

Former Member
0 Kudos

Hi,

my requirement is , like I need to find back date from current date using no of months.

e.g say if I enter 4 months, then it should give me , if current date is 5th Jun 2009.

then 5th Jun - 4 months so it should give me date as 5th Feb 2009. it should alos give me all the dates in between 5th feb and 5th Jun. (range of dates)

is there any FM for this?

Regards,

Mrunal

2 REPLIES 2

Former Member
0 Kudos

Use FM : RP_CALC_DATE_IN_INTERVAL

former_member188829
Active Contributor
0 Kudos

Hi,

Use the FM: RP_CALC_DATE_IN_INTERVAL

DATA:date1 TYPE sy-datum.

START-OF-SELECTION.
  CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
    EXPORTING
      date      = sy-datum
      days      = '00'
      months    = '04'
      signum    = '-'
      years     = '00'
    IMPORTING
      calc_date = date1.

  WRITE date1.