В системе есть стандартная программа пример в которой для чтения результатов расчета зарплаты используется операция GET PAYROLL
Название программы:EXAMPLE_PNP_GET_PAYROLL
Ниже исходный код программы:
*********************************************************************** * EXAMPLE Report EXAMPLE_PNP_GET_PAYROLL * * PNP: New event: GET PAYROLL for access to payroll results * * * * Use '900' as selection screen (report attributes) * * * * The selection screen can be customized by assigning a PNP payroll * * reportclass to this report (the default is PY_DEF): Go to -> * * report properties -> Button HR reportclass -> check the box "Payroll* *-reportclass -> Press create to enter the customizing view. * * * * 4.6C VRM Small changes * * * * 4.6A VRM New report * * * *********************************************************************** REPORT EXAMPLE_PNP_GET_PAYROLL. * These three tables need to be declared for the selection screen-. * Currently, the declarations of pyorgscreen, pytimescreen HAS to * be done in addition to setting selection screen = 900 . * Declare the country specific structure: * payXX_result with XX = country code, e.g. payDE_result for Germany * Country = 99 is an exception: If this structure is used, the * international part of every payroll result is returned regardless * of country code. In the other case, pernr's whose country code do * not fit the structure are skipped. NODES: payroll TYPE pay99_result. * this section is example specific * Declarations for modifying the result list after GET PERNR * nothing to do here *---------------------------------------- GET pernr. * A progress indicator based on the number of pernrs processed / total * number of selected pernrs is automatically calculated & displayed. g_result_counter = 0. * The infotypes could be accessed here as in any other PNP * based report. The same holds true for the infotype based * authorizations. * You can use the methods of class "pay" to read and modify * the list of payroll result that is going to be processed at * the <get payroll> event. However, these method calls might * change with the next release. CREATE OBJECT pay. * pay->LDB = 'SAPDB_MY_OWN_LDB'. "only if you copied the LDB PNP CALL METHOD pay->read_result IMPORTING list = mylist. "delete mylist index 2. "For example: Remove an unwanted payroll result CALL METHOD pay->write_result EXPORTING list = mylist. *-------------------------------------- * After all payroll results for ONE pernr are processed, the event GET * LATE is triggered. A good place to e. g. sum up results. pernr-pernr. 'No results ? Did you assign the right structure to node PAYROLL?'(024). *-------------------------------------- GET payroll. * At the event <payroll> the complex struture payroll is filled * with the payroll result for the specific person. The structure * of payroll is as declared above. g_result_counter = g_result_counter + 1. * Print some parts of the result (ignore splits for simplicity) 'In period ='(015), payroll-inter-versc-inper, 'For period ='(016), payroll-inter-versc-fpper, 'Pay date ='(017), payroll-inter-versc-paydt. 'Sub Area ='(019), wa_wpbp-btrtl. WHERE sprsl EQ sy-langu AND molga EQ payroll-inter-versc-molga AND lgart EQ wa_rt-lgart. t512t-lgtxt, wa_rt-betrg CURRENCY payroll-inter-versc-waers. WHERE sprsl EQ sy-langu AND molga EQ payroll-inter-versc-molga AND lgart EQ wa_crt-lgart. t512t-lgtxt, wa_crt-betrg CURRENCY payroll-inter-versc-waers.