Skip to Content

When I first started working with HR programming, I was really freaked out. Logical Databases? Payroll? Infotypes? First time, you get such a shock…the next time, you find that you love HR programming.

What we’re going to discuss here, is how get the payroll of an employee for a determined month, and that’s an important thing, trust me. Without payroll, the employees don’t get paid, and if they know that you are the developer and they didn’t get paid because of your app…you’re toast.

Anyway, don’t get scared I’m gonna try and help you out. I know that there is the usual way to read the payroll, I have used it quite a lot myself.

You must remember to include the logical database PNP and the selection screen 900

image

That’s great right? You have the payroll for a month, trimester or even for a year. But what happens when they tell you that, they want the payroll for a month to be compared against the payroll for 6 months back, month by month. That’s what happened to me. Of course, you’re not going to repeat that loop everytime for every month for every employee. You need something else, something like this.

With these two simple FM’s, your days of fighting with the payroll are gone.

P.S: It seems that i was forgot to put some important tables…Special thanx to prasanna venkatesh for making me noticed it -;)

To report this post you need to login first.

26 Comments

You must be Logged on to comment or reply to a post.

  1. Former Member
    Im trying to produce a payroll report which would compare the payroll results from the curent and the previous month aned produce a variance..

    is this report usefull in this case ?

    One more thing i keep getting this error when i try to run the report

    it says :

    The field PERNR is unkown but there is a field with a similar naME pnpPERNR.

    wHEN MUST BE THE FIRST STAETMENT AFTER A CASE STATEMENT

    (0) 
    1. Alvaro Tejada Galindo Post author
      Hi Ahmed:

      Remember that this is not a report, it’s just a couple of techniques to get the payroll up and running. Besides, they both works fine…i just have make at least 15 reports using them -;)

      About you error…Did you remember to set PNP as the logical database??? You must do that in the attributes of the program. Also, you must declare the PERNR variable…You just don’t don’t get it by default…You declare it as PA001-PERNR for example…

      Greetings,

      Blag.

      (0) 
    1. Alvaro Tejada Galindo Post author
      FPPER
           
      “The date on which the For-period payroll is valid”.

      INPER

      “contain information on the period in which payroll is run”.

      Greetings,

      Blag.

      (0) 
    1. Alvaro Tejada Galindo Post author
      Dear prasanna:

      Remember that this is not a program, is just couple of snippet codes to show some functionallity.

      For your error, you should include logical database PNP as you do…But also you must include SELECTION SCREEN 900 in the properties windows of the ABAP program.

      If you still have errors, please let me know. I have used those codes a hundred of times, but you never know…Sometime problems can arise -:)

      Greetings,

      Blag.

      (0) 
  2. Prasanna Balakrishnan
    Already i initialized the screen number(900).Now i run the program the same error’s are coming(the field pernr is unknown,but there is a field with the similiar name”pnppernr”).
    (0) 
    1. Alvaro Tejada Galindo Post author
      Are you including this tables???

      TABLES: RP50G,PERNR,PYORGSCREEN,PYTIMESCREEN.

      I guess i forget to put them on the source codes…You know…When you do the same thing that many times, you just do them without thinking -:P

      I’m going to fix the blog…And thanx for making me noticed it -;)

      Greetings,

      Blag.

      (0) 
  3. Former Member
    Hi Alvaro,

    I just want to mention  that you can retsrict the cluster XX reading to a few table that you will read instead of buffering all cluster data. You know that payroll data volume is huge and we often need only RT table results.

    So you can restrict your Cluster reading to table RT by doing following between events START-OF-SELECTION and GET PERNR:

    data: gs_object   TYPE char20,
          gt_objects  TYPE STANDARD TABLE OF char20.

      gs_object = ‘INTER-RT’.
      APPEND gs_object TO gt_objects.

      CALL FUNCTION ‘PYXX_SPECIFY_OBJECTS’
        TABLES
          specified_objects = gt_objects.

    Cheers,
    Anthony

    (0) 
  4. i am creating an HR Report using PNP LDB..
    my problem is that after taking values from get pernr..it again call back the get pernr after end-of-selection event …plz suggest
    (0) 
    1. Alvaro Tejada Galindo Post author
      Well…What I do is as following…

      *=======================================================================
      * End-of-selection
      *=======================================================================
      END-OF-SELECTION.
      PERFORM PRINT_REPORT.

      That way, when all the data is retrieved I just print it…

      I assumed that your problem is that when it calls again the GET PERNR you got some repeated data…right???

      Greetings,

      Blag.

      (0) 
  5. Adel Yacoubi
    Thanks for your blog its really interessant.
    I m a junior abap programmer.for my first project in abap i have to program an application for payroll.
    Do you have some other documents about the pnp ldb?
    How to change text/label of a screen-field?
    how i can add fields to the screen of pnp but not at the end of the screen ?

    Regards,

    (0) 
    1. Alvaro Tejada Galindo Post author
      Hi Adel:

      Actually…What you see on my blog is what I know…I never need to include new fields or change the labels or texts…So I didn’t take time to learn it…You can check all the info of a LDB on SE36 transaction…

      Greetings,

      Blag.

      (0) 
    2. Former Member
      1.How to change text/label of a screen-field?
      By using the function call ‘SELECTION_TEXTS_MODIFY.
      2.How i can add fields to the screen of pnp but not at the end of the screen?
      You cannot do that without modifying the Std SAP code. I wouldn’t attempt that unless it is absolutely necessary.
      (0) 
  6. Former Member
    hi experts,
    i am new to hr abap. could any boduy help me with the code to my requirement.
    my requirement:
    “This Report will be run monthly after running payroll; this report should be able to generate the flat file for bank transfer data.”

    =>Report will be use the logical database PNP to get employee salary data in payroll cluster database.
    =>The user should select payroll area and payroll period and only select all employee under that payroll area.

    please could any body help me with the code.

    thanks in advance

    (0) 
  7. Former Member
    hi experts,
    i am new to hr abap. could any boduy help me with the code to my requirement.
    my requirement:
    “This Report will be run monthly after running payroll; this report should be able to generate the flat file for bank transfer data.”

    =>Report will be use the logical database PNP to get employee salary data in payroll cluster database.
    =>The user should select payroll area and payroll period and only select all employee under that payroll area.

    please could any body help me with the code.

    thanks in advance

    (0) 
  8. Former Member
    could any body .
    please send me suiable code for the below requirement.

    This Report will be run monthly after running payroll; this report should be able to generate the flat file for bank transfer data
    Report will be use the logical database PNP to get employee salary data in payroll cluster database.
    The user should select payroll area and payroll period and only select all employee under that payroll area.

    Thanks in advance.

    (0) 
  9. Former Member
    Hi friend, I have a issue in payroll, when i’m trying to post payroll results to FI/CO, im getting a error ‘payroll results could not import from database’, please help me.

    please send me the solution, my email id is jkbodla@yahoo.co.uk

    (0) 
  10. Former Member
    Payroll results are not easly acessed by the viewers as they are being stored in clusters.

    We Have to Create Payroll infotype and than have to fill wid the payroll results. After that we can use that payroll infotype in SQ01 using the logical database PNPCE.

    Details steps are given below

    Creating Simulated Payroll Infotypes

    •     Define Evaluation Wage Types

    Access the activity using one of the following navigation options:
    IMG Menu     Personnel Management   Human Resource information System  Payroll Results    Define Evaluation Wage Types
    Transaction Code     SPRO

    •     Assign Wage Types

    Access the activity using one of the following navigation options:

    IMG Menu     Personnel Management   Human Resource information System  Payroll Results   Assign Wage Types
    Transaction Code     SPRO

    Set Up Payroll Infotypes
    Access the activity using one of the following navigation options:

    IMG Menu     Personnel Management   Human Resource information System  Payroll Results    Set Up Payroll Infotypes
    Transaction Code     SPRO

    Generate The Payroll Infotypes

    Set Up Assignment to Payroll

    Access the activity using one of the following navigation options:

    IMG Menu     Personnel Management   Human Resource information System  Payroll Results    Set Up  Assignment to payroll
    Transaction Code     SPRO

                                                                                                                                                                      Fill the Payroll Infotypes with Payroll Data
    ( With Report RPABRI00)

    Access the activity using one of the following navigation options:

    Menu     System  services  Reporting
    Transaction Code     SE38

    By running report H99_DISPLAY_PAYRESULT
    We can have the overview of payroll results.

    Regards,

    Kapil Kaushal
    SAP HCM Consultant/Trainer

    (0) 

Leave a Reply