‎2007 Jan 29 2:01 PM
hi
what is the function module to add months to a date.
i am using HR_PSD_DATES_ADD_MONTHS .
but if i am passing 31.1.2008 and adding 12 months then it is giving
31.1.2009 but it shud give 30.1.2009
‎2007 Jan 29 2:03 PM
Hi sonika,
1. u can also use HR_JP_ADD_MONTH_TO_DATE
2. Normally
3. 31.01.2008 + 1 year
=
31.01.2009
4. But, if u want 30.01.2009,
then u can simply
do
date = date - 1.
(where date contains the calcualted figure of 31.01.2009)
regards,
amit m.
‎2007 Jan 29 2:04 PM
Hi sonika,
use any of the following fms to add months to date..
u just have to pass two parameters..the months to be aDDED AND THE DATE
BKK_ADD_MONTH_TO_DATE
/BEV3/CHPS__ADD_MONTH_TO_DATE
with regards,
all the best,
sampath
*award if helpful and close the thread
‎2007 Jan 29 2:05 PM
Hi Sonika,
<b>Run the below code to get u r result</b>
<b>Report zex33.
parameter : p_date(10),
p_months like T5A4A-DLYMO.
data : p_format type XUDATFM value 1,
date type datum,
v_dates like sy-datum.
CALL FUNCTION 'DATE_STRING_CONVERT'
EXPORTING
DATE_FORMAT = p_format
DATE_STRING = p_date
START_DATE = SY-DATUM
IMPORTING
RESULT_DATE = date.
call function 'RP_CALC_DATE_IN_INTERVAL'
exporting
date = date
days = 0
months = p_months
signum = '+'
years = 0
importing
calc_date = v_dates.
write : / v_dates.</b>
give input as
p_date : 31.01.2008
p_months : 12
‎2007 Jan 29 2:07 PM
‎2007 Jan 29 2:07 PM
‎2007 Jan 29 2:11 PM
Hi,
I hope one of the following FM's will solve your problem.
<b>RP_CALC_DATE_IN_INTERVAL :</b> Add/subtract years/months/days from a date
<b>MONTH_PLUS_DETERMINE :</b> Add or subtract months from a date. To subtract a month, enter a negative value for the 'months' parameter.
<b>RE_ADD_MONTH_TO_DATE :</b> Can add/subtract months to/from date.
Reward points if the answer is helpful.
Regards,
Mukul
‎2007 Jan 29 2:23 PM
would you please be so nice to explain to me brainless bugger why you intend to get the 30.01.2009?
in my eyes the 31.01.2009 is quite fine.
12 month = 1 year = 365 days. since it´s 2008 we´re talking about it´s even 366 days (29 days february).
maybe thats why you get the 31.01.2009?
what is the difference between adding 12 month and a year?
‎2007 Jan 29 2:26 PM
Hi Florian,
YOu are spot on. She might have got confused with the leap year thingie.
Regards,
ravi
‎2007 Jan 29 2:38 PM
‎2011 Jan 21 7:58 AM
‎2016 Sep 23 8:25 AM