cancel
Showing results for 
Search instead for 
Did you mean: 

Incorrect Attendance Bonus Calculation

Former Member
0 Kudos

Hello Experts,

I have a PCR to calculate the attendance bonus which is paid to the employees who work through the month without availing leaves and  without remaining absent (Unpaid absence/LWP).

The calculation of this bonus is based on the following formula

[(1000+1006+1016) / Total number of working days] * 2

Where 1000/1006 and 1016 are the wagetypes.

Unfortunately, my PCR is working even if the employee has not worked for the entire month. Requesting a help in correcting the same.

Below is my PCR

Harriss

Accepted Solutions (0)

Answers (2)

Answers (2)

sikindar_a
Active Contributor
0 Kudos

You have Given condition for paid , Unpaid absences and  issue is coming in Else condition , When you are saying employee not worked for entire month are you booking absence to the employee in what cases employee will not work for entire month other than paid and unpaid absence

Former Member
0 Kudos

Sikindar,

When the employee joins mid month (Say on 11 May). We cannot practice to book this employee as absent from 1 till 10 th May.

Harriss

sikindar_a
Active Contributor
0 Kudos

I am saying it is missed , Check with the E as stated by Tania (which i am talking  about Active and In active status of the Employee)

jagan_gunja
Active Contributor
0 Kudos

Do changes as below in addition to the above.  Note b means one blank:

1. Wherever you have in the PCRs op'ns as below

      ZERO=bRNA

      ADDWTb2005

   Result of the above op'ns: 

    If w/t 2005 had any of rate, number or amt, it would still exist in IT; you are just adding zero).

  

  replace with

      ZERO=b2005

This means w/t 2005 will have no rate, num nor amt, if there was any before. 

2. var VAR9 has no.of worked days in rate field.  As you require the total amt of w/t's 1000, 1006 & 1016 by the number of days added to the rate field.   So replace

     AMT/&bVAR9

   with

     RTE=&bVAR9

     DIVID ARA

Hope this helps.

br, JG

Former Member
0 Kudos

Just to reconfirm - for mid-month joinees, attendance bonus should not be calculated?

Former Member
0 Kudos

Tania,

The Baseline is: IT SHOULD BE CALCULATED ONLY FOR THOSE EMPLOYEES WHO WORK FOR ENTIRE MONTH, hence: Mid Month Joinees wont fulfill this condition as they join late n wont work for entire month.

To add upon: I have one more PCR tht checks this condition. Find below

Harriss

sikindar_a
Active Contributor
0 Kudos

The syntax of the PCR should be corrected

OUTWPPERSB Employee subgroup (2 Char)

**

ADDWT

G0

we have to mention Employee subgroups other than G0

Former Member
0 Kudos

Try changing ZAT6 as below:

1) Cut the entire part under PPPAR U under the sub node * ( Delete it from this sub node but ave it for reference to be used elsewhere).

2) Under PPPAR U subnode *, add :

PPPAR E  

*

(All the deleted lines from step 1 should be placed here)

E

ZERO= RNA

ADDWT 2005

Former Member
0 Kudos

Hello Tania,

I did the modifications as u had told. I have also changed AMT/26 to AMT/ VAR9 (as AMT/26 is hardcode and total working days is always unstable and cant be 26 days every month)

But when I run the PY, am being hit by an error in the log. Plz check below

I hope I have modified the PCR per ur suggestions. I have copied ZAT6 to ZAT7 and have done the modifications in ZAT7 and have inserted the same in schema in place of ZAT6.

Help PLz

Harriss

Former Member
0 Kudos

Change AMT/VAR9 to AMT/& VAR9

Former Member
0 Kudos

Oh, Am sorry Tania, I had to do it as AMT/& VAR9.

But even after correcting, yet the error persists.

Help

Harriss

Former Member
0 Kudos

Can you double click on processing and send a screenshot. Also send a screenshot of the PARTA & PARTT tables.

Former Member
0 Kudos

Also change RTE-TAXX**  to RTE-TAAX**

Former Member
0 Kudos

Tania,

Changed RTE-TAXX** to RTE-TAAX**, Yet the error repeats.

Below is the processing of the error for your perusal

Help

Former Member
0 Kudos

Where is this PCR called in the schema? Ensure it is after the PARTT function

Sanky
Active Contributor
0 Kudos

Hi,

Please share the PARTT and PARTA table details for this employee and where have you placed this PCR in the Payroll schema.

You have split the PCR in two parts.

After passing the value to variable VAR9 you have to cross check it's RTE with 0. Hence if VAR9 is greater than 0 then only proceed for further calculation else come out from the PCR.

ADDWT&VAR9

RTE=& VAR9

RTE?0

   *

     ADDWT *

   >

     AMT=  1000

     AMT+   1006

     AMT+  1016

    AMT*2

   AMT/& VAR9

   PRINT&

   ADDWT  2005

Regards,

Sankarsan

Former Member
0 Kudos

YES - Tania,

The PCR is called after PARTT in schema

Help

Harriss

Former Member
0 Kudos

Can you double click on PARTA & PARTT and send a screenshot? Am trying to understand why VAR9 becomes 0.

Former Member
0 Kudos

Hello Sankarsan

Per ur requirements: Sharing PARTT and PARTA

Harriss

Former Member
0 Kudos

Tania,

Sharing PARTT and PARTA

Harriss

Former Member
0 Kudos

Are you executing payroll for March 14 or is this a retro run? Send the screenshot from the same month where the error is thrown.

Former Member
0 Kudos

Tania,

Yes am running the PY for March. Because this is a DEV Server, am running the PY for only March.

And the error whihc I had sent u is also for the same month (As am running the payroll for only month)

Former Member
0 Kudos

I think I've understood why the error is thrown. VAR9 contains RTE field but not the amount field, whereas the wage type /001 contains the amount field.

So the Divide statement is looking for a value in Amount field of VAR9. Hence after the line RTE-TAAX**, add the below:

NUM=1

MULTI NRA

Former Member
0 Kudos

Tania,

I added NUM=1 and MULTI NRA below RTE-TAAX** and ran PY, But the error continues.

Harriss

Former Member
0 Kudos

Temporarily replace line AMT/& VAR9 with AMT/26. Then add a line PRINT VAR after this PCR and send a screenshot of the variable table.

Former Member
0 Kudos

Tania,

If I have made it correct?

I replaced AMT/& VAR9 with AMT/26.

Then in the schema of PY - I added a line PRINT VAR after PCR ZAT7

Ran the PY, and it shows a error again - It says the error is displayed in the Old Log, When I click on old log - Below is the error message

Help

Harriss

Former Member
0 Kudos

Could you delete PRINT & in your PCR?

Former Member
0 Kudos

Tania,

Apologies - The error was in NUM=1, I had mistakenly maintained spaces in a wrong way. Now since I have corrected the spaces and HAVE NOT DELETED PRINT&, The PY is running correctly but just to remind you - We have maintained AMT/26 instead of AMT/ VAR9. Which I dont want to hardcode as 26 is not stable for every month

As you had asked for: Sharing the screen capture of variable table.

And to add upon: The PY run is for March 2014 for a test employee who is present for the entire month (in other ways: who is not absent for any day)

Plz Help

Harriss

Former Member
0 Kudos

Ok, now we can see VAR9 contains the value 26. It should no longer give the Divide by Zero error. Replace AMT/26 with AMT/& VAR9 and check if it works.

Former Member
0 Kudos

Tania,

I checked with multiple scenarios  and I see that it is working pretty as of now .

But, there is something more I would be requesting you: We record time in IT2011. Now while I was testing, I checked for a month for which I have not maintained IT2011 but Att Bonus appears for that month also.

Meaning: I want to put a condition in the PCR in a way that the PCR should check if there is any data in IT2011, If yes then only proceed else dont (Reason being: The customer will regularly update IT2011 else it wont take any serious thought on that).

Help Plz

Harriss

sikindar_a
Active Contributor
0 Kudos

You Cant do that one directly (even check condition based on TEVEN table entries) in payroll Schema

Put a condition in Time schema like , if the there is no time in and time out (2011) pass value

10 to payroll schema via time wage type and if

Num=10 , if the statement is true our pcr should not work

(Since time schema runs every day you should change the PCR accordingly in Time Schema)

Former Member
0 Kudos

A few queries:

1) Do you want the system to check if there is an IT 2011 record for every day of the month or at least one day of the month? You will need to fix cutoff dates. You need to consider whether the updates in IT 2011 for what period of the month are done before that month's payroll. E.g. Time data from 16th of previous month to 15th of current month should be considered for current month's payroll.

This is something you will need to discuss with your client.

2) Are you using time evaluation?

Former Member
0 Kudos

Two more suggestions regarding your initial requirement:

a) Adding PPPAR E checks for entries during the month, likewise if you want to deactivate attendance bonus for mid-month separations, add a subnode for PPPAR A. You can follow the same process as we did for PPPAR E.

b) For the existing sub nodes E,B, U, the existing lines are ZERO=RNA ADDWT 2005

I think above ZERO=RNA, add a line ADDWT *.

This will ensure that the original wage type /001 (on which this logic gets processed) gets added to IT irrespective of whether or not the employee gets the attendance bonus.

Former Member
0 Kudos

Tania,

Here is my reply to your queries:

1. Am fine even if we check for atleast a entry in IT2011 ignoring sundays and public holidays (If the employee is present for entire month, then he will be having all d entries in IT2011, hence we can check one) OR if the number of entries in IT2011 = VAR9, then the PCR should work.

2. Yes - We do time eval every month before we run PY.

Let me know if you have any more queries -

Harriss

Former Member
0 Kudos

Hi Sikindar,

Do we have an option to put the condition in Time Schema?? or Do we need to design a PCR and insert in ?

The idea is correct but how do we proceed for the same?

Help

Harriss

Former Member
0 Kudos

Okay. You will need to make some changes in the Time evaluation schema. Which schema do you use?

Former Member
0 Kudos

Nice,

I use the copy of TM00.

Former Member
0 Kudos

Tania, Thanks for the suggestions.  I did check with mid month joinees (only Once I did though), I dont see any attendance bonus appearing on the employees payslip.

But your suggestions are considered. Will change the PCR accordingly and post it for your perusal. Will do this once we are done with the Time Schema tweaking..

Thanks

Harriss

Former Member
0 Kudos

Yes, it will work for mid-month joinees but what I suggested was for mid-month separated employees.

Former Member
0 Kudos

Oh Yah, Now I got it... Surely will do it once when we are done with narrowing the existing scenarios and making it work considering IT2011 entries,,,

Let me know what shud be done to the Time Schema to make it work the way I explained you in one of my earlier reply

Harriss

Former Member
0 Kudos

Try this:

1) Create a new wage type (you can copy the number wage type created earlier for public holidays, I think it was 1033). Ensure that this wage type is not checked for any cumulation class. Also remove this from direct entry in It 15 as this wage type will be internally calculated by time evaluation as the no. of days for which It 2011 exists.

2) Create a new PCR to be used in the time evaluation schema. You can copy any existing time PCR and change as below:

*

****

OUTTPORIGS

*

E

  OUTTPEXTIM

   N

   Y

      HRS=1

      ADDZLSnnnn  where nnnn is your new wage type

3) Call this new PCR in your time schema after TE10 PCR as below:

RTIP <new PCR> GEN

4) Execute time eval for any employee. Check the results using PT66, table ZL. Check that the wage type gets updated correctly with the number of days for which It 2011 exists.

5) Change your existing payroll PCR ZAT7 as below:

a) Instead of calling it based on /001 (I don't know why this was done), call it on the new wage type nnnn.

b) Above RTE=TADIVI, add:

AMT=1

MULTI ANA

ADDWT&nnnn where nnnn is your new wage type.

c) Cut all lines from ADDWT&VAR9 onwards & save for further use. Add:

AMT?& nnnn

*

  <paste all existing lines ADDWT&VAR9 onwards saved earlier>

<

  ZERO= RNA

  ADDWT 2005

Note that here we are comparing the no. of days for which entries exist in It 2011 with VAR9. If >= VAR9, then attendance bonus will be calculated, else it will not.

This will work under the assumption that all IT 2011 data for the month (say 26 working days) has been entered prior to executing that month's payroll. I still think that this is a challenge & all data may not be uploaded in time for payroll. I suggest you confirm that this is ok with your client.

Former Member
0 Kudos

Thanks Again Tania,

This is a huge work . I ll work on the configurations mentioned and design the PCR as u have written in ur reply. and keep you posted on the progress. But before that, I have 2 concerns:

1. Because the PCR compares entries in IT2011 with VAR9 and if VAR9>= then the PCR functions - My concern is: In IT2011, every attendance will have 2 entries (Viz: P10 (Clock in) and P20 (Clock Out)), SO I dont know how will the comparison will go?

2.  And - You have asked me to cope a wagetype - I can do that but connected to which you have also mentioned "Also remove this from direct entry in It 15 as this wage type will be internally calculated by time evaluation as the no. of days for which It 2011 exists". I request you to make me know how do I do this? n what exactly is this.

Meanwhile I ll get busy in to the designing part what you have mentioned. A big Thank again,

Harriss

Former Member
0 Kudos

1) The two entries (clock in & clock out) will be merged into one entry into TIP. Since we are reading TIP with the function RTIP, it will be processed once for each time pair.

2) After copying the wage type 1033, it will create an entry for the new wage type in V_t512z under infotype 15. You can delete the entry from here for the new wage type since we do not want it to be updated in any infotype.

Former Member
0 Kudos

Hello Tania,

I did everything the same way u guided me in your latest reply  and I guess and have done everything correct.

Here is my testing results.

TEST1:

I checked for an employee for whom IT2011 was not maintained. The results are per our expectations. Now Att Bonus wont come if IT2011 is not maintained (Earlier it was dispalying in payslips). Thanks for this.

TEST2:

I tested for an employee for whom IT2011 is maintained.

Step1 of Test2: Maintained IT2011

Step2 of Test2: PT60 LIVE Run. I see ZL displaying the number of days (Though the screen capture is from PT60 log but its a LIVE run)

Step3 of Test2: Ran PY for May 2015; Encountered with an error (Error capture screen is below). Like u had taught me earlier, checked the value of VWTCL for X020. For new WT1034, changed PC3 from 0 till 6 and ran PY on every change yet the Att Bonus dint appear. When the PC 3 was blank, I had encountered that error.

Help

Harriss

sikindar_a
Active Contributor
0 Kudos

When ever you get this error , please note this is due to processing calsses

X020 is your Rule

3 is your Processing class , check the value for the wage type 1034

Credits :- Tania D souza

Former Member
0 Kudos

Assign PC 3 =0 and then send a screenshot of processing of the PCR.

Former Member
0 Kudos

Tania,

PC3 maintained as 0 and below is the processing of the PCR

I hope I have designed the PCR per ur requirements/guidance

Guide Plz

Harriss

Former Member
0 Kudos

My mistake, change the last < sign to >. Which means it will compare VAR9(working days) with 1034(It 2011). If working days > It 2011, then it should not update attendance bonus.

Former Member
0 Kudos

Thumbs Up -

It worked this time Tania. Will have more testing and keep u posted,,,

Thanks Again

Harriss

Former Member
0 Kudos

Ok, one more suggestion. If you want these changes effective current month only(so that it does not affect attendance bonus calculation for past periods), create a PCR to check for period.

*

****

CMPER xxyy (where xx is the year & yy is the period number effective which you want this change)

*

SCOND= T IF

<

SCOND=F IF

Then before calling the revised attendance bonus PCR, add an IF:

IF <new PCR>

<call new attendance bonus PCR>

ELSE

<call old attendance bonus PCR>

ENDIF

Former Member
0 Kudos

YES Sikindar,

Tania has taught me this earlier. All credits goes to her ..

@Tania - Thanks a bunch.

Harriss

Former Member
0 Kudos

My pleasure!

Former Member
0 Kudos

Tania,

YOU SEEM LIKE A MASTER OF ALL GEEKS IN PCRs .

My bad .. Am zero literate in PCRs n Schema.. Gotta learn from u many a things.

Thanks for Suggestion # 2.. Considered tht too.. But first i ll focus on suggestion # 1 - Deactivating Att Bonus for Mid Month Retirees/Separations.

And to add in context to ur suggestion#1: is it still require?? Because our narrowing the PCR is any how checking IT11 n comparing with VAR9, Guess this can evade the processing of PCR as my guess says there will be mis-match here..

Waiting fr ur suggestion#3

Harriss

Former Member
0 Kudos

Haha! Yes I'm a geek for sure. But the speed at which you're picking stuff up is pretty commendable!

Good question regarding whther or not we need the mid-month separation check. Most likely, TADIVI will fetch the working days for the entire month irrespective of date of separation. If so, you are right, we don't need to incorporate this additional check. The best bet would be to test it out for any mid-month separation case & confirm.

Former Member
0 Kudos

Thanks Tania,

You been a big help ..

Closing the thread

Harriss