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: 

Add to system date

Former Member
0 Kudos

Hi All,

I have a scenario where i am declaring a Global variable Numeric.

I will call this variable in a program which will add to the system date.

How do i do this...

Reg

Suren

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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 = variable
months = 0
signum = '+'
years = 0
importing
calc_date = wa_date.


write: / wa_date.

3 REPLIES 3

Former Member
0 Kudos

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 = variable
months = 0
signum = '+'
years = 0
importing
calc_date = wa_date.


write: / wa_date.

JozsefSzikszai
Active Contributor
0 Kudos

hi Sureen,

if the global variable represents number of days, you can add directly:

DATA : gv_days TYPE i,
           gv_date TYPE sy-datum.

gv_date = sy-datum + gv_gays.

Also, do not change system variables directly, use a separately defined variable!

hope this helps

ec

Former Member
0 Kudos

Hi Suren,

You can try this way-

Data:w_numc type n,
        w_result type sy-datum.


w_result = sy-datum + w_numc.