Академический Документы
Профессиональный Документы
Культура Документы
by Gayathri Nannapaneni
PrepareMe TellMe
3
ShowMe
LetMe HelpMe
5
India SAP CoE, Slide 2
PrepareMe TellMe
3
ShowMe
LetMe HelpMe
5
India SAP CoE, Slide 3
Objective
Understanding to Configure the SAP system for writing payroll schema and PCR
CONTENTS
Concept of payroll driver and it's relation with schema and PCR Introduction to schema Introduction to PCR Payroll run
Day 1
Concept of payroll driver and it's relation with schema and PCR
Concept of payroll driver Payroll driver relationship with PCR and Schema Concept of table header and Wage types
Introduction to schema
Introduction to schema Functions in Schema Documentation on functions Structure of a schema How to create a Schema How to write a custom schema? Examples on writing custom Schemas
Day 2
Introduction to PCR
Introduction to PCR Operations in PCR Documentation on operations Rule Structure How to write a custom PCR? Examples on writing custom PCRs Concept of processing classes in writing PCRs Concept of payroll constants in writing PCRs Documentation on Payroll Schema and PCRs Expanding schemas and PCRs Payroll run process flow Running payroll driver Reading the payroll driver log Exercises Transactions and Reports Tips and Tricks
Payroll run
PrepareMe TellMe
3
ShowMe
LetMe HelpMe
5
India SAP CoE, Slide 8
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.
PrepareMe TellMe
3
ShowMe
LetMe HelpMe
5
India SAP CoE, Slide 11
Rules (PE02)
Functions (PE04)
Operations (PE04)
SCHEMA
The payroll schema contains calculation rules to be used by the payroll driver during payroll. The personnel calculation schemas define the basic process of payroll or time evaluation Schema is Basically collection of Functions and schemas to be processed in sequential manner during payroll run. Schemas can call other schemas within them using function COPY. Transaction code for Schemas is PE01 Schemas are Country Specific Report RPDASC00 can be used to search Schemas for Time and Payroll. Edit Commands for Schema D Deletes a line I Inserts a line C Copies a line DD Indicates the start / end of a block to be deleted CC Indicates the start / end of a block to be copied A Places the block after the chosen line B Places the block before the chosen line
The system performs the following steps: Updates the databases Imports required infotypes Gross calculation of pay The system performs the following steps: Processes basic data and time data Queries off-cycle payroll runs Reads payroll account of the last period accounted Processes time data and calculates the individual gross values Performs factoring Net calculation of pay
The system performs the following steps: Calculates net remuneration Performs bank transfers
Functions in Schema
Functions are used in Schema. Used to perform business process specific calculation within the Payroll Driver run. Transaction Code : PE04 Functions can me created with customer development. Z* Few examples for Payroll Functions: PIT/PRT -Function PIT will process a particular wage type or all wage types in Input table/based on the parameter value PRT -Function PRT will process a particular wage type or all wage types in Result Table based on the parameter value COPY -Function copy is used to copy a subschema in main schema IF & ENDIF - Used for conditional statement execution
Schema Structure
The system processes these functions in sequence. A function must be processed successfully before the next functions in the source text can be processed. Column D (Execution of function or subschema) This indicator determines whether the function or subschema specified in a line of the source text is executed. If you enter an asterisk (*) in this field, you deactivate the function or subschema, in other words, the function or subschema is not included when the schema is executed. Function Most functions perform specific tasks that collect, process, or display data. There are also Functions to control the process: conditions (IF...ENDIF) and loops (LPBEG...LPEND) Functions to call subschemas (COPY) Different functions to call personnel calculation rules
Short text
Work Place/Basic Pay
Description
Table WPBP is filled by the infotypes Actions (0000), Organizational Assignment (0001), Planned Working Time (0007), Basic Pay (0008), and Cost Distribution (0027). Table RT contains the result wage types of the current period for which payroll is run. Data is transferred from table IT to table RT using the operation ADDWTE. CRT contains the cumulations of wage types in table RT over a certain time period. Every entry in the Bank Transactions table (BT) of an employee, corresponds to a payment that was created in a payroll period for this employee. Table C0 contains global information about the cost distribution for wage types.
RT Results Table
CRT
BT
C0
Cost Distribution
Short text
Description
Input Table
During the payroll run table IT is filled with data that is to be processed. Data is transferred to table RT using operation ADDWTE.
OT
Output Table
ORT
Table ORT is table RT from the last payroll result (usually from the previous payroll period). Tables LRT and VORT are also formed from table ORT.
Operations in PCRs
Working with wage types in a rule is sort of like working with internal tables in ABAP. The function that called the rule (PIT, PRT, P0014 or whatever) loops through the table, placing each row, one at a time, in a 'header' space. You work with the wage type in that header space, and when finished add it back to the table. Transaction Code : PE04 Operations can me created with customer development. Z* Few examples for Payroll Operations: AMT ex: AMT= 1000 (Read amount from wage type 1000) NUM ex: NUM=KGENAU (Read number from constant GENAU in table T511K)
RTE 1000) ex: RTE= 1000 (Read RATE from wage type
Rule Structure
The rules treatment of wage types is also affected by how it is called by the function. The rule gets its wage types from the function, so the function controls what the rule can process. Parameter 1 will have PCR for a particular function which can access a PCR Parameter 2 has the following values: GEN Only access the **** wage type section of the rule. Pxx Like GEN but brings along the value of the processing class xx. Exx Same as Pxx except for evaluation classes. (blank) Access the section of the rule that corresponds to the current wage type (will process only a specific wage type)
Pcr: ZA01 will be processed for all ESG groupings of wage type /181
Pcr: X043 & X047 will process wage type only for a specific wage type not all wage types in input table.
Pcr: X042 & X047 will process all wage types in input table.
PrepareMe TellMe
3
ShowMe
LetMe HelpMe
5
India SAP CoE, Slide 49
Example-1:
Example 1 Calculating a COLA Wage Type The first example multiplies wage type 0BAS by 0.15 and puts the result into wage type 0COL. Figure 8 shows the IT before rule ZUA1.
Example-1 Contd.
Figure 9 shows the processing section for rule ZUA1, showing calculation done on wage type 0BAS.
Example-1 Contd.
See Figure 10 for the IT after rule ZUA1 was processed, showing the new wage type 0COL with the same A and AP splits as wage type 0BAS, and 0.15 in the NUM field to reflect the percentage used in calculation. Figure 10 IT after processing of rule ZUA1
Example-2
Example 2 - Restricting COLA to Specific Groups of Employees Rule ZUA3 shows how to restrict COLA based on personnel area and employee subgroup. The calculation is the same 15 percent of wage type 0BAS is put into wage type 0COL. The IT is the same as rule ZUA1, both before and after processing. The difference is in the processing section (Figure 11). Figure 11 Processing section for rule ZUA3
Example-2 Contd
If the employee is in personnel area ACAF, then you look at which employee subgroup they are in (OUTWP operation with the PERSB option). If they are in employee subgroup PS, then you calculate COLA. For employees who are not in personnel area ACAF, or are in ACAF but not employee subgroup PS, you perform the ADDWT * operation. This copies wage type 0BAS from the header row to the IT. If you didnt do this, that wage type would be dropped from the payroll calculation at this point.
Example-3
Example 3 - Bracketed Calculations & Flat-Amount Override The third example shows how to use the AMT operation to make decisions based on a wage types value. A nested decision structure is used calculate COLA with various rates. If wage type 0COL already has a value then you keep that amount instead of doing the calculation. Since you ran out of room in the variable key in rule ZUA4, you break the logic into two rules, calling rule ZUA5 from ZUA4 when needed. The IT before processing is the same as in the previous examples, but the processing is significantly different (Figure 12).
Example-3 Contd.
Example-3 Contd..
Notice how the PIT function starts with rule ZUA4, branches to ZUA5 and then returns. The IT before processing now has 0COL in it (Figure 13).
Example-3 Contd..
The processing section now sees 0COL and simply passes it on to the outgoing IT table (Figure 14).
A wage type has 99 processing classes, though Payroll does not use every one of them for every countrys payroll. Table T52D8 shows which processing classes apply to each country. Customers can use processing classes 90 through 99 for their own purposes and the others are delivered by SAP.
Figure 16 Click on the blue "i" icon to document the processing class
India SAP CoE, Slide 63
Example-4
Example 4 is the same calculation logic as Example 3, but the amounts are moved into constants, and use a processing class to specify the COLA wage base. Table T511K, or view V_T511K, holds payroll constants. These constants are date-effective, and are read with the end-date of the pay period being calculated. First you set up the new processing class. For customer-defined processing classes, start with 99 and work down. For this case, use processing class 90. In the IMG, go to the section for processing and evaluation classes (Figure 15).
Rule ZUA3 also changes since you now have to execute a rule for a specific processing class. Use the P90 value for parameter 1 (line 150). (See Figure 19.)
Example-4 Contd.
Example-4 Contd..
When payroll runs, the processing section for rules ZUA6 and ZUA7 look much the same as before, except you see constants and processing classes (Figure 20). Figure 20 Processing section for rules ZUA6 and ZUA7 with constants and processing classes
When modifying wage types, constants, and other data via views in transaction SM30 or the IMG, click on the blue i or Info button for documentation. The current documentation is brought up in display mode. Click on the edit button or press F5 to maintain it. Transaction PDSY is a universal way to access all this documentation, regardless of where it comes from. Via PDSY, you can view and edit documentation, using the same editor, for many different objects. Early releases of R/3 used report RPDSYS00 to view and maintain documentation, but it has been replaced with transaction PDSY. While RPDSYS00 may continue to exist, you cannot be assured it is showing you the most recent documentation. Document the Why Each rule, schema, wage type, and constant can be documented online. Click on the Goto menu and select Documentation. From there, you can enter documentation on why you are making the changes, reference the transport it is assigned to, and perhaps enter other change management information (i.e. issue number, ticket number and so on). The critical part is to define why you are making the change, not just saying what the rule does. Most people who have to come behind you to modify the rule can see what the rule is doing, but may not know why it was done a certain way or if there are other dependencies in the schema. This sort of documentation requires very little effort, and saves much time in the future.
Schema(PE01)
Contains
Rules(PE02)
Contain
May Manipulate
Functions(PE04)
May Manipulate
Operation(PE04)
Wage Type(T512W)
Exercises
1. write a PCR to read amount from a certain wage type (Ex: wage type 1000) in input table and multiply it with the number of any other wage type (Ex: wage type 1001) and then store it in the first wage type (Ex: wage type 1000). 2. write a PCR to read amount from a certain wage type (Ex: wage type 1000) in input table and divide it with the number of any other wage type (Ex: wage type 1001) and then store it in the first wage type (Ex: wage type 1000). 3. write a PCR to restrict the above example for a certain personnel area and employee subgroup (Ex: for wage type 1000) 4. Compare the amount against the wage type (Ex: amt of wage type 1000) of above examples and if it is greater than 50 then only add it to the output table.
Transactions
PE01- Payroll Schema PE02- PCR (Personnel calculation rule) PE04- Payroll Functions & Operation PDSY- Documentation for payroll function/operation PC00_Mxx_CALC- Payroll Run PC_Payresult- Payroll Results
PrepareMe TellMe
3
ShowMe
LetMe HelpMe
5
India SAP CoE, Slide 95
HelpMe
Tips and Tricks
1.While writing custom operations or functions it is recommended to copy the source code to Z Program and then use. and also before releasing these changes it is strictly recommended to do the version comparison of an object. 2. Be careful while releasing transports related to schema changes as they are date dependant. Dependency must be checked with respect to dates of a particular schema before release. 3. It is always recommended to do a thorough impact analysis before touching any payroll schema or PCR. 4. Be careful with the usage of PRT and Pxxxx functions. wrong syntax of these functions will leads to double output in payroll.
Any Questions
Thank You