HR Programming
HR Programming
4)
Programming in HR
Introductions
Your instructor. You !
Name Experience ( SAP / HR ) Expectations - Objectives
Course Objectives
By the end of this course you will be :
Familiar with the special features of programming in HR Able to use HR specific commands and function modules to query and report information from Personnel Administration and Personnel Development Able to report on the results from a Payroll run.
Agenda
Introduction / HR Overview Logical database PNP Views - JOIN & PROJECTION Reading Infotypes Time data Repetitive structures Evaluating Payroll Results Logical database PCH Infotype enhancement Other features (inc. Logical DB PAP)
Chapter 1
HR Overview
HR Components
PA - Personnel Management
Personnel Administration Time Management Payroll Benefits Recruitment Business Trip Management
HR Components
PD - Personnel Development & Planning
Organisational Management Training & Event Management Personnel Development Shift Planning Qualifications / Skills Catalogue Personnel Costs
Organisational Management
Organisational Plan
Organisational Unit (O) Position (S) Job (C) Task (T) Person (P)
Organisational Structure
Organisational Unit
Positions
Tasks
Jobs
People
SAP HR Concepts
Infotype
Grouping of related data fields Facilitates data entry Allows time dependant data storage Provides information structure
Infogroup
Collection of related infotypes
Action
Execution of an Infogroup ( eg. Hiring )
Chapter 1: Exercise
Objective:
Become familiar with Infotype navigation & contents
Chapter 1: Summary
The main components of the SAP HR module are:
PA - Personnel Management PD - Personnel Development & Planning
Chapter 2
Logical database PNP
Chapter 2 - Objectives
By the end of this chapter you will be able to:
Explain the function of the Logical Database PNP Use reports to select from the PA Database according to :
A specific selection period Data for specific individuals A specified sort sequence
Data Retrieval
SAP DB
PNP
Screening
Authorisation Checking
Database Tables
PSnnnn
PBnnnn
Qnnnn
PCLn
Data Retrieval
Create an internal table for each Infotype :
REPORT Zxxxxxxx. TABLES pernr. INFOTYPES : 0001, 0002.
Jan
July
Current
Period
PROVIDE / RP-PROVIDE-FROM-LAST
Sorting
The standard sort sequence lists personnel numbers in ascending order. The sort function allows you to sort report data by organisational criteria. The sort functionality is provided as part of the logical database engine
= = = =
1. 9999999. BT. I.
Report Categories
Chapter 3
Join & Projection
Chapter 3 - Objectives
By the end of this chapter you will be able to :
Process more than one infotype within a PROVIDE ENDPROVIDE loop Process an infotype according to whether changes have been made to specific fields Read time-dependent table entries
Join
Coding a Join
INFOTYPES: 0001, 0002.
GET PERNR.
PROVIDE * FROM P0001 * FROM P0002 BETWEEN PN-BEGDA AND PN-ENDDA.
. . . ENDPROVIDE.
Time Constraints
Hired
2 3
TIME -->
Projection
Employee : Bob. Position Programmer.
Dec 1998
Jan 1996
Dec 1998
Coding a Projection
INFOTYPES:
0001.
GET PERNR.
PROVIDE STELL FROM P0001 BETWEEN PN-BEGDA AND PN-ENDDA. . . . ENDPROVIDE.
Result :
Jan 1998
Chapter 3: Exercises
Exercise 3.1
Employee Name & Address Report ZDEG240_xx_031
Exercise 3.2
Employee Job Report ZDEG240_xx_032
Chapter 4
Reading Infotypes
Chapter 4 - Objectives
By the end of this chapter you will be able to : Use macros to process HR data Read Infotypes without using a Logical Database
RMAC Macros
RP_SET_DATA_INTERVAL
Data Selection Period July Infotype nnnn Dec
Result
RP-READ-T001P
Table : T001P - Personnel Area / Subarea
AREA SUB AREA COUNTRY GROUPING PAY SCALE AREA PAY SCALE TYPE
REPORT Zxxxxxxx. TABLES: PERNR, T001P. . GET PERNR. RP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA. RP-READ-T001P P0001-WERKS P0001-BTRTL SPACE.
Chapter 4: Exercise
Employee Payments & Deductions Report ZDEG240_xx_041
Chapter 5 - Objectives
By the end of this chapter you will be able to :
Explain the dependency of Time Data on the Validity Period Use a macro to import Time Data Process the imported Time Data by using an internal table
Time Data
Data Selection Period
20th April 10th May
Leave 15 days
15 days
GET PERNR.
RP-READ-ALL-TIME-ITY PN-BEGDA PN-ENDDA. LOOP AT P2001. . . . ENDLOOP.
Chapter 5: Exercises
Exercise 5.1
Absence Data Report ZDEG240_xx_051
Exercise 5.2
Cumulated Absences ZDEG240_xx_052
Chapter 6 - Objectives
By the end of this chapter you will be able to :
Identify and evaluate Infotypes that use repetitive structures within your ABAP code Output a list using Table Control
* Define Work Area. DATA: BEGIN OF WAGETYPES, LGA LIKE P0008-LGA01, BET LIKE P0008-BET01, ANZ LIKE P0008-ANZ01, EIN LIKE P0008-EIN01, OPK LIKE P0008-OPK01, END OF WAGETYPES.
Chapter 7
Chapter 7 - Objectives
By the end of this chapter you will be able to :
Import & Export Cluster Data Structures Understand the cluster definition of payroll results Import & Evaluate payroll results using the function modules CU_READ_RGDIR and CD_EVALUATION_PERIODS Understand the function of the Cluster Directory Manager
Database Tables in HR
PAnnnn PCL1 PCL2 PCL3 PCL4 PCL5 HR data DB for HR work areas Accounting results Recruitment data Documents Cost planning
PCL2
L1 B2
ZL Z1 RX
G1
TE
PS
CU
PT xy
Tables : PCLn.
EXPORT
Key definition PCLn : CLIENT 3 Client RELID 2 Relation ID SRTFD 40 Work area key SRTF2 10 Sort field for duplicate key
Cluster definition
Cluster definition
Chapter 7: Exercises I
Exercise 7.1
Export Database Tables ZDEG240_xx_071
Exercise 7.2
Import Database Tables ZDEG240_xx_072
Chapter 7: Exercises II
Exercise 7.3
Export Database Tables using the buffer ZDEG240_xx_073
Exercise 7.4
Import Database Tables using the buffer ZDEG240_xx_074
(2)
(3)
A A
P P A A A
Payroll Results
Payroll Tables
Payroll Control Records T549A - Payroll Areas
PERMO - period modifier (ie weekly / monthly)
Utility Programs
Transaction PU00 : Delete Payroll Clusters by Employee Utility Programs : RPUPnD00 / D10
n indicates Database Table PCL1 or PCL2 Delete one or more records from any cluster
RPUPDEL20 : Delete Payroll Results RPUAUD00 : Infotype Change Documents RPTEDT00 : Read Time Evaluation Results
Exercise 7.6
Payroll Results II ZDEG240_xx_076
Chapter 8
Logical Database PCH: Organisation Management / Personnel Planning.
Chapter 8: Objectives
By the end of this chapter you will be able to:
Explain the function and structure of the Logical Database PCH Create reports for sequential and structural evaluations of the Organisational Structure Evaluate additional data on relationships
Cost centre
Cost Centre Allocation
Job
Is Described by
Position
Describes
Work Centre
Incorporates
Describes
Holder
Task
Describes
Person
S S
POSITION
C T
TASK
S
POSITION
POSITION POSITION
T
TASK
POSITION
Infotypes
The characteristics of objects are stored as Infotypes : INFOTYPE No. Example Object 1000 org unit Relationships 1001 belongs to, reports to Description 1002 general text Work schedule 1011 planned working hours Cost planning 1015 cost elements Address 1028 address 1, address 2
Object Status
Active - can be used Planned - proposed but not active Submitted - currently being checked Approved - object accepted Rejected - object not approved
PTnnnn
HRTnnnn
PLOGI
PADnn
Evaluation Paths I
Evaluation Paths :
Describe a set of relationships between objects in a hierarchical structure ( i.e. O-S-P describes relationship between Org unit, Positions and Persons ) Are used to select objects for structural evaluations Are used in all standard reports Can be displayed via report RHWEGID0
Evaluation Paths II
O
ORG UNIT
O
ORG UNIT
S
POSITION
10
S
POSITION
20
008
Holder
P
PERSON
30
002
L.Supervisor of
P
PERSON
Sequential Evaluations
TABLES : OBJEC. INFOTYPES : 0000, nnnn. GET OBJEC. LOOP AT Pnnnn WHERE BEGDA LE PC-ENDDA AND ENDDA GE PC-BEGDA. ENDLOOP.
Structural Evaluations
TABLES : OBJEC, GDSTR. INFOTYPES : 0000, nnnn.
General structure description - will allow structure parameters to be used on selection screen.
GET OBJEC. LOOP AT Pnnnn WHERE BEGDA LE PC-ENDDA AND ENDDA GE PC-BEGDA. ENDLOOP.
Internal Information
Pnnnn
Internal Infotype Table
OBJEC
Object Information (from Infotype 1000)
GDSTR
Root of Structure (root object, number of objects within the hierarchy)
STRUC
Internal Structure Information
Chapter 8: Summary
Logical Database PCH can be used to read Personnel Planning and Organisational Management information
Information is retrieved by each organisational object in turn (OBJEC)
Structural evaluations can be used to read data according to the hierarchy of information
Evaluation paths (groups of relationships) are set up in the IMG to specify exactly how the structure should be searched
Chapter 9: Objectives
By the end of this chapter you will be able to:
Add a new field on to a standard SAP Infotype screen Appreciate the tools / steps involved with creating a bespoke Infotype
Enhancing an Infotype
SAP Fields
New Fields
Enhancing an Infotype
SAP Fields
Standard Screen
Enhancing an Infotype
SUBSCREEN
Screen
PBO Module
PAI Modules
ZPxxxxnn ZPxxxxmm
Regenerating the screen via PM01 may cause any amendments to be overwritten
Enhancements
PBAS
0001
Chapter 9: Exercise
Add a new field to a Standard Infotype
Enhance a standard Infotype within Personnel Administration
Chapter 9: Summary
The Infotype enhancement concept allows us to :
Add enhancements to standard Infotypes Create new bespoke Infotypes Perform additional customer validations Infotype Enhancement :
Uses the development tool - PM01 Is available in the areas of Personnel Administration & Recruitment
Chapter 10
Other Features
RHALTD00
Program for transferring PD data
RPULKT00
Program for transferring payroll accounts
GET OBJEC. WRITE : / OBJEC-OTYPE, OBJEC-OBJID, OBJEC-STEXT. LOOP AT P1002. RH-GET-TBDAT P1002-INFTY P1002-TABNR IPT1002. LOOP AT IPT1002. WRITE : / IPT1002-TLINE. ENDLOOP. SKIP 2. ENDLOOP.
Infotype Customising
Changes to standard Infotype screens may be configured according to customer requirements. Infotype Screen Control. IMG path :
Personnel Management > Personnel Admin > Customising User Interfaces > Determine screen modification
Structural Authorisation
HR Authorisations :
User Groups / Transactions According to position in the organisation
Tables
T77PR - Definition of Authorisation Profiles T77UA - User Authorisations
Function Module
ie. RH_GET_ORG_ASSIGNMENT
HR IDocs - ALE
Interfaces to other applications
HR system as a separate component HR -> AC, HR -> LO, HR -> HR
Master Data
IDoc type HRMD_A03 Select desired infotypes as filter objects within the distribution model OSS note 105148 (enhancement of standard IDoc to include extra Infotype segments)
HR ABAP Features
Dynamic Actions (Table T588Z)
Further Utilities
Selection reports for fast entry Accessing subroutines for specific periods Features
Course Evaluation