We have customized payroll function for China which is used to calculate some accruals. The logic is that if it is retro calculation, we will read the previous payroll result without any change. However, recently when run for around 13000 employees, we found during retro calculation, some times, we miss some wage types in the payroll result. So we try to reproduce the problem, but the problem doesn't happen again when we run for single employee or even batch employees.
We use below program to read old payroll result
Code: Select all
SELECT SINGLE * FROM t500l INTO ls_w500l WHERE molga EQ i08_molga. lv_clustername = 'PAYxx_RESULT'. lv_clustername+3(2) = ls_w500l-intca. CREATE DATA lv_itemp_result_ref TYPE STANDARD TABLE OF (lv_clustername). CREATE DATA lv_wresult_ref TYPE (lv_clustername). ASSIGN lv_itemp_result_ref->* TO <itemp_result>. ASSIGN lv_wresult_ref->* TO <wresult>. * Get the last payroll result CALL FUNCTION 'HR_GET_PAYROLL_RESULTS' EXPORTING pernr = i08_pernr permo = i08_permo pabrj = lv_pabrj pabrp = lv_fabrp pabrj_end = lv_pabrj pabrp_end = lv_labrp actual = 'A' TABLES result_tab = <itemp_result> EXCEPTIONS no_results = 1 error_in_currency_conversion = 2 t500l_entry_not_found = 3 t549q_entry_not_found = 4 OTHERS = 5.
Please kindly advice. Thanks.