[SAP HR] Payroll Schema

Schemas and Functions

Schemas ( Use tcode PE01 )

  • is a collection of functions executed in a specific order
  • Schemas are stored in T52C0 (SAP standard) / T52C1 ( Customer created)
  • Example is X000 ( X stands for International )
  • Another Example is L000 ( L stands for Malaysia )
Functions ( Use tcode PE04 )

  • WPBP a common function used to process IT0, IT1, IT7, IT8
Wagetypes
 

Wagetypes are used to store a rate/number/amount. It ends up as an object in the payroll result database. It can be earnings, deductions, taxes.

Wagetype attributes are stored mainly in T512W.
3 types of Wagetypes:-

  • Model Wagetypes = Start with a letter. Wagetype M320 is a sample wagetype. To implement for customer, it is copied to 0001 for example
  • Technical wagetypes = Start with /. Used for very specific processing. Not advisable to edit/delete this type of wagetype. These wagetypes are used during calculations and cannot be seen in Infotypes
  • User wagetypes = Starts with a number. Will not be changed SAP. It's company-specific payroll payments or deductions
Rules and Operations

Payroll Rules (Use tcode PE02)

  • is a collection of operations.Rules are stored in T52C5.

Operations (Use tcode PE04)

  • MULTI = Multiplies the rate and number of a wagetype to determine the amount
  • OUTWP = Retrieves specific data about employee. For example IT0001-Work Contract = UA then do 'x'. If it is UB, then do 'y'
Common Functions
COPY is the same as 'include' in ABAP. Calls the sub-schema

BLOCK is used with BEG/END. It is used to make the log easy to read

IF/ELSE/ENDIF Used in Parameter 2. E.g. IF NAMC in schema U000

Pxxxx - Reads information from Infotype xxxx

PIT - Process Input Table. It is normally used after Pxxxx function where it loops each wagetype from IT (Input Table) and sends them to RT (Results Table)

PRT - Process Results Table. Similar logic to PIT where it loops RT table and outputs into RT table

ACTIO - Process a payroll rule, but does not loops a table. But it can loop Infotype records for the current pay period for rule processing

Common Operations

MULTI, DIVID
These operations let you multiply and divide two fields of a wagetype and store it in a third. The fields you can work with are AMT, RTE and NUM. MULTI RNA would multiply the rate with the numberand store it in the Amount field. DIVID ANA would divide the Amount field by the number and store it back in the amount field.

NUM, RTE and AMT
These are the basic fields and powerful assignment operations.

NUM = 1 or AMT 2.50 - You can do this but it is bad practise to do this

Create a constant in T511K called ZNUM
NUM = KZNUM
This is a better way to do it because constants are date-effective

AMT = E9XXX will set the amount with the amount field from wagetype 9XXX

AMT < 9XXX will only set the amount from wagetype 9XXX if the AMT field is currently less than it

AMT*100 will multiply Amount with 100 and store it back into Amount

ADDWT
Transfers the wagetype in the header into another table

ADDWT * transfers the current wagetype to OT

ADDWTE* transfers the wagetype to RT without renaming the wagetype. It will no longer be in the IT or OT

ADDWT9xxx transfers the wagetype to RT and changing the wagetype to 9xxx

ELIMI and RESET
Splits are attributes of wagetypes that link them to some other table in payroll. Sometimes you have to remove certain splits when doing work in a rule - that's what ELIMI does. To restore them use RESET.

FILLF
This operation resets the value of a wagetype field. FILLF A will reset the amount back to what it was before.

Making Decisions
OUTWP
is used to make decisions based on WPBP table in payroll. It mainly concerns IT0000 and IT0001 data. As an example, OUTWPCOMPY puts company code field into variable key

VAKEY
Places certain data into variable key. For example AMT?0 checks whether AMT is equal to 0

VWTCL
This operation returns the value of a certain processing class. As an example, VWTCL 93 places in the variable key the value of processing class 93.

OPIND
Changes sign to positive or negative

GEN/8 16
Used with parameter 16, this means it generates 16 wagetypes thst starts from /8. Hence, /801 to /816 will be generated in the IT.

Comments

Popular posts from this blog

[SAP ABAP] Data declaration

[SAP ABAP] BAPI