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

Date Function Module

Former Member
0 Likes
692

Hi Friends,

Can any of you inform me the Function Module to get the date based on the no of days entered ,

If suppose i enter 10 days as input parameter , i should get 10 days back date.

Thanks in Advance

Anil

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
668

hi Anil,

use FM

call function <b>'RP_CALC_DATE_IN_INTERVAL'</b>
         exporting
              date      = '06/15/2006'
              days      = 10
              months    = 0
              signum    = '-'
              years     = 0
         importing
              calc_date = wa_date.

6 REPLIES 6
Read only

Former Member
0 Likes
669

hi Anil,

use FM

call function <b>'RP_CALC_DATE_IN_INTERVAL'</b>
         exporting
              date      = '06/15/2006'
              days      = 10
              months    = 0
              signum    = '-'
              years     = 0
         importing
              calc_date = wa_date.

Read only

Former Member
0 Likes
668

Hi anilkumar,

you can calculate date.

DATA: data like sy-datum value sy-datum.

*

write: / date.

date = date - 10.

write: / date.

Hope it helps.

Regards, Dieter

with input try this:

parameters: days(2) type n default 10.

*

data: date like sy-datum.

*

date = sy-datum.

write: / date.

*

date = date - days.

*

write: / date.

Message was edited by:

Dieter Gröhn

Read only

Former Member
0 Likes
668

also chk this FM

<b>RM_GO_BACK_N_DAYS</b>

Read only

Former Member
0 Likes
668

hi,

check out this FM

RP_CALC_DATE_IN_INTERVAL

Read only

Former Member
0 Likes
668

Hi,

check this function module.

TV_GO_BACK_N_DAYS

Regards,

Sruthi

Read only

Former Member
0 Likes
668

Execute teh code.

report Zex13.

parameters : p_days type T5A4A-DLYDY.


data: v_date like sy-datum,
      v_dateold like sy-datum.

 v_date = sy-datum.


CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
  EXPORTING
    date            = v_date
    days            = p_days
    months          = 00
   SIGNUM           = '-'  " days substracted
    years           = 00
 IMPORTING
   CALC_DATE       = v_dateold.


write:/'Current date',  v_date.

skip 2.
write:/ p_days , 'Old date is ', v_dateold.

regards,

vijay