Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

[HR] problem with PERNR and all that HR stuff

Hi. I try to understand developing HR module but I have to admit that it brings me some problems. How should I understand that code:

REPORT zsuo_hr_prumer .
TABLES: pernr, zhr_prumery.
NODES: payroll TYPE pay99_result.
DATA: wa_rt LIKE LINE OF payroll-inter-rt.
DATA mylist LIKE  pc261 OCCURS 0 .
DATA wa_mylist LIKE LINE OF mylist.
DATA pay TYPE REF TO cl_pay.

DELETE zhr_prumery.
COMMIT WORK AND WAIT. "<<<---  pernr has value :|

GET pernr.

GET payroll.
*  sort payroll-inter-rt by pernr.

  READ TABLE payroll-inter-rt WITH KEY lgart = '/0T1' INTO wa_rt.
  IF sy-subrc = 0.

    zhr_prumery-pernr = pernr-pernr.
    zhr_prumery-prumer = wa_rt-betpe.
    MODIFY zhr_prumery.


I assume that pernr is sth like 'object' that represents single person and GET pernr collects particular info about that person. Am I right?

What in that case is the function of 'GET payroll'? Are there only 'payroll-objects' connected with recent pernr searched?

I observe that GET pernr makes a loop, reading all pernr objects. It takes a long minute to complete that. Is there some method to restrict number of processed people?

And thing which is very misterious for me. When I debug code - the pernr has value before 'GET pernr' line, value is given in 'COMMIT WORK AND WAIT' line 8-| WHY?

I'm really confused so please be patient Greetings. P.

Not what you were looking for? View more on this topic or Ask a question