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

regarding date in sap

Former Member
0 Likes
632

is there any function module for

how to add certain numbder of days to a date and get the result in date format

example

03/19/2004 + 30 = 04/18/2004

Thanks in advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
608

hi Saanvi,

If you need to add the calender days simply add the days to the date.. like

data : gs_date type sy-datum.

gs_date = gs_date + 14.

write : gs_date.[/code]

or simply use this fm...........

DATE_IN_FUTURE and pass the days and date

4 REPLIES 4
Read only

Former Member
0 Likes
609

hi Saanvi,

If you need to add the calender days simply add the days to the date.. like

data : gs_date type sy-datum.

gs_date = gs_date + 14.

write : gs_date.[/code]

or simply use this fm...........

DATE_IN_FUTURE and pass the days and date

Read only

Former Member
0 Likes
608

data v_date like sy-datum.

v_date = v_date + 30.

Read only

Former Member
0 Likes
608

You can do just as you showed.

dateout = datein + nbr_of_days.

Read only

Former Member
0 Likes
608

hi check this..

parameters: i_date type sy-datum.

data:date type sy-datum,

date1(2),

date2(2),

date3(4),

date4(10).

CALL FUNCTION 'ADD_TIME_TO_DATE'

EXPORTING

I_IDATE = i_date "Original date

I_TIME = '4' " Ammount to add

I_IPRKZ = ' ' " for date leave it as space

IMPORTING

O_IDATE = date ."new date

date3 = date+0(4).

date2 = date+4(2).

date1 = date+6(2).

concatenate date1 date2 date3 into date4 separated by '/'.

write:/ date4.

regards,

venkat