Application Development 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: 

FM to increment date

Former Member
0 Kudos
125

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

Former Member
0 Kudos
85

Hi Kavitha ,

Use the FM DATE_IN_FUTURE.

Regards

Arun

0 Kudos
85

Hi Arun,

Thanks

Former Member
0 Kudos
85

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?

messier31
Active Contributor
0 Kudos
85

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.