‎2009 Jan 08 5:03 AM
hi
i have got the date of birth of an employee as 23/02/1951
i.e the d.o.b + 58 yrs
i want to get the recquirement date as 23/02/2009.
how to do this pls help me....
is there any function module for this....
‎2009 Jan 08 5:05 AM
hi,
try this FM RP_CALC_DATE_IN_INTERVAL
Function module RP_CALC_DATE_IN_INTERVAL
Import parameters Value
DATE 02-26-2002
DAYS 00
MONTHS 00
SIGNUM +
YEARS 58
Export parameters Value
CALC_DATE 02-26-2060
‎2009 Jan 08 5:07 AM
‎2009 Jan 08 5:07 AM
use these function module.
RP_CALC_DATE_IN_INTERVAL
MONTH_PLUS_DETERMINE
‎2009 Jan 08 5:08 AM
Helo Karteek,
Check the method ADD_YEARS_TO_DATE of the class CL_HRPAD_DATE_COMPUTATIONS ?
* Adds No. of Years to Date
TRY.
CALL METHOD CL_HRPAD_DATE_COMPUTATIONS=>ADD_YEARS_TO_DATE
EXPORTING
start_date = sy-datum
months = l_v_years
RECEIVING
date = l_v_date.
CATCH cx_hrpa_violated_postcondition .
ENDTRY.
Hope this helps.
BR,
Suhas
Edited by: Suhas Saha on Jan 8, 2009 6:09 AM
‎2009 Jan 08 5:09 AM
‎2009 Jan 08 5:17 AM
Hi,
You just try this Funtion Module.. RP_CALC_DATE_IN_INTERVAL
Hope it will work.
‎2009 Jan 08 5:18 AM
Hi,
Here is a sample code for your help.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = <date>/<variable containing date>
days = 0
months = 0
signum = '+'
years = 0000 "number of years you want to add
IMPORTING
calc_date = <variable to hold the result>.
Hope it will help you.
Regards
Natasha Garg
‎2009 Jan 08 6:23 AM
DATA: date1 TYPE d.
CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
EXPORTING
date = '19510223'
days = 0
months = 0
signum = '+'
years = 58
IMPORTING
calc_date = date1.
WRITE: date1.