Hi,
Can any one give an idea of how to implement the fn. module HR_GET_PAYROLL_RESULTS as i tried giving the values for a already exisiting personnel from pc_payresult ,in the import parameters of function module and execute it iam not getting the results table but instead gives an error message
Exception WRONG_STRUCTURE_OF_RESULT_TAB
Message ID: RP Message number: 016
Message:
WRONG_STRUCTURE_OF_RESULT_TAB
Thanks in advance
Regards,
Sangram
Pl check the model report RPMUST01 in your system.
~Suresh
Hi Sangram,
See below code sample for reading payroll results for an employee in US
*select the max sequence number for the PERNR from directory
SELECT MAX( seqnr )
INTO w_seqnr
FROM hrpy_rgdir
WHERE pernr EQ w_pernr.
IF sy-subrc IS INITIAL.
**get the payroll results for the employee
CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT'
EXPORTING
employeenumber = w_pernr
sequencenumber = w_seqnr
clusterid = 'RU' "depends on for which country
CHANGING
payroll_result = i_payresult
EXCEPTIONS
illegal_isocode_or_clusterid = 1
error_generating_import = 2
import_mismatch_error = 3
subpool_dir_full = 4
no_read_authority = 5
no_record_found = 6
versions_do_not_match = 7
OTHERS = 8.
IF sy-subrc IS INITIAL.
*Get the CRT (cumulative results) table entries
i_crt[] = i_payresult-inter-crt[].
you can read the i_crt table with wage type (lgart) & cumty (yearly) and get the year to date amounts.
This is for US so the declaration of parameters are as follows
i_payresult TYPE payus_result,
i_crt TYPE TABLE OF pc208.
Cheers
Add a comment