09-14-2008 11:48 AM
I have date as 20080909. i need to subtract 18 days from it. is there any specfic function module or way to do it. if i do it normal arthematic operations i am getting all wrong dates.
09-14-2008 11:52 AM
Please check the below code:
RDATE = DATE1 - DATE2.
or
RDATE = DATE1 - 18.
Regards
09-14-2008 12:19 PM
09-14-2008 12:33 PM
try this FM: HR_SEN_CALE_DAYS_DATE,
for Calculation of a Date: Add/Subtract Calendar Days
Sid
Edited by: Siddhartha Prakash on Sep 14, 2008 1:45 PM
09-14-2008 12:34 PM
if you search in SDN you get lot of posts realted to this..
there are many functions to do that, one function is
[RP_CALC_DATE_IN_INTERVAL|https://www.sdn.sap.com/irj/sdn/advancedsearch?query=rp_calc_date_in_interval&cat=sdn_all]
search the forum before posting.
09-14-2008 1:21 PM
Hi,
Use FM RP_CALC_DATE_IN_INTERVAL.
DATA:
W_DATE1 LIKE SY-DATUM,
W_DATE2 LIKE SY-DATUM.
W_DATE1 = '20080909'.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
DATE = W_DATE1
DAYS = 18
MONTHS = 0
SIGNUM = '-'
YEARS = 0
IMPORTING
CALC_DATE = W_DATE2.
WRITE:
W_DATE2.
Regards
Adil