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

function module to find the date

Former Member
0 Likes
508

Hi folks,

Is there a FM where in by using the current date I could calculate an earlier date which is 30 days less than the current one?

Thanks,

Sk

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
485

Hello,

U can do like this

Data lv_datum like sy-datum..

lv_datum eq sy-datum - 30.

write lv_datum

Regards,

Vasanth

4 REPLIES 4
Read only

Former Member
0 Likes
486

Hello,

U can do like this

Data lv_datum like sy-datum..

lv_datum eq sy-datum - 30.

write lv_datum

Regards,

Vasanth

Read only

0 Likes
485

No need for a function module, use subtract 30 days. Yes it works.

data: new_datum type sy-datum.

new_datum = sy-datum - 30.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
485

data: l_date like sy-datum.

l_date = sy-datum - 30.

write : / l_date.

Thanks,

Santosh

Read only

Former Member
0 Likes
485

Hi,

If you want to use FM, try FM RP_CALC_DATE_IN_INTERVAL.


data: wa_date like sy-datum.
 
call function 'RP_CALC_DATE_IN_INTERVAL'
         exporting
              date      = sy-datum
              days      = 30
              months    = 0
              signum    = '-'
              years     = 0
         importing
              calc_date = wa_date.

write: / wa_date.

Regards,

Ferry Lianto