HR Reporing Payroll using Logical Database PNPCE

Hi ALL
Can any body explain me how can we do HR Payroll reporing using logical database PNPCE.
In the program attibutes as mentioned we need to scee 900 for payroll reporting, but when I use PNPCE I cant see that screen in the Dropdown.
can any body help me with this.
regards
AJ

check this program..
REPORT    ZHR_PAYROLL_EX1
           MESSAGE-ID ZZ
           LINE-SIZE 132
           LINE-COUNT 64(2)
           NO STANDARD PAGE HEADING .
              T A B L E S                                            *
TABLES    : PA0001 ,        "Infotype 0001
             PCL1,           "HR Cluster 1
             PCL2,           "HR Cluster 2
             T549A,          "Payroll Accounting Areas
             T549Q.          "Payroll Periods
              I N C L U D E S                                        *
*--Standard Include for US Payroll
INCLUDE RPC2RUU0.            "Cluster RD data definition
INCLUDE RPC2CD00.            "Cluster CD Data-Definition
INCLUDE RPC2CA00.            "Cluster CA Data-Definition
INCLUDE RPC2RX00.            "Cluster RF data definition internat. part
INCLUDE RPPPXD00.            "Data definition buffer PCL1/PCL2
INCLUDE RPPPXD10.            "Common part buffer PCL1/PCL2
INCLUDE RPPPXM00.            "Buffer handling routine
                INTERNAL TABLES
*Internal Table to Hold data from PA0001
DATA : BEGIN OF I_0001 OCCURS 0,
          PERNR LIKE PA0001-PERNR,  "Personnel Number
        END OF I_0001.
*Internal Table to Hold data from PA0001
DATA : BEGIN OF I_FINAL OCCURS 0,
          PERNR LIKE PA0001-PERNR, "Personnel Number
          GAMNT LIKE PC207-BETRG,  "Gross Amount
          NTAMT LIKE PC207-BETRG,  "Net Amount
          PAYDT LIKE PC261-PAYDT,  "Pay Date
          RUNDT LIKE PC261-RUNDT,  "Run Date
          VORNA LIKE PA0002-VORNA,  "First Name
          NACHN LIKE PA0002-NACHN,  "Last Name
        END OF I_FINAL.
*Internal Table to Hold data from PA0002
DATA : BEGIN OF I_0002 OCCURS 0,
          PERNR LIKE PA0002-PERNR,  "Personnel Number
          VORNA LIKE PA0002-VORNA,  "First Name
          NACHN LIKE PA0002-NACHN,  "Last Name
        END OF I_0002.
Control record type
TYPES     : BEGIN OF T_T569V,
               ABKRS    LIKE T569V-ABKRS, "Personnel Area
               PABRJ    LIKE T569V-PABRJ, "Accounting year
               PABRP    LIKE T569V-PABRP, "Accounting period
               STATE    LIKE T569V-STATE, "Status of Control Record
               ADRUN    LIKE T569V-ADRUN, "HR: Special payroll run
             END   OF T_T569V.
                  STRUCTURES
DATA : WA_T569V TYPE T_T569V.    " Work area for t569v
                 DATA
DATA : V_PABRJ  LIKE T569V-PABRJ,  "Accounting year
        V_PABRP  LIKE T569V-PABRP,  "Accounting period
        V_BEGDA  LIKE SY-DATUM,     "Begin Date
        V_ENDDA  LIKE SY-DATUM,     "End Date
        V_FPPER(6) TYPE C,          "For Period
        V_SEQNR  LIKE PC261-SEQNR.  "Sequence Number
   SELECTION SCREEN
Selectio Screen Block for Employee Selection.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
SELECT-OPTIONS : S_PERNR FOR PA0001-PERNR, "Pernr
                  S_DATE  FOR SY-DATUM.     "Date
SELECTION-SCREEN END OF BLOCK B1.
   START-OF-SELECTION
START-OF-SELECTION.
*Get Data from pa0001
   PERFORM GET_DATA_FROM_0001.
*Get Data from pa0001
   PERFORM GET_DATA_FROM_0002.
*Get CHAD Details
   PERFORM GET_PAYDATA.
   END-OF-SELECTION
END-OF-SELECTION.
   IF NOT I_FINAL[] IS INITIAL.
*Print the Final Report.
     PERFORM PRINT_REPORT.
   ENDIF.
                T O P  O F  P A G E
TOP-OF-PAGE.
Display Header
   PERFORM DISPLAY_HEADER.
                S U B - R O U T I N E S
*&      Form  get_data_from_0001
      Get Data from 0001
FORM GET_DATA_FROM_0001.
   SELECT PERNR                     "Personnel Number
          FROM PA0001
          INTO TABLE I_0001
          WHERE PERNR IN S_PERNR AND
                ENDDA >= S_DATE-LOW AND
                BEGDA <= S_DATE-HIGH .
   IF SY-SUBRC = 0.
     SORT I_0001 BY PERNR.
   ENDIF.
ENDFORM.                    " get_data_from_0001
*&      Form  get_data_from_0002
      Get Data from 0002
FORM GET_DATA_FROM_0002.
   SELECT PERNR                     "Personnel Number
          VORNA
          NACHN
          FROM PA0002
          INTO TABLE I_0002
          WHERE PERNR IN S_PERNR AND
                ENDDA >= S_DATE-LOW AND
                BEGDA <= S_DATE-HIGH .
   IF SY-SUBRC = 0.
     SORT I_0002 BY PERNR.
   ENDIF.
ENDFORM.                    " get_data_from_0002
*&      Form  populate_chad_coinage_table
      text
FORM GET_PAYDATA.
   LOOP AT I_0001.
     READ TABLE I_0002 WITH KEY PERNR = I_0001-PERNR BINARY SEARCH.
     IF SY-SUBRC = 0.
       I_FINAL-VORNA = I_0002-VORNA.
       I_FINAL-NACHN = I_0002-NACHN.
     ENDIF.
Read Result Directory for Payroll Results for a Employee.
     PERFORM CU_READ_RGDIR.
Get Sequence Number & Associated Payroll Results.
     PERFORM GET_PAYROLL_RESULTS.
   ENDLOOP.
ENDFORM.                    " get_paydata
*&      Form  cu_read_rgdir
      Reag rgdir to get the results with conty grouping 'TD'
FORM CU_READ_RGDIR.
   DATA : V_MOLGA  LIKE T500L-MOLGA ."Country Grouping
*Call function module to get Results
   CALL FUNCTION 'CU_READ_RGDIR'
     EXPORTING
       PERSNR          = I_0001-PERNR
     IMPORTING
       MOLGA           = V_MOLGA
     TABLES
       IN_RGDIR        = RGDIR
     EXCEPTIONS
       NO_RECORD_FOUND = 1
       OTHERS          = 2.
   SORT RGDIR BY SEQNR.
ENDFORM.                    " cu_read_rgdir
*&      Form  get_payroll_results
      Get Sequence number
FORM GET_PAYROLL_RESULTS.
   LOOP AT RGDIR WHERE   SRTZA = 'A' AND
                     VOID IS INITIAL AND
                     REVERSAL IS INITIAL AND
                     OUTOFSEQ IS INITIAL AND
                     PAYDT    IN S_DATE.
     V_SEQNR = RGDIR-SEQNR.
*-- Macro Call for Germany
     RP-INIT-BUFFER.
     RX-KEY-PERNR = I_0001-PERNR.
     RX-KEY-SEQNO = V_SEQNR.
     RP-IMP-C2-RU.
     LOOP AT RT WHERE LGART = '/559'.
       I_FINAL-PERNR = I_0001-PERNR.
       I_FINAL-GAMNT = RT-BETRG.
       I_FINAL-PAYDT = RGDIR-PAYDT.
       I_FINAL-RUNDT = RGDIR-RUNDT.
       APPEND I_FINAL.
       CLEAR  I_FINAL.
     ENDLOOP.
   ENDLOOP.
ENDFORM.                    "get_payroll_results
*&      Form  display_header
      Display Header
FORM DISPLAY_HEADER .
   FORMAT COLOR 1.
   ULINE.
   WRITE:/1 SY-VLINE,
         (15) 'Empl Number',
         SY-VLINE,
         (20) 'First Name',
         SY-VLINE,
         (20) 'Last Name',
         SY-VLINE,
         (15) 'Pay Date',
         SY-VLINE,
         (15) 'Run Date',
         SY-VLINE,
         (25) 'Gross Amount',
         132 SY-VLINE.
   ULINE.
   FORMAT COLOR OFF.
ENDFORM.                    " display_header
*&      Form  print_report
      Display Report
FORM PRINT_REPORT .
   LOOP AT I_FINAL.
     WRITE:/1 SY-VLINE,
           (15) I_FINAL-PERNR,
           SY-VLINE,
           (20) I_FINAL-VORNA,
           SY-VLINE,
           (20) I_FINAL-NACHN,
           SY-VLINE,
           (15) I_FINAL-PAYDT,
           SY-VLINE,
           (15) I_FINAL-RUNDT,
           SY-VLINE,
           (25) I_FINAL-GAMNT,
           132 SY-VLINE.
     ULINE.
   ENDLOOP.
   SKIP 2.
   WRITE:/1 'Period Begin Date:',(25) V_BEGDA.
   WRITE:/1 'Period End   Date:',(25) V_ENDDA.
ENDFORM.                    " print_report

Similar Messages

  • Logical Database PNPCE and inherited Sub Area

    Hi,
    I have asked this in the HR forum but no response......
    I have a report using Logical Database PNPCE to find some values from a couple of info types. When I select a unit (from the 'OrgStructure' button at the top of the screen), say 111, and all its sub-units with no selections in the selection screen, I get one person displayed. This is correct and this person is in a sub-unit 3 levels down (unit 333).
    I then added a selection to only display people in units with Personnel SubArea 'OTEC'. Now I get no results output. When I look in PPOME, I can see that unit 333 has Personnel SubArea 'OTEC' but it is inherited from '111'.
    In PP01, unit 111 has an Account Assignment entry (Info Type 1008) but 333 does not.
    Does anyone know how to report on this?
    Is there a flag somewhere that tells the LDB to check for inherited units?
    If not, any ideas if there is a function out there to find the superior unit for these sub-units?
    Thanks.

    Thanks,
    I am aware of that FM but how do I find the parent unit in a clever fashion?
    The structure could have multiple levels e.g.
    Unit 1 - Unit 2a - Unit3a......
           - Unit 2b
           - Unit 2c
    Unit 1 is the parent and all the below units inherit from it.
    The LDB is looping through an internal table with a list of the units. It finds Unit 1 but not the rest.
    So, when the LDB is looking for Unit 3a, how does it know that Unit 1 is the parent?
    If I use that FM, I think I would have to look for all units above it and see if there is an Info Type 1008 exists. Seems like a lot of processing for something that should be simple?
    Kroc.

  • Logical database PNPCE

    Hi
      I have created a custom OM infotype 9910 which will data with Object ID either 'O' (Org Unit) or S (Position) .
    I am using Logical database PNPCE in my report. I have declared the infotype at the declaration part with infotypes 9910 statement
    When the get peras event is triggered in program the table p9910 is not filled with values even though there is record in HRP9910 with Object ID 'S' for the employee position who i am interested in.
    I think there is some link missing. For the OM infotype records to be filled during get peras event do i need to give any other selection value like evaluation path or i have to use a different event. Please advice
    Suitable answers will be rewarded
    Thanks,
    Kasi

    I don't think PNPCE does anything with HRP infotypes.  PNPCE is all about PA data since PERNR is the main key.  Logical DB PCH is the one that deals with HRP Infotypes.

  • Custom selection field using Logical database

    Hi All,
    I have to create a program that would print out employee contracts from infotype 16.
    I am using logical database PNPCE.
    Is there a way to add "contract type" as a selection parameter in the screen that is generated by PNPCE?
    Thanks,
    ~Mark

    Hi,
    Create CTTYP(Contract type) as input parameter in the program.
    Then after GET PERNR.
    write check stmt for that field like below.
    PARAMETERS: p_cttyp type p0016-cttyp.
    GET PERNR.
    CHECK p0016-cttyp EQ p_cttyp.
    Rewards points if helpful.
    Regards,
    Srinivas Ch

  • Logical Database (PNPCE) , selection screen hide.

    Hi Gurus,
             i have couple of questions related to logical database pnpce.
    1.Since i know logical database has there own selection screen , my requirement is i want to add my custom fields to the selection screen other than what is provided is it possible or not.
    2. i want to hide the selection screen of the logical database, but i do want to create my own in which i will be declaring some select options of the standard logical database screen has, like pernr, organisation unit, etc, how do i communicate the entered data with the logical database if i dont use the logical database standard selection screen, hope i could able to explain my problem, please see into my problem and let me know thanks in advance,
    hussaini

    Hussain,
    LDB have standard selection screens, if at all you want to customize those standard selection screen you would have to define a report category for your program. You`ll have to configure in the spro settings for your corresponding report category.
    If you would like to declare your own selection criteria, you can very well do it and these criteria are visible below the standard selection criteria. You can process these elements in your program and not in the LDB standard program. Use the normal selection screen events in your program for processing your selection criteria.
    Hope this info is helpful, reward points if convinced.
    Regards

  • How to use Logical database in function module?

    I will create a function module in HR.
    but how to use Logical database  in function module ?  Logical database PNP always show screen.in function (RFC) code , it is a matter.

    You cannot attach the LDB to the main program of the function group.
    - So you may [SUBMIT|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=submit&adv=false&sortby=cm_rnd_rankvalue] a report which use the LDB and get back the data (export/import), by default in the syntax of SUBMIT the selection-screen will not be displayed
    - Use [LDB_PROCESS|https://www.sdn.sap.com/irj/sdn/advancedsearch?query=ldb_process&cat=sdn_all], fill a structured table for selection, and get data back in another table
    - Use [HR function modules to read Infotypes|https://www.sdn.sap.com/irj/sdn/advancedsearch?cat=sdn_all&query=hrfunctionmodulestoread+Infotypes&adv=false&sortby=cm_rnd_rankvalue].
    Regards

  • How to pass a default value in selection screen of logical database pnpce

    Dear All,
    Can any one tell me how to pass a default value in selection screen of logical database pnpce .
    Regards
    Rakesh Singh

    Hi Rakesh,
    Go to SE36 (logical database Builder).First enter PNPCE in Logical Database and press documentation,here you will get the details of exactly what is PNPCE and how it works.After that select selections in subojects in se36 only and enter display ,there you have the include from where you acn get the idea.
    Regards,
    Rahul

  • How to retrieve data using logical database and custom select options

    Hi all,
    I have a selection screen which is displayed by logical database PSJ and I have two select options of my own. I need to retrieve data based on both selection screen of logical database and my own select options. How can I do it?
    Thanks in advance.

    Hai Gupta
    Check the following Document & Links
    1. A logical database is in fact
    a program only.
    2. This LDB provides two main things :
    a) a pre-defined selection screen
    which handles all user inputs and validations
    b) pre defined set of data
    based upon the user selection.
    3. So we dont have to worry about from
    which tables to fetch data.
    4. Moreover, this LDB Program,
    handles all user-authorisations
    and is efficient in all respects.
    5. tcode is SLDB
    good info about Logical Database. you can check the link.
    http://www.geekinterview.com/question_details/1506
    http://help.sap.com/saphelp_46c/helpdata/EN/35/2cd77bd7705394e10000009b387c12/frameset.htm
    Re: How to Create and Use ldb in reports?
    Re: Logical databases
    http://help.sap.com/saphelp_46c/helpdata/en/9f/db9bed35c111d1829f0000e829fbfe/frameset.htm
    Functions for displaying and changing logical databases:
    Call Transaction SE36 or
    Choose ABAP Workbench -> Development -> Programming environ. -> Logical databases
    Interaction between database program and report:
    During program processing, subroutines are performed in the database program and events are executed in the report.
    To read data from a database tables we use logical database.
    A logical database provides read-only access to a group of related tables to an ABAP/4 program.
    advantages:-
    The programmer need not worry about the primary key for each table.Because Logical database knows how the different tables relate to each other,and can issue the SELECT command with proper where clause to retrieve the data.
    i)An easy-to-use standard user interface.
    ii)check functions which check that user input is complete,correct,and plausible.
    iii)meaningful data selection.
    iv)central authorization checks for database accesses.
    v)good read access performance while retaining the hierarchical data view determined by the application logic.
    disadvantages:-
    i)If you donot specify a logical database in the program attributes,the GET events never occur.
    ii)There is no ENDGET command,so the code block associated with an event ends with the next event
    statement (such as another GET or an END-OF-SELECTION).
    1. transaction code SLDB.
    2.enter name z<ldb-name>
    3.create
    4.short text
    5.create
    6. name of root node (here Ekko)
    7. enter short text (f6)
    8.node type -> data base table.
    9.create
    10 change logical DB
    riht click on ekko and insert node
    here node name ekpo
    11.create
    12. click on selections
    13. press no Should the changed structure of Z<ldb name> be saved first.
    14.select tables which you want to join.
    15.transfer
    16 now you have to o to coding part.
    17. save
    activate.
    19.click to src code
    double click on first include and activate
    Regards
    Sreeni

  • How to extend dynamic selection for Logical Database PNPCE

    Hi All,
    I need to extend dynamic selection for Logical Database PNPCE. Can someone able to help with steps?
    Thanks
    Ranjith

    Hi All,
    I need to extend dynamic selection for Logical Database PNPCE. Can someone able to help with steps?
    Thanks
    Ranjith

  • How to inactivate the 'Complex Search' button when using Logical Database

    Hy experts
    I m using Logical Database for a select and you know that for an GET event by default in selection screen it appears some selection fields for every GET event..I manage to hide the ones that don't interest me but I have a little problem: I have a button that's called 'Complex Search' and I don't know how to get rid of this button..
    Here is some code:
    AT SELECTION-SCREEN OUTPUT.
      LOOP AT SCREEN.
    IF screen-name CP '%BT02010_BLOCK_1000'.
          screen-input = '0'.
          screen-active = 0.
          screen-invisible = 1.
          MODIFY SCREEN.
        ENDIF.
        IF screen-name CP 'QL_REFIL'.
          screen-input = '0'.
          screen-active = 0.
          screen-invisible = 1.
          MODIFY SCREEN.
        ENDIF.
    I do this for every screen-name in the program that doesn t interes me..but it seams that even if I comment all the button with 'Complex Search' remains..I mention that is a disperate solution to inactivate every screen element but I could not do other way..My bigest pb is the 'Complex Seach' button..can anyone help me?? pls.. <REMOVED BY MODERATOR> ..thx..
    Edited by: Alvaro Tejada Galindo on Feb 12, 2008 12:45 PM

    Thank you Thomas,
    I need some more from you...
    If I have 8 tables for 8 columns, then how do i proceed?
    Also could u tell me some query optimization techniques while working with intermedia text.
    Thanks you once again,
    waiting...
    Khaleel Hi Khaleel,
    I think this depends on your data model (relationship between the tables) and how you like to search later.
    The optimization begins also with the create index statement (memory clause and storage clause).
    If you like me to help I need more information about your hardware, os, datamodel and what kind of searches you will have later.
    Cheers,
    Thomas

  • Using logical database to fetch data in Module Pool programming

    I am unable to use logical database to fetch data in case of Module pool programming. Has anyone ever faced problems with it...?

    use f.m LDB_PROCESS....
    refer demo program DEMO_LOGICAL_DATABASE

  • Query using logical database

    Hi,
    There is one query which is using logical database PNM. I have got one requirement to add one field in selection screen to filter the output. The field which is required to be displayed in selection screen to filter the data is from table mkal which is not present in logical database. Hence my question is, is it possible to add field from table which is not present in logical database? IF yes, please specify the procedure.

    Hi Jogeswara,
    Thanks for your inputs.
    But my question is, how can I filter the data which is being fetched by standard logical database. I cannot go inside the std. LDB and change internal tables of it. I tried coding in extras, but I think it works only if we want to add additional fields in output.
    At present, we are considering the option of creating a z LDB where we copy. std. LDB and also add the reqd. table which is not present in LDB.
    Is there any other option?
    Please provide your valuable inputs.
    Regards,
    Imran Kundan.

  • Can I use logical databases in a WebDynpro ABAP program?

    can I use logical databases in a WebDynpro ABAP program?
    I need to build a WDA screen that is similar to the SAPDBPNP selection screen (user can find the personnel number based on several criteria, such as last_name/first_name of the employee).  So it seems that the existing logical databases have already many nice features already built (like the selection screens, the logic behind the screens etc). So I was wondering if/how I can use them in my WDA application.

    Hello, Tiberiu.
    You cannot use LDB directly within your WDA programa. BUT, you can fetch results from this LDB by using FM LDB_PROCESS. This function module can be called anytime from any kind of ABAP program. But you will still have to create the screen, as it only processes data, not screens.
    Regards,
    Andre
    PS: Pls reward points if it helps.

  • Can I use logical databases in a WebDynpro for ABAP program?

    can I use logical databases in a WebDynpro ABAP program?
    I need to build a WDA screen that is similar to the SAPDBPNP selection screen (user can find the personnel number based on several criteria, such as last_name/first_name of the employee).  So it seems that the exisinting logical databases have already many nice features already built (like the selection screens, the logic behind the screens etc). So I was wondering if/how I can use them in my WDA application.

    Hi
    Please let me also know the solution to this. I am a beginner to WebDynpro  and want to know if I can make use of LDB's as we do in our normal HR programming do develop a WDA in HR.
    Thanks and regards,
    Uma.

  • Splitting "pernrs" in program that is using logical database

    Hello All,
           I have a HR program that uploads data from file into infotype 377. Everything works fine except if the file has like 20000 records the program is taking for ever to run! I am using logical database (GET PERNR) in the program. I populate my pnpindex with all pernrs from file for processing. Is there any way I can aplit pernrs (like 5000 each processing) so that I can speed up the process i.e, I want to process 5000 pernrs at a time. I tried to find solution here but no luck and I am out of ideas. If you happen to have any ideas on this, please let me know.
    Thanks.
    Mithun

    U need to code your program to run parallely ...
    look at the sample code at ..
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/interface%252bprogram%252bfor%252bmaterial%252bdata

Maybe you are looking for