Basic HR ABAP Training - Day 1

Embed Size (px)

Citation preview

  • 8/13/2019 Basic HR ABAP Training - Day 1

    1/26

    1

    Basic ABAP HRTraining Day 1

  • 8/13/2019 Basic HR ABAP Training - Day 1

    2/26

    2

    Agenda

    1. What is HCM?2. HCM Sub-Module

    3. Difference between Conventional ABAP

    4. Concepts of Infotypes

    5. Logical Databases in HCM

    6. Macros in HCM

    7. Clusters in HCM

    8. Enhancement and creation of Infotype

    9. Reporting in Payroll & Time in HCM

    10. Form editor for Payslip

    11. User Exits and BAdIs

    12. Authorization Objects in HCM13. Naming Conventions used in HCM

    14. List of Transaction code

    15. List of Standard Reports

  • 8/13/2019 Basic HR ABAP Training - Day 1

    3/26

    3

    What is HCM?

    Human Capital Management (HCM)

    The task of HCM is to produce the organizationalhierarchies , relationship between employees and

    to allow storage and administration of employee data.

  • 8/13/2019 Basic HR ABAP Training - Day 1

    4/26

    4

    HCM Sub-Module

    Personnel Management

    Time Management

    Payroll

    SAP Learning Solution

    Training & Event Management

    Organizational Management

    Information System( Standard Reports )

  • 8/13/2019 Basic HR ABAP Training - Day 1

    5/26

    5

    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 tovarious 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 taxcalculations, and payments to employees and third-party vendors.

  • 8/13/2019 Basic HR ABAP Training - Day 1

    6/26

    6

    Some Important terms used in HCM

    Company Code Employee Subgroup

    Personnel area Payroll area

    Personnel Sub-area Organizational unit

    Cost Center Job

    Employee Group Position

  • 8/13/2019 Basic HR ABAP Training - Day 1

    7/26

    7

    Difference between Conventional ABAP

    and ABAP HR ?

  • 8/13/2019 Basic HR ABAP Training - Day 1

    8/26

    8

    Difference between Conventional ABAP

    The following concepts are defined in HCM which differs thismodule 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

  • 8/13/2019 Basic HR ABAP Training - Day 1

    9/26

    9

    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

    Concepts of Infotypes

    Number Range Reserved

    00000999 Master Data

    10001999 Planning Data

    20002999 Time Data30008999 Not Yet Used

    90009999 Customer Specific Infotypes

  • 8/13/2019 Basic HR ABAP Training - Day 1

    10/26

    10

    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.

  • 8/13/2019 Basic HR ABAP Training - Day 1

    11/26

    11

    Concepts of Infotypes

    Time constraints: Enable you to determine how the validity periods ofInfotype 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.

  • 8/13/2019 Basic HR ABAP Training - Day 1

    12/26

    12

    Transparent tables for infotype

    Each infotype has a transparent table. Each logical field for an infotype hasa corresponding physical field on the database.

    One physical table is stored on the database for each transparent table. Thenames of the physical table and logical table definition in the Dictionary are

    compatible.

    The following naming convention applies to infotype tables; nnnn stands forthe infotype number:

    PAnnnnfor transparent tables in Personnel Administration

    PBnnnnfor transparent tables in Recruitment HRPnnnnfor transparent tables in Personnel Planning

    Example : For Infotype 0000, the corresponding database table associatedwith it is PA0000

    Concepts of Infotypes

  • 8/13/2019 Basic HR ABAP Training - Day 1

    13/26

    13

    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 TEVENtable 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 =

    TCLAS = Transaction Class with values A or B or T

    IMPORTING

    DBNAME = EXCEPTIONS

    ENTRY_NOT_FOUND = 1

    OTHERS = 2.

    You can also use the database table T777Dto find the database table associated

    with an infotype.

    Concepts of Infotypes

  • 8/13/2019 Basic HR ABAP Training - Day 1

    14/26

    14

    Logical Databases in HCM

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

  • 8/13/2019 Basic HR ABAP Training - Day 1

    15/26

    15

    To reduce programming efforts, HCM often make use of the logical databaseswhen creating reports. Logical databases are special ABAP Programs that

    provides Standard selection screen, Data retrieval and Authorizationcheck.

    Logical Databases used In HCM

    1. PAP ( Applicant administration )

    2. PNP ( Personnel Management )

    3. PNPCE - Enhanced version of PNP available form SAP Enterpriseversion onwards ( Personnel Management )

    4. PCH ( Organisational Management )

    5. PTRVP ( Travel Management )

    The Logical Databases PNP/PNPCE are mostly used.

    Logical Databases in HCM

  • 8/13/2019 Basic HR ABAP Training - Day 1

    16/26

    16

    Macros in HCM

    What is a Macro?

  • 8/13/2019 Basic HR ABAP Training - Day 1

    17/26

    17

    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 logicaldatabase 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)

  • 8/13/2019 Basic HR ABAP Training - Day 1

    18/26

    18

    Macros in HCM

    Example of Macros are

    RP_PROVIDE_FROM_FRSTwhich is available in table TRMAC

    RP_PROVIDE_FROM_LASTwhich is available in the includeDBPNPMAC

    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-FOUNDhas 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.

  • 8/13/2019 Basic HR ABAP Training - Day 1

    19/26

    19

    Clusters in HCM

  • 8/13/2019 Basic HR ABAP Training - Day 1

    20/26

    20

    Database tables of type PCLn are divided into

    subareas known as data clusters.

    Data clusters can be identified by their two-

    character IDs.

    To see the cluster definitions use RPC*&&00.

    Where * is the cluster table

    && is the Data clusters(RELID).

    Clusters in HCM

  • 8/13/2019 Basic HR ABAP Training - Day 1

    21/26

    21

    Clusters in HCM

    SAP AG 1999

    Database Tables PCLn

    PCLnPCLn

    A1

    A2

    A3

  • 8/13/2019 Basic HR ABAP Training - Day 1

    22/26

    22

    Clusters in HCM

    Cluster table PCL1:

    PCL1 contains the following data areas

    B1 Time events/PDC

    G1 Group incentive wagesL1 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

  • 8/13/2019 Basic HR ABAP Training - Day 1

    23/26

    23

    Clusters in HR

    Cluster table PCL2:

    PCL2 contains the following data areas:

    B2 Time accounting results

    CU Cluster directoryPS Generated schema

    PT Texts for generated schemas

    RX Payroll results/international

    XY 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

  • 8/13/2019 Basic HR ABAP Training - Day 1

    24/26

    24

    Clusters in HR

    DB Table Administration/ PCLn

    IMPORT

    PCLnPCLn

    A1 A2

    TABLES: PCLn.

    EXPORT

    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.

  • 8/13/2019 Basic HR ABAP Training - Day 1

    25/26

    25

    Clusters in HR

    Table Structure / PCLn

    Field name

    CLIENT

    RELID

    SRTFDSRTF2

    KEY

    X

    X

    XX

    Length

    3

    2

    4010

    Text

    Client

    Relation ID

    Work area keySort field for duplicate key

    Example of international payroll results:

    RELID SRTFD

    RX 00001911 00001

    RX 00001911 00002

    RX 00001911 00003

    . . .

  • 8/13/2019 Basic HR ABAP Training - Day 1

    26/26

    26

    Thank You!