Application Development 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: 

hr abap issue

Former Member
0 Kudos

hi all,

how to extract the hire date from infotype 0041

my requirement is extract the employee hire date

thanks & regards

Revathi Raj

Edited by: revathi raju on Sep 4, 2008 12:11 PM

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Raju,

The Date type for hire date is ' U1 '

Now you need to loop through all the dates in the infortype 41

and compare the date types for U1.

Once u get the date type in the variable

DAR0X ,Then particular DAT0X will be ur hire date...

ok lets see the example as how to do...


data: l_datar   type datar,
        l_dardt   type dardt.
 do 12 times
 varying l_datar from pa0041-dar01 next pa0041-dar02
 varying l_dardt from pa0041-dat01 next pa0041-dat02.
      if l_datar eq U1.
        v_hiredate = l_dardt.
endif.
enddo.

The above is just a sample code..Check if it is helpful

Thank you

10 REPLIES 10

Former Member
0 Kudos

If you want employee hire date goto infotype 41, using repetative structure (do varying) you can get the date.

Former Member
0 Kudos

HI,

Use FM HR_READ_INFOTYPE.

READ TABLE T_P0000 INTO WA_P0000 INDEX 1.
  READ TABLE T_P0041 INTO WA_P0041 INDEX 1.

  DO VARYING W_DTYPE FROM WA_P0041-DAR01 NEXT WA_P0041-DAR02
     VARYING W_DTEXT FROM WA_P0041-DAT01 NEXT WA_P0041-DAT02.

    IF W_DTYPE EQ P_DATE.
      WRITE 😕  WA_P0000-PERNR,
                WA_P0000-ENDDA,
                WA_P0000-BEGDA,
                W_DTYPE,
                W_DTEXT.
      EXIT.
    ENDIF.
  ENDDO.

Regards

Sumit Agarwal

0 Kudos

thanks,

but i want hire date only from IT41

GauthamV
Active Contributor
0 Kudos

hi,

in infotype 41 u can extract hire date details for data type 71.

former_member181995
Active Contributor
0 Kudos

Use macr to read Infotypes.:

rp-provide-from-last p0041 space pn-begda pn-endda.

Former Member
0 Kudos

HI,

Plz ignore

Regards

Sumit Agarwal

Former Member
0 Kudos

HI revathi,

Use the FM HR_READ_INFOTYPE

Example:-

LOOP AT t_pa0000 INTO fs_pa0000.
    CALL FUNCTION 'HR_READ_INFOTYPE'
      EXPORTING
        pernr           = fs_pa0000-pernr
        infty           = '0041'
        begda           = fs_pa0000-begda
        endda           = fs_pa0000-endda
        bypass_buffer   = 'X'
      TABLES
        infty_tab       = t_pa0041
      EXCEPTIONS
        infty_not_found = 1
        OTHERS          = 2.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.                             " IF SY-SUBRC NE 0.

  ENDLOOP.                             " LOOP AT T_PA0000...
          

Here t_pa0000 is a table which contains all active employees.

Best if Luck,

Bhumika

Former Member
0 Kudos

hii

try using FM

CALL FUNCTION 'RP_GET_HIRE_DATE'
EXPORTING
PERSNR = wa_out-pernr
CHECK_INFOTYPES = '0041'

DATUMSART = '01' 
STATUS2 = '3' 
P0016_OPTIONEN = ' ' 
IMPORTING 
HIREDATE = wa_out-hiredat

regards

twinkal

Former Member
0 Kudos

Hi,

In infotype 41..there are fields from dar01 to dar12...check in pa30...in which dar field does the date of joining is captured...accordingly get the value of date from dat01 to dat12 respectively....

For eg..,Date of joining is in date type 'DAR01'..then the date of joining is 'DAT01'...

Former Member
0 Kudos

Hi Raju,

The Date type for hire date is ' U1 '

Now you need to loop through all the dates in the infortype 41

and compare the date types for U1.

Once u get the date type in the variable

DAR0X ,Then particular DAT0X will be ur hire date...

ok lets see the example as how to do...


data: l_datar   type datar,
        l_dardt   type dardt.
 do 12 times
 varying l_datar from pa0041-dar01 next pa0041-dar02
 varying l_dardt from pa0041-dat01 next pa0041-dat02.
      if l_datar eq U1.
        v_hiredate = l_dardt.
endif.
enddo.

The above is just a sample code..Check if it is helpful

Thank you