Go Back   Wiki NewForum | Latest Entertainment News > Career Forum & Tips


SAP Payroll Basics - Part 1


Reply
Views: 7664  
Thread Tools Rate Thread
  #1  
Old 12-14-2008, 12:11 PM
saphr saphr is offline
Member
 
Join Date: Dec 2008
Posts: 163
Default SAP Payroll Basics - Part 1

The area most often overlooked when training people on SAP Payroll is the basic, fundamental meaning and usage of payroll schemas, rules, wagetypes and their associated processes.
We will try to correct that. First, we will present an overview of the basic parts of the payroll process, then in subsequent articles we’ll go into more detail on each one. Not every possibility will be covered – that would be a multi-volume hard-back series of books, not an easily read web-based article. But we will cover the basics in a way that gives you a good understanding of SAP schemas and rules – from there you can use that knowledge base to learn as much as you want about the rest of this subject.

SCHEMAS In SAP HR terms, a payroll function is not the same as an ABAP function. A payroll function does consist of ABAP code, but it is not executed in the same way an ABAP function would be. Payroll functions are executed within a schema by the payroll driver program (let’s assume RPCALCU0).
A schema is just a collection of functions executed in a specific order – each one passing its results on to the next. Schemas are always created and edited via transaction PE01, but are actually stored as a collection of rows in tables T52C0 (SAP standard schemas) and T52C1 (customer-created schemas and modified SAP-standard schemas). The payroll driver reads the lines in T52C0/T52C1 and executes the functions one by one.
So how do we make the leap from a payroll function stored in a table to the execution of ABAP code to get the work done? In transaction PE04 you can see the ABAP code associated with every function. The function name in the schema correlates to an ABAP form – for example payroll function WPBP maps to the ABAP form ‘fuwpbp’; function USTAX maps to form ‘fuustax’. So when the payroll driver is executing the schema, it takes the function name from the current row in schema, puts an ‘fu’ on the beginning of the name, and then does a ‘perform’ statement on it. It’s a very simple and elegant design.

WAGETYPES

In a broad sense, a wagetype simply holds a piece of data – a rate, number, and/or amount. But more specifically, a wagetype has dozens of attributes that control how it is manipulated and processed. In the end though, it ends up as an object in the payroll results database that stores a rate, number, and/or amount.
The most typical use of a wagetype is to store the amounts of earnings, deductions and taxes in an employee’s paycheck. A person’s base pay is stored in a wagetype, the amount of their ffice:smarttags" />United Way deduction is stored in a wagetype, and their taxable wages & taxes are stored in wagetypes. Wagetypes, as the primary data element for employee paychecks, are also mapped to FI/CO accounts to record the debits and credits resulting from the paycheck and reported on the W-2 and other tax forms.
Wagetypes can also be used to store statistical data – such as the number of hours worked in a pay period, the average weekly wages for the past six months, or the amount of wages eligible for a profit sharing calculation. Wagetype attributes are stored in several tables, but the central table is T512W. Much more time will be spent on various aspects of T512W.
There are three categories of wagetypes – model, technical, and user. Model wagetypes are delivered by SAP for customers to use as guidelines for creating their own wagetypes. They always start with a letter and SAP may add, delete or update them in system upgrades or HRSP’s. Technical wagetypes always start with the ‘/’ symbol, and are delivered by SAP. They are intended for very specific standard processing in payroll, and while you can modify them, SAP may also update them during upgrades or HRSP’s. So if you ever (I mean EVER) change a technical wagetype, check it after each upgrade or HRSP to make sure it still has the attributes you want. And never delete a technical wagetype. User wagetypes always start with a number – and these are wagetypes that SAP does not change during upgrades & HRSP’s. OK, SAP rarely changes them in upgrades and HRSP’s. User wagetypes are for all the company-specific payroll payments and deductions.

RULES AND OPERATIONS


A long-time client of ours once created a screen-saver message that stated ‘Payroll Rules!’. Those of us who were experienced SAP Payroll analysts or consultants immediately saw the double meaning, and corny humor, in that message. Rules contain the most basic logic used in SAP Payroll. Where a schema is a collection of functions, a rule is a collection of operations. An operation is a very basic piece of logic that is used, mostly, to manipulate wagetypes. For example, operation MULTI multiplies the number and rate fields of a wagetype to determine the amount to pay an employee. Operation OUTWP retrieves specific data about an employee so that another operation can make a decision on how to process it. For example, if the work contract on infotype 1 is UA then do ‘x’, if it is UB then do ‘y’, otherwise do ‘z’.
Operations can also be viewed in transactions PE04 and PDSY, and are edited with transaction PE02. Where a function’s ABAP equivalent form starts with ‘fu’, an operation’s ABAP form starts with ‘op’. For example, operation MULTI would have an ABAP form ‘opmulti’. Rules, like schemas, are stored in a table – rules are stored in T52C5.
The more senior SAP consultants who have been working with computer systems for many years often find similarities between payroll rules and programming mainframe computers in Assembly language. While there is nothing fancy about operations, when used correctly together they can be very powerful.
Hopefully we’ve presented a good but brief overview that makes sense. In our next SAP Payroll Technical Basics article we will get into more detail on the common functions used in SAP’s payroll schema.










Central Functions in the Payroll Schema
Previously we presented an overview of the foundation of payroll processing - the basic structure of schemas, rules, function and operations. Now let's take a look at the major functions in the payroll schema.
Functions can have up to four parameters, and usually the SAP documentation does a good job telling you what each parameter does. Documentation for functions and operations can be found via transactions PDSY or PE04.
COPY


This is the same as 'include' in ABAP and other programming languages. COPY just inserts the schema contained in parameter 1 when payroll is executed. Good programming style and good schema configuration style are basically the same - put commonly used logic in an 'include' so that it can be used in several places and to improve readability.


BLOCK


As of release 4.0 the schema log is organized in a collapsible tree structure. BLOCK BEG starts a node and BLOCK END ends the node. Everything between BEG and END is contained within the node. BLOCK BEG/END can be nested several levels deep. Again, place the BLOCK BEG/END functions appropriately to make the log easy to read.


IF/ELSE/ENDIF


There are two ways to specify the true/false condition for an IF function. SAP has several built-in conditions that you can use in parameter 2 (IF NAMC in schema U000). You can also specify a custom rule in parameter 1, and in the rule perform whatever logic you want. In the rule you use operation SCOND to set the true/false switch for the IF function.


Pxxxx


The payroll driver & schema read and process data from many infotypes. The common way of doing this is with infotype-specific functions - named as 'P' and the four-digit infotype number. So, P0014 reads and processes data from infotype 14, P0168 processes life insurance plans from infotype 168 and P2010 reads in additional payments from infotype 2010. Many of these functions, but not all, allow you to futher refine the processing with a payroll rule. Schema UAP0, for example, shows that P0014 is processed futher by rule U011. Function P0168 is one of those that does not use a rule (in some older releases it does) - you specify options in parameter 1 instead (see schema UBE1).
Some infotypes are used in payroll, but do not have a Pxxx function. Examples include infotypes 207, 208, 209 and 210 which are all read and processed in the main tax function USTAX. Infotypes 0, 1, 7, and 8 are processed by function WPBP.


PIT


PIT is an acronym for Process Input Table, and is one of the most used and most powerful functions in payroll. When wagetypes are read into payroll by the Pxxx functions, they are stored in an internal table called IT - Input Table. PIT loops through that table and applies logic contained in rules. So for each wagetype in the IT, it will apply the logic from a rule.
The goal of PIT is to move wagetypes out of the IT and into the RT - Results Table. Most often, the rules called by PIT will change some attributes of the wagetype and then transfer it from the IT to the RT. The wagetype can also be left in the IT and even moved to other tables. We'll cover those possibilities when we reiew how operations work.
A good example of PIT is in schema UAL0 - PIT X023. When the payroll driver gets to this point in the schema, PIT will look at each wagetype in the IT, and rule X023 tells it to do certain things depending on the wagetype's value in processing class 20. Values 3, 4, 5, 6, 9 and B will move the wagetype to the RT, while values 1, 7, and 8 leave it in the IT. Value 2 has no operation, essentially eliminating the wagetype from the IT.


PRT


PRT is short for Process Results Table. Although most wagetype processing happens via PIT, there are several occasions where you want to process the wagetypes that have already been transferred to the Results Table (RT). PRT work much the same as PIT, looping through the RT and applying logic from a rule.
In schema UTX0, PRT is used to process tax wagetypes that are already in the RT. Function UTX0 (US tax function) returns its wagetypes directly to the RT, so any processing on tax wagetypes has to be done with a PRT function.


ACTIO


The ACTIO function processes a payroll rule, but it does not loop through a wagetype table. Instead it can loop over the different workplace/basic pay records and process the rule for each one. For example, suppose the employee had two infotype 1 records for the current pay period. ACTIO would have two records to loop through.
Schema UTX0 again has a good example of ACTIO using rule UWH1 to calculate the number of working hours in the pay period.



Reply With Quote
  #2  
Old 05-29-2009, 08:49 PM
sbogner sbogner is offline
Junior Member
 
Join Date: May 2009
Posts: 5
This wiki content is copied illegally from my site - two different articles: http://www.insightcp.com/res_13.html and http://www.insightcp.com/res_19.html.

Please remove the content from this wiki as it violates the copyright.

Steve Bogner
Managing Partner
Insight Consulting Partners
Reply With Quote
  #3  
Old 05-30-2009, 07:43 AM
welcomewiki welcomewiki is offline
Member
 
Join Date: Dec 2008
Location: India
Posts: 80,566
Hi

This is a forum and our Aim is to share the knowledge and any one can post not like only Wiki team will post the content.

And in this content one of the member shared this info.

Thanks

Quote:
Originally Posted by sbogner View Post
This wiki content is copied illegally from my site - two different articles: http://www.insightcp.com/res_13.html and http://www.insightcp.com/res_19.html.

Please remove the content from this wiki as it violates the copyright.

Steve Bogner
Managing Partner
Insight Consulting Partners
Reply With Quote
  #4  
Old 06-01-2009, 12:41 PM
sbogner sbogner is offline
Junior Member
 
Join Date: May 2009
Posts: 5
Sir - This site's user agreement that everyone must agree to before registering states, in part:

"By agreeing to these rules, you warrant that you will not post any messages that are obscene, vulgar, ***ually-oriented, hateful, threatening, or otherwise violative of any laws."

Copying my firm's copyrighted material does indeed violate copyright law, which is why I am requesting you remove the content from this site.

Steve Bogner
Managing Partner
Insight Consulting Partners
Reply With Quote
Reply

Tags
sap hr

Latest News in Career Forum & Tips





Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2024, vBulletin Solutions, Inc.