Overtime is defined as work done outside the planned working hours. What if your client gives you a requirement where any work done in the last 2 planned working hours will be treated as Overtime during the Ramadan Period? This is contrary to the basic definition of overtime and is called Ramadan Overtime.
Client was implementing positive time management. Any work done in the plant in the last 2 planned working hours will be treated as Ramadan Overtime. These hours should be added to the overtime wage type for processing in payroll. Also, the overtime work done between 9 pm – 6 am will be at R2 rate (Higher Rate) and the overtime work done between 6 am – 9 pm will be at R1 rate. Ramadan overtime is not applicable for OFF days (planned working hours = 0) or on public holidays if the employee is eligible for public holiday.
Let us assume that the employee is on shift WSR with morning shift from 06:00 – 14:00, afternoon shift from 14:00 – 22:00 and night shift from 22:00 – 06:00 and is also eligible for public holiday. Hence, if the employee works at plant between 12:00 – 14:00 in morning shift, he will be paid Ramadan Overtime at R1 rate. If he works at plant between 20:00 – 22:00 in afternoon shift, he will be paid Ramadan Overtime at R1 rate for work done between 20:00 – 21:00 and at R2 rate for work done between 21:00 – 22:00. If he works at plant between 04:00 – 06:00 in night shift, he will be paid Ramadan Overtime at R2 rate. This also implies that only data from IT2011 will be used towards Ramadan Overtime. Any attendance captured in IT2002 during the last 2 planned working hours will not contribute towards Ramadan Overtime.
Also, the overtime hours would need to be rounded off as per the below logic:
- 0 min till < 15 min to be rounded off to 0 min
- 15 min till < 45 min to be rounded off to 30 min
- 45 min till 60 min to be rounded off to 60 min
Before going through the solution design, let me give you a pictorial depiction of what will constitute Ramadan Overtime with regards to afternoon shift. The afternoon shift is from 14:00 – 22:00.
The above diagram depicts period for R1 and R2 rate Ramadan Overtime during an afternoon shift of 14:00 – 22:00. The orange color lines represent various continuous time pairs. For time pairs which are overlapping across R1 and R2 rates timings, we would need to write a PCR to split the timings to arrive at Ramadan Overtime Hours with R1 and R2 rates.
We will need to create a WSR for Ramadan Overtime and ensure that this WSR is maintained in IT0007 for the Ramadan Period. Below are the configuration done for Ramadan WSR.
Generation of Work Schedules
We will require the below daily time types for storing Ramadan Overtime hours R1 and R2.
We will create 2 constants in Table V_T511K to define the timings where R1 changes into R2 and vice versa.
In the above table, we have maintained the value of ZAR12 as 21.00 because overtime rate changes from R1 to R2 at 21:00 hours in afternoon shift. For night shift, we have maintained the value of ZNR12 as 30.00 because overtime rate changes from R2 to R1 at 30:00 hours in night shift. In SAP, 6:00 hours on current date is 30:00 hours for previous day shift.
Below is the PCR which has been written to read overtime work done during the last 2 planned workings hours of the shift. This is a very big PCR and hence, I will give you an overview of its design.
We are basically trying to check each time pair in the last 2 planned working hours of the shift to see if it falls in the R1 or R2 time zone and accordingly, add these hours to daily time types ZRR1 or ZRR2.
We first determine the personnel subarea and process this PCR only personnel subarea 0001. Then we determine the pair type and process the PCR for pair types 1 only. Pair type 1 means that the data is coming from IT2011. Then we determine the work schedule rule and process the PCR for Ramadan Work Schedule S0001-01 only. Then we try to find out if planned working hours are greater than 0 or not. If the planned working hours are 0, we move the time pairs to output table. If the planned working hours are greater than 0, we read the shift end time and subtract 2 from it to determine the time 2 hours before shift end time. This time is stored in daily time type ZET2.
We then process time pairs belonging to Time Id 02 and 03 only and then check if the day is a public holiday or not. If the day is a public holiday, we check if the day type is blank (employee not eligible for public holiday) or not. If the day type is blank, we process it further for Ramadan Overtime and all hours will be R2 overtime hours because the day is a public holiday. If the day is not a public holiday, we determine the daily work schedule and based on each daily work schedule, we process it further to determine Ramadan Overtime.
In case of morning shift, all Ramadan Overtime hours will be R1 hours because overtime done between 6 am and 9 pm will be R1 hours. In case of afternoon shift, Ramadan Overtime hours may get split between R1 and R2. In case of night shift, Ramadan Overtime hours will be R2 hours only in the current scenario.
Each time pair is checked against the last 2 planned working hours of the day to see if it overlaps with that or not. If it overlaps with that, we also check if the timings fall within 6am – 9pm or 9pm – 6am to determine R1 or R2 overtime hours. These overtime hours are cumulated in time types ZRR1 (for R1 hours) and ZRR2 (for R2 hours).
We need to create another PCR to round off the hours cumulated in time types ZRR1 and ZRR2 and then add them to their respective overtime wage types.
The rounding rule 92 is defined as shown below:
The two PCRs are placed in the positive time schema ZPT1 as shown below:
Ensure that the PCRs are placed after function TIMTP because the function will be responsible for splitting time pairs, assignment of Time Ids and assignment of time types to time pair.
Also, ensure that the parameters for function P2001 and P2002 in the schema are blank as shown below:
With the solution design in place, let us proceed to testing.
Please refer below the screenshots related to key infotypes before we do the testing.
IT0007 – Ramadan Period is for the month of Aug’13 and hence, Ramadan WSR is assigned for that period.
Let us capture time events in IT2011 for the given dates and it should result in Ramadan Overtime as shown below:
PT60 – Time Evaluation Run
Time Evaluation runs successfully.
TCode PT_BAL00 – Time Types ZRR1 & ZRR2
TCode PT_BAL00 – Ramadan Overtime Wage Types
Here, I come to the end of this knowledge artifact. I hope this document has been beneficial for you.