You are on page 1of 140

IBM Global Business Services

HR ABAP
Technical Overview

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

List of Topics Logical Databases Join & Projection Reports / Repetitive Structures Clusters Time Data Infosets & Infoset Queries Infotypes Logical Database PCH

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Logical Databases

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

What is a Logical Database ?


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

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Functions of the Logical Database PNP

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Logical Databases provided by SAP


HR Logical Databases In Human Resources (HR), the following logical databases can be used as a data source for HR InfoSets: PNP / PNPCE PAP PCH By selecting a logical database, you determine the HR data that can be reported on using an InfoSet. Logical Database PCH This logical database generally enables you to report on all HR infotypes. However, you are advised not to use this logical database unless you want to report on Personnel Planning data. Logical Database PNP Use logical database PNP to report on HR master data. It is possible to use logical database PCH to access this data, but PNP meets such reporting requirements more quickly because it is best suited to the task of selecting persons.

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Structure of Logical Database


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.

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

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

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Linking a Logical Database to an Executable Program

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Logical and DB Tables in PA Logical Structures Structures and Database Tables in PA

Logical structures

Database tables Screen fields Qnnnn PAnnnn PBnnnn

Pnnnn
KEY fields

Data fields PSnnnn Selection fields PNP PCLn

PERNR

10

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

LDB : Infotype Structure Infotype - Data Data Structures

DB structure PAnnnn using infotype 0002 as an example

PA0002

MANDT

PAKEY

PSHD1

PS0002

Infotype structure Pnnnn using infotype 0002 as an example

PSKEY

PSHD1

PS0002

11

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

LDB - Screening

12

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

LDB Data Retrieval

1. Create data structures forinfotypes INFOTYPES: 0001, 0002, 0007.


" Organizational Assignment " "Personal Data " " Planned Working Time"

2. Fill the data structures withthe infotype records GET PERNR.

13

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Calling a Logical Database Using a Function Module

LDB_PROCESS Function module is used to call logical databases independently from any ABAP program
Selection screen is not displayed The logical database does not trigger any GET events in the calling program, but passes the data back to the caller in callback routines The depth to which the logical database is read is determined by specifying a node name in the CALLBACK parameter For the GET event, the callback routine is executed directly after the data has been read for the node, and before the subordinate nodes are processed.

For the GET LATE event, the callback routine is processed after the subordinate nodes have been processed.

14

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Processing Infotypes in Logical Database

15

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Processing Master Data

LDB Processing Master Data Using Provide


TABLES: PERNR. INFOTYPES: 0001, 0002, 0006, .... "Actions "Personal Data "Addresses

GET PERNR. PROVIDE * FROM P0002 BETWEEN PN-BEGDA AND PN-ENDDA. WRITE...

ENDPROVIDE.

16

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Loop Nesting 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.

Infotype loop Employee loop

Infotype loop

END-OF-SELECTION.

17

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Period-Based Data (1) LDB Period Based Data -1

JANUARY - APRIL

MAY - AUGUST

Ms Y

SEPTEMBER - DECEMBER

SAP AG 1999
18 HR ABAP Jan-2007

2007 IBM Corporation

IBM Global Business Services

LDB Period Based Data - 2


January December

Period-Based Data (2)

Data Selection

Org. Assignment

January

December

Org. Assignment

January

December

19

SAP AG 1999

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Criteria Criteria LDBScreening Screening

Data selection Person selection INFOTYPES: ... GET PERNR. PROVIDE... WRITE... PAnnnn

SAP AG 1999
20 HR ABAP Jan-2007

2007 IBM Corporation

IBM Global Business Services

LDB Sort Order Sort Order

... GET PERNR. ...

PerNo. Pers.area Name 1909 1910 1899 1000 1000 1100 Sam Hawkins David Lindsay Karl May

SAP AG 1999
21 HR ABAP Jan-2007

2007 IBM Corporation

IBM Global Business Services

LDB Flow Control of Logical Database


View of HR report attributes - flow control for logical database
Program ZPLIST00 ZPLIST10 Batch 1 2 Online 1 2

Flow Control for Logical Database

1 Forward select options 2 Array fetch is active 3 Array fetch active and forward select options

22

SAP AG 1999 HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Join and Projection

23

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Joins Join and/ Projection Creating Intervals

Personal Data (0002)

Organizational Assignment (0001)

Join

24

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Joins in PROVIDE Join / Coding


TABLES: PERNR. INFOTYPES: 0001, 0002, 0006, ....

"Organizational Assignment "Personal Data "Addresses

GET PERNR. PROVIDE * FROM P0001 * FROM P0002 BETWEEN PN-BEGDA AND PN-ENDDA. WRITE... ENDPROVIDE.

25

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Join / Subtypes Join / Subtypes

TABLES: PERNR. INFOTYPES: 0001, 0002, 0006, .... GET PERNR. PROVIDE

"Organizational Assignment "Personal Data "Addresses

* FROM P0002 * FROM P0006 BETWEEN PN-BEGDA AND PN-ENDDA WHERE P0006-SUBTY = '1'. IF P0006_VALID = 'X'. WRITE... ENDIF. ENDPROVIDE.

26

SAP AG HR 1999 ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Join and Projection / Coding Joins and Projection / Coding

TABLES: PERNR. INFOTYPES:0001, 0002, ....

"Organizational Assignment "Personal Data

GET PERNR. PROVIDE STELL ENAME FROM P0001 GBDAT FROM P0002 BETWEEN PN-BEGDA AND PN-ENDDA. WRITE... ENDPROVIDE.

27

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services Table Entries Reading Time-Dependent

Reading Time-Dependent Table Entries


P0001-BEGDA

BEGDA T513S

ENDDA

SELECT * FROM T513S WHERE SPRSL = AND STELL = AND ENDDA GE AND BEGDA LE ENDSELECT.

SY-LANGU P0001-STELL P0001-BEGDA P0001-BEGDA.

28

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

HR Macros
RP_PROVIDE_FROM_LAST RP_PROVIDE_FROM_FIRST RP_SET_DATA_INTERVAL RP_READ_INFOTYPE RP-READ-ALL-TIME-ITY

29

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Options for Defining Modules

Macros can be defined in reports or includes using the ABAP command DEFINE
If a macro is changed, each report using this macro is automatically regenerated when it is executed

Macros can also be defined as RMAC macros. The source code of these modules is stored in the function section of the control table TRMAC
When you change an RMAC macro in the table TRMAC, the reports that use this macro are not regenerated automatically. You must regenerate them manually.

30

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Macro Modules Macro Modules

TABLES: PERNR. INFOTYPES: 0001, 0002, 0006, ....

"Organizational Assignment "Personal Data "Addresses

GET PERNR. RP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA. WRITE...


* * * Include program DBPNPMAC. DEFINE RP_PROVIDE_FROM_LAST. PNP-SW-FOUND = '0'. . . . END-OF-DEFINITION.

31

SAP AG 1999 HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Processing a Specific Infotype Record

Processing a Specific Infotype Record

Data selection

January

December

Table Pnnnn

January

December

GET PERNR. RP_PROVIDE_FROM_LAST <Pnnnn> SPACE PN-BEGDA PN-ENDDA. IF PNP-SW-FOUND = 1. WRITE... ENDIF.
SAP AG 1999
32 HR ABAP Jan-2007

2007 IBM Corporation

IBM Global Business Services

Reading InfotypeWithout withoutLogical using DB LDB Reading Infotypes (1)(1)

PAnnnn
INFOTYPES: <nnnn>. ... CALL FUNCTION 'HR_READ_INFOTYPE'...

33

SAP AG 1999 HR ABAP

Jan-2007

2007 IBM Corporation

Reading Infotypes Without Logical DB (2)

IBM Global Business Services

Reading Infotype Without Using LDB (2)


INFOTYPES: 0002. DATA: return LIKE SY-SUBRC. CALL FUNCTION 'HR_READ_INFOTYPE' EXPORTING . . . PERNR = <person> INFTY = '0002' BEGDA = <begdat> ENDDA = <enddat> IMPORTING SUBRC TABLES INFTY_TAB EXCEPTIONS INFTY_NOT_FOUND OTHERS
34 HR ABAP

= return = P0002 = 1 = 2.
Jan-2007

2007 IBM Corporation

IBM Global Business Services Updating Infotype Records

Updating Infotype Record


PARAMETERS: persnum LIKE P0002-PERNR, natio_o LIKE P0002-NATIO DEFAULT 'DE', natio_n LIKE P0002-NATIO DEFAULT 'D'. * Update infotype records UPDATE PA0002 SET NATIO = natio_n WHERE PERNR = persnum AND NATIO = natio_o. IF SY-SUBRC = 0. WRITE: 'Modified records', SY-DBCNT. ENDIF.

35

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Reading Planning Infotypes with Function Module

36

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Determining The Entry Date

37

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Dynamic Actions

38

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Indicator for Step


P Check conditions

I
W V F

Maintain infotype record


Set default values when creating a new record Reference to another step Call routine

Send mail

Tables used
PSAVE To check old values of field

PSPAR Transaction classes


T001P Start dates and molga

39

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Function character of step


02 for Change 04 for Create 06 for Change and create 08 for Delete 10 for Change and delete 12 for Create and delete

40

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Calling Reports Using Dynamic Actions

41

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Reports / Repetitive Structures

42

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Infotype with repetitive Structure

43

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Repetitive Structure / Evaluation (1)

44

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Repetitive Structure / Evaluation (2)

45

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

ALV Data Structures

ALV Data Structures


. . . TYPE-POOLS: SLIS. . . . DATA: alv_fieldcat TYPE slis_t_fieldcat_alv, alv_layout TYPE slis_layout_alv. . . . TYPES: BEGIN OF data_struc, pernr LIKE PERNR-PERNR, ename LIKE P0001-ENAME, . . . dar LIKE P0041-DAR01, . . . END OF data_struc. data_tab TYPE TABLE OF data_struc, data_tab_wa TYPE data_struc.

DATA:

46

SAP AG 1999

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

ALV Field Catalog

47

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

AVL Interface

48

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Clusters

49

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Clusters
Definition
It is a database object,
It is a file or table which link with Relid It combines the data from several tables with identical keys.

50

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Clusters
Different Types Of Clusters
PCL1 : Database for HR Work Area
PCL2 : Accounting Results ( Time / Payroll Results ) PCL3 : Recruitment/Applicant Tracking Data PCL4 : Documents Data PCL5 : Personnel Cost Planning

51

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Clusters
PCL2 Accounting Results table
PCL2 is a Transparent table.
PCL2-relid then it is called Cluster. PCL2- (XX) Where XX : IN India RX- International RU- USA FI- Finland RQ- Australia

52

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Importing Data

53

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Importing / Exporting with Macros

54

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Importing/Exporting using a Buffer


Program
Export UPDATE

PCLn
Import

Buffer

55

SAP AG 1999

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Importing Using a Buffer

56

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Data flow in Payroll

57

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Payroll Results

Payroll Results

REPORT RPCLSTxy.
Payroll result Suzanne Werner January 19xx WT01 WT02 WT03 /101 .... Standard salary 5000 DM Bonus 300 DM Overtime 200 DM Tot. gross amt 5500 DM

58

SAP AG 1999

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Reading the Cluster Directory


*Table containing directory of payroll results DATA: BEGIN OF RGDIR OCCURS 100. INCLUDE STRUCTURE PC261. DATA: END OF RGDIR. DATA: COUNTRY LIKE T001P-MOLGA. ... CALL FUNCTION 'CU_READ_RGDIR' EXPORTING PERSNR = PERNR-PERNR IMPORTING MOLGA = country TABLES IN_RGDIR = RGDIR EXCEPTIONS NO_RECORD_FOUND = 1 OTHERS = 2.

Reading the Cluster Directory

59

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Determining Current Payroll Result (1)

Determining Current Payroll Result (1)


DATA: number LIKE PC261-SEQNR. . . . GET PERNR. . . . CALL FUNCTION 'CU_READ_RGDIR' . . . CALL FUNCTION 'CD_READ_LAST' EXPORTING BEGIN_DATE = PN-BEGDA END_DATE = PN-ENDDA IMPORTING OUT_SEQNR = number TABLES RGDIR = RGDIR EXCEPTIONS NO_RECORD_FOUND = 1 OTHERS = 2.

60

SAP AG 1999

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Determining Current Payroll Result (2)

Determining Current Payroll Result (2)


DATA: result TYPE PAY99_RESULT. DATA: rt_header TYPE LINE OF HRPAY99_RT. . . . CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT' EXPORTING CLUSTERID = 'RX' EMPLOYEENUMBER = p0001-pernr SEQUENCENUMBER = number * READ_ONLY_BUFFER = ' ' * READ_ONLY_INTERNATIONAL = ' ' * CHECK_READ_AUTHORITY = 'X' . . . CHANGING PAYROLL_RESULT = result EXCEPTIONS . . LOOP AT result-INTER-RT INTO rt_header. WRITE: / rt_header-LGART, ... ENDLOOP.
SAP AG 1999
61 HR ABAP Jan-2007

2007 IBM Corporation

IBM Global Business Services

Clusters Data Structure for Payroll Result


Structure for Payroll Results

Structure: PAY99_RESULT EVP


Structure PC261

INTER Structure PAY99_INTERNATIONAL VERSC


Type PC202

NAT BT
Dummy for national part

RT
Type HRPAY99_RT

CRT
Type HRPAY99_CRT

DATA: result TYPE PAY99_RESULT . DATA: rt_header TYPE LINE OF HRPAY99_RT . . . . * Access to payroll result data WRITE: result -INTER-VERSC-FPPER, . . . LOOP AT result -INTER-RT INTO rt_header . WRITE: / rt_header -LGART, . . . ENDLOOP.

62

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Table Types for Payroll Results (1)


Aggregated data types:
Dictionary
Payroll result

Table Type for Payroll Results (1)

Structures (field strings) Tables

Table type: HRPAY99_TAB_OF_RESULTS Line type: PAY99_RESULT EVP


Structure PC261

INTER Structure PAY99_INTERNATIONAL VERSC


Type PC202

NAT BT

RT
Type HRPAY99_RT

CRT
Type HRPAY99_CRT

SAP AG 1999
63 HR ABAP Jan-2007

2007 IBM Corporation

IBM Global Business Services

Table Type for Payroll Results (2)

Table Types for Payroll Results (2)


DATA: result_tab TYPE HRPAY99_TAB_OF_RESULTS, result_header TYPE PAY99_RESULT. DATA: rt_header TYPE LINE OF HRPAY99_RT. DATA: rgdir LIKE PC261 OCCURS 0 WITH HEADER LINE. ... CALL FUNCTION 'PYXX_GET_EVALUATION_PERIODS' EXPORTING CLUSTERID = <Cluster> EMPLOYEENUMBER = PERNR-PERNR INPER_MODIF = <Period parameter> INPER = <In-period> TABLES RGDIR = rgdir EVALUATED_PERIODS = result_tab EXCEPTIONS NO_PAYROLL_RESULTS = 1 NO_ENTRY_FOUND_ON_CU = 2.

64

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Table Type for Payroll Results (3)

Table Types for Payroll Results (1)


CALL FUNCTION 'PYXX_GET_EVALUATION_PERIODS' EXPORTING . . . IF SY-SUBRC = 0. LOOP AT result_tab INTO result_header. WRITE: / PERNR-PERNR, P0001-ENAME, result_header-INTER-VERSC-FPPER, . . . LOOP AT result_header-INTER-RT INTO rt_header. WRITE: / rt_header-LGART, . . . ENDLOOP. ENDLOOP. ENDIF.

65

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Clusters - Display of Payroll Result(PC00_M40_CLSTR)

66

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Clusters - Display of Cluster data Payroll Result

67

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Clusters - Display of Cluster data Payroll Result

68

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Clusters - Important Structures to read Payroll data


1 . Payxx_result ( internal structures EVP/ INTER / NAT ) Where xx :99 = International DE = Germany IN = India FI = Finland

2. HRPAYxx_RT/ CRT/ WPBP. Where xx :99 = International DE = Germany IN = India FI = Finland

69

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Clusters - Function Modules To Read Payroll data


1. PYXX_GET_RELID_FROM_PERNR 2. CU_READ_RGDIR 3. CD_READ_LAST 4. PYXX_READ_PAYROLL_RESULT

70

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Time Data

71

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services Time Data

Time Data
Contents:
Dependency of Time Data on Validity Period Importing Time Data Processing Time Data Using Internal Tables

SAP AG 1999

72

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Time data and Validity Period

Time Data and Validity Period

Data selection period

Leave

15 days

PROVIDE... WRITE... ENDPROVIDE.

15 days

73

SAP AG 1999 HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Importing Time Data (1) (1) Importing Time Data

Data selection period

INFOTYPES: 2001, "Absences 2002, "Attendances 2005, "Overtime 2010. "Employee Remuneration Info GET PERNR.
74 HR ABAP Jan-2007

PAnnnn

2007 IBM Corporation

IBM Global Business Services

Importing Time Data (2)


INFOTYPES: 0001, 0002, ... 2005 MODE N.

Importing Time Data (2)

GET PERNR. RP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA. . . . . RP_READ_ALL_TIME_ITY PN-BEGDA PN-ENDDA. . . . . LOOP AT P2005. WRITE... ENDLOOP.

75

HR ABAP SAP AG 1999

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Importing Time Data to Internal Tables


TYPES: BEGIN OF overtime, bukrs LIKE P0001-BUKRS, werks LIKE P0001-WERKS, btrtl LIKE P0001-BTRTL, stdaz LIKE P2005-STDAZ, END OF overtime. DATA: tab TYPE TABLE OF overtime WITH HEADER LINE. GET PERNR. RP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA. MOVE-CORRESPONDING P0001 TO tab. RP_READ_ALL_TIME_ITY PN-BEGDA PN-ENDDA. LOOP AT P2005. MOVE-CORRESPONDING P2005 TO tab. COLLECT tab. (oder: APPEND tab.) ENDLOOP. bukrs werks btrtl

Importing Time Data to Internal Tables

stdaz

Work area(header line)

Data area

76

SAP AG 1999 HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Processing Time Data with Internal Tables


Header processing
END-OF-SELECTION. LOOP AT tab. AT FIRST. ... ENDAT. AT NEW bukrs. ... ENDAT. tab BUKRS WERKS 0001 0001 0002 0002 0001 0001 0002 0002 BTRTL 0001 0002 0003 0004 AT NEW werks. ... ENDAT.

Processing Time Data with Internal Tables

Single record processing


AT END OF werks. ... ENDAT. AT END OF bukrs. ... ENDAT.

Footer processing
SAP AG 1999
77 HR ABAP

AT LAST. ... ENDAT. ENDLOOP.


Jan-2007

2007 IBM Corporation

IBM Global Business Services

Infosets and Infoset Query

78

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Infosets and User Groups

79

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Assign Infosets to User Groups ( Transaction SQ03 )

80

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Reporting on Data from PNP/PNPCE and PCH


Logical database PNP PCH PAP

Selection of
Infotypes that can be included in the InfoSet

Persons
Infotypes for Personnel Administration (00000999) Time Management (2000-2999) Payroll infotypes Infotypes for Personnel Planning objects that can be related to persons

Objects from Personnel Planning


If the object type is specified: Infotypes for the object type Infotypes for objects that can be related to the specified object type If the object type is not specified: All infotypes

Applicants

Infotypes for Recruitment (40004999) Some infotypes for Personnel Administration (such as 0001 and 0002)

Customer infotypes

81

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Procedure for Creating and Changing Infosets (SQ02)

82

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Initial Maintenance Screen for Reporting on Person/Applicants

83

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Ad Hoc Query

84

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Creating Queries II

85

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Ad Hoc Query: Overview

86

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Restricting Reporting Set

87

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Creating Queries

88

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Infotypes

89

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Infotype Data Structure


Four digit number nnnn Unique identification 9000 to 9999 reserved for customer infotypes

90

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Naming Conventions for Infotypes


0000 to 0999 HR Master data / Applicant data 1000 to 1999 Organizational Management 2000 to 2999 Time data 4000 to 4999 Applicant data 5000 to 5999 Planning Infotypes 9000 to 9999 Customer defined

91

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Personnel Administration Transparent Tables

Key Fields

Administration Fields

Custom Fields

92

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Database Table For Applicant Infotypes

93

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Components of an Infotype

94

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Infotype specific include programs


The main program MPnnnn00 only contains INCLUDE statements. If you create the main program using transaction PM01 Dialogs in HR, the system also creates the following four includes:

Name of include MPnnnn10

The include contains The PROGRAM statement and the declaration of common data objects PBO modules for the screens PAI modules for the screens subroutines

MPnnnn20 MPnnnn30 MPnnnn40

95

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Infotype Screens
Each infotype has at least three screens:

An initial screen ( 1000 )


Initial screen is used as technical interface Processed in background and not displayed

A single screen ( 2000 )


Its an interface between the system and the user
It enables to create, display or maintain data records

A list screen ( 3000 )


Enables to list all records in info type

96

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Initial Screens
Initial screen is used as technical interface Screen 1000 is used for all infotypes Processed in background.

Performs general initialization procedures

97

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Initial Screen - Preview

98

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Single Screen - Preview

99

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

List Screen - Preview

100

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Infotype Time Constraint


A time constraint indicates whether more than one infotype record may be available at one time. The following time constraint indicators are permissible: 1 No overlapping and no gaps. Eg : Infotype 0000 - Actions 2 No overlapping but time gaps are permitted. Eg : Infotype 0021 - Family Details 3 Overlapping and and time gaps are permitted. Eg : Infotype 0019 Monitoring of Task

101

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Other Possible Time Constraints


A Only one record may exist, valid from 01/01/1800 to 12/31/9999. Splitting and deletion is not permissible.

Only one record may exist, valid from 01/01/1800 to 12/31/9999. Splitting is not permissible, but may be deleted.

The time constraint varies depending on the subtype.

Refers to time management infotypes.

102

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Infotype Characteristics
The following tables must be maintained for each infotype: Name of table T582A Task Basic infotype characteristics (database tables, single screen, list screen, time constraint, dialog module, and so on) T582S T777A Infotype short texts Technical Characteristics of Infotype (database table, dialog module, and so on) Name of data field structure (PSnnnn)

T77ID

103

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Creating Personnel Administration Infotypes Step 1

104

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Creating Personnel Administration Infotypes Step 2

105

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Creating Personnel Administration Infotypes Step 3

106

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Created Objects

107

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Enhancing Personnel Administration Infotypes Overview

108

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Enhancing Personnel Administration Infotypes Procedure

109

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Enhancing Infotypes Created Objects

110

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Creating HRP info types


Transaction code : PPCI. (Personnel Planning Infotype Copier)

111

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Creating HRP info types


We can create the following kinds of info types: Language-dependent field info types Language-independent field info types Language-dependent table info types Language-independent table info types
We can also specify whether an info type is country-specific or not

112

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Creating HRP info types

113

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Creating HRP info types


Start the Data Dictionary (SE11) Select the Radio button Data Type Enter the info type no). HRI9nnn ( Where 9nnn is

Click on Create Button, and Create the required Structure Save , Check and Activate the Structure

114

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Creating HRP info types

115

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Creating HRP info types

116

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Creating HRP info types


Go to T Code : PPCI Enter Info the details Info type : 9nnn Info type name : xxxxx Click on Create, it will display Extended screen

117

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Creating HRP info types

118

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Creating HRP info types

119

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Creating HRP info types


Here you can select Field info type / Table Info Type Language Dependent/ Independent Country Specific / not After selecting these options click on Create Button

120

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Creating HRP info types

121

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Creating HRP info types


After Creation of Infotype Maintain the Following Details using TCode: OOIT Time Constraint Infotype Per Object Type

122

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Logical Database PCH(PNP)

123

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Data Model

124

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Relationship Between Basic Object Type

125

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Table Infotype

126

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Sequential Evaluation

127

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Structural Evaluation

128

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Evaluation Path

129

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Maintaining Evaluation Path

130

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Sequential Evaluation Coding

131

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Structural Evaluations Coding

132

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Structure Parameters

133

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Setting Structure Condition

134

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Filling Fields in the Selection Screen

135

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Evaluating Additional Data on Relationship

136

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Evaluating Table Infotype

137

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Evaluating the Infotype Index

138

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Questions ?

139

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Thank You

140

HR ABAP

Jan-2007

2007 IBM Corporation

You might also like