sitemap
ABAP HR
Guidelines to retrieve Payroll data (Mainly US/UK/Ireland)

Before directly going into the Guidelines to retrieve Payroll Data let us look in to the basic
concepts of the Payroll.

Introduction to Payroll

To calculate the remuneration for work done for each employee

Payroll does not just involve the calculation of remuneration, but consists of a variety of
processes that are becoming increasingly important due to the employer’s increased obligation
to supply benefits and medical welfare. These benefits are products of:

• Labor law

• Tax law

• Contribution law

• Benefits law

• Civil law

• Reporting law

• Information law

• Statistics law


Payroll in the SAP System: In the SAP Human Resources Management System, payroll
accounting is executed using the Payroll driver.

Process Flow:

When you access Payroll, the payroll driver calls the accompanying payroll schema, which
consists of a sequence of functions. For each activity, the individual functions import data from
internal tables and payroll relevant files.

Payroll Integration:

Payroll can be integrated in Personnel Administration, Time Management, Incentive Wages and
Accounting:

Standardized data retention enables you to use master data and other payroll relevant data
from
Personnel Administration.

Time data, entered via Time Management, is automatically included in the Payroll and is
valuated during the payroll run. Data from the
Incentive Wages component is used to calculate
piecework wages and premium wages directly in Payroll.

Information on expenses and payables from Payroll is posted for accounting directly in
Financial
Accounting
, and you assign the costs to the appropriate cost center. You can also control the
financial system of third-party providers.

Payroll Driver

Payroll driver is a special report for Payroll.
SAP has developed country-specific payroll drivers, which are based on report RPCALCx0.
The country-specific net calculation of pay must be developed explicitly for every country.

Separate country programs, which meet the tax and insurance requirements of the respective
country, can be created from the basic report
RPCALCx0.   Since the payroll driver has a
modular structure, you can use the Customizing functions to quickly modify the payroll
procedure to meet the particular requirements of your enterprise.

Integration

Calculation rules and other reports are stored in an accompanying schema, which also contains
the activities carried out by the payroll driver during payroll. All data is stored in internal tables
and saved in files with a cluster structure.

When you access Payroll, the payroll driver calls the accompanying payroll schema, which
consists of a sequence of functions. For each activity, the individual functions import data from
internal tables and payroll relevant files.

Payroll Schema:

It contains calculation rules to be used by the payroll driver during payroll.
SAP has developed country-specific schemas, which are based on schema X000.  
With country-specific reports, the first character in the name refers to the country indicator.

For example,
  D for Germany
  F for France
  U for USA

Schema Structure    A schema consists of the following parts:

1. Initialization    

Where system performs the following steps:
Updates the databases
Imports required infotypes

2. Gross calculation of pay

Where system performs the following steps:
Processes basic data and time data  
Reads payroll account of the last period accounted
Processes time data and calculate the individual gross values
Performs factoring  

3. Net calculation of pay

 where system performs the following steps:
    Calculates net remuneration
       Performs bank transfers

Example:

The classic example is the payroll for salaried employees at the end of the month in contrast to
the wage accounting of hourly workers in the middle of the following month.

Enter the organizational assignment of employees to a payroll accounting area (ABKRS) in
Infotype 0001. Payroll accounting area also determines the two functions necessary for payroll
accounting:

  • The summarization of personnel numbers to be accounted and
  • The determination of the exact payroll period.

Select Personnel Numbers:

Personnel numbers are selected for payroll accounting by specifying a payroll area in the payroll
driver.  Infotype 0001 Organizational Assignment enables you to assign an employee to the
appropriate payroll area.
These Pernrs are locked during Payroll Run.

Determine Payroll Period:

On the Selection screen, you can give Payroll Period Parameter as per the requirement else you
can give Payroll Area, by which system calculates the payroll period.

Finding Payroll Results for a Specific Query:

Payroll results are stored in cluster Rx of the PCL2. The cluster key is not mnemonic; it contains
only the PERNR (personnel number) and SEQNO (sequential number) fields.

The internal table RGDIR (PC261 - Cluster Directory for Export and Import of Payroll Results)
contains a directory entry for each payroll result.

 This entry is a sequential number (RGDIR-SEQNR), which uniquely identifies the payroll result.

  Payroll results can only be imported if the payroll cluster key (PC200) contains the personnel
number and sequential number.

Function Modules for Selecting Payroll Results

You will probably always have the same queries when importing payroll records. For example,
"Which payroll results (original and retroactively accounted records) were written for a specific
payroll run (defined by IN payroll category, IN payroll area, IN period)"? To save programmers
from having to write their own reports for this functionality, standard modules are available for
the most important queries.    The employee's payroll directory is always transferred to the
function modules using the table RGDIR (PC261). The modules then transfer the payroll records,
which satisfy the specified selection criteria using a table whose type corresponds to that of the
RGDIR (PC261) but which has a different name.

    Exporting        Pernr – Personal Number
    Importing        Molga – Country
    Tables             Rgdir – Payroll Results Directory

This Function Module populates payroll results of all employees with PERNR & SEQNR as key.

Macro Modules:

   We have populated Results Directory & retrieved Sequential Number, we need to call an
import macro module for retrieving the required payroll results. For this we need to pass the
unique identification of an Employee payroll Result i.e.
rx-key-pernr = v_pernr.

        
rx-key-seqno = v_seqnr.

 To that import macro.

Calling Import Module:  RP-imp-c2-RU.     

 This Macro populates all the cluster tables required for Payroll, by importing from PCL2 Cluster
Directory. After that we can loop through these cluster tables for    required fields.

Guideline to write a program, which retrieves the data for, specified country

• Use Logical Database As per the Requirement.

•Include Payroll Driver with reference to Country- Specific modules which inturn includes Country-
specific Schemas etc.

• Get the PERNRs for which you want to obtain payroll results.

•Populate Results Directory RGDIR with PERNR & Molga (Country) calling FM CU_READ_RGDIR.

•Get the Unique Sequential Number with PERNR, From Date & Last Date calling CD_READ_LAST.

•      Pass these KEY Field (PERNR, SEQNR) to IMPORT MACRO
 RP-IMP-C2- RU to import all the relevant field entries from PCL2  
 DIRECTORY to all the cluster tables

• Get the required fields by looping through cluster tables.


Integration

All data is stored in internal tables and saved in files with a cluster structure.
  
Internal Tables:
 Internal tables store data during payroll.

The system imports data to these tables and used them to calculate new data. This data is then
also saved in internal tables.

     At the start of the payroll run, the system reads the values from the results tables to the
old results table (ORT). Data from the previous period is, therefore, available in the current
payroll period.

The most important internal tables are:

• Input table (IT)
Table IT contains data that can be edited. The table exists only during processing.

•• Output table (OT)
Table OT contains the results of an activity. These results are written to the input table for
further processing. The table exists only during processing.  

•• Results table (RT)
Table RT contains the results of the period for which payroll has been run. The system saves
this data in the PCL2 file in cluster RX.

Interaction of IT, OT and RT:

The necessary data for the respective processing step is loaded into the input table and is thus
available for various processing procedures. The results of a processing step are stored either in
the output table or the results table.  At the end of a processing step, the data from the OT is
loaded back into the IT, where it is available for further processing steps. The IT and OT are only
temporarily filled, whereas the RT is stored on the database.  In one of the first processing
steps, the RT of the last payroll accounting period is imported into the old results table (ORT)
and can consequently be used for further processing.

Payroll Relevant Files:
 Payroll files contain data for payroll and payroll results.

Structure      
The system requires the following files for payroll:

• Pnnnn (nnnn = number of the infotype)
The Pnnnn files contain data that has been entered in the respective infotypes for an employee.   
                                       
Example
 P0000 - Actions Infotype
P0008 - Basic Pay Infotype


• PCL1
The PCL1 file contains primary information, in other words, data from the master data and time
recording systems.

• PCL2
The PCL2 file contains secondary information, in other words, derived data and all generated
schemas
 
Integration

When you start payroll, the system imports the relevant master data from the Pnnnn files (for
example, basic pay and tax class) and imports the time data from the PCL1 file to the IT table.
    The system imports the payroll results from the previous month from table ORT (for
example, to form averages).
    The system processes this data and saves the payroll results and generated schemas in the
PCL2 file.

Payroll Control

Use

This function is used to control Payroll.
During Payroll the master data for the personnel numbers to be included in the payroll run can
not be changed for the past or present,

Example You should not perform payroll, when master data is being processed for the
personnel numbers for which payroll should be run.


Scope of Function

  • Payroll Control Record

  • Payroll Status

  • Payroll Area

  • Payroll Period

Payroll Control Record

Payroll object that is important for the payroll run, and which contains all the information on a
payroll area

Use
The payroll control record has the following functions:
  • It locks the personnel numbers, for which payroll should be run, against master data
    changes that affect the payroll past or present.
  • It locks the payroll for the period during which payroll-relevant changes are made to the
    master data for the personnel numbers being processed.         

It makes the following information available for the system:

  • What is the next payroll period for which regular payroll should be run?
  • Up to what date is retroactive accounting carried out?
  • What status does the payroll currently have? (For example, Released for Payroll or Check
    Payroll Results)?

      When you carry out a payroll run, the system automatically changes the payroll status in
the payroll control record. You can also change the status manually   under Payroll ® Tools ®
Control Record.

Structure

The control record contains the following information:

  • Payroll area
  • Payroll status
  • Payroll period
  • Earliest possible retroactive accounting period
  • Last change made to the control record

Payroll Status (Infotype 0003)

Infotype in which data on the Payroll status and Time Management status is stored

For example,

The system stores the date of the last payroll run performed for the employee in the Payroll
Status infotype (0003).

The system can flag an employee that was rejected in the payroll run.

Use

The system automatically creates this infotype when the employee is hired. In general, the
system updates the infotype and writes the changes to the payroll past.

Payroll Area

A group of employees for whom payroll should be run together, and at the same time

Use

You can perform Payroll separately for different employee groups, using different payroll areas.
This is necessary if the payroll period is not the same for all employee groups.

Examples:
•         Industrial worker (monthly, on the 4th day of next month)
•         Salaried employee (monthly, on 15th day of the month)
•         Company pensioner (monthly, on 20th day of previous month)
•         Weekly paid employee (weekly, on Friday)

Every payroll area needs its own payroll control record.

When you run payroll, you must specify the payroll area in the payroll driver selection screen.
The payroll area has the following functions:
In the Payroll Period block it is used to determine the exact payroll period.
In the Selection block it is used to select the personnel numbers that should be grouped
together during the payroll.

Structure

The payroll area contains the following information:
Payroll area text
Eg: Monthly, Weekly, and BI-Weekly
Period parameters
Its two digit numerical parameter
Eg: 01 - Monthly, 02 - BI - Weekly.
·          Date Modifiers
Eg: DDMMYYYY, MMDDYYYY etc.  

Payroll Period
    Exact period in which the regular payroll is carried out
Its (2, 4) digit numerical parameter where first is a unit & second is Year
·        A payroll period is usually a month or a week
·        A 'special case' (especially in USA)
·        A payroll can also be one day

Example

14-day payroll periods have been defined for your enterprise for a particular year (2003).
The first period begins on 1 January. If you carry out Payroll for payroll period 09, the payroll
period is 01 to 15 May.

01              - 1 Jan   to    15 Jan of 2003
02              - 16 Jan   to    31 Jan of 2003
03              - 01 Feb   to   15 Feb of 2003
09              - 01 May to   15 May of 2003

The method used for defining the payroll period is dependent on whether you are carrying out a
test run or a live payroll run:

·         For a test run, you generally enter the specific payroll period.
·         For a live payroll run, the system uses the value that is in the payroll control record as
the current payroll period.

In the payroll driver selection screen, enter the payroll area for which you want to run payroll.
The system derives the exact start and end date of the payroll for this payroll area, which are
stored in the payroll area or in the payroll control record.

Example

In your enterprise, the first payroll period for 2002 begins on 1 January. It does not matter
which period parameter you use as a basis, for example weekly or monthly, the payroll period 05
2002 can still have the following meaning:
·         Weekly period parameter:
Period 05 2002 = 01-07 February 2002

·         Monthly period parameter:
Period 05 2002 = 01-31 May 2002
Back to ABAP HR Page
All of the  product names here are trademarks of their respective companies.  The site
www.allsaplinks.com no way affiliated with SAP AG. We have made every effort for the content
integrity.  Information used on this site is at your own risk.
SapMaterial.com   
ABAP TECHNICAL

SAP Introduction

sap abap faq

sap Tables

SAP Transaction codes

Internal tables

data dictionary

performance tuning

transports & Requests

Sap scripts

Smartforms

lsmw

reports

sap Workflow

module pool/ dialog
programming

table control

user exits

sap memory

abap memory

alv reports

ABAP ADVANCED

IDOC

ALE

BAPI

BADI

RFC


FUNCTIONAL SIDE

Materials Management

FICO

Human Resources

BIW / BW / SEM


Free Documentation
Abap Material

Ale Material

BAPI Material

BC Material

IDOC Material

R/3 Database Management

SAP material

RFC

Transport

Sales & Distribution Material

Basic Data and Function
Material

Basis (BC) Material

Billing Material

CA Material

CATT : Computer Aided Test
Tool

Capacity Evaluation and
leveling Material

Capacity Planning Material

Cross Application Material

Countries

Customer Service Material

Enterpise  Material

Financial / Controlling (FICO)

Internet Time Sheet

Inspection Material

HR Material

Material Management
Material

Payments Material

Payroll Material

Pension Fund

Production Planning and
Control

Plant Maintenance

Quality Management Material

Real Estate Material

SAP material

Wage Types