Skip to Content
How to read rules and Schemas1.Structure of relationship in Rules and Schemas:a)Schemas consist of Functions and Sub-schemas b)Some functions have the rules attached to it as one of its parameter c)Rules consist of a set of operations to perform some actions d)Operations and Functions are the executable components image  As per the diagram Set of Operations make a Rule which in turn attached to some functions and those functions embedded in Schemas or Sub-schemas (Inside the main schemas) to decide the flow of the payroll program.  Structure of a Schema:                         imageimageFunc:This column is used to give a function name. Par1, Par2, Par3, Par4: 1.     Function has maximum four parameters. 2.     The function can have zero to four parameters as per the definition of the function. 3.     Pressing F4 we can get the list of all the values which can be used as parameters. 4.     For some functions in the first parameter is the name of the rule created. 5.     These parameter values are predefined the function is being created. D: 1.     This column is used to comment and uncomment a function. 2.     If (*) is being put then the line is commented and will not be executed in Payroll processing. 3.     If nothing is given then the line would be executable. Desc 1.     In this column description for the function is being used. Functions:Functions are used for; •     Performing some payroll computations (E.g. INEPF function calculates the PF amount of an employee during payroll run) •     Calling rules (E.g. P0045 function calls a rule INLN to compute the loan details of a personnel number). •     Getting data from Infotypes (E.g. P0581 will get the data from Infotype-581 for payroll processing). •     For some decisions. (E.g. IF & ENDIF function is used to execute as per the true and false decisions) etc. Rules:     Rules are used for holding a set of operations for a particular requirement to be accomplished. Attributes:1.     Program Class. a.     There are two program classes to be assigned to the rule while creating. i.     Payroll (C). ii.     Time (T). 2.     Country Grouping. a.     For Payroll program class the country grouping should be mentioned. (E.g. 40 for India). b.     For Time management rule the country grouping should be (*). 3.     Employee Sub-grouping. a.     All the wagetypes have an attribute of employee sub-grouping. b.     It varies client to client. c.     Value 3 means EE sub-grouping is 3. d.     Value * means all EE Sun-groupings. 4.     Wagetypes. a.     The wagetype in the internal table which is meant to be processed by the rule. b.     If a value for Wagetype is being given then the particular wagetype is being queried for processing. c.     If **** has been given then all the wagetypes present in the particular internal table will be processed. Structure of the Rule.                    image                         Frequently Used Internal Tables in PY Processing: The Payroll driver uses lots of internal tables used for storing data temporarily in the program for processing. Some of the important internal tables are: imageThe structure of internal tables: imageEE Sub-grouping:     1. The Wagetype is assigned to a particular Employee sub-group.      2.  3 is a particular employee subgroup for basic pay wagetype.      3. * value means for all EE sub-grouping.Wagetype Code:1.     The Wagetype code number is the number assigned to a particular pay component.Wagetype Description:     1. The description for the wagetype code.NUM:1.     If there is a split for the wagetypes then this NUM field will make them different. 2.     If A person’s basic salary is changed in the mid of the month then the wagetype will be split in two amounts with NUM = 01 and NUM = 02.RTE:1.     The RTE column stores a value for; a.     Rate of interest. b.     Number of leave days. c.     Projection factor. Etc. 2.     E.g. In the above diagram /401 wagetype has RTE value 10 which is the projection factor used for different calculations.AMT:1.     This column possesses the amount of the particular wagetype.  Use of the internal tables:1.     The internal tables are being used for calculations on the NUM, RTE & AMT fields. 2.     These internal tables are being read by the rules row by row. 3.     The Calculation rule would be only processed for those wagetypes which are specified in the rule’s source code. 4.     The row in the internal table containing the wagetype which has been defined in rule attributes will be placed in the header of the internal table for processing. 5.     The processing would be as per the operations used in the rule. Some important Operations & Functions:•     The editor for Operations and Functions is PE04. •     While the payroll driver encounters a function and operation it would call a subroutine written in the payroll driver. •     The subroutine name for the operation will be OP****, Where **** will be the name of the operation. •     For E.g. for Operation AMT the subroutine name would be OPAMT. •     The code written for the function will be found as a subroutine in payroll driver as FU****, where **** will be the name of the function. •     For E.g. for function INEPF the subroutine name would be FUINEPF. Operations:AMT:1.     This Operation would fetch the Amount of the wagetype queried in the rule, in the Variable AMT for processing. 2.     The Syntax of the Operation is ZZZOVVVV. 3.     ZZZ -> AMT. 4.     O -> Operand. 5.     VVV -> Value or Variable. 6.     For E.g. (AMT=  1000) will fetch the Amount of Wagetype 1000 into AMT. 7.     Pressing F1 on the AMT Operation will provide the documentation. RTE:1.     This Operation would fetch the Rate of the wagetype queried in the rule, in the Variable RTE for processing. 2.     The Syntax of the Operation is ZZZOVVVV. 3.     ZZZ -> RTE. 4.     O -> Operand. 5.     VVV -> Value or Variable. 6.     For E.g. (RTE=  /401) will fetch the Rate of Wagetype /401 into RTE. 7.     Pressing F1 on the RTE Operation will provide the documentation. NUM:1.     This Operation would fetch the Split indicator of the wagetype queried in the rule, in the Variable NUM for processing. 2.     The Syntax of the Operation is ZZZOVVVV. 3.     ZZZ -> NUM. 4.     O -> Operand. 5.     VVV -> Value or Variable. 6.     For E.g. (NUM=  1000) will fetch the Split indicator of Wagetype 1000 into NUM. 7.     Pressing F1 on the NUM Operation will provide the documentation. ADDWT:1.     This Operation will append one more row in the internal table (Processed by   the rule). 2.     After calculating an amount from a particular wagetype the amount can be assigned to another wagetype and append to the internal table. 3.     For E.g. ADDWT 2050 will add the NUM, RTE, AMT calculated to the NUM, RTE & AMT of the wagetype 2050. 4.     If the Wagetype 2050 is not there before in the internal table then NUM, RTE & AMT would be 0. 5.     If any value of these three variables are present before then they will be added to the calculated ones.  Functions:     PIT:1.     This function will read the internal table IT (Input table). 2.     The function will hold a rule as first parameter.  PRT:1.     This function will read the internal table RT (Results table). 2.     The function will hold a rule as first parameter. PDT:1.     This function will read the internal table IT (Input table). 2.     The function will hold a rule as first parameter. PORT:1.     This function will read the internal table ORT (Old results table). 2.     The function will hold a rule as first parameter. P0014:1.     This function will read the Infotype 0014 for processing. 2.     The function will hold a rule as first parameter.  N.B.The documentation for all the Operations and Function is being provided, which can be viewed in PE04 (Editor for Operation and Function).
To report this post you need to login first.


You must be Logged on to comment or reply to a post.

  1. David Halitsky
    Some (many) here will tell you that the SDN blogsphere is not the place for this kind of effort.  So I’m here to suggest it is, if only to show SAP what SAP itself should be doing.

    Until SAP makes all of its operational metastructures available for general inspection as clearly as you’ve done here, it is getting in the way of its own efforts to move the SAP community to ES(O)A. 

    Of course, if SAP were ever to undertake to do this systematically, it would have to display the results in some venue more systematic than a blogsphere. 

    But what’s interesting about your effort here, and what SAP should consider very carefully, is the fact that you’re willing to share your knowledge with the community for free and to take some time and effort in making your presentation as clearly as you can.  In other words, it never even occurred to you to say to yourself: “I’m not sharing what I know about SAP Payroll unless SAP or someone else pays me to do so.”

  2. Anonymous
    I am actually responding to the comment:)

    Please take a look at

    The interactive log replay will enable you to inspect the payroll processing steps down to the operation level, and the state of the internal tables at each step.

  3. Aniket Chatterjee
    The blog is useful specially for the beginners.Could have been supplemented with the operations …presntly with more than 500 Operations in the country(+/- 10 per cent for different country specific solutions) it might be a good idea to list the some of the not so common operations….which could be called at different stages in the payroll run….
  4. Finances Sind
    I am a beginner in analyzing shemas and rules in payroll and this is a great overview of how all the parts fit together.  I am curious if you have an overview on the time types and time shema’s.  I would be very interested to read this.  Do the time types use NUM, RTE & AMT?

    Connie Durham
    Systems Analyst
    Propex Inc.

  5. mur ali
    Hi Bis,

    Can you post a comprehensive list of operations that are part of the payroll run? like, AVERA etc…


  6. RĂ©mi Corriveau
    According to it’s documentation, function PDT “accesses a personnel calculation rule that processes the contents of difference table DT according to the rules specified (and not table IT as indicated here).
  7. santosh kumar

    Hi Biswajit Das,

    I have read your old post while searching the sample code to Upload data to the IT0008. So If you have any piece of code or any program to upload data to IT0008 using F.M BAPI_BASICPAY_CREATE. Can you kindly send me…..


Leave a Reply