Skip to Content
author's profile photo Former Member
Former Member

HOW to use HR_READ_INFOTYPE FM

Hi Guy's,

How to use " HR_READ_INFOTYPE" Function module.

Thanks and Regards,

Bhavani

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Mar 19, 2008 at 01:42 PM

    hi use this,

    &----


    *& Report ZVENKAT_03

    *&

    &----


    *&

    *&

    &----


    REPORT ZVENKAT_03.

    tables:p0002.

    data: it_data type p0002 occurs 0 with header line.

    data: it_data1 type p0008 occurs 0 with header line.

    data:v_name1 like p0002-cname,

    v_date like p0041-dat01.

    data:begin of it_p0002 occurs 0,

    pernr like p0002-pernr,

    begda like p0002-begda,

    endda like p0002-endda,

    vorna like p0002-vorna,

    nachn like p0002-nachn,

    end of it_p0002.

    data:begin of it_p0008 occurs 0,

    pernr like p0008-pernr,

    begda like p0008-begda,

    endda like p0008-endda,

    ansal like p0008-ansal,

    bet01 like p0008-bet01,

    preas like p0008-preas,

    end of it_p0008.

    parameters:p_pernr like p0002-pernr.

    start-of-selection.

    CALL FUNCTION 'HR_READ_INFOTYPE'

    EXPORTING

    pernr = p_pernr

    infty = '0002'

    TABLES

    infty_tab = it_data.

    if sy-subrc eq 0.

    it_p0002-pernr = it_data-pernr.

    it_p0002-begda = it_data-begda.

    it_p0002-endda = it_data-endda.

    it_p0002-vorna = it_data-vorna.

    it_p0002-nachn = it_data-nachn.

    append it_p0002.

    clear it_p0002.

    endif.

    CALL FUNCTION 'HR_READ_INFOTYPE'

    EXPORTING

    pernr = it_data-pernr

    infty = '0008'

    BEGDA = it_data-begda

    ENDDA = it_data-endda

    TABLES

    infty_tab = it_data1.

    if sy-subrc eq 0.

    it_p0008-pernr = it_data1-pernr.

    it_p0008-begda = it_data1-begda.

    it_p0008-endda = it_data1-endda.

    it_p0008-ansal = it_data1-ansal.

    it_p0008-bet01 = it_data1-bet01.

    it_p0008-preas = it_data1-preas.

    append it_p0008.

    clear it_p0008.

    endif.

    sort it_p0002 by pernr begda.

    read table it_p0002 index 1.

    write:/ it_p0002-pernr,it_p0002-begda,it_p0002-endda,it_p0002-vorna,it_p0002-nachn.

    sort it_p0008 by pernr.

    read table it_p0008 with key pernr = it_p0002-pernr.

    write:/ it_p0008-pernr,it_p0008-begda,it_p0008-endda,it_p0008-ansal,it_p0008-bet01,it_p0008-preas.

    sort it_p0008 by pernr.

    read table it_data1 index 2 .

    write:/ it_data1-ansal.

    regards,

    venkat.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 19, 2008 at 01:42 PM

    HR_READ_INFOTYPE

    pernr1 = pernr-pernr.

    call function 'HR_READ_INFOTYPE'

    exporting

    • TCLAS = 'A'

    pernr = pernr1

    infty = '0001'

    • BEGDA = '18000101'

    • ENDDA = '99991231'

    • BYPASS_BUFFER = ' '

    • LEGACY_MODE = ' '

    • IMPORTING

    • SUBRC =

    tables

    infty_tab = It_p0001 <-- like p0001 structure

    • EXCEPTIONS

    • INFTY_NOT_FOUND = 1

    • OTHERS = 2

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Mar 19, 2008 at 01:46 PM

    Hi,

    Please refer code below:

    CALL FUNCTION 'HR_READ_INFOTYPE'
             EXPORTING
    *          TCLAS                 = 'A'
               pernr                 = wa_repdata-staff_id "PERNR- Personnel number
               infty                 = '0002'  "Info type
    *          BEGDA                 = '18000101' "Begin date
    *          ENDDA                 = '99991231' " End date
    *          BYPASS_BUFFER         = ' '
    *          LEGACY_MODE           = ' '
    *        IMPORTING
    *          SUBRC                 = 
             tables
               infty_tab             =  p0002
            EXCEPTIONS
              INFTY_NOT_FOUND       = 1
              OTHERS                = 2.
    

    Thanks,

    Sriram Ponnna.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.