You are on page 1of 60

ABAP HR / HCM

Agenda Day 1
Basics of SAP HR and Why ABAP HR Logical Databases PA (Personnel Administration) - Overview Structure of Database Tables in PA Infotypes Overview

Macros and Function Modules


Hands On Sessions and Assignments

Topic List
Basics of SAP HR and Why ABAP HR Logical Databases PA (Personnel Administration) - Overview Structure of Database Tables in PA Infotypes Overview

Macros and Function Modules


Hands On Sessions and Assignments

Basics of SAP HR and Why ABAP HR ?

What is SAP HR / HCM ? When to use SAP HR / ABAP HR ? Where is SAP HR / HCM used ? How is SAP HR / HCM beneficial ?

Why ABAP HR ?

Basics of SAP HR

contd

SAP HR or SAP Human Resources Management System is one of the largest modules in the SAP R/3 system which consists of many sub modules like: Organizational Management Personnel Administration Recruitment Time Management Payroll Compensation Management Personnel Cost Planning Budget Management Personnel Development Training & Event Management Travel Management Environmental Health & Safety.

HR as a Function- HR LC
Acquire Strategize and Plan
2. Staff Acquisition

Right Person

Sustain

Right Job at the Right Time

3. Organization and Position Management

4. Compensation Management

5. Benefits Management Performing 1. HR Strategy 6. Employee Training ,Development and Performance Management 7. Leave and attendance Mgt

Well

and Appropriately Compensated

8. Travel Management

Separate
3. Separation Management

Timely Retirement Processing

Core Modules of SAP HR


Personnel Management

Organisational Management

Master data
HR

Time Management

Payroll Accounting

HR Structures
Enterprise structure.- Client, Company code, PA, PSA Organizational structure Org Unit, Position, Job, Task Personnel structure.-Emp Group, Emp Sub-Group. Payroll accounting Area

Organizational Unit

O Organizational Structure

O
S O O

Position

Job C S

Personnel Structure

S C S

Independant Contractant ext. Intrimaire External

Retiree

Hourly Worker Monthly worker Executive Manager Senior Manager Student

Employee

Active

Hourly Worker Monthly worker Executive Manager Senior Manager Student Expatri

Executive Manager Senior Manager

Enterprise Structure
WT01

WT02 1100 AP Sales

WT03

WT04 1003 NDEL

1000 KAR Administration Sorti Hourly Worker Monthly worker Executive Manager Senior Manager Student Legal

1101 WB

Company Code Personnel Area

Finance Engineering

HR

Quality

Mkt

Personnel Sub-Area

Enterprise Structure

Organizational Structure
Organizational Unit (O)
Incorporates Is managed by

Job (C)

Describes Is described by

Position (S)
Holder

person (P)

HR Structures: Employee in the Personnel Structure


Employee Group: Subdivision of employees into various categories for management reasons

External

Pensioner

Active

HR Structures: Employee in the Personnel Structure


Employee SubGroup: Subdivision of an employee subgroup into different employee status for management reasons
Executive

Active

Workforce Student Manager

HR Structures: Payroll A/c Area

IT 0001- Organizational Assignment

Basics of SAP HR

contd

What is ABAP HR and Why ABAP HR ?


The aim in the Human Resources component is to be able to process employee related data according to business requirements in an effective structure. The Human Resources module uses a system of data grouped together called Infotypes. The Human Resources module stores bulk data like time management and Payroll data in Cluster tables In HR ABAP use of select statements significantly less than in other areas of ABAP development In addition to the LDB, HR programming also involves the use of Macros for data extraction cluster tables.

Topic List

Basics of SAP HR and Why ABAP HR Logical Databases PA (Personnel Administration) - Overview Structure of Database Tables in PA Infotypes Overview

Macros and Function Modules


Hands On Sessions and Assignments

Logical Databases (LDB)


What is a LDB ? When to use LDB ? Where to search for LDB ? How is LDB beneficial ?

Why use LDB instead of SQL selects?

LDB
What is a LDB ?

contd

Logical databases are special ABAP programs that retrieve data and make it available to application programs. The most common use of logical databases is still to read data from database tables and linking them to executable ABAP programs while setting the program contents Logical databases contain Open SQL statements that read data from the database. You do not therefore need to use SQL in your own programs A logical database can read the lines of these tables one after the other into an executable program in a sequence which is normally defined by the hierarchical structure

LDB

contd

LDB
3 Components of an LDB
STRUCTURE The structure defines the data view of the logical database. SELECTIONS The selections define a selection screen, which forms the user interface of the executable programs that use the logical database. DATABASE PROGRAM The database program contains the ABAP statements used to read the data and pass it to the user of the logical database.

contd

LDB
Structure of Logical Database
The structure of a logical database is usually based on the foreign key relationships between hierarchical tables in the SAP System.
Logical databases have a tree-like structure The nodes must be structures defined in the ABAP Dictionary or data types from a type group

. contd

LDB
When to use a LDB ?

contd

It is always worth using logical databases if the structure of the data that you want to read corresponds to a view available through a logical database. To Read the same data for several programs.

Defining the same user interface for several programs.

LDB

contd

Where to search / view / create / edit LDBs ? SE36 Transaction Code for Logical Database Operations

Logical databases have a tree structure. A logical database can contain a maximum of 300 tables
SAPDB<LDB Name> is the name of the database program for the logical database. Ex. SAPDBPNP for PNP - LDB

Linking a LDB to an Executable Program

LDB
Advantages of using LDB

contd

An easy-to-use standard user interface


Check functions which check that user input is complete,

correct, and plausible


Meaningful data selection Central authorization checks for database accesses You do not have to program a selection screen for user input since this is created automatically

LDB
Events in an LDB GET Event

contd

GET LATE Event

LDB

contd

DEMO

Personnel Administration Overview


What is PA Module? When to use PA Module ? Where is PA (Specific T-Codes) ? Why PA Module ?

Structure of DB tables in PA
Logical Structures and Database Tables in PA

Logical structures

Database tables Screen fields Qnnnn PAnnnn PBnnnn

Pnnnn
KEY fields

Data fields PSnnnn Selection fields PNP PCLn

PERNR

Infotypes Overview
What is an Infotype ? When to use Infotype ? Where are Infotypes present ? How is Infotype beneficial ?

Why use Infotypes in SAP HR?

Infotype - Data Structures

LDB : Infotype Data Structure


DB structure PAnnnn using infotype 0002 as an example

PA0002

MANDT

PAKEY

PSHD1

PS0002

Infotype structure Pnnnn using infotype 0002 as an example

PSKEY

PSHD1

PS0002

LDB PNP Screening

LDB Data Retrieval

1. Create data structures forinfotypes INFOTYPES: 0001, 0002, 0007.


" Organizational Assignment " "Personal Data " " Planned Working Time"

2. Fill the data structures withthe infotype records GET PERNR.

LDB Processing Master Data Using Processing Master Data Provide


TABLES: PERNR. INFOTYPES: 0001, 0002, 0006, .... "Actions "Personal Data "Addresses

GET PERNR. PROVIDE * FROM P0002 BETWEEN PN-BEGDA AND PN-ENDDA. WRITE...

ENDPROVIDE.

LDB - Loop Nesting


Loop Nesting
GET PERNR. PROVIDE * FROM P0002 BETWEEN PN-BEGDA AND PN-ENDDA. WRITE... ENDPROVIDE. PROVIDE * FROM P0006 BETWEEN PN-BEGDA AND PN-ENDDA. WRITE... ENDPROVIDE.

Infotype loop Employee loop

Infotype loop

END-OF-SELECTION.

LDB Period Based Data - 1


Period-Based Data (1)

JANUARY - APRIL

MAY - AUGUST

Ms Y

SEPTEMBER - DECEMBER

SAP AG 1999

LDB Period Based Data - 2


Period-Based Data (2)

Data Selection

January

December

Org. Assignment

January

December

Org. Assignment

January

December

LDB Screening Criteria


Screening Criteria

Data selection Person selection INFOTYPES: ... GET PERNR. PROVIDE... WRITE... PAnnnn

SAP AG 1999

LDB Person Selection

LDB Data Selection

Default Values on Selection Screen

Sort Order

LDB Sort Order

... GET PERNR. ...

PerNo. Pers.area 1909 1910 1899 1000 1000 1100

Name Sam Hawkins David Lindsay Karl May

SAP AG 1999

JOIN INFOTYPES

JOIN / CODING

JOIN / SUBTYPES

INFOTYPE JOIN - DEMO

PROJECTION

PROJECTION / CODING

PNP Logical Database DEMO

Topic List
Basics of SAP HR and Why ABAP HR Logical Databases PA (Personnel Administration) - Overview Structure of Database Tables in PA Infotypes Overview

Macros and Function Modules


Hands On Sessions and Assignments

Any Questions?

Thank you

You might also like