Understand Payroll Wage Type Processing Payroll Schema and Rule Basics Download
Understand Payroll Wage Type Processing Payroll Schema and Rule Basics Download
by Steve Bogner, Managing Partner, Insight Consulting Partners Relationship of Payroll Driver, Schema (Functions), Rules ( perations) 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 RP A! U", in #exico it is $#% A! ", and in anada RP A! &". Each one is di''erent, but they share a common core o' 'unctionality. (he )ob o' the payroll driver is to process payroll 'unctions as speci'ied in a payroll schema. (hese payroll 'unctions each per'orm a speci'ic )ob, 'or example * reading data 'rom in'otypes, calculating taxes, and processing +age types. Some 'unctions process payroll rules. Rules are a collection o' payroll operations. Each operation does a small unit o' +or,, such as multiplying a +age type-s number by a rate to get an amount. Schemas are edited +ith transaction PE"., and rules Schemas 3PE".6
Functions 3PE"16
Rules 3PE"06
9perations 3PE"16
Figure ! / Processing relationships +ith PE"0. Functions and operations are maintained +ith transaction PE"1. (o vie+ payroll results, use transaction pc2payresult 3or in earlier R45 releases go to Tools"Payroll result"Display in the Payroll menu6. 3See Figure !.6(he standard payroll schema 'or a country can be derived 'rom table t7""l. 8' the country in table t7""l has an # in the l$ %aming Conv 'ield, then the schema is &R Country 'n$icator plus (((. 9ther+ise, it is the 'S Co$e plus ((. So the U.S. has schema U""" and 'or #exico it is #%"". &ea$er an$ Ta)le Wage Type Concept :hen calculating payroll, +age types are read 'rom in'otypes and the (ime #anagement cluster and stored in an internal table called the 8nput (able 38(6. 3See Ta)le !.6 8n A;AP terms, this is simply an internal table. <arious payroll 'unctions and operations can read and update data in this table. Similar to A;AP internal tables, there is a header ro+. (hat header ro+ de'ines +hich ro+ o' data can be accessed by the payroll operations. A'ter manipulating the data in the header ro+, you can save the ro+ bac, to the 8(, save it to another payroll table, or ignore it. 8n (able . there are three +age types, and +age type 0."" is currently in the header ro+. A'ter you are done +ith +age type 0."", +age type 10"" is moved into the header ro+. (able . :age type 0."" 0."" 10"" .7"" Ta)le ! 8nput (able =umber " " " 1" Rate " " " .".5" Amount .""."" .""."" 0"."" 1.0.""
Page . o' 07
Schema an$ Rule %aming Conventions ustomer modi'ied schemas and rules need to begin +ith *. #any customers simply replace the 'irst letter o' the standard schema +ith a * / i.e., their modi'ied copy o' UAP" becomes ?AP". ;ut there can be problems +ith that convention. For example, you might later implement anadian payroll and need a modi'ied version o' schema &AP", but ?AP" is already used 'or the U.S. For many years, 8-ve used a naming convention o' ? plus the country identi'ier and a se@uential number 'or modi'ied rules and schemas. So a modi'ied UAP" +ould become ?U". and a modi'ied &AP" becomes ?&".. +$itor Documentation Aocumentation 'or the 'unction, operation, schema, and rule editors is available online at http>44help.sap.com. lic, on S,P R-. an$ R-. +nterprise and then select your release level and language. (hen navigate to the &uman Resources"&R Tools section. F! &elp 8n the schema and rule editors, place your cursor on a 'unction or operation and press F. to get help text. A schema or a rule-s documentation is available in the editor via the /oto"Documentation menu. 8n the schema editor, the F1 ,ey sho+s possible values 'or each o' the 'our parameters 'or +hatever 'unction is entered on that line. (he same documentation / and more / is available via transaction PDSY. Creating a Test Schema For testing purposes, it is use'ul to have a version o' the payroll schema that does not care about the control record 3transaction PA036 settings. ;ypassing the control record lets you run and save the results 'or any pay period needed, +ithout having to update the control record. (here-s no problem +ith having such a schema around, since the payroll driver does not save payroll results 'rom a schema that ignores the control record in a production system. For examples, 8 +ill sho+ you ho+ to create t+o schemas / ?UA", +hich +ill be used in production and +ill chec, the control record, and ?UA(, +hich ignores the control record and is used 'or testing purposes only. First, create a copy o' SAP-s schema U8=" and name it ?UA0. 8n the schema editor 3transaction PE026 enter schema U8=", and clic, the copy button, or Schema"Copy in the menu. Enter ?UA0 'or the To schema. (hen edit ?UA0 and ma,e the CHECK ABR line executable by removing the asteris, in the D column. 3See Figure 0.6 (he $E & 'unction is commented out by SAP in the standard schema, so you uncomment it here 'or use in the main ?UA" schema.
=o+ copy the SAP*standard schema U""" to ?UA. and comment out the initialiBation schema U8=" 3 Figure .6.
Page 0 o' 07
Figure . omment out the initialiBation schema U8=" 8n the schema editor, create the production schema 3don-t copy it 'rom anything6 in my example ?UA". ;e sure to chec, the Schema can )e e1ecute$ chec,box. 3See Figure 2.6 9nly executable schemas can be entered into the payroll driver selection screen.
Figure 2 hec, the Schema can )e e1ecute$ chec,box (he production schema ?UA" is a simple one, )ust t+o lines. 3See Figure 3.6 First, you call the initialiBation schema, and then you call the main calculation schema ?UA..
Page 5 o' 07
Figure 3 Schema ?UA9 opy schema ?UA" to your test schema ?UA(. 3See Figure 4.6 Cou +ant ?UA( to ignore the control record, so have it use schema U8=" 'or initialiBation. Remember that CHECK ABR is commented out in U8=". (here'ore, both the production and test schemas no+ use the same calculation logic in schema ?UA. / +hich ,eeps them in sync.
Figure 4 opy schema ?UA" to test schema ?UA( Cour custom rules 'or these examples +ill go in a copy o' schema UAP". opy UAP" to ?UA5 and add lines 'or each o' the 'ive examples. 3See Figure 5.6 Edit schema ?UA. to COPY ZUA3 instead o' COPY UAP0 3not sho+n6.
Page 1 o' 07
Page 7 o' 07
Figure 7 Editor 'rom the Enterprise release (ypical documentation might loo, li,e +hat is sho+n in Figure 8. Another U0 heading +as added 'or 9o$ification &istory.
Page E o' 07
:hen modi'ying +age types, constants, and other data via vie+s in transaction SM30 or the 8#F, clic, on the blue i or 'nfo button 'or documentation. (he current documentation is brought up in display mode. lic, on the edit button or press F7 to maintain it. (ransaction PDSY is a universal +ay to access all this documentation, regardless o' +here it comes 'rom. <ia PDSY, you can vie+ and edit documentation, using the same editor, 'or many di''erent ob)ects. Early releases o' R45 used report RPASCS"" to vie+ and maintain documentation, but it has been replaced +ith transaction PDSY. :hile RPASCS"" may continue to exist, you cannot be assured it is sho+ing you the most recent documentation. Document the :Why; Each rule, schema, +age type, and constant can be documented online. lic, on the /oto menu and select Documentation. From there, you can enter documentation on +hy you are ma,ing the changes, re'erence the transport it is assigned to, and perhaps enter other change management in'ormation 3i.e. issue number, tic,et number and so on6. (he critical part is to de'ine why you are ma,ing the change, not )ust saying what the rule does. #ost people +ho have to come behind you to modi'y the rule can see +hat the rule is doing, but may not ,no+ +hy it +as done a certain +ay or i' there are other dependencies in the schema. (his sort o' documentation re@uires very little e''ort, and saves much time in the 'uture.
Page H o' 07
Figure !! Payroll driver selection screen 'or the United States 8' you are using the schema ?UA" 'or production payroll, the payroll period is al+ays le't at Current perio$ unless you are only running simulations, +hich tells the payroll driver to get the current pay period 'rom the payroll control record. 8' you use the test schema ?UA(, you could select ther perio$ and then enter +hatever period and year you +ant to run, and save those results 3only in a non*production system6. (he payroll area in this section is re@uired and tells the payroll driver +hich payroll area to use 'or deriving the current period, the period begin and end dates, and other payroll area*related data. (he selection section speci'ies +hich groups o' employees you include in the payroll run. (he payroll area entered here determines +hich ones are included in the payroll run. (hese payroll areas need to have the same setup as the one entered at the top o' the screen / the same period de'inition and pay dates, 'or example. Feneral program control is used to tell the payroll driver ho+ to run the payroll. 9''*cycle payroll uses various reason codes, and those codes can be entered here. 8' running an o''*cycle payroll, you speci'y the type o' payroll and the date o' that payroll in the ff=cycle payroll line. (he schema line speci'ies the main schema to use 'or the calculation. 8' you +ant to 'orce a payroll run to go bac, to a certain date and recalculate everything since then, that date is entered in the Force retro>accounting as of 'ield. And 'inally, there is an option 'or a test run / also ,no+n as a simulation run.
Page I o' 07
Each payroll 'unction and operation has the ability to put additional diagnostic in'ormation in the payroll log. For testing payroll, it is good to have the log sho+n. 8n a production payroll, sho+ing the log 'or a +hole payroll area +ill severely a''ect system per'ormance. (he log re@uires a lot o' temporary storage and signi'icant processing resources. 8' the Display log for time management a$$itionally is selected, then you +ill be able to )ump 'rom the payroll log into the day processing 3AACPR 'unction6 part o' the gross payroll schema U("". 9ther+ise, that part o' the log is not generated. Aisplay variants can be created to customiBe the +ay the payroll log is displayed, and i' one has been de'ined you can select it in the Display variant for log line. Finally, the remuneration statement parameters are used to de'ine +hich, i' any, $R Form is displayed at the end o' the payroll calculation. 8' a 'orm is speci'ied here and the log is not displayed, then the payroll driver displays the results via that $R Form. 8' the log is displayed, it 'irst displays the log but also gives you a button at the top to display the $R Form.
Page J o' 07
Figure !0 Payroll log in Enterprise (he log tells you that one employee +as selected, and one employee +as success'ully calculated. (he number o' periods calculated may be more than the number o' employees, since it counts the current and retrocalculated periods. Employees re)ected 'rom payroll +ould be counted in the Re6ecte$ line. (he payroll driver re)ects employees 'or t+o primary reasons / a lac, o' basic and consistent master data, and customiBation errors. Each node can be opened to vie+ deeper levels o' processing, until you get do+n to a particular 'unction and4or rule. (o get to my example, you expand the nodes to the point sho+n in Figure !..
Figure !. Expand the nodes For the P8( 'unction and rule ?UAI, you can see the 'nput, Processing, and utput sections. (hese sections vary by 'unction and operation, but are vital to testing and troubleshooting. 8' you double*clic, the P'T 'unction, the payroll driver displays the contents o' the input, processing, and output sections together in one list. 9r you can double*clic, any one section to see its contents alone. !i,e+ise, you can 'urther expand each section to see individual components / in this case, +age types.
8n many o' the detailed lists, you can see t+o icons / a green plus sign +ith a do+n arro+ and a red minus sign +ith an up arro+ 3Figure !26. (hese icons control the level o' detail that is displayed in the list. lic, the green plus to see more detail and the red minus to see less.
Figure !3 Select the section o' the rule that +ill process +age type ";AS
Page .. o' 07
(he rule-s treatment o' +age types is also a''ected by ho+ it is called by the 'unction. (he rule gets its +age types 'rom the 'unction, so the 'unction controls +hat the rule can process. Parameter 0 has the 'ollo+ing values> FE= / 9nly access the KLLLL- +age type section o' the rule. Pxx / !i,e FE= but brings along the value o' the processing class Kxx-. Exx / Same as Pxx except 'or evaluation classes. 3blan,6 / Access the section o' the rule that corresponds to the current +age type
Parameter 5 can have t+o values> =9A; / 9nly access the KL- employee subgroup grouping section o' the rule. 3blan,6 / Access the rule speci'ically 'or each employee subgroup grouping
(he employee subgroup grouping 'or personnel calculations rules is maintained via vie+ v27"52b.
Figure !4 8( be'ore rule ?UA. Figure !5 sho+s the processing section 'or rule ?UA., sho+ing calculation done on +age type ";AS.
Page .0 o' 07
Figure !5 Processing section 'or rule ?UA. See Figure !7 'or the 8( a'ter rule ?UA. +as processed, sho+ing the ne+ +age type " 9! +ith the same A and AP splits as +age type ";AS, and "..7 in the =U# 'ield to re'lect the percentage used in calculation.
Page .5 o' 07
Figure !8 Processing section 'or rule ?UA5 8' the employee is in personnel area A AF, then you loo, at +hich employee subgroup they are in 39U(:P operation +ith the PERS; option6. 8' they are in employee subgroup PS, then you calculate 9!A. For employees +ho are not in personnel area A AF, or are in A AF but not employee subgroup PS, you per'orm the AAA:( L operation. (his copies +age type ";AS 'rom the header ro+ to the 8(. 8' you didn-t do this, that +age type +ould be dropped 'rom the payroll calculation at this point.
verri$e
(he third example sho+s ho+ to use the A#( operation to ma,e decisions based on a +age type-s value. A nested decision structure is used calculate 9!A +ith various rates. 8' +age type " 9! already has a value then you ,eep that amount instead o' doing the calculation. Since you ran out o' room in the variable ,ey in rule ?UA1, you brea, the logic into t+o rules, calling rule ?UA7 'rom ?UA1 +hen needed. (he 8( be'ore processing is the same as in the previous examples, but the processing is signi'icantly di''erent 3 Figure 0(6.
Page .1 o' 07
Figure 0( Processing using A#( operation =otice ho+ the P8( 'unction starts +ith rule ?UA1, branches to ?UA7 and then returns. :hen +age type " 9! is entered via in'otype 0".", the rule-s behavior changes. (he 8( be'ore processing no+ has " 9! in it 3 Figure 0!6.
Figure 0! 8( +ith " 9! (he processing section no+ sees " 9! and simply passes it on to the outgoing 8( table 3 Figure 006.
Page .7 o' 07
Figure 00 9utgoing 8( table +ith " 9! =otice that i' +age type " 9! is entered 'or someone +ho is not in personnel area A AF and employee subgroup PS, then it +ould be paid any+ay. Rules ?UA1 and ?UA7 are processed only 'or +age type ";AS. So i' +age type " 9! existed in the 8( be'ore this rule, it +ould simply be passed on to the next 'unction. (his can be restricted by customiBing vie+s v27..2b, v27"52g and v2"".p2, so that " 9! cannot be entered 'or this combination o' personnel areas and employee subgroups.
+1ample 2
$ard*coding amounts and +age types into rule is a bad practice. Example 1 is the same calculation logic as Example 5, but the amounts are moved into constants, and use a processing class to speci'y the 9!A +age base. (able t7..,, or vie+ v2t7..,, holds payroll constants. (hese constants are date*e''ective, and are read +ith the end*date o' the pay period being calculated. First you set up the ne+ processing class. For customer*de'ined processing classes, start +ith JJ and +or, do+n. For this case, use processing class J". 8n the 8#F, go to the section 'or processing and evaluation classes 3 Figure 0.6.
Page .E o' 07
Figure 0. 8#F section 'or processing and evaluation classes Execute the 9aintain processing classes an$ their specifications item, and create processing class 8(. =ote that you can clic, on the blue "iE icon to document the processing class 3Figure 026.
Page .H o' 07
Figure 02
Select the processing class J" ro+ and then double*clic, on Processing class specifications. $ere is +here you de'ine each value o' processing class J" 3Figure 036. Cou can also document each value. (hen go to vie+ v27.0+2o to set +age type ";AS processing class J" e@ual to ..
Figure 03 Set +age type ";AS processing class 8( e@ual to ! =o+ you create the constants in t7.., 3using transaction sm5" and vie+ v2t7..,6. Each constant can be documented 3Figure 046.
Page .I o' 07
Figure 04
reating constants
Rule ?UA5 also changes since you no+ have to execute a rule 'or a speci'ic processing class. Use the P8( value 'or parameter . 3line !3(6. 3See Figure 05.6
Page .J o' 07
Figure 05 Use the P8( value 'or parameter . 3line !3(6 :hen payroll runs, the processing section 'or rules ?UAE and ?UAH loo, much the same as be'ore, except you see constants and processing classes 3Figure 076.
Figure 07 Processing section 'or rules ?UAE and ?UAH +ith constants and processing classes
+1ample 3
(he last example involves the handling o' +age type splits. Some o' the splits have documentation, others don-t. :hen vie+ing the R( table +ith the pc2payresult transaction 3or the Aisplay Results option in the (ools menu in Payroll6, select a split value +ith your cursor and then press F. 'or help. (his gives you the 'ull name 'or the split indicator. Some documentation is also available in transaction PDSY, using operations E!8#8 and SP!8(. See Ta)le 0 'or common split indicators. (able 0 * ommon Split 8ndicators Split indicator A !in,s to table in payroll results =4A Aescription
(his is the ES grouping 'or the +age type, and it is matched up to an ES grouping section o' a payroll rule 'or processing (able :P;P holds basic data 'rom in'otypes ., H, and I.
AP
:P;P
.,
0, 5
ountry*dependent
(his varies by country, but it is typically used to lin, a +age type to tax authorities. 8n the U.S., split . lin,s the +age type to a tax authority in table (A% ost assignment overrides can be entered 'or +age types and time data, and that override data is stored in table .. (he variable assignment type 3v(6 and number 3vn6 lin, a +age type to table <", and the purpose varies per country. 8n the U.S., this is the lin, to a bene'it plan.
&oRe
v(vn
<"
Ta)le 0 ommon split indicators 8n the article in the August4September 0""5 issue o' HR Expert, 8 gave an example o' an employee changing cost centers in the middle o' a pay period. (his causes +age type ";AS to split / allocating a certain amount to each cost center via the AP split. (he challenge, though, is to calculate 9!A 'or each split value, based on the +hole* period amount o' ";AS. (o do this, you create another +age type to hold the +hole*period amount. :hen you cumulate to that +age type / J 9! / you eliminate the splits, and that is +hat causes it to store the amount 'or the +hole period. ;y using J 9! and processing class J", you can no+ have multiple +age types cumulate to the 9!A +agebase, +hich is more realistic. (he other thing you did +as to move the " 9! +age type 'rom in'otype 0"." to in'otype .1. (his +as so that you could allocate the " 9! +age type across the multiple splits. 8n'otypes di''er on ho+ they +or, +ith splits. 3See Ta)le ..6 (able 5 / ho+ 8n'otypes 0".", .7 and .1 handle splits 8n'otype 0"." Split $andling Allocates the AP split based on +hatever day it 'alls +ithin the pay period. For example, the pay period is Man .E to Man 5., and it splits on Man 0". So Man .E to Man .J is AP split N "., and Man 0" to Man 5. is split APN"0. 8' the in'otype 0"." +age type is dated Man .J, it +ill be assigned to AP split ".O i' in'otype 0"." is dated Man 0" it is assigned to AP split "0. :hen read into payroll the AP split is eliminated, so its AP split is blan,. For accounting and reporting purposes, it +ill be assigned to the last organiBation assignment 3table :P;P in particular6, but 'or payroll operations it is not associated +ith either split. 8' processing class ." is set to something other than Bero, then it +ill be split across the pay periods. 9ther+ise it is handled li,e in'otype .7. So i' there is an AP split in the period, in'otype .1 +ill create multiple +age types in the 8( / one 'or each AP split.
.7
.1
Ta)le . $o+ in'otypes 0".", .7, and .1 +or, +ith splits (he behavior o' each in'otype can be customiBed in the payroll rules that are processed +hen 'unctions P0".", P"".7, and P"".1 are executed. (he logic listed in (able 5 is the standard logic 'rom SAP 3'or the U.S.6 / it could be customiBed in your system. So to get 9!A in my example to +or, 'or splits, 8 moved " 9! to in'otype .1 and set its processing class ." to a .. 8n this case, processing class ." is used to tell payroll to allocate +age types across payroll splits.
Page 0. o' 07
=o+, instead o' cumulating the 9!A +age base to +age type J 9!, you could cumulate it into a payroll variable. (his is similar to a +age type, but it is not stored in the payroll result. 8nstead o' doing ADDWT 9COL, you +ould do ADDWT&9COL. (he "P" adds it to the Kvariable- table <AR. (o retrieve the value o' the variable, you +ould do AMT=& 9COL. (here are good and bad points +ith variables. (he good point is that they are easily created dynamically in the payroll rules. (he bad parts are that they do not have splits on them so you can not trac, values per split indicator, they are not stored in the payroll result so it ma,es auditing and explaining calculations more di''icult, and i' you do not clear them 3ZERO=& 9COL 'or example6, then the values 'rom one gross*to*net loop 'lo+ into the next loop. Period 0 had a split in it / a ne+ event 3in'otype """"6 +as processed on .40"4"5. ;ase pay +as pro*rated, giving t+o +age types ";AS to deal +ith 3Figure 086.
Figure 08 ";AS +ith t+o +age types 8n the processing section o' rule ?UAI, you can see that it +as called once 'or each ";AS 3 Figure .(6.
Figure .( Processing section o' rule ?UAI called once 'or each ";AS
Page 00 o' 07
For each o' those executions, the same logic is per'ormed. First, chec, to see i' the current +age type has a processing class J" o' .. (hen, chec, to see i' the employee is in a valid personnel area and employee subgroup. 8' it passes those t+o tests, then it 'irst passes the current +age type along into the output / you don-t +ant to lose the base pay +age types. Eliminate all the splits and add the +age type to the output as J 9!. :age type J 9! then has no splits 'or the +hole pay period, and holds the sum o' all +age types +hose processing class J" e@uals .. 3See Figure .!.6
Figure .! :age ;uilding +agetype J 9! Cou can see that even though ";AS had splits, +age type J 9! in the resulting 8( does not have splits, and represents the sum o' the t+o 3Figure .06.
Page 05 o' 07
=o+ that you have the +hole*period amount 'or the 9!A +age base, you can process 9!A 'or each o' the +age base components. Rule ?UAA is also processed 'or all +age types that have processing class J" e@ual to .. 8n this case, that is the t+o +age types ";AS. Each one is processed as sho+n in Figure ...
Figure .. Processing o' ";AS +age types First, set the amount e@ual to " 9! to see i' there is an override 9!A amount. (he A#( operation loo,s 'or +age type " 9! in the 8( +here the split indicators in the 8( are the same as in the header o' the 8(. So +age type ";AS is in the header +ith an AP split o' ".. 8t loo,s 'or +age type " 9! +ith a split AP o' ". in the 8(. (his is +hy you read " 9! into the 8( via in'otype .1 and processing class ." N .. 8' the amount is e@ual to Bero, then you don-t have a " 9! +age type. =o+, eliminate the splits on ";AS in the header ro+, and go loo, 'or J 9! in the 8(. 8' you 'ind J 9!, then test the amount to see +hat +age brac,et you 'it into. (hen restore the original splits and reset the amount in the header bac, to the original amount / i.e., 'rom the J 9! amount to the ";AS amount. =o+ you are bac, to the original ";AS in the header ro+. #ultiply that amount by the 9!A rate 3constant ?R""56 and create +age type " 9! +ith the result. :age type " 9! in this case has all the same attributes / including the split values / as +age type ";AS. So the 9!A amounts are split and allocated in the same manner as the +age types ma,ing up the 9!A +age base 3 Figure .26.
Page 01 o' 07
Figure .2 base.
9!A amounts split and allocated in the same manner as the +age types ma,ing up the 9!A +age
Steve ;ogner is managing partner at 8nsight onsulting Partners and has been +or,ing +ith SAP $R since .JJ5. $e has consulted various public, private, domestic, and global companies on their SAP $R4Payroll implementationsO presented at the SAP user-s group ASUFO and been 'eatured on the S,yRadio =et+or, program regarding SAP $R. Cou may reach Steve via email at sbognerQinsightcp.com.
Page 07 o' 07