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

suggest a function module

Former Member
0 Likes
1,289

hi all,

i need to calculate the date.

inputs are date and days....... output should be in date.

for eg

input --- 12.04.2008 + 90 = date,

12.04.2008 + 180 = date.

please suggest a suitable function module

Regards

Suprith

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,256

Hi,

Use FM

HR_99S_DATE_PLUS_TIME_UNIT

12 REPLIES 12
Read only

Former Member
0 Likes
1,257

Hi,

Use FM

HR_99S_DATE_PLUS_TIME_UNIT

Read only

Former Member
0 Likes
1,256

try this

'RP_CALC_DATE_IN_INTERVAL'

Regards

prabhu

Read only

0 Likes
1,256

hi prabhu

'RP_CALC_DATE_IN_INTERVAL' willnot work if the day is of 3 chars.

Read only

0 Likes
1,256

Hi ,

u can add no. of months in that case , but with out FM u can also try this one

date = date + 180.

u will get the same o/p.

Regards

Prabhu

Read only

Former Member
0 Likes
1,256

Hi Suprith,

You can try this FM's:

DATE_IN_FUTURE

Calculate a date N days in the future.

RP_CALC_DATE_IN_INTERVAL

Add/subtract years/months/days from a date

With luck,

Pritam.

Read only

bpawanchand
Active Contributor
0 Likes
1,256

Hi

DATA :
   w_d TYPE d,
   w_days TYPE i VALUE 10,
   w_final TYPE d.



w_d = sy-datum.

w_final  = w_d + w_days.

WRITE :
  w_final.

Regards

Pavan

Read only

sachin_mathapati
Contributor
0 Likes
1,256

Hi ,

Try this FM//

RP_CALC_DATE_IN_INTERVAL u2013 Adds/subtracts years, months, days to/from date

Regards,

Sachin M M

Read only

Former Member
0 Likes
1,256

hi,

check out this.

DATE_IN_FUTURE

Read only

Former Member
0 Likes
1,256

Hi,

Check this Fm,

'RP_CALC_DATE_IN_INTERVAL'

data: w_date type sy-datum.
call function 'RP_CALC_DATE_IN_INTERVAL'
         exporting
              date      = sy-datum
              days      = 90
              months    = 0
              signum    = '+'
              years     = 0
         importing
              calc_date = w_date.
 write: / w_date.

Regards

Adil

Read only

Former Member
0 Likes
1,256

Hi,

Use this FM

DATE_IN_FUTURE or  CALCULATE_DATE

DATA:
  w_date TYPE sy-datum.

CALL FUNCTION 'CALCULATE_DATE'
  EXPORTING
    days        = '180'
    months      = '0'
    start_date  = sy-datum
  IMPORTING
    result_date = w_date.

WRITE: w_date.

For sample code refer this link:

Regards

Adil

Read only

Former Member
0 Likes
1,256

Hi Suprith,

Use can check with the RP_CALC_DATE_IN_INTERVAL FM.

Here for the date at input we can add/substract the no: of Days/Months/Years.

Kindly let me know if this FM does not fit your requirement.

Read only

Former Member
0 Likes
1,256

HI Suprith,

Use the Following Function Module

RP_CALC_DATE_IN_INTERVAL

Hope it will solve your problem,

Regards,

KP