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

Regarding Date

Former Member
0 Likes
603

Hi,

i want to add days to particular date. for example i have date 23 i need to add days to this 23 (ie 23 days) in scripts. plz let me know any function module is there or not ? if not how to achieve this thru code.

Thanks & Regards

Munna

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
582

Hi Syed,

You this can be achived by coding in Print program. create a variable & in this variable concatenate 23 & days. And pass this variable in the script. Or if you are already passing the 23 to script the after the 23 you can simply write the DAYS after the variable (in which value 23 is passed).

Reward points if helpful answer.

Asvhender

5 REPLIES 5
Read only

ThomasZloch
Active Contributor
0 Likes
582

DATA: LF_DATE TYPE D.

LF_DATE = '20070905'.

ADD 23 TO LF_DATE.

WRITE LF_DATE DD/MM/YYYY.

Result: 28.09.2007 (in your local date format)

Is that what you're looking for?

Read only

0 Likes
582

Hi,

actually i am looking for requireent to add text days after date.

suppose date is 23 i need to add text days after 23 final out put i need is 23 days.

Thanks & Regareds

Munna

Read only

Former Member
0 Likes
583

Hi Syed,

You this can be achived by coding in Print program. create a variable & in this variable concatenate 23 & days. And pass this variable in the script. Or if you are already passing the 23 to script the after the 23 you can simply write the DAYS after the variable (in which value 23 is passed).

Reward points if helpful answer.

Asvhender

Read only

Former Member
0 Likes
582

Hi Munna,

Date format stores in SAP by default YYYYMMDD.

If you want get the date declare variable and get the DD values to use.

day+6(2).

Regards,

Ameer Baba.

Read only

Former Member
0 Likes
582

Hi syed,

you can use this function module "RP_CALC_DATE_IN_INTERVAL" to add days or month or years to a given date.

Eg:to add 23 days and 1 month to a date

CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'

EXPORTING

date = ws_date

days = 23

months = 1

signum = '+'

years = 0

IMPORTING

calc_date = ws_eddate.

Regards,

Sheron