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

FM to increment date

Former Member
0 Likes
758

Hi all,

I need to add 3 days to the date i retrieve from a DB table and do further selection based on that. Is there any function module for adding days to a date ..........so taht it gives correct date based whether the month has 30 0r 31 days ........

thanks,

kavitha.

Hi all,

I need to add 3 days to the date i retrieve from a DB table and do further selection based on that. Is there any function module for adding days to a date ..........so taht it gives correct date based whether the month has 30 0r 31 days ........

thanks,

kavitha.

4 REPLIES 4
Read only

Former Member
0 Likes
718

Hi Kavitha ,

Use the FM DATE_IN_FUTURE.

Regards

Arun

Read only

0 Likes
718

Hi Arun,

Thanks

Read only

Former Member
0 Likes
718

If the database field is a date format, then you can just add 3 to the date e.g

data:
  l_date    like sy-datum.

  select *
    from ztable1
    where bukrs = '1000'.

  l_date = ztable1-date.  
  add 3 to l_date.     "3 days time

  select * 
    from ztable2
    where other_date = l_date.

Why do you need a function module to do this?

Read only

messier31
Active Contributor
0 Likes
718

Hi,

U can use function module

<b>HR_SEN_CALE_DAYS_DATE</b>

Provide date to which you want to add days,

say + to add (in second parameter) and

no of days you want to add.

You can also use this to add months or years to ny date.

Enjoy SAP.

Pankaj Singh.