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

specified date to get a target date------------Function module

Former Member
0 Likes
560

Would you please tell me how to write ABAP code to calculate the date after 10 years?

Any function module can be used: add 10 years after a specified date?

(Needs to handle ten years after 29/02/2004 will be 1/3/2014)

We want the target date.

That means to add 9.81yrs into a specified date to get a target date.

4 REPLIES 4
Read only

jayanthi_jayaraman
Active Contributor
0 Likes
540

Hi,

search in SE37 for date

Message was edited by:

Jayanthi Jayaraman

Read only

0 Likes
540
call function 'RP_CALC_DATE_IN_INTERVAL'
exporting
date = sy-datum
days = 0
months = 0
signum = '+'
years = 10
importing
calc_date = wa_date.
Read only

Former Member
0 Likes
540

Try DATE_IN_FUTURE

Read only

ferry_lianto
Active Contributor
0 Likes
540

Hi Shilpa,

You can use FM RP_CALC_DATE_IN_INTERVAL.


data: wa_output  like sy-datum.

clear wa_output.

call function 'RP_CALC_DATE_IN_INTERVAL'
   exporting
       date      = sy-datum
       days      =  0
       months    = 0
       signum    = '+'
       years     = 10
    importing
       calc_date = wa_output.

write: / wa_output.

Regards,

Ferry Lianto