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

Adding months with a date.

Former Member
0 Likes
639

Hi,

I am having problem in adding six months with the current date(sy-datum). Can you please let me know how can I add six months with sy-datum.

Lokman

1 ACCEPTED SOLUTION
Read only

ferry_lianto
Active Contributor
0 Likes
620

Hi Lokman,

You can use this FM <b>RP_CALC_DATE_IN_INTERVAL</b>.

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

Hope this will help.

Regards,

Ferry Lianto

5 REPLIES 5
Read only

Former Member
0 Likes
620

Hi,

Convert the months into days & you can add to sy-datum directly.

Read only

0 Likes
620

Hi Phani,

I don't know the months in advance. It will be different in different time. Is there any alternative way for this.

Lokman

Read only

ferry_lianto
Active Contributor
0 Likes
621

Hi Lokman,

You can use this FM <b>RP_CALC_DATE_IN_INTERVAL</b>.

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

Hope this will help.

Regards,

Ferry Lianto

Read only

0 Likes
620

Ferry,

Thank a lot.

Lokman

Read only

Former Member
0 Likes
620

g_date = sy-datum + 180.

g_date6(2) = sy-datum6(2).

Hope it helps,

Regards,

Bikash