Relationship of Payroll Driver, Schema (Functions), Rules (Operations)
Each country payroll version supported by SAP has a program called the "payroll driver" that calculates payrolls. For example, in the U.S., the payroll driver is RPCALCU0, in Mexico it is HMXCALC0, and in Canada RPCALCK0. Each one is different, but they share a common core of functionality. The job of the payroll driver is to process payroll functions as specified in a payroll schema. These payroll functions each perform a specific job, for example - reading data from infotypes, calculating taxes, and processing wage types. Some functions process payroll rules. Rules are a collection of payroll operations. Each operation does a small unit of work, such as multiplying a wage type’s number by a rate to get an amount.
Schemas are edited with transaction PE01, and rules PE02.
Functions and operations are maintained with transaction PE04.
To view payroll results, use transaction pc_payresult (or in earlier R/3 releases go to Tools>Payroll result>Display in the Payroll menu).
The standard payroll schema for a country can be derived from table t500l. If the country in table t500l has an X in the Old Naming Conv field, then the schema is HR Country Indicator plus 000. Otherwise, it is the ISO Code plus 00. So the U.S. has schema U000 and for Mexico it is MX00.
ffice:smarttags" name="country-region">ffice:smarttags" name="place"> Creating Custom Schemas and Rules
Schema and Rule Naming Conventions
Customer modified schemas and rules need to begin with Z. Many customers simply replace the first letter of the standard schema with a Z – i.e., their modified copy of UAP0 becomes ZAP0. But there can be problems with that convention. For example, you might later implement Canadian payroll and need a modified version of schema KAP0, but ZAP0 is already used for the U.S. For many years, I’ve used a naming convention of Z plus the country identifier and a sequential number for modified rules and schemas. So a modified UAP0 would become ZU01 and a modified KAP0 becomes ZK01.
In the schema and rule editors, place your cursor on a function or operation and press F1 to get help text. A schema or a rule’s documentation is available in the editor via the Goto>Documentation menu. In the schema editor, the F4 key shows possible values for each of the four parameters for whatever function is entered on that line. The same documentation – and more – is available via transaction PDSY.
Creating a Test Schema
For testing purposes, it is useful to have a version of the payroll schema that does not care about the control record (transaction PA03) settings. Bypassing the control record lets you run and save the results for any pay period needed, without having to update the control record. There’s no problem with having such a schema around, since the payroll driver does not save payroll results from a schema that ignores the control record in a production system. For examples, I will show you how to create two schemas – ZUA0, which will be used in production and will check the control record, and ZUAT, which ignores the control record and is used for testing purposes only.
First, create a copy of SAP’s schema UIN0 and name it ZUA2. In the schema editor (transaction PE02) enter schema UIN0, and click the copy ****on, or Schema>Copy in the menu. Enter ZUA2 for the To schema. Then edit ZUA2 and make the CHECK ABR line executable by removing the asterisk in the D column. (See Figure 2.) The CHECK function is commented out by SAP in the standard schema, so you uncomment it here for use in the main ZUA0 schema.