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

Logicall Structures and DB Tables lin PA A Logi Stru tur nd t T in

Logi

l tru tur

l Bnnnn

nnnn
KEY fi l s

cr fi l s
Qnnnn

Annnn

t fi l s
Snnnn

l cti fi l s

Ln

10

HR ABAP

Jan-2007

2007 IBM Corporation

1999

IBM Global Business Services

LDB : Infotype Data tur Infotyp t Stru Structure

B tru tur

Annnn u ing infotyp 000

n x mpl

A000

MANDT

AKEY

D1

Infotyp

tru tur

nnnn u ing infotyp 000

n x mpl

KEY

D1

11

HR ABAP

Jan-2007

2007 IBM Corporation

1999

IBM Global Business Services

LDB - Screening

12

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

LDB Data Retrieval

1. Create ata str ct res for i fot INFOTYPES: 0001, 0002, 0007.

es

" Orga izatio al ssig e t" "Perso al Data " " Pla e Worki g i e"

2. Fill the ata str ct res withthe i fot GET PERNR.

e recor s

13

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Calling a Logical Database Using a Function Module

 LD _PROC 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 ro ti es  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 L TE 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

Processi g 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

SAP AG

IBM Global Business Services

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

Ift l Empl l p

Ift l

END-OF-SELECTION.

17

HR ABAP

Jan-2007

2007 IBM Corporation

AP AG 1999

IBM Global Business Services

riod-B sed (1) LDB Period Basedt Data -

JA UA Y - A

IL

MAY - AUGUST

Ms Y

SE TEMBE - E EMBE

AP AG 1999
18 HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

LDB Period Based Data - 2


January ecem er

eriod-Based ata ( )

t Selection

January

Org. Assignment

ecem er

January

Org. Assignment

ecem er

19

AP AG 1999

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

LDBScree i g Criteria Criteria Screening

Data selectio Perso selectio

INFOTYPES: ... GET PERNR. PROVIDE... WRITE...


P

20

HR ABAP


Jan-2007 2007 IBM Corporation

SAP AG

IBM Global Business Services

LDB Sort Or er Sort Order

... GET PERNR. ...

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

21

HR ABAP


Jan-2007 2007 IBM Corporation

SAP AG

IBM Global Business Services

Flow ontrol for Logical atabase

LDB Flow Control of Logical Database


View of
Program ZPLIST00 ZPLIST10

report attributes - flow control for logical database


Batch 1 Online 1

1 For r s l ct options Arr f tc is cti Arr f tc cti nd for rd s l ct options

22

AP HR ABAP AG1999

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 Joi / Projection and Creati g Intervals

Perso al Data (0002)

Orga izatio al ssig e t (0001)

Joi

24

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Joins in PROVIDE

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 / Subt es 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 1999 HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Join and Joins and Projection / /oding 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 Reading Time- ependent Table Entries

Reading Time-Dependent Table Entries


P0001-BEG A

BEG A T 1 S

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

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

28

HR ABAP

Jan-2007

2007 IBM Corporation

AP AG 1999

IBM Global Business Services

HR Macros
 RP_PROVIDE_FROM_L ST  RP_PROVIDE_FROM_FIRST  RP_SET_D TA_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 efine in re orts or includes using the ABAP co DEFINE


 If a acro is changed, each re ort using this when it is e ecuted

and

acro is auto aticall regenerated

 Macros can also be defined as RMAC acros. The source code of these odules is stored in the function section of the control table TRMAC
 When ou change an RMAC acro in the table TRMAC, the re orts that use this acro are not regenerated auto aticall . You ust regenerate the anuall .

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 Infot pe Record

Processing a Specific Infotype Record

Data selection

Januar

Dece ber

Table Pnnnn

Januar

Dece ber

GET PERNR. RP_PROVIDE_FROM_LAST <Pnnnn> SPACE PN-BEGDA PN-ENDDA. IF PNP-SW-FOUND = 1. WRITE... ENDIF.
32

SAP AG 1999 HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

ReadingInfot pes Without Logical DB (1)(1) Reading Infotype without using LDB

PAnnnn

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

33

SAP AG 1999 ABAP HR

Jan-2007

2007 IBM Corporation

Reading Infot pes 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 Infot pe 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 I W V F M Check conditions 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

ata 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

AP 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 co bines the data fro several tables with identical ke s.

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 ( Ti e / Payroll Results )  PCL3 : Recruit ent/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 R - 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

Importing/Exporting Using a Buffer


IBM Global Business Services

Importing/Exporting using a Buffer


Program
Export UPDATE

PCLn
Import

Buffer

55

HR ABAP

Jan-2007

2007 IBM Corporation

AP AG 1999

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 T01 WT0 WT03 /101 .... erner January 19xx 000 300 200 00 DM DM DM DM

Standard salary Bonus Overtime Tot. gross amt

58

AP 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

SAP AG 1999

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

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


61

AP AG 1999

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Clusters Data Structure for Payroll Result


tr t r f r r ll lt

tr P
Str

t r : PAY INT
T

T
Str t r PAY INT NAT IONAL

NAT T
C T

t r PC261

SC
! 
PC202 T

P AY

P AY

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

# % $$

#" ! 

# % $$

#" ! 

C T

f r rt

ti

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

AP AG 1999

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

SAP AG 1999

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 Time Data Business Services

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

72

&

AP AG 1999

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

SAP AG 1999

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. bu rs wer s btrtl

Importing Time Data to Internal Tables

stdaz

Wor area(header line)

Data area

76

'

AP 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 HR ABAP

AT LAST. ... ENDAT. ENDLOOP.


Jan-2007 2007 IBM Corporation

77

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 Selection of Infotypes that can be included in the InfoSet PNP Persons Infotypes for y Personnel Administration (00000999) y Time Management (2000-2999) y Payroll infotypes y Infotypes for Personnel Planning objects that can be related to persons PCH Objects from Personnel Planning If the object type is specified: y Infotypes for the object type y Infotypes for objects that can be related to the specified object type If the object type is not specified: y All infotypes PAP Applicants

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

y 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

In ot pe C aracteristics
e ollo in tables ust be aintaine or eac in ot pe

82A

Basic inot pe c aracteristics atabase tables sin le screen list screen ti e constraint ialo o ule an so on

82S 777A

In ot pe s ort te ts ec nical C aracteristics o In ot pe atabase table ialo so on a e o ata iel structure PSnnnn o ule an

77I

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