Skip to Content
avatar image
Former Member

How to get data from Infotype

I have an infotype e.g nnnn which contains the basic salary and allowances for all employees.How can I get the data from infotype for a particular employee (by unique employee no)? Can I get the example code for understanding?

Regards,

Aisha Ishrat.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

8 Answers

  • Best Answer
    avatar image
    Former Member
    Jun 04, 2007 at 09:48 AM

    assign PNP ldb in your programe attributes and code like following

    tables : pernr,

    infotypes : 0000, 0001,0002,0004 .

    start-of-selection.

    get pernr.

    provide * from p000 between pn-begda and pn-endda

    • from p0001

    put your condition like where <.........>

    endprovide.

    or you also can get data if you dont want to use LDB.

    every info type will be associated with table

    ex if infotype is 0001 table name is p0001.

    so you can also write select statement .

    Thanks

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 04, 2007 at 09:54 AM

    Also you can use Function Module "HR_READ_INFOTYPE".

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 04, 2007 at 12:39 PM

    Here's an example code of FM HR_READ_INFOTYPE:

    DATA pernr TYPE pernr.
    INFOTYPES 0008.    "Your Infotype
    
    CALL FUNCTION 'HR_READ_INFOTYPE'
             EXPORTING
                pernr = pernr
                infty = '0008'  "Your Infotype
                begda = '18000101'
                endda = '99991231'
             TABLES
               infty_tab = p0008.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 05, 2007 at 11:21 AM

    Hi aisha,

    1. If u want to get data from infotype 0008,

    then its better to use the FM

    BAPI_BASICPAY_GETDETAIL

    regards,

    amit m.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 04, 2007 at 09:52 AM

    hi Alisha,

    u can use table,

    PA0008:basic Pay

    PA0009 Bank Details

    PA0015 Additional Payment

    pass PERNR (employee number) and u will get all information.....

    u can get details from table starting with PA*

    reward point if helpful,

    Regards,

    Imran

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 04, 2007 at 09:58 AM

    Hi

    see this sample code to fetch the salary details from INfotype pa0008.

    REPORT RPABAP06.

    TABLES:PERNR.

    INFOTYPES: 0008.

    DATA: BEGIN OF WAGETYPES,

    LGA LIKE P0008-LGA01,

    BET LIKE P0008-BET01,

    ANZ LIKE P0008-ANZ01,

    EIN LIKE P0008-EIN01,

    OPK LIKE P0008-OPK01,

    END OF WAGETYPES.

    GET PERNR.

    RP_PROVIDE_FROM_LAST P0008 SPACE PN-BEGDA PN-ENDDA.

    DO 20 TIMES VARYING WAGETYPES

    FROM P0008-LGA01

    NEXT P0008-LGA02.

    IF WAGETYPES-LGA IS INITIAL.

    EXIT.

    ELSE.

    WRITE: / WAGETYPES-LGA, WAGETYPES-BET.

    ENDIF.

    ENDDO.

    Reward points if useful

    Regards

    Anji

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 04, 2007 at 10:02 AM

    If we want to extract data from infotype 'nnn' (Ex : 0000,0001) then the data will be available in table PA or PB nnnn table, emp number as one of the key.

    Just write select quiery to extract data from PA/PB tables.

    All the very best to you.

    Regards

    -Mohan.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jun 05, 2007 at 11:15 AM

    I did this as follows:

    Report zinfo.

    tables pa0008.

    data : begin of f-tab occurs 0,

    annual-salary like pa0008-ansal,

    end of f-tab.

    select * from pa0008.

    f-tab-annual-salary = pa0008-ansal.

    append f-tab to f-tab.

    endselect.

    loop at f-tab.

    write f-tab-annual-salary.

    skip.

    endloop.

    Add comment
    10|10000 characters needed characters exceeded