11-20-2007 12:25 PM
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.
ENDIF.
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.
11-20-2007 1:28 PM
This program use a logical database related to HR, so you have to look at program attributes to find the logical database and understand the logic beyond it.
Look at <a href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PYINT/PYINT_REPORTING.pdf">Evaluating the Payroll Results using Infotypes or the Logical Database</a> and <a href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/PAXX/PYINT_RMAC.pdf">Programming Utilities for the Logical Databases PNP and PAP</a>
Look also at <a href="http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCABA/BCABA.pdf">ABAP Programming (BC-ABA)</a> and search for logical database.
Regards