Download - 105723-ABAP-HR
-
7/29/2019 105723-ABAP-HR
1/60
ABAP HR / HCM
-
7/29/2019 105723-ABAP-HR
2/60
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
-
7/29/2019 105723-ABAP-HR
3/60
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
-
7/29/2019 105723-ABAP-HR
4/60
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 ?
-
7/29/2019 105723-ABAP-HR
5/60
Basics of SAP HR contd
SAP HR orSAP Human Resources Management System is one of the largestmodules 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.
-
7/29/2019 105723-ABAP-HR
6/60
HR as a Function- HR LC
Strategize and Plan
1. HR
Strategy
Acquire
2. Staff Acquisition
Sustain
4. Compensation Management
5. Benefits
Management
3. Organization
and Position
Management
6. Employee Training ,Development and
Performance Management
7. Leave and attendance Mgt
8. Travel Management
Separate
3. Separation Management
Right Job at the
Right Time
Right Person
Performing Welland
Appropriately
Compensated
Timely
Retirement
Processing
-
7/29/2019 105723-ABAP-HR
7/60
Time Management Payroll Accounting
Organisational ManagementPersonnel Management
Core Modules of SAP HR
HR
Master data
-
7/29/2019 105723-ABAP-HR
8/60
HR Structures
Enterprise structure.- Client, Company code, PA, PSA
Organizational structureOrg Unit, Position, Job, Task
Personnel structure.-Emp Group, Emp Sub-Group.
Payroll accounting Area
-
7/29/2019 105723-ABAP-HR
9/60
Personnel Structure
O
O O
O O
S
S
S
S
C
C
Position
Job
P Employee
External
Independant
Contractant ext.Intrimaire
Retiree
Active
Hourly WorkerMonthly worker
ExecutiveManager
Senior ManagerStudent
Expatri
Sorti
Organizational Structure
Hourly WorkerMonthly worker
ExecutiveManager
Senior ManagerStudent
ExecutiveManager
Senior Manager
Hourly WorkerMonthly workerExecutiveManager
Senior ManagerStudent
Organizational Unit
Enterprise StructureWT01
1000WT021100
WT03
1101WT041003
KAR AP WB NDEL
Administration Sales Finance HR
Legal Quality Mkt Engineering
Company Code
Personnel Area
Personnel Sub-Area
-
7/29/2019 105723-ABAP-HR
10/60
Enterprise Structure
-
7/29/2019 105723-ABAP-HR
11/60
-
7/29/2019 105723-ABAP-HR
12/60
Organizational Structure
Job
(C)
Organizational
Unit (O)
Position
(S)
person
(P)
Is managed by
Holder
Incorporates
Is described by
Describes
-
7/29/2019 105723-ABAP-HR
13/60
HR Structures: Employee in the
Personnel Structure
External
Active
Pensioner
Employee Group:Subdivision of employees into variouscategories for management reasons
HR St t E l i th P l
-
7/29/2019 105723-ABAP-HR
14/60
HR Structures: Employee in the Personnel
Structure
Employee SubGroup:Subdivision of an employee subgroup intodifferent employee status for managementreasons
Executive
Active
Student
Workforce
Manager
-
7/29/2019 105723-ABAP-HR
15/60
HR Structures: Payroll A/c Area
-
7/29/2019 105723-ABAP-HR
16/60
IT 0001- Organizational Assignment
-
7/29/2019 105723-ABAP-HR
17/60
Basics of SAP HR contd
-
7/29/2019 105723-ABAP-HR
18/60
What is ABAP HR and Why ABAP HR ?
The aim in the Human Resources component is to beable 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.
-
7/29/2019 105723-ABAP-HR
19/60
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
-
7/29/2019 105723-ABAP-HR
20/60
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?
-
7/29/2019 105723-ABAP-HR
21/60
LDB contd
What is a LDB ?
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
-
7/29/2019 105723-ABAP-HR
22/60
LDB contd
-
7/29/2019 105723-ABAP-HR
23/60
LDB contd
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.
3 Components of an LDB
-
7/29/2019 105723-ABAP-HR
24/60
LDB . contd
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
-
7/29/2019 105723-ABAP-HR
25/60
When to use a LDB ?
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
-
7/29/2019 105723-ABAP-HR
26/60
Where tosearch / 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 is the name of the database program for
the logical database.
Ex. SAPDBPNP for PNP - LDB
LDB contd
-
7/29/2019 105723-ABAP-HR
27/60
Linking a LDB to an Executable Program
-
7/29/2019 105723-ABAP-HR
28/60
Advantages of using LDBAn 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 contd
-
7/29/2019 105723-ABAP-HR
29/60
Events in an LDB
GET Event
GET LATE Event
LDB contd
-
7/29/2019 105723-ABAP-HR
30/60
DEMO
LDB contd
-
7/29/2019 105723-ABAP-HR
31/60
Personnel Administration Overview
What is PA Module?
When to use PA Module ?
Where is PA (Specific T-Codes) ?
Why PA Module ?
-
7/29/2019 105723-ABAP-HR
32/60
Structure of DB tables in PA
Logical structures
Pnnnn
KEY fields
Data fields
PSnnnn
Database tables
PAnnnnPAnnnn PBnnnnPBnnnnScreen
fields
Qnnnn
Selection
fields PNP
PERNR
PCLnPCLn
-
7/29/2019 105723-ABAP-HR
33/60
Infotypes Overview
What is an Infotype ?
When to use Infotype ?
Where are Infotypes present ?
How is Infotype beneficial ?
Why use Infotypes in SAP HR?
-
7/29/2019 105723-ABAP-HR
34/60
LDB : Infotype Data Structure
PA0002PA0002
DB structure PAnnnn using infotype 0002 as an example
Infotype structurePnnnn using infotype 0002 as an example
MANDT PAKEY PSHD1 PS0002
PSKEY PSHD1 PS0002
-
7/29/2019 105723-ABAP-HR
35/60
LDB PNP Screening
-
7/29/2019 105723-ABAP-HR
36/60
LDB Data Retrieval
1. Create data structures forinfotypes
2. Fill the data structures withthe infotyperecords
"Organizational Assignment""PersonalData""Planned Working Time"
INFOTYPES:0001,0002,0007.
GET PERNR.
LDB Processing Master Data Using
-
7/29/2019 105723-ABAP-HR
37/60
TABLES: PERNR.
INFOTYPES: 0001, "Actions
0002, "Personal Data
0006, "Addresses
....
GET PERNR.
PROVIDE * FROM P0002 BETWEEN PN-BEGDA AND PN-ENDDA.
WRITE...
ENDPROVIDE.
LDB Processing Master Data Using
Provide
LDB L N ti
-
7/29/2019 105723-ABAP-HR
38/60
LDB - 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.
END-OF-SELECTION.
Infotype
loop
Infotype
loop
Employee
loop
-
7/29/2019 105723-ABAP-HR
39/60
LDB Period Based Data - 1
JANUARY - APRIL
MAY - AUGUST
SEPTEMBER - DECEMBER
Ms YMs Y
LDB P i d B d D t 2
-
7/29/2019 105723-ABAP-HR
40/60
Org.
Assignment
Data
Selection
January December
January December
Org.
Assignment
January December
LDB Period Based Data - 2
-
7/29/2019 105723-ABAP-HR
41/60
Data selection
Person selection
PAnnnnPAnnnn
INFOTYPES: ...
GET PERNR.
PROVIDE...
WRITE...
LDB Screening Criteria
-
7/29/2019 105723-ABAP-HR
42/60
LDB Person Selection
-
7/29/2019 105723-ABAP-HR
43/60
LDB Data Selection
-
7/29/2019 105723-ABAP-HR
44/60
Default Values on Selection Screen
-
7/29/2019 105723-ABAP-HR
45/60
...
GET PERNR.
...
190919101899
Pers.areaPerNo. Name
100010001100
Sam HawkinsDavid LindsayKarl May
LDB Sort Order
-
7/29/2019 105723-ABAP-HR
46/60
JOIN INFOTYPES
-
7/29/2019 105723-ABAP-HR
47/60
JOIN / CODING
-
7/29/2019 105723-ABAP-HR
48/60
JOIN / SUBTYPES
-
7/29/2019 105723-ABAP-HR
49/60
INFOTYPE JOIN - DEMO
-
7/29/2019 105723-ABAP-HR
50/60
PROJECTION
-
7/29/2019 105723-ABAP-HR
51/60
PROJECTION / CODING
-
7/29/2019 105723-ABAP-HR
52/60
PNPLogical Database DEMO
-
7/29/2019 105723-ABAP-HR
53/60
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
-
7/29/2019 105723-ABAP-HR
54/60
-
7/29/2019 105723-ABAP-HR
55/60
-
7/29/2019 105723-ABAP-HR
56/60
-
7/29/2019 105723-ABAP-HR
57/60
-
7/29/2019 105723-ABAP-HR
58/60
An Q estions?
-
7/29/2019 105723-ABAP-HR
59/60
Any Questions?
-
7/29/2019 105723-ABAP-HR
60/60
Thank you