Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

date problem

Former Member
0 Likes
980

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....

8 REPLIES 8
Read only

Former Member
0 Likes
895

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

Read only

Former Member
0 Likes
895

Try this FM

RP_CALC_DATE_IN_INTERVAL

Hope this solves ..

Read only

GauthamV
Active Contributor
0 Likes
895

use these function module.

RP_CALC_DATE_IN_INTERVAL

MONTH_PLUS_DETERMINE

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
895

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

Read only

Former Member
0 Likes
895

Hi,

try this FM

RP_CALC_DATE_IN_INTERVAL

Read only

Former Member
0 Likes
895

Hi,

You just try this Funtion Module.. RP_CALC_DATE_IN_INTERVAL

Hope it will work.

Read only

Former Member
0 Likes
895

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

Read only

Former Member
0 Likes
895
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.