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

HR-ABAP

Hi to all

Please tell me what id the meaning of following statement :

RP-READ-INFOTYPE PERNR 0002 P0002 <BEGIN> <END>

Also tell me how to fetch data from infotype and tables.

plz tell me the step by step procedure.

thanks & regards

Anubhav

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 23, 2007 at 06:14 AM

    Hi

    This is the Macro used in HR to fetch the data from a Infotype

    See the sample code for fetching data from Infotype

    1. PROVIDE * from PA0001......ENDPROVIDE

    this will fetch all data similar to select...endselect with in the given BEGDA and ENDDA dates

    2.If you attach a LDB like PNP then you use the MAcros and fetch the data using GET statement

    START-OF-SELECTION.

    GET pernr.

    rp_provide_from_frst p0000 space pn-begda pn-endda.

    if pnp-sw-found EQ '1'.

    READ TABLE p0001 WITH KEY pernr = p0000-pernr.

    if sy-subrc = 0.

    write : p0001-plans. " earliest.

    endif.

    endif.

    rp_provide_from_last p0014 space pn-begda pn-endda.

    if pnp-sw-found EQ '1'.

    READ TABLE p0014 WITH KEY pernr = p0000-pernr.

    if sy-subrc = 0.

    write : p0014-LGART. .

    endif.

    endif.

    Regards

    Anji

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 23, 2007 at 06:17 AM

    Create a program, link the program to the PNP logical database (SE38 -> Click Properties -> Logical Database -> PNP).

    In the very top line of your top-include or global data section put this instruction:

    INFOTYPES:

    And write all the numbers you need, for example:

    INFOTYPES: 0000, 0001, 0002, 0006, 0041.

    This will buffer those infotypes at runtime.

    After, put this line:

    TABLES pernr.

    In the section START-OF-SELECTION...END-OF-SELECTION put this instruction:

    GET pernr.

    You will see P* structures magically filled.

    If you want, you can read other records from Infotypes declared in global data section, using the macro:

    rp-read-infotype

    Or fetch the last/first record on a P* structure by using these:

    rp-provide-from-last

    rp-provide-from-first

    If you need only active employees, you can use this macro at INITIALIZATION section:

    rp-sel-ein-aus-init.

    This will force the system to check out only active employees.

    &----


    *& Report ZSR_HR_EX1

    *&

    &----


    *&

    *&

    &----


    REPORT ZSR_HR_EX1.

    .

    DATA : BOOLEAN(1) TYPE C.

    TABLES : PERNR.

    INFOTYPES : 0002,0006.

    START-OF-SELECTION.

    GET PERNR.

    RP-DEF-BOOLEAN .

    *write :/ pernr-pernr.

    RP-PROVIDE-FROM-LAST P0002 SPACE PN-BEGDA PN-ENDDA.

    IF PNP-SW-FOUND = 1.

    WRITE :/ P0002-PERNR, P0002-NACHN, P0002-VORNA.

    ENDIF.

    RP-PROVIDE-FROM-LAST P0006 '1' PN-BEGDA PN-ENDDA.

    END-OF-SELECTION.

    IF PNP-SW-FOUND = 1.

    WRITE :/ P0006-ORT01, P0006-LAND1, P0006-PSTLZ.

    ENDIF.

    use above logic and get data for remaining p0000,p0001,p0041 also

    How to get data from Infotype

    HR ABAP - urgent

    Look at the Link below

    http://www.sap-basis-abap.com/sapta010.htm

    Please give me reward points...

    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.