‎2007 Jan 18 6:30 AM
hi ,
I want to subtract 13 months from a date.
'OIL_DATE_SUBTRACT_MONTH' this fm is going for dump...
can anybody suggest sme other fn module to do the same.
‎2007 Jan 18 6:31 AM
try CALCULATE_DATE
Check this program contributed by Andreas
with month = -13
REPORT zforum117 .
PARAMETERS: date LIKE sy-datum DEFAULT sy-datum,
mth(4) default -1.
DATA: fecha LIKE sy-datum(6),
fecha1 LIKE sy-datum.
CALL FUNCTION 'CALCULATE_DATE'
EXPORTING
* days = '0'
months = mth
start_date = date
IMPORTING
result_date = fecha1.
.
fecha = fecha1(6).
write: fecha.
‎2007 Jan 18 6:35 AM
‎2007 Jan 18 6:35 AM
Well, the easiest thing to do is to simply subsract a number (of days) to a date.
data: w_date like sy-datum.
w_date = sy-datum.
w_date = w_date - 90.
* w_date has a date 90 days of the past.
But if you have to add or substract months or years, you can use FM RP_CALC_DATE_IN_INTERVAL:
data: w_date like sy-datum.
data: new_date like sy-datum.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
DATE = w_date
DAYS = 0
MONTHS = 3
SIGNUM = '-'
YEARS = 0
IMPORTING
CALC_DATE = new_date
EXCEPTIONS
OTHERS = 1.
* new_date has a value 3 months of the past.Regards,
Santosh
‎2007 Jan 18 6:35 AM
Hi,
Just try to use this FM HRWPC_BL_DATES_MONTH_INTERVAL
here you have to give date and number of month before given date and number of month ahead of given date.
this FM returns the dates subtracting from given date.
Regards
Ashutosh
Reward points if helpful
‎2007 Jan 18 6:35 AM
‎2007 Jan 18 6:35 AM
Hi,
Use MONTH_PLUS_DETERMINE, and pass -13 for previous date.
+13 for future date.
Regards
Subramanian
‎2007 Jan 18 6:38 AM
Hi,
Use this
CALL FUNCTION 'CALCULATE_DATE'
EXPORTING
DAYS = '0'
MONTHS = '-13'
START_DATE = SY-DATUM
IMPORTING
RESULT_DATE = lv_date.
write lv_date.
Rgds,
Prakash
‎2007 Jan 18 6:38 AM
Hi,
Use this FM
/BEV3/CHCALCULATE_DATE
DATE 12.12.2005
Pass the values like
DAYS 00
MONTHS 13
SIGNUM -
YEARS 0000
KZ_INCL X
Output
CALC_DATE 11.11.2004
Hope this will help u.
Thanks
Shiva
‎2007 Jan 18 6:47 AM
Hi,
Use the FM:
<b>CALCULATE_DATE</b>
Increase/decrease DATE by a specific number of Days/Months
Hope it helps.
Reward if helpful.
Regards,
Sipra
‎2007 Jan 18 7:09 AM
hi,
Use the function module .
CALL FUNCTION 'CALCULATE_DATE'
EXPORTING
days = '0'
months = '-13'
start_date = '20061123' " give your start date
IMPORTING
result_date = X.
hope this helps .