cancel
Showing results for 
Search instead for 
Did you mean: 

how to check a wage type is applicable for a payroll area

Former Member
0 Kudos

how to check a wage type is applicable for a payroll area,wt characterists is in hours.

Regards,

prasad

Accepted Solutions (0)

Answers (3)

Answers (3)

stephen_cottrell
Explorer
0 Kudos

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.

venkateshorusu
Active Contributor
0 Kudos

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

former_member193210
Active Contributor
0 Kudos

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.

former_member193210
Active Contributor
0 Kudos

I don't think that you can check by "Payroll Area", but you can check by Personnel Sub-Area Grouping and Employee Sub-Group Grouping (in table view V_511_B)