Skip to Content
avatar image
Former Member

How to obtain PERNR list?

Hi,

Can any one help me find a logic to retrieve a list all the PERNR under a payroll area?...Thanks , Ragesh

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 16, 2008 at 11:34 AM

    Hi Ragesh,

    You can retrieve it by directly selecting it from PA0001 table.

    also have a look on the following blog:

    https://blogs.sap.com/?p=41375

    Hope this will help.

    Regards,

    Nitin.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 16, 2008 at 11:43 AM

    Hi Ragesh,

    The infotype for payroll status is PA0003. Write a select statement as follows :

    Select pernr 
        from pa0003
        into  itab
      where <cond>.

    Regards,

    Swapna.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 16, 2008 at 12:14 PM

    Hi Ragesh,

    You can use BAPI HR_READ_INFOTYPE for this purpose.

    For this, just go through the following thread:

    how-to-use-fm-hrreadinfotype

    Hope this will help.

    Regards,

    Nitin.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 16, 2008 at 12:31 PM

    Dear Rajesh ,

    You can use macro rp-imp-c2-cu to import the data from cluster PCL2.

    Here I have given sample code..Just have a look at it. I hope it will be useful .

    DATA: BEGIN OF RX-KEY. "Cluster Key

    INCLUDE STRUCTURE PC200.

    DATA: END OF RX-KEY.

    DATA: BEGIN OF RGDIR OCCURS 100.

    INCLUDE STRUCTURE PC261.

    DATA: END OF RGDIR.

    • table to store employee based on payroll area

    data : begin of itab_empdetails occurs 0.

    data : pernr like pa0001-pernr,

    ABKRS like pa0001-ABKRS.

    data : end of itab_empdetails.

    data w_fpper(6) type c. "For Payroll Period

    rp-imp-c2-cu.

    check rp-imp-cd-subrc = 0.

    clear rx-key.

    rx-key-pernr = itab_empdetails-pernr.

    • Fill internal tables from cluster results to be displayed

    loop at rgdir

    where fpper = w_fpper

    and inper = w_fpper

    and void is initial

    and abkrs in pnpabkrs.

    rx-key-seqno = rgdir-seqnr.

    rx-key-pernr = itab_empdetails-pernr.

    rp-imp-c2-in.

    • Successful import of cluster results

    • RETURN CODE FROM IMPORT.

    if rp-imp-in-subrc <> 0.

    continue.

    endif.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 17, 2008 at 03:38 AM

    Thank You all but i am still need of a solution . The Pernr has to be fetched from the cluster PCL2.

    A function module or any other logic should do .

    The code provided is showing syntax error.

    Edited by: ragesh venugopalan on Sep 17, 2008 5:39 AM

    Add comment
    10|10000 characters needed characters exceeded