116
Overview of ABAP HR Programming 1. Overview & Features in HR Programming and Difference from conventional ABAP 2. Concepts of Infotypes (Structure/Processing etc.) 3. Concepts of Clusters (Import/Export etc.), cluster directory 4. Concepts of Macros (Import/Export etc.) 5. Retrieval of data using LDBs (PNP/PAP/APP/PCH) 6. Overview of PA/PD/& Integration between PA & PD Overview & Features in HR Programming and Difference from conventional ABAP The aim in the Human Resources component is to be able to process employee related data according to business requirements in an effective structure. The Human Resources module uses a system of data grouped together called infotypes. Infotypes mirror a quantity of connected data records; infotypes are identifiable through a four character numerical string [e.g. infotype Addresses (0006)] and a complete listing is included. You can save the infotypes as time-dependent to enable a retroactive evaluation of Employee data. The infotypes appear as an entry screen for the user, through which you can maintain infotype records. Infotypes can be processed individually or in fast entry mode. Difference from conventional ABAP Advanced Business Application Programming ABAP is SAP's fourth generation language. All of R/3's applications and even parts of its basic system are developed in ABAP. ABAP is used for customization and modification of SAP applications. In HR ABAP use of select statements significantly less than in other areas of ABAP development, Logical databases have limited applications in other modules but are very useful in HR. Also, you really need to understand the infotype time constraint concept, When you cannot get the information that you need out of the logical DB look at the function modules starting with HR* and RH*. These function modules will provide you with multiple ways of accessing data to save time. Worst-case scenario, use a select statement. Concepts of Infotypes (Structure/Processing etc.) Infotypes: An infotype represents a group of related data fields, provides information structure, facilitates data entry, and allows time dependent storage. In other words we can say infotypes are information units used to enter the time dependent data of the employee. Master data in HR is stored in infotypes. Each infotype pertains to a specific type of data. Each infotype has a database table associated with it. Time constraints: Enable you to determine how the validity periods of infotype data records interact Time constraint 1: Exactly one valid data record of the infotype in question must exist for the entire time that the employee belongs to the enterprise. Time constraint 2: No more than one valid data record of the infotype in question can exist at any one time.

92825062 Overview ABAP HR

Embed Size (px)

DESCRIPTION

hr abap hr abap

Citation preview

Page 1: 92825062 Overview ABAP HR

Overview of ABAP HR Programming

1. Overview & Features in HR Programming and Difference from conventional ABAP 2. Concepts of Infotypes (Structure/Processing etc.) 3. Concepts of Clusters (Import/Export etc.), cluster directory 4. Concepts of Macros (Import/Export etc.) 5. Retrieval of data using LDBs (PNP/PAP/APP/PCH) 6. Overview of PA/PD/& Integration between PA & PD

Overview & Features in HR Programming and Difference from conventional ABAP

The aim in the Human Resources component is to be able to process employee related data according to business requirements in an effective structure. The Human Resources module uses a system of data grouped together called infotypes. Infotypes mirror a quantity of connected data records; infotypes are identifiable through a four character numerical string [e.g. infotype Addresses (0006)] and a complete listing is included. You can save the infotypes as time-dependent to enable a retroactive evaluation of Employee data. The infotypes appear as an entry screen for the user, through which you can maintain infotype records. Infotypes can be processed individually or in fast entry mode. Difference from conventional ABAP

Advanced Business Application Programming ABAP is SAP's fourth generation language. All of R/3's applications and even parts of its basic system are developed in ABAP. ABAP is used for customization and modification of SAP applications. In HR ABAP use of select statements significantly less than in other areas of ABAP development, Logical databases have limited applications in other modules but are very useful in HR. Also, you really need to understand the infotype time constraint concept, When you cannot get the information that you need out of the logical DB look at the function modules starting with HR* and RH*. These function modules will provide you with multiple ways of accessing data to save time. Worst-case scenario, use a select statement.

Concepts of Infotypes (Structure/Processing etc.)

Infotypes:

An infotype represents a group of related data fields, provides information structure, facilitates data entry, and allows time dependent storage. In other words we can say infotypes are information units used to enter the time dependent data of the employee. Master data in HR is stored in infotypes. Each infotype pertains to a specific type of data. Each infotype has a database table associated with it. Time constraints: Enable you to determine how the validity periods of infotype data records interact

Time constraint 1: Exactly one valid data record of the infotype in question must exist for the entire time that the employee belongs to the enterprise.

Time constraint 2: No more than one valid data record of the infotype in question can exist at any one time.

Page 2: 92825062 Overview ABAP HR

Time constraint 3: Any number of valid data records of the infotype in question can exist at any one time.

The prerequisites for the existence of a personnel or applicant number are infotypes 0000 Actions, 0001 Organizational Assignment, 0002 Personal Data, and 0003 Payroll Status. Transparent tables for infotype

Each infotype has a transparent table. Each logical field for an infotype has a corresponding physical field on the database. One physical table is stored on the database for each transparent table. The names of the physical table and logical table definition in the Dictionary are compatible. The following naming convention applies to infotype tables; nnnn stands for the infotype number:

PAnnnn for transparent tables in Personnel Administration

PBnnnn for transparent tables in Recruitment

HRPnnnn for transparent tables in Personnel Planning

Example: For Infotype 0000, the corresponding database table associated with it is PA0000

Check and Control Tables for HR Infotypes

Table T777D Infotypes - Dialog/Database Assignment is the central check table (domain INFOTYP) for all HR infotypes (Administration and planning infotypes). It is used to store the names of all infotype-dependent repository objects (tables, structures, programs, and so on).

Table T77ID Infotypes: Enhancements to T777D is simply an enhancement of table T777D that exists for reasons of memory space.

Table T582A Infotypes - Customer-Specific Settings is used for customer settings in Administration infotypes.

Table T77CD Infotypes - Customer-Specific Settings is used for customer settings in planning infotypes.

The primary key of transparent table PAnnnn consists of the following key fields:

PERNR: the personnel number is the only unique key within a client for identifying an employee. It is used

to access the display and maintenance screens for an employee‟s master data and working time data (infotypes).

SUBTY: subtypes are subdivisions of infotypes. An infotype‟s subtypes can have different time constraints

and form their own histories.

OBJPS: the object identification is used to make a distinction between records with the same infotype,

subtype, lock indicator, start date, and end date. For example, the child number in infotype 0021 Family/Related Person.

SPRPS: the lock indicator for HR master data is used to lock and unlock data records, which enables the

“double verification principle” to be put into practice. In accordance with this principle, at least two users are involved in the process of writing an active data record to the database. One of the users creates a

Page 3: 92825062 Overview ABAP HR

locked infotype record, and the other user unlocks - that is, activates - the data record.

ENDDA: end date.

BEGDA: start date.

SEQNR: The Sequential Number is used to make a distinction between infotype records that have the

same key and time constraint '3' (any number of valid infotype data records at any one time). Unlike the object identification, it is assigned by the system automatically.

Structure:

The Data Dictionary contains a Pnnnn structure for each infotype nnnn. The infotype structure Pnnnn corresponds to the table PAnnnn. The Pnnnn structure of the infotype is used as the field structure for the infotype entry screen (Transaction code PA30). Basic form of an infotype:

Infotypes nnnn [name c] [occurs m] [mode n] [valid from comp1 to comp2]. nnnn can be 0000 to 9999. 0000 – 0999 are HR Master Data infotypes. 1000 – 1999 are HR Planning data infotypes. 2000 – 2999 are HR time data infotypes. 3000 – 8999 are not used 9000 – 9999 are used for the custom infotypes Effect of the above syntax is It creates an internal table as below... DATA BEGIN OF c OCCURS m. INCLUDE STRUCTURE Pnnnn. DATA END OF c VALID BETWEEN comp1 AND comp2

If name option is not given in the syntax then the internal table will be created with the name p<nnnn>

If occurs clause in not given then the size of an internal table would be 10 * size of the structure pnnnn. That is in the place of „m‟ it would be 10.

If valid clause is not given then the comp1 and comp2 values will be 01/01/1800 and 31/12/9999 respectively.

Mode n this clause can only be used with the LDB‟s PCH and PNP. This addition stops this infotype being automatically filled at the GET PERNR command.

The infotype records can be processed using the infotype structure when the report is run. Processing Infotypes

Processing Single Infotype Record We can process the Single records of an infotype using the following macros. 1.RP_PROVIDE_FROM_LAST Pnnnn SPACE PN-BEGDA PN-ENDDA. This macro is used to retrieve the most recent record in the PN-BEGDA and PN-ENDDA data selection period

available in the structure Pnnnn for infotype nnnn 2. RP_PROVIDE_FROM_FIRST Pnnnn SPACE PN-BEGDA PN-ENDDA

This macro retrieves the earliest record for the given selection period. If the infotype has subtypes, then replace SPACE with the subtype so, the data is retrieved based on that subtype. If the retrieval is successful then the return code PNP-SW-FOUND will be „1‟.

Processing All Infotype Records

Page 4: 92825062 Overview ABAP HR

Syntax: PROVIDE * FROM Pnnnn BETWEEN PN-BEGDA AND PN-ENDDA. ENDPROVIDE

nnnn stands for 4-digit infotype number. The relationship between the data and the selection period is established using the PN-BEGDA and PN- ENDDA variables. Infotype List

Concepts of Clusters (Import/Export etc.), cluster directory

Definition

Page 5: 92825062 Overview ABAP HR

Each database object, for example, PCL1 or PCL2, with the type Import/Export file consists of related areas. These areas are known as clusters, for example. RX, RD. Cluster objects are dependent on the super ordinate database object. Cluster objects RX, RD, B2 can be selected for the database PCL2. If the database object has the type master data then there will be no cluster object. Import/Export files They are 4 types of files.

PCL1: Basis for HR Work area data. Contains information from time data recording.

PCL2: Contains derived information like payroll results and generated payroll schemas.

PCL3: Contains Applicant Data

PCL4: Contains change documents for HR master data and recruitment.

Importing and Exporting of data is managed with the commands IMPORT and EXPORT These commands store objects such as fields, field strings, or internal tables on the database, or read these from the database. Data is read from and written to the database using a unique key. RMAC provides two macros for importing and exporting data RP-IMP-Cn-xx and RP-EXP-Cn-xx; only these macros should be used. Export Cluster data using standard include

The EXPORT command causes one or more 'xy' KEY data objects to be written to cluster xy.

The cluster definition is integrated with the INCLUDE statement.

REPORT ZHREXPRT. TABLES: PCLn. INCLUDE: RPCnxxy0. "Cluster definition * Fill cluster KEY xy-key-field = <value>. * Fill data object .... * Export record EXPORT TABLE1 TO DATABASE PCLn (xy) ID xy-KEY. IF SY-SUBRC EQ 0. WRITE: / 'Update successful'. ENDIF.

Export Cluster data using the macro

Export data using macro RP-EXP-Cn-xy.

When data records are exported using macro, they are not written to the database but to a main memory buffer.

To save data, use the PREPARE_UPDATE routine with the USING parameter 'V'.

REPORT ZHREXPRT. *Buffer definition INCLUDE RPPPXD00. INCLUDE RPPPXM00. "Buffer management DATA: BEGIN OF COMMON PART 'BUFFER'. INCLUDE RPPPXD10. DATA: END OF COMMON PART 'BUFFER'. ... RP-EXP-Cn-xy. IF SY-SUBRC EQ 0. PERFORM PREPARE_UPDATE USING ‘V’. ENDIF.

Page 6: 92825062 Overview ABAP HR

Importing Cluster Data using standard include

The IMPORT command causes data objects with the specified key values to be read from PCLn.

If the import is successful, SY-SUBRC is 0; if not, it is 4.

REPORT RPIMPORT. TABLES: PCLn. INCLUDE RPCnxxy0. "Cluster definition * Fill cluster Key * Import record IMPORT TABLE1 FROM DATABASE PCLn (xy) ID xy-KEY. IF SY-SUBRC EQ 0. * Display data object ENDIF. Importing Cluster data using Macro

Import data using macro RP-IMP-Cn-xy.

Check return code SY-SUBRC. If 0, it is successful. If 4, error.

Need include buffer management routines RPPPXM00

Example REPORT RPIMPORT. *Buffer definition INCLUDE RPPPXD00. DATA: BEGIN OF COMMON PART 'BUFFER'. INCLUDE RPPPXD10. DATA: END OF COMMON PART 'BUFFER'. *Import data to buffer RP-IMP-Cn-xy. .... *Buffer management routines INCLUDE RPPPXM00. Cluster Authorization

Simple EXPORT/IMPORT statement does not check for cluster authorization. Use EXPORT/IMPORT via buffer, the buffer management routines check for cluster authorization. How to read the Payroll Results

Payroll results are stored in cluster Rn of PCL2 as field string and internal tables.

n - Country identifier.

Standard reports read the results from cluster Rn. Report RPCLSTRn lists all payroll results;

Report RPCEDTn0 lists the results on a payroll form.

The cluster definition of payroll results is stored in two INLCUDE reports:

Page 7: 92825062 Overview ABAP HR

include: rpc2rx09. "Definition Cluster Ru (I)

include: rpc2ruu0.”Definition Cluster Ru (II)

This first INCLUDE defines the country-independent part; the second INCLUDE defines the country-specific part (US). The cluster key is stored in the field string RX-KEY.

All the field string and internal tables stored in PCL2 are defined in the ABAP/4 dictionary. This allows you to use the same structures in different definitions and nonetheless maintain data consistency.

The structures for cluster definition comply with the name convention PCnnn

Unfortunately 'nnn' can be any set of alphanumeric characters.

*Key definition DATA: BEGIN OF RX-KEY. INCLUDE STRUCTURE PC200. DATA: END OF RX-KEY. *Payroll directory DATA: BEGIN OF RGDIR OCCURS 100. INCLUDE STRUCTURE PC261. DATA: END OF RGDIR.

How to retrieve Payroll results

To read payroll results, you need two keys: pernr and seqno

You can get SEQNO by importing the cluster directory (CD) first.

Example REPORT ZHRIMPRT. TABLES: PERNR, PCL1, PCL2. INLCUDE: rpc2cd09. "Definition cluster CD PARAMETERS: PERSON LIKE PERNR-PERNR. ... RP-INIT-BUFFER. *Import cluster Directory CD-KEY-PERNR = PERNR-PERNR. RP-IMP-C2-CU. CHECK SY-SUBRC = 0. LOOP AT RGDIR. RX-KEY-PERNR = PERSON. UNPACK RGDIR-SEQNR TO RX-KEY-SEQNO. *Import data from PCL2 RP-IMP-C2-RU. ENDLOOP.

Reading records from the Payroll directory After importing the payroll directory, which record to read is up to the programmer

Each payroll result has a status.

'P' - previous result 'A' - current (actual) result 'O' - old result

Function module CD_EVALUATION_PERIODS will restore the payroll result status for a period when that

Page 8: 92825062 Overview ABAP HR

payroll is initially run. It also will select all the relevant periods to be evaluated.

Example Call function 'CD_EVALUATION_PERIODS' exporting bonus_date = ref_periods-bondt inper_modif = pn-permo inper = ref_periods-inper pay_type = ref_periods-payty pay_ident = ref_periods-payid tables rgdir = rgdir evpdir = evp iabkrs = pnpabkrs exceptions no_record_found = 1. Authorization Check Authorization for Persons

In the authorization check for persons, the system determines whether the user has the authorizations required for the organizational features of the employees selected with GET PERNR.

Recruits for which the user has no authorization are skipped and appear in a list at the end of the report.

Authorization object: 'HR: Master data'

Authorization for Data

In the authorization check for data, the system determines whether the user is authorized to read the infotypes specified in the report.

If the authorization for a particular infotype is missing, the evaluation is terminated and an error message is displayed.

Deactivating the Authorization Check

In certain reports, it may be useful to deactivate the authorization check in order to improve performance. (E.g. when running payroll)

You can store this information in the object 'HR: Reporting'.

Concepts of Macros (Import/Export etc.)

Macros: Introduction

Programs that process the cluster data (for example, RX) do not access the cluster independently. The data is accessed using a defined interface created with macros. Macro contains some part of source code, which it will be useful for number of applications. Macro is module, which is stored Naming Conventions of Macro:

Page 9: 92825062 Overview ABAP HR

RP-aaa-bb-cc

aaa is the type of Macro. It takes two values o IMP Import Macro o EXP Export Macro

bb is the Database table where the data is saved: o C1 Database object PCL1 o C2 Database object PCL2 o C3 Database object PCL3 o C4 Database object PCL4

Cc is the cluster, it may take o RX Cluster object RX o RD Cluster object RD o B2 Cluster object B2 and so on.

Defining and Calling the Macros Defining: There are two options for defining the Macros

Macros are defined using the ABAP Commands DEFINE…. END-OF-DEFINITION. A macro can be used within a report or within include. If a macro is used in a report, and the macro is defined in include with the DEFINE command, include must be integrated.

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. The coding is grouped under a specific name in the table key.

According to conventions, the first two letters of the name must stand for the application. The rest of the name is freely definable. Difference between the two methods is:

If a macro is changed, each report using this macro is automatically regenerated when it is executed.

When you change a RMAC macro in the table TRMAC, the reports that use this macro are not regenerated automatically. You must regenerate them manually.

Standard HR Macros

The macro RP-PROVIDE-FROM-FRST retrieves the first (start) data record, which is valid in the data selection period.

The macro RP-PROVIDE-FROM-LAST retrieves the last (latest) data record, which is valid in the data selection period.

The macro RP-READ-INFOTYPE retrieves the data record(s), which is valid in the data selection period.

How to check whether the macro operation is successful or not

For every macro, whether the operation was successful or not will be checked with PNP-SW-FOUND. If PNP-SW-FOUND = 1, then the operation is successful.

Page 10: 92825062 Overview ABAP HR

Where exactly the Macrocode is stored

The program code pertaining to this macro is stored in the control table RMAC Guidelines for how and when to use the Standard Macros

1. RP_PROVIDE_FROM_FRST

Use macro RP_PROVIDE_FROM_FRST in programs for the logical databases PNP and PAP where the first data record for a period (can be a subtype) is read from an infotype table. The infotype table has been filled earlier (for example, with GET PERNR or RP_READ_INFOTYPE). This macro is only helpful if the infotype has time constraint 1 or 2. Prerequisites

The validity begin date of the time period must be before or the same as the validity end date.

Validity start and end dates are correct (preferably of the type DATE).

The infotype table is sorted in ascending order. Otherwise, you would receive the first fitting table entry that might not necessarily correspond to the first time entry.

Features

The first entry for a specified period is placed in the table header entry from an internal infotype table. Parameters

RP_PROVIDE_FROM_FRST inftytab subty beg end IN:

1. Name of the internal table 2. Subtype required or SPACE if no subtype is being specified 3. Validity start date of the time interval 4. Validity end date of the time interval

OUT:

1. PNP-SW-FOUND: has the value 0 if there is no matching entry in the infotype table in the given time period. Otherwise it has the value 1.

2. The matching table header entry if PNP-SW-FOUND = 1 orthe initial table header entry if PNP-SW-FOUND = 0

Example (RP_PROVIDE_FROM_FRST inftytab subty beg end) RP_PROVIDE_FROM_FIRST P0021 '1' PN-BEGDA PN-ENDDA. IF PNP-SW-FOUND EQ '1'. ... ENDIF. or RP_PROVIDE_FROM_FRST P0001 SPACE PN-BEGDA PN-ENDDA. IF PNP-SW-FOUND EQ '0'. WRITE: / 'Error: Org. assignment is missing' REJECT. ENDIF.

Page 11: 92825062 Overview ABAP HR

2. RP_PROVIDE_FROM_LAST

You use macro RP_PROVIDE_FROM_LAST in programs for the logical databases PNP and PAP where the last data record for a period (can be a subtype) is read from an infotype table. The infotype table has been filled earlier (for example, with GET PERNR or RP_READ_INFOTYPE). This macro is only helpful if the infotype (or subtype) has time constraint 1 or 2. Prerequisites

The validity begin date of the time period must be before or the same as the validity end date.

Validity start and end dates are correct (preferably of the type DATE).

The infotype table is sorted in ascending order. Otherwise, you would receive the last fitting table entry that might not necessarily correspond to the last time entry.

Features

The macro RP_PROVIDE_FROM_LAST makes sure that the last entry for a specified period is placed in the table header entry of the report output list. Parameters

RP_PROVIDE_FROM_LAST inftytab subty beg end

IN:

1. Name of the internal table 2. Subtype required or SPACE if no subtype is being specified 3. Validity begin date of the time interval 4. Validity end date of the time interval

OUT:

1. PNP-SW-FOUND: has the value 0 if there is no matching entry in the infotype table in the given time period. Otherwise it has the value 1.

2. The matching table header entry if PNP-SW-FOUND = 1 or the cleared table header entry if PNP-SW-FOUND = 0

Example: RP_PROVIDE_FROM_LAST P0021 '1' PN-BEGDA PN-ENDDA. IF PNP-SW-FOUND EQ '1'. ... ENDIF. OR RP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA. IF PNP-SW-FOUND EQ '0'. WRITE: / 'Error: Org. assignment is missing'. REJECT. ENDIF.

3. RP_READ_INFOTYPE

You can use the macro in all programs at any point. You can also use it in function modules. In database PNP, an

Page 12: 92825062 Overview ABAP HR

infotype is usually read with GET PERNR. Using macro P_READ_INFOTYPE is an exception. You can also use the function module HR_READ_INFOTYPE. For information on how to use the function module, see the documentation on Function Modules. Prerequisites

The validity begin date of the time period must be before or the same as the validity end date.

Validity begin and end are correct date specifications (preferably of the type DATE).

The infotype table must match the infotype number.

The program using the macro must contain the include DBPNPMAC.

Features

The macro RP_READ_INFOTYPE makes sure that all data records for a person for the specified period are placed in an internal infotype table. Parameters

RP_READ_INFOTYPE pernr infty inftytab beg end IN:

1. Personnel number of the person requested 2. Infotype number of the required infotype 3. Name of the internal infotype table 4. Validity start date of the time interval 5. Validity end date of the time interval

OUT:

1. PNP-SW-FOUND = 0, if there is no matching record in the dataset PNP-SW-FOUND = 1, if there is no matching record in the dataset

2. PNP-SW-AUTH-SKIPPED-RECORD = 0, if the HR authorization check has not retained any records due to incorrect authorizations.

PNP-SW-AUTH-SKIPPED-RECORD = 1 , if the HR authorization check has retained at least one record due to lack of authorization

3. Internal infotype table, containing all matching records for which the user is authorized (this table can also be empty).

Example

(RP_READ_INFOTYPE pernr infty inftytab beg end) INFOTYPES: 0001. RP-LOWDATE-HIGHDATE. DATA: PERNR LIKE P0001-PERNR. DATA: BEGDA LIKE P0001-BEGDA, ENDDA LIKE P0001-ENDDA. PERNR = '12345678'. BEGDA = LOW-DATE + 15 ENDDA = HIGH-DATE - 5. RP-READ-INFOTYPE PERNR 0001 P0001 BEGDA ENDDA. IF PNP-SW-AUT-SKIPPED-RECORD EQ '1'. WRITE: / 'Insufficient authorization'. STOP. ENDIF. IF PNP-SW-FOUND EQ '0'. WRITE: / 'Infotype 0001 missing'. STOP.

Page 13: 92825062 Overview ABAP HR

ENDIF.

Retrieval of data using LDBs (PNP/PAP/APP/PCH) without LDBs. Logical database

A logical database is a special ABAP/4 program which combines the contents of certain database tables. Using logical databases facilitates the process of reading database tables. HR Logical Database is PNP

Main Functions of the logical database PNP:

Standard Selection screen

Data Retrieval

Authorization check

To use logical database PNP in your program, specify in your program attributes. Standard Selection Screen

Date selection

Date selection delimits the time period for which data is evaluated. GET PERNR retrieves all records of the relevant infotypes from the database. When you enter a date selection period, the PROVIDE loop retrieves the infotype records whose validity period overlaps with at least one day of this period.

Person selection

Person selection is the 'true' selection of choosing a group of employees for whom the report is to run.

Sorting Data

The standard sort sequence lists personnel numbers in ascending order.

SORT function allows you to sort the report data otherwise. All the sorting fields are from infotype 0001.

Report Class

You can suppress input fields, which are not used on the selection screen by assigning a report class to your program.

If SAP standard delivered report classes do not satisfy your requirements, you can create your own report class through the IMG.

Data Retrieval from LDB

1. Create data structures for infotypes. INFOTYPES: 0001, "ORG ASSIGNMENT 0002, "PERSONAL DATA 0008. "BASIC PAY 2. Fill data structures with the infotype records. Start-of-selection.

Page 14: 92825062 Overview ABAP HR

GET PERNR. End-0f-selection.

Read Master Data

Infotype structures (after GET PERNR) are internal tables loaded with data.

The infotype records (selected within the period) are processed sequentially by the PROVIDE - ENDPROVIDE loop.

GET PERNR. PROVIDE * FROM Pnnnn BETWEEN PN/BEGDA AND PN/ENDDA If Pnnnn-XXXX = ' '. write:/ Pnnnn-XXXX. Endif. ENDPROVIDE.

Period-Related Data

All infotype records are time stamped. IT0006 (Address infotype) 01/01/1990 12/31/9999 present

Which record to be read depends on the date selection period specified on the selection screen.PN/BEGDA PN/ENDDA.

Current Data

IT0006 Address - 01/01/1990 12/31/9999 present

RP-PROVIDE-FROM-LAST retrieves the record, which is valid in the data selection period.

For example, pn/begda = '19990931' pn/endda = '99991231' IT0006 subtype 1 is resident address RP-PROVIDE-FROM-LAST P0006 1 PN/BEGDA PN/ENDDA.

Overview of PA/PD/& Integration between PA & PD

This explains how to use the ABAP programs, which set integration between PA and PD/OM. They are mainly used after data conversion, bulk updates or to correct errors caused by other programs. Each program is explained in detail so you can decide which ones you need to run. To set up/fix full integration between PA and PD, they should be run in this sequence: 1. RHINTE00 – Transfer PA records into PD positions –batch 2. RHINTE20 – Create OM objects in PA tables – Online 3. RHINTE30 – Bulk update of infotype 0001 4. RHINTECHECK – Program to check PA to PD 5. RHCHECKV - Checks all inverse relationships Overview

It is important to realize that in PA, there are tables that contain objects from OM, i.e. for those items displayed on infotype 0001 Organizational Assignment. Sometimes the tables can get „out of step‟ with those in PD – table

Page 15: 92825062 Overview ABAP HR

HRP1000. The tables are: T513, T513S Object type C (Job) T528B, T528T Object types S (Position) and A (Work center) T527X Object type O (Organizational unit) RHINTE00

This loops through all employees in PA by looking at positions on infotype 0001. It checks the corresponding person to position relationship exists in PD (A008), if not it is created. RHINTE10

Generally, the program RHINTE20 will be used instead of this one. This program loops through the PD table HRP1000. For each job, position, work centre and organization unit, corresponding entry is created in the PA tables, which are shown above. Run this with evaluation path o_s_p, which runs through Org units, jobs and positions or find a suitable alternative if you wish to update work centers also. The main difference with this program as opposed to RHINTE20 is that this one has the option to delete items from the PA tables, which no longer exist in PD. RHINTE20

This program loops through the PD table HRP1000. For each job, position, work centre and organization unit, corresponding entry is created in the PA tables, which are shown above. Run this with evaluation path o_s_p, which runs through Org units, jobs and positions or find a suitable alternative if you wish to update work centers also. An example output will show:

Expand the tree items to display a list of objects that can be created: RHINTECHECK

When the above programs have been run, use this check program, which looks through all employees and reports any inconsistencies found between PA and PD.

Page 16: 92825062 Overview ABAP HR

Tick each item that you wish to be created, or click on the text and click „select

subtree‟ to select them all then click to perform multiple updates. This program can prove to be „problematic‟. If difficulties arise with it, try using RHINTE10 instead. RHINTE30

This will create an infotype 0001 record with correct entries for org unit, job, position and work centre by looking through the organization structure. It creates a batch job, which must be run via SM35. More details to follow. RHCHECKV

This will check inverse relationships and create missing ones.

Page 17: 92825062 Overview ABAP HR

All product names are trademarks of their respective companies. AbapMania.com is in not affiliated with SAP AG. SAP, SAP R/3, ABAP, ALE, ALV, BAPI, BADI, CATT, IDOC, LSMW, ABAP OOP, User-Exits, SAP Query, Smartforms, Sapscripts, ABAP

Workflow, and any other SAP trademarks are registered trademarks of SAP AG in Germany. Every effort is made to ensure content integrity. Use information on this site at your own risk.

RHINTE00 SAP Report - Transfer Organizational Assignment (PA ->

PD)

RHINTE00 is a standard ABAP report available within your SAP system (depending on your

version and release level). Below is the standard documentation available for this report and

a few details of other objects it interacts with such as tables, function modules, includes etc.

If you would like to see the full code listing simply enter the object name( RHINTE00 ) into

the relevant SAP transaction such as SE38 or SE80

Within the comments section below there is also an opportunity for anyone to be able add

useful hints and information specific to this SAP object. This means that you and other users will be able to find these details quickly by simply searching on the object name.

SAP Documentation for program RHINTE00

TRANSACTION CODE: Z110

DESCRIPTION

This report reads the infotype records of the Organizational Assignment infotype (0001) created in PA.

The system then checks whether all or some of these records exist in PD.

If all these records exist in PD, that is for the entire validity period of the PA record, a log is output. The log indicates

that no changes are required in PD and no batch input session is created.

If changes are required, the system creates the following records in PD according to the Create Object(s) and Create

Relationship(s) parameters.

Objects (infotype 1000):

Work center

Job

Organizational unit

Position

Relationships (infotype 1001) between the following objects:

Page 18: 92825062 Overview ABAP HR

Person and position (or work center)

Position and job

Position and organizational unit

Cost center and organizational unit or position (depending on the Relate Cost Center with parameter).

The system only creates objects and relationships with objects that are used in HR Master Data. The objects are

created in the validity period they have in the relevant check tables for master data.

If the validity periods of the PA and PD records border each other or overlap, a continuous record is created in PD or

the existing record is extended (thereby avoiding splits in the validity period).

Example of bordering records:

The following example illustrates how a PA record and a PD record that border each other are merged into one

record in PD after report RHINTE00 has been run.

Record in PA:

|<---PA RECORD--->|

Record in PD:

|<--PD-RECORD-->|

Record in PD after RHINTE00 has been run:

|<---------PD RECORD----------->|

Example of overlapping records:

The following example illustrates how a PA record and a PD record that overlap each other are merged into one

record in PD after report RHINTE00 has been run.

Record in PA:

|<-----------PA RECORD--------->|

Record in PD:

|<----PD RECORD----->|

Record in PD after RHINTE00 has been run:

|<---------PD RECORD----------->|

The settings of the switches PLOGI TEXTO, PLOGI TEXTC, and PLOGI TEXTS

dictate which texts are copied to the Object

Abbreviation (SHORT/Length=12) field of the PD object for organizational units, jobs, and positions.

You can find these switches in the Implementation Guide (IMG) for Personnel Management under Organizational

Management -> Integration -> Integration with Personnel Administration ->Set Up Integration with Personnel

Administration.

If these switches are activated, (value ='X'), the text of the PA object is transferred (and if necessary reduced to 12

characters) to the Object Abbreviation field of the PD object when report RHINTE00 is run.

If these switches are not activated (value = ' '), the system transfers the object ID of the PD object to the ID field when

report RHINTE00 is run.

Page 19: 92825062 Overview ABAP HR

EXAMPLE :

The object ID of the PD object is '00001000'.

Text for organizational unit in PA:

Department 1

Text in PD after RHINTE00, if PLOGI TEXTO='X':

Department 1

Text in PD after RHINTE00, if PLOGI TEXTO=' ':

00001000

In both cases, the text of the PA object is transferred to the

Object Name (STEXT) field of the PD object.

Employees who have already left the company at the time the report is run, obtain a position relationship in HR-PD

only up to the leaving date.

If the leaving is to be transferred to HR-PD for employees who have already been transferred, you must select the

parameter Transfer Leavings Only. In this case, only the relationships that still exist in HR-PD of employees who

have already left are delimited. No records are created.

NOTE :

This report does not allow you to transfer an employee's leaving and

subsequent reentry simultaneously. However, you can do this by running

the program twice (once for the leaving, and once for the reentry).

After this report has been run, a batch input session (BTCI) must be processed (exception: if it is a test run or no

changes are required in PD).

You can start the batch input session from the menu under System -> Services -> Batch Input -> Process. The

session contains the name of the user who started report RHINTE00.

The report uses the standard relationships listed in Customizing under Maintain Relationships to create relationships

between said objects.

Selection

You make the entries according to standard selection for file PAnnnn. You must enter a start and end date for the

time interval to be processed (default values: 01/01/1800 to 12/31/9999; ensures complete consistency between PA

and PD).

Report-Specific Settings

The parameters of this report allow you to define the following:

The target plan version for the relevant objects and relationships (the standard target plan version is the integration

plan version set up in Customizing under Set Active Plan Version).

Whether records are to be created in PD (transfer of organizational assignment) or delimited (transfer of

employees' leaving). Records are created in the standard system.

Status to be used for relationships and objects (active or planned; only active for integration plan version).

Page 20: 92825062 Overview ABAP HR

Percentage to be used in the relationship (standard is 100%)

Whether objects and relationships are to be created. In the standard system, this option is selected = yes.

Object type with which relationships with cost centers are created (standard is O = organizational unit).

Whether old holder relationships are to be delimited (if can be decided technically).

If and under which name a batch input session is to be created.

For more information, see the documentation for the individual parameters:

Create Object(s)

This parameter enables you to specify whether integration objects (positions, jobs, and organizational units) are to be

created.

Only objects that are used in HR Master Data are created.

Create Relationship(s)

This parameter enables you to specify which of the following relationships are to be created:

Position - person

Position - job

Position - organizational unit

Position or organizational unit - cost center

Only relationships between objects that are used in HR Master Data are created.

Delimit Old Holder Relationships

This parameter provides you with the following options:

None (Presetting)

If you select this option, the system response is the same as before the functional enhancement, see SAP

Note 637221. No holder relationships (infotype 1001, subtype A008/B008) for this person are delimited in PD.

Exception:

If the Customizing setting of the time constraint for IT 1001/B008 < =

'2', a person can only occupy one position at a time, thereby

implicit delimitations occur. In this case, you must check all the holder relationships of this person and, if necessary,

delimit them manually.

SAP recommends you use this option, which is selected as standard. For an explanation, see SAP Note 554412.

Page 21: 92825062 Overview ABAP HR

Only positions from IT 0001

If you select this option, the report delimits previous, individual holder relationships in PD if the following conditions

apply:

A previous record with a different position has been found for each of the infotype 0001 records selected.

Corresponding holder relationships with a validity identical to that of the transfer date have been found in infotype

0001 for these previous records.

In this case, the corresponding records are delimited as of the transfer date.

Exception:

If the corresponding holder relationship starts on the same date as the

transfer in infotype 0001, this relationship is only delimited (or,

in this case, deleted) if the staffing percentage of a previous record in infotype 1001 for the same position has not

changed. If it has changed, it is assumed that the relationship was created intentionally in PD and it is therefore not

delimited.

Caution:

In the case of multiple assignments (one person occupies several

positions), a maximum of one holder relationship is delimited in PD for

each selected infotype 0001 record. The relationship that is saved in infotype 0001 is delimited.

EXAMPLE :

The following example illustrates what RHINTE00 does if the Only Positions from IT 0001 option is selected.

The following abbreviations are used: S = position, I = start and end selection of infotypes.

Before RHINTE00 has been run:

Selection period:,, I------------------------

Infotype 0001,,I---S1-----I-S2--I--S2-I---S3------

Infotype 1001/AB008,,I---S1----------------------------------

",,I---S4--I-------S4------------I--S4--

After RHINTE00 has been run:

Infotype 1001/AB008,,I---S1-----I

",, I-S2---------I

",, I---S3--------

" ,,I---S4--I-------S4------------I--S4--

All

If you select this option, all holder relationships in PD that intersect the selected records are delimited as of the start

date of the first selected infotype (or deleted if the holder relationship starts later than the first selected infotype 0001

record).

Caution:

Page 22: 92825062 Overview ABAP HR

SAP recommends you use this option only if you can ensure that persons

in the selection period cannot occupy several positions at the same

time meaning that no multiple assignments could exist.

If multiple assignments do exist, this may result in required holder

relationships being deleted unintentionally if, contrary to expectation,

multiple assignments are intended for some persons.

Example:

The following example illustrates what RHINTE00 does if the All option is selected.

The following abbreviations are used: S = position, I = start and end selection of infotypes.

Before RHINTE00 has been run:

Selection period:,, I------------------------

Infotype 0001,,I---S1-----I-S2--I--S2-I---S3------

Infotype 1001/AB008,,I---S1----------------------------------

",,I---S4--I-------S4------------I--S4--

After RHINTE00 has been run:

Infotype 1001/AB008,,I---S1-----I

",, I-S2---------I

",, I---S3--------

" ,,I---S4--I--I

Note:

Irrespective of the option you select here, all the relevant data for infotype 0001 records found in the selection period

are created again in PD according to the defined time constraint logic.

Records listed in the list output of the report under Delimited or Deleted Relationships, can also appear under the

records to be added. In this way, a technical delimitation is described.

Provided they are available in the release you use, you can then run run report RHINTECHECK or RHINTE20 to find

any remaining inconsistencies.

For more details and information about the technical background, see SAP Note 637221.

Session Name

This parameter enables you to enter a name for the batch input session that is created by this report.

Test

This parameter enables you to specify whether a batch input session is to be created. If you select this parameter, a

test run is executed without creating a batch input session.

OUTPUT

The report outputs a batch input session or a list of objects found for the session. It also outputs a list of personnel

numbers for which no relationship with a position exists.

Documentation extract taken from SAP system, Copyright (c) SAP AG

Page 23: 92825062 Overview ABAP HR

Includes used within report:

*RETROFIT : START OF ADDITION IN THE IN INCLUDE RHINDATA

Tables used within report and the associated select statement:

previous

******For selected Line from previous list

CLEAR ls_line.

T777V

SELECT SINGLE * FROM t777v WHERE langu EQ sy-langu

AND relat EQ plog_tab-subty+1(3).

T77S0

SELECT SINGLE * FROM t77s0 "VWMOBTCI

WHERE grpid = 'PMAIN' "VWMOBTCI

AND semid = 'OBTCI'. "VWMOBTCI

T522F

SELECT SINGLE * FROM t522f

WHERE repid EQ sy-repid.

T528T

SELECT * FROM t528t WHERE sprsl EQ sy-langu

AND otype EQ re528t_otype

AND plans EQ re528t_objid

AND begda LE re528t_begda

AND endda GE re528t_begda

Page 24: 92825062 Overview ABAP HR

ORDER BY PRIMARY KEY.

T528B

SELECT * FROM t528b WHERE otype = re528b_otype

AND plans = re528b_objid

AND endda GE p0001-begda

AND begda LE p0001-endda ORDER BY PRIMARY KEY.

T513

SELECT * FROM t513 WHERE stell EQ p0001-stell

AND begda LE p0001-endda

AND endda GE p0001-begda ORDER BY PRIMARY KEY.

T513S

SELECT * FROM t513s WHERE sprsl EQ sy-langu

AND stell EQ re513s_objid

AND begda LE re513s_begda

AND endda GE re513s_begda.

T527X

SELECT * FROM t527x WHERE sprsl EQ sy-langu

AND orgeh EQ re527x_objid

AND begda LE re527x_begda

AND endda GE re527x_begda.

T001P

SELECT SINGLE * FROM t001p WHERE werks EQ p0001-werks

AND btrtl EQ p0001-btrtl.

T77AR

SELECT SINGLE * FROM t77ar WHERE "ANDAHRK052416

relat EQ plog_tab-subty+1(3). "ANDAHRK052416

Page 25: 92825062 Overview ABAP HR

T77AR

SELECT SINGLE * FROM t77ar WHERE

relat EQ plog_tab-subty+1(3).

T527X

SELECT * FROM t527x WHERE sprsl EQ sy-langu

AND orgeh EQ wplog-objid

AND begda LE wplog-begda

AND endda GE wplog-begda.

T528T

SELECT * FROM t528t WHERE sprsl EQ sy-langu

AND otype EQ u_$otype

AND plans EQ wplog-objid

AND endda GE wplog-begda

AND begda LE wplog-begda.

T528B

SELECT * FROM t528b WHERE otype EQ u_$otype

AND plans EQ wplog-objid

AND endda GE wplog-begda

AND begda LE wplog-begda.

T513S

SELECT * FROM t513s WHERE sprsl EQ sy-langu

AND stell EQ wplog-objid

AND begda LE wplog-begda

AND endda GE wplog-begda.

T513

SELECT * FROM t513 WHERE stell EQ wplog-objid

Page 26: 92825062 Overview ABAP HR

AND begda LE wplog-begda

AND endda GE wplog-begda.

T778P

SELECT SINGLE * FROM t778p WHERE plvar EQ newplvar.

T778O

SELECT SINGLE * FROM t778o WHERE otype EQ kostrel.

T777E

SELECT SINGLE * FROM t777e WHERE clas1 EQ kostrel

AND relat EQ $okrel+1(3)

AND clas2 EQ $kostl

AND rsign EQ $okrel+0(1).

PLOG

* SELECT * FROM PLOG WHERE PLVAR EQ NEWPLVAR.

PLOGI

SELECT * FROM plogi UP TO 1 ROWS WHERE plvar EQ newplvar. "QPXA97295

T778S

SELECT SINGLE * FROM t778s WHERE istat EQ status.

Function Modules used within report and the associated call

statement:

REUSE_ALV_GRID_DISPLAY

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = gc_repid

i_callback_user_command = gc_user_command

Page 27: 92825062 Overview ABAP HR

i_callback_pf_status_set = gc_pf_status_set

i_callback_top_of_page = gc_formname_top_of_pageb

is_layout = gs_layout_basic_list

it_fieldcat = gt_fieldcat_basic_list

i_save = gc_save

TABLES

t_outtab = gt_plog_count

EXCEPTIONS

program_error = 1

OTHERS = 2.

REUSE_ALV_COMMENTARY_WRITE

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = gt_list_top_of_page_basic_list.

REUSE_ALV_COMMENTARY_WRITE

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = gt_list_top_of_page_sec_list.

REUSE_ALV_GRID_DISPLAY

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = gc_repid

i_callback_top_of_page = gc_formname_top_of_pages

i_callback_pf_status_set = gc_pf_status_set_alv1

is_layout = gs_layout_sec_list

it_fieldcat = gt_fieldcat_sec_list

Page 28: 92825062 Overview ABAP HR

i_save = gc_save

is_variant = gs_variants

TABLES

t_outtab = gt_sec_list

EXCEPTIONS

program_error = 1

OTHERS = 2.

REUSE_ALV_VARIANT_F4

CALL FUNCTION 'REUSE_ALV_VARIANT_F4'

EXPORTING

is_variant = is_variant

i_save = gc_save

* it_default_fieldcat =

IMPORTING

e_exit = gv_exit

es_variant = ls_xvariant

EXCEPTIONS

not_found = 2.

REUSE_ALV_VARIANT_EXISTENCE

CALL FUNCTION 'REUSE_ALV_VARIANT_EXISTENCE'

EXPORTING

i_save = gc_save

CHANGING

cs_variant = ls_xvariant.

REUSE_ALV_VARIANT_DEFAULT_GET

CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'

Page 29: 92825062 Overview ABAP HR

EXPORTING

i_save = gc_save

CHANGING

cs_variant = ls_xvariant

EXCEPTIONS

not_found = 2.

PAK_GET_SHORTTEXT_DTEL

CALL FUNCTION 'PAK_GET_SHORTTEXT_DTEL'

EXPORTING

i_elem_key = iv_dataelement

i_language = sy-langu

IMPORTING

e_short_text = xv_shorttext.

REUSE_ALV_FIELDCATALOG_MERGE

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = gc_repid

i_internal_tabname = iv_int_tab

i_structure_name = iv_struct

CHANGING

ct_fieldcat = xt_fieldcat

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

BDC_CLOSE_GROUP

Page 30: 92825062 Overview ABAP HR

CALL FUNCTION 'BDC_CLOSE_GROUP'. "QPXK109211

RH_UNIT_RECORD

CALL FUNCTION 'RH_UNIT_RECORD' "NAD

TABLES "NAD

record_tab = record_tab "NAD

unit_tab = unit_tab "NAD

. "NAD

BDC_OPEN_GROUP

* CALL FUNCTION 'BDC_OPEN_GROUP'

* EXPORTING

* client = sy-mandt

* group = group

* user = sy-uname

* keep = keep

* holddate = holddate.

RH_READ_INFTY_1001

CALL FUNCTION 'RH_READ_INFTY_1001' "note637221

EXPORTING

istat = status

begda = prev_endda

endda = high_date

subty = 'B008'

TABLES

i1001 = sp1001

OBJECTS = sobjects

EXCEPTIONS

Page 31: 92825062 Overview ABAP HR

nothing_found = 1

wrong_condition = 2

OTHERS = 3.

HR_READ_INFOTYPE

CALL FUNCTION 'HR_READ_INFOTYPE' "note637221

EXPORTING

pernr = l_pernr

infty = '0001'

begda = prev_endda

endda = prev_endda

TABLES

infty_tab = p0001_tab

EXCEPTIONS

infty_not_found = 1

OTHERS = 2.

RH_INVERT_RELA_INFTY

CALL FUNCTION 'RH_INVERT_RELA_INFTY' "

EXPORTING "

p1001_imp = sp1001 "

IMPORTING "

p1001_exp = sp1001. "

RH_INVERT_RELA_INFTY

CALL FUNCTION 'RH_INVERT_RELA_INFTY' "note637221

EXPORTING

p1001_imp = sp1001

IMPORTING

Page 32: 92825062 Overview ABAP HR

p1001_exp = sp1001.

RH_CONDITION_BUILD

CALL FUNCTION 'RH_CONDITION_BUILD'

EXPORTING

infty = plog_tab-infty

IMPORTING

condition = condition

TABLES

condtab = condtab

EXCEPTIONS

empty_condtab = 1

no_db_field = 2

unknown_infty_db = 3

wrong_condition = 4

unknown_pad_db = 5

OTHERS = 6.

RH_READ_INFTY

CALL FUNCTION 'RH_READ_INFTY'

EXPORTING

infty = plog_tab-infty

istat = plog_tab-istat

extend = 'D'

condition = condition

sort = 'X'

TABLES

innnn = infty_ta

Page 33: 92825062 Overview ABAP HR

OBJECTS = plog_object

EXCEPTIONS

all_infty_with_subty = 1

nothing_found = 2

no_objects = 3

wrong_condition = 4

OTHERS = 5.

BDC_OPEN_GROUP

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

client = sy-mandt

group = group

user = sy-uname

keep = keep

holddate = holddate.

RH_READ_INFTY_1001

CALL FUNCTION 'RH_READ_INFTY_1001' "VWMK018916

EXPORTING "VWMK018916

subty = 'A008' "VWMK018916

TABLES "VWMK018916

i1001 = sp1001 "VWMK018916

OBJECTS = sobjects "VWMK018916

EXCEPTIONS "VWMK018916

nothing_found = 1 "VWMK018916

wrong_condition = 2 "VWMK018916

OTHERS = 3. "VWMK018916

Page 34: 92825062 Overview ABAP HR

BDC_OPEN_GROUP

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

client = sy-mandt

group = group

user = sy-uname

keep = keep

holddate = holddate.

BDC_OPEN_GROUP

CALL FUNCTION 'BDC_OPEN_GROUP' "

EXPORTING

client = sy-mandt

group = group

user = sy-uname

keep = keep

holddate = holddate.

BDC_CLOSE_GROUP

CALL FUNCTION 'BDC_CLOSE_GROUP'.

RP_EDIT_NAME

CALL FUNCTION 'RP_EDIT_NAME'

EXPORTING

pp0002 = p0002

molga = t001p-molga

langu = sy-langu

format = $$format

IMPORTING

Page 35: 92825062 Overview ABAP HR

edit_name = edit_name

retcode = subrc.

RP_HIRE_FIRE

* CALL FUNCTION 'RP_HIRE_FIRE' "ANDK015989 "QPXK109211

* EXPORTING BEG = PN-BEGDA "ANDK015989 "QPXK109211

* END = PN-ENDDA "ANDK015989 "QPXK109211

* IMPORTING FIRE_DATE = FIREDATE "ANDK015989 "QPXK109211

* HIRE_DATE = HIREDATE "ANDK015989 "QPXK109211

* TABLES PP0000 = P0000 "ANDK015989 "QPXK109211

* PP0001 = P0001 "ANDK015989 "QPXK109211

* PPHIFI = PPHIFI. "ANDK015989 "QPXK109211

HRCA_CONTROLLINGAREA_FIND

CALL FUNCTION 'HRCA_CONTROLLINGAREA_FIND'

EXPORTING

companycode = p0001-bukrs

businessarea = p0001-gsber

IMPORTING

contrlarea = rk_kokrs

EXCEPTIONS

not_found = 1

OTHERS = 2.

BDC_INSERT

CALL FUNCTION 'BDC_INSERT'

EXPORTING

tcode = 'PP02'

TABLES

Page 36: 92825062 Overview ABAP HR

dynprotab = bdcdata.

BDC_INSERT

CALL FUNCTION 'BDC_INSERT'

EXPORTING

tcode = 'PP02'

TABLES

dynprotab = bdcdata.

RH_GET_NUMBER_RANGE

CALL FUNCTION 'RH_GET_NUMBER_RANGE'

EXPORTING

no_range_num = 'EX'

plan_version = newplvar

object_type = $workp

IMPORTING

from_no = from_no

to_no = to_no

last_no = last_no

returncode = subrc

EXCEPTIONS

interval_not_found

object_type_not_found

plan_version_not_found

rp_plan_ranges_not_defined.

RH_GET_NUMBER_RANGE

CALL FUNCTION 'RH_GET_NUMBER_RANGE'

EXPORTING

Page 37: 92825062 Overview ABAP HR

no_range_num = 'EX'

plan_version = newplvar

object_type = $class

IMPORTING

from_no = from_no

to_no = to_no

last_no = last_no

returncode = subrc

EXCEPTIONS

interval_not_found

object_type_not_found

plan_version_not_found

rp_plan_ranges_not_defined.

RH_GET_NUMBER_RANGE

CALL FUNCTION 'RH_GET_NUMBER_RANGE'

EXPORTING

no_range_num = 'EX'

plan_version = newplvar

object_type = $orgeh

IMPORTING

from_no = from_no

to_no = to_no

last_no = last_no

returncode = subrc

EXCEPTIONS

interval_not_found

Page 38: 92825062 Overview ABAP HR

object_type_not_found

plan_version_not_found

rp_plan_ranges_not_defined.

RH_GET_NUMBER_RANGE

CALL FUNCTION 'RH_GET_NUMBER_RANGE'

EXPORTING

no_range_num = 'EX'

plan_version = newplvar

object_type = $plste

IMPORTING

from_no = from_no

to_no = to_no

last_no = last_no

returncode = subrc

EXCEPTIONS

interval_not_found

object_type_not_found

plan_version_not_found

rp_plan_ranges_not_defined.

RH_READ_INFTY_1001

CALL FUNCTION 'RH_READ_INFTY_1001' "QPXA109712

EXPORTING "QPXA109712

begda = p0000-begda "QPXA109712

endda = p0000-endda "QPXA109712

istat = active "QPXA109712

TABLES "QPXA109712

Page 39: 92825062 Overview ABAP HR

i1001 = lp_table "QPXA109712

OBJECTS = obj_tab "QPXA109712

EXCEPTIONS "QPXA109712

nothing_found = 01 "QPXA109712

wrong_condition = 02. "QPXA109712

RH_INVERT_RELA_INFTY

CALL FUNCTION 'RH_INVERT_RELA_INFTY' "QPXA109712

EXPORTING "QPXA109712

p1001_imp = lp_table "QPXA109712

IMPORTING "QPXA109712

p1001_exp = lp_table. "QPXA109712

BDC_OPEN_GROUP

CALL FUNCTION 'BDC_OPEN_GROUP'

EXPORTING

client = sy-mandt

group = group

user = sy-uname

keep = keep

holddate = holddate.

BDC_INSERT

CALL FUNCTION 'BDC_INSERT'

EXPORTING

tcode = 'PP02'

TABLES

dynprotab = bdcdata.

HR_READ_T77S0

Page 40: 92825062 Overview ABAP HR

CALL FUNCTION 'HR_READ_T77S0' "#EC *

EXPORTING "#EC *

grpid = 'PLOGI' "#EC *

semid = 'PLOGI' "#EC *

IMPORTING "#EC *

gsval = plogi-plvar "#EC *

EXCEPTIONS "#EC *

OTHERS = 2. "#EC *

RH_READ_OBJECT

CALL FUNCTION 'RH_READ_OBJECT'

EXPORTING

plvar = plogi-plvar

otype = 'P'

objid = delimit_tab-pernr-pernr

* BEGDA = SY-DATUM

* ENDDA = SY-DATUM

IMPORTING

* SHORT =

* STEXT =

display_text = edit_name

* TABLES

* EXISTENCE =

EXCEPTIONS

not_found = 1

OTHERS = 2

.

Page 41: 92825062 Overview ABAP HR

Text pool values

Selection Text: CUTINH_0 = None (Presetting)

Selection Text: CUTINH_1 = Only Unique

Selection Text: CUTINH_2 = All

Selection Text: GROUP = Session name

Selection Text: HOLDDATE = Lock session until

Selection Text: KEEP = Keep session

Selection Text: KOSTREL = Relate cost centers with

Selection Text: LEAVE = Transfer leavings only

Selection Text: TEST = Test

Selection Text: STATUS = Structure status

Selection Text: RELATE = Create relationship(s)

Selection Text: RELAT% = Relationship percentage

Selection Text: P_VARS = Layout

Selection Text: OBJECTS = Create object(s)

Selection Text: NUR_INHA = Create holder relatshp. only

Selection Text: NEWPLVAR = Target plan version

Title: Transfer Organizational Assignment (PA -> PD)

Text Symbol: UPD = Will Be Noted

Text Symbol: SAT = Record(s)

Text Symbol: REL = Relationship

Text Symbol: REJ = Colored records are already available in Personnel Planning

Text Symbol: PER = Person

Text Symbol: 001 = Delimited or Deleted Relationships:

Text Symbol: 100 = No entry in table

Text Symbol: 999 = Highlighted records will not be updated in database.

Text Symbol: AL1 = Report-Specific Settings

Text Symbol: AL2 = Exists

Text Symbol: ALL = Integration tables are maintained.

Text Symbol: ALR = Exists in Personnel Planning

Text Symbol: ARG = for the key

Text Symbol: BEZ = Name

Text Symbol: BTC = Batch input session created

Text Symbol: DEL = All relationships delimited to

Text Symbol: ERR = * Table error *

Text Symbol: GUE = Validity

Text Symbol: IN0 = Delimitation of Old Holder Relationships (See Documentation)

Text Symbol: IN1 = None (Presetting)

Text Symbol: IN2 = Only Positions from IT 0001

Text Symbol: IN3 = All

Text Symbol: INB = Infotype

Text Symbol: MIT = Persons without positions

Text Symbol: NRC = Found no relationships in Personnel Planning to be delimited

Text Symbol: OBJ = Objects

001 &0..................&3.............&1..................&2..................

Page 42: 92825062 Overview ABAP HR

RHINTE10 SAP Report - Prepare Integration (OM with PA)

RHINTE10 is a standard ABAP report available within your SAP system (depending on your

version and release level). Below is the standard documentation available for this report and

a few details of other objects it interacts with such as tables, function modules, includes etc.

If you would like to see the full code listing simply enter the object name( RHINTE10 ) into

the relevant SAP transaction such as SE38 or SE80

Within the comments section below there is also an opportunity for anyone to be able add

useful hints and information specific to this SAP object. This means that you and other users will be able to find these details quickly by simply searching on the object name.

SAP Documentation for program RHINTE10

TRANSACTION CODE: Z111

DESCRIPTION

This program allows you to create object types in Personnel Administration (HR-PA) which have already been set up

in Personnel Planning and Development (HR-PD) and which are needed for integration.

The following object types are relevant to integration:

PD,,,,PA

Work center,,(object type A),,Tables T528B, T528T

Job,,(Object type C),,Tables T513, T513S

Position,,(Object type S),,Tables T528B, T528T

Organizational unit,,(Object type O),,Table T527X

Only objects which exist in status 1 (active) in the integration plan version are included (see in PD Customizing

under Set active plan version, entry PLOGI PLOGI).

The integration object types are required for infotype 0001 "Organizational Assignment".

A program run can take place for one or all object types.

Parameter

Creating Objects

Controls whether objects should be created in the tables for Personnel Administration. These objects are created,

that is transferred to the existing objects in Personnel Planning and Development (HR-PD).

Deleting Non-Existent Objects

Controls whether objects in Personnel Administration tables (HR-PA) that only exist in these tables and not in

Personnel Planning and Development ( HR-PD) should be deleted.

Only Objects with Original in OM

Restricts the objects to be deleted to objects whose original is maintained in Organizational Management. In relation

to the "Delete non-existent objects" parameter, only objects of the PA tables whose original was previously created in

OM are taken into account. Objects which were created with their original in OM from the beginning and therefore

have never existed in OM are not deleted.

Test

This parameter controls whether the program is to be run in test mode without table changes or in update mode with

table changes.

Page 43: 92825062 Overview ABAP HR

DEPENDENCIES

OUTPUT

You obtain a list containing the number of records for each operation performed and for each object type. To display

the individual records, double-click on a line.

Documentation extract taken from SAP system, Copyright (c) SAP AG

Includes used within report:

INCLUDE RHODAT00.

INCLUDE RHOINI00.

INCLUDE RHODAT00.

Tables used within report and the associated select statement:

T777O

SELECT SINGLE * FROM t777o WHERE langu EQ sy-langu

AND otype EQ objects_count-otype.

T77ST

SELECT SINGLE * FROM t77st

WHERE langu = sy-langu

AND grpid = 'PLOGI'

AND semid = 'PRELI' .

T528B

SELECT * FROM t528b WHERE otype = $plste

AND plans = $preli.

PLOGI

SELECT * FROM plogi INTO TABLE iplogi

WHERE otype = dn_otype

Page 44: 92825062 Overview ABAP HR

AND plvar = act_plvar.

T527X

SELECT * FROM t527x INTO TABLE i527x.

T527X

SELECT * FROM t527x INTO TABLE i527x WHERE maint = 'P'.

T513

SELECT * FROM t513 INTO TABLE i513.

T513

SELECT * FROM t513 INTO TABLE i513 WHERE maint = 'P'.

T528B

SELECT * FROM t528b INTO TABLE i528b

WHERE otype = dn_otype.

T528B

SELECT * FROM t528b INTO TABLE i528b

WHERE otype = dn_otype

AND maint = 'P'.

T528B

SELECT * FROM t528b INTO TABLE i528b

WHERE otype = dn_otype.

T528B

SELECT * FROM t528b INTO TABLE i528b

WHERE otype = dn_otype

AND maint = 'P'.

PLOGI

* SELECT SINGLE * FROM PLOGI

* WHERE PLVAR = ACT_PLOGI-PLVAR

Page 45: 92825062 Overview ABAP HR

* AND OTYPE = ACT_PLOGI-OTYPE

* AND OBJID = ACT_PLOGI-OBJID.

T777O

SELECT SINGLE * FROM t777o WHERE langu EQ sy-langu

AND otype EQ dn_otype.

T527X

SELECT COUNT(*) FROM t527x WHERE orgeh = act_plogi-objid.

T513

SELECT COUNT(*) FROM t513 WHERE stell = act_plogi-objid.

T513S

SELECT COUNT(*) FROM t513s WHERE stell = act_plogi-objid.

T5C13

SELECT COUNT(*) FROM t5c13 WHERE stell = act_plogi-objid.

T5D13

SELECT COUNT(*) FROM t5d13 WHERE stell = act_plogi-objid.

T5K13

SELECT COUNT(*) FROM t5k13 WHERE stell = act_plogi-objid.

T5U13

SELECT COUNT(*) FROM t5u13 WHERE stell = act_plogi-objid.

T528B

SELECT COUNT(*) FROM t528b WHERE otype = act_plogi-otype

AND plans = act_plogi-objid.

T528T

SELECT COUNT(*) FROM t528t WHERE otype = act_plogi-otype

AND plans = act_plogi-objid.

the

Page 46: 92825062 Overview ABAP HR

* Fetch the records to be transferred of the selected object type

* from the set of objects to be transferred

WHEN gv_icon_delete(5).

Function Modules used within report and the associated call

statement:

RH_INTEGRATION_CHECK

CALL FUNCTION 'RH_INTEGRATION_CHECK'

IMPORTING

integrated_plvar = act_plvar

org_integration = act_orga.

RH_GET_OBJECTS_FROM_E071K

* CALL FUNCTION 'RH_GET_OBJECTS_FROM_E071K'

* EXPORTING

* CORRNUM = CORRTASK

* TABLES

* ST_PLOGI_DEL = ACT_PLOGI_DEL

* ST_PLOGI = ACT_PLOGI

* WF_PLOGI_DEL = WF_PLOGI_DEL

* WF_PLOGI = WF_PLOGI

* EXCEPTIONS

* CORRNUM_DONT_EXIST = 1

* OTHERS = 2.

REUSE_ALV_GRID_DISPLAY

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

Page 47: 92825062 Overview ABAP HR

EXPORTING

i_callback_program = gv_repid

is_layout = is_layout

it_fieldcat = it_fieldcat

is_variant = ls_variant

i_save = gv_save

it_events = it_events

IMPORTING

es_exit_caused_by_user = ls_exit_caused_by_user "BACK

TABLES

t_outtab =

EXCEPTIONS

program_error = 1

OTHERS = 2.

REUSE_ALV_FIELDCATALOG_MERGE

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = gv_repid

i_internal_tabname = lv_itab

i_structure_name = lc_rhinte10

CHANGING

ct_fieldcat = xt_fieldcat[]

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

Page 48: 92825062 Overview ABAP HR

PAK_GET_SHORTTEXT_DTEL

CALL FUNCTION 'PAK_GET_SHORTTEXT_DTEL'

EXPORTING

i_elem_key = iv_data_ele

i_language = sy-langu

IMPORTING

e_short_text = iv_heading.

REUSE_ALV_EVENTS_GET

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

i_list_type = 0

IMPORTING

et_events = xt_events

EXCEPTIONS

list_type_wrong = 1

OTHERS = 2.

REUSE_ALV_COMMENTARY_WRITE

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = it_list_header

i_end_of_list_grid = iv_footer.

HR_READ_T77S0

CALL FUNCTION 'HR_READ_T77S0' "#EC * "STFO789750

EXPORTING "#EC * "STFO789750

grpid = 'PLOGI' "#EC * "STFO789750

semid = 'PLOGI' "#EC * "STFO789750

Page 49: 92825062 Overview ABAP HR

IMPORTING "#EC * "STFO789750

gsval = l_plogi-plvar "#EC * "STFO789750

EXCEPTIONS "#EC * "STFO789750

OTHERS = 2. "#EC * "STFO789750

RH_READ_OBJECT

CALL FUNCTION 'RH_READ_OBJECT'

EXPORTING

plvar = l_plogi-plvar

otype = gs_outtab_alv-otype

objid = objects-objid

* BEGDA = SY-DATUM

endda = objects-endda

IMPORTING

short = l_short

stext = l_stext

* display_text =

* TABLES

* EXISTENCE =

EXCEPTIONS

not_found = 1

OTHERS = 2

.

HRDSYS_SHOW_DOCU

CALL FUNCTION 'HRDSYS_SHOW_DOCU' "VWMDSYS

EXPORTING "VWMDSYS

* MOLGA = ' ' "VWMDSYS

Page 50: 92825062 Overview ABAP HR

oname = 'PRELI' "VWMDSYS

otype = 'SEKZ' "VWMDSYS

EXCEPTIONS "VWMDSYS

wrong_otype = 1 "VWMDSYS

loio_not_found = 2 "VWMDSYS

internal_error = 3 "VWMDSYS

OTHERS = 4. "VWMDSYS

Text pool values

Selection Text: TEST = Test

Selection Text: MOVEOBJ = Create objects

Selection Text: MAINTAIN = Only objects with orig. in OM.

Selection Text: DELEXIST = Delete existing objects first.

Selection Text: DELEOLDS = Delete non-existant objects.

Title: Prepare Integration (OM with PA)

Text Symbol: JOB = Tables 513S and 513 are maintained.

Text Symbol: K13 = The entries in table T5D13 have been deleted.

Text Symbol: NON = Error: No tables have been maintained.

Text Symbol: OBJ = Object

Text Symbol: ORG = Table 527X is maintained.

Text Symbol: POS = Tables 528T and 528B are maintained.

Text Symbol: SAT = Record(s)

Text Symbol: TI1 = Special Options

Text Symbol: TI2 = Create objects in PA tables.

Text Symbol: TI3 = Delete non-existant objects.

Text Symbol: U13 = The entries in table T5U13 have been deleted.

Text Symbol: GUE = Validity

Text Symbol: 001 = The following objects must be deleted in the PA tables:

Text Symbol: 002 = The following objects are being transfered to the PA tables:

Text Symbol: 003 = Test mode: PA tables were not changed.

Text Symbol: 004 = Update of the PA tables not required.

Text Symbol: 005 = The objects have been deleted in the PA tables.

Text Symbol: 013 = Table T513 has been maintained.

Text Symbol: 13S = Tabelle T513S has been maintained.

Text Symbol: 13T = The entries in table T513S have been deleted.

Text Symbol: 27X = The entries in table T527X have been deleted.

Text Symbol: 28B = Table T528B has been maintained.

Text Symbol: 28T = Table T528T has been maintained.

Text Symbol: 513 = The entries in table T513 have been deleted.

Page 51: 92825062 Overview ABAP HR

Text Symbol: 528 = Entries in tables T528B, T528T have been deleted.

Text Symbol: BEZ = Name

Text Symbol: C13 = The entries in table T5C13 have been deleted.

Text Symbol: D13 = The entries in table T5D13 have been deleted.

001 &0..................&3.............&1..................&2..................

ALV grid display (inc. column total)

Below is an example ABAP program which will populate a simple internal table(it_ekpo) with

data and display it using the basic ALV grid functionality(including column total). The

example details the main sections of coding required to implement the ALV grid functionality:

Data declaration

Data retrieval

Build fieldcatalog

Build layout setup

*&-------------------------------------------------------------* *& Report ZDEMO_ALVGRID * *& * *&-------------------------------------------------------------* *& * *& Example of a simple ALV Grid Report * *& ................................... * *& * *& The basic requirement for this demo is to display a number * *& of fields from the EKKO table. * *&-------------------------------------------------------------* REPORT zdemo_alvgrid . TABLES: ekko. type-pools: slis. "ALV Declarations *Data Declaration *---------------- TYPES: BEGIN OF t_ekko, ebeln TYPE ekpo-ebeln, ebelp TYPE ekpo-ebelp, statu TYPE ekpo-statu, aedat TYPE ekpo-aedat, matnr TYPE ekpo-matnr, menge TYPE ekpo-menge, meins TYPE ekpo-meins,

Page 52: 92825062 Overview ABAP HR

netpr TYPE ekpo-netpr, peinh TYPE ekpo-peinh, END OF t_ekko. DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0, wa_ekko TYPE t_ekko. *ALV data declarations data: fieldcatalog type slis_t_fieldcat_alv with header line, gd_tab_group type slis_t_sp_group_alv, gd_layout type slis_layout_alv, gd_repid like sy-repid. ************************************************************************ *Start-of-selection. START-OF-SELECTION. perform data_retrieval. perform build_fieldcatalog. perform build_layout. perform display_alv_report. *&---------------------------------------------------------------------* *& Form BUILD_FIELDCATALOG *&---------------------------------------------------------------------* * Build Fieldcatalog for ALV Report *----------------------------------------------------------------------* form build_fieldcatalog. * There are a number of ways to create a fieldcat. * For the purpose of this example i will build the fieldcatalog manualy * by populating the internal table fields individually and then * appending the rows. This method can be the most time consuming but can * also allow you more control of the final product. * Beware though, you need to ensure that all fields required are * populated. When using some of functionality available via ALV, such as * total. You may need to provide more information than if you were * simply displaying the result * I.e. Field type may be required in-order for * the 'TOTAL' function to work. fieldcatalog-fieldname = 'EBELN'. fieldcatalog-seltext_m = 'Purchase Order'. fieldcatalog-col_pos = 0. fieldcatalog-outputlen = 10. fieldcatalog-emphasize = 'X'. fieldcatalog-key = 'X'. * fieldcatalog-do_sum = 'X'. * fieldcatalog-no_zero = 'X'. append fieldcatalog to fieldcatalog. clear fieldcatalog.

Page 53: 92825062 Overview ABAP HR

fieldcatalog-fieldname = 'EBELP'. fieldcatalog-seltext_m = 'PO Item'. fieldcatalog-col_pos = 1. append fieldcatalog to fieldcatalog. clear fieldcatalog. fieldcatalog-fieldname = 'STATU'. fieldcatalog-seltext_m = 'Status'. fieldcatalog-col_pos = 2. append fieldcatalog to fieldcatalog. clear fieldcatalog. fieldcatalog-fieldname = 'AEDAT'. fieldcatalog-seltext_m = 'Item change date'. fieldcatalog-col_pos = 3. append fieldcatalog to fieldcatalog. clear fieldcatalog. fieldcatalog-fieldname = 'MATNR'. fieldcatalog-seltext_m = 'Material Number'. fieldcatalog-col_pos = 4. append fieldcatalog to fieldcatalog. clear fieldcatalog. fieldcatalog-fieldname = 'MENGE'. fieldcatalog-seltext_m = 'PO quantity'. fieldcatalog-col_pos = 5. append fieldcatalog to fieldcatalog. clear fieldcatalog. fieldcatalog-fieldname = 'MEINS'. fieldcatalog-seltext_m = 'Order Unit'. fieldcatalog-col_pos = 6. append fieldcatalog to fieldcatalog. clear fieldcatalog. fieldcatalog-fieldname = 'NETPR'. fieldcatalog-seltext_m = 'Net Price'. fieldcatalog-col_pos = 7. fieldcatalog-outputlen = 15. fieldcatalog-do_sum = 'X'. "Display column total fieldcatalog-datatype = 'CURR'. append fieldcatalog to fieldcatalog. clear fieldcatalog. fieldcatalog-fieldname = 'PEINH'. fieldcatalog-seltext_m = 'Price Unit'. fieldcatalog-col_pos = 8. append fieldcatalog to fieldcatalog. clear fieldcatalog. endform. " BUILD_FIELDCATALOG *&---------------------------------------------------------------------* *& Form BUILD_LAYOUT

Page 54: 92825062 Overview ABAP HR

*&---------------------------------------------------------------------* * Build layout for ALV grid report *----------------------------------------------------------------------* form build_layout. gd_layout-no_input = 'X'. gd_layout-colwidth_optimize = 'X'. gd_layout-totals_text = 'Totals'(201). * gd_layout-totals_only = 'X'. * gd_layout-f2code = 'DISP'. "Sets fcode for when double * "click(press f2) * gd_layout-zebra = 'X'. * gd_layout-group_change_edit = 'X'. * gd_layout-header_text = 'helllllo'. endform. " BUILD_LAYOUT *&---------------------------------------------------------------------* *& Form DISPLAY_ALV_REPORT *&---------------------------------------------------------------------* * Display report using ALV grid *----------------------------------------------------------------------* form display_alv_report. gd_repid = sy-repid. call function 'REUSE_ALV_GRID_DISPLAY' exporting i_callback_program = gd_repid * i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM * i_callback_user_command = 'USER_COMMAND' * i_grid_title = outtext is_layout = gd_layout it_fieldcat = fieldcatalog[] * it_special_groups = gd_tabgroup * IT_EVENTS = GT_XEVENTS i_save = 'X' * is_variant = z_template tables t_outtab = it_ekko exceptions program_error = 1 others = 2. if sy-subrc <> 0. * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO * WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. endif. endform. " DISPLAY_ALV_REPORT *&---------------------------------------------------------------------* *& Form DATA_RETRIEVAL *&---------------------------------------------------------------------* * Retrieve data form EKPO table and populate itab it_ekko *----------------------------------------------------------------------* form data_retrieval.

Page 55: 92825062 Overview ABAP HR

select ebeln ebelp statu aedat matnr menge meins netpr peinh up to 10 rows from ekpo into table it_ekko. endform. " DATA_RETRIEVAL

SAP HR Common Error Messages

Personnel Administration

Error Message Reason for Error and Solution thereof

No data stored for xxxxxx in the selected period The date or radio button in the "Period" box is

before the employee's hire date. Change the

period by inserting specific start and end dates.

You have locked key PREL ######## [Pers No.] The employee is currently being maintained in

another session. Close one of the sessions and

continue to maintain the employee.

Key PREL ######## locked by user ######## The employee is being maintained by another

user. Use transaction code PA20 if you only

wish to display information. Contact the other

user - who may have finished updating this

employee.

Payroll area M1 is locked for on-line maintenance You have attempted to change payroll data

whilst the payroll is locked for processing. Exit

the current screen and wait until payroll

processing is complete or change the control

record (transaction code PA03) if you are not in

your Production client and you have the

required security access to do so.

Data entry for correction period; payroll area M1 The change is being made whilst the payroll

control record is in a correction. This will ensure

that this employee will be processed as part of

the next matchcode W payroll run.

Enter data for payroll past (retrospective accounting) The master data changes made affects

previously generated results. The

employeesinfotype 3 (field: "Earliest MD

Change") will be updated to allow the payroll to

carry out retroactive calculations.

Page 56: 92825062 Overview ABAP HR

To period of record dd.mm.yyyy will be delimited to dd.mm.yyyy The existing infotype record will have the "To"

date delimited to the day before the new record

you have entered.

This record will cause another record to be deleted The infotype record you are creating or

changing will replace the previous infotype

record.

No Entry in Table xxxxx Entries need to be added to this table. Use

transaction code SM31 to add the entries. If you

would like to know where in the IMG these

entries are entered - use the customising option

on SM31.

Wage Type not allowed for ESG/PSG ... This relates to wage type permissibility. Check

the settings on table T511_B for the wage

type's entries for ESG or PSG. Check to see

whether this employee should, in fact, be

allowed this wage type. If they are, then amend

the configuration.

Planned Working Time

ATTENTION: Please check Basic Pay data The field "Monthly Working Hours" in IT 0007 must have

the same value as "Work hours/period" in IT 0008. This

value is fed into the field on IT 0008 from IT 0007 when

the initial hire action is carried out. Use a dynamic action

(table T588Z) to update this field on IT 0007 whenever IT

0008 is modified.

Monthly WS deleted or does not exist for dd.mm.yyyy The work schedule allocated to this employee has not

been generated.

Basic Pay

No Entry in table T529Q for period

modifier 03 for time xx.xx.xxxx

Check table T510w to ensure that all the ESG for CAP point to the

correct period modifiers rather than a default one.

Employee not selected during payroll run Check that you have chosen the correct payroll area on the selection

screen. Check that the employee is active in the chosen payroll period.

Recurring Payments and Deductions

Amount is impermissible entry This wage type does not allow direct entry of an amount. The wage type

characteristics (table T511) have been set up to allow the entry of a

Page 57: 92825062 Overview ABAP HR

number of units instead.

Always enter both number and unit. This is one of those odd messages. The wage type wants just an amount and you have entered either:

a number and no amount, or;

a number and an amount,

a unit and an amount

Enter an amount with no number or unit.

Do not enter units for wage type xxxx Clear these fields and enter an amount instead.

Please enter an amount Both number and amount are blank. Enter a value as appropriate.

Bank Details

Retroactive entries

allowed only up to the xx

yyyy

Banking details cannot be created or changed for pay periods that have already had

the EFT transfer run. Change the "From" date to the start of the next pay period.

Personnel Event - Hire or Org/Pay Change

Number range nn is internal; please do not enter a personnel

number

Personnel numbers are assigned

automatically from an internal range. Delete

the entry in the Personnel Number field - the

system will provide the number.

No entry in table T530 for xx You need to enter a valid "Reason for

Action"

Person and Position have different Personnel Areas This happens when hiring several employees in the same session. The system defaults to the Personnel Area of the person you hired last hired in the session - What to do.

Delete the default entries for the Personnel Area, Employee Group and Employee Subgroup

Click "Enter" - This will default in the correct Personnel Area, Employee Group and Employee Subgroup as per the Position

If correct select Save

A008 relationships of S 500xxxx exceed working hours by nnn.nn% This position may have more than one

incumbent. It is appropriate to have more

Page 58: 92825062 Overview ABAP HR

than one person in a position in the

following circumstances; For a handover

period two employees occupy the position.

The position is designed to have multiple

occupants - eg. Contractors may be set up

in one position.

Absence & Attendance Entry

First day is a day of Warns that the first day of the absence or

attendance period is a non-working day for this

employee.

Last day is a day off Warns that the last day of the absence or

attendance period is a non-working day for this

employee.

All days in the period are days off Alerts you that every day of the absence or

attendance period is a non-working day for this

employee.

No validity interval for key 1 08 05 This occurs when you try and enter an absence

quota for an employee whose absence quota

does not exist in the validity period as a default

value. The table is T559V.

This will cause leave entitlement to become negative Check leave balance in Leave View if required

Confirm with supervisor that negative leave is approved

Enter the absence ensuring that you select the appropriate absence subtype for negative leave

Please enter indicator OR absence/attendance type When using the push button Abs./attendances in

Calendar View for bringing up the data entry box

for Absence/Attendance, an entry in one or other

of the columns marked 'AC' and 'STy.' is required

- not both.

No data stored for leave entitlement for the selected period No data is currently held on infotype 0005.

Create the record.

No entry in table T551C for key 0GR071998081 10000000000 Check to make sure you have assigned the

period work schedule valuation classes and

counting classes. The two IMG Paths are as

follows:

Time Management Time Recording

Page 59: 92825062 Overview ABAP HR

Absences Absence Catalog Absence

Counting Define counting classes for period

work schedule

And

Time Evaluation Time Evaluation with Data

from Sub System/Time Evaluation Without Clock

Times Time Wage Type Selection and

Overtime Compensation Define valuation

classes for period work schedules

"No entry in table T551C for key 10GR071998081

10000000000"

The error message number is P2501. When I try

to get the help for the message, I find the help

contains nothing more except the message ID.

Table T551C entries required on the 11/08/2998

for absence type GR07

Payroll Reports

Please do not enter a period You have entered a payroll period but the

radio button says "Current Period". Either

delete period entry to use the current

Period or change radio button to "Other

Period"

Error when retrieving results: CLUSTER DIRECTORY NOT FOUND Your selection criteria have not yielded any

employees. Check the criteria, in particular

that the payroll period exists.

General

Changes to Repository or cross-client

Customising are not permitted

You have attempted to change an object in a client which has not

been set to allow client-independent changes. Check the settings

on table T000 and get the System Administration team to change

the setting on the table. If allowed you can do it yourself

using transaction code SCC4

Number range HRTEM_REFN does not exist You usually get this error whilst trying to post costs from Training

and Events to Controlling. The solution is to create an external

number range - but don't tick the "External" tickbox

Payroll

Change too far in payroll past Appears if you want to change

an infotype relevant to retroactive

Page 60: 92825062 Overview ABAP HR

accounting and the start date for this

infotype lies before the earliest

retroactive accounting limit

Employee not selected during payroll run Check that you have chosen the

correct payroll area on the selection

screen. Check that the employee is

active in the payroll period that you

have chosen.

No entry in table T529Q for period modifier 03 for time 01.04.2001-06-20 This error message is misleading as

this table does not exist. It actually

points to table T549Q which in turn

points to table T510W. This table

holds the link between the payscale

type and area and the period

parameter. The permissible entries

may point to a weekly period

parameter - which is fine for weekly

employees. Get the monthly

combinations to point to a monthly

period parameter eg 51 - GB Monthly.

Deletion forbidden Results has been posted with posting run <nnnnnnnn> An error occurs when attempting to delete employee's records whose payroll results have been posted to finance.

Using transaction PU03, ensure the Accounted To, Earliest MD change and Recal.follow-up prog dates have been removed.

Using transaction PU00, select all infotypes and delete the employee.

T100S & T100C - hold the information relating to the SAP standard error messages. You can change the error messages from an E to a W. When creating or changing a message in T100C make sure that you do not fill in a user name - leave the field blank - otherwise it will only be specific to that particular user.

General Payroll Error Messages

NCALE “P” eriod mark missing on dd.mm.yyyy

Run Transaction PC00_M08_CONV

As part of GBSXP phase II in the UK, program Z_FILL_NCALE has been replaced with standard programRPLABSG0_SXP_OXP_CONV (transaction code is PC00_M08_CONV).

This needs to be run as part of the absence Data Take on process to fill tables AVERAGE and NCALE.

Page 61: 92825062 Overview ABAP HR

Payroll calendar T549Q invalid (permo/yr/per)

Error message in GCRTO of Gross to Net stating Multiple Employment: Court Order amounts from OTHER contracts. Other contracts do not and have never had court order payments. Error due to multiple employments being linked but not overlapping in a time period, therefore, they are not true multiple contracts, rather separate periods of employment (i.e. one contract finished before the next one starts). IT0121 and IT031 have been deleted from the employments and employees rerun through payroll.

In addition, where a court order is maintained, this is copied across all contracts, even if those contracts have been terminated. Had to set the run up to date as the end date of the previous period and run GLK0. Then clear run up to date and run through the primary contract.

Multiple employee has a terminated employment that needs to be run through payroll. Enter the last day of the period being run in the „run payroll up to‟ field in IT0003.

Also check ME consistency report. For the UK, all contracts need IT0065 and IT0069 to process through payroll.

The official fix for this error is contained in HRSP 40/41 for version 4.7.

Company code xxxx is not assigned to an FM area

This error is due to a configuration setting in Financial Accounting.

Table T549s should not be changed after payroll run (payroll area)

If the multiple employment solution is used, changes to the table with pay dates (T549S) are no longer allowed after the payroll for the period has been run. Make sure that table T549S is changed back to the initial configuration (which is reflected in the payroll results). This can occur when you have multiple employments across different payroll areas which SAP does not support. It can also occur when the employee has results from one payroll area and then changed payroll area over the same period – results across different payrolls for the same period are not permitted.

Wage type /010 must be in table IT to perform offsetting on 02.08.2004

Failure in processing of GBSXP. SAP cannot derive a daily rate for this employee to calculate SSP/OSP entitlement. Check IT0008 record. Likelihood there is no basic pay to derive a daily rate from or zero hours in IT0008.

Payroll Period for Contract nnnnnnnn Is Not Defined (01.08.2006 - 31.08.2006)

Highlighted employee is in a payroll area not set for paying. This can occur in a multiple employment scenario where one contract is in a paying payroll area and the other is in a non paying payroll area. SAP best practice says all linked contracts should be in the same payroll area.

Retroactive accounting date set by system, 26.07.2006, is before pers. EARLIEST RETRO. 01.08.2006 or

Employee has changed payroll areas before the end of a current period. For example, employee has moved from weekly paid to monthly paid and has moved out of the weekly paid payroll area before the end of a weekly period. Check Payroll area in IT0001 – may need to delete results and rerun.

Retroactive accounting date set by system, 01.04.2004, is before pers. EARLIEST RETRO. 01.04.2005

This employees earliest MD change is before go-live the person will be overpaid by up to a full year Unless payroll results are deleted.

Page 62: 92825062 Overview ABAP HR

Error when processing a particular wage type

wxyy name of wage type Termination in operation ERROR nnnnnnnn G0103***** ERROR Basic entry in IT : A Wage type APC1C2C3ABKoReBTAwvTvn One amount/one number Amo 3 wxyz name of WT wxyz 15. Current entry in OT:

Error in processing through PCR G010 (or customer copy of this). Happens where no value is maintained in processing class 01 against the wage type which is failing.

RGDIR import failed

Multiple employments linked across different payroll areas.

This period's taxable pay takes total year to date into a negative situation (Perhaps due to backdated changes in a previous tax year

Employee has deductions of some kind but no earnings or earnings that are less than deductions. Could be IT0014/IT0015 deductions or a cash AVC/loan.

Termination in operation ERROR nnnnnnnn G030****** ERROR # = = = = = = Basic entry in IT : A Wage type APC1C2C3ABKoReBTAwvTvn One amount/one number Amount * /134 Co.car: pa 99.00- Processing class missing on wage type /134.

Error during indirect calculation: Infotype 0014 subtype nnnn

Error message: “IndVal of wage type nnnn: No entry in table T510 for key '08CLC137005' on 01.04.2006”

Wage type nnnn is indirectly valuated but the value in infotype 0014 for this wage type is reading zero, or

The person concerned should not be receiving the allowance.

Error during indirect calculation: Infotype 0008 subtype 0 IndVal of wage type 1005: No entry in table T510 for key '08CMC11ADLRNTUT05' on 01.04.2005

Wage type 1005 in IT0008 has a value of zero.

Payroll period for contract XXXXXXXX is not defined

Page 63: 92825062 Overview ABAP HR

Employee is in a payroll area not defined for payroll processing.

/121 Taxable pay goes into a negative situation for an employee on the line:

PIT GGDN NOAB Interpret NI retro changes

Error in processing of GB Gross to Net in PCR GGDN – Interpret NI retro changes. Employee is a late leaver so it is trying to bring forward a negative taxable pay from a previous period. These situations are dealt with through schemaGRET.

If the employee is a multiple employment you will get a further error message. You can not run GRET (9RET) for multiple employments where one contract is still active. You need to create a wage type for a positive amount for the same value as the negative amount in the rejection and run the employee through the normal schema (9000). You then need to deduct this same amount from (one of) the remaining active employment(s). This will ensure the employee balances.

'Not the most recent period paid to this person'

This error occurs when payroll results for a later period exist for an employee. The solution is to remove the date in the “accounted to field” on IT0003 and run the schema GRET (or your customer equivalent).

Negative Payments ('NP' T7PBSDEC_WTGRP) don't include wage type XXXX

Failure in function XDEC due to missing wage type in wage type group NP. Wage type needs adding in to wage type group NP through transaction pu96.

Once having entered the transaction code go and find the relevant wage type and select it. You will notice that the line is now highlighted – as are all the other wage types which are relevant for the group NP. Save and transport through to PRD.

Payroll Go-Live date 01.04.2005 must equal period start date 28.03.2005 (Feature GBPLG)

Feature GBPGL is not set up properly for go live period. Feature GBPLG needs maintaining for each payroll area you are going live with. Date in feature should be the start date of the first period of go live.

DTO wage type TOFM not stored in IT0015 for first live payroll (27.03.2005 - 02.04.2005)

Employee has a maternity absence which spans the go live period. Both wage types TOFM and TOOM need entering with a date of the first date of the first period being run.

Same message for Adoption and Paternity absences but different wage types. Only required for go live.

ME SMP: Inconsistent SxP record between xx.xx.xxxx and xx.xx.xxxx (infotype 0088)

IT0088 should be copied across all contracts for multiple employment for consistency using a dynamic action which is part of the ME solution.

ME SMP: Inconsistent absence between xx.xx.xxxx and xx.xx.xxxx ME SMP: Inconsistent SxP record between xx.xx.xxxx and xx.xx.xxxx (infotype 0088)

An IT2001 SMP‟able absence has been extended without IT0088 being extended. Extended the IT0088 record in line with the 2001 entry and re-run through payroll.

SMP Error; Employee has no valid MATB1 form between 29.08.2006 and 28.08.2007 (IT0088)

Page 64: 92825062 Overview ABAP HR

Problem with IT0088. Check MATB1 date is correct.

Termination in operation ERROR

Rejection in G010 (or customer copy) when processing AWE override wage types AWEM, AWEA, AWEP, AWES through IT0014. This is because IT0014 is processed earlier in the schema than IT0015.

These wage types are required in IT0014 for DTO purposes.

Ensure processing class 01 = 0 and processing class 03 = 0 for these wage types.

(see SAP note 825164)

Wage type incorrectly reduced. A deduction wage type was not completely reduced by the amount in table DDNTK Wage type xxxx. Please check whether the wage type is still in table IT at the time of the PRDNT function (processing class 20).

Should be fixed by SAP note 794021. If the application of this note does not fix the error, it is possible that the wage type in error is missing a value in processing class 41. This value should be set to „3‟. Also check the priorities of deductions table V_T51P6.

Late Leaver processing not possible. Employment xxxxxxxx is still active on dd.mm.yyyy

Multiple Employment employee has a contract which is a late leaver. SAP does not support running schema GRET for a late leaver contract for multiple employment. If you process GRET you get the above error. SAP recommend that in this scenario, you maintain a value in a customer wage type which equates to a positive amount for the failure on the negative taxable amount (i.e. failure on negative taxable pay of –115.15; create a wage type for the amount of +115.05) on the late leaver contract and process through contract G000 (or copy of G000). Use the same wage type to deduct this amount from the active contract(s) and run through G000 (or copy of G000).

Enter rate / GBP rate type M for 01.04.2005 in the system settings

Wage type in IT0014 or IT0015 has been entered without a currency. Check config of wage type.

Late-leaver period; no payment made in error correction permitted

IT0793 has been entered for an employee who is a late leaver. Cannot use IT0793 to adjust NI refund for a late leaver – not supported as part of the NIPE functionality.

Wage type /011 must be in table IT to perform offsetting on 13.11.2005

This is caused either by a claims based person who has had IT0088 and 2001 copied from another employment and has had no claims or the person has a 2001 sickness copied from another employment and has no IT0008 – delete IT0088 and the corresponding 2001 records from the claims based record or create the missing IT0008.

Employee has no Date Specification in Infotype 0041 for Date Type 01

Add the correct date for the date type specified in the above message.

Division by zero not performed Calculation rule xyz

Check that the wage type has been input correctly, in the above case an amount has been used instead of a

Page 65: 92825062 Overview ABAP HR

number and unit.

STOP: No rule in key 9060*0NIL< * * * *

Check absences on IT2001 - Absences that may only be unpaid for a full day have been entered as a half day.

Only certain absence types are allowed to be @ half pay.

Payroll Error Messages - NCALE

When running the NCALE fix with transaction PC00_M08_CONV you get a blank screen (i.e. no data in the list) you will need to check the errors by clicking on the “yellow lightning bolt” icon.

DTO check error: infotype 0014 contains no entry for AWEM (06.11.2005 - 17.12.2005)

Create the necessary AWEx entry mentioned in the error on infotype 0014 and delete/lock the AWEx entry on infotype 0015.

Also check and extend IT0088 if necessary.

SSP Error; Table PERIOD HISTORY contains no entries for absence 13.11.2005 - 24.12.2005

Re-process the employee through payroll after checking that the Master Data Change Date (IT0003-RRDAT) has been updated to re-process this date. (13.11.2005)

Costs table is empty for period 200601, run in period 200605

Costs table in XDEC has not been filled for a previous period.

Run transaction SA38 in the program command and enter the program as RPUDECG0PBS_FILL_COSTS for a single employment and RPUDECG0PBS_FILL_COSTS_ME for multiple employments

Enter in periods to be updated and employment numbers as well as appropriate dates to start dates for conversion.

Inconsistency exists between table RT and COSTS for wage type nnnn

Failure in function XDEC on a pension wage type. Pension record in IT0071 changed relating to a period for which costs have already been apportioned in table COSTS. Ie employee has results in a period, which has then been exited. Backdated pension changes causing a retro calculation, which cannot reconcile table RT with table COSTS.

There is a cost distrib.of 50.00% without company code from 01.09.2004 to 30.09.2004

Employee is assigned to 2 positions simultaneously, one of which does not have a cost centre and/or company code associated with it, therefore, costs can not be distributed across all cost centres.

Infotype 0007 does not exist or is incomplete for 01.08.2006

Where an employee with linked multiple employments exists but one or more of those other linked employments does not have a defined work schedule. Go and create the infotype 0007 (planned working time) for the relevant employment.

GBSXP X Process Statutory Absences (Factored Up)

Page 66: 92825062 Overview ABAP HR

4 Input Processing U / 000 Average Weekly Earnings calculation for personnel number nnnnnnnn U Message (000) (language EN) not found

Data issue due to linked employments across different payroll areas with different period modifiers. This situation is not allowed in SAP as it will cause inconsistent payroll results.

Jump from DAYPR to detailed log. Incorrect generation of wage types

Error where no entry in counting class for Daily Work schedule in T551C. To see the error, check time processing log inRPCALCG0 and double click „Jump to DAYPR to detailed log‟. This will take you to the error stored in Time Evaluation.

Wage type /010 must be in table IT to perform offsetting on 06.04.2005 SSP QDP; No qualifying days 24.04.2005 - 30.04.2005. QDP defaulted to Wednesday

SSP QDP; No qualifying days 24.04.2005 - 30.04.2005. QDP defaulted to Wednesday SSP QDP; No qualifying days 24.04.2005 - 30.04.2005. QDP defaulted to Wednesday SSP QDP; No qualifying days 24.04.2005 - 30.04.2005. QDP defaulted to Wednesday SSP QDP; No qualifying days 24.04.2005 - 30.04.2005. QDP defaulted to Wednesday SSP QDP; No qualifying days 24.04.2005 - 30.04.2005. QDP defaulted to Wednesday SSP QDP; No qualifying days 24.04.2005 - 30.04.2005. QDP defaulted to Wednesday SSP QDP; No qualifying days 17.04.2005 - 23.04.2005. QDP defaulted to Wednesday SSP QDP; No qualifying days 17.04.2005 - 23.04.2005. QDP defaulted to Wednesday SSP QDP; No qualifying days 17.04.2005 - 23.04.2005. QDP defaulted to Wednesday SSP QDP; No qualifying days 17.04.2005 - 23.04.2005. QDP defaulted to Wednesday

Employee has no IT0007 record or a IT0007 record with no working days. SAP is trying to calculate a daily rate for SSPbut employee is not scheduled to work on the days where an absence is recorded.

Wage types /011, /012 and /013 will be issued for the same reason but Maternity, Paternity and Adoption absences.

Calculate first non-primary contract nnnnnnnn for primary contract nnnnnnnn

You will see an error message in the payroll log along the lines of “calculate first non-primary contract nnnnnnnn for primary contract nnnnnnnn”. In essence you have tried to process the primary employment first – without having any results for one of the secondary employments. All non-primary contracts need processing before the linked primary contract.

Multiple employment employee without a primary employment (dd.mm.yyyy – dd.mm.yyyy)

The employee number missing from field P0121-RFPN4. This can occur where a primary contract record is removed/deleted or changed after the payroll has initially calculated results for the employee. When the primary employment is deleted, SAP has removed all reference to the employee number including the entry from field RFPN4. A new primary employment needs to be assigned.

Change the control record back to a previous period, delete the earliest dates in IT0003 and then set the control record back and reprocess the payroll.

Multiple Employment employee with an inactive primary employment (dd.mm.yyyy -

Page 67: 92825062 Overview ABAP HR

dd.mm.yyyy)

• An employment that has left is assigned as the primary; • Or, this employment number is maintained in IT0121 after their leaving date. Ensure that when an employment leaves, IT0121 is delimited for this employment and the newly created IT0121 does not contain this number. All linked employments are rejected from Payroll in this scenario; • Or, IT0121 record is valid from a start date after the primary employment left Where all contracts are terminated, ensure that one terminated primary contract remains with an end date of 31.12.9999 in IT0121. Any date less than 31.12.9999 will cause an error in payroll.

Payroll constant ELGWK not found on 00.00.0000 in T511K (country grouping 08)

Inconsistency between IT0088 on Multiple employment contracts

No multiple employment NI calculation if late leaver and late starter

If an employee holds more than one contract NI calculation is restricted to cases in which the individual contracts will be not a late starter and a late leaver at the same time. If this occurs (as in the present case) master data has to be adjusted to prevent the occurence of a late starter and late leaver at the same time. Check IT0001 to ensure the start and end dates do not correspond to late starter and late leaver period.

ME transfer error: Total Gross mismatch (Cost NI Payment 7748)

Run program RPUDECG0PBS_FILL_COSTS_ME via transaction SE38, This will fill the cost tables and solve the XDEC error.

According to control record for PArea TA, payroll is not completed

Payroll period for which you are trying to post has not been exited. Period needs to be exited through PA03.

/565 Carry-over for subs.month

IT0009 bank details are missing – update bank details and re-run

SAPDBPNPCE SAP Report - PNPCE Logical Database: Database Program

SAPDBPNPCE is a standard ABAP report available within your SAP system (depending on

your version and release level). Below is the standard documentation available for this

report and a few details of other objects it interacts with such as tables, function modules,

includes etc. If you would like to see the full code listing simply enter the object name(

SAPDBPNPCE ) into the relevant SAP transaction such as SE38or SE80

Within the comments section below there is also an opportunity for anyone to be able add

useful hints and information specific to this SAP object. This means that you and other users will be able to find these details quickly by simply searching on the object name.

SAP Documentation for program SAPDBPNPCE

Page 68: 92825062 Overview ABAP HR

PURPOSE

The PNPCE logical database supports the evaluation of HR master data. It includes the functions of the PNP logical

database and offers additional evaluation options. Therefore, you should use the PNPCE logical database instead of

the PNP logical database for all new developments.

The enhanced functionality of PNPCE in comparison to PNP essentially concerns the evaluation of Concurrent

Employment, that is, the possibility to group evaluate several assignments/personnel numbers of a person. The new

events 'GET PERSON' and 'GET GROUP' as well as an enhanced syntax for the INFOTYPES statement (addition

AS PERSON TABLE) for the procurement of infotype data enable you to use the new functionality. The use of these

new functions is optional. You can run a PNPCE report that does not use the new events and the addition for the

INFOTYPES statement in a PNP-compatible session. Since the PNPCE also has an improved selection screen, each

report benefits from this even if the report does not use the functions for evaluating Concurrent Employment.

PREREQUISITES

A report that wants to use the PNPCE must enter this in its report attributes under Logical database.

In addition, the PERNR structure must be declared in the report using the 'TABLES PERNR' statement. You can only

use the PERNR structure again in certain circumstances. The use of the 'GET PERNR' event is therefore forbidden.

Instead, use the 'GET PERAS' event. Except for the PERNR-PERNR component, all other components of the

PERNR structure are no longer filled and have initial values. This kind of programming (with the exception of PERNR-

PERNR) is therefore not permitted.

In addition to the 'GET PERAS' event, you can also use the 'GET PERSON' and 'GET GROUP' events. To be able to

use these events, you must declare them using the NODES statement ('NODES PERSON', 'NODES GROUP', or

'NODES PERAS').

Explanation of Terms

If the 'GET PERSON' and 'GET GROUP' events and the 'AS PERSON TABLE' addition for the INFOTYPES

statement are not used, the report indicates that it does not require the functionality for evaluating Concurrent

Employment. In this case, the report runs in a PNP-compatible session. This is referred to as PNP mode in the

following documentation. On the other hand, if the report uses the functionality for evaluating Concurrent Employment

we refer to CE mode.

FEATURES

Process of an Evaluation

The PNPCE selection screen offers you as standard a range of functions that you can use to restrict the personnel

number and person selection. These are discussed in more detail in the following sections. The process is initially as

follows regardless of whether the report runs in CE or PNP mode. All available functions and selection conditions

leads to the selection of personnel numbers. If you use the sorting function, this set of personnel numbers is then

sorted according to the sort criteria you selected. In PNP mode, the GET PERAS event is triggered as a result for

each personnel number.

In CE mode, the persons belonging to the personnel numbers are determined first for all personnel numbers

selected. The GET PERSON event is then triggered for each person. The person ID is specified in the OBJID

component of the PERSON structure. PERNR_NUM contains the total number of personnel assignments (=

personnel numbers) that this person has and the ALL_PERNRS table, which contains a list of these personnel

numbers regardless of whether they were actually selected or not. The SELECTED flag is set to X for the personnel

numbers selected. The flag is initial for all personnel numbers that are not selected. The PROCESS flag specifies

whether the personnel number should be processed in the rest of the process. This flag is set to X by default for the

personnel numbers selected. However, the report can set or delete this flag at the GET PERSON event for all

personnel numbers. In this way, report and logical database communicate with each other which enables the report

to control the rest of the process.

In the next step, the logical database groups all personnel numbers of a person that are to be processed (that is, all

personnel numbers that have the PROCESS flag set). The report can control the type of grouping using the

PNPCE_GROUPING_FROM_PAYROLL flag (normal or payroll grouping) and using the PNPGPRSN (grouping

reason) and PNPGPVAL (grouping value) parameters of the selection screen. The GET GROUP event is triggered

for each group of personnel numbers determined. The GROUPING_REASON and GROUPING_VALUE components

contain the grouping reason and grouping value of this group. The number of personnel numbers that belong to this

Page 69: 92825062 Overview ABAP HR

group and that are processed subsequently is in PERNR_NUM. The included ALL_PERNR table contains a list of

these personnel numbers with additional information. The SELECTED flag specifies whether the current personnel

number was originally selected (flag is set) or was marked by the report as to be processed. GROUPING_BEGDA

and GROUPING_ENDDA contain the validity period that the personnel number has for this grouping. The

NO_AUTHORITY flag is set if there is insufficient authorization for a personnel number. This personnel number is not

processed further. The SORT component defines a standard sort order for the personnel numbers of a group. The

report can change this by overwriting the values. In this way, report and logical database communicate with each

other, which controls the further pr

ocessing sequence of the personnel numbers.

The GET PERAS event is then triggered for all personnel numbers of the group (with the exception of the personnel

numbers for which no authorization exists) in the sequence defined by the SORT component (see above). The

SELECTED, GROUPING_BEGDA, and GROUPING_ENDDA components have the same meaning here as with the

GET GROUP event. The PROCESSED_BEFORE flag specifies whether the personnel number has already been

processed once before (it is possible that the personnel number belongs to several groupings and has been therefore

been processed several times).

Sort Order

You can sort the list of selected personnel numbers using the Sort function in the application toolbar. You can choose

to include up to seven fields from infotype 0001 for the sort. Since several data records can exist for infotype 0001 for

a personnel number, you also need to specify for period evaluations (not the case for key date evaluations) whether

the sort should take place according to the values of the last or of the first data record in the person selection period.

In PNP mode, the sorted sequence determines exactly the sequence in which the GET PERAS event is called. In CE

mode, the sort determines the sequence in which the GET PERSON event is called. The list of persons is created

based on the (sorted) sequence of personnel numbers. If only one person exist for each selected personnel number,

the sequence of persons corresponds exactly to the sequence of personnel numbers. However, if several selected

personnel numbers lead to the same person, only the first personnel number determines the sort sequence of

persons. All other personnel numbers only determine the sequence in which the GET PERAS event is subsequently

called. Provided that the report does not require the personnel numbers to be resorted by manipulating the SORT

component at the GET GROUP event (see above), the GET PERAS event is called for the personnel numbers of a

person in the sequence in which the personnel numbers were (originally) sorted.

Retrieving Infotype Data Records

As well as triggering the GET PERSON, GET GROUP, and GET PERAS events, the logical database also provides

the data records of the infotypes that are requested using the INFOTYPES statement. In the report, you must specify

the INFOTYPES statements where the variable declarations are made. You should do this in any case before the first

code is entered.

In principle, there are three types of INFOTYPES statements:

INFOTYPES nnnn

The nnnn infotype is provided with the data records of the current personnel number at the GET PERAS event. Only

the data records that are in the evaluation period specified in the selection screen are provided ( this is different to

PNP, which provides all data records by default). Alternatively, the report can specify which data records are to be

provided using the RP_SET_DATA_INTERVAL, RP_SET_DATA_INTERVAL_INFTY, and

RP_SET_DATA_INTERVAL_ALL macros.

INFOTYPES nnnn AS PERSON TABLE

The nnnn infotype is provided at the GET GROUP event with the data records of all personnel numbers that are in

the included ALL_PERNRS table (of the GROUP structure) and for which authorization exists (NO_AUTHORITY flag

is not set). Only the data records that are in the evaluation period specified in the selection screen are provided.

Alternatively, the report can specify which data records are to be provided using the RP_SET_DATA_INTERVAL,

RP_SET_DATA_INTERVAL_INFTY, and RP_SET_DATA_INTERVAL_ALL macros.

INFOTYPES nnnn AS PERSON TABLE MODE P

The nnnn infotype is provided at the GET PERSON event with the data records of all personnel numbers that are in

the included ALL_PERNRS table (of the PERSON structure). No authorization check is performed and all existing

data records are provided independent of how the evaluation period is defined in the selection screen. The use of the

RP_SET_DATA_INTERVAL, RP_SET_DATA_INTERVAL_INFTY, and RP_SET_DATA_INTERVAL_AL macros also

has no influence here.

Page 70: 92825062 Overview ABAP HR

Selection Options

You can use all the functions and selection options in the selection screen (initially) to select personnel numbers

regardless of whether the report is running in PNP or CE mode. Only in CE mode, the persons belonging to these

personnel numbers are then determined. The functions that PNPCE provides to restrict the selection are described in

the following. The environment in which these functions are actually used depends on the report and its report

category. You can assign a report category to a report in maintenance of report attributes (SE38, Attributes, Change

button -> HR report category button). The customer can override this assignment. To do so, perform the Assign

Report Categories Customizing activity under 'Personnel Management' -> 'Human Resources Information System' ->

'Reporting' -> 'Adjusting the Standard Selection Screen'. Follow the same path to define and change report categories

in the Create Report Categories Customizing activity. Since the PNP logical database also uses the concept of report

categories, ensure that you assign only one report category that is created specially for the PNPCE database to a

PNPCE report.

Selection Fields of the 0000 and 0001 Infotypes

You can use all the standard fields of the 0000 and 0001 infotypes for selection. You can also use additional selection

fields that are the concatenation of two or more of these infotype fields. If possible, do not use these concatenated

fields because they do not play a significant role in the selection and can lead to long runtimes in certain

circumstances. You can show and hide the required selection fields using the Selection Fields function in the

application toolbar. The report category defines a preselection of fields that should be available.

Dynamic Selections

The dynamic selections enable you to select according to any infotype fields and, in particular, according to

customer-specific infotype fields. You can show and hide the dynamic selections using the Dynamic Selections

function in the application toolbar. The report category controls whether this appears as a dialog box or inplace, that

is whether the dynamic selections are supported at all. The basis for the dynamic selections is a selection view that

defines which infotypes and which fields can be used for selection. You can define the selection view in the ABAP

Workbench. You must choose For any table as the type of selection view (the For logical database type is not

permitted although you may have presumed differently at first). The report category is used to control which selection

view is used for the dynamic selections. If you use the dynamic selections, the Restrict by OrgStructure, Search Help,

and Selection ID functions are not available.

Restrict by OrgStructure

You can also select personnel numbers by their position in the organizational structure. To do so, you use the

OrgStructure function in the application toolbar. This button displays the organizational structure. Here you can select

the organizational units to which the personnel numbers to be selected should belong. It is insignificant if the

personnel numbers are assigned to the selected organizational unit directly or to one of its subordinate organizational

units. If you restrict the selection by organizational structure, the Dynamic Selections, Search Help, and Selection ID

functions are not available.

Search Help

You can use the included search helps of the PREM collective search help by clicking Search Help function in the

application toolbar. You can also add customer-specific search helps here. For a description of how to do this, see

the Customizing for Personnel Management -> Personnel Administration -> Basic Settings -> Maintain Search Helps.

If you use a search help, the Dynamic Selections, Restrict by OrgStructure, and Selection ID functions are not

available.

Selection ID

You can also restrict the number of personnel numbers to be selected using a predefined selection method called a

Selection ID. For information on how to use and create selection IDs, see the Define Selection IDs Customizing

activity under 'Personnel Management' -> 'Human Resources Information System' -> Define Selection IDs. How

you Specify Groupings of selection IDs is also described here. The selection IDs whose grouping is stored in the

report category are available to you for selection on the PNPCE selection screen. When you select a selection ID, it is

always performed. This happens either explicitly when you press the button (behind the selected selection ID), or

implicitly when output starts (F8). If you use a selection ID, the Dynamic Selections, Restrict by OrgStructure, and

Search Help functions are not available.

Evaluation Period

The PNPCE (and the PNP) differentiates between the data selection period and the person selection period. Both

these periods are summarized in the term evaluation period. Whereas the person selection period affects the

Page 71: 92825062 Overview ABAP HR

selection of personnel numbers, the data selection period controls the retrieval of data requested by the INFOTYPES

statement. You can configure both separately on the selection screen by selecting an appropriate entry in each list

box. Alternatively, you can set up both selection periods at the same time using a common list box. You can control

which entries are in the list boxes (that is which evaluation intervals are supported) using the report category. The

person selection period you have set up is taken into consideration when the personnel numbers are selected. Only

the personnel numbers are selected that fulfill the selection conditions on at least one (key) date in the specified

person selection period. All data records of the requested infotypes that are valid on at least one (key) date in the

specified data selection period are retrieved by default for these personnel numbers. You can set up a different

procedure using the RP_SET_DATA_INTERVAL, RP_SET_DATA_INTERVAL_INFTY, and RP_

SET_DATA_INTERVAL_ALL macros. Retrieving data records for infotypes that were defined by the AS PERSON

TABLE MODE P addition is an exception. In this case, all data records are retrieved independent of the data

selection period.

The payroll period should be considered as a special feature for the evaluation period. You can select either the

current payroll period or another payroll period. You must enter the payroll area in both cases. The evaluation period

is calculated from these specifications. This interval is used as evaluation period (as person selection period and as

data selection period) for the further (internal) processing.

The report can query the evaluation period used via the PN structure. The BEGDA and ENDDA contain the data

selection period whereas BEGPS and ENDPS contain the person selection period. Inversely, the report can also set

the data and person selection period explicitly. The report must also fill the relevant components of the PN structure

at the START-OF-SELECTION event. This is only meaningful if the manual maintenance of the evaluation period was

hidden using the report category.

Communication Between Report and PNPCE

The DBPNPCECOM include is an element of the PNPCE logical database. This is automatically included in each

report that is based on PNPCE. The common part defined in this include means that the report and PNPCE have a

common data area. This data area enables the data exchange for communication between the report and PNPCE. All

switches that can be used by the report to control the process of PNPCE are defined here. The DBPNPCECOM

include also contains a number of macros that PNPCE uses to make additional functions available to the report. Most

of these macros were adopted by PNP and defined there in the DBPNPMAC include. Additional macros still exist in

the TRMAC table, which has in the meanwhile become obsolete. Do not use these macros for any purpose. You can

find all the macros defined in PNP that affect the functionality of the logical database in the DBPNPCECOM include.

They have a slightly different spelling; underscore_ instead of hyphen-, for example RP_PROVIDE_FROM_LAST

instead of PROVIDE-FROM-LAST. Some of the TRMAC macros in the DBPNPCECOM include were redefined with

the same spelling but without the functionality so that any incorrect use (of the TRMAC macros) leads to a syntax

error and is therefore excluded.

The following describes the functions made available by the switches and macros defined in the DBPNPCECOM

include. For information about the exact syntax for calling a macro in view of its parameters and type specifications,

see the definition of the macro in the DBPNPCECOM include.

Evaluation Period in the PN Structure

The PN structure contains information about the evaluation period for which the evaluation is started regardless of

how this is specified on the selection screen. A report should access the fields of the PN structure only if it requires

this information and should not access the PNPBEGDA, PNPENDDA, and other selection fields of the selection

screen.

The PN-BEGPS and PN-ENDPS fields contain the person selection period for which the personnel number selection

was performed. The PN-BEGDA and PN-ENDDA fields contain the data selection period. If you have specified the

evaluation period using a payroll period, PN-PABRP contains the payroll period, PN-PABRJ the payroll year, and PN-

PERMO the period parameters. The payroll period and payroll year are also in PN-PAPER.

The report can also fill the PN-BEGDA, PN-ENDDA, PN-BEGPS, and PN-ENDPS fields with values at the START-

OF-SELECTION event and in doing so, specifies the evaluation period. In cases like this, it is not meaningful to have

this setting option on the selection screen and it should therefore be hidden using the report category. In addition, the

report must ensure that the values specified are valid since there is no longer a validation of these values.

Setting the Data Selection Period: RP_SET_DATA_INTERVAL, RP_SET_DATA_INTERVAL_INFTY,

RP_SET_DATA_INTERVAL_ALL

Page 72: 92825062 Overview ABAP HR

The report uses the INFOTYPES statement to request infotype data records that are read and made available by

PNPCE. The report can specify that it only requires data records that are valid in the specified period using the

'VALID FROM .. TO ..' addition. Unfortunately, you cannot use the 'VALID FROM .. TO ..' addition in most cases

because it does not accept dynamic date specification. It only accepts constants. If you do not use the 'VALID FROM

.. TO ..' addition, PNPCE returns all data records that are in the specified data selection period on the selection

screen by default. If this is not required, the report can call the RP_SET_DATA_INTERVAL,

RP_SET_DATA_INTERVAL_INFTY, and RP_SET_DATA_INTERVAL_ALL macros to restrict the infotype data

records to a different validity period. The RP_SET_DATA_INTERVAL macro sets the validity period for an individual

infotype whose name you specify in the first parameter. Do not confuse the name of the infotype, P0001 or PP0001

for example, with the number of the infotype 0001. You specify the validity period in the second and third parameters.

You should use the RP_SET_DATA_INTERVAL_INFTY macro in the same way but instead of entering the name in

the first parameter, enter the number of the infotype. Since the same infotype can be used several times (under

different names) when you use the INFOTYPES additions 'AS PERSON TABLE' or 'NAME ...', this macro sets the

validity period for all infotypes of the same number. In contrast, the RP_SET_DATA_INTERVAL_ALL macro only has

the validity period as a parameter and sets this for all infotypes used.

Setting the Mode of an Infotype: PNP_SET_INFTY_MODE_BY_NAME, PNP_SET_INFTY_MODE_BY_NUMBER

The INFOTYPES statement can use the MODE addition to control whether the infotype should be processed and

how this should proceed. If the addition is not used, this corresponds to a MODE Y and the PNPCE logical database

reads the infotype and places it in the internal infotype table. MODE N enables the internal infotype table to be

declared but no infotype data records are read by the PNPCE logical database. MODE P can only be used together

with the 'AS PERSON TABLE' addition and causes all infotype data records of all personnel numbers of a person to

be read at the GET PERSON event without authorization check or period restriction. The report can use the

PNP_SET_INFTY_MODE_BY_NAME and PNP_SET_INFTY_MODE_BY_NUMBER macros to change the MODE

specified by the INFOTYPES statement (dynamically) at runtime. The macros must be called at the INITIALIZATION

or START-OF-SELECTION events. The PNP_SET_INFTY_MODE_BY_NAME macro sets the MODE for an

individual infotype whose name you specify in the first parameter. Do not confuse the name of the infotype, P0001 or

PP0001 for example, with the number of the infotype 0001 You should use the

RP_SET_INFTY_MODE_BY_NUMBER macro in the same way but instead of entering the name in the first

parameter, enter the number of the infotype. Since the same infotype can be used several times (under different

names) when you use the INFOTYPES additions 'AS PERSON TABLE' or 'NAME ...', this macro sets the MODE for

all infotypes of the same number.

Reading Time Management Infotypes: RP_READ_ALL_TIME_ITY, RP_READ_ALL_PERSON_TIME_ITY

Time management infotypes (2000-2999) often contain a large number of data records, particularly if positive

recording is implemented. If a dataset that is too large is requested using the INFOTYPES statements, this can lead

to performance problems or in an extreme case, to memory overflow. For this reason, there are the

RP_READ_ALL_TIME_ITY and RP_READ_ALL_PERSON_TIME_ITY macros, which can be used to read time

management data in a targeted manner. The time management infotypes are defined by the INFOTYPES statement

with the MODE N addition. This enables the internal infotype table to be declared but no data is read (at the moment)

by the PNPCE logical database. The report can then decide at the GET GROUP and GET PERAS events whether it

wants to read the time management data and for which period. At the GET GROUP event, the report can call the

RP_READ_ALL_PERSON_TIME_ITY macro to read all time management data on the personnel numbers of a

person that should be processed. In other words, the time management data that is in the included ALL_PERNRS

table of the GROUP structure. The data is then written to the infotypes that were declared by the INFOTYPES

statement with the AS PERSON TABLE addition.

However, at the GET PERAS event, the report can call the RP_READ_ALL_TIME_ITY macro to read the time

management data on the current personnel number. In both cases, you must specify the period in which the data

records should be valid when the macro is called. The PNP-SW-IGNORELOCKEDRECORDS switch is also taken

account of in both cases and controls whether locked data records are read or not. In addition, an authorization check

is performed for all data records. If no authorization exists for a data record, this data record is rejected (that is, it is

not placed in the infotype table). If data records are rejected because of missing authorization, the PNP-SW-AUTH-

SKIPPED-RECORD global switch is set to 1. This switch is otherwise set to 0.

Locked Data Records: PNP-SW-IGNORELOCKEDRECORDS

In HR master data maintenance, you can lock individual infotype data records. These data records are normally

ignored during evaluations using PNPCE. If you set the PNP-SW-IGNORELOCKEDRECORDS switch to N (at the

Page 73: 92825062 Overview ABAP HR

INITIALIZATION or START-OF-SELECTION events), the report can however instruct PNPCE to read locked data

records too.

Authorization Check: PNP_SW_SKIP_PERNR, PNP_GET_AUTH_SKIPPED_PERNRS

The PNPCE logical database performs an authorization check for all infotype data records that are requested by the

report using the INFOTYPES statement. If no authorization exists for even one individual data record of one of the

infotypes used, processing of the personnel numbers is terminated by default. In PNP mode, this means that the GET

PERAS event (for the personnel number) is skipped. The report is only aware of this if it then (if possible at the END-

OF-SELECTION event) calls the PNP_GET_AUTH_SKIPPED_PERNRS macro, which returns a list of the skipped

personnel numbers.

In CE mode, the NO_AUTHORITY flag is set in the included ALL_PERNRS table at the GET GROUP event, which

indicates to the report that no authorization exists. The following event, GET PERAS, is also not executed for this

personnel number. As in PNP mode, the report can get a list of the personnel numbers for which no authorization

exists using the PNP_GET_AUTH_SKIPPED_PERNRS macro.

You can enter different settings using the PNP_SW_SKIP_PERNR switch. If you set this switch (at the

INITIALIZATION or START-OF-SELECTION events) to N, no more personnel numbers (without authorization) are

skipped. Only the data records for which no authorization exists are rejected (that is, not made available). The report

has no way of knowing that data records are being withheld from it.

Mass Access By Array-Fetch: PNPCE_ARRAY_FETCH_SIZE

The infotype data records are not read for each personnel number individually but in a mass access for several

personnel numbers simultaneously. This reduces the number of database accesses and performance can be

considerably improved. You cannot read the infotype data records of all personnel numbers at once since this can

lead to problems with memory space depending on the number of selected personnel numbers and existing data

records. For this reason, the personnel numbers are segmented into blocks of a fixed size and the personnel

numbers of a block are always read together. The size of the block is set to 100 by default (this means that the

personnel numbers from 100 persons are processed at the same time). The report can change this setting using the

PNPCE_ARRAY_FETCH_SIZE switch at the INITIALIZATION or START-OF-SELECTION event. Be very careful if

you change this value. If the value is set too high, it can lead to a memory overflow. If the value is too low,

performance is affected. You must choose a suitable value based on the number of requested infotypes and their

expected datasets.

Locking Persons/Personnel Numbers

By default, the logical database does not lock any personnel numbers or persons. However, the report can request

this. In CE mode, the report must set the PNPCE_ENQUEUE_PERSONS switch to X. This enables the LDB to set

locks for all personnel numbers of a person. The person is regarded as locked and is processed further only if all

personnel numbers have been successfully locked. Otherwise, they are skipped. It is the reports task to remove this

lock. To do so, the report calls the PNPCE_DEQUEUE_PERSON macro by specifying the person ID. Persons that

could not be locked and were skipped are logged by the logical database. After processing has finished, the report

can query this list using the PNPCE_GET_ENQ_FAILED_PERSONS macro. However, not all persons are logged,

only the first N persons. The report can find out how many this is exactly using the

PNPCE_LOG_ENQ_FAILED_PERSONS switch. 1 means that all persons should be logged. If the report calls the

PNPCE_GET_ENQ_FAILED_PERSONS macro, the total number of skipped persons is returned with the first N

logged persons.

In PNP mode, individual personnel numbers can be locked. The report (and PNP) must set the PNP-SW-

ENQUEUPERNR switch to Y to enable this. The report is here also responsible for unlocking the personnel numbers

and can call the PNP_DEQUEUE_PERNR macro for this by specifying the personnel number. The report can get a

list of the personnel numbers that could not be locked by calling the PNP_GET_ENQ_FAILED_PERNRS macro. Only

the first N personnel numbers and the total number of skipped personnel numbers are returned. The number of

personnel numbers that should be logged can be specified using the PNP_LOG_ENQ_FAILED_PERNRS switch. 1

means that all personnel numbers should be logged.

Determining the First Data Record in the Period: RP_PROVIDE_FROM_FRST

The RP_PROVIDE_FROM_FRST macro analyzes the infotype data records that were transferred in an internal table

to the macro with regard to the specified period. It places the first data record that is valid in the specified period (the

data record with the lowest ENDDA) in the header of the internal table. If no data record exists in the specified period,

the PNP-SW-FOUND global switch is set to 0. Otherwise it has the value 1. If the infotype contains subtypes, you

Page 74: 92825062 Overview ABAP HR

also need to specify the subtype for which the last valid data record should be determined. If you do not specify the

subtype, the result is undefined. In addition, the data records of the internal table must be sorted according to primary

key. The data records are sorted if the data records were determined by PNPCE logical database using the

INFOTYPES statement. Analyze the implementation of the macro if the exact functions of the macro are unclear. If in

doubt, do not use the macro. Instead implement a suitable solution for the report in question.

Determining the Last Data Record in the Period: RP_PROVIDE_FROM_LAST

The RP_PROVIDE_FROM_LAST macro analyzes the infotype data records that were transferred in an internal table

to the macro with regard to the specified period. It places the last data record that is valid in the specified period (the

data record with the highest ENDDA) in the header of the internal table. If no data record exists in the specified

period, the PNP-SW-FOUND global switch is set to 0. Otherwise it has the value 1. If the infotype contains subtypes,

you also need to specify the subtype for which the last valid data record should be determined. If you do not specify

the subtype, the result is undefined. In addition, the data records of the internal table must be sorted according to

primary key. The data records are sorted if the data records were determined by PNPCE logical database using the

INFOTYPES statement. A special feature of infotypes with time constraint 3 in this case is that the data record with

the highest ENDDA is not necessarily returned, but the first data record (if it exists) that is valid on the end date of the

specified period. Analyze the implementation of the macro if the exact functions of the macro are unclear. If in doubt,

do not use the macro. Instead implement a suitab

le solution for the report in question.

Reading Infotypes: RP_READ_INFOTYPE

The RP_READ_INFOTYPE macro reads the data records of an infotype for the specified personnel numbers that are

valid in the specified period, and writes these to the internal table specified. This table must be completed correctly. If

no data records exist in the specified period, the PNP-SW-FOUND global switch is set to 0. Otherwise it has the

value 1. In addition, an authorization check is performed for all data records. If no authorization exists for a data

record, this data record is rejected (that is, it is not placed in the internal table). If data records are rejected because

of missing authorization, the PNP-SW-AUTH-SKIPPED-RECORD global switch is set to 1. This switch is otherwise

set to 0. The PNP-SW-IGNORELOCKEDRECORDS switch is also taken account of when the data records are read

and controls whether locked data records are read or not.

Normally, infotypes are read using the HR_READ_INFOTYPE function module. The RP_READ_INFOTYPE macro

can improve performance when the data records have already been read by PNPCE and are in the internal buffer.

PNPCE only read the data records that were requested by the report using the INFOTYPES statement. In addition,

the buffer is deleted again at the latest after 100 processed personnel numbers. If however the report requests the

data records using an INFOTYPES statement, it is not particularly meaningful to request the data records again for

the same personnel number using the RP_READ_INFOTYPE macro. The buffer is only useful when the data records

are called for a different personnel number if these personnel numbers belong to the block of the 100 current buffered

personnel numbers. Always weigh up the advantages of this macro against the consequences of its use for

performance.

Excluding Withdrawn Employees: RP_SEL_EIN_AUS_INIT

If this macro is called at the INITIALIZATION event, only personnel numbers are selected that do not have the status

withdrawn in the specified person selection period. From a technical point of view, the select option PNPSTAT2

(STAT2 from infotype 0000) is filled with ' 0' for this. This is a default value for the selection condition displayed on the

selection screen that the user can change or delete at a later date.

Progress Indicator: PNPCE_NO_PROGRESS_INDICATOR, PNPCE_PROGRESS_BLOCK_SIZE

The PNPCE logical database uses the standard technique of displaying processing progress (process indicator). If

the report wants to set up its own progress indicator or does not want to have a progress indicator displayed, it can

switch this indicator off by setting the PNPCE_NO_PROGRESS_INDICATOR switch to X. The

PNPCE_PROGRESS_BLOCK_SIZE switch enables the report to control how often (that is, after how many

processed persons) the progress indicator should be updated. If the progress indicator is updated too often,

performance suffers.

Payroll Grouping: PNPCE_GROUPING_FROM_PAYROLL

If you set the switch to X, the grouping of personnel numbers (as returned at the GET GROUP event) should be

performed on the basis of payroll data.

Personnel Numbers Skipped Due to Error: PNP_GET_ERR_SKIPPED_PERNRS

A special logic for determining data records is implemented in PNPCE for certain infotypes. This is performed using a

Page 75: 92825062 Overview ABAP HR

function module (HR_COST_DISTRIBUTION_GET) for infotypes 0027 and 0266. In the case of an error, the function

module can trigger an exception. PNPCE reacts to an exception by terminating processing of the personnel numbers

for which the error occurred (that is, the PUT PERAS event is not triggered). If the report wants to know which

personnel numbers were skipped due to this error, it can call the PNP_GET_ERR_SKIPPED_PERNRS macro.

Comments

Headers of Infotype Tables

PNPCE fills the table body with infotypes defined by INFOTYPES. It does not fill headers. These are initialized.

Therefore, it is not permitted to program headers. This is in part different in the PNP logical database. In certain

cases, the header is also filled but in many cases it is not filled. Since this depends on various factors, which, in

particular, cannot be traced or controlled by the report, you are also not permitted to program headers.

Infotype Administration Table $RINFO$

In the $RINFO$ table, infotypes are managed that the report defines using the INFOTYPES statement. It is defined in

the DBPNPCECOM include so that the report also has access to this table. You are forbidden to manually modify this

table for the purpose of changing infotype characteristics by the report. Instead, use the macros that enable you to

set the infotype characteristics (set the MODE by PNP_SET_INFTY_MODE_BY_NAME and

PNP_SET_INFTY_MODE_BY_NUMBER; set the validity period by RP_SET_DATA_INTERVAL,

RP_SET_DATA_INTERVAL_INFTY, and RP_SET_DATA_INTERVAL_ALL).

Starting a PNPCE Report Using Preselected Personnel Number Set/Person Set

You can also start a PNPCE report using an externally predefined personnel number set. You must provide the

PNPINDEX parameter with the relevant personnel number when you call the report using SUBMIT. Since, technically

speaking, the select option for PNPINDEX is hidden, you must specify the personnel numbers in a RANGE structure

that consists of SIGN, OPTION, and LOW. For each personnel number, SIGN must contain the value I, OPTION the

value EQ, and LOW the personnel number. For SUBMIT, the range table should be transferred to PNPINDEX by the

IN operator.

Example:

RANGES: pernr_index FOR pernr-pernr.

CLEAR pernr_index.

pernr_index-sign = 'I'.

pernr_index-option = 'EQ'.

pernr_index-low = '00000815'.

APPEND pernr_index.

SUBMIT pnpce_report WITH pnpindex IN pernr_index.

If a set of personnel numbers is defined in this way, you cannot use the Dynamic Selections, Restrict by

OrgStructure, Search Help, and Selection ID functions to (further) restrict the set of personnel numbers. However, the

conditions entered for the selection fields of infotypes 0000 and 0001 are taken into account.

Similarly, you can start a PNPCE report with a specified set of persons. You must provide the PNPPERID parameter

with the relevant person IDs when you call the report using SUBMIT. Unlike PNPINDEX, PNPPERID is not a range

but is an internal table whose row type is the PERSONID data element.

Example:

DATA: personid_index TYPE STANDARD TABLE OF personid.

APPEND '00000815' TO personid_index.

SUBMIT pnpce_rerpot WITH pnpperid = personid_index.

If a set of persons is defined in this way, you cannot define a set of personnel numbers (using PNPINDEX) at the

same time. Also in this case, you cannot use the Dynamic Selections, Restrict by OrgStructure, Search Help, and

Selection ID functions to (further) restrict the set of personnel numbers.

Using Several Selection Options Simultaneously

In addition to selecting fields of infotypes 0000 and 0001 as described above, PNPCE offers six other options for

selecting personnel numbers. They are selection using dynamic selections, using organizational structure, using

search help, using selection ID, and by explicitly specifying a personnel number set in PNPINDEX or a person set in

PNPPERID when you call the report. These six options exclude each other, that is you can only use one of these

options at a time. Appropriate queries on the selection screen attempt to ensure this. It can happen in certain cases,

however, that more than one of these functions is used (for example, when you call the PNPCE report by explicitly

specifying a personnel number set in PNPINDEX as well as one of the variants to be used in which dynamic

Page 76: 92825062 Overview ABAP HR

selections were also stored). In this case, only one function, which is the first function used, is taken into account with

regard to the following sequence:

Dynamic Selections

Restrict by OrgStructure

Search Help

Selection ID

Explicit Specification or Personnel Numbers in PNPINDEX

Explicit Specification or Persons in PNPPERID

The personnel number set found this way is always restricted further by the selection conditions specified in the 0000

and 0001 infotypes.

Example

PNP Mode (without functions for evaluating concurrent employment)

TABLES: PERNR.

NODES: PERAS.

INFOTYPES: 0006 NAME P0006.

GET PERAS.

* table P0006 is filled with infotype 0006 data of PERNR

* stored in PERAS-PERNR

WRITE :/ PERAS-PERNR.

...

CE Mode (with function for evaluating concurrent employment)

TABLES: PERNR.

NODES: PERSON, GROUP, PERAS.

INFOTYPES: 0001 NAME ALL_0001 AS PERSON TABLE MODE P.

INFOTYPES: 0001 NAME PP0001 AS PERSON TABLE.

INFOTYPES: 0006 NAME P0006.

GET PERSON.

* table ALL_0001 is filled with infotype 0001 data of all PERNRs

* stored in PERSON-ALL_PERNRS without authority check !!!

WRITE :/ PERSON-OBJID.

...

GET GROUP.

* table P0001 is filled with infotype 0001 data of all PERNRs

* stored in GROUP-ALL_PERNRS

WRITE :/ GROUP-GROUPING_REASON, GROUP-GROUPING_VALUE.

...

GET PERAS.

* table P0006 is filled with infotype 0006 data of PERNR

* stored in PERAS-PERNR

WRITE :/ PERAS-PERNR.

...

Documentation extract taken from SAP system, Copyright (c) SAP AG

Page 77: 92825062 Overview ABAP HR

Includes used within report:

INCLUDE PAY_PROCESS_MODELL.

INCLUDE DBPNP_PNPCE_COMMON_FORMS.

* INCLUDE DBPNP_PNPCE_COMMON_DEFS

INCLUDE DBPNP_PNPCE_PLAN_FORMS.

* INCLUDE DBPNP_PNPCE_PLAN_DEFS

* INCLUDE DBPNP_PNPCE_COMMON_FORMS

INCLUDE DBPNP_PNPCE_AUTH_FORMS.

* INCLUDE DBPNP_PNPCE_AUTH_DEFS

* INCLUDE DBPNP_PNPCE_COMMON_FORMS

INCLUDE DBPNP_PNPCE_F4_FORMS.

INCLUDE DBPNP_PNPCE_LOG_FORMS. * INCLUDE RPC4PR00

Tables used within report and the associated select statement:

No SAP database TABLES are accessed within this report code!

Function Modules used within report and the associated call

statement:

No SAP FUNCTION MODULES are executed within this report code!

Text pool values

Selection Text: PNPGRANT = Grant

Selection Text: PNPGSBER = D Business Area

Selection Text: PNPJUPER = D Legal Person

Selection Text: PNPKOKRS = D Controlling Area

Selection Text: PNPKOKTL = Controlling Area/Cost Center

Selection Text: PNPKOSTL = D Cost Center

Selection Text: PNPMASNG = Action Type/Action Reason

Selection Text: PNPMASSG = Reason for Action

Page 78: 92825062 Overview ABAP HR

Selection Text: PNPMASSN = Action Type

Selection Text: PNPMSTBR = D Supervisor Area

Selection Text: PNPORGEH = D Organizational Unit

Selection Text: PNPOTYPE = D Object Type

Selection Text: PNPPABRJ = Period Selection: Year

Selection Text: PNPDISBD = Display: Payroll Period: Start

Selection Text: PNPDISED = Display: Payroll Period: End

Selection Text: PNPDISPJ = Display: Payroll Period: Year

Selection Text: PNPDISPP = Display: Payroll Period

Selection Text: PNPENAME = Employee Name

Selection Text: PNPENDDA = Data Selection Period: End

Selection Text: PNPENDPS = Person Selection Period: End

Selection Text: PNPEXPID = D Person ID

Selection Text: PNPFISTL = D Funds Center

Selection Text: PNPFKBER = D Functional Area

Selection Text: PNPGEBER = D Fund

Selection Text: PNPGPRSN = Grouping Reason

Selection Text: PNPGPVAL = Grouping Value

Selection Text: PNPSNAME = EE Name Can Be Sorted

Selection Text: PNPSTAT1 = Customer-Specific Status

Selection Text: PNPSTAT2 = Employment Status

Selection Text: PNPSTAT3 = Special Payment Status

Selection Text: PNPSTATU = Status 1/Status 2/Status 3

Selection Text: PNPSTELL = Job

Selection Text: PNPTIMED = Data Selection Period

Selection Text: PNPTIMES = Employee Selection Period

Selection Text: PNPVDSK1 = Organizational Key

Selection Text: PNPWERKS = D Personnel Area

Selection Text: PNPXABKR = Period Selection: Payroll Area

Selection Text: PNPXBWBK = Pers.Area/Subarea/Cost Center

Selection Text: PNPXPGPK = Employee Group/Subgroup

Selection Text: PNPPABRP = Period Selection: Period

Selection Text: PNPPERNR = D Personnel Number

Selection Text: PNPPERSG = D Employee Group

Selection Text: PNPPERSK = D Employee Subgroup

Selection Text: PNPPLANS = D Position

Selection Text: PNPSACHA = Payroll Administrator

Selection Text: PNPSACHP = Personnel Administrator

Selection Text: PNPSACHZ = Time Recording Administrator

Selection Text: PNPSASBA = Administrator Group: Payroll

Selection Text: PNPSASBP = Administrator Group: Personnel

Selection Text: PNPSASBZ = Administrator Group: Time

Selection Text: PNPSBMOD = D Administrator Group

Selection Text: PNPSELID = Selection ID

Selection Text: PNPBUKRS = D Company Code

Selection Text: PNPBTRTL = D Personnel Subarea

Selection Text: PNPBEGPS = Person Selection Period: Start

Selection Text: PNPBEGDA = Data Selection Period: Start

Selection Text: PNPANSVH = D Work Contract

Selection Text: PNPABKRS = D Payroll Area

Title: PNPCE Logical Database: Database Program

Page 79: 92825062 Overview ABAP HR

Text Symbol: 018 = Personnel Number

Text Symbol: 019 = Personnel Numbers

Text Symbol: 020 = Initializing...

Text Symbol: 021 = Processing...

Text Symbol: 022 = Dynamic Selections

Text Symbol: 025 = Key Date

Text Symbol: 026 = Period

Text Symbol: 031 = Period

Text Symbol: 032 = Payroll Period

Text Symbol: 033 = Reporting Set

Text Symbol: 034 = Limit by

Text Symbol: 017 = OrgUnits

Text Symbol: 016 = OrgUnit

Text Symbol: 015 = Grouping

Text Symbol: 013 = Person Selection

Text Symbol: 012 = Data Selection

Text Symbol: 011 = Reporting Period

Text Symbol: 009 = Selection Fields

Text Symbol: 008 = Selection Criteria

Text Symbol: 007 = Active

Text Symbol: 006 = Sort Order

Text Symbol: 004 = Payroll Area

Text Symbol: 002 = Period

Text Symbol: P11 = Special Run

Text Symbol: P10 = Other Payroll Period

Text Symbol: P09 = Current Payroll Period

Text Symbol: P08 = Future (as of today)

Text Symbol: P07 = Past (until today)

Text Symbol: P06 = Current Year

Text Symbol: P05 = Current Month

Text Symbol: P04 = Other Period

Text Symbol: P03 = All

Text Symbol: P02 = Key Date

Text Symbol: P01 = Today

Text Symbol: 047 = Payroll Type

Text Symbol: 046 = Evaluation Run

Text Symbol: 044 = Payroll Run

Text Symbol: 043 = Run

Text Symbol: 042 = Hide Person Selection Period

Text Symbol: 041 = Show Person Selection Period

Text Symbol: 040 = Execute

Text Symbol: 039 = Hide Dynamic Selections

Text Symbol: 038 = Dynamic Selections

Text Symbol: 037 = Period

Text Symbol: 036 = Search Help

Text Symbol: 035 = OrgStructure

SAPDBPNP SAP Report - Logical database PNP: Database program

SAPDBPNP is a standard ABAP report available within your SAP system (depending on your

version and release level). Below is the standard documentation available for this report and

Page 80: 92825062 Overview ABAP HR

a few details of other objects it interacts with such as tables, function modules, includes etc.

If you would like to see the full code listing simply enter the object name( SAPDBPNP ) into

the relevant SAP transaction such as SE38 or SE80

Within the comments section below there is also an opportunity for anyone to be able add

useful hints and information specific to this SAP object. This means that you and other users

will be able to find these details quickly by simply searching on the object name.

SAP Documentation for program SAPDBPNP

Note

In future, the PNPCE logical database should be used for new developments instead of the PNP logical database.

DESCRIPTION

The logical database PNP performs the following functions in Reporting:

provides the standard selection screen for the HR master data

makes the specified selections

checks whether the user has the necessary authorizations to read the data

The logical database is assigned to a report by maintaining the "Logical database PNP" report attribute.

The selection screen can then be created by assigning a HR report class.

In the report itself, the persons, along with the specified infotypes at the GET PERNR event are retrieved from the

logical database in accordance with the selections entered. Furthermore, the system checks the authorization for

data access.

You can use the GET PAYROLL event to evaluate payroll results.

PRECONDITION

The structure PERNR must be declared in the TABLES statement.

If you use the GET PAYROLL event, the hrpy_rgdir and hrpy_wpbp tables must be stored in the TABLES statement.

The PAYROLL structure is completed using the NODES statement. Enter 900 for the selection screen. This ensures

that the personnel numbers at the GET PERNR event are selected using payroll results and not master data. Use

PAYROLL as the report class. A sample report is EXAMPLE_PNP_GET_PAYROLL, and you can find additional

information in the report documentation.

Documentation extract taken from SAP system, Copyright (c) SAP AG

Includes used within report:

INCLUDE <ICON>. " CONSTANTS FOR ICONS

*CODING OF DBPNPPOV COMMENTED; REPLACED BY INCLUDE DBPNP_PNPCE_F4_FORMS

Page 81: 92825062 Overview ABAP HR

INCLUDE DBPNP_PNPCE_COMMON_FORMS.

* INCLUDE DBPNP_PNPCE_COMMON_DEFS

INCLUDE DBPNP_PNPCE_PLAN_FORMS.

* INCLUDE DBPNP_PNPCE_PLAN_DEFS

* INCLUDE DBPNP_PNPCE_COMMON_FORMS

INCLUDE DBPNP_PNPCE_AUTH_FORMS.

* INCLUDE DBPNP_PNPCE_AUTH_DEFS

* INCLUDE DBPNP_PNPCE_COMMON_FORMS

INCLUDE DBPNP_PNPCE_F4_FORMS.

INCLUDE DBPNP_PNPCE_LOG_FORMS.

* INCLUDE RPC4PR00

Tables used within report and the associated select statement:

No SAP database TABLES are accessed within this report code!

Function Modules used within report and the associated call

statement:

No SAP FUNCTION MODULES are executed within this report code!

Text pool values

Selection Text: PNPMSTBR = Supervisor area

Selection Text: PNPORGEH = Organizational unit

Selection Text: PNPOTYPE = Object Type

Selection Text: PNPPABRJ = Period selection: Year

Selection Text: PNPPABRP = Period selection: Period

Selection Text: PNPPERNR = D Personnel number

Selection Text: PNPPERSG = Employee group

Selection Text: PNPPERSK = Employee subgroup

Selection Text: PNPPLANS = Position

Selection Text: PNPSACHA = Payroll administrator

Selection Text: PNPSACHP = Personnel administrator

Selection Text: PNPSACHZ = Time recording administrator

Selection Text: PNPSASBA = Administrator group: payroll

Selection Text: PNPSASBP = Administrator group: personnel

Selection Text: PNPSASBZ = Administrator group: time

Page 82: 92825062 Overview ABAP HR

Selection Text: PNPSBMOD = Administrator group

Selection Text: PNPSNAME = EE name can be sorted

Selection Text: PNPSTAT1 = Customer-specific status

Selection Text: PNPSTAT2 = Employment status

Selection Text: PNPMASSN = D Action type

Selection Text: PNPANSVH = D Work contract

Selection Text: PNPBEGDA = Data selection: From

Selection Text: PNPBEGPS = Person selection: From

Selection Text: PNPBTRTL = D Personnel subarea

Selection Text: PNPBUKRS = D Company code

Selection Text: PNPENAME = Employee name

Selection Text: PNPENDDA = Data selection: To

Selection Text: PNPENDPS = Person selection: To

Selection Text: PNPFISTL = Funds Center

Selection Text: PNPFKBER = D Functional area

Selection Text: PNPGEBER = Fund

Selection Text: PNPGRANT = Grant

Selection Text: PNPGSBER = Business area

Selection Text: PNPJUPER = Legal person

Selection Text: PNPKOKRS = Controlling area

Selection Text: PNPKOKTL = Controlling area/cost center

Selection Text: PNPKOSTL = Cost center

Selection Text: PNPMASNG = Action type/action reason

Selection Text: PNPMASSG = Reason for action

Selection Text: PNPSTAT3 = Special payment status

Selection Text: PYENDDA = end

Selection Text: PYJUPER = D Legal person

Selection Text: PYKOSTL = D Cost center

Selection Text: PYPA03R0 = r0

Selection Text: PYPA03R1 = r1

Selection Text: PYPAYID = Payroll ID

Selection Text: PYPAYTY = Payroll type

Selection Text: PYPERNR = Personnel number

Selection Text: PYPERSG = Employee group

Selection Text: PYPERSK = Employee subgroup

Selection Text: PYSEQNR = D Sequential number

Selection Text: PYSRTZA = D Status of result

Selection Text: PYVW0_0 = End of in-period

Selection Text: PYVW0_1 = In-period view

Selection Text: PYVW1_0 = End of for-period

Selection Text: PYVW1_1 = For-period view

Selection Text: PYVW2_0 = Payday

Selection Text: PYWERKS = Personnel area

Selection Text: PYXABKR = Payroll Area

Selection Text: PYBUKRS = Company code

Selection Text: PNPSTATU = Status 1/status 2/status 3

Selection Text: PNPSTELL = Job

Selection Text: PNPTIMR1 = Today

Selection Text: PNPTIMR2 = Current month

Selection Text: PNPTIMR3 = Current year

Selection Text: PNPTIMR4 = To current date

Page 83: 92825062 Overview ABAP HR

Selection Text: PNPTIMR5 = From current date

Selection Text: PNPTIMR6 = Other period

Selection Text: PNPTIMR9 = Current period

Selection Text: PNPTIMRA = Other period

Selection Text: PNPVDSK1 = Organization key

Selection Text: PNPWERKS = Personnel area

Selection Text: PNPXABKR = Period selection: Payroll area

Selection Text: PNPXBWBK = Pers.area/subarea/cost center

Selection Text: PNPXPGPK = Employee group/subgroup

Selection Text: PYABKRS = Payroll Area

Selection Text: PYABRP1 = p1

Selection Text: PYBEGDA = start

Selection Text: PYBTRTL = Personnel subarea

Selection Text: PNPABKRS = D Payroll area

Title: Logical database PNP: Database program

Text Symbol: 034 = Too many personnel nos. cannot be locked; list ended at

Text Symbol: 035 = Reason 3: Cost assignment data contains errors

Text Symbol: 041 = Current Period

Text Symbol: 042 = Period

Text Symbol: 050 = First payroll period

Text Symbol: 052 = Last payroll period

Text Symbol: 123 = Enter a period

Text Symbol: 124 = Do not enter a period

Text Symbol: 127 = Do not enter a date

Text Symbol: 128 = Enter a date

Text Symbol: AKT = active

Text Symbol: BIS = To

Text Symbol: BLK = Key date

Text Symbol: BLP = Payroll period

Text Symbol: BLR = Additional data

Text Symbol: BLS = Selection

Text Symbol: BLT = Period

Text Symbol: DAI = Period

Text Symbol: DDI = Data Selection Period

Text Symbol: 001 = Selected personnel numbers

Text Symbol: 002 = Selection options

Text Symbol: 003 = Choose selection fields

Text Symbol: 006 = Enter payroll period

Text Symbol: 007 = Enter payroll area and payroll year

Text Symbol: 008 = Enter payroll year

Text Symbol: 012 = is a delimeter between fields but is not allowed as a field name

Text Symbol: 013 = is not a field in infotype 0001

Text Symbol: 014 = is not allowed because field in table PSHDR

Text Symbol: 015 = only allowed after

Text Symbol: 018 = PNPTIMED only allows

Text Symbol: 019 = PNPTIMED not together with PNPXABKR,PNPPABRJ,PNPPABRP

Text Symbol: 022 = Value sets are allowed only for entry fields ( >T599X)

Text Symbol: 025 = For search help

Text Symbol: 026 = no access path exists

Text Symbol: 030 = Personnel numbers skipped by the database driver

Text Symbol: 031 = Reason 1: insufficient authorization, no. skipped personnel nos.:

Page 84: 92825062 Overview ABAP HR

Text Symbol: 032 = Reason 2: unsuccessful ENQUEUE, no. of skipped personnel nos. :

Text Symbol: 033 = List of skipped personnel nos. (reason 2)

Text Symbol: DDK = Key Date

Text Symbol: YA2 = Switch off archive access

Text Symbol: YB1 = Period

Text Symbol: YB2 = Selections

Text Symbol: YB3 = Periods

Text Symbol: YCU = Current period

Text Symbol: YEV = Use CD evaluations on in periods

Text Symbol: YIP = Other periods

Text Symbol: YPY = Payroll-specific selections

Text Symbol: YTE = Technical selections

Text Symbol: YTI = Period

Text Symbol: Z21 = Today

Text Symbol: Z22 = Current month

Text Symbol: Z23 = Current year

Text Symbol: Z24 = Up to today

Text Symbol: Z25 = From today

Text Symbol: Z26 = Other period

Text Symbol: Z27 = Other keydate

Text Symbol: ZP1 = Current period

Text Symbol: ZP2 = Other period

Text Symbol: DPE = Payroll area

Text Symbol: DPS = Person selection period

Text Symbol: FSL = Dynamic Selections

Text Symbol: P10 = Selections from

Text Symbol: P11 = Further selections

Text Symbol: P20 = Search helps

Text Symbol: P21 = Search help &

Text Symbol: P30 = Sort order

Text Symbol: P40 = Org. structure

Text Symbol: PAY = Selection screen on payroll results

Text Symbol: PNP = Selection screen on infotypes

Text Symbol: VON = from

Text Symbol: Y01 = Period

Text Symbol: Y02 = General time selection

Text Symbol: Y03 = Employee

Text Symbol: Y04 = General employee selectio

Text Symbol: Y10 = Period

Text Symbol: Y11 = Employee

Text Symbol: YA1 = Switch on archive access

Some thing about info types

Infotypes:

The information units used to enter the data of an employee are called Infotypes.

The Infotypes are used to group related data fields together.

Examples

0002 -Personal data-->This infptype contains data like first name,last name,DOB,maritial status...etc

Page 85: 92825062 Overview ABAP HR

0006 - Address---> it contains data like, street,city,region.district and telephone numbers where

employess residing or working.

0009 - Bank details --> It contains data like bank name,account number..etc of an employee.

why Infotype :

As HR is related to time, we require old data as well as new data. The data we enter into the Infotypes are

automatically checked for accuracy and against the table entries. In simple, HR data is huge and to access

data easily we require Infotype.

for example: In the above said info types, in 0002 an employee may change his name or marital status

may change or any other personnel data may get changed, then it is very important to save old data with

correct time frame along with the changed data.

let us suppose if an employee personnel data record exists from 01/01/2000 t0 31/12/9999( this is the

max date we consider when there is no end date is given) . if he changes his personnel data on

01/01/2008 then a new record Will be created from 01/01/2008 to 31/12/9999 and the old record Will

get delimited to 01/01/2000 to 31/12/2007. so here we have two records for the same employee in the

same info type but with the different dates.

Moving on further about infotypes we have to know about time constraints and subtypes.

A time constraint indicates whether more than one Infotype record may be available at one time. When

you update an infotype, old data is not lost but archived for historical evaluation. The system records a

specific period of validity for each infotype, This enables the system to store more than one infotype

record at the same time, even if their validity periods overlap. This means that the time relationships

between infotype records must be defined. The concept of time constraints enables you to do this.

There are seven different types of time constraints avilable.

Time Constraint 1:

For the entire time that the employee works at the enterprise, exactly one valid infotype record must exist.

The validity periods of the individual records must not overlap. If a new record is created, the system

automatically uses the start date of the new record as the delimitation date of the old record. Gaps are

only allowed between the employee’s entry date and the start date of the first record.

Page 86: 92825062 Overview ABAP HR

Time constraint 1 must be used for all of the infotypes containing information that must be available at all

times. This is particularly true of personal and organizational assignment data.

If a record is delimited because of time constraint 1, the system displays an appropriate message.

Eg:0000-Actions,0001-orgassignent..etc.

Time Constraint 2

No more than one valid record can exist at any one time. Records with constraint 2 must not overlap.

Their existence is not obligatory. If a new record is created, the system automatically delimits the previous

record, if one exists.

If a record is delimited because of time constraint 2, the system displays an appropriate message. Eg-

0023-previous employee.

Time Constraint 3

Any number of valid records can exist at any one time. The individual records do not conflict with each

other. Eg0105-comunications.

Time Constraint A

Infotypes with time constraint A must have no more than one record. The system automatically assigns

the record a validity period from January 01, 1800 through December 31, 9999. This validity period

cannot be subdivided.

Infotype records with time constraint A cannot be deleted.Eg:0003 -payrollstatus

Time constraint B

Infotypes with time constraint B must have no more than one record. The system automatically assigns

the record a validity period from January 01, 1800 through December 31, 9999. This validity period

cannot be subdivided.

Infotype records with time constraint B can be deleted.Eg

Time Constraint T

Infotype records with time constraint T depend on the subtype.

Page 87: 92825062 Overview ABAP HR

Subtype:-subtype is a sub category of an info type based on the type of data. for example IT0006 is for

addresses and it has many subtypes 1,2,3 and so on for each type of addresses like home address ,work

address...etc.

Time Constraint z.

Z: Refers to time management Infotypes. The time constraint for these Infotypes depends on the time

constraint class defined in view V_T554S_I Absence: General Control. Collision checks are defined in

view V_T554Y Time Constraint Reaction

The principles of data entry and time constraints that apply to infotypes ensure that data is consistent

and accurate. They also constitute the basis of time recording, payroll accounting, and reporting.

http://help.sap.com/saphelp_di471/helpdata/EN/48/35c9f24abf11d18a0f0000e816ae6e/frameset.htm

Operation that can be performed on infotypes.

Create

Delimit

Change

Delete

Lock/unlock

display

Infotypes range

0000 – 0999 -> Personal Administration

1000 – 1999 -> Org Management

2000 – 2999 -> Time data

4000 – 4999 -> Applicant Data

9000 – 9999 -> Customer Name space

Apart from org management infotypes all other infotypes can accessed from T-codes PA30 for create and

change and PA20 for display and OM infotypes can be accessed from T-Codes PPOME for change,PPOCE

for create and PPOSE for display.

Moving on to structures and tables that are associated to each info type.

Each PA info type XXXX requires two structures and one table.

Page 88: 92825062 Overview ABAP HR

Structures PSXXXX and PXXXX (Eg: For IT0001 containstwo structures PS0001 and p0001)

PSXXXX-> is a structure which contains only info type fields (for example for IT0001 fields like

BUKRS,WERKS,PERSG,PERSK..etc will be available.)

PXXXX-> is a combination of structres PSKEY,PSHD1,PSXXX,CI_PXXXX(optional).

PSKEY:- it is a PA info type comman Key fields structurethe same structure is used for all PA info types as

key.bleow are the fields fields of this structure.

PERNR-> PersonnelNumber

INFTY-> Infotype

SUBTY ->Subtype

OBJPS ->Object Identification

SPRPS-> Lock Indicator for HR Master Data Record

ENDDA ->End DateBEGDA

BEGDA ->Start Date

SEQNR ->Number of Infotype Record with Same Key

PSHD1-> is a structure with Control Fields like "changed on, Name of the person who changed..etc it

contains 15 fields all are related to control data. This is also comman to all PA info types.

CI_Pxxxx-> Is an optional structure which indicates whether thatparticular info type can be enhanced or

not, if you enhance info type with new fields those fields will be saved under this structure. (Eg:-for

IT0001 ->CI_P0001)

Tables:-PAXXXX and PBXXXX(optional).

PAXXXX-> Is a transparent table which includes structures PSKEY,PSHD1,PSXXX,CI_PXXXX(optional)

and MANDT field. the structure of this table resumbles same like PXXXX.

PBXXXX-> Is also a transparent table and resumbles same as PAXXXX table. This table stores only

APPLICANT DATA which means not employees data, for example data of the candidates who applied for

the organisation are stored. This table is optional and it may or may not exist for info type.

Coming to OM info types XXXX each infotype has one table and one structure.

Table:HRPXXXX,Structure PXXXX (for example IT10001 table is HRP1001, P1001)

Infotype screens

An initial screen

Page 89: 92825062 Overview ABAP HR

Single screen

List screen

Infotype includes

MPXXXX00 – Main program

MPXXXX10 – Declarations and includes

MPXXXX20 – PBO for the screen

MPXXXX30 – PAI for the screen

MPXXXX40 – Subroutines

Posted by Reach surya at 11:00 PM

0 comments: Post a Comment

Search

Hom

e

TO

P

10

Crick

et

Fil

m

Televisi

on

Gener

al

Healt

h

and

Food

Mobi

le

Car

&

Bik

e

SAP

Onlin

e

traini

ng

TR

P

Carr

er

Papara

zzi

Wiki NewForum > Career Forum

BASIC QUESTIONS ON SAP HR TIME

MANAGEMENT with answers

User Name User Name

Remember Me?

Password

Log in

Register FAQ Members List Calendar

Sponsored Links

Career Forum Jobs, Career Advice, Job Hunt Strategy, Career Tips, Career Assessment, Company &

Industry Research, Professional Networking, State Employment Information, Resumes & Letters, Resume

Writing Tips, Resume Samples, Cover Letter Tips, Cover Letter Samples, Interviewing, Interview

Preparation, Interview Questions, Interview Appearance, Following Up, Salary & Benefits, Benefits

Page 90: 92825062 Overview ABAP HR

Information, Negotiation Tips, Salary Information, In the Workplace, Starting a New Job, Leaving a Job,

Work-Life Balance, Workplace Issues, Career Development, Getting Promoted, Changing Careers, Education

& Training, SAP Forum, SAP HR Forum, Free SAP HR Training, SAP FICO Forum, SAP ABAP HR Forum, SAP

MM Forum, SAP SD Forum, SAP QM Forum, SAP PP Forum, SAP PM Forum, SAP Basis Forum, SAP ABAP

Froum, SAP LE Forum, SAP PS Forum, SAP BW Forum, ESS & MSS, Cite HR Forum, CiteHR Forum, Web

Development and Design Forum, HTML Forum & Tutorial, Java Forum & Tutorial, ASP.NET Forum & Tutorial,

PHP Forum & Tutorial, IT Forum, MS Excel 2003, MS Word 2003, PowerPoint 2003, Outlook 2003, MS Excel

2007, MS Word 2007, PowerPoint 2007, Outlook 2007, JAVA Forum, Oracle Database, SQL, Application,

Programming, MS Office 2010, Exam Results/Answer Keys/Application Forms 2011, 2012, Hot jobs, Screen

shots, Documents, Tutorials, Downloads, pdf forms & More.

Tag Cloud

Payday Loans

Cheap Airfare

Bad credit loan

Personal Loan

Bad credit loan

New car loan rates

Las vegas hotels

Payday Loans

Free bank account

Page 92: 92825062 Overview ABAP HR

Member Posts: 164

94. I m working on CATS where in the data is interfaced through a legacy system.

I have the following Queries which requires an urgent response.

• Data from the legacy system to be transported is based on Wagetypes

• How to assign a Wagetype ( For example Wagetype-1000) to an Attendance and Absence Type

and accordingly pick it up in Time Evaluation and send the data to Payroll

• I am confused of how to send the wagetype data to Payroll through Time Evaluation.ffice:office" />

ANS:1 i have used documents this site to understand how to create time wage types in time evaluation,

thrue table T554s, T555Y and T510S

http://www.insightcp.com/res_16.htm

When wagetypes are stored in ZL they are processed in Payroll.

ANS:2 Please maintain the table T554S.

Please maintain a proper Time Management Status in IT0007, so that time can be integrated with

payroll.

95. any document about time, worklow and time bapi for 4.7 / 4.6c

ANS:1 Hope this helps for time management:

http://help.sap.com/saphelp_erp2005vp/helpdata/en/8a/9868bc46c411d189470000e829fbbd/frames

et.htm

ANS:2 Some BAPI,s for time module are :-

1)BAPI_ABSENCE_CREATE

2)BAPI_TIMEQUOTA_GETDETAILEDLIST

3)BAPI_EMPATTABS_GETDETAIL

4)BAPI_PTIMEOVERVIEW_GET

5)BAPI_ABSENCE_GETDETAIL

6)BAPI_PTIMEOVERVIEW_SAVEREPLICA

ANS:3 Check with below links

http://help.sap.com/saphelp_nw04/helpdata/en/a5/3ec8534ac011d1894e0000e829fbbd/frameset.ht

m

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ab80b790-0201-0010-569a-

99dcadc709c3

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40bceb90-0201-0010-7297-

Page 93: 92825062 Overview ABAP HR

d5e11f35743f

96. I'd like to know the basic tables to customize de types of time wages to transfer to payroll.

The first question is where do I relation a time type to a payrol wage type.

ANS:1 I am not sure whether table v_512w_d is you are looking for. For example you may configure

one hourly pay wagetype in this table (normally you need to use tcode oh11 to copy a standard

wagetype), after then you can put this hourly pay wagetype in IT0008 with time records for calculation

payroll.

ANS:2 Table T510S is used to generate time wage type (with the help of time types and processing

types) and these time wage types will store only the hours in time management module. When these

are carried over to the payroll, dollar amounts are attached to these wage types in payroll.

If time management is not used, then time wage types can be generated inside the payroll schema itself

(U000). The function DAYPR will call the sub-schema TC00 and time wage types are generated inside

this.

ANS;3 maintain Table T510S and read the doc on DAYMO function

97. I would like to learn and know about infotypes of time management such as

IT2001,IT2002,IT2006,IT2007. If possible please give a scenario and explain breifly about the

funtionality

of each fields in those infotypes such as absence, attendence, absence quota and attendance quotas.

ANS; You can use the Attendances and Absences component to create the basic time information for

the evaluation and accounting of your employees’ working times. You can use the Attendances (2002)

and Absences (2001) infotypes to record time information efficiently.

You should use the Attendances/Absences component if you want to record working times or absence

times for individual employees.

You can use Attendances to record the following situations, for example:

· Employees’ actual times

· Deviations from an employee’s personal work schedule

· Deviations from an employee’s general activities (such as seminar attendances, business trips)

You can use Absences to record the following situations, for example:

· Leave

· Doctor’s appointments

· Illness

You can specify data entry checks that permit or prevent the entry of specific attendances and

absences.

You use 2006 infotype to manage time accounts that represent employees’ absence entitlements or

Page 94: 92825062 Overview ABAP HR

time credits. The time accounts contain a particular number of days or hours during which employees

are permitted to be off work.

You can use 2006 infotype to manage the following time accounts, for example:

· Employees’ annual leave

· Time in lieu accounts, containing hours of overtime for which employees are permitted to claim

compensatory time off

· Paid and unpaid absence entitlements, such as for illness or other life events

You use 2007 infotype to manage time accounts that represent employees’ attendance approvals.

Employees’ working times affect costs. You can therefore use the Attendance Quotas infotype (2007) to

specify how many hours an employee is permitted to work, and at what times. The system monitors

how these time accounts are accrued and deducted.

You can use the infotype to manage the following time accounts, for example:

· Approvals for an employee to use a set number of days each year for further training

· Approvals for an employee to work a set number of overtime hours, if required, at set times over a set

period

98. My client needs the following data:

Employee applies for 5 days leave.

later he cancels it and re applies for 3 days only. In absences infotype, i delete earlier absences of 5

days and put only 3 days. but client wants to see both data...his first leaveapplication of 5 days, and

the second leave application of 3 days also... how do we save LEAVE APPLICATIONS?? Even though

the first leave application is cancelled,client wants to see as:

1. 5 days leave

2. 3 days Leave etc...

ANS:1 You could find useful this transaction: S_AHR_61016380, there you can log infotypes changes, so

that you can save the leave record after modifying/deleting it in PA30.

ANS:2 I hope, you will have the splits in the corresponding table. Eventually, you have the two splits in

his / her master record history.

99. anyone who worked on time constraints in depth. please let me know how can i delete the

absence and overwrite it with attendnce automatically. if i eneted abse for 2nd aug, and i try to enter

attendance on 2nd aug, it is not allowing/ or allowing both records to exist... i am using A for

attdnace ...still not able to get...where else do i need to chnage in 554y_b table?

ANS:1 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.

2 No overlapping but time gaps are permitted.

3 Overlapping and and time gaps are permitted.

Page 95: 92825062 Overview ABAP HR

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

ANS:2 First of all, I am not able to understand "How a person will remain absent and present at the

same time on 2nd Aug?" Not sure, if your client have got such typical requirement...

Moreover its related to Time constraint Class and you need to change the Reaction indicators and TCC

in the table.

Actually i am not asking that the employee should have ATTENDANCE and ABSCENCE records for

same day...my problem is: The Abs record shuld get deleted if i try to enter ATTENDANCE at later

days... REGULARIZATION u might have veard of..where employees want to correct their abscences.

means 2nd aug, by some delay or mistake, it is marked absence, later tomm, if i enter attendance in

2002 infotype, SAP shuld delete the earlier absence automatically, and maintain only attendance.

in fact i had achieved doing it last year in my project, same thing i am not able to do now....

ANS:3 Well if you did it last year with the help of time constraints then i don't know, I thought time

constraints check only on the same infotype. Interesting to know that it can also work on 2 different

infotypes.

Anyways, alternatively, you could setup a dynamic action (background delte) for your requirement.

Dynamic Action may need some description of the reaction....instead if i just change the time

constraint ,i can solve...and i have of course solved my problem.

ANS:4 Use table v_554y_b and reaction Type A to overwrite attendance with new coming absences

(and viceversa)in the first screen it is shown the incoming infotype and time constraint type.

Doubleclicking you set the reaction against existing ones

100. Does anyone know what is the meaning of this operation: HRS?IDAHRS

ANS:1 Operation HRS?IDAHRS returns the number of working hours of the employee (contents of field

ARBST from infotype 0007, planned working time).

ANS:2 Furthet to Rodrigo,the code compares the value in the Hrs field with that of the planned working

time.It does not return the value. It depends upon the work schedule.

So using this operation as you have written it, the operation will actually return < (less than), > (greater

than) or = (equal to), depending on whether the variable HRS has a less than, greater than or equal

value compared to the daily working hours value from infotype 0007.

Page 96: 92825062 Overview ABAP HR

#7

,

saphr

Member

Join Date: Dec 2008

Posts: 164

101. Here we are using positive time management, where all actual time in and time out has been

recorded in the time machines installed at factory gates. We want the daily time data has to

uploaded to SAP System to run the time evaluation. Does SAP have any standard report/tool for the

data upload, from time machine to SAP Or need to write ABAP programming to upload the data? Can

you please send me the steps to be taken for the integration and any standard format is available for

the uploading. Do you have any kind document on this?ffice:office" />

ANS:1 You can use program RPTEUP10 to upload time data daily. But this program is not certified or

either supported by SAP. This is an example program which will serve your purpose without doing any

programming. Also do goto HR-PDC notes,

102. I trying to understand how to upload time events by using the transaction PT80 (Subsystem

connection - time events - upload request), can some one tell me how it works? I don't understand if I

have to set up or configure a connection between the clocks and sap system, and then run another

process.

ANS:1 Please see...

http://help.sap.com/saphelp_erp2004/helpdata/en/8a/9868bc46c411d189470000e829fbbd/frameset.

htm

It has ...

1. Example: Message Processing

2. Message View and Employee View for Message Processing

3. Message Functional Areas

4. Processing Methods

5. Individual Functions in Message Processing

and also 6. Authorizations in the Time Manager’s Workplace

Page 97: 92825062 Overview ABAP HR

ANS:2 In the project i have done recently, they have a link b/w sap system and the time recording

machine. The time events wil be stored in a file and the same wil be stored in teh sap appln server. We

need to post them explicitly in the Teven table which is nothing but hte infotype 2011.

Initially they wil be stored in the temporary buffer CC1TEV table. A batch job will be scheduled to post

the tempory buffer entreis into the TEVEN table. the program name for the batch job is 'SAPCDT45'.

I guess you have to establish the connection b/w sap system and the time recording machine using

PT80.

ANS;3 try pt45 and pt46 and pt44

103. Every day a flat text file gets generated from time machine, text file contains the employee id

date and time, this file we have uploaded to SAP through Tcode PT80.

While processing the time event data system has to understand the employees time is In punching Or

Out punching, for these we have done customizing in the table PDC Processing Statuses(V_T705B) for

the key A01. Now we getting an error in time management pool "Time event Type is not assigned to

time event type group 01" Any solution for this?

That means, you haven't assigned A01 to your PSgrouping 01. Check it one more time.

104. kindly tell me what is the primary wage type for creating or copying Time Wage type for

ffice:smarttags" />India? For Calculation of Loss of Pay. For Example: Basic Pay we take MB10 into

consideration Like that for Loss of Pay what has to be taken?

ANS:1 Are you hinting at leave with out pay (LWP)f scenario?

In this scenario they loss of pay happens to the employees due to the factoring of the wage types

applicable to that particular employee.

Factoring depends on the yr Time management configurations of Absences & quotas,counting class

etc...

The factoring for wage types depends on RULE INP1 for india payroll

If u assign Value 1 to processing class 10 of Wage type (tavle V_512w_d) then that wage type will get

reduced according to the rule INP1 (SAP standard rule).

if u dont want to factor it due to LWP then assign 0 in processing class 10.

you can aslo write rule INp1 for special business requirement from the customer.

You are not configuring a wage type with amount to be deducted for LWP.It should be done through

factoring & time management config.

Actually my Client wants If an employee takes an Leave that is a Loss of Pay automatically his

Conveyance & Medical Allowances should be reduced.

For Example: An employee Gets Conveyance for 30 days is Rs.800/- & Medical is Rs.1250/- p.m. Now

when he takes Leave for 2 days then automatically These 2 allowances should get reduced, then

Conveyance will be Rs.747/- & Medical will be Rs.1167/- for 28 days. Now tell me How should I do

Page 98: 92825062 Overview ABAP HR

this above sceniorio?

yr client requirement is the same what i mentioned above? is yr client's payroll is inegrated with time

management?? Even if yr client dont wanna go for Time Management,though the Scope of the project

is Just Payroll itself, u need to have PA (Master data config (India specific infotypes 0580 series) ) and

basic Time management configs in place.

For your requirement you should configure absence types, quotas,counting rules,public holiday

calender,basic work shedule (eg NORM) etc for this factoring. assign value 1 in Processing class of wage

type that should get reduced in the view V_512w_d (transaction sm31). You have to really go through

SAP Help & some materials ab't time mangmnt and learn well & go ahead.

I had done exactly what you had told but its not getting reduced to CA & MA. I had configured Time

Managment also. Can u tell me which step did I missed?

Qn1. Is yr other wage types other than CA and MA getting reduced (factored)???

if yes then Check these wage types under V_512w_d for processing class 10.

give value 1 there .

If yr payroll is with out integration of time mangement & time evaluation then u have to comment in

schema XT00 the TC00 ( for commenting you have to put an asteric symbol * ) PE01 transaction takes

you there.

Answer clearly then only i will be able to make assesment of situation.

Thats why people who replies ask questions,so answer to the point,it will help both the parties.

I had mentioned for my both wage types 1 in the Processing class 10 under table number V_512W_D.

I wants to know in IT0008 the moment I enter my Wage type Conveyance Allowance & Medical

Allowance the system automatically has to give me the balance amount for this what I needs to do?

105. Where do we maintain Time constraint assignment to subtypes of an infotype. I am looking to

subtypes of IT 0210 ( Tax With holding ) " where do we create the subtypes and their characteristics

for this infotype in IMG? I tried in view V_T591A but there is no entry for this 0210 infotype but I can

find the time constraint assignment for the rest of the infotypes in this view.

ANS:1 SPRO-->Personnel Management--> Payroll-->Payroll:USA-->Payroll Results Adjustment-->Define

Time Constraints for adjustments, select infotype 0210 & maintain

ANS:2 I checked this table earlier but here we can maintain the properties of the complete infotype.

Here we can mention the table to use for individual subtype time constraint assignment, but for this

particular INFOTYPE 0210 we can not mention the subtype table.

ANS:3 You can maintain the subtype table for 0210 in T777D via SM30/31.

106. As negative Time evaluation does the time evaluation based on the deviations to the work

Page 99: 92825062 Overview ABAP HR

schedule, how is the time interpreted which are captured in 2001 and 2002 using TM01.

I just want to understand teh difference between TM01 and TM04 with respect to getting the time

data from infotypes(in day processing). Both of them read 2001, 2002 infotypes in common, i am not

clear how is this interpretation different different in two schemas TM01 and TM04.

Before going to know about TM01schema.It is better to know about Absence valuation. Absence

valuation is a component in Time management which is used to evaluate absences like

paid,unpaid,illness..so.on.There are different types of absence valuation methods which can be used

depending on the requirement.

They are:

As is Principle:(Absence valuation as if emp had worked)

Formation of counting classes for factoring and cost acounting:(by considering different quotas for

diferent emp grps and doing deductions)

Individual Caluculation:(Deiations to atual schedules)

Valuation ofabsenes using averages and constants: (Ex: Overttime caluculation)

To do all above processes sys depends on different Schemas ..

Depending on the business req shemas canbehange.

TM01:TimeEvaluation schema which is used for exceptions to work schedule.(For ex:A set of emps who

has to work for a hr extra for first two days a weekie its the deviation to actual schedule)

TM04:Time evaluation for data recorded in hrs(This is a case for production workers for whom the

payment is done depending on no of working hrs)

#8

,

saphr

Member

Join Date: Dec 2008

Posts: 164

107. 1. For Leave carry forward which infotype do we use? Could you suggest me the navigation path

to carry forward for next year? And what is the report we use to generate “leave carry forward”?

2. Where can we assign different absence types for particular employee group

3. What method do we use to upload the data to IT0008?

4. How do we configure second Saturday? Navigation path and what components should be

Page 100: 92825062 Overview ABAP HR

considered while doing that?

5. Could you give suggestion for this Mr. X is an employee coming late to the office daily by 30

minutes for the whole week, and the time amount has to be deducted from his pay? How can we do

that?

6. What do we set in IT0007 for TMSTA if do not use time evaluation? And what do we set if we use

time evaluation?

7. In “permit time quota with out using time evaluation”, we have optionals like no, generation,

increase and replace when do we use each of them?

ANS: 2. Where can we assign different absence types for particular employee group

Ans :(a) IMG node : Time Management->Time Data Recording and Administration->Absences->Group

Personnel Subareas for Attendances and Absences.

(b) IMG node : Time Management->Time Data Recording and Administration->Absences->Absence

Catalog ->Absence Counting ->Rule for Absence->Group Employee Subgroups for Time Quotas

4. How do we configure second Saturday? Navigation path and what components should be considered

while doing that?

Ans: This has to be configured in your work schedule, mark each second saturday as absence in the

holiday calendar, create the work schedule and generate.

5. Could you give suggestion for this Mr. X is an employee coming late to the office daily by 30 minutes

for the whole week, and the time amount has to be deducted from his pay? How can we do that?

Answer : From Time perspective, make Time Management status in nifty 0007 as 1 or 9, refer F1 help

on the field in infotype 0007.

6. What do we set in IT0007 for TMSTA if do not use time evaluation? And what do we set if we use

time evaluation?

Answer: Mark Time Management status as '7' - Time Evaluation without payroll integration.

7. In “permit time quota with out using time evaluation”, we have optionals like no, generation,

increase and replace when do we use each of them?

Ans : No generation : No quota accrual has to happen-> User will fill in the Quota amount.

Increase : Quota accrued is increased in the generating proportion.

Replace: Quota accrued is replaced by the new value of accrual.

ANS: for second saturday u can define holiday from a fixed date like

after 8th of every month u can fallow second saturday.

so u can make as after 8th coming saturday as holiday

hope this 'll help u

108. anyone now how to use some of the following bapis?

Page 101: 92825062 Overview ABAP HR

BAPI_PTMGREXTREMSPEC_INSERT

BAPI_PTMGREXTREMSPEC_INSWACT

BAPI_PTMGREXTREMSPEC_INSWCOST

i need to know how to USE this bapis, i dont know how to insert data using this BAPI, wich

parameters are needed.

ANS:1 Call transaction BAPI. There select [Hierarchical][Personnel Time

Management][PTManagerExtAttAbs]. The three insert methods are the BAPIS that you want to call. In

the tree there are also the documentation for the parameters

my problem is that i dont know which parameters are needed in order to create an absence or

attendance.

ANS:2 following is from the documentation:

Import parameters

AttendanceAbsence - Attendance/absence

Description - For more information on the individual parameter fields, see the data element

documentation in the ABAP Dictionary.

The following data is required:

Logical system of the original document (Field EXTSYSTEM)

External application (Field EXTAPPLICATION)

Document number (Field EXTDOCUMENTNO)

Personnel number (Field EMPLOYEENUMBER)

From date (Field FROM_DATE)

To date (Field TO_DATE)

Attendance or absence type (Field ABS_ATT_TYPE)

Start time (Field START_TIME) and End time (Field END_TIME) or

Attendance/absence hours (Field ABS_ATT_HOURS)

What is your problem?

I need to know the technical process that is recommended between the moment a positive employee

clocks in and clocks out to the final moment where time management has fed payroll. Would you

know that or have that by any chance.

ANS:3 Only one parameter is enough. see below....

CALL FUNCTION 'BAPI_PTMGREXTREMSPEC_INSERT'

TABLES

remuneration_specification = remuneration_specification

return = return.

109. Is there any way that i can enter time in cat2 No of hours worked in that period.

Ex: i want to enter No of hours worked (REG) = 80 instead of entering each day 8 hours --> i.e.

Page 102: 92825062 Overview ABAP HR

monday 8h, Tue 8h, wed - 8 ....... i just want to enter the total amount hours worked for whole period

insted of

day by day.

ANS:1 Check for the Data Entry Profile properties under the section "Time Settings"- whether it is a

weekly entry or daily entry. Access the Data entry profile using the SPRO path

SPRO->IMG -> Personnel Management -> Employee Self Service -> Service Specific Settings ->Working

Time -> Record Working Time -> Setup Data Entry Profiles.

Or use transaction code CAC1.

ANS:2 Check DATA entry profile , May be it can be done by profile or else try if you can directly enter

the no of hrs with out filling days information.

ANS:3 By default Standard SAP allows you to enter attendance type and hours day wise . You cannot

enter total hours for the whole week in the CATS.

One option is possible if you use 2010 instead of 2002 or 2001. You can create a wage type called

Regular Hours and ask the employees to enter the total hours for this wage type in time sheet. Hope

this help.

If i create a wage type reg hours and can i use that in CAT2 to enter the total hours or i have to use

IT2010 for entering time. What about Over time again

ANS:4 Your requirement is kind of abnormal. Normally when you use time sheet its expected that you

enter time everyday. If you really want to allow employee to enter total number of hours in the week

say 40 hours in the week as regular hours, 8 hours overtime etc then you need to use Infotype 2010 and

you can ask the employees to enter these hours in time sheet using two different wagetypes , one for

regular hours and other for overtime. Then using CAT6 you can move the hours to IT2010. Hope this

clarifies your query.

now i assigned hours using wage type from IT2010 and in payroll it is also taking it but it is also taking

from workschedules as well how can i stop that and one more thing i am conserned about is in our

client accruals are calculated according to the hours EE worked. i.e. for ever hour EE worked they will

get 0.01 hours of sick. can we configure that if we assign hours through IT2010.

ANS:5 U want to compensate O.T by paying / Time in Lieu..

If u want to pay then u can use 2010 IT. If u want to give Comp Off, U have to transfer the O.T hours

into a daily Time Type and link it to the sick leave quota..

110. am working with ESS standard applications, can you any one please help me how to configure

these two feature "LLREP" and "WEBMO" .Its very high priority work.

ANS: Go to PE03 type LLREP ( Variants for Reports) go to function code TIME expand ZTERF(Employee

Page 103: 92825062 Overview ABAP HR

Time Management Status) here you can assign your variant according to Time Status.

Go to PE03 type WEBMO(Rule Group for Customizing Tables in web Env)select APPID (Application ID)

expand click on ESS_ LR(LEave Request Application) then according to ESG you can specify your Rule

Group for Work Flows.

#9

,

saphr

Member

Join Date: Dec 2008

Posts: 164

111. Employees enter their time in SAP Portal. Once these times are approved, these need to be

moved in to PeopleSoft. Presently there are complex interfaces for the process. Management has

decided to redesign the interfaces.

ANS: The powerful integration broker, we are having in SAP Netweaver is SAP xi, that is exchange

infrastructure, which will communicate with any platform.

112. We have implemented time management and we have for for salaried exempt

• enter vacation / sick hours via Portal

• time off auto approved

• reports can be generated via SAP

Likewise we have the same for salaried nonexempt and hourly ees (slightly different though)

in all above cases the ee is assigned a time administrator (TA) code on infotype 1.

So the issues are:

1. there is no logic to the TA codes other than "Hxx"”= hourly person and “Sxx” = salary ee??

2. The TA codes have the Administrator Name as position text of the people manager … this causes

multiple text with same name (example attached)

3. A spread sheet is maintained representing the TA code for each people manager

4. Security role is created , apporoved and assigned to each manager… a manager may have multiple

roles

5. Each time there is an org change , config must be completed to create new TA codes

In the IMG for Administrator, there are 3 additional fields we could use …but these fields don’t show

in the drop down on IT1 . But at least it might be beneficial to store data her rather than in a work

Page 104: 92825062 Overview ABAP HR

sheet.

--------------------------------------NO ANS--------------------------------------

113. 1) how to Configure tables like T555A, T555y, T510S, Etc

2)Configuration of overtime, using Schema’s like TW15, PCR’ ( To01, To02)

3)how to maintain Maintained infotypes like 2001, 2002, 2006 and 2011, Etc

ANS:1 1. These tables are maintained for time wage type generation. In table T555A, you define a time

type which you will be using. In table T555Y, you define the processing type-time type pair for a

attendance or an absence accordingly to the processing type-time type class. In table T510S, you define

the time wage type selection rule for various conditions of the day, time etc.

2. TW15 is used to calculate overtime for more than 8hrs a day. TW30 is used to calculate overtime for

more than 40hrs per week. You can customize the rules TO01, TO02 etc for your requirement.

3. 2001 is used to maintain absences, 2002 is used to maintain attendances, 2006 is used to maintain

absence quotas, 2011 is used to maintain time events for which you need to maintain 0050.

ANS:2 As you are going for Positive Time evaluation.(2011 infotype in your question). T555Z is also an

important table to be checked

Go through the training material HR311 to have a better understanding about +ve time evaluation.

114. Just wondering is it possible to check the time constraint of standard infotypes such that the

behaviour of infotype records will react accordingly to the time constraint?

I am aware that we can change the time constraint in PM01 but i have tested it, it does not seem to

delimit past infotype records. I have changed the time constraint of Infotype 0081 to 2, but it does

not delimit past records. Is it dependent on the infotype itself as well? Is there any existing function

module or user exit that I can use to enhance the module pool of infotype to delimit records?

ANS: 1 Check the table v_t582A.

I have changed the field ZEITB for time constraint to 2, but it still doesn't do auto delimitation of a

past record when i create a record that has validity dates that overlaps with a past record.

Any subtypes created for this infotype?

I have removed the Subtype table entry, Subty. text tab, Subtype field and Time constraint tab entry

in that view that you mentioned previously. Still, it doesn't work. Even if there are Subtype entries, if

the Time Constraint is set to 2, shouldn't the delimitation be based on all records instead of

Subtypes?

ANS: It has to work with subtype as well since it is not dependent on the subtype

have you created any record with different validity date and try instead of changing 1 field.

Yes, I did. I have changed the validity date. For eg. for 1 record, i have Begin Date as 24th Oct 2007,

End Date as 31st Dec 9999. Then I create another record with Begin Date as 26th Oct 2007, End Date

as 31st Dec 9999. By right, it shld delimit the first record to end on 25th oct 2007 when the 2nd record

is created, based on time constraint 2. But no, it didn't.

Page 105: 92825062 Overview ABAP HR

ANS: R u doing this for a field or infotypes ?

The time constraint is used only for infotypes .

In configuration ---> In Maintain Infotypes--->Time constarint (subnode) --->Choose the infotype and

give the correct time constraint (1/2/3 ) .

I am doing this for infotypes and yes, i have changed the time constraint to 2, but it doesn't do any

delimitation for records with validity dates that overlap.

ANS: Try this out.

1) Take infotype 0081 IT , going to PM01----> in change mode .

2) Give time constraint 1 , check Subtype obligatory and Text allowed (It will not affect , no need to

remove that check )

3)

1: An infotype record must be available at all times. This record may have no time gaps. You may not

delete the record last stored on the database because all records of this infotype would otherwise be

deleted.

2: Only one record may be available at one time, but time gaps are permitted.

3: Any number of records may be valid at one time, and time gaps are permitted.

4) Try with two,three infotypes 0022 etc

I have changed it to time constraint 1, subtype obligatory and text allowed. I created 1 record with

Dates: 24.10.2007 - 31.12.9999. Another record with Dates: 24.11.2007 - 31.12.9999. It did not delimit

the first record. However, when I tried to delete either of the record, it says 'Record cannot be

delimited (time constraint 1)', although there are currently 2 records.

Somehow, the other record seems to be invisible to the other. FYI, this behaviour is not what I

require. I need the records to do auto delimitation of previous records if it overlaps with previous

records.

ANS: Can u tell me which IT r u trying ,,,, try for 0022 IT too ,

check whether the behaviour is the same .

When u give 2 as time constraint , your problem should be solved .

Eg: 24.10.2007 - 31.12.9999 - 1st record

24.11.2007 - 31.12.9999 - 2nd record

While saving the second record ,

IF Time constraint is 1 : it will delimit with a date as 23.11.2007 for 1st record

IF Time constraint is 2 : it will delimit with a date as 23.11.2007 for 1st record (does the same thing)

Time gaps are the difference (You can have the record delimited to 20.11.2007 for Tiime constrint 2 but

for 1 it should not allow the same)

If this is not happening the messages are the problem .

Use user exit for the same to correct the problem .

Page 106: 92825062 Overview ABAP HR

What is the message ur getting when you try to save the second record .

It works for Infotype 0022- past record will get delimited. But I need it to work for Infotype 0081-

Military Service. Currently IT0081 record doesn't get delimited. Could it be becoz it is a time

management infotype?

Btw, for Infotype 0081, when i changed it to Time Constraint 2, no messages are prompted at all.

Another record would just be created without the past record being delimited- behaviour is as if its

time constraint 3.

115. Would some colleagues have experience concerning time keeping clock suppliers having

developed adequate interface between their clocks and Sap and delivering complete packages

(hardware and software)

ANS: There are SEVERAL.....look at Time Management 3rd party partners.....they are across the

board...you have many options and most all provide out-of-the-box solutions. Check SAP's site for a list

of the certified vendors.

#10

,

saphr

Member

Join Date: Dec 2008

Posts: 164

116. I have a scenario where the employee can work any 8 hours in a day of 12 hours. where the day

starts at 9 am. so for this how can we fix a lunch break, tea break, since there is no fixed log in or log

out time. how can we configure for this.ffice:office" />

ANS:1 'Dynamic Breaks' can help you in resolving it.

ANS:2 you can configure this in the IMG :

follow the path : Time Management->Work Schedules ->Daily work schedules -> Determine Break

schedule.

I have done as follows

defined a break with no from or to times , and specifying the quantity of time as 30 mins,

Page 107: 92825062 Overview ABAP HR

but let me know whether this is right or not. how dynamic breaks are help ful in this regard.

ANS:3 Dynamic break means there is no fixed timings for the break taken by the employee. He can take

30 min (in your case) in the entire day. You can also specify this break as paid or un-paid too.

ANS:4 Suppose if you want to give unpaid Tea break after 2 hours of

login for 15 min, don't specify anything in Start & End and mention 0.25

under unpaid and 2.00 under After column.

And for 30 min.Paid Lunch break after 4 hrs, mention 4 under "After" and

0.50 under paid. Make sure to give the same grouping as well as name to all Breaks

with different serial number.

117. My Client has requirement to change from time evaluation with clock times to time evaluation

with out clock times in positive time recording.

ANS:1 I would suggest you to read the SPRO doc for Time eval w/o clock times.

It is more benefical if you go through that...

In case if you need more help, let me know. Also tell me what you’re exactly looking in time eval w/o

clock times?

ANS:2 Im also working with positive time recording. Please start your work with the concepts what you

know. While working if you are getting any doubts, please let me know. So that i will give you the

solutions and ideas regarding your threads. Or if you want to know from the first part of the

configuration, pls let me know.

ANS:3 Please do the following things and let me know where you are facing problem. then we will go

further as it is a long process. pls do agree with me.

Check OR create the table T555Z.

Check or create the table t555e

check or create the table t555a

Check or create the table t 510s

check or create the table t554s

And if you clear with all these things pls let me know. we will go ahead

118. 1. Could any guide me on Time types, Time balances and Time wage types?

2. Bay balance, period balance in "base entitlement for absence quota generation"?

ANS:1 Time types represent a semantic

grouping of duration periods.

Page 108: 92825062 Overview ABAP HR

Standard settings

The standard SAP system contains common time types as standard entries for a personnel subarea

grouping.

These standard entries are generally sufficient for day to day processing within payroll.

----------------

In the standard SAP system, the time type determination group for the employee subgroup grouping

for

personnel calculation rules 1, 2 and 3 has the value 02.

The time wage type selection rule group is assigned the value of the employee subgroup grouping for

the

personnel calculation rule to read the Time Wage Type Selection Rule table.

ANS:2 Please maintain the following tables for all those:

V_T555A: Used to maintain or add a new time type.

V_T510S: Used to create a selection rule for the time wage type selection.

V_T559L: Used to create a selection rule for quota accrual.

119.. y do v do time evaluation?diff between time evaluation n time recording?

if possible send me configuration material for Time evaluation.

ANS: Time evaluation can be done in 2 ways:

1. positive time recording 2. negative time recording.

1. POSITIVE:

automatic recording:

record separately in a diff. system, upload to R/3

manual recording:

Attendances infotype - 2002

2.NEGATIVE:

record only deviations from the work schedule.

120. 1. Is it possible (if yes, how) to still include a employee in time evaluation even if this employee

is inactive (status P0000-STAT2 = 0). We need this in order to calculate weeks of not working (this has

to be calculated). I know that for payroll this is possible wih a setting in infotype 0003.

2. Is it possible (and how) to read data back from payroll into time. For example in payroll you export

something to ZL table, can you then pick this up in time evaluation schema, as there is also ZL table.

Or is there another way to do this?

ANS : Why you want to evaluate the time for inactive person.

Page 109: 92825062 Overview ABAP HR

If you want you can do.

Process :

First of all you have to group your employees. and sub groups.( for inactive emp)

Assign the employee sub group grouping for PCR in Basic Pay ( IMG ).

Then come to Time Evaluation Schema. Put the Day grouping nn nn nn nn in the Parameters. and run

the time evaluation. You will get the output in DZL table.

For the above process you need to configure the T510S table.

Yes you can read the payroll into time.

the same concept will run in both of the modules.

the output should appear in the ZL table only.

Here the concept is.....Some companies, they will not use the payroll wage types. only they will use the

time wage types.. these wage types has to be configure in the T510S. and we have to do the wage type

copying from the part of time management only if they are not using the payroll. So either in Payroll or

in Time management the evaluation of time willbe the same.

First answer: I do not need different employee groups, but need (status P0000-STAT2 = 0) employees

to be evaluated. But this problem is solved as I can use operation HRS=Y.....

Second answer: I don't get your answer: the customer uses payroll and the result of a wage type in

payroll has then to be read back into time.....

ANS: So i think you have already configured the Wage types in Payroll. And you have transferred to

Time. So, now you want to c whether the time is capturing the Payroll wage types or not.

I gave the solution to your answer in the previous reply itself. The Process is, ZL table only stores the

time wage types irrespective of whether you configured in the payroll or Time Management.

121. what are this TIME TYPES..?

ANS:1 Time Types are your

Clock in

Clock Out

Break In

Break Out

Offsite In

Offsite out

What ever you are going to use in your PDC.

ANS:2 Time Types are buckets to store time balances. The table is T555A.

ANS:3 Time types Play Important Part in Time Evaluation:

1)They help in creating the TIME ACCOUNTS for the employee

Page 110: 92825062 Overview ABAP HR

-Once the Time evaluation is run we get time wage types which are set to payroll for calculation of

remuneration for the employee. and also we get Time types which are used to show time accounts

(with the help of Time balances)for the employee.

Time types store time balances.....

Let me give you an example: say time type-0002(Periodic balance)

If a particular employee worked 10 hours In a day that 10 hours is stored in ZES(Daily Balance) AND

Total cumulation for the whole month say 200 hours in SALDO(Monthly Balance).........The whole

balances are Put in a Time Type.

V_T555A-used to view time types for a particular period.

these time types are stored in cluster B2

Page 2 of 2 < 1

2

Tags

abkrs, absence, absence quotas, actions, address, administartor groups, all the img config, and deduction

of quotas, as-is, attendance, attendance types, bank, base entitlements, basic, basic data

changes, benefits, canada, cats, cea/cha, certification, certification

review, coa/cla, communication, complete in00 schema, configurations, contr, contract

elements, conveyance, cost accounting with finance, counting rules, country payrolls, course employee

master data, d atar, d.a based on cpi, daily and weekly over time, daily work schedules, date

specifications, day types, different absence types like pl, discussion

forum, documents, download, dynamic, dynamic actions, e-recruitment in sap hr, education, error

message, errors, esi, ess and mss, ess: leave application, family details, features, fico,fixed and variable

breaks, flexi time, form 16 with annexure, forms, france, free, functions, germany, gross salary, hard

furnishing, hiring, hr abap reports, hr authorizaton, hr module tables, hr sapscripts,hra, igmod, img

steps, india, info type, infotype menus, infotypes explanations and configurations, integration, interview

questions & answers, leave balances, leave carry forwards, leave encashment,leave encashment request.. &

more., legislation, lgmst, loans, loans and interest subsidy, lso, lta, lwf, lwop, medical, membership

fees, monitoring of tasks, multiple form 16, mysap, notifications, numkr,objects on loans, one time

payments, online training, operations, organisational key, organization management, p.f and vpf, paid and

unpaid breaks, path, payroll, payroll driver, payroll sub modules,payslip design, payslip display, pcr, period

work schedules, perks, person ids, personal data, personnel administration, personnel

development, pinch, planned working time, positive & negative time recording, positive and negative time

evaluations, previous employer details, previous exp, promotion, ptax, quarterly

returns, queries, quotas, recurring payments, reports, rotating shifts, sample resumes, sap certification

exam, sap help, sap hr, sap hr faq, sap hr forum, sap solution manager, schema, schkz, screen

header, screen modifications, screen shots, sdn sap, shifts patterns and

allowances, solutions, specification, statutory, steps, structures in human resources, t-codes, tariff, tax

calculation, technical principles, testing, third party vendors, time evaluation, time management, time

mgmt: holidays and holiday calendars, tips, tm00 and tm04, tmsta, to-be, training and event

management, transaction codes, transfer, uat, usa, vacation quotas etc, variants, vdsk1, wage types, work

Page 111: 92825062 Overview ABAP HR

schedules, year end activities, zlsch

« Previous Thread | Next Thread »

Forum Jump

Career Forum Go

hit counter code

Contact Us - Wiki NewForum - Top

Powered by vBulletin® Version 3.7.4

Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

2009-03-23

Disclaimer: All the content

posted in WikiNewForum.com

in any Thread/Post are made

by the readers/users and

WikiNewForum.com is NOT

responsible for any such

Content If you have any legal

issues please click Report Post

icon in the Content/contact

us.

Concepts of Macros (Import/Export etc.)

Macros:

Introduction

Programs that process the cluster data (for example, RX) do not access the cluster independently. The

data is

accessed using a defined interface created with macros.

Page 112: 92825062 Overview ABAP HR

Macro contains some part of source code, which it will be useful for number of applications. Macro is

module,

which is stored

Naming Conventions of Macro:

RP-aaa-bb-cc

aaa is the type of Macro. It takes two values

o IMP Import Macroo EXP Export Macro

bb is the Database table where the data is saved:

o C1 Database object PCL1

o C2 Database object PCL2

o C3 Database object PCL3

o C4 Database object PCL4

Cc is the cluster, it may take

o RX Cluster object RXo RD Cluster object RDo B2 Cluster object B2 and so on.

Defining and Calling the Macros

Defining:

There are two options for defining the Macros

Macros are defined using the ABAP Commands DEFINE…. END-OF-DEFINITION. A macro can be

used within a report or within include. If a macro is used in a report, and the macro is defined in include

with the DEFINE command, include must be integrated.

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. The coding is grouped under a specific name in the table key.

According to conventions, the first two letters of the name must stand for the application. The rest of

the

name is freely definable.

Difference between the two methods is:

If a macro is changed, each report using this macro is automatically regenerated when it is executed.

When you change a RMAC macro in the table TRMAC, the reports that use this macro are not regenerated automatically. You must regenerate them manually.

Standard HR Macros

Page 113: 92825062 Overview ABAP HR

o The macro RP-PROVIDE-FROM-FRST retrieves the first (start) data record, which is valid in the

data

selection period.

o The macro RP-PROVIDE-FROM-LAST retrieves the last (latest) data record, which is valid in the

data

selection period.

o The macro RP-READ-INFOTYPE retrieves the data record(s), which is valid in the data selection

period.

How to check whether the macro operation is successful or not

For every macro, whether the operation was successful or not will be checked with

PNP-SW-FOUND.

If PNP-SW-FOUND = 1, then the operation is successful.

Where exactly the Macrocode is stored

The program code pertaining to this macro is stored in the control table RMAC

Guidelines for how and when to use the Standard Macros

o RP_PROVIDE_FROM_FRST

Use macro RP_PROVIDE_FROM_FRST in programs for the logical databases PNP and PAP where the

first data

record for a period (can be a subtype) is read from an infotype table. The infotype table has been

filled earlier

(for example, with GET PERNR or RP_READ_INFOTYPE). This macro is only helpful if the infotype has

time

constraint 1 or 2.

Prerequisites

The validity begin date of the time period must be before or the same as the validity end date.

Validity start and end dates are correct (preferably of the type DATE).

The infotype table is sorted in ascending order. Otherwise, you would receive the first fitting table entry

that might not necessarily correspond to the first time entry.

Features

The first entry for a specified period is placed in the table header entry from an internal infotype table.

Parameters

RP_PROVIDE_FROM_FRST inftytab subty beg end

Page 114: 92825062 Overview ABAP HR

IN: 1) Name of the internal table

2) Subtype required or SPACE if no subtype is being specified

3) Validity start date of the time interval

4) Validity end date of the time interval

OUT: 1)PNP-SW-FOUND: has the value 0 if there is no matching entry in the infotype table in the

given time

period. Otherwise it has the value 1.

2)The matching table header entry if PNP-SW-FOUND = 1 orthe initial table header entry if PNP-SW-

FOUND = 0

Example

(RP_PROVIDE_FROM_FRST inftytab subty beg end)

RP_PROVIDE_FROM_FIRST P0021 '1' PN-BEGDA PN-ENDDA.

IF PNP-SW-FOUND EQ '1'.

ENDIF.

or

RP_PROVIDE_FROM_FRST P0001 SPACE PN-BEGDA PN-ENDDA.

IF PNP-SW-FOUND EQ '0'.

WRITE: / 'Error: Org. assignment is missing' REJECT.

ENDIF.

o RP_PROVIDE_FROM_LAST

You use macro RP_PROVIDE_FROM_LAST in programs for the logical databases PNP and PAP where

the last data

record for a period (can be a subtype) is read from an infotype table. The infotype table has been

filled earlier

(for example, with GET PERNR or RP_READ_INFOTYPE). This macro is only helpful if the infotype (or

subtype)

has time constraint 1 or 2.

Prerequisites

The validity begin date of the time period must be before or the same as the validity end date.

Validity start and end dates are correct (preferably of the type DATE).

The infotype table is sorted in ascending order. Otherwise, you would receive the last fitting table entry

that might not necessarily correspond to the last time entry.

Features

The macro RP_PROVIDE_FROM_LAST makes sure that the last entry for a specified period is placed in

the table

header entry of the report output list.

Page 115: 92825062 Overview ABAP HR

Parameters

RP_PROVIDE_FROM_LAST inftytab subty beg end

IN: 1) Name of the internal table

2) Subtype required or SPACE if no subtype is being specified

3) Validity begin date of the time interval

4) Validity end date of the time interval

OUT:1) PNP-SW-FOUND: has the value 0 if there is no matching entry in the infotype table in the

given time

period. Otherwise it has the value 1.

2) The matching table header entry if PNP-SW-FOUND = 1 or the cleared table header entry if PNP-SW

-FOUND = 0

Example:

RP_PROVIDE_FROM_LAST P0021 '1' PN-BEGDA PN-ENDDA.IF PNP-SW-FOUND EQ '1'.

…ENDIF.ORRP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA.IF PNP-SW-FOUND

EQ '0'.WRITE: / 'Error: Org. assignment is missing'. REJECT.ENDIF.

· RP_READ_INFOTYPE

You can use the macro in all programs at any point. You can also use it in function modules. In

database PNP, an

infotype is usually read with GET PERNR. Using macro RP_READ_INFOTYPE is an exception.

You can also use the function module HR_READ_INFOTYPE. For information on how to use the function

module,

see the documentation on Function Modules.

Prerequisites

The validity begin date of the time period must be before or the same as the validity end date.

Validity begin and end are correct date specifications (preferably of the type DATE).

The infotype table must match the infotype number.

The program using the macro must contain the include DBPNPMAC.

Features

The macro RP_READ_INFOTYPE makes sure that all data records for a person for the specified period

are placed

in an internal infotype table.

Parameters

RP_READ_INFOTYPE pernr infty inftytab beg end

IN: 1) Personnel number of the person requested

2) Infotype number of the required infotype

3) Name of the internal infotype table

Page 116: 92825062 Overview ABAP HR

4) Validity start date of the time interval

5) Validity end date of the time interval

OUT: 1) PNP-SW-FOUND = 0, if there is no matching record in the dataset

PNP-SW-FOUND = 1, if there is no matching record in the dataset

2) PNP-SW-AUTH-SKIPPED-RECORD = 0, if the HR authorization check has not retained any records

due

to incorrect authorizations.

PNP-SW-AUTH-SKIPPED-RECORD = 1 , if the HR authorization check has retained at least one

record due to

lack of authorization

3) Internal infotype table, containing all matching records for which the user is authorized (this

table can

also be empty).

Example

(RP_READ_INFOTYPE pernr infty inftytab beg end) INFOTYPES: 0001. RP-LOWDATE-

HIGHDATE.DATA: PERNR LIKE P0001-PERNR.DATA: BEGDA LIKE P0001-BEGDA, ENDDA LIKE P0001-

ENDDA.PERNR = '12345678'.BEGDA = LOW-DATE + 15ENDDA = HIGH-DATE – 5.RP-READ-INFOTYPE

PERNR 0001 P0001 BEGDA ENDDA.IF PNP-SW-AUT-SKIPPED-RECORD EQ '1'.WRITE: / 'Insufficient

authorization'. STOP.ENDIF.IF PNP-SW-FOUND EQ '0'.WRITE: / 'Infotype 0001 missing'. STOP.ENDIF.