‎2006 Jun 28 9:07 AM
Hi all,
Could u tell me how to add/subtract some no of months to a particular date and get the resulting date..
Thanks
Ananda
‎2006 Jun 28 9:10 AM
Use the below function module...
data : wa_date type sy-datum.
call function 'RP_CALC_DATE_IN_INTERVAL'
exporting
date = sy-datum
days = 0
months = 6
years = 0
signum = '+'
importing
calc_date = wa_date.
<b>signum = '+' " add month
signum = '-' " subtract month</b>
Pl. award points if useful.
‎2006 Jun 28 9:10 AM
Use the below function module...
data : wa_date type sy-datum.
call function 'RP_CALC_DATE_IN_INTERVAL'
exporting
date = sy-datum
days = 0
months = 6
years = 0
signum = '+'
importing
calc_date = wa_date.
<b>signum = '+' " add month
signum = '-' " subtract month</b>
Pl. award points if useful.
‎2006 Jun 28 9:10 AM
Hi,
you can use these two funcion odules.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
DATE = IT_HEADER-INVOICE_DATE
DAYS = '00'
MONTHS = '01'
SIGNUM = '-'
YEARS = '00'
IMPORTING
CALC_DATE = BILLING_PERIOD-LOW
CALL FUNCTION 'HR_SEN_CALE_DAYS_DATE'
EXPORTING
ID_DATE = V_DATE
ID_OPERATOR = '+'
IS_DURATION = V_DURATION
IMPORTING
ED_DATE = V_PAYMENT_DUE
EXCEPTIONS
CONVERSION_NOT_SPECIFIED = 1
CONVERSION_NOT_POSSIBLE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
reward if you find this helpful.
regards,
sumit
Message was edited by: sumit kumar
‎2006 Jun 28 9:11 AM
Hi,
Copy and paste this code.
REPORT ZTEST .
data : l_month type i value '2'.
data : l_date type sy-datum value '20060505',
l_date_new type sy-datum.
CALL FUNCTION 'RE_ADD_MONTH_TO_DATE'
EXPORTING
MONTHS = l_month
OLDDATE = l_date
IMPORTING
NEWDATE = l_date_new.
write : l_date_new.
Message was edited by: mukesh kumar
‎2006 Jun 28 9:13 AM
‎2006 Jun 28 9:13 AM
‎2006 Jun 28 9:13 AM
‎2006 Jun 28 9:34 AM
Hi Herath,
U can use this function module :
BKK_ADD_MONTH_TO_DATE
U can pass negative values to deduct and positive values to add months to the date.