Recently I got to work on an interesting client requirement and wanted to share this information with rest of the SAP peeps. This is not the exact client requirement; I simplified it for this blog.
Scenario: Holiday pay is to be generated automatically via time evaluation for your employees on company holidays. Holiday pay hours are also included towards the weekly overtime calculation. Your company also has a holiday policy that states that employees will not get holiday pay hours in case of unpaid time before or after a company holiday.
Given this scenario, there may be certain instances where you need to recalculate/correct overtime, especially when unpaid time occurs after the company holiday. In this case, you would have already generated holiday hours and included them in the overtime calculation so you need to correct/recalculate.
SAP provides a function called GOTC (Get Overtime Correction) to handle this requirement. Whenever you call this function, time evaluation will stop processing for the current day and go back to the specified day in the past and start re-evaluation of time for each day until the current day. Be careful about the condition on which you want to trigger a recalculation and make sure it does not go into a recurring processing. How far back you want the system to go depends on the parameter you pass to the function. It also provides an option to pass a correction time type. This correction time type will be available as a day balance on the day when the re-evaluation starts.
Before I can explain it further, let’s assume that our work week is from Sat – Fri. Employee is on 5X8 schedule Mon – Fri and we are processing time data for the week of June 29th to July 5th. Now assume that Employee recorded 11 hours of regular time from Mon -Wed and enters an unpaid leave on Friday for 8 hours.
Time Evaluation run from June 29th to July 3rd: Employee is not scheduled to work on Sat/Sun, so Employee will have 33 hours in the OT bucket until July 3rd (Wed).
Time Evaluation run on Thursday (July 4th): OT bucket is already at 33 hours for that week. Time Eval will generate holiday hours (8) on Thursday and counts these hours towards overtime. This will generate overtime for 1 hour and 40 regular. On this day, we don’t know yet if employee has a unpaid time for the next day (Friday). Store the generated holiday hours into time type (9HPY).
Time Evaluation on Friday: Employee records unpaid absence on this day. You can identify this entry in TIP table within Time Evaluation. Collect unpaid time into a time type (9UPH). Check if holiday hours are generated for the previous day. If yes, then store this holiday hours as a negative balance in to a correction time type (9COR). Call the function GOTC to re-evaluate time data from the beginning of the work week with the correction time type.
Below is the custom rule in my schema.
|$ D HRS=D9UPH HRS?0||“Check if unpaid time exists for cur day|
|* D HRS=L9HPY HRS?0||“Check if holiday pay exists from prev day|
|* * HRS=R ADDDB9COR-NEXTR A||“Add holiday loss to correction time type|
|* * A GOTCWW9COR||“Go to begin of WW with correction type|
|* =||“No holiday pay|
|=||“No unpaid time|
In our scenario GOTC will start re-evaluation on Saturday (June 29th). I have another rule in the schema to check if daily balance in correction time type is a non-zero and then carry it forward to the next day. I will reset/reduce correction time type when I come across the holiday during re-evaluation. In this case, this will be the Thursday that is a company holiday.
So when time is re-evaluated on Thursday, you will not generate holiday pay since there is a correction time type with a balance and also reduce/reset the correction time type. Obviously, you need to do this before the overtime calculation so that holiday pay hours will not be included in the overtime. When the processing continues to Friday, there should not be any holiday pay hours, so GOTC will not be triggered again.
Like I said, I simplified the requirement to be able to explain this easily in a blog. There could be various scenarios you may need to consider based on your requirement, e.g. consecutive holidays, whether employee is scheduled to work the day before/after company holiday, etc. You also need to be careful when you are setting/resetting/carrying forward the required time types. Good luck!!!