Learn how to use personnel calculation rules to retrieve action types and action reasons for the first day of the subsequent payroll period, even when they’re not available in the work center basic pay table while you process payroll. See how you can retrieve the values of action types and action reasons when an employee’s last working day falls on the last day of the payroll period. You can use personnel calculation rules to meet these types of payroll requirements.
Key Concept
Data fields action type MASSN and action reason in infotype 0000 (actions) are frequently queried in payroll for calculation purposes. You can use action types (e.g., new hire or separation) in combination with action reasons (e.g., voluntary resignation or termination) for automatic calculation of certain payments, such as gratuity and notice period pay. You store these fields in the work center basic pay table during payroll runs.
Users and functional experts face many challenges that are unique to payroll implementations. Payroll requirements that can vary based on which business processes are involved and any country-specific legal requirements create some of the toughest challenges. I show you how to meet the requirements of processing a full and final settlement for an employee. I also explain how to retrieve action types (field name MASSN) and action reasons (field name MASSG) for subsequent payroll periods even when they’re not available in the work center basic pay (WPBP) table.
For most employees, their last working days are the end of the month or the last day of a payroll period. Some of the benefits that are provided to employees as a part of their full and final settlement (e.g., a gratuity) depend on the action type or action or action reason in the SAP ERP HCM system. The data for action types and action reasons are stored in infotype 0000 (actions). These values are fetched into the WPBP table when payroll is processed.
A good example to illustrate this concept is the gratuity, which is given to employees as a part of their final settlements. The calculation amount for the gratuity depends on the action reason and the action type. For example, the gratuity amount that is paid differs depending on whether the employee has resigned (voluntary) or has been terminated by the employer (involuntary). Some companies, depending on their HR policies, do pay an extra allowance (or provide perquisites) to employees even when they are terminated or dismissed.
To address and automate these types of requirements, you have to write personnel calculation rules (PCRs) in the SAP payroll system. The key challenge with performing this task is retrieving the action type or action reason if an employee’s last working day falls on the payroll period end date. The WPBP table holds the value of the action type and action reason only for the payroll period for which the payroll is run. Here is an example.
Note
I assume that you have a basic understanding of PCRs, schemas, and payroll (i.e., you have a basic understanding of transaction codes PE01, PE02, and PC00_M**_CALC and their functionalities). I also don’t include details about how to create wage types, schemas, and rules.
For more information about these topics, refer to the following articles and SAP library documentation:
Business Scenario: A Practical Example
In this example, I explain how to retrieve action types and action reasons using PCRs even when the WPBP table doesn’t hold the value for the action type and action reason.
In Figure 1 the display screen for employee master data (transaction PA20) includes two action types maintained for an employee. Each record is marked with a number. Here is a description for each of these records:
- This record explains that the employee was hired starting on January 1, 2011. A hiring action (Z0) is shown for this employee with a start date of 2011.01.01.
- The second record shows that the same employee was terminated as of February 1, 2011. Action type 10 (Termination) and action reason 03 (Dismissal) are displayed.

Figure 1
Employee actions infotype overview
In Figure 2 the action type Z0 (Hiring HR050) is stored against the employee in infotype 0000 (actions) as shown in Figure 1.

Figure 2
Table WPBP in payroll processing view
The first two columns are the From and To dates of the hiring record. Notice that the WPBP table doesn’t have the action type and action reason for the second record (action type Termination and action reason Dismissal) for the employee as shown in Figure 1.
The WPBP retrieves action types and action reasons only for the period for which payroll is run. Here in my example the employee is terminated from February 1, 2011, and payroll is run only for the period January 2011. This is because the employee’s employment status changed to withdrawn as of February 1, 2011. Therefore, the SAP system does not process payroll for this employee for February 2011.
Next I show you how you can retrieve the values for action type (Termination) and action reason (Dismissal) as in Figure 1, even when the WPBP table does not hold the values for action type and action reason on February 1, 2011 for this employee.
Use PCRs to Retrieve Action Types and Action Reasons from Table WPBP
I show you in detail how to retrieve the action types and action reasons using PCRs.
I concentrate only on the PCR rule ZWBP to retrieve action types and action reasons.
Payroll Main Schema for Retrieving Action Types and Action Reasons
In this example I use ZKLM as the main schema for running payroll. I copy this schema for my country version; you can use your country version schema and copy it to a custom schema (i.e., U000 for US or X000 for international).
Inside the main schema I create a sub-schema ZWPB (Figure 3). The SAP standard function COPY is used to copy the schema dynamically to the current schema. In other words, the copy function processes the sub-schema within the main schema.

Figure 3
Schema ZKLM
Figure 4 is the expanded view of sub-schema ZWPB. Each line is marked with a number. Here is the explanation of each of the lines:
- The payroll function BLOCK BEG allows you to structure the payroll accounting process log. By marking the beginning and ending of the sequence, I group the payroll functions together semantically. They appear in the process log under a common node.
- The payroll function PIT calls a PCR for each wage type from the internal table IT. The header row of the internal table OT is used as the work area. In this example it calls PCR ZWPB. A new PCR ZWPB is created and accessed in schema ZWPB.
- Payroll function BLOCK END states the ending BLOCK for reading the WPBP table.

Figure 4
Sub-schema ZWPB
PCR Rule ZWPB for Retrieving Action Types and Action Reasons
In this example, I use PCR ZWPB for a business requirement in which a wage type has to be created when an employee is terminated with an action reason Dismissal (i.e., action type Termination [10] and action reason Dismissal [03]). See Figure 5 for a detailed explanation of PCR ZWPB.

Figure 5
A PCR for retrieving an action type or action reason
Each operation is marked with a number in Figure 5. The various operations used in PCR ZWPB are defined as follows:
- Operation PPPAR F checks to see if an employee is being terminated or withdrawn on the first day of the next payroll period. If the condition is true, then it returns the value F in the variable key (Var.Key) column.
- Operation OUTWPMAS1N retrieves the action type MASSN value on the first day of the next payroll period.
- Operation OUTWPMAS1G retrieves the action reason MASSG value on the first day of the next payroll period.
- Operation ADDWT adds values in the rate, amount, and number fields to the subsequent wage type.
Execute Payroll
In Figure 6, payroll driver (RPCALCx0) is run for January 2011 (01.01.2011 to 31.01.2011) for the same employee who was terminated as of February 1, 2011 (Figure 1), with action type 10 (Termination) and action reason 03 (Dismissal).

Figure 6
The payroll driver selection
Each operation is marked with a number. These operations are defined as follows:
- The payroll is run for period 01-2011 (e.g., 01-Jan-2011 to 31-Jan-2011).
- The main schema ZKLM is listed as an input. This value contains sub-schema ZWPB and PCR ZWPB.
After I execute the payroll driver, a screen appears with the output (Figure 7). The sub-schema ZWPB (Figure 4) is displayed in the output log.

Figure 7
Sub-schema ZWPB in the payroll log
Figure 8 shows the expanded payroll log (for sub-schema ZWPB). Two segments of this screen are explained as follows:
- PCR ZWPB is executed for this employee and the conditions for operations OUTWPMAS1N and OUTWPMAS1G are satisfied (e.g., action type 10 [Termination] and action reason 03 [Dismissal]).
- Wage type 1WAT is generated for this employee as per the condition (i.e., a wage type has to be generated when an employee is terminated and the action reason is Dismissal).

Figure 8
Expanded log view of sub-schema ZWPB
I have based my example scenario on the business requirements of one of my clients. You can use this information as and when required.
Note
SAP ERP HCM system standard operations OUTWPMAS1N and OUTWPMAS1G are assigned to only a few countries. Check in transaction code PE04 to verify if one or both of these operations are valid for your country’s requirement. If these operations are not assigned, I suggest that you create a new operation with the same functionality as for operations OUTWPMAS1N and OUTWPMAS1G.
Refer to the following link for information about creating new operations in the SAP system:
https://help.sap.com/erp2005_ehp_06/helpdata/en/f7/86883cc4bdea1ae10000000a114084/frameset.htm.
Sayeeram Subramanian
Sayeeram Subramanian
is a senior SAP HCM consultant at Accenture in Malaysia. He has been working as an SAP HCM consultant for many years. He has been involved in various sub-modules within SAP HCM, including Payroll and Time Management implementations.
You may contact the author at sayeeram_ns@hotmail.com.
If you have comments about this article or publication, or would like to submit an article idea, please contact the editor.