Learn how to customize schema and configure rules in SAP ERP HCM to process the time recordings of nonexempt union staff as per union agreements to derive the regular and premium (time-and-a-half and double-time) hours to be paid.
Key Concept
The Fair Labor Standards Act (FLSA) was enacted to govern wage and hour laws in the US. Among other things it prohibited employment of minors, introduced a 40-hour work week, and established national minimum wages and a time-and-a-half rate for overtime. These remain the cornerstones of the act and generally apply to hourly nonexempt workers.
Union agreements in the US generally have the Fair Labor Standard Act (FLSA) as the baseline and then tend to be used to negotiate better benefits for union members. At times these rules become quite complex. The rules have to be implemented in the SAP system to provide for results based on the agreement. To do so you can use the SAP ERP HCM framework. A sample agreement demonstrates how the rules can be implemented in the system.
Agreement Rules and Concepts
For understanding this process, you need to know the basic concepts of Time Evaluation and payroll integration. You also need to be familiar with schemas, functions, and rules.
Key terms are as follows:
Time-and-a-half: 1.5 times the regular rates
Double-time: 2.0 times the regular rates
Holiday: day declared as a public holiday (e.g., Independence Day)
Scheduled day: a day when the employee is planned or scheduled to work
Unscheduled day: a day when the employee is not planned or scheduled to work (off)
Substitution: Employee’s planned shift (e.g., regular) is substituted by another shift (night)
Shifts: The various time slots or patterns in which employees work in the organization.
Figure 1 shows sample shifts.
Figure 1
Sample shifts and their timings
Sample Agreement Rules
1. On a scheduled day, hours worked up to 8 are paid at a regular rate. Hours worked over 8 are paid at a time-and-a-half rate, and hours worked over 12 are paid at a double-time rate.
2. On an unscheduled day, hours worked up to 8 are paid at time-and-a-half. Hours worked over 8 are paid at double-time.
3. All the hours in rule 1 are paid at a regular rate to cumulate to a total of weekly regular hours. When the cumulated weekly regular hours reach 40, then hours worked on a day up to 8 are paid at time-and-a-half and hours worked over 8 are paid at double-time.
4. All the hours in rules 2 and 3 are paid at time-and-a-half to cumulate to a total of weekly time-and-a-half hours. When the cumulated weekly regular and time-and-a-half hours reach 60, then all further hours worked in the week are paid at double-time.
5. Hours worked up to 8 on a scheduled public holiday are paid at time-and-a-half and are added to the cumulative weekly time-and-a-half hours total. Hours over 8 are paid double-time.
6. Hours worked up to 8 on an unscheduled public holiday are paid double-time and do not add to any weekly total.
Figure 2 is a sample calculation of regular, time-and-a-half, and double-time for a week based on the above agreement rules.
Figure 2
A sample calculation
Below I list the mapping of the columns in the table in
Figure 2 to parts within the time evaluation of SAP ERP HCM. (Refer to
Figures 17,
18, and
19 of my article “How to Customize Schemas and Personnel Calculation Rules to Implement Time Evaluation in SAP ERP HCM” for details on customizing schemas and personnel calculation rules [PCRs] for understanding the overtime related parts of the time evaluation schema.)
Mapping is the first key step in implementing any custom requirement (e.g., FLSA) using Time Evaluation:
- The first, second, and third columns (i.e., Day, Holiday, and Scheduled Hrs) are predefined in the system and map to the work schedule. The work schedule also contains the holidays. The work schedule rule is assigned to the employee’s master data in infotype 0007 (i.e., planned working time as shown in Figures 3 and 4).
- The fourth column, Hrs Worked, maps to infotype 2002 (attendances Figure 5) or infotype 2011 (time swipes Figure 6). Time swipes are captured using card or biometric machines.
- The next three columns are the daily regular, time-and-a-half, and double-time hours. They map to the time wage types that are generated by the time evaluation program (using custom schema and PCRs) to hold the daily totals of these hours. These hours are passed on to payroll to generate amounts for payment.
- The last three columns are Cumulative Weekly regular hrs, Cumulative Weekly time-and-a-half, and Cumulative Double Time. They map to the time types that are updated by the time evaluation program (as counters) to hold cumulative weekly totals (such as of regular hours and time-and-a-half). They are not passed to payroll.
Figure 3
Work schedule F001 (40-hour week) assigned to the employee in infotype 0007
Note
In this article the knowledge of configuration and setup of a work
schedule (including holiday calendar), attendance, and the HR-PDC (plant
data collection)* interface is a prerequisite (and hence not
explained). I focus on the last six columns of Figure 2, which involve the processing within Time Evaluation.
Figure 4
Figure 4
Details of work schedule F001 from the 24th to the 30th of April
In the current example, the total 65 hours (detailed in
Figure 5) worked by the employee in a week are entered and saved in infotype 2002. Hours worked on April 24, 25, 28, 29, and 30 account for 8 hours each (08:00 to 16:00) for a total of 40 hours. Hours worked on April 26 are 12 and on April 27 are 13, which account for the additional 25 hours. Thus, the total hours worked for the week are 65.
Note
The From and to columns in Figure 5 do not show any value when the hours worked are exactly as planned (8 hours in this case).
Figure 5
Attendances recorded for the employee in infotype 2002
If the attendance is captured using biometric or card terminals, it is stored in infotype 2011. The entries show up as clock-in and clock-out as displayed in
Figure 6.
Figure 6
Time swipes captured in infotype 2011 (also called time events)
Customization of PCRs in the Schema to Implement Union Rules
The standard schema TM04 needs to be copied to a custom schema (say ZM06).
Refer to my article “How to Customize Schemas and Personnel Calculation Rules to Implement Time Evaluation in SAP ERP HCM” (
Figures 6,
7, and
8) for the basics on creating and editing the schemas.
Note
Time Evaluation schema TM00 is for time evaluation with clock
times only. Since there are times where non-clock times are also
required to be recorded in the system (e.g., attendance in infotype 2002
for some off-site work), I use schema TM04, which supports both
clock-time and non-clock times.
- The Determine overtime block of the custom schema ZM06 needs to be modified to calculate daily and weekly hours (regular, time-and-half, and double-time) as shown in Figure 7.
- The Select time wage types block needs to be modified to generate time wage types (which are passed to payroll) as shown in Figure 7.
Figure 7
Determine overtime and select the time wage type blocks of the schema
Determine Overtime
The two sub-schemas TW15 and TW30, both of which are part of standard schema TM04, are used to generate daily overtime and weekly overtime, respectively. You copy these to custom sub-schemas ZW15 and ZW30. (Refer to my article “How to Customize Schemas and Personnel Calculation Rules to Implement Time Evaluation in SAP ERP HCM” for details on how to create or edit custom schemas.)
These custom sub-schemas are then placed in the Determine overtime block of the custom schema ZM06 (
Figure 7). The first subschema ZW15 consists of PCR ZO01 (
Figure 7) to initialize the limits of daily and weekly overtime (described immediately after
Figure 2). The second subschema ZW30 (explained in detail in the section “Calculate Daily and Weekly Overtime Hours”) consists of PCRs ZW31, ZW32, and ZW06 (these three PCRs replace the standard PCRs TW31, TW32, and TW06, respectively) to calculate overtime (explained in
Figure 2).
Define Overtime Limits
The standard PCR TO01 (used to define the daily overtime limit as part of standard subschema TW15) is copied to custom PCR ZO01 and placed in custom subschema ZW15 (which replaces standard subschema TW15) as shown in
Figure 7. You then modify PCR ZO01 to define the limits of overtime (
Figure 8).
Figure 8
PCR ZO01 placed in subschema ZW15
You also create time types ZTMH and ZDBT (
Figures 9 and
10) to hold the value of hours worked on a day beyond which time-and-half and double-time rates apply, respectively. (Refer to the section “An Overview of the Configuration Tables Used in Time Evaluation” of my article “How to Customize Schemas and Personnel Calculation Rules to Implement Time Evaluation in SAP ERP HCM” for the steps to create time types.)
Figure 9
Time type ZTMH
When a value is required for day calculation (e.g., the number of hours after which double-time starts), then the day balance indicator is set to 1 (e.g., time type ZDBT in
Figure 10).
Figure 10
Time type ZDBT
PCR ZO01 (
Figure 11) sets the values of time types ZTMH and ZDBT. These values denote the number of hours to be worked after which the time-and-a-half rate (ZTMH) and the double-time rate (ZDBT) apply on a day. This PCR uses two standard operations, VARSTDAYTY and VARSTFREE.
Figure 11
PCR ZO01 to define the rules for overtime
Refer to (1) in
Figure 11. The first operation, VARSTDAYTY, checks the type of the current day. If it is a non-holiday, then it branches out to value 0 (detailed in 2 below) and if it is a holiday, then it branches out to value 1 (3 below). For special day types, it branches out to value 2, and for any other type of day, it would branch out to *.
(2) The second operation, VARSTFREE, checks whether the current day is free with 0 planned hours (i.e., unscheduled). If it is an unscheduled day it branches out to Y; otherwise, it branches out to N (which would mean a scheduled day).
Finally, under branch N (which stands for non-holiday and scheduled day), the value of time types ZTMH and ZDBT are set to 8 and 12. This means on this day a time-and-a-half rate starts after 8 hours and the double-time rate starts after 12 hours of work.
Under branch Y (which stands for non-holiday and unscheduled day), the values of ZTMH and ZDBT are set to 0 and 8. This means the time-and-a-half rate starts after 0 hours and the double-time rate starts after 8 hours of work.
(3) The third operation, VARSTFREE, checks whether the current day is free with 0 planned hours (i.e., unscheduled). If it is an unscheduled day it branches out to Y; otherwise, it branches out to N (which would mean a scheduled day).
Finally, under branch N (which stands for a holiday on a scheduled day), the value of time types ZTMH and ZDBT are set to 0 and 8. This means the time-and-a-half rate starts after 0 hours and the double-time rate starts after 8 hours of work.
Under branch Y (which stands for a holiday on an unscheduled day) time type ZDBT is set to 0. This means the double-time rate starts after 0 hours of work.
Calculate Daily and Weekly Overtime Hours
The standard PCR TW31 is copied to ZW31. Likewise, the standard PCR TW32 is copied to ZW32 and TW06 is copied to ZW06. These are then placed in sub schema ZW30 (
Figure 12).
Figure 12
PCRs ZW31, ZW32, and ZW06 in subschema ZW30
ZW31 initializes time types to store the daily and weekly overtime limits. ZW32 splits any time pair that spans across two days or weeks. ZW06 evaluates or processes the time pairs and segregates them into regular hours or time-and-a-half hours and double-time hours. These rules are explained in detail later in the article.
You also create time types ZWRH, ZWTM, and ZWDT (
Figures 13,
14, and
15). These hold the following cumulative values:
- ZWRH: Weekly cumulated regular hours
- ZWTM: Weekly cumulated time-and-a-half hours
- ZWDT: Weekly cumulated double-time hours
- 0906: The standard time type is predefined in the system, which holds the time at which the pair should be split.
The scenario discussed in this article does not use time types ZPRH, ZPTM, and ZPFT, but they are required for overlapping scenarios across weeks when a split is required. The information in the sidebar “Time Pair Spans” is intended to help you if you would like to try this scenario on your own.
Time Pair Spans
Practically, a time pair (denoting continuous hours worked by an employee) would not be more than 24 hours. At the maximum, it can span across two days. If the first of these two days happens to be the last day of one week and the second of these two days happens to be the first day of the next week, the time pair would span both across two days and two weeks. It can never span across three days or three weeks.
Split time is used when a time pair spans across two weeks or days. For example, the weekly working time is defined as Monday from 06:00 am to the following Monday at 05:59 am, whereas the employee works from 23:00 on Sunday to 07:00 am on Monday. In such cases the time pair of 23:00 to 07:00 needs to be split into two pairs. The first pair would be 23:00 to 06:00 (to be added to previous week cumulation), and the second pair would be 06:00 to 07:00 (to be added to current week cumulation). It is also used when the start time (e.g., 23:00 Monday) and end time (e.g., 06:00 am Tuesday) of swipes are on different days of the week (to handle cases in which one single attendance record is created in infotype 2002 across days).
You can use the following time types to track the previous week details when time pairs span across two weeks:
ZPRH: Weekly cumulated regular hours for previous week
ZPTM: Weekly cumulated time-and-half hours for previous week
ZPDT: Weekly cumulated double-time for previous week
If a value is to be cumulated for a period of time (e.g., the number of hours worked in a week shown as ZWRH in
Figure 13), then the Cumulate in period balance indicator needs to be set to 1.
Figure 13
Time type ZWRH
Figure 14
Time type ZWTM
Figure 15
Time type ZWDT
You use PCR ZW31 (
Figure 16) to set the value in time type 0906, which works as a cut-off time for the end of the week. If a time pair starts before and ends after this time, then PCR ZW32 splits such pairs. This PCR uses two standard operations: VARSTFDYWW and VARSTLDYWW.
Figure 16
PCR ZW31 sets the end time of the current week
Refer to (1) in
Figure 16. Operation VARSTFDYWW checks whether it’s the first day of the week. If it is not the first day of the week, it branches out to condition N (2 below). If it is the first week of the day, then it branches out to condition Y (3 below).
(2) Checks whether it’s the last working day of the week. If it is not the last working day of the week then it branches out to option N. Operation HRS=48 followed by ADDDB0906Z sets the split time of the time pair to the end of the next day (48 hours from the start of the current day). If it is the last working day of the week then it branches out to option Y. Operation HRS=24 followed by ADDDB0906Z sets the split time of the time pair to the end of the current day (24 hrs from the start of the current day).
(3) Reads the start time of the week using operation HRS=IWWEEK and sets this value in time type 0906 using operation ADDDB0906Z.
Reads the value of weekly regular hours cumulated up to the previous day using operation HRS=MZWRH and moves it to time type ZPRH using operation ADDDBZPRHZ.
Reads the value of weekly time-and-half cumulated up to the previous day using operation HRS=MZWTM and moves it to time type ZPTM using operation ADDDBZPTMZ.
Reads the value of weekly double-time cumulated up to the previous day using operation HRS=MZDT and moves it to the time type ZPDT using operation ADDDBZPDTZ.
Note
You would not use time types ZPRH, ZPTM, and ZPDT for the example in this article. It is defined in the PCR to give an idea to readers about where to place this condition when there is a scenario of a time swipe spanning across two weeks.
You use PCR ZW32 (
Figure 17) to split all time pairs that stretch across two weeks. This PCR uses standard operation OUTTPEXTIM.
Figure 17
PCR ZW32 used to split time pairs spread across two weeks
Refer to (1) in
Figure 17. Operation OUTTPEXTIM checks whether a time pair (start and end time) exits for the current day being evaluated. If a time pair does not exit, it branches out to option N (2 below). If a pair exits, it branches out to option Y (3 below).
(2) Operation COLOP * passes on the time pair as it is without causing any split.
(3) Operation HRS=PBEG gets the start time of the time pair. Next, HRS?D0906 compares the start time with the time in time type 0906. If the start time of the pair is after the time in time type 0906, then it branches out to * (4a below). If the start time of the pair is before the time in time type 0906, it branches out to < (4b below).
(4a) Since the start time of the current pair is after the start time of the current week or day, no split is required. Hence, operation COLOP * is used to pass on the current pair as is.
(4b) Operation HRS=PEND gets the end time of the pair. Next HRS?0906 compares the end time with the time in time type 0906.
If the end time of the time pair is less than the time in time type 0906, it branches out to *. This is followed by operation COLOP *, which passes on the current time pair as is.
If the end time of the time pair is greater than the time pair in time type 0906, it branches out to > condition. The next operation, HRS=R, gets the time difference between the time in time type 0906 and end time of the time pair (assume x minutes). Operation GENTPE * splits the time pair x minutes from the end.
PCR ZW06 (
Figure 18) checks whether the current time pair is an attendance or not. In case it is an attendance (processing type S), it branches out to PCR ZW04. In other cases, the time pairs are passed on as they are. This PCR uses operation OUTTPPVTYPE and OUTTPPTYPE.
Figure 18
PCR ZW06 checks for attendance and passes them to PCR ZW04
Refer to (1) in
Figure 18. Operation OUTTPVTYPE checks the processing type of the time pair. If the processing type is S, it branches out to 2; otherwise, it uses COLOP* to pass on the time pair as is.
(2) Operation OUTTPPTYPE checks the pair type. If the pair type is 0 or 2 (indicating absence), the pair is passed on as is using COLOP*. Otherwise (option *), the PCR ZW04 is called.
PCR ZW04 (
Figure 19) checks the values in time types ZTMH and ZDBT (set in PCR ZO01) to verify the number of hours to be worked before time-and-half and double-time rates apply. If the number of hours to be worked for double-time to commence is already done, then it marks the current time pair for double-time and adds it to double-time.
In all other cases, the cumulated weekly hours (regular and time-and-half ) are totaled and then the number of hours in the current time pair is added to this total to figure out whether some or all of the hours in the time pair fit into regular hours or time-and-half or double-time hours.
PCR ZW04 uses operation HRS and the time types ZWRH, ZWTM, ZWDT, ZDRH, ZDTM, ZDDT, ZTMH, and ZDBT for simulating the calculation and segregation of hours as shown in
Figure 2. It also uses two constants, OVERT and DBLT, both of which are used to store the cut-off for weekly hours (40 hrs and 60 hrs) beyond which time-and-half and double-time rates apply.
Figure 19
PCR ZW04 determines the daily and weekly overtime
Refer to (1) in
Figure 19. Operation HRS=DZTMH gets the number of hours on the current day beyond which time-and-half rates apply (This was set in rule ZO01 before). Next, the operation HRS?0 compares this value with 0. If it is equal to 0 (no regular hours to be worked before the time-and-half rates apply), it branches to = condition (1.1 below), and if it is greater than 0, then it branches to > condition (1.2 below).
(1.1) Operation HRS=DZDBT gets the number of hours on the current day beyond which double-time rates apply (this was set in PCR ZO01). Next, the operation HRS?0 compares this value with 0. If it is equal to 0 (all hours worked on the day are paid at double-time), then it branches to = condition (1.1.2); otherwise, it branches out to * condition (1.1.1)
(1.1.1) Refer to
Figure 20 for this step and the following sub-branches.
Operation HRS=MZWRH sets the value of HRS to the number of weekly cumulated hours (say, X).
Operation HRS+DZDRH adds the regular hours of the current day processed so far (in case of multiple attendance pairs say Y) to the value in HRS (X+Y).
Operation HRS+MZWTM adds the weekly cumulated time-and-a-half hours (say, Z) to the value in HRS (X+Y+Z).
Operation HRS+DZDTM adds the daily time-and-a-half hours (say, A) to the value in HRS (X+Y+Z+A).
Operation HRS?CDBLT compares the value in HRS to the value of constant DBLT (weekly double-time limit stored in table T511K). If the value in HRS is less than the value in constant DBLT, then it branches out to < (1.1.1.1 below); otherwise, it branches out to *(1.1.1.2 below).
(1.1.1.1) Operation HRS+PNUM adds the total hours in the current time pair being processed (say, x) to HRS (X+Y+Z+A from 1.1.1).
Operation HRS?CDBLT compares the value in HRS with the value of constant DBLT (weekly double-time limit stored in table T511K). If the value in HRS is less than the value in constant DBLT, then it branches to * (1.1.1.1.1 below); otherwise, it branches out to > (1.1.1.1.2 below).
(1.1.1.1.1) Operation FILLPVO marks the current time pair for a time-and-half rate by filling the pair with processing type as O.
Operation HRS=PNUM sets the value of HRS to the number of hours of the current time pair.
Operations ADDDBZWTM and ADDDBZDTM add the number of hours in HRS to the time types ZWTM and ZDTM.
(1.1.1.1.2) Since after adding the current time pair the weekly total hours have crossed the limit for weekly double-time hours, the time pair needs to be split.
Operation HRS-CDBLT sets the value of HRS to number of hours over (and above) the weekly double-time limit (say, X).
Operation GENTPE M carves out hours above the weekly double-time limit (X hours) from the end of the time pair and fills the processing type with M.
Operations ADDDBZWDT and ADDDBZDDT add the value in HRS to time types ZWDT and ZDDT.
Operation HRS=CDBLT sets the value of HRS to the value in constant DBLT (weekly double-time threshold limit stored in constant table T511K).
Operations HRS-MZWRH, HRS-DZDRH, HRS-MZWTM, and HRS-DZDTM subtract from HRS all the cumulated weekly regular hours, daily regular hours, weekly time-and-a-half hours, and daily time-and-a-half hours. (This leaves the balance hours [say, Y] in the current time pair, which should be marked for time-and-half.)
GENTPE O carves out (splits) hours above the weekly regular hours limit from the end of the pair and fills it with processing type O.
Operations ADDDBZWTM and ADDDBZDTM add the number of hours in the HRS field to time types ZWTM and ZDTM.
Operation HRS=PNUM sets the value of HRS to the number of hours in the leftover time pair (after the carving out of parts in previous steps).
Operations ADDDBZWRH and ADDDBZDRH add the value in HRS to the time types ZWRH and ZDRH.
Figure 20
Conditions 1.1.1 and 1.1.1.1 expanded further from Figure 19
Refer to (1.1.2) in
Figure 21. Operation FILLPVM sets the processing type of the current time pair to M. Operation COLOP* passes on the changed time pair to the output table.
Figure 21
Condition 1.1.2 expanded from Figure 19
(1.2) Operation HRS=MZWRH sets the value of HRS to the cumulated weekly regular hours.
Operation HRS+DZDRH adds to HRS the value of the daily regular hours.
Operation HRS?COVERT compares the value in HRS with the constant OVERT (weekly regular hours limit, stored in constant table T511k, after which time-and-half hours start). If the value of HRS is less than the value of constant OVERT, then it branches to < condition (1.2.2 below); otherwise, it branches to * condition (1.2.1 below).
(1.2.1) Refer to
Figure 22 for this step and the following sub-branches.
Operation HRS+DZDTM adds to HRS the daily time-and-a-half hours from time type DZTM.
Operation HRS+MZWTM adds to HRS the weekly time-and-a-half hours from time type MZWTM.
Operation HRS?CDBLT compares the value in HRS with the constant DBLT (limit for weekly double-time stored in constant table T511K). If the value in HRS is less than the value of constant DBLT, then it branches to condition < (1.2.1.2); otherwise, it branches to condition * (1.2.1.1).
Figure 22
Condition 1.2.1 expanded further from Figure 19
(1.2.1.1) Operation FILLPVM fills the processing type of the current pair with value M.
Operation HRS=PNUM fills HRS with the value of the number of hours from the current time pair.
Operation ADDDBZWDT adds the number of hours in HRS to time type ZWDT.
Operation ADDDBZDDT adds the number of hours in HRS to time type ZDDT.
Operation COLOP* passes on the updated time pair to the output table.
(1.2.1.2) Operation HRS+PNUM adds to HRS the number of hours in the current pair.
Operation HRS?CDBLT compares the value of HRS with the constant value DBLT (weekly limit for double-time stored in table T511K). If the value of HRS is greater than DBLT, then it branches out to condition > (1.2.1.2.1); otherwise, it branches to condition * (1.2.1.2.2).
(1.2.1.2.1) Operation HRS=CDBLT sets HRS to the value of the weekly double-time limit (stored in constant DBLT of table T511K).
Operation HRS-COVERT subtracts the value of the weekly time-and-a-half limit (stored in constant OVERT of table T511K) from the value present in HRS).
Operation HRS-DZWTM subtracts the number of hours cumulated in the time-and-a-half time type ZWTM.
Operation GENTPB O carves out or splits the number of hours in the current time pair that should be set to time-and-a-half.
Operations ADDDBZWTM and ADDDBZDTM add the number of hours in HRS to time types ZWTM and ZDTM.
Operation FILLPVM sets the processing type of the remaining part of the time pair to M.
Operation HRS=PNUM sets the value of HRS to the number of hours of the remaining part of the time pair.
Operations ADDDBZWDT and ADDDBZDDT add the number of hours in HRS to time types ZWDT and ZDDT.
Operation COLOP* passes on all the time pairs to the output table.
(1.2.1.2.2) Operation FILLPVO sets the processing type of the current time type to O.
Operation HRS=PNUM sets the value of HRS to the number of hours in the current time pair.
Operations ADDDBZWTM and ADDDBZDTM add the number of hours in HRS to time types ZWTM and ZDTM.
Operation COLOP* passes on the time pairs to the output table.
(1.2.2) Operation HRS+PNUM adds the number hours of the current time pair to HRS.
Operation HRS?COVERT compares the value of HRS with the constant OVERT (weekly time limit for time-and-a-half to start, stored in constant OVERT of table T511k). If the value is greater than that of constant OVERT, it branches to condition > (1.2.2.2); otherwise, it branches to condition * (1.2.2.1).
(1.2.2.2) [Refer to
Figure 23 for all sub conditions]
Operation HRS+DZDTM adds to HRS the number of hours from time type ZDTM.
Operation HRS+DZWTM adds to HRS the number of hours from time type ZWTM.
Operation HRS?CDBLT compares the value of HRS with constant DBLT (limit for weekly hours before double-time starts, stored in constant DBLT of table T511K). If the value of HRS is greater than that of DBLT, then it branches to condition > (1.2.2.2.2); otherwise, it branches to condition * (1.2.2.2.1).
Figure 23
Condition 1.2.2.2 expanded further from Figure 19
(1.2.2.2.1) Operation HRS=COVERT sets the value of HRS to that of constant OVERT (limit for weekly time-and-half to start, stored in constant OVERT of table T511K).
Operation HRS-DZWRH reduces the number of cumulated weekly regular hours from HRS.
Operation HRS-DZDRH reduces the number of daily regular hours from HRS.
Operation GENTPB S carves out the number of hours left in HRS to be marked as regular hours.
Operations ADDDBZWRH and ADDDBZDRH add the number of hours in HRS to time types ZWRH and ZDRH.
Operation FILLPVO fills the processing type of the leftover time pair with the value O.
Operation HRS=PNUM sets the number of hour in the leftover time pair to HRS.
Operations ADDDBZWTM and ADDDBZDTM add the number of hours in HRS to time types ADDDBZWTM and ADDDBZDTM.
Operation COLOP* passes on the updated time pair to the output table.
(1.2.2.2.2) Operation HRS-CDBLT reduces from HRS the weekly double-time limit from constant DBLT (stored in table T511K).
Operation GENTPE M carves out the number of hours stored in HRS from the current time pair and fills the processing type with value M.
Operations ADDDBZWDT and ADDDBZDDT add the number of hours in HRS to time types ZWDT and ZDDT.
Operation HRS=CDBLT sets the value of HRS to that of constant DBLT (stored in constant DBLT in table T511K).
Operation HRS-DZWTM reduces the cumulated weekly time-and-a-half hours from the number of hours in HRS.
Operation HRS-DZDTM reduces the daily time-and-a-half hours from the number of hours in HRS.
Operation HRS-DZWRH reduces the cumulated weekly regular hours from the number of hours in HRS.
Operation HRS-DZDRH reduces the daily regular hours from the number of hours in HRS.
Operation GENTPE O carves out from the current time pair the number of hours in the HRS field and fills the processing type to O.
Operations ADDDBZWTM and ADDDBZDTM add the number of hours carved out to the time types ZWTM and ZDTM.
Operation HRS=PNUM sets the value of HRS to the number of hours left after the carved-out time pair.
Operations ADDDBZWDT and ADDDBZDDT add the number of hours in HRS to time types ZWDT and ZDDT.
Operation COLOP* passes on the processed time pairs to the output table.
(1.2.2.1) Operation PCY ZO02 calls PCR ZO02 (shown in
Figure 24).
Figure 24
PCR ZO02 to determine daily overtime
Refer to (1) in
Figure 24. All processing types with the value S (regular hours or non-overtime) are processed. The regular hours and time-and-a-half hours are added to HRS. The value in HRS is compared with the daily working hours limit after which the time-and-a-half rate starts (ZTMH). If HRS is less than the limit for time-and-a-half hours (ZTMH), then go to condition < (3); otherwise, go to condition * (2).
(2) Hours in HRS are compared with the daily working hours limit after which double-time rates apply (ZDBT). If HRS is less than the limit for daily double-time (ZDBT), then go to condition < (2.2); otherwise, go to * condition (2.1 below).
(2.1) The processing type of the time pair is marked as M. The number of hours of the time pair is added to the time types ZWDT and ZDDT. The updated pair is passed on to the output table.
(2.2) The number of hours of the time pair is added to HRS. PCR ZO03 is called (
Figure 25).
(3) The number of hours of the current pair is added to HRS. This value is then compared with the daily hours after which time-and-a-half hours (ZTMH) start. If the value of HRS is greater than the daily limit for time-and-a-half hours (ZTMH), then go to condition > (3.2 below); otherwise, go to * condition (3.1).
(3.1) The number of hours of the current pair is added to time types ZWRH and ZDRH. The time pair is then passed to the output table.
(3.2) The daily limit after which time-and-a-half hours start is assigned to HRS. The hours already worked as regular are subtracted from HRS. The number of hours in HRS is carved out of the current time pair and marked as regular hours. The hours of the remaining time pair are added to HRS and PCR ZO03 is called (
Figure 25). PCR ZO03 in
Figure 25 segregates the overtime hours into time-and-half or double-time hours.
Figure 25
PCR ZO03 to determine daily time-and-a-half or double-time hours
Refer to (1) in
Figure 25. The value in HRS is compared with the daily working hours limit for double-time starts (DZDBT). If the value of HRS is less than DZDBT, then fill the processing type with value O. Also, add the number of hours of the current time pair to ZDTM and ZWTM.
(2) If the value in HRS is greater than daily working hours limit for double-time (ZDBT), then assign the double-time limit to HRS. From HRS reduce the daily time-and-a-half hours limit. Carve out from the time pair the hours in the HRS field and assign processing type O. Assign the number of hours in the HRS field to ZDTM and ZWTM. Fill the remaining part of the time pair with processing type M. Get the number of hours of the remaining part of the time pair and add that to ZDDT and ZWDT. Pass on all the time pairs to the output table.
PCR ZW06 (internally calls PCRs ZW04, ZO02 and ZO03) has the inputs and outputs shown in
Figures 26 and
27, respectively.
Figure 26
Inputs to PCR ZW06
PCR ZW06 processes the input table (
Figure 26) and generates the output table (
Figure 27). There are primarily two changes that this PCR makes. The first is to split the time pairs into overtime pairs, and the second is to mark each overtime pair with processing type O or M, depending on whether it is time-and-a-half or double-time.
Figure 27
Output from PCR ZW06 based on inputs in Figure 26
Note that the processing type of all inputs is S, and after processing by the rules, the time pairs are split. Also, the processing types are changed to S (regular hours), O (time-and-a-half hours), and M (double-time hours).
Generate Wage Types
In the previous rules, I marked the time pairs for time-and-a-half hours with processing type O, while the time pairs for double-time hours were marked with processing type M. The time pairs for regular hours were marked with processing type S. Therefore, in the schema ZM06 you need to have separate functions to generate wage types for each of these processing types.
The schema already contains two GWT functions (line numbers 000560 and 000570 of
Figure 28) to generate wage types for processing types S and M, respectively. You need to create a new entry of GWT to generate wage types for processing type O. This is done by replacing the last 0 of line 000570 with letter I and pressing Enter (
Figure 28).
Figure 28
GWT functions to generate wage types
Enter function GWT with processing type O as shown in
Figure 29.
Figure 29
GWT function added for processing type O to generate time-and-half hours
You create entries corresponding to each processing type (S, O, and M) in table T510S to generate separate wage types for each of them (
Figures 30,
31, and
32).
Figure 30
Entry in table T510S to generate wage type 2100 for processing type S
Figure 31
Entry in table T510S to generate wage type 2200 for processing type O
Figure 32
32 Entry in table T510S to generate wage type 2300 for processing type M
These functions convert the time pairs (
Figure 27) to the wage types. After you run time evaluation, look at the log of the wage types that are generated (
Figure 33). Refer to my article “How to Customize Schemas and Personnel Calculation Rules to Implement Time Evaluation in SAP ERP HCM” (
Figures 37,
38 and
39) on how to view the time evaluation log.
Figure 33
Time wage types generated by schema ZM06
Riishi Riitambhar
Riishi Riitambhar is technical/functional consultant with over 12 years of experience in the area of HCM applications built on SAP ERP HCM and SAP SuccessFactors. His special areas of focus include SAP positive Time Management and Payroll integration. Riishi's SuccessFactors Employee Central experience includes extensive implementation experience of Metadata Framework, workflows, and business rules.
You may contact the author at
riishi.riitambhar@gmail.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the
editor.