cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP HR: How to read Payroll Simulation through program

0 Kudos

Hi,

We need to compare the employee salary for the last month with current month simulation. If comparison is successful then Payroll will be run for the current month.

Is there any way to read the payroll simulation data.

Thanks in advance...

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Payroll simulation does not create any clusters meaning that you have no way of comparing the results. Depending on the real requirement, here are some avenue you could take:

1- Just create a payroll rule that would compare the current with the previous salary and output a message.

2- You could also create a custom function that would output what you want to compare into a custom table... You then can have a program that would do the compare.

There are other solutions you could think of based on the two (2) I gave you.

Regards,

Serge

Former Member
0 Kudos

Do you want to compare in payroll driver or in Zprogram

Former Member
0 Kudos

if you are comparing with Z program use

Hr_get_payroll_results function module to get results.

If you wan to compare in STD code

Go to HINCALC0 find your user exit where to compare and do logic there. I kept one model program to compare basic pay for previous month with current month ESI deductions. Kindly go through it and

get the idea.

select * from pa0008 INTO CORRESPONDING FIELDS OF TABLE it_0008
                       where pernr = pernr-pernr.

if sy-subrc eq 0.

LOOP at it_0008 into wa_0008 .
        pre_begda = wa_0008-begda - 1.
  read table it_0008 into wa_0008 with key endda = pre_begda.
   if sy-subrc eq 0.
   do 40 times varying lgart from wa_0008-lga01 next wa_0008-lga02
               VARYING a_betrg from wa_0008-bet01 next wa_0008-bet02  .
if lgart = '1002'.
  a_betrg = wa_0008-bet01 / 2.
   endif.

req_amt = req_amt + a_betrg.

     enddo.

     endif.
clear: lgart, wa_0008,a_betrg.
     endloop.

     endif.

Do this for Earning part and Deduction part.