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

Function module for DATE

Former Member
0 Likes
1,766

I want to add days (numeric vales) to date. For example 03/27/2006 + 3 days = 03/30/2006.

Is there any FM for this?

Regards,

Arpit

1 ACCEPTED SOLUTION
Read only

ferry_lianto
Active Contributor
0 Likes
1,294

Hi Arpit,

You can try this FM <b>RP_CALC_DATE_IN_INTERVAL</b>.

call function 'RP_CALC_DATE_IN_INTERVAL'
         exporting
              date      = sy-datum
              days      = 3
              months    = 0
              signum    = '+'
              years     = 0
         importing
              calc_date = wa_date.

Hope this will help.

Regards,

Ferry Lianto

6 REPLIES 6
Read only

ferry_lianto
Active Contributor
0 Likes
1,295

Hi Arpit,

You can try this FM <b>RP_CALC_DATE_IN_INTERVAL</b>.

call function 'RP_CALC_DATE_IN_INTERVAL'
         exporting
              date      = sy-datum
              days      = 3
              months    = 0
              signum    = '+'
              years     = 0
         importing
              calc_date = wa_date.

Hope this will help.

Regards,

Ferry Lianto

Read only

0 Likes
1,294

Hi,

another option can be use function module SALP_CALC_DATE

IN_RECTYPE D (for Days)

IN_NBR_DWXMQY 10 (no of days)

IN_DATE (start date)

thanks

Read only

Former Member
0 Likes
1,294

Hi Arpit,

You can directly add days to any date.No FM is required.

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,294

First you need to get the data into internal format. Then you can just add 3 days to it.




report zrich_0001 .


data: date(10) type c value '03/27/2006'.
data: datum type sy-datum.

start-of-selection.

  call function 'CONVERT_DATE_TO_INTERNAL'
       exporting
            date_external = date
       importing
            date_internal = datum.


  datum = datum + 3.

  write:/ datum.

REgards,

Rich Heilman

Read only

Former Member
0 Likes
1,294

Hi,

U can use the function module 'DATE_IN_FUTURE' to add or subtract days to date.

regards,

Sek s

Read only

Former Member
0 Likes
1,294

If your date is in a field defined as a date field, just add your number to it.

Bruce