on 07-09-2015 7:52 AM
how to check a wage type is applicable for a payroll area,wt characterists is in hours.
Regards,
prasad
Hi,
It's very simple to do on input, it's just a small amount of code in a user exit (EXIT_SAPFP50M_002).
This is the PAI exit of the infotypes (PAI = Process After Input) and is triggered when a user presses enter or save on an infotype record.
All you need in this exist is code to read infotype 1, i.e:
* Get infotype 1
CALL FUNCTION 'HR_READ_INFOTYPE'
EXPORTING
pernr = innnn-pernr
infty = '0001'
begda = innnn-begda
endda = innnn-endda
TABLES
infty_tab = lt_p0001.
loop at lt_p0001 into ls_p0001.
exit.
endloop.
Then get the wagetype input from the infotype you're maintaining (infotype 15 in my example below):
CALL METHOD cl_hr_pnnnn_type_cast=>prelp_to_pnnnn
EXPORTING
prelp = innnn
IMPORTING
pnnnn = ls_p0015.
Then read a custom table where you've defined what wagetypes are applicable to what payroll area:
select single * from Z_CUSTOM_TABLE where abkrs EQ ls_p0001-abkrs AND lgart EQ ls_p0015-lgart.
if sy-subrc is not initial. "i.e. wagetype is not permissible for this payroll area
MESSAGE 'Wagetype not allowed for this payroll area' TYPE 'E'.
endif.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It can not be decided by Payroll area, It can be decided by ESG,EG,PA,PSG and allowance grouping.
We can qury payroll area in PCR and where we can do some calculations as we required.
Regards
Venkatesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As mentioned by Venkatesh, you can add a PCR in your Payroll Schema, where you will query the Wage Type and the Payroll Accounting Area.
If the WT comes from an Infotype, an other alternative is to ask an ABAP programmer to create the code that will make the check, either when the Infotype is checked or when it is saved.
If the WT comes from Time Evaluation, you could make the query through a PCR in Time Evaluation.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
7 | |
7 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.