ABAP Programming in HR
ABAP Programming in HR
ABAP Programming in HR
ABAP Programming in HR
Listen
Respect each Deeply
one’s truth
HR Overview
Client
C o m p an y X YZ
Company Code
US M e x ico
P h oe n ix S a n F ra n c is co Personnel Area
Employee
A c tive E m p loye es
Group
Jobs are defined in the job index and they are seen as a base for the SAP HR
Personnel Development module:
Job Career paths;
Competencies and Qualifications;
This object will be used for reporting purposes, to group employees from
Functional Area different organizational units into logical functional areas groupings.
Some examples of defined functional areas: Commercial, Finance, Legal …
O
OM - Example S
LBC Ltd. P
Michael Johnson Suzanne Thomson Zonal Mgr (North) Zonal Mgr (South)
O – Org Unit
S – Position
P – Person Catherine Jennifer
• PA Tables • PB Tables
– For all employees master – Recruitment master data
data – Prefix with PBnnnn
– Prefix with PAnnnn – Transaction codes are PB30,
PB20, PB40 and PB10
– Transaction codes are
– Applicant number , BEGDA
PA30, PA20, PA40 and and ENDDA are the main key
PA10 fields
– Employee number , BEGDA
and ENDDA are the main
key fields
Exercise 1
Exercise2
Logical Database
An HR report which uses the logical database has the following basic structure:
REPORT RPABAP01.
TABLES: PERNR.
INFOTYPES: 0001.
GET PERNR.
PROVIDE * FROM P0001 BETWEEN PN-BEGDA AND PN-ENDDA.
WRITE: / P0001-PERNR,
P0001-STELL,
P0001-BEGDA,
P0001-ENDDA.
ENDPROVIDE.
This report evaluates the Organizational Assignment infotype records in the
specified data selection period.
additions: NAME x,
OCCURS 999,
MODE N,
VALID FROM begin TO end.
GET PERNR.
…
process infotype data for employee
…
END-OF-SELECTION.
START-OF-SELECTION.
…
GET PERNR.
PROVIDE * FROM P0001
BETWEEN PN/BEGDA
The data selection period
AND PN/ENDDA. from the selection screen
is used here.
ENDPROVIDE.
END-OF-SELECTION.
SYNTAX:
RP-PROVIDE-FROM-LAST Pnnnn SPACE PN/BEGDA
PN/ENDDA.
Pnnn is the infotype, SPACE is the subtype (1, 2, 3, etc.
or SPACE if no subtype exists), PN/BEGDA is the
beginning date and PN/ENDDA is the ending
TABLES: PA0002.
DATA: V_NACHN LIKE PA0002-NACHN.
HR Report
Category
GET pernr.
PROVIDE * FROM p0001
* FROM p0002 BETWEEN pn-begda AND pn-endda.
WRITE: / p0002-pernr , p0002-vorna, p0002-nachn.
ENDPROVIDE.
END-OF-SELECTION.
GET pernr.
PROVIDE pernr stell begda endda FROM p0001
BETWEEN pn-begda AND pn-endda.
WRITE: / p0001-pernr,
p0001-stell,
p0001-begda,
p0001-endda.
ENDPROVIDE.
END-OF-SELECTION.
Exercise4
Exercise 5
Infotype Creation
• In the Sub objects box, select CI include and choose Create. This takes
you to the following screen: Dictionary: Initial Screen.
• Create the CI include and choose Activate. If you want to include fields
that are completely new, you must also create data elements. Go back to
the Enhance Infotypes screen.
• Result: you have included additional fields in the standard single screen of
an infotype.
reports to/
is line
supervisor Cost Center Allocation
of
Organizational
belongs to Cost center
Cost Center
incorporates
Allocation
is belongs to
described
by
describes incorporates
is is
Job described described Position Work center
by by occupies
Holder
describes
describes
Task Person/user
SAP AG 1999
Objectty
p es Objecttypekeys
Organizationalunits O
Jobs C
Positions S
CostCenters K
Persons P
SAPAG1999
An organizational plan can be made with many object types, although the five basic object types are the building blocks.
Organizational units O
Jobs C
Positions S
Cost centers K
Persons P
Persons hold positions that are defined by jobs and assigned to organizational units and cost centers.
SAP AG 1999
Relationship
Administrative assistant
A/B 007
for marketing department
Administrative assistant
for executive board
Job:
Administrative
assistant
Administrative assistant
for research department
SAP AG 1999
Holder
Relationship
Position A/B 008 Person
SAP AG 1999
O Organizational unit
C Job
S Position
P Person
K Cost Center
T Task
A Work Center
Q Qualification
BU Budget
SAP AG 1999
Organizational unit O
C Job
Job C
Position S S S
Tasks T Position S Position
Position
Work centers A
O Org.unit
S O Org.unit
Position
S Position
C Job
S Position T T
Task Task
S S
Position Position
SAP AG 1999
S e q u e n t ia l e v a lu a t io n s
Executive Board
Human resources
Financial accounting
Accounts receivable
Payroll
Validation
Accounts payable
Social insurance
SAP AG 1999 . . . . . .
SAP AG 1999
TABLES: OBJEC.
INFOTYPES: 0002, "Personal Data
1003, "Addresses
....
GET OBJEC.
LOOP AT Pnnnn
WHERE BEGDA LE PC-ENDDA
AND ENDDA GE PC-BEGDA.
WRITE...
ENDLOOP.
SAP AG 1999
GET OBJEC.
LOOP AT Pnnnn
WHERE BEGDA LE PC-ENDDA
AND ENDDA GE PC-BEGDA.
WRITE...
ENDLOOP.
SAP AG 1999
. . .
SAP AG 1999
SAP AG 1999
Pay statement
Payroll
Payment
Gratuities
Basic pay
Gross pay
Overtime
Bonuses
Weekly Semi-Monthly
7 14 21 28 15 30
SAP AG 1999
Release payroll
Start payroll
Check results
No
Error-free? Corrections
Yes
Exit payroll
SAP AG 1999
Payroll driver
Start payroll RPCALC*0
Payroll Driver
?
Selections from Matchcodes
Payroll period
Payroll area U1
Current period
Other period
Selection
Personnel number
Payroll area U1
SAP AG 1999
R*
PAnnnn payroll
- infotype data driver PCL2
Payroll result
PCL1
- variable data
SAP AG 1999
Cluster xy
PCL2
creates
RPCLSTxy
SAP AG 1999
SAP AG 1999
SAP AG 1999
*Call feature
PERFORM RE549D USING ‘ABKRS’ ‘2’ V_ABKRS V_ERROR.