01-08-2007 6:35 AM
actally i want to add 2 montsh fro teh current date.but i have to consider the month of february for the calculation and even the leap year.
so can u guys help me out .
waiting for the reply
thanks in advance.
01-08-2007 6:38 AM
Hi Rajeev ,
Welcome to SDN.
Check this and execute the code.
This will cover the leap year also.
data: date like sy-datum,
date1 like sy-datum.
date = sy-datum.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = date
days = 00
months = 02 "no of months
SIGNUM = '+' "months added
years = 00
IMPORTING
CALC_DATE = date1. " new date
write:/ 'new date', date1.
regards.
vijay
01-08-2007 6:38 AM
Hi Rajeev ,
Welcome to SDN.
Check this and execute the code.
This will cover the leap year also.
data: date like sy-datum,
date1 like sy-datum.
date = sy-datum.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = date
days = 00
months = 02 "no of months
SIGNUM = '+' "months added
years = 00
IMPORTING
CALC_DATE = date1. " new date
write:/ 'new date', date1.
regards.
vijay
01-08-2007 6:41 AM
01-08-2007 6:38 AM
data: ws_date type sy-datum,
ws_new_date type sy-datum.
ws_date = '20060101'.
CALL FUNCTION 'MONTH_PLUS_DETERMINE'
EXPORTING
months = '2'
olddate = ws_date
IMPORTING
newdate = ws_new_date.
write: / ws_new_date
01-08-2007 6:40 AM
Hi,
Use the FM SG_PS_ADD_MONTH_TO_DATE.
It considers leap years also
Regards
Arun
01-08-2007 6:41 AM
hi,
chk this.
data : wa_date type sy-datum.
call function 'RP_CALC_DATE_IN_INTERVAL'
exporting
date = sy-datum
days = 0
months = 2--------------------> give ur required month
years = 0
signum = '+'
importing
calc_date = wa_date.
write 😕 wa_date. -> new minised date
Note
signum = '+' "
signum = '-' "
Regards
Anver
01-08-2007 6:55 AM