Payroll Schemas and Personnel Calculation Rules
|
This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production. |
When the payroll program runs for Ana Torres, nobody types the steps of the calculation into it. The steps are written down in advance, in a small program-like text that the payroll program reads from top to bottom: first prepare the data, then work out what Ana earned, then take off what must be deducted, and finally work out what is paid out. That text is called a personnel calculation schema. Inside it, individual steps hand the detailed arithmetic to smaller texts called personnel calculation rules, which contain the actual decisions such as "is this a recurring payment?" and "which amount goes into which wage type?". This page explains both texts, shows a real schema and a real rule from SAP’s documentation, and uses Ana’s March 2026 payslip to show what kind of work a rule does. It is written against SAP S/4HANA 2025 FPS02 on premise and Private Edition, where payroll comes from SAP HCM for SAP S/4HANA (H4S4), a separately licensed product. SAP S/4HANA Cloud Public Edition and SAP SuccessFactors are not covered here; the landscape page compares the options.
Before you read
-
HR and Payroll Basics: gross pay, net pay, the payslip and the payroll run in plain words.
-
Time Evaluation: time evaluation uses the same two kinds of texts (schemas and rules), so reading it first makes this page shorter.
-
Enterprise and Personnel Structure: the employee subgroup, payroll area and personnel calculation rule grouping that choose which rule applies to which employee.
Key terms
-
Personnel calculation schema: the ordered list of steps (functions) that a payroll or time evaluation program follows.
-
Function: one step of a schema, such as copying a subschema, starting a loop or calling a rule.
-
Subschema: a schema that another schema calls with the COPY function to do one subtask.
-
Personnel calculation rule: a decision tree of operations that calculates values such as amounts and hours for wage types.
-
Operation: the smallest element of a rule, one statement such as storing a wage type.
-
Wage type: one kind of payment or deduction, such as basic pay or social contributions, shown as one line on the payslip.
-
Payroll driver: the country-specific program that runs the schema for the employees of a payroll area.
-
Variable key: the column of a rule that holds the possible answers of a decision operation.
The example used on this page
The page uses Example Trading Co. (company code EX01, currency EUR), the fictitious business of this site. Ana Torres (personnel number 00001234, Sales Manager, monthly basic pay 4,000.00 EUR) is paid in payroll area E1, "Monthly EX01". Chloe Martin (00001236) is an hourly Warehouse Clerk who is also in the monthly payroll area E1; that is a choice of this example, not a rule of SAP. All codes and amounts are invented example values, not SAP-delivered values. The payslip rates are generic flat example rates and are not the rules of any country, so no real country’s payroll schema produces them.
Why payroll needs a schema and rules
Payroll differs by country and often by company, so SAP does not hard-code the calculation order in a program. Instead SAP’s documentation describes a payroll driver, the program that runs payroll for one country, and a schema that tells it what to do. SAP’s definition of the schema is that it describes the sequence and contents of a country-specific payroll program (payroll driver) or time evaluation program (time evaluation driver), and that schemas define the basic process of payroll or time evaluation. The payroll driver runs the sequence based on the tasks the schema specifies.
A second text, the personnel calculation rule, holds the detail. SAP’s definition: a rule is a statement for executing defined tasks in Time Management and Payroll, made of one or more operations that calculate values in the payroll run and define the order of those statements. A rule is called from inside a schema to process special subtasks. The division of work is therefore:
| Text | Made of | Answers the question |
|---|---|---|
Schema |
Functions, one per line, run in sequence |
In which order do the steps of the run happen, and which of them are skipped or repeated? |
Rule |
Operations, arranged as a decision tree |
Given this wage type and this employee, what is the amount, the hours or the rate? |
SAP also names the two tools for working on them in the system. Its documentation describes a schema editor and a rule editor, reached from the SAP Easy Access menu under Human Resources, Payroll, the country, Tools, Customizing Tools (entries Schema and Calculation Rule), or from Human Resources, Time Management, Administration, Tools (Maintain Schemas and Maintain Personnel Calculation Rules). The book mentioned below calls these tools PE01 and PE02, and SAP’s authorization objects for them are P_PE01 (personnel calculation schemas) and P_PE02 (personnel calculation rules). A third tool, the Maintain Functions and Operations transaction PE04, lists the functions and operations that exist in the system. Using a schema or rule editor in a real system requires an SAP system; not run here.
Main schemas and subschemas
A schema is either a main schema or a subschema. SAP’s documentation says a main schema must be executable, which means it can be given directly as the parameter of the payroll or time evaluation driver. Subschemas are schemas that another schema reaches with the COPY function, from a main schema or from another subschema, and they carry out subtasks. A subschema needs to be executable only for test purposes.
The standard system (client 000) includes the international payroll schema X000, plus other international and country-specific schemas. Where schemas exist for a country, the first character of the schema name is the country indicator (SAP’s examples are D for Germany and F for France), and country-specific schemas are based on X000. For time evaluation the standard system includes the international schema TM00, which the Time Evaluation page walks through.
A schema has three elements, according to SAP: attributes, source text and documentation. The source text is the part that matters here. It is stored as a table whose rows have a line number, a column D, a function, up to four parameters and a text.
| Column | Meaning (from SAP’s description) |
|---|---|
Line number |
Every row has one, and line commands can be typed in it in the table display. |
D |
An asterisk in column D deactivates the function or subschema: it is left out when the schema runs. |
Function |
The step: most functions collect, process or display data; others control the flow, call subschemas, or call personnel calculation rules. |
Par1 to Par4 |
Up to four parameters that define the function more exactly. |
Text |
Descriptive comment. |
The control functions that appear in the next listing are COPY (call a subschema), IF and ENDIF (start and end a condition) and LPBEG and LPEND (start and end a loop).
Schema X000: initialization, gross, net
SAP’s documentation describes a payroll schema in three parts. Initialization updates the databases and imports the required infotypes. Gross calculation of pay processes basic data and time data, queries off-cycle payroll runs, reads the payroll account of the last period accounted, processes time data and calculates the individual gross values, and performs factoring (the partial period handling covered on a later page). Net calculation of pay calculates net remuneration and performs bank transfers. All the data is kept in internal tables and saved in files with a cluster structure.
SAP’s own example of a schema is X000 itself, the main schema of international payroll, used as a template for the country versions. Its subschemas are called with COPY. The diagram shows the order of the calls in the listing (a deactivated line is left out), grouped under SAP’s three parts. The grouping into the three parts is this page’s reading aid: SAP’s listing itself is one flat list of lines, and the exact assignment of a subschema to a part is in the in-system documentation.
XIN0 initialization of payroll"] --> B["Gross calculation
XBD0 edit basic data
XPRO, XLR0 import earlier results
XT00 gross remuneration from time management"] B --> C["XAP9 further payments and deductions
XAL9 factoring and storage"] C --> D["Loop: LPBEG to LPEND
XTBL reload saved tables
XDD9 deductions and storage
XNA9 cumulation of net and payment amount
XDNT all deductions taken?"] D --> E["XRR0 retroactive accounting"] E --> F["Net calculation and transfer
XNN0 net payments and deductions and transfer"] F --> G["XEND final processing rule"]
Here is the main part of the schema as SAP documents it. The listing is a reduced copy of SAP’s table (lines 000060 to 000080 and the deactivated lines are omitted for space) and it is shown to explain how to read a schema, not as something to copy. The Func column holds the function and Par1 the subschema name.
| Line | Func | Par1 | Text (SAP’s description) |
|---|---|---|---|
000040 |
COPY |
XIN0 |
Initialization of payroll |
000050 |
COPY |
XBD0 |
Edit basic data |
000090 |
COPY |
XPRO |
Import previous result for current period |
000100 |
COPY |
XLR0 |
Import last payroll result |
000110 |
COPY |
XT00 |
Gross remuneration (time management) |
000140 |
COPY |
XAP9 |
Import further payments/deductions |
000160 |
COPY |
XAL9 |
Factoring and storage |
000170 |
COPY |
XTBS |
Save table before iteration |
000180 |
LPBEG |
Start iteration |
|
000190 |
COPY |
XTBL |
Reload saved tables |
000200 |
COPY |
XDD9 |
Processing of deductions and storage |
000220 |
COPY |
XNA9 |
Cumulation of net amount/payment amount |
000230 |
COPY |
XDNT |
All deductions taken? |
000240 |
LPEND |
End of iteration |
|
000250 |
COPY |
XRR0 |
Retroactive accounting |
000260 |
COPY |
XNN0 |
Net payments/deductions and transfer |
000280 |
COPY |
XEND |
Final processing rule |
Reading the table top to bottom is exactly what the payroll driver does: it never skips ahead on its own. SAP’s page adds that in the full listing the lines with an asterisk in column D (loans, one of the two lines for further payments, one of the two for factoring and storage, one of the two for cumulation of the net amount, and month end accruals) are deactivated, which is how a company or country switches a step off without deleting it. The loop between LPBEG and LPEND makes the driver repeat the deduction steps, and the question "All deductions taken?" belongs to that loop; the precise stopping logic is described in the documentation of those subschemas in the system.
What happens to Ana in March 2026
The payslip of Ana for March 2026 is the same one used on the basics page: gross 4,000.00 EUR, employee social contributions 800.00 EUR, income tax 480.00 EUR, net 2,720.00 EUR, and employer contributions 840.00 EUR. The flat rates are an invention of this example. They are not any country’s rules, and no SAP country schema contains them. Mapped to a schema, the payslip is produced in the same order as the diagram: the gross part reads her basic pay and creates the wage type for it, the deduction part works out the contributions and tax, and the net part leaves 2,720.00 EUR to be paid.
The calculation is small enough to check by hand, and it was also checked with a short script (python, arithmetic only, no SAP system):
The total employer cost is 4,000.00 + 840.00 = 4,840.00 EUR. Where does a rule come in? Each line above is a wage type, and a rule decides its values. The next table describes the rules a flat-rate setup like this would need. It is plain-language pseudocode that explains the idea, not SAP source text, and it contains no real operation names.
| Step | What the rule does for Ana | Result in March 2026 |
|---|---|---|
1 |
Read the basic pay of 4,000.00 EUR from the pay infotype and store it as the basic pay wage type |
Gross 4,000.00 |
2 |
Apply the flat employee contribution rate of 20.00% to the gross |
Social contributions 800.00 |
3 |
Apply the flat tax rate of 15.00% to the gross reduced by the contributions |
Tax 480.00 |
4 |
Apply the flat employer rate of 21.00% to the gross, as an employer cost that does not reduce her pay |
Employer contributions 840.00 |
5 |
Subtract the deductions from the gross |
Net 2,720.00 |
Which rate applies to which employee is not typed into the rule. SAP’s documentation says a rule can have several subareas, each defined for one combination of employee subgroup grouping for personnel calculation rules and wage type (or time wage type). Ana (subgroup AA, salaried) and Chloe (subgroup AB, hourly) can therefore pass through the same rule and take different branches, which matches the grouping explained on the enterprise structure page. A subarea is not a subrule: a subrule is another rule called from a step.
Personnel calculation rules and operations
A rule is a decision tree. SAP says each step within a rule corresponds to one operation, and that further rules can be reached through special operations, called subrules; the operation GCY calls a subrule. An operation is the smallest element of a rule, can be up to ten characters long, and in the table display starts under the plus sign in the source text header. If an asterisk is entered in the last field of a line, the sequence of operations continues on the next line.
Rules decide with the help of the variable key. SAP says the variable key is used to create the decision tree: a decision operation is marked with rule type D in column T, the line below it holds the possible answers in the VarKey column, and an asterisk stands for every answer not listed. The attributes of a rule say where and how it is used: a short text, the program class (Payroll or Time Management), the country grouping (a rule for one country has to be a Payroll rule; Time Management rules apply to all countries), the person responsible and whether only that person may change the rule.
The diagram shows the general shape, which is how the SAP example below behaves.
run for every wage type"] --> B{"Decision operation
row with D in column T"} B -->|"VarKey answer 1"| C["Operations on the next row
for example store the wage type"] B -->|"VarKey answer 2"| D["Other operations"] B -->|"VarKey asterisk
every other answer"| E["Fallback operations"]
An annotated rule: X011
SAP’s own example is the international rule X011, Recurring Payments and Deductions and Supplementary Payments. SAP describes it like this: it reads the infotypes Recurring Payments/Deductions (0014) and Supplementary Payments (0015) and places the wage types they contain into the wage type table (OT) for further processing. The first rows of its source text are reproduced here in a reduced form to be annotated. Column names follow SAP’s table display.
| Line | VarKey | T | Operations | Annotation |
|---|---|---|---|---|
000010 |
|
First row, no VarKey and no decision: three operations that run before the decisions below. The exact meaning of each operation is in the in-system documentation ( |
||
000020 |
D (column NL holds 1) |
|
A row of rule type D: a decision operation. The answers it distinguishes follow in the VarKey column of the rows below. |
|
000030 |
|
D |
|
Another decision operation, reached under the variable key |
000040 |
|
|
Under the key |
The operations named in SAP’s description or confirmed by the book are ADDWT (it stores a wage type entry in an internal table whose name comes from the additional parameters; in this rule SAP says the table is OT) and the variable-key mechanism above. The other operations in the listing belong to the system’s own documentation. Their documentation is read in an SAP system; not run here. The takeaway for Ana is the pattern: rule X011 does not know her pay, it knows the pattern "read the infotype row, decide by the variable key, store the wage type". Ana’s fixed monthly basic pay comes from the Basic Pay infotype and is handled by other rules of the schema in the same pattern.
Processing classes and cumulation classes
Wage types carry characteristics that rules query. Two of them are processing classes, which tell the rules how a wage type is to be treated by a given step, and cumulation classes, which tell the payroll program into which running totals (for example gross for tax) a wage type goes. The official pages used for this page describe the decision mechanism a rule uses to ask such questions (the decision operation and the variable key), and the listing of X011 contains a decision operation named VWTCL, but they do not define processing classes or cumulation classes, so their exact values and meanings are not given here. They are set per wage type in Customizing and explained in the in-system documentation of the wage type characteristics and of the decision operations (PE04). This is the reason Ana’s payslip lines differ in treatment: the basic pay wage type and the social contribution wage type are the same kind of object, and the characteristics are what make a rule treat them differently.
Working with schemas and rules: modification and names
SAP’s documentation gives schemas and rules a modification concept: SAP delivers standard schemas and rules, and a company copies one and changes the copy instead of changing the standard. SAP also describes separate naming conventions for standard and customer schemas, so a company’s own objects do not collide with delivered ones. The details (name ranges, transports) are in the Editor for Personnel Calculation Schemas and Editor for Personnel Calculation Rules chapters of the documentation, which also cover including a schema in a transport request; The schema editor can also generate a schema and compare two source texts; both tasks require an SAP system, not run here.
What older books show, and what has changed
The book SAP ERP HCM: Technical Principles and Programming, 1st edition (2013), describes the same structure: a payroll schema made of functions and subschemas, personnel calculation rules made of operations that work on the wage type entries of internal tables, and the transactions PE01, PE02 and PE04 to look at them. Its examples are the US schema and the US rules. The concepts on this page are the same, and SAP’s current documentation still describes schema X000, rules such as X011 and the same elements. What has changed is the product around them. The book is written for SAP ERP HCM, with its own screens; in SAP S/4HANA 2025 these functions come from SAP HCM for SAP S/4HANA (H4S4), which needs a separate license, and the business function for it is active by default, so the older compatibility mode is no longer an option. SAP SuccessFactors Employee Central Payroll is a different product with its own documentation and is not described here.
Source for the H4S4 statements: SAP HCM for SAP S/4HANA (SAP Help Portal)
Summary
-
A personnel calculation schema is the ordered list of functions that the payroll driver follows. A main schema is executable, and subschemas are called with
COPY. -
Schema
X000is the international template: initialization, gross calculation, then net calculation, with a loop for deductions. A star in column D switches a line off. -
A personnel calculation rule is a decision tree of operations, called from a schema function. The variable key holds the answers of a decision operation, and a star means every other answer.
-
Rule
X011shows the usual pattern: read infotype records, decide, store the wage type withADDWT. Rule subareas let employee subgroups such asAAandABtake different branches. -
Ana’s payslip (gross 4,000.00, social 800.00, tax 480.00, net 2,720.00, employer 840.00) uses flat example rates, not any country’s rules. The arithmetic was checked by hand and by script.
-
Processing classes and cumulation classes are named, but their values belong to the in-system documentation, which this page does not reproduce.
References
-
Access to the Personnel Calculation Schema Editor (SAP Help Portal)
-
Calling the Editor for Personnel Calculation Rules (SAP Help Portal)
-
P_PE01 (HR: Authorization for Personnel Calculation Schemas) (SAP Help Portal)
-
P_PE02 (HR: Authorization for Personnel Calculation Rule) (SAP Help Portal)
-
SAP ERP HCM: Technical Principles and Programming (SAP PRESS, publisher page)