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

Add to system date

Former Member
0 Likes
641

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
Read only

Former Member
0 Likes
597

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.

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

3 REPLIES 3
Read only

Former Member
0 Likes
598

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.

Read only

JozsefSzikszai
Active Contributor
0 Likes
597

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

Read only

Former Member
0 Likes
597

Hi Suren,

You can try this way-

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


w_result = sy-datum + w_numc.