Skip to Content
avatar image
Former Member

hr abap issue

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

9 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 04, 2008 at 02:00 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 04, 2008 at 10:13 AM

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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 04, 2008 at 10:14 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 04, 2008 at 10:15 AM

    hi,

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

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 04, 2008 at 10:16 AM

    Use macr to read Infotypes.:

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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 04, 2008 at 10:16 AM

    HI,

    Plz ignore

    Regards

    Sumit Agarwal

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 04, 2008 at 10:18 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 04, 2008 at 10:18 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 04, 2008 at 10:21 AM

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

    Add comment
    10|10000 characters needed characters exceeded