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

Looking for a function module (date + nu00BA days)

Former Member
0 Likes
583

Hi Gurus,

I need to know if there is a module to perform functions and return the following:

He passed as parameters date1 and a number of days and will return a date2 date1 result of adding the more the number of days.

Input Parameters:

- Date1

- No. days

Result:

date2 = date1 + N ° days

Thank you.

Regards,

1 ACCEPTED SOLUTION
Read only

jayesh_gupta
Active Participant
0 Likes
534

Hi,

You can achieve this directly by adding the desired number of days to a date type variable.

DATA: date1 type sydatum,

date2 type sydatum,

N_days type i value 4.

date1 = sy-datum.

date2 = date1 + N_days.

write: date1, / date2.

Edited by: Jayesh Gupta on May 20, 2010 9:39 AM

4 REPLIES 4
Read only

jayesh_gupta
Active Participant
0 Likes
535

Hi,

You can achieve this directly by adding the desired number of days to a date type variable.

DATA: date1 type sydatum,

date2 type sydatum,

N_days type i value 4.

date1 = sy-datum.

date2 = date1 + N_days.

write: date1, / date2.

Edited by: Jayesh Gupta on May 20, 2010 9:39 AM

Read only

0 Likes
534

Hi,

You can also use FM ADD_TIME_TO_DATE, with i_idate = origin_date, i_time = number of days, i_iprkz = 'D'

the result is o_idate = i_idate + i_time

Anyways, there are other FMs where you can use calendars, for example when you only want to compute workdays.

Regards,

Read only

Former Member
0 Likes
534

Hi,

Use FM 'CALCULATE_DATE'.

Regards,

Praveen N

Read only

Former Member
0 Likes
534

Thanks!! it's solved!!

forgot to tell you that the environment I'm working on is SAP BI.

And MF comentais I do not exist, as I have suggested will implement Jayesh.