Sunteți pe pagina 1din 140

IBM Global Business Services

2007 IBM Corporation HR ABAP Jan-2007


HR ABAP
Technical Overview


IBM Global Business Services
2007 IBM Corporation 2 Jan-2007 HR ABAP
List of Topics
Logical Databases
Join & Projection
Reports / Repetitive Structures
Clusters
Time Data
Infosets & Infoset Queries
Infotypes
Logical Database PCH
IBM Global Business Services
2007 IBM Corporation 3 Jan-2007 HR ABAP


Logical Databases
IBM Global Business Services
2007 IBM Corporation 4 Jan-2007 HR ABAP
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

IBM Global Business Services
2007 IBM Corporation 5 Jan-2007 HR ABAP
Functions of the Logical Database PNP
IBM Global Business Services
2007 IBM Corporation 6 Jan-2007 HR ABAP
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.

IBM Global Business Services
2007 IBM Corporation 7 Jan-2007 HR ABAP
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.


IBM Global Business Services
2007 IBM Corporation 8 Jan-2007 HR ABAP
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

IBM Global Business Services
2007 IBM Corporation 9 Jan-2007 HR ABAP
Linking a Logical Database to an Executable Program

IBM Global Business Services
2007 IBM Corporation 10 Jan-2007 HR ABAP
Logical Structures and DB Tables in PA
SAP AG 1999
Logical Structures and Database Tables in PA
Logical structures
Pnnnn
KEY fields
Data fields
PSnnnn
Database tables
PAnnnn PAnnnn PBnnnn PBnnnn
Screen
fields
Qnnnn
Selection
fields PNP
PERNR
PCLn PCLn
IBM Global Business Services
2007 IBM Corporation 11 Jan-2007 HR ABAP
LDB : Infotype Data Structure
SAP AG 1999
Infotype - Data Structures
PA0002 PA0002
DB structure PAnnnn using infotype 0002 as an example
Infotype structure Pnnnn using infotype 0002 as an example
MANDT PAKEY PSHD1 PS0002
PSKEY PSHD1 PS0002
IBM Global Business Services
2007 IBM Corporation 12 Jan-2007 HR ABAP
LDB - Screening
IBM Global Business Services
2007 IBM Corporation 13 Jan-2007 HR ABAP
LDB Data Retrieval



1. Create data structures for infotypes
2. Fill the data structures with the infotype records
" Organizational Assignment "
"Personal Data "
" Planned Working Time"
INFOTYPES: 0001,
0002,
0007.
GET PERNR.
IBM Global Business Services
2007 IBM Corporation 14 Jan-2007 HR ABAP
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.



IBM Global Business Services
2007 IBM Corporation 15 Jan-2007 HR ABAP
Processing Infotypes in Logical Database
IBM Global Business Services
2007 IBM Corporation 16 Jan-2007 HR ABAP
LDB Processing Master Data Using Provide
SAP AG 1999
Processing Master Data
TABLES: PERNR.
INFOTYPES: 0001, "Actions
0002, "Personal Data
0006, "Addresses
....
GET PERNR.
PROVIDE * FROM P0002 BETWEEN PN-BEGDA AND PN-ENDDA.
WRITE...
ENDPROVIDE.
IBM Global Business Services
2007 IBM Corporation 17 Jan-2007 HR ABAP
LDB - Loop Nesting
SAP AG 1999
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.
END-OF-SELECTION.
Infotype
loop
Infotype
loop
Employee
loop
IBM Global Business Services
2007 IBM Corporation 18 Jan-2007 HR ABAP
LDB Period Based Data - 1
SAP AG 1999
JANUARY - APRIL
MAY - AUGUST
SEPTEMBER - DECEMBER
Ms Y Ms Y
Period-Based Data (1)
IBM Global Business Services
2007 IBM Corporation 19 Jan-2007 HR ABAP
LDB Period Based Data - 2
SAP AG 1999
Org.
Assignment
Data
Selection
January December
January December
Org.
Assignment
January December
Period-Based Data (2)
IBM Global Business Services
2007 IBM Corporation 20 Jan-2007 HR ABAP
LDB Screening Criteria
SAP AG 1999
Screening Criteria
Data selection
Person selection
PAnnnn PAnnnn
INFOTYPES: ...
GET PERNR.
PROVIDE...
WRITE...
IBM Global Business Services
2007 IBM Corporation 21 Jan-2007 HR ABAP
LDB Sort Order
SAP AG 1999
Sort Order
...
GET PERNR.
...
1909
1910
1899
Pers.area PerNo. Name
1000
1000
1100
Sam Hawkins
David Lindsay
Karl May
IBM Global Business Services
2007 IBM Corporation 22 Jan-2007 HR ABAP
LDB Flow Control of Logical Database
SAP AG 1999
Flow Control for Logical Database
View of HR report attributes - flow control for logical database
Program Batch Online
ZPLIST00
ZPLIST10
1
2
1
2
1
2
3
Forward select options
Array fetch is active
Array fetch active and forward select options
IBM Global Business Services
2007 IBM Corporation 23 Jan-2007 HR ABAP
Join and Projection
IBM Global Business Services
2007 IBM Corporation 24 Jan-2007 HR ABAP
Joins and Projection


Join
Organizational
Assignment (0001)
Personal
Data (0002)
Join / Creating Intervals
IBM Global Business Services
2007 IBM Corporation 25 Jan-2007 HR ABAP
Joins in PROVIDE


Join / 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.
IBM Global Business Services
2007 IBM Corporation 26 Jan-2007 HR ABAP
Join / Subtypes
SAP AG 1999
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.
IBM Global Business Services
2007 IBM Corporation 27 Jan-2007 HR ABAP
Joins and Projection / Coding


Join 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.
IBM Global Business Services
2007 IBM Corporation 28 Jan-2007 HR ABAP
Reading Time-Dependent Table Entries
SAP AG 1999
Reading Time-Dependent Table Entries
BEGDA
P0001-BEGDA
T513S
ENDDA
SELECT * FROM T513S
WHERE SPRSL = SY-LANGU
AND STELL = P0001-STELL
AND ENDDA GE P0001-BEGDA
AND BEGDA LE P0001-BEGDA.
ENDSELECT.
IBM Global Business Services
2007 IBM Corporation 29 Jan-2007 HR ABAP
HR Macros
RP_PROVIDE_FROM_LAST

RP_PROVIDE_FROM_FIRST

RP_SET_DATA_INTERVAL

RP_READ_INFOTYPE

RP-READ-ALL-TIME-ITY




IBM Global Business Services
2007 IBM Corporation 30 Jan-2007 HR ABAP
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.


IBM Global Business Services
2007 IBM Corporation 31 Jan-2007 HR ABAP
Macro Modules
SAP AG 1999
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.
IBM Global Business Services
2007 IBM Corporation 32 Jan-2007 HR ABAP
Processing a Specific Infotype Record
SAP AG 1999
Processing a Specific Infotype Record
Data selection January December
Table
Pnnnn
January December
GET PERNR.
RP_PROVIDE_FROM_LAST <Pnnnn> SPACE PN-BEGDA PN-ENDDA.
IF PNP-SW-FOUND = 1.
WRITE...
ENDIF.
IBM Global Business Services
2007 IBM Corporation 33 Jan-2007 HR ABAP
Reading Infotype without using LDB (1)
SAP AG 1999
Reading Infotypes Without Logical DB (1)
PAnnnn PAnnnn
INFOTYPES: <nnnn>.
...
CALL FUNCTION
'HR_READ_INFOTYPE'...
IBM Global Business Services
2007 IBM Corporation 34 Jan-2007 HR ABAP
Reading Infotype Without Using LDB (2)
SAP AG 1999
Reading Infotypes Without Logical DB (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.
IBM Global Business Services
2007 IBM Corporation 35 Jan-2007 HR ABAP
Updating Infotype Record
SAP AG 1999
Updating Infotype Records
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.
IBM Global Business Services
2007 IBM Corporation 36 Jan-2007 HR ABAP
Reading Planning Infotypes with Function Module
IBM Global Business Services
2007 IBM Corporation 37 Jan-2007 HR ABAP
Determining The Entry Date
IBM Global Business Services
2007 IBM Corporation 38 Jan-2007 HR ABAP
Dynamic Actions
IBM Global Business Services
2007 IBM Corporation 39 Jan-2007 HR ABAP
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
IBM Global Business Services
2007 IBM Corporation 40 Jan-2007 HR ABAP
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
IBM Global Business Services
2007 IBM Corporation 41 Jan-2007 HR ABAP
Calling Reports Using Dynamic Actions
IBM Global Business Services
2007 IBM Corporation 42 Jan-2007 HR ABAP
Reports / Repetitive Structures
IBM Global Business Services
2007 IBM Corporation 43 Jan-2007 HR ABAP
Infotype with repetitive Structure
IBM Global Business Services
2007 IBM Corporation 44 Jan-2007 HR ABAP
Repetitive Structure / Evaluation (1)
IBM Global Business Services
2007 IBM Corporation 45 Jan-2007 HR ABAP
Repetitive Structure / Evaluation (2)
IBM Global Business Services
2007 IBM Corporation 46 Jan-2007 HR ABAP
ALV Data Structures
SAP AG 1999
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.
IBM Global Business Services
2007 IBM Corporation 47 Jan-2007 HR ABAP
ALV Field Catalog
IBM Global Business Services
2007 IBM Corporation 48 Jan-2007 HR ABAP
AVL Interface
IBM Global Business Services
2007 IBM Corporation 49 Jan-2007 HR ABAP
Clusters
IBM Global Business Services
2007 IBM Corporation 50 Jan-2007 HR ABAP
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.

IBM Global Business Services
2007 IBM Corporation 51 Jan-2007 HR ABAP
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

IBM Global Business Services
2007 IBM Corporation 52 Jan-2007 HR ABAP
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

IBM Global Business Services
2007 IBM Corporation 53 Jan-2007 HR ABAP
Importing Data
IBM Global Business Services
2007 IBM Corporation 54 Jan-2007 HR ABAP
Importing / Exporting with Macros
IBM Global Business Services
2007 IBM Corporation 55 Jan-2007 HR ABAP
Importing/Exporting using a Buffer
SAP AG 1999
Importing/Exporting Using a Buffer
Import
Export
Program
UPDATE
PCLn PCLn
Buffer
IBM Global Business Services
2007 IBM Corporation 56 Jan-2007 HR ABAP
Importing Using a Buffer
IBM Global Business Services
2007 IBM Corporation 57 Jan-2007 HR ABAP
Data flow in Payroll
IBM Global Business Services
2007 IBM Corporation 58 Jan-2007 HR ABAP
Payroll Results
SAP AG 1999
Payroll Results
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
. . . .
REPORT RPCLSTxy.
IBM Global Business Services
2007 IBM Corporation 59 Jan-2007 HR ABAP
Reading the Cluster Directory
SAP AG 1999
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.
IBM Global Business Services
2007 IBM Corporation 60 Jan-2007 HR ABAP
Determining Current Payroll Result (1)
SAP AG 1999
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.
IBM Global Business Services
2007 IBM Corporation 61 Jan-2007 HR ABAP
Determining Current Payroll Result (2)
SAP AG 1999
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.
IBM Global Business Services
2007 IBM Corporation 62 Jan-2007 HR ABAP
Clusters Data Structure for Payroll Result




Structure for Payroll Results
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.
Structure :

PAY99_RESULT
EVP
Structure PC261
INTER

Structure PAY99_INTERNATIONAL NAT
Dummy
for national
part
VERSC
Type PC202
RT
Type HRPAY99_RT
BT CRT
Type HRPAY99_CRT
IBM Global Business Services
2007 IBM Corporation 63 Jan-2007 HR ABAP
Table Types for Payroll Results (1)
SAP AG 1999
Table Type for Payroll Results (1)
Payroll result
Dictionary
Table type: HRPAY99_TAB_OF_RESULTS
Aggregated data types:
Structures (field strings)
Tables
Line type: PAY99_RESULT
EVP
Structure PC261
INTER Structure PAY99_INTERNATIONAL NAT
VERSC
Type PC202
RT
Type HRPAY99_RT
BT CRT
Type HRPAY99_CRT
IBM Global Business Services
2007 IBM Corporation 64 Jan-2007 HR ABAP
Table Types for Payroll Results (2)
SAP AG 1999
Table Type 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.
IBM Global Business Services
2007 IBM Corporation 65 Jan-2007 HR ABAP
Table Types for Payroll Results (1)
SAP AG 1999
Table Type for Payroll Results (3)
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.
IBM Global Business Services
2007 IBM Corporation 66 Jan-2007 HR ABAP
Clusters - Display of Payroll Result(PC00_M40_CLSTR)
IBM Global Business Services
2007 IBM Corporation 67 Jan-2007 HR ABAP
Clusters - Display of Cluster data Payroll Result
IBM Global Business Services
2007 IBM Corporation 68 Jan-2007 HR ABAP
Clusters - Display of Cluster data Payroll Result
IBM Global Business Services
2007 IBM Corporation 69 Jan-2007 HR ABAP
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


IBM Global Business Services
2007 IBM Corporation 70 Jan-2007 HR ABAP
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

IBM Global Business Services
2007 IBM Corporation 71 Jan-2007 HR ABAP
Time Data
IBM Global Business Services
2007 IBM Corporation 72 Jan-2007 HR ABAP
Time Data
SAP AG 1999
Time Data
Dependency of Time Data on Validity Period
Importing Time Data
Processing Time Data Using Internal Tables
Contents:
IBM Global Business Services
2007 IBM Corporation 73 Jan-2007 HR ABAP
Time data and Validity Period
SAP AG 1999
Time Data and Validity Period
Leave
Data selection
period
15 days
PROVIDE...
WRITE...
ENDPROVIDE.
15 days
IBM Global Business Services
2007 IBM Corporation 74 Jan-2007 HR ABAP
Importing Time Data (1)
SAP AG 1999
Importing Time Data (1)
PAnnnn PAnnnn
Data selection period
INFOTYPES: 2001, "Absences
2002, "Attendances
2005, "Overtime
2010. "Employee
Remuneration Info

GET PERNR.
IBM Global Business Services
2007 IBM Corporation 75 Jan-2007 HR ABAP
Importing Time Data (2)
SAP AG 1999
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.
IBM Global Business Services
2007 IBM Corporation 76 Jan-2007 HR ABAP
Importing Time Data to Internal Tables
SAP AG 1999
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
IBM Global Business Services
2007 IBM Corporation 77 Jan-2007 HR ABAP
Processing Time Data with Internal Tables
SAP AG 1999
Processing Time Data with Internal Tables
WERKS BUKRS tab - BTRTL
0001
0001
0002
0002
0001
0001
0002
0002
0001
0002
0003
0004
Footer processing
Header processing
END-OF-SELECTION.
LOOP AT tab.
AT FIRST.
...
ENDAT.
AT NEW bukrs.
...
ENDAT.
AT NEW werks.
...
ENDAT.
Single record
processing
AT END OF werks.
...
ENDAT.
AT END OF bukrs.
...
ENDAT.
AT LAST.
...
ENDAT.
ENDLOOP.
IBM Global Business Services
2007 IBM Corporation 78 Jan-2007 HR ABAP
Infosets and Infoset Query
IBM Global Business Services
2007 IBM Corporation 79 Jan-2007 HR ABAP
Infosets and User Groups
IBM Global Business Services
2007 IBM Corporation 80 Jan-2007 HR ABAP
Assign Infosets to User Groups ( Transaction SQ03 )
IBM Global Business Services
2007 IBM Corporation 81 Jan-2007 HR ABAP
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 (0000-
0999)
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 (4000-
4999)
Some infotypes for
Personnel
Administration (such as
0001 and 0002)

Customer infotypes
IBM Global Business Services
2007 IBM Corporation 82 Jan-2007 HR ABAP
Procedure for Creating and Changing Infosets (SQ02)
IBM Global Business Services
2007 IBM Corporation 83 Jan-2007 HR ABAP
Initial Maintenance Screen for Reporting on Person/Applicants
IBM Global Business Services
2007 IBM Corporation 84 Jan-2007 HR ABAP
Ad Hoc Query
IBM Global Business Services
2007 IBM Corporation 85 Jan-2007 HR ABAP
Creating Queries II
IBM Global Business Services
2007 IBM Corporation 86 Jan-2007 HR ABAP
Ad Hoc Query: Overview
IBM Global Business Services
2007 IBM Corporation 87 Jan-2007 HR ABAP
Restricting Reporting Set
IBM Global Business Services
2007 IBM Corporation 88 Jan-2007 HR ABAP
Creating Queries
IBM Global Business Services
2007 IBM Corporation 89 Jan-2007 HR ABAP
Infotypes
IBM Global Business Services
2007 IBM Corporation 90 Jan-2007 HR ABAP
Infotype Data Structure
Four digit number
nnnn

Unique
identification

9000 to 9999
reserved for
customer infotypes
IBM Global Business Services
2007 IBM Corporation 91 Jan-2007 HR ABAP
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

IBM Global Business Services
2007 IBM Corporation 92 Jan-2007 HR ABAP
Personnel Administration Transparent Tables
Key
Fields
Administration
Fields
Custom Fields
IBM Global Business Services
2007 IBM Corporation 93 Jan-2007 HR ABAP
Database Table For Applicant Infotypes
IBM Global Business Services
2007 IBM Corporation 94 Jan-2007 HR ABAP
Components of an Infotype
IBM Global Business Services
2007 IBM Corporation 95 Jan-2007 HR ABAP
subroutines
MPnnnn40
PAI modules for the screens
MPnnnn30
PBO modules for the screens
MPnnnn20
The PROGRAM statement and
the declaration of common data objects
MPnnnn10
The include contains Name of include
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:

IBM Global Business Services
2007 IBM Corporation 96 Jan-2007 HR ABAP
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

Infotype Screens
IBM Global Business Services
2007 IBM Corporation 97 Jan-2007 HR ABAP
Initial Screens
Initial screen is used as technical interface

Screen 1000 is used for all infotypes

Processed in background.

Performs general initialization procedures

IBM Global Business Services
2007 IBM Corporation 98 Jan-2007 HR ABAP
Initial Screen - Preview
IBM Global Business Services
2007 IBM Corporation 99 Jan-2007 HR ABAP
Single Screen - Preview
IBM Global Business Services
2007 IBM Corporation 100 Jan-2007 HR ABAP
List Screen - Preview
IBM Global Business Services
2007 IBM Corporation 101 Jan-2007 HR ABAP
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

IBM Global Business Services
2007 IBM Corporation 102 Jan-2007 HR ABAP
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.

IBM Global Business Services
2007 IBM Corporation 103 Jan-2007 HR ABAP
The following tables must be mai ntained for each infotype:
Name of table Task
T582A Basic infotype characteristics
(database tables, single screen, list screen, time constrai nt, dialog
modul e, and so on)
T582S Infotype short texts
T777A
Technical Characteristics of Infotype (database tabl e, dialog module, and
so on)
T77ID Name of data fi eld structure (PSnnnn)
Infotype Characteristics
IBM Global Business Services
2007 IBM Corporation 104 Jan-2007 HR ABAP
Creating Personnel Administration Infotypes Step 1
IBM Global Business Services
2007 IBM Corporation 105 Jan-2007 HR ABAP
Creating Personnel Administration Infotypes Step 2
IBM Global Business Services
2007 IBM Corporation 106 Jan-2007 HR ABAP
Creating Personnel Administration Infotypes Step 3
IBM Global Business Services
2007 IBM Corporation 107 Jan-2007 HR ABAP
Created Objects
IBM Global Business Services
2007 IBM Corporation 108 Jan-2007 HR ABAP
Enhancing Personnel Administration Infotypes Overview
IBM Global Business Services
2007 IBM Corporation 109 Jan-2007 HR ABAP
Enhancing Personnel Administration Infotypes Procedure
IBM Global Business Services
2007 IBM Corporation 110 Jan-2007 HR ABAP
Enhancing Infotypes Created Objects
IBM Global Business Services
2007 IBM Corporation 111 Jan-2007 HR ABAP
Creating HRP info types
Transaction code : PPCI.
(Personnel Planning Infotype Copier)

IBM Global Business Services
2007 IBM Corporation 112 Jan-2007 HR ABAP
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

IBM Global Business Services
2007 IBM Corporation 113 Jan-2007 HR ABAP
Creating HRP info types
IBM Global Business Services
2007 IBM Corporation 114 Jan-2007 HR ABAP
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

IBM Global Business Services
2007 IBM Corporation 115 Jan-2007 HR ABAP
Creating HRP info types
IBM Global Business Services
2007 IBM Corporation 116 Jan-2007 HR ABAP
Creating HRP info types
IBM Global Business Services
2007 IBM Corporation 117 Jan-2007 HR ABAP
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

IBM Global Business Services
2007 IBM Corporation 118 Jan-2007 HR ABAP
Creating HRP info types
IBM Global Business Services
2007 IBM Corporation 119 Jan-2007 HR ABAP
Creating HRP info types
IBM Global Business Services
2007 IBM Corporation 120 Jan-2007 HR ABAP
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
IBM Global Business Services
2007 IBM Corporation 121 Jan-2007 HR ABAP
Creating HRP info types
IBM Global Business Services
2007 IBM Corporation 122 Jan-2007 HR ABAP
Creating HRP info types
After Creation of Infotype Maintain the Following Details using TCode: OOIT

Time Constraint

Infotype Per Object Type
IBM Global Business Services
2007 IBM Corporation 123 Jan-2007 HR ABAP
Logical Database PCH(PNP)
IBM Global Business Services
2007 IBM Corporation 124 Jan-2007 HR ABAP
Data Model
IBM Global Business Services
2007 IBM Corporation 125 Jan-2007 HR ABAP
Relationship Between Basic Object Type
IBM Global Business Services
2007 IBM Corporation 126 Jan-2007 HR ABAP
Table Infotype
IBM Global Business Services
2007 IBM Corporation 127 Jan-2007 HR ABAP
Sequential Evaluation
IBM Global Business Services
2007 IBM Corporation 128 Jan-2007 HR ABAP
Structural Evaluation
IBM Global Business Services
2007 IBM Corporation 129 Jan-2007 HR ABAP
Evaluation Path
IBM Global Business Services
2007 IBM Corporation 130 Jan-2007 HR ABAP
Maintaining Evaluation Path
IBM Global Business Services
2007 IBM Corporation 131 Jan-2007 HR ABAP
Sequential Evaluation Coding
IBM Global Business Services
2007 IBM Corporation 132 Jan-2007 HR ABAP
Structural Evaluations Coding
IBM Global Business Services
2007 IBM Corporation 133 Jan-2007 HR ABAP
Structure Parameters
IBM Global Business Services
2007 IBM Corporation 134 Jan-2007 HR ABAP
Setting Structure Condition
IBM Global Business Services
2007 IBM Corporation 135 Jan-2007 HR ABAP
Filling Fields in the Selection Screen
IBM Global Business Services
2007 IBM Corporation 136 Jan-2007 HR ABAP
Evaluating Additional Data on Relationship
IBM Global Business Services
2007 IBM Corporation 137 Jan-2007 HR ABAP
Evaluating Table Infotype
IBM Global Business Services
2007 IBM Corporation 138 Jan-2007 HR ABAP
Evaluating the Infotype Index
IBM Global Business Services
2007 IBM Corporation 139 Jan-2007 HR ABAP




Questions ?
IBM Global Business Services
2007 IBM Corporation 140 Jan-2007 HR ABAP

Thank You

S-ar putea să vă placă și