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 getting past date

Former Member
0 Likes
3,330

Hi Experts,

Can you tell me what is the function module for getting date by passing Date and number of days. For example if i pass date as 12/24/2007(MMDDYYYY) and days as 10 then output should be 12/14/2007(MMDDYYYY) ie ten days back date. Days can be any number it can be more than 31 also.

Points will be rewarded.

Thanks In Advance.

Regards,

Praveen.

7 REPLIES 7
Read only

former_member188829
Active Contributor
0 Likes
2,099

Hi,

Use function module:RP_CALC_DATE_IN_INTERVAL

Read only

Former Member
0 Likes
2,099

Hi Praveen,

You don't need any function module: you can just subtract the number of days:

DATA:

zlv_date_01 TYPE d,

zlv_date_02 TYPE d,

zlv_days TYPE i.

.

.

zlv_date_02 = zlv_date_01 - zlv_days.

Regards,

John.

Read only

former_member156446
Active Contributor
0 Likes
2,099

hi this will work

RP_CALC_DATE_IN_INTERVAL

IF pa_older = 'X'.

CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'

EXPORTING

date = pa_end

days = '00'

months = '06'

signum = '-'

years = '00'

IMPORTING

calc_date = pa_end.

ENDIF.

Read only

Former Member
0 Likes
2,099

Hi,

Please use the FM BKK_ADD_WORKINGDAY.

For past days input -days.

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
2,099

DATA : date LIKE sy-datum.

date = sy-datum.

date = date - 30. "no of days

write : date.

Read only

Former Member
0 Likes
2,099

Hi praveen for u r requirement there is no need of any FM

Try this code

parameters:

p_date like sy-datum,

p_no type i.

data:

w_date like sy-datum.

w_date = p_date - p_no.

write: / w_date .

it is enogh for u r requirement

plzz reward if it is usefull...

for any further quiries my mail id is mutyalasunilkumar@gmail.com

plzz dont forget to reward

Read only

Former Member