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 for date

rahul2000
Contributor
0 Kudos

Dear all,

Is there any FM to add 3 days to a given date..

eg if i give date as 15.04.08

i should get output as 18.04.08

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Use FM

RP_CALC_DATE_IN_INTERVAL

Example:

data: v_curr type sy-datum,

v_next type sy-datum.

v_curr = '20080415'.

CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'

EXPORTING

DATE = v_curr

DAYS = '03'

MONTHS = '0'

SIGNUM = '+'

YEARS = 0

IMPORTING

CALC_DATE = v_next.

write:/5 'Current date', v_curr.

write:/5 'Future date', v_next.

Edited by: Velangini Showry Maria Kumar Bandanadham on Apr 15, 2008 11:25 AM

9 REPLIES 9

Former Member
0 Kudos

Hi,

Use FM

RP_CALC_DATE_IN_INTERVAL

Example:

data: v_curr type sy-datum,

v_next type sy-datum.

v_curr = '20080415'.

CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'

EXPORTING

DATE = v_curr

DAYS = '03'

MONTHS = '0'

SIGNUM = '+'

YEARS = 0

IMPORTING

CALC_DATE = v_next.

write:/5 'Current date', v_curr.

write:/5 'Future date', v_next.

Edited by: Velangini Showry Maria Kumar Bandanadham on Apr 15, 2008 11:25 AM

Former Member
0 Kudos

Hi,

No function module is necessary, just add 3 to the date and put the answer in another date field.

E.g.


data: wa_date type datum.

wa_date = sy-datum + 3.

Regards,

Nick

Former Member
0 Kudos

Hi,

dat = dat + 3.

rgds,

bharat.

Former Member
0 Kudos

v_date = date + 3. will do that no need of function module

Former Member
0 Kudos

Hi,

try this

RP_CALC_DATE_IN_INTERNAL

peter_ruiz2
Active Contributor
0 Kudos

hi,

use WDKAL_DATE_ADD_FKDAYS

regards,

Peter

Former Member
0 Kudos

USE FM :

BKK_ADD_WORKINGDAY

Former Member
0 Kudos

Hi,

Use FM:

DATE_IN_FUTURE – takes number of days and date - gives future date in user format and system format

Hope this helps.

Reward if helpful.

Regards,

Sipra

Former Member
0 Kudos

Use FM 'HR_SGPBS_ADD_TIME_TO_DATE' for this purpose.

In I_IDATE parameter pass the base date and in I_IPRKZ pass 'D' it you want to add date and pass no of days to I_TIME . Export parameter O_IDATE will return the required date.


Ex:
Pass 
 I_IDATE = '15.04.08' 
 I_TIME = '3'
 I_IPRKZ = 'D'


The export parameter O_IDATE will return '18.04.08'