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

2 HR ABAP Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Logical Databases

3 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

4 HR ABAP Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Functions of the Logical Database PNP

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

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

7 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

8 HR ABAP Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Linking a Logical Database to an Executable Program

9 HR ABAP Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

Logical
Logical Structures andDatabase
Structures and DB Tables in PA
Tables in PA

Logical structures Database tables


Pnnnn Screen
fields PAnnnn PBnnnn
KEY fields
Qnnnn

Data fields
Selection PCLn
PSnnnn fields PNP

PERNR

10 HR ABAP Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

LDB : Infotype
Infotype - Data Data Structure
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, "Actions
0002, "Personal Data
0006, "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. Infotype
WRITE... loop
ENDPROVIDE.
Employee
PROVIDE * FROM P0006 loop
BETWEEN PN-BEGDA AND PN-ENDDA. Infotype
WRITE... loop
ENDPROVIDE.

END-OF-SELECTION.

17 HR ABAP Jan-2007 © 2007 IBM Corporation


IBM Global Business Services

LDB – Period
Period-Based
BasedDataData
(1) -1

JANUARY - APRIL

MAY - AUGUST

Ms Y

SEPTEMBER - DECEMBER

 SAP AG 1999
18 HR ABAP Jan-2007 © 2007 IBM Corporation
IBM Global Business Services

Period-Based Data (2)


LDB – Period Based Data - 2

January December
Data
Selection

January December
Org.
Assignment

January December
Org.
Assignment

19 HR ABAP Jan-2007 © 2007 IBM Corporation


 SAP AG 1999
IBM Global Business Services

– Screening
LDBScreening Criteria Criteria

Data selection

Person selection

INFOTYPES: ...

GET PERNR.
PAnnnn
PROVIDE...

WRITE...

 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 1000 Sam Hawkins
1910 1000 David Lindsay
1899 1100 Karl May

 SAP AG 1999

21 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 1 1
ZPLIST10 2 2

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 inJoin
PROVIDE
/ Coding

TABLES: PERNR.
INFOTYPES:0001, "Organizational Assignment
0002, "Personal Data
0006, "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, "Organizational Assignment
0002, "Personal Data
0006, "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
HR1999
ABAP Jan-2007 © 2007 IBM Corporation
IBM Global Business Services

Join and Projection / Coding


Joins and Projection / Coding

TABLES: PERNR.
INFOTYPES:0001, "Organizational Assignment
0002, "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


Reading
IBMTime-Dependent
Global Business Services Table Entries

Reading Time-Dependent Table Entries

P0001-BEGDA

BEGDA   ENDDA
T513S

SELECT * FROM T513S


WHERE SPRSL = SY-LANGU
AND STELL = P0001-STELL
AND ENDDA GE P0001-BEGDA
AND BEGDA LE P0001-BEGDA.
ENDSELECT.

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, "Organizational Assignment
0002, "Personal Data
0006, "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
HR1999
ABAP Jan-2007 © 2007 IBM Corporation
IBM Global Business Services

Processing a Specific Infotype Record


Processing a Specific Infotype Record

Data selection January December

January December
Table
Pnnnn

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
Reading Infotypes withoutLogical
using DB
LDB
(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 = return
TABLES
INFTY_TAB = P0002
EXCEPTIONS
INFTY_NOT_FOUND = 1
OTHERS = 2.

34 HR ABAP 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 Maintain infotype record
W Set default values when creating a new record
V Reference to another step
F Call routine
M 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: data_tab TYPE TABLE OF data_struc,


data_tab_wa TYPE data_struc.

 SAP AG 1999
46 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 Jan-2007 © 2007 IBM Corporation


 SAP 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 Werner January 19xx
WT01 Standard salary 5000 DM
WT02 Bonus 300 DM
WT03 Overtime 200 DM
/101 Tot. gross amt 5500 DM
....

 SAP AG 1999
58 HR ABAP 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.

 SAP AG 1999
60 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 INTER Structure PAY99_INTERNATIONAL NAT
Structure PC261 Dummy
VERSC RT CRT BT for national
Type PC202 Type HRPAY99_RT Type HRPAY99_CRT 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

Payroll result
 Structures (field strings)
 Tables

Table type: HRPAY99_TAB_OF_RESULTS

Line type: PAY99_RESULT


EVP INTER Structure PAY99_INTERNATIONAL NAT
Structure PC261
VERSC RT CRT BT
Type PC202 Type HRPAY99_RT 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


TimeIBM Global Business Services
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

15 days
Leave

PROVIDE...
WRITE...
ENDPROVIDE.
15 days

73  SAP AGHR
1999
ABAP Jan-2007 © 2007 IBM Corporation
IBM Global Business Services

Importing Time
Importing DataData
Time (1) (1)

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  SAP AGHR ABAP


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 AGHR
1999
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.
Header processing AT FIRST.
...
ENDAT.
AT NEW bukrs.
...
ENDAT.
tab - BUKRS WERKS BTRTL AT NEW werks.
...
0001 0001 0001 ENDAT.
0001 0001 0002 Single record
processing
0002 0002 0003
AT END OF werks.
0002 0002 0004 ...
ENDAT.
AT END OF bukrs.
...
ENDAT.
AT LAST.
...
Footer processing ENDAT.
ENDLOOP.
 SAP AG 1999
77 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 PNP PCH PAP
database
Selection of Persons Objects from Personnel Applicants
Planning
Infotypes Infotypes for If the object type is
that can be  Personnel specified:  Infotypes for
included in Administration (0000-  Infotypes for the object Recruitment (4000-
the InfoSet 0999) type 4999)
 Time Management  Infotypes for objects  Some infotypes for
(2000-2999) that can be related to Personnel
 Payroll infotypes the specified object type Administration (such as
 Infotypes for Personnel If the object type is not 0001 and 0002)
Planning objects that specified:
can be related to  All infotypes
persons

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

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.

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

T The time constraint varies depending on the subtype.

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

T582S Infotype short texts

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


so on)

T77ID Name of data field structure (PSnnnn)

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 HRI9nnn ( Where 9nnn is
info type no).

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