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 days to date

Former Member
0 Likes
1,746

Hi all,

How can I add 3 days to a specific date? Like adding 3 days to SY-DATUM? THanks in advance.

8 REPLIES 8
Read only

Former Member
0 Likes
1,287

Just do + 3

it will give u next date after three days.

Regards

Azad.

Reward if helpful.

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
1,287

Hi,

You can do that like this.


DATA: dat type sy-datum.

dat = sy-datum + 3.

write: dat.

Regards,

Sesh

Read only

Former Member
0 Likes
1,287

Hi,

If you just want to add calendar days, then all you need to do is add the days to the date. Assuming that GS_DATE is type as a date field, the system will handle adding and subtracting in this way.

gs_date = gs_date + 03.

Or use this..

call function 'RP_CALC_DATE_IN_INTERVAL'

exporting

date = sy-datum

days = 3

months = 0

signum = '+'

years = 0

importing

calc_date = wa_date.

reward if it helps..

regards,

Omkar.

Message was edited by:

Omkaram Yanamala

Read only

Former Member
0 Likes
1,287

hi,

u can simply add + 3.

With Regards,

S.Barani

Read only

Former Member
0 Likes
1,287

Hi

directly add 3

for ex

data x type sy-datum.

x = sy-datum.

x = x + 3.

x has 24.08.2007

Regards

sandhya

Read only

Former Member
0 Likes
1,287

Hi

DATA: date type sy-datum.

date = sy-datum + 3.

reward points to all helpful answers

kiran.M

Read only

Former Member
0 Likes
1,287

Hi,

Use the below function module

RP_CALC_DATE_IN_INTERVAL

Read only

Former Member
0 Likes
1,287

Hi

You can use FM CALCULATE_DATE

Regards

Gregory