Vous êtes sur la page 1sur 26

Basic ABAP - HR Training Day 1

Agenda
1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. What is HCM? HCM Sub-Module Difference between Conventional ABAP Concepts of Infotypes Logical Databases in HCM Macros in HCM Clusters in HCM Enhancement and creation of Infotype Reporting in Payroll & Time in HCM Form editor for Payslip User Exits and BAdIs Authorization Objects in HCM Naming Conventions used in HCM List of Transaction code List of Standard Reports
2

What is HCM?
Human Capital Management (HCM)

The task of HCM is to produce the organizational hierarchies , relationship between employees and to allow storage and administration of employee data.

HCM Sub-Module

Personnel Management Time Management Payroll SAP Learning Solution Training & Event Management Organizational Management Information System( Standard Reports )
4

HCM Sub-Module(Functions)
1. The Personnel administration (PM) submodule helps employers to track employee master data, work schedules, salary and benefits information. 2. From the Organization Management(OM) perspective, companies can model a business hierarchy, the relationships of employees to various business units and the reporting structure among employees. 3. Current Personnel Development (PD) functionality focuses on employees' skills, qualifications and career plans. 4. Finally, the Time Evaluation (TM) and Payroll (PY) submodules process attendance and absences, gross salary and tax calculations, and payments to employees and third-party vendors.

Some Important terms used in HCM

Company Code
Personnel area

Employee Subgroup
Payroll area

Personnel Sub-area
Cost Center

Organizational unit
Job

Employee Group

Position

Difference between Conventional ABAP and ABAP HR ?

Difference between Conventional ABAP


The following concepts are defined in HCM which differs this module with other Modules 1. Use of Infotypes 2. The use of Logical Database 3. Use of Macros 4. Storage and Access of data 5 Authorization checks

Concepts of Infotypes
What is an Infotype? A group of related data fields Appears as an entry screen for the user Time dependent storage. Identifiable through a four character numerical string Database table associated with it

Number Range

Reserved

0000 0999 1000 1999 2000 2999 3000 8999 9000 9999

Master Data Planning Data Time Data Not Yet Used Customer Specific Infotypes

Concepts of Infotypes
Subtype: Subdivision of infotypes.

Subtype have been created for infoypes in order to subdvide similar information groups of this type into variants with similar information content. From technical point of view the subtype specification is a four character alphanumeric data field. For e.g. Infotype 0021(Family Member/Dependents) may contain information about spouse, children.

10

Concepts of Infotypes
Time constraints: Enable you to determine how the validity periods of Infotype data records interact. Time constraint 1: Exactly one valid data record of the infotype in question must exist for the entire time that the employee belongs to the enterprise. Time constraint 2: No more than one valid data record of the infotype in question can exist at any one time. Time constraint 3: Any number of valid data records of the infotype in question can exist at any one time.

11

Concepts of Infotypes
Transparent tables for infotype Each infotype has a transparent table. Each logical field for an infotype has a corresponding physical field on the database. One physical table is stored on the database for each transparent table. The names of the physical table and logical table definition in the Dictionary are compatible. The following naming convention applies to infotype tables; nnnn stands for the infotype number: PAnnnn for transparent tables in Personnel Administration PBnnnn for transparent tables in Recruitment HRPnnnn for transparent tables in Personnel Planning Example : For Infotype 0000, the corresponding database table associated with it is PA0000

12

Concepts of Infotypes
Transparent tables for infotype It is not true always that a Personnel Administration/Recruitment/Personnel Planning etc has a transparent table like PAnnnn or PBnnnn or HRPnnnn. One such example is TEVEN table for IT 2011.It is better to use the Function module. HR_INFOTYPE_DATABASETABLE_GET to get the Infotype table name for an infotype. CALL FUNCTION 'HR_INFOTYPE_DATABASETABLE_GET' EXPORTING INFTY = <INFTY> TCLAS = <TCLAS> Transaction Class with values A or B or T IMPORTING DBNAME = <DBTAB> EXCEPTIONS ENTRY_NOT_FOUND = 1 OTHERS = 2. You can also use the database table T777D to find the database table associated with an infotype.
13

Logical Databases in HCM

What is Logical Database(LDB)? Uses of LDB.

14

Logical Databases in HCM


To reduce programming efforts, HCM often make use of the logical databases when creating reports. Logical databases are special ABAP Programs that provides Standard selection screen, Data retrieval and Authorization check. Logical Databases used In HCM 1. 2. 3. 4. 5. PAP ( Applicant administration ) PNP ( Personnel Management ) PNPCE - Enhanced version of PNP available form SAP Enterprise version onwards ( Personnel Management ) PCH ( Organisational Management ) PTRVP ( Travel Management )

The Logical Databases PNP/PNPCE are mostly used.

15

Macros in HCM

What is a Macro?

16

Macros in HCM
Like subroutines and function modules, macro modules can be used to modularize programs. Macro modules are frequently used in HCM. These macros are defined in program SAPDBPNP (include DBPNPMAC) with the keyword DEFINE. They can be used in any program that uses the logical database PNP. If you want to use these macros in reports that do not use the logical database PNP, you must include program DBPNPMAC with the keyword INCLUDE. You can also define your own macros. In accordance with the naming convention, the first two letters stand for the application. Some macros are also stored in the Macros in ABAP Programs table (TRMAC)

17

Macros in HCM
Example of Macros are RP_PROVIDE_FROM_FRST which is available in table TRMAC RP_PROVIDE_FROM_LAST which is available in the include DBPNPMAC The RP_PROVIDE_FROM_LAST macro retrieves the last valid data record in the data selection period. The parameters for RP_PROVIDE_FROM_LAST are: infotype, subtype, start date, and end date. If you do not want to specify a particular subtype, enter SPACE. You can process not only the last valid data record in the data selection period, but also the first valid data record using the RP_PROVIDE_FROM_FRST macro. The macro return code PNP-SW-FOUND has the value 1 if a suitable entry exists in the infotype table for the specified period. If no entry is found, the value is 0.
18

Clusters in HCM

19

Clusters in HCM

Database tables of type PCLn are divided into subareas known as data clusters. Data clusters can be identified by their twocharacter IDs. To see the cluster definitions use RPC*&&00. Where * is the cluster table && is the Data clusters(RELID).

20

Clusters in HCM
Database Tables PCLn

PCLn

A1 A2

A3

SAP AG 1999

21

Clusters in HCM
Cluster table PCL1: PCL1 contains the following data areas B1 Time events/PDC G1 Group incentive wages L1 Individual incentive wages PC Personal calendar TE Trip costs/accounting results TC Trip costs/credit card data TX Infotype texts Z1 Interface PDC -> cost accounting/materials management This table is mainly used for retrieving data from the following data areas: 1. B1 2. TX
22

Clusters in HR
Cluster table PCL2: PCL2 contains the following data areas: B2 CU PS PT RX XY Time accounting results Cluster directory Generated schema Texts for generated schemas Payroll results/international Payroll results/country-specific, whereby XY represents the relation ID. This is from RELID field of table T500L for the country. ZL Personal work schedule

23

Clusters in HR
DB Table Administration/ PCLn

PCLn
IMPORT A1 A2 EXPORT
TABLES: PCLn.

1. The PCLn import/export database tables are managed by the ABAP commands IMPORT and EXPORT. 2. We can use these commands to store any data object - such as fields, structures or internal tables - on the database, or to read them from the database. 3. Data is read and written using a unique key.
SAP AG 1999

24

Clusters in HR
Table Structure / PCLn

Field name KEY CLIENT RELID SRTFD SRTF2 X X X X

Length 3 2 40 10

Text Client Relation ID Work area key Sort field for duplicate key

Example of international payroll results: RELID SRTFD RX 00001911 00001 RX 00001911 00002 RX 00001911 00003 ...

SAP AG 1999

25

Thank You!

26

Vous aimerez peut-être aussi