Você está na página 1de 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 Structures
Structures and
Tables
in PA
Logical
andDatabase
DB Tables
in PA

Logical structures

Pnnnn
KEY fields

Database tables
Screen
fields

PAnnnn

PBnnnn

Qnnnn

Data fields
PSnnnn

Selection
fields PNP

PCLn

PERNR

10

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Infotype
- Data Data
Structures
LDB
: Infotype
Structure

DB structure PAnnnn using infotype 0002 as an example

PA0002

MANDT

PAKEY

PSHD1

PS0002

Infotype structure Pnnnn using infotype 0002 as an example

PSKEY

11

HR ABAP

PSHD1

PS0002

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

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

Infotype
loop

Employee
loop

END-OF-SELECTION.

17

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Period-Based
DataData
(1) - 1
LDB Period
Based

JANUARY - APRIL

MAY - AUGUST

Ms Y

SEPTEMBER - DECEMBER

18

SAP AG 1999

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Period-Based Data (2)

LDB Period Based Data - 2

Data
Selection

Org.
Assignment

Org.
Assignment

19

HR
SAP AG ABAP
1999

January

December

January

December

January

December

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Criteria Criteria
LDBScreening
Screening

Data selection
Person selection
INFOTYPES: ...
GET PERNR.

PAnnnn

PROVIDE...
WRITE...

20

SAP AG 1999

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

21

1000
1000
1100

Sam Hawkins
David Lindsay
Karl May

SAP AG 1999

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Flow Control for Logical Database

LDB Flow Control of Logical Database


View of HR report attributes - flow control for logical database
Program

Batch

Online

ZPLIST00

ZPLIST10

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 and Projection

24

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Joins in PROVIDE

25

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Join
/ Subtypes
Join
/ Subtypes

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

"Organizational Assignment
"Personal Data
"Addresses

GET PERNR.
PROVIDE

* 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

Joins and Projection / Coding

27

HR ABAP

Jan-2007

2007 IBM Corporation

IBMTime-Dependent
Global Business Services Table Entries
Reading

Reading Time-Dependent Table Entries


P0001-BEGDA

BEGDA
T513S

ENDDA

SELECT * FROM T513S


WHERE SPRSL
=
AND
STELL
=
AND
ENDDA
GE
AND
BEGDA
LE
ENDSELECT.

28

HR ABAP

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

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

Table
Pnnnn

January

January

December

December

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

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

IBM Global Business Services

Reading Infotypes Without Logical DB (2)

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
I

Check conditions

W
V

Set default values when creating a new record

F
M

Call routine

Maintain infotype record


Reference to another step
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.
. . .

46

TYPES:

BEGIN OF data_struc,
pernr LIKE PERNR-PERNR,
ename LIKE P0001-ENAME,
. . .
dar
LIKE P0041-DAR01,
. . .
END OF data_struc.

DATA:

data_tab TYPE TABLE OF data_struc,


data_tab_wa TYPE data_struc.

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

HR ABAP

SAP AG 1999

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

58

SAP AG 1999

HR ABAP

Standard salary 5000 DM


Bonus
300 DM
Overtime
200 DM
Tot. gross amt 5500 DM

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Reading the Cluster Directory

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.

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.

61

SAP AG 1999

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

NAT

VERSC

RT

CRT

BT

Type PC202

Type HRPAY99_RT

Type HRPAY99_CRT

Dummy
for national
part

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 Type for Payroll Results (1)

Table Types for Payroll Results (1)


Aggregated data types:

Dictionary

Structures (field strings)

Payroll result

Tables

Table type: HRPAY99_TAB_OF_RESULTS


Line type: PAY99_RESULT
EVP

INTER Structure PAY99_INTERNATIONAL

Structure PC261

63

NAT

VERSC

RT

CRT

Type PC202

Type HRPAY99_RT

Type HRPAY99_CRT

BT

SAP AG 1999

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

Global Business Services


TimeIBM
Data

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

72

SAP 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

15 days

Leave

PROVIDE...
WRITE...
ENDPROVIDE.

73

SAP AG 1999

HR ABAP

15 days

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Importing
Time
DataData
(1) (1)
Importing
Time

Data selection period

INFOTYPES: 2001, "Absences


2002, "Attendances
2005, "Overtime
2010. "Employee
Remuneration Info

PAnnnn

GET PERNR.

74

HR ABAP

Jan-2007

2007 IBM Corporation

IBM Global Business Services

Importing Time Data (2)

Importing Time Data (2)


INFOTYPES:

0001,
0002,
...
2005 MODE N.

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

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

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

Processing Time Data with Internal Tables


END-OF-SELECTION.
LOOP AT tab.
AT FIRST.
...
ENDAT.

Header processing

AT NEW bukrs.
...
ENDAT.
tab -

BUKRS WERKS

BTRTL

0001

0001

0001

0001

0001

0002

0002

0002

0003

0002

0002

0004

AT NEW werks.
...
ENDAT.

Single record
processing
AT END OF werks.
...
ENDAT.
AT END OF bukrs.
...
ENDAT.

Footer processing

77

AT LAST.
...
ENDAT.
ENDLOOP.

SAP AG 1999

HR ABAP

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

Persons

Objects from Personnel


Planning

Applicants

Infotypes
that can be
included in
the InfoSet

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

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

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:

95

Name of include

The include contains

MPnnnn10

The PROGRAM statement and


the declaration of common data objects

MPnnnn20

PBO modules for the screens

MPnnnn30

PAI modules for the screens

MPnnnn40

subroutines

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

Task

T582A

Basic infotype characteristics


(database tables, single screen, list screen, time constraint, dialog
module, and so on)

103

T582S

Infotype short texts

T777A

Technical Characteristics of Infotype (database table, dialog module, and


so on)

T77ID

Name of data field structure (PSnnnn)

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

Você também pode gostar