126
Introduction on SAP HR module-: The SAP HR module enables companies to effectively manage information about the people in their organization. It is integrated with other SAP modules and external systems. From the Organization Management perspective, companies can model a business hierarchy, the relationships of employees to various business units and the reporting structure among employees. The Personnel Administration (PA) sub module helps employers to track employee master data, work schedules, salary and benefits information. The Personnel Development (PD) functionality focuses on employees' skills, qualifications and career plans. Finally, the Time Evaluation and Payroll sub modules process attendance and absences, gross salary and tax calculations, and payments to employees and third party vendors.

Sap Hr - Wipro

  • Upload
    shiva12

  • View
    1.088

  • Download
    28

Embed Size (px)

Citation preview

Introduction on SAP HR module-:

The SAP HR module enables companies to effectively manage information about the people in

their organization. It is integrated with other SAP modules and external systems. From the

Organization Management perspective, companies can model a business hierarchy, the

relationships of employees to various business units and the reporting structure among employees.

The Personnel Administration (PA) sub module helps employers to track employee master data,

work schedules, salary and benefits information. The Personnel Development (PD) functionality

focuses on employees' skills, qualifications and career plans. Finally, the Time Evaluation and

Payroll sub modules process attendance and absences, gross salary and tax calculations, and

payments to employees and third party vendors.

Programming in Human Resource ______________________________________________________________________

What is HR ?

The task of Human Resource Management is to produce the organizational hierarchies, relationship between employees and to allow storage and administration of employee data .

Organization:

 We can define an organization as an individual enterprise (company or industry) in which someone is leading it and with some departments like HR, Marketing, Finance, R&D etc.

For any organization employees are the most powerful resource. So to maintain the employee related data we require one system which ensures accuracy and consistent within the organization.

Why HR is different from other modules?

The following concepts are defined in HR which differs this module with other modules

 1. Use of Infotypes

 2. The use of Logical Database

 3. Use of Macros

 4. Storage and Access of data

 5. Authorization checks

2

Programming in Human Resource ______________________________________________________________________

Logical Database:

The use of logical database is very important in HR ABAP Programming. Being an ABAP

programmer you may be knowing about Logical Database (LDB). But I will give a brief

description about the LDB keeping in mind the novice.

Introduction:

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.

A logical database is linked to an ABAP report program as one of the program attributes. It

supplies the report program with a set of hierarchically structured table entries derived from

different database tables. This saves the developer from having to program the data retrieval. For

example The HR PA has the logical database PNP. The program behind this LDB will be

SAPLDBPNP.

HR Logical Databases:

In Human Resources (HR), the following logical databases can be used

1) PNP

2) PAP

3) PCH

Logical Database PNP: Use logical database PNP to report on HR master data. It is possible to

use logical database PCH (This facility can be used only to access this data, but PNP meets such

reporting requirements more quickly because it is best suited to the task of selecting persons. To

use logical database PNP in your program, specify in your program attributes. Main functions of

the logical database PNP

Standard Selection screen

Data Retrieval

Authorization check 

Standard Selection Screen :

3

Programming in Human Resource ______________________________________________________________________

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.

GET PERNR event:

The GET PERNR event is executed for all personnel numbers where selected on the basis of

selection screen entries. Data is retrieved at the GET PERNR point. GET PERNR fills the internal

tables of the infotypes that are declared for each employee using the infotypes statement. The time

point should be viewed as a loop via the selected personnel numbers.

Note: PERNR is a data dictionary structure without a database. You must declare this structure

using the TABLES statement

Data Retrieval from LDB

1. Create data structures for infotypes.

4

Programming in Human Resource ______________________________________________________________________

    INFOTYPES: 0001, "ORG ASSIGNMENT                        0002, "PERSONAL DATA                         0008. "BASIC PAY2. Fill data structures with the infotype records.

    Start-of-selection.          GET PERNR.     End-of-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 DataAll 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 addressRP-PROVIDE-FROM-LAST P0006 1 PN-BEGDA PN-ENDDA.

We Will discuss about Read master data under processing infotypes.

5

Programming in Human Resource ______________________________________________________________________

This is the attributes screen of the program. Look at the field Logical database. You need to declare your required logical database at this place. I have declared the LDB as PNP.

Logical Database PCH: This logical database generally enables you to report on all HR infotypes.

However, you are advised not to use this logical database unless you want to report on Personnel

Planning data.

Logical Database PAP: Logical database PAP enables you to access data from Recruitment.

6

Programming in Human Resource ______________________________________________________________________

This is the PNP selection screen. You can customize the selection screen with your own fields by

change or create to HR report category.

7

Programming in Human Resource ______________________________________________________________________

We are going to discuss the following areas in HR.

1) Personnel Administration

2) Personnel Development

3) Time Management

4) Payroll

8

Programming in Human Resource ______________________________________________________________________

Personnel Administration: PA involves administrating employee data, commonly referred

to Master Data. Master Data contains all employee data used in HR processing. Master Data

includes Personal (Eg. address), Organizational (Position description), Benefits (Insurance,

Pension), Time & Payroll.  

Master Data is stored in Infotypes. Infotypes are tables (for user Data entry screen) that contain

logically related employee data. Data can be stored for specific periods, which includes current and

historical. 

Components of PA:

Personnel Area: represents a division of a company code into subunits. It is an

organizational entity representing an area within an organization defined by specific

aspects of personnel administration, time management and payroll. Personnel areas are

subdivided into personnel subareas. Personnel area is specific to HR and is a four character

alphanumeric identification. Eg. Personnel area 100 is for employees in Karnataka, 200 is

for Chennai. 

Personnel Subarea: is a further subdivision of Personnel area. It may represent

geographical locations. Functions include: 

     1.  Set groupings for Time Management, so that work schedules, substitution

and absence and leave types can be setup for  individual personnel subareas. 

     2. Generate default pay scale type and area for an employee's basic pay. 

     3. Define public holiday calendar. 

Employee Groups: divides or groups employees into various categories. Eg. Active

employees, Retired employees, Contractors. Employee groups are used to generate default

values for payroll accounting area and basic pay. 

Employee Subgroups: are further differentiated within the employee group. Eg. Salaried

employees, Hourly employees, unionized employees, Executives. The employee subgroup

grouping for the payroll rule allows you to define different payroll procedures for different

employee subgroups. For eg. You can specify whether an employee's pay should be

9

Programming in Human Resource ______________________________________________________________________

determined on hourly or monthly basis. The employee subgroup grouping for the work

schedule defines the validity of work schedule, and the attendance or absence quota type

determines the validity of time quotas.

10

Programming in Human Resource ______________________________________________________________________

Infotypes: Infotypes are units of information in the Human Resource System. They are used to

group data fields together that all relate to the same subject matter. Infotypes structure information,

and facilitate data entry and time-dependent data storage. From the user’s perspective, infotypes

are data entry screens. From the database perspective, infotypes are a data structure and a set of

data records that belong together. The ability to create histories for infotypes is ensured by time-

dependent infotype storage. The system records a validity period for each infotype record. Each

infotype entered for an employee usually has several data records that are distinguished one from

the other by their validity periods.

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.

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.

11

Programming in Human Resource ______________________________________________________________________

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

12

Programming in Human Resource ______________________________________________________________________

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 locked infotype record, and the other user

unlocks - that is, activates - the data record.

ENDDA: end date.

BEGDA: start date.

13

Programming in Human Resource ______________________________________________________________________

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.

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.

14

Programming in Human Resource ______________________________________________________________________

INFOTYPE PROCESSING:

After the Event GET PERNR point, the internal tables of the infotypes contain records and ready

for processing.

*Provide statementPROVIDE * from pnnnn between PN-BEGDA and PN-ENDDA. Write: / pnnnn-<field>.ENDPROVIDE

Pnnnn stands for internal table for infotype nnnn. It is similar to normal select

statement.

PROCESING A SPECIFIC INFOTYPE RECORD:

RP-PROVIDE-FROM-LAST Pnnnn SPACE PN-BEGDA PN-ENDDA.

RP-PROVIDE-FROM-FRST Pnnnn SPACE PN-BEGDA PN-ENDDA.

These statements make the newest or oldest record in the PN-BEGDA to PN-ENDDA data selecting period available in the structure Pnnnn for infotype nnnn.

STANADARD HR PROGRAM STEPS:Attach PNP Logical Database name in Attributes.Declare PERNR structure in tables.Includes if required.Selection-screen formatting.Start-of-Selection.

...required Validations.GET PERNR “Event starts here

Perform retrievePerform Populate…..All Performs

END-OF-SELECTION “event ends hereWrite/Download.

15

Programming in Human Resource ______________________________________________________________________

16

Programming in Human Resource ______________________________________________________________________

Using the logical database and reading master data.

Suppose you want to create a report which generates a list of employees with the following

information

Personnel number Name Language Date of birth

REPORT zamar. *-- Declaration TABLES: pernr. INFOTYPES: 0002. "Personal Data SELECT-OPTIONS: language FOR p0002-sprsl. *-- Selection screen INITIALIZATION. pnptimed = 'D'. *-- Processing GET pernr. PROVIDE * FROM p0002 BETWEEN pn-begda AND pn-endda. CHECK language. WRITE: / p0002-pernr, sy-vline, pernr-ename, sy-vline, p0002-sprsl, sy-vline, p0002-gbdat. ENDPROVIDE.

17

Look at the example below

Look at the example below

Programming in Human Resource ______________________________________________________________________

Suppose you require additional reports that combine data from different infotypesThen you need to join one or more infotypes.

Any number of infotypes can be linked by a JOIN

Note that changing data in any one of the infotypes linked by a join causes a split in the

selection period.

18

Programming in Human Resource ______________________________________________________________________

If infotypes linked by a JOIN have subtypes, processing must be restricted to one subtype using a WHERE condition, in which a subtype is queried.

In this example, the first partial interval only contains personal data. The record is not meaningful because the join's task of retrieving data from all of the infotypes in question has not been performed.

Using variable Pnnnn_VALID, the system recognizes that one partial interval only contains incomplete data.

When the report is run, this variable is created for each Pnnnn infotype included in a join.

If a partial interval for infotype Pnnnn contains data, its Pnnnn_VALID variable is filled with X.

19

Programming in Human Resource ______________________________________________________________________

The * in the PROVIDE statement, which stands for all of the fields in the infotype, is replaced by the five-digit field name of the infotype included in the projection.

The * in a simple PROVIDE means that all of the fields in the infotype are included in the projection.

JOIN and PROJECTION can be combined in a PROVIDE statement.

Infotype records are not allowed to overlap for projection. Data must be unique, which means that projection is only allowed for time constraints 1 and 2.

The logical validity of the activity period is stored in the infotype's BEGDA and ENDDA fields.

20

Programming in Human Resource ______________________________________________________________________

Join and Projection “Joining Infotypes”

At the end of this exercise, you will be able to:

Process the Personal Data infotype (0002) and Addresses infotype (0006) using a JOIN.

Make the processing of data dependent on the content of variable Pnnnn_VALID.

Suppose you want to create a report in which period the employee lived at which address under which name. The created list should contain the following information:

Start date

End date

Name

Place of residence

Only process the records from Infotype 0006 which have subtype 1.

Only print data for the periods for which address information is available.

Use a variable with the characteristics of field P0001-ENAME, so that the first and last name are only separated by one space. Use the statement CONCATENATE.

Enter a width of 100 characters for the list (addition LINE-SIZE for keyword REPORT).Restrict the length of the name to 30, and the length of the city to 20 characters.Separate the resulting field contents in your list by a vertical line (SY-VLINE).

REPORT zpsol020 LINE-SIZE 100. *-- declaration TABLES: pernr. INFOTYPES: 0002, "Personal Data 0006. "Address DATA: name LIKE p0001-ename. *-- Processing GET pernr. PROVIDE * FROM p0002

21

Look at the example below

Look at the example below

Programming in Human Resource ______________________________________________________________________

* FROM p0006 BETWEEN pn-begda AND pn-endda WHERE p0006-subty = '1'. IF p0006_valid EQ 'X'. CONCATENATE p0002-nachn p0002-vorna INTO name SEPARATED BY SPACE. PERFORM print_data. ENDIF. ENDPROVIDE. *-------------------------------------------------------------* * FORM PRINT_DATA *-------------------------------------------------------------* FORM print_data. WRITE: / p0002-pernr NO-ZERO, sy-vline, p0002-begda, sy-vline, p0002-endda, sy-vline, (30) name, sy-vline, (20) p0006-ort01. ENDFORM.

22

Programming in Human Resource ______________________________________________________________________

Join and Projection “Projection to Infotype Fields”

At the end of this exercise, you will be able to:

Project to particular fields by joining two infotypes.

Read texts from time-dependent table entries.

Suppose you want to create a report which documents how an employee’s job has developed. The created list should contain the following information:

Name Date of birth Start date End date Job key Job title

Project to the fields P0001-STELL and P0001-ENAME for infotype 0001. Project to field P0002-GBDAT for infotype 0002.

Only print data for the periods in which organizational assignment information is available.

Before reading table T513S, check that the table entry to be read for the job key in question is already in the work area. To do this, use the statement CHECK.If the required table entry does not exist, print the personnel number, an error text, and the job key text.End further processing with the REJECT statement.

Enter a width of 100 characters for the list (addition LINE-SIZE for keyword REPORT).Restrict the length of the name to 20, and the length of the job title to 15 characters.Separate the resulting field contents in your list by a vertical line (SY-VLINE).

23

Look at the example below

Look at the example below

Programming in Human Resource ______________________________________________________________________

REPORT zpsol030 LINE-SIZE 100. *-- Declaration TABLES: pernr, T513S. "Job Titles INFOTYPES: 0001, "Organ. Assignment 0002. "Personal Data *-- Processing GET pernr. PROVIDE stell ename FROM p0001 gbdat FROM p0002 BETWEEN pn-begda and pn-endda. IF p0001_valid EQ 'X'. IF p0001-stell NE space. PERFORM re513s. WRITE: / pernr-pernr, sy-vline, (20) p0001-ename, sy-vline, p0002-gbdat, sy-vline, p0001-stell, sy-vline, (15) t513s-stltx, sy-vline, p0001-begda, sy-vline, p0001-endda. ENDIF. ENDIF. ENDPROVIDE.

*-------------------------------------------------------------** FORM RE513S *-------------------------------------------------------------** Read Job Title *-------------------------------------------------------------*FORM re513s. CHECK sy-langu NE t513s-sprsl OR p0001-stell NE t513s-stell OR p0001-begda LT t513s-begda OR p0001-begda GT t513s-endda. SELECT * FROM t513s WHERE sprsl EQ sy-langu

24

Programming in Human Resource ______________________________________________________________________

AND stell EQ p0001-stell AND endda GE p0001-begda AND begda LE p0001-begda. ENDSELECT. IF sy-subrc NE 0. CLEAR t513s. WRITE: / pernr-pernr, ‘No entry in T513S for job key’ (001), p0001-stell. REJECT. ENDIF. ENDFORM.

25

Programming in Human Resource ______________________________________________________________________

HR Macros and Function Modules:

At the conclusion of this chapter you will be able to use HR macros and read infotypes without using logical database.

Like subroutines and function modules, macro modules can be used to modularize programs. Macro modules are frequently used in HR.

These macros are defined in program SAPDBPNP (include DBPNPMAC) with the keyword DEFINE. They can be used in any program that uses the logical database PNP.

If you want to use these macros in reports that do not use the logical database PNP, you must include program DBPNPMAC with the keyword INCLUDE.

You can also define your own macros. In accordance with the naming convention, the first two letters stand for the application.

Some macros are also stored in the Macros in ABAP Programs table (TRMAC)

26

Programming in Human Resource ______________________________________________________________________

The RP_PROVIDE_FROM_LAST macro retrieves the last valid data record in the data selection period.

The parameters for RP_PROVIDE_FROM_LAST are: infotype, subtype, start date, and end date. If you do not want to specify a particular subtype, enter SPACE.

You can process not only the last valid data record in the data selection period, but also the first valid data record using the RP_PROVIDE_FROM_FRST macro.

The macro return code PNP-SW-FOUND has the value 1 if a suitable entry exists in the infotype table for the specified period. If no entry is found, the value is 0.

27

Programming in Human Resource ______________________________________________________________________

When the START-OF-SELECTION event occurs, the RP_SET_DATA_INTERVAL macro ensures that the only records imported from database table PAnnnn to internal table Pnnnn are those which are valid in the data selection period.

28

Programming in Human Resource ______________________________________________________________________

It is often necessary to read the groupings stored in the Personnel Area/Subarea table because they are required as keys for other tables. This must take place individually for each personnel number to be processed.

Each employee's assignment to a personnel area and subarea is stored in infotype 0001.

The parameters of the macro are:

Personnel areas

Personnel subareas

Reaction, if no entry is found:

X = Termination of report with error message ‘No entry found in table ...’

SPACE = SY-SUBRC is set to 4.

Alternatively, if you only want to determine the country indicator, you can use the function module HR_COUNTRY_GROUPING_GET.

29

Programming in Human Resource ______________________________________________________________________

You can also read infotype records for a particular personnel number without using the logical database.

To do this, use the function module HR_READ_INFOTYPE. However, you must ensure that the internal table for the required infotype is declared with the INFOTYPE statement.

30

Programming in Human Resource ______________________________________________________________________

The function module reads the HR infotype records for a person (employee or applicant) in accordance with the specified selection criteria. Values are returned in an internal table, the structure of which corresponds to the appropriate infotype table. In the calling program, such tables can be declared with the INFOTYPES statement, for example. An infotype record is selected if its validity period overlaps with the specified period.

The function module performs an authorization check.

The following specifications are possible for the return code:0: The return table contains all required records4: The return table contains all records, however, it is incomplete due to missing authorization8: The return table is empty because no records were found with the specified criteria12: The return table is empty due to missing authorization

Note: You should not use this function module in reports that use the logical database PNP. If you want to read an infotype separately in one of these reports, you can call the subroutine READ-INFOTYPE directly in the database program SAPDBPNP (PERFORM READ-INFOTYPE(SAPDBPNP)). . .). If this is the case, you declare the infotypes in the statement INFOTYPES with supplement MODE N.

31

Programming in Human Resource ______________________________________________________________________

With this function module, you can determine the initial start date of an employee. You can take the following infotypes into account when you determine this date:- P0000 Actions- P0001 Organizational Assignment- P0016 Contract Elements- P0041 Date Specifications

The transfer parameter CHECK_INFOTYPES is used to determine which of these infotypes are taken into account. The employment status (parameter STATUS2) can also be specified for infotype P0000. In infotype P0016, only the Entry data field (P0016-EINDT) is taken into account. For infotype P0041, the corresponding date type can be given in the transfer parameter DATUMSART. The date type '01' is usually used for the technical entry date.

Most function modules in HR have the letters 'HR' or 'RP' in the first two characters of their name. To find additional modules, use the search function in the Function Builder.

32

Programming in Human Resource ______________________________________________________________________

Before you change employee data, you must lock the personnel number. You can do this with the function module BAPI_EMPLOYEE_ENQUEUE.

Messages are returned in the parameter RETURN. If an error occurs, this structure contains the following information:- Message type (field TYPE)- Message text (field MESSAGE).If the step is successful, the structure is blank.

If an employee's data has been locked, only the user who has locked the data can access the data records linked to the employee. For other users, access is denied. For this reason, you must remove the lock after the data has been changed. You can do this with the function module BAPI_EMPLOYEE_DEQUEUE.

33

Programming in Human Resource ______________________________________________________________________

With this function module, you can maintain the employee and applicant master data. You can specify one data record. All validations that would normally take place if the infotypes were maintained online with the individual maintenance screens are also carried out here. The module returns the same error messages as in the online operation. This means the error messages for the individual maintenance screens are displayed rather than interpreted. The update is carried out by a 'Call dialog' to the module pool for the infotype. This means that some restrictions apply to the infotypes processed in that way (see documentation for module).

The following values are amongst those available for the parameter OPERATION: MOD (change), COPY (copy), DEL (delete), INS (insert), LIS9 (delimit).

With the parameter DIALOG_MODE, you specify whether the action is generally run in the background or whether it only runs in the background until an error occurs, or whether the changes are generally carried out in the dialog mode. Possible values:'0' The changes are generally processed in the background. If an error occurs (with an E or A message), the complete step is terminated and the module returns the corresponding error message in the structure 'RETURN'. '1' The changes are generally processed in the background. If an error occurs, the system switches to dialog mode so that the user can correct the entries. '2' The changes are processed in the dialog mode.

34

Programming in Human Resource ______________________________________________________________________

If you cannot use the function module HR_INFOTYPE_OPERATION, you can use the UPDATE statement. Note that the system does not check the correctness of the new field contents when a direct DB update takes place.

In this example, the field P0002-NATIO (nationality) in DB table PA0002 is updated directly. The field contents is changed from ‚DE' to ‚D'. The incorrect value 'D' in field PA0002-NATION then triggers an error message when the infotype record is changed or copied in dialog mode.

The system field SY-DBCNT contains the number of changed records.

Authorization checks are not supported by the UPDATE statement and should be carried out on the program level.

Many HR reports use macros. Their program codes are stored in a table or defined locally using the DEFINE keyword.

The RP_PROVIDE_LAST macro writes the last valid record in the data selection period to the header line of the internal Infotype table.

You can use the function module HR_READ_INFOTYPE to read the personal data in reports which do not use an HR logical database.

35

Programming in Human Resource ______________________________________________________________________

Specific Commands “Macros”

At the end of this exercise, you will be able to:

Use the macro RP_PROVIDE_FROM_LAST to retrieve the last valid record in the data selection period.

Use the macro RP-READ-T001P to read the Personnel Area/Personnel Subarea table.

Suppose you need to create a report that will generate a list of the recurring payments and deductions for each employee.The list should contain the following information for each employee:

Personnel number

Name

Personnel area

Personnel subarea text

In the following lines, print:

Wage type

Wage type text

Amount

Start date

End date

Employees who have no recurring payments or deductions should not appear on the list. If employees do not have a record for infotype 0014, the internal table P0014 is empty at the GET PERNR event. Use the keyword DESCRIBE to query the characteristics of this table.

To place the last infotype 0001 record valid in the data selection period in the header of internal table P0001, use the macro RP_PROVIDE_FROM_LAST.

36

Look at the example below

Look at the example below

Programming in Human Resource ______________________________________________________________________

To read table T001P (Personnel Area/Subarea), use the macro RP-READ-T001P. The country indicator is assigned to each personnel area/subarea in the field T001P-MOLGA. The country indicator is part of the key for table T512T (Wage Type Texts). The personnel area text is taken from field T001P-BTEXT.

Read the accompanying wage type texts for the wage types for infotype 0014 from table T512T. Before reading table T512T, check that the table entry to be read is already in the workarea. To do this, use the statement CHECK.Restrict the length of the name to 20 characters.

REPORT zpsol040 . *-- Declaration TABLES: pernr, t512t, "Wage type text t001p. ”Plant sectionINFOTYPES: 0001, "Organ. Assignment 0014. "Recurr. Earn. & Deduc. DATA: filled_lines LIKE sy-index. *-- Processing GET pernr. DESCRIBE TABLE p0014 LINES filled_lines. IF filled_lines GT 0. rp_provide_from_last p0001 space pn-begda pn-endda. rp-read-t001p p0001-werks p0001-btrtl space. SKIP 2. WRITE: / pernr-pernr, (20) p0001-ename, p0001-werks, t001p-btext. PROVIDE * FROM p0014 BETWEEN pn-begda AND pn-endda. CHECK p0014-betrg NE 0. PERFORM print USING p0014-lgart p0014-betrg p0014-begda p0014-endda. ENDPROVIDE. ENDIF.

*-------------------------------------------------------------** FORM PRINT *-------------------------------------------------------------*

37

Programming in Human Resource ______________________________________________________________________

* Print List *-------------------------------------------------------------*FORM print USING value(wtype) value(amount) value(begda) value(endda). PERFORM re512t USING t001p-molga wtype. WRITE: / wtype UNDER p0001-ename, T512T-LGTXT, amount, begda, endda. ENDFORM.

*-------------------------------------------------------------* * FORM RE512T *-------------------------------------------------------------* * Read Wage Type Texts *-------------------------------------------------------------* FORM re512t USING value(country_grouping) value(wtype). CHECK t512t-sprsl NE sy-langu OR t512t-molga NE country_grouping OR t512t-lgart NE wtype. SELECT SINGLE * FROM t512t WHERE sprsl EQ sy-langu AND molga EQ country_grouping AND lgart EQ wtype. IF sy-subrc NE 0. CLEAR t512t. ENDIF. ENDFORM.

38

Programming in Human Resource ______________________________________________________________________

Few things need to be known about INFOTYPE:

An Infotype has an entry in check table T777D, and several infotype-dependent elements in the Repository.

In addition to the structures and database tables discussed in unit 2 (Data Structures in HR), each Infotype has a module pool containing the Infotype-specific entry and list screens with their validations, and a dialog module.

When you create individual elements, take careful note of the following:

Some Infotype-dependent Infotype objects must be processed using the Data Dictionary.

Some Infotype elements must be processed using the Infotype copy functions within Personnel Planning and Personnel Administration. These functions have been created for this specific purpose.

Some Infotype-dependent settings must be made using Customizing for infotypes.

If you follow these instructions, inconsistencies will not affect your Infotype-dependent objects and table entries. Creating and enhancing infotypes is discussed in more detail later in this unit.

39

Programming in Human Resource ______________________________________________________________________

When working with infotypes, it is important to comply with the above namespace conventions.

Other namespace conventions for standard infotypes:

Time Management infotypes are assigned to namespace 2000-2999

Recruitment infotypes are assigned to namespace 4000-4999

There are three different ways of storing customer-specific information in infotypes:

You can use the fields that already exist in standard infotypes. For example, you can store the required information in a specific field of a standard infotype that you have not used before.

You can enhance a standard Infotype, which means creating the fields that you require in a cluster include.

You can create a new Infotype with the fields that you require.

Before you enhance standard infotypes or create new infotypes, you should always determine whether the infotypes included in the standard system meet your requirements.

40

Programming in Human Resource ______________________________________________________________________

Problem: You want to store specific information in the system.

Procedure: Check all of the standard infotypes to determine whether one of the fields in a standard Infotype can be used to store this information.

Situation: You find an Infotype that contains a suitable field.

Procedure: Use this Infotype to store your specific information.

Example: You want to store the following item of information: “position entitled to company car”.

Use standard Infotype 1010 (Authorities/Resources).

Note: Information on specific fields is obtained from Infotype-specific structure Pnnnn (or from structure PSnnnn or HRInnnn).

41

Programming in Human Resource ______________________________________________________________________

These are some of the most important HR Infotypes

0000    Actions0001    Org assignment 0002    Personal information 0003    Payroll data 0007    Work time 0008    Basic pay 0014    Reoccurring pay 0015   Additional Payments0027   Cost Distribution0041   Date Specifications0057   Membership Fees0165   Over ride  to limits on deductions 0167   Health 0168   Insurance 0169   Savings 0170   Spending    0194   Garnishment reduction 0195   Garnishment order 0207   Residence Tax 0208   Work Tax 0209   Unemployment Tax 0210   Withholding 0216   Garnishment adjustment 0221   Adjustment 0267   Off cycle

2001 Absences

2002 Attendances

2003 Substitutions

2004 Availability

2005   Over Time

2006 Absence Quotas

2007 Attendance Quotas

2010   Employee Remuneration Info1000   Infotypes 1000 – 1999 are PD Relationship infotypes

42

Programming in Human Resource ______________________________________________________________________

PD ( Planning and Development) : You can use the Personnel Development component to

maximize employees’ utility within your company. You can plan and implement specific

personnel and training measures to promote the professional development of your employees. A

company’s personnel development needs are determined by comparing current or future work

requirements with employees’ qualifications, preferences and aspirations.

Organizational Units:  describe the different business areas within your company. Org. Units must exist in a company organization structure and be linked to one another in order to create a hierarchical structure for your company and a link between the objects. Use transaction PP02 to create Org.Units. Object type 'O'. Following is a three level hierarchy. Table HRP1000. One Org. Unit can be related to another Org. Unit. 

Jobs: A job is the general classification for a set of tasks. Eg. manager, customer service representative. Each Job identifies a unique classification of activity. Employees hold positions and not Jobs. Jobs are linked to Positions, which are held by employees. Equal number of positions should be created for each Job. Use transaction PP02 to create Org.Units. Object type 'C'. Table HRP1000.

Positions:  are specific jobs performed by individuals in a company. Each position is occupied by one employee. Eg. HR Manager. Positions not assigned to employees are known as vacancies. One Position can be assigned to more than one person. Eg. the first employee may work 50% and the other will work the remainder 50%. Position belongs to a Job which describes the Position. Use transaction PP02 to create Org.Units. Object type 'S'. Table HRP1000

Manager

HR Manager  Accounting Manager

Relationship between objects: Table HRP1001. Transaction PP02 (Infotype 1001)

43

Programming in Human Resource ______________________________________________________________________

In the Dictionary, each HRPnnnn infotype table is defined using the following three include structures:

HRIKEY: contains the key fields of the infotype table

HRIADMIN: contains administrative information on the infotype record (including the date on which it was last changed, and the user name of the person who made this last change)

HRInnnn: contains the infotype-specific fields with the actual infotype data or information

To ensure that transparent table HRPnnnn and logical structure Pnnnn always remain mutually consistent, structure HRInnnn is also included by structure Pnnnn.

44

Programming in Human Resource ______________________________________________________________________

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

MANDT: legally and organizationally independent participants in the system.

PLVAR: a one or two-character alphanumeric plan version key that is used to make a distinction between different organizational plans.

OTYPE: a one or two-character alphanumeric object key (such as ‘S’ for position, ‘Q’ for qualification, and ‘E’ for business event).

OBJID: an eight-digit, non-mnemonic key that represents a single object (such as an organizational unit, qualification, or business event).

SUBTY: subtypes are subdivisions of infotypes. An infotype’s subtypes can have different time constraints and form their own histories.

ISTAT: a one-digit key that stands for a planning status. All objects and their defining infotypes have a status. This enables you to put objects and infotypes through a planning cycle.

BEGDA: end date.

ENDDA: start date.

VARYF: variation field of the PLOG file (that contains the target object for relationships).

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). It is assigned by the system automatically.

45

Programming in Human Resource ______________________________________________________________________

Report RHMOVE00 transports Planning data records from the R/3 System to a sequential file.

This sequential dataset can be displayed and edited using report RHMOVE40.

Report RHALTD00 uses a sequential dataset to create a batch input session.

Structure E1Pnnn must be used for records of infotype Pnnnn. This is the IDoc segment structure of the infotype.

Structure E1Pnnnn is expanded for table infotypes - that is, it contains the primary record and the table division of the table infotype.

Structure E1PADnn must be used for relationships with additional data of structure PADnn. For the assignment, see table T77AD.

46

Programming in Human Resource ______________________________________________________________________

Reporting in PD using PCH Logical database:

At the end of this chapter , you will be able to:Explain the functions and data structures of logical database PCHCreate reports for sequential evalutions of the organizational structureCreate reports for structural evalutions of the organizational structureEvaluate additional data on relationships

Relationships are stored on the database in two directions.

47

Programming in Human Resource ______________________________________________________________________

"Job" is used as a general classification, such as secretary or head of department.

More than one employee can have the same job. For example, twenty employees can have the job of secretary.

A position is the assignment of an individual employee in your enterprise, for example, sales manager, secretary in the marketing department. You form the structure (organigram) of your enterprise by creating positions and linking them to each other.

48

Programming in Human Resource ______________________________________________________________________

Positions must be linked to an organizational unit. However, if you want to view the position hierarchy, you must create a reporting structure by relating positions to each other.

An organizational unit can incorporate one or more positions. A position belongs to an organizational unit.

Example:The organizational unit Personnel incorporates the positions Head of Department and Secretary.The position Secretary belongs to the organizational unit Human Resources.

49

Programming in Human Resource ______________________________________________________________________

If Organizational Management is integrated with master data, the holder relationship between position and person is also stored for the person in the Organizational Assignment infotype (0001), despite the fact that the data is redundant.

50

Programming in Human Resource ______________________________________________________________________

The Object infotype performs key functions. It enables you to create new objects, such as organizational units and jobs, and determines the validity period of other infotypes that describe the characteristics of existing objects.

Once you have used this infotype to create an object, its characteristics can be described using other infotypes such as the Relationships Infotype (1001) and the Description Infotype (1002).

The Object Infotype (1000) defines an object's existence. You can use it to store a short text and a long text on the object. An object is uniquely identified by its:- Plan variant- Object type- Object identification

Records stored in the Relationships Infotype (1001) serve as a descriptive and functional link between objects. For example:

A person is the holder of a positionA position belongs to an organizational unitAn organizational unit is assigned to a cost center in CO

51

Programming in Human Resource ______________________________________________________________________

The relationships between basic object types are defined in the standard system and should not be changed.

Each standard relationship has a three-digit code. The customer namespace is from AAA to ZZZ.

Relationships between objects are reciprocal. If a job describes a position, for example, then the position is described by the job. When you assign a relationship, the system automatically creates its inverse relationship. This enables you to carry out reporting from either perspective.

52

Programming in Human Resource ______________________________________________________________________

The Pnnnn structure contains an infotype's key fields and data fields.

The PTnnnn structure contains the table infotype data fields for some infotypes.

The PADnn structure defines additional data for particular relationships.

The transparent HRPnnnn tables contain the infotypes used in Personnel Planning. Table infotypes are stored in the HRTnnnn tables. Additional data on relationships is stored in the HRPADnn tables.

Transparent table PLOGI contains an index of all objects on the Personnel Planning database. They can be displayed and created with report RHPLOGI0. This object directory is the basis of all evaluations using logical database PCH.

53

Programming in Human Resource ______________________________________________________________________

For each selected object, internal table Pnnnn is filled per infotype with all available infotype records.

The infotypes from Personnel Administration can also be imported.

54

Programming in Human Resource ______________________________________________________________________

The only difference between a structural and sequential evaluation is the additional GDSTR entry in the TABLES statement. This ensures that the structure parameters are shown on the standard selection screen.

Note:If you do not specify an evaluation path before starting the program, a sequential evaluation is performed.

When the INITIALIZATION event occurs, you can set default values for the selection screen.

The fields for the object ID are defined in include DBPCHSEL. This is an internal table (PCHOBJID) that must be filled with APPEND.

55

Programming in Human Resource ______________________________________________________________________

For each selected object, internal table Pnnnn is filled per infotype with all available infotype records.

For each selected object, the OBJEC structure contains the most important information from infotype 1000 (plan version, object type, object ID, short text, and long text).

The GDSTR structure contains information on the current hierarchy, such as the root object and the number of objects within the hierarchy. The value of the structure does not change unless the system reaches a new hierarchy root when a structural evaluation is performed for more than one root object.

For each selected object, the STRUC structure contains internal structure information. In particular, it includes information on the relationship used by the system to select the current object along the evaluation path.

56

Programming in Human Resource ______________________________________________________________________

RH-GET-TBDAT is a macro for logical database PCH. These macros are defined in include DBPCHCOM. With this macro, you can import the data for an infotype with a repetitive structure. See also Table Infotypes.

The parameters for macro RH-GET-TBDAT are:Parameter 1 : InfotypeParameter 2 : Reference fieldParameter 3 : Table for structure PTnnnn

Macros for logical database PCH must not be confused with macros for logical database PNP. Please note that you cannot use macros for logical databases PCH and PNP at the same time.

57

Programming in Human Resource ______________________________________________________________________

Function module RH_READ_INFTY can be used to read Personnel Planning infotype records (function group RHDB) in programs without logical database PCH (module pools, reports of other logical databases).

The function module reads all of the infotype records for a specific infotype or (parameter INFTY = SPACE) all of the infotypes for the specified set of objects.

Depending on the AUTHORITY and WITH_STRU_AUTH parameters, the function module performs an authorization check.

58

Programming in Human Resource ______________________________________________________________________

Logical Database PCH – Exercise

At the end of this exercise, you will be able to:

Program a structural evaluation.

Select administration infotypes using the logical database PCH.

Understand the evaluation principle ‘search to depth’.

Suppose you require an overview of the staff positions with the name of the employees holding these positions and their telephone numbers.

Write a report that lists the staff positions in the organization structure along with the persons assigned to these positions.Use the evaluation path O-S-P.

For the personal data (first name, last name), use the infotype 0002 records for the person. For the telephone number, use subtype 1 from infotype 0006.

The staff position information is contained in infotype 1003 for the position. If the position is flagged as a staff position, the field P1003-STABS has the value “X”.

Process the records from infotypes 0006 and 0002 with a join. For these infotypes, project to the First name, Last name, Telephone number, and Subtype fields.

For holders of staff positions only, display the object ID, the object identifier, and the object name. Display this in one line. In the following line, display the name and the telephone number.

The object type O and the evaluation path should appear in the selection screen as default values.

REPORT zhsol010. TABLES: objec, gdstr. INFOTYPES: 0002, 0006, 1003. DATA: stabs LIKE p1003-stabs, name LIKE p0001-ename. INITIALIZATION. pchotype = 'O'. pchwegid = 'O-S-P'.

59

Look at the example below

Look at the example below

Programming in Human Resource ______________________________________________________________________

GET objec. IF objec-otype = 'S'. CLEAR stabs. LOOP AT p1003 WHERE begda LE pc-endda AND endda GE pc-begda. IF p1003-stabs = 'X'. stabs = 'X'. WRITE : / objec-objid, objec-short, objec-stext. ENDIF. ENDLOOP. ENDIF. IF objec-otype = 'P' AND stabs = 'X'. PROVIDE vorna nachn FROM p0002 subty telnr FROM p0006 BETWEEN pc-begda and pc-endda WHERE p0006-subty = '1'. IF p0006_valid = 'X'. CONCATENATE p0002-vorna p0002-nachn INTO name SEPARATED BY SPACE. WRITE: / name, p0006-telnr. SKIP. ENDIF. ENDPROVIDE. ENDIF.

60

Programming in Human Resource ______________________________________________________________________

Time Management

SAP HR Time Management functionality includes time collection, evaluation of time and absence data for payroll, leave management and reporting. It also automatically calculates leave accruals, overtime, shift premiums and bonuses.  

Time data is used to process Payroll, internal & external reporting. Payroll needs Time data to process:

Hours worked Overtime Shift times Vacation Absence to be paid

Time is also used for 

Internal reporting - by management to evaluate and project costs. External reporting - tracking of time data for Labor Union requirement etc. For eg. Labor union requires statistical data concerning the amount of overtime spent on certain shifts etc.

61

Programming in Human Resource ______________________________________________________________________

Time data is stored in various infotypes. This data is evaluated according to various rules during time evaluation and the processed data is transferred to payroll.

Time data is generally collected by a third party recording terminal. Time data is recorded in various ways. eg. Punch cards, Manual time sheets that stores hours worked for each day along with any absences. 

All the absence's and attendance in a day are uploaded into SAP and analyzed using the pre-defined times in the employees Work Schedule rule. After processing the time events, the system generates wage types and time types based on pre-defined rules within the time evaluation program. These wage types and time types are then used for Interfacing to payroll, reporting etc.

The employee work schedule is an integral part of R/3 Time Management containing the planned specifications for employee working time.An employee’s planned working time is represented in a work schedule. The work schedule is generated from a period work schedule and a public holiday calendar. The period work schedule comprises a set sequence of daily work schedules. The daily work schedule contains information on a day’s working time including breaks. The sequence can reflect regular and variable working times. The period work schedule is applied to the calendar, taking into account specifications in the public holiday calendar. The work schedule rule encompasses all the specifications required to define the work schedule.The work schedule is used as the basis for time data evaluation.

Examples:

62

Programming in Human Resource ______________________________________________________________________

The work schedule shows how many hours salaried employees must work to be entitled to their full salary. Depending on the specifications defined for the individual employee, any additional hours worked are identified as overtime in R/3 Time Evaluation.If you only record deviations to the work schedule, planned working time is used as the basis for time evaluation.You assign a work schedule to an employee in the Planned Working Time infotype (0007) using work schedule rules.

The standard R/3 System already contains public holiday calendars that include regional public holidays. You can change existing and define new public holidays in the public holiday list. In addition, you can change existing or define new public holiday calendars. You assign a public holiday calendar to a personnel subarea.Public holidays are taken into account when determining bonuses or calculating leave, for example.

63

Programming in Human Resource ______________________________________________________________________

In R/3 Time Management, there are certain infotype records that you must create for every employee. Time management data is stored in the same master data records used by other HR areas, such as R/3 Payroll Accounting or R/3 Personnel Planning and Development.

The following master data infotypes are required for Time Management: Organizational Assignment (0001) Personal Data (0002) Planned Working Time (0007):

You must have entered the appropriate Time Management status, determining whether the employee‘s time data is processed in R/3 Time Evaluation or in R/3 Payroll Accounting.

Time Recording Info (0050):This infotype is used in R/3 Time Evaluation. It can contain interface data on the subsystem and additional data on the employee that is relevant for time evaluation.Employees leave entitlement is managed in the Absence Quotas infotype (2006).

64

Programming in Human Resource ______________________________________________________________________

If an employee records his or her actual times at a time recording system, you can view the recorded time events in the Time Events infotype (2011).You can use the Time Events infotype (2011) to enter or correct time events that were not uploaded or that were incorrectly uploaded to the SAP R/3 System. You can use list entry to enter several time events for one personnel number at the same time.The infotype contains information on the origin of the record (whether it was recorded manually or by a subsystem) and on the terminal ID, for instance.The infotype can also store information on a different payment (premium, different pay scale group, and so on) or a different cost center. The information can either be entered manually or by a time recording system.

65

Programming in Human Resource ______________________________________________________________________

Time evaluation is performed by the time evaluation driver RPTIME00. It evaluates employees' time data that has been recorded either at the time recording terminals or in the time management infotypes. Time evaluation generally runs once daily, overnight, and is started using a batch job. It is normally used for large groups of employees. You can also run time evaluation for individual employees or groups of employees, or for particular past evaluation periods. This function is particularly useful for test purposes, for example.The time evaluation report can also be run for future periods. A future evaluation can be useful in the following situations: You want time evaluation to determine an employee’s anticiapted absence entitlements when

absence quotas are built up automatically. You want to evaluate planned times in shift planning while taking anticipated overtime income into

account, for example.

66

Programming in Human Resource ______________________________________________________________________

Reading DataInfotypes 2000 to 2999 are time infotypes. The time data in these infotypes stored intables PA2000 to PA2999. Infotypes are declared with the INFOTYPE statement, anddata is made available for processing in the internal infotype tables (infotype 2011 is anexception).

You should not load all time infotype records from the lowest to highest system datesinto the main memory. This would quickly lead to a memory overload, especially if afront-end time recording system is connected to your HR system.This is why time data should be read only for a specific period.Use the infotype declaration supplement MODE N to define that the internal timeinfotype tables should be declared but not filled at the GET PERNR time point.Later you can fill these tables using a statement with selection period parameters.Use the following report to read time data:

REPORT RPABAP05.TABLES: PERNR.INFOTYPES: 2001 MODE N.GET PERNR.RP-READ-ALL-TIME-ITY PN/BEGDA PN/ENDDA.LOOP AT P2001.WRITE: / P2001-ABWTG.ENDLOOP.

An ABAP/4 macro reads the time data. This macro uses the data selection periodparameter of the selection screen.

Due to the time constraint of infotypes, several special features must be taken intoaccount when processing time data. Views of time data are generally not practical.In time infotypes, data is determined on the basis of the validity period.When you enter an absence record, the number of days of absence is calculated on thebasis of the absence period.In a view, new partial periods are created without any changes being made to infotypedata. This would lead to incorrect results in time infotypes, since this data depends on thevalidity period.For example, if, a leave record extends from the middle of January to the middle ofFebruary and 20 days of leave are calculated for this period, then a view for the month ofFebruary would result in a leave record which extends from the beginning to the middleof February. The number of days of leave would not have changed and the informationwould be incorrect.In master data, the time constraint is a definite feature of the infotype or subtype. Thereare no time dependencies between infotypes and subtypes.Time data is basically different. Let us assume that an employee becomes sick duringvacation. The leave record is then delimited on the first day of the sickness, and thesickness record follows.

67

Programming in Human Resource ______________________________________________________________________

Likewise, the system prohibits the entry of a leave record that coincides with a sicknessrecord. The same also applies to overtime during a sickness.The time dependency of time infotype records is not limited only to dependenciesbetween records of one and the same infotype, but covers all infotypes and subtypes.The time constraint of time infotypes is not an attribute but is defined by therelationships between infotypes.

Moreover, certain time infotype records have specific clock-in/clock out times. Severalrecords may therefore exist for one infotype on a particular day.Since views require explicit data and this prerequisite is not fulfilled by time infotypes,you should not use joins and projections for time data.

Time infotype tables are processed with the LOOP statement since the PROVIDEstatement limits, and thus changes, the infotype begin and end dates to the data selectionperiod.

Processing 'Time Data'.· Dependence of time data on validity period· Importing time data· Processing time data using internal tables

Time Data and Validity Period· Time data always applies to a specific validity period.· The validity periods of different types of time data are not always the same as the date selection period specified in the selection screen.

Date selection period |---------------| Leave |-------------|

· PROVIDE in this case is therefore not used for time infotypes.

Importing Time Data· GET PERNR reads all time infotypes from the lowest to highest system data, not only those within the date selection period.· To prevent memory overload, add MODE N to the infotype declaration. This prevents the logical database from importing all data into infotype tables at GET PERNR.· Use macro RP-READ-ALL-TIME-ITY to fill infotype table.

INFOTYPES: 2001 MODE N.GET PERNR.    RP-READ-ALL-TIME-ITY PN/BEGDA PN/ENDDA.    LOOP AT P0021.         If P0021-XYZ = ' '. A=B. Endif.     ENDLOOP.

68

Programming in Human Resource ______________________________________________________________________

Processing Time Data· Once data is imported into infotype tables, you can use an internal table to process the interested data.DATA: BEGIN OF ITAB OCCURS 0,              BUKRS LIKE P0001-BUKRS, "COMPANY              WERKS LIKE P0001-WERKS, "PERSONNEL AREA              AWART LIKE P2001-AWART, "ABS./ATTEND. TYPE              ASWTG LIKE P2001-ASWTG, "ABS./ATTEND. DAYS           END OF ITAB.GET PERNR.RP-PROVIDE-FROM-LAST P0001 SAPCE PN-BEGDA PN-ENDDA.CLEAR ITAB.ITAB-BUKRS = P0001-BURKS. ITAB-WERKS = P0001-WERKS.RP-READ-ALL-TIME-ITY PN/BEGDA PN/ENDDA.LOOP AT P2001.      ITAB-AWART = P2001-AWART. ITAB-ASWTG = P2001-ASWTG.      COLLECT ITAB. (OR: APPEND ITAB.)ENDLOOP.

69

Programming in Human Resource ______________________________________________________________________

Cluster Tables and Payroll :

Cluster tables combine the data from several tables with identical (or almost identical) keys  into one physical record on the database.Data is written to a database in compressed form.

Retrieval of data is very fast if the primary key is known.

Cluster tables are defined in the data dictionary as transparent tables.

External programs can NOT interpret the data in a cluster table.

Special language elements EXPORT TO DATABASE, IMPORT TO DATABASE and DELETE  FROM DATABASE are used to process data in the cluster tables.

PCL1 - Database for HR work area; PCL2 - Accounting Results (time, travel expense and payroll);PCL3 - Applicant tracking data;PCL4 - Documents, Payroll year-end Tax data

Database Tables PCLn

PCLn database tables are divided into subareas known as data clusters. Data Clusters are identified by a two-character code. e.g RU for US payroll result, B2 for time evaluation result... Each HR subarea has its own cluster. Each subarea has its own key.

Database Table PCL1The database table PCL1 contains the following data areas:  B1 time events/PDC  G1 group incentive wages   L1 individual incentive wages  PC personal calendar  TE travel expenses/payroll results  TS travel expenses/master data  TX infotype texts  ZI PDC interface -> cost account

Database Table PCL2The database table PCL2 contains the following data areas:   B2 time accounting results  CD cluster directory of the CD manager  PS generated schemas

70

Programming in Human Resource ______________________________________________________________________

  PT texts for generated schemas  RX payroll accounting results/international  Rn payroll accounting results/country-specific ( n = HR country indicator )  ZL personal work schedule

Database Table PCL3The database table PCL3 contains the following data areas:  AP action log / time schedule  TY texts for applicant data infotypes

Data Management of PCLn

The ABAP commands IMPORT and EXPORT are used for management of read/write to database tables PCLn.A unique key has to be used when reading data from or writing data to the PCLn.  Field Name KEY Length Text  MANDT X 3 Client  RELID X 2 Relation ID (RU,B2..)  SRTFD X 40 Work Area Key  SRTF2 X 4 Sort key for dup. key

Cluster DefinitionThe data definition of a work area for PCLn is specified in separate programs which comply with fixed naming conventions.They are defined as INCLUDE programs (RPCnxxy0). The following naming convention applies:   n = 1 or 2 (PCL1 or PCL2)   xx = Relation ID (e.g. RX)   y = 0 for international clusters or country indicator (T500L) for different country cluster

71

Programming in Human Resource ______________________________________________________________________

Payroll is used to calculate the remuneration for work done for each employee. SAP Payroll delivers powerful and efficient gross-to-net, net-to-gross, regular and off-cycle payroll processing. SAP's complex Payroll process  handles everything including vacation policies, compensation programs, work schedules, Holidays, overtime pay etc. 

SAP's ESS (Employee Self Service) function allows employees to view, create and maintain data anytime, anywhere, via Web-based technology and interactive voice response functionality. ESS is an effective means for providing real-time access and data maintenance capabilities to the source or owner of the data. It has the ability to offload much of the data entry and related customer service activities that may be typically performed in an organization's human resources, payroll, benefits and purchasing departments.

Payroll accounting calculates the payment of work done by an employee. Payroll function does the following: 

Compute employees gross salary Make necessary deductions Calculate Net salary Generate Checks or direct deposits.

Payroll components include:

Payroll area - groups employees based on the frequency of their paydates. eg. Z1 for salaried staff paid monthly.

Control Record - It determines the current payroll period for a payroll area. Period Modifier - Period in which payroll accounting is carried out. eg. 10 - for monthly

pay periods. Date Modifier - Distinguishes periods with same frequency but different date. Eg. 10 - for

monthly pay period but with the pay date being 5th of every month. Payroll Calendar - Generating calendars for cumulating wage types to get monthly,

quaterly or yearly sum totals. Payscale type - used for segregation of employees payscales based on the type of union

contracts in a company. Eg. 10 - non union workers 20 - collective agreement for secretaries contract.

Payscale area - Differentiates payscales based on geographical area. Eg. 10 - California. Payscale group - Differentiates employees payscales based on functionality. Eg. GR01 -

grouping for junior clerks, GR02 - for senior clerks.  Payscale level - Subdivision of employees payscales. Eg. L1 - level 1 clerk, L2 - level 2

clerk. Wage types - The payments and deductions for an employee are coded as wage types. Eg.

A001 - salary payment, B001 - 401K deduction.

72

Programming in Human Resource ______________________________________________________________________

Payroll Infotypes: Payroll data is stored in various infotypes, which includes, 0001, 0007, 0008, 0009, 0207, 0208, 0209, 0210, 0234. These infotypes maintain personal details, payment and deduction info, benefits data, garnishment data, tax data, etc.

Payroll Process involves:

Maintaining payroll related infotypes Periodic payroll run Transferring data to FI/CO Transferring third party remittance data to Accounts Payable Tax reporting Standard reporting

Payroll program name: RPCALCx0

73

Programming in Human Resource ______________________________________________________________________

Broadly speaking, payroll accounting is the calculation of payment for work performed by each employee. More specifically, however, payroll accounting comprises a number of work processes including the generation of payroll results and remuneration statements, bank transfers and check payments. Payroll accounting also includes a number of subsequent activities: transfer of payroll results to Accounting various evaluations, such as evaluating the payroll account. etc.

74

Programming in Human Resource ______________________________________________________________________

The calculation of payment comprises two main steps: Calculation of remuneration elements Statutory and voluntary deductions (country-specific)

Both the remuneration elements and the statutory and voluntary deductions consist of individual payments and deductions, which are calculated for an employee during a payroll period. These payments and deductions are included in the payment calculation by means of different wage types.The employee is usually paid by bank transfer or check and the payment amount is printed in a form for the employee.

75

Programming in Human Resource ______________________________________________________________________

The remuneration elements for an employee are formed from individual wage and salary types that are used during a payroll period. Payments such as basic pay, various bonuses and gratuities are included in the remuneration calculation. Deductions can be made for items such as a company-owned flat, company-sponsored day care or similar benefits. Different factors determine whether such benefits increase or reduce the taxable income. This is determined by country-specific regulations and, in some countries, the philosophy of the company. An employee's remuneration consists of all wage types calculated for him or her during a payroll period.

76

Programming in Human Resource ______________________________________________________________________

Voluntary and statutory deductions, such as tax and social insurance contributions, are taken from the gross calculation to determine the payment amount. Different gross values, for example, total gross amount, and gross tax amount, are used to calculate the deductions. For this reason, different totals are formed during the payroll run, and these totals are be used for subsequent processing.

The Payroll Run steps

77

Programming in Human Resource ______________________________________________________________________

The payroll program is usually run separately for different employee groups. A typical example is that of salaried employees and hourly employees, for whom payroll is performed using two different payroll periods. The payroll area determines when payroll is run.

The payroll area serves two functions, both of which are prerequisites for running the payroll. The payroll area groups together personnel numbers that must be processed in the same payroll run

The payroll area determines the payroll period.

Employees for whom payroll is performed at the same time and for the same payroll period are assigned to the same payroll area. Personnel numbers are assigned to a payroll area in the Organizational Assignment infotype (0001).

78

Programming in Human Resource ______________________________________________________________________

The personnel numbers to be included in the payroll run are selected by specifying a payroll area in the payroll driver selection screen. The payroll period is transferred directly from the payroll control record to the payroll program.In a live run, the payroll period is determined by the system. The last period to be included in a payroll run is stored in the payroll control record for each payroll area. The current payroll period is, therefore, the last period to be included in a payroll run, plus one.Hint: Payroll driver should be started by Personnel Number or Payroll Area only.

79

Programming in Human Resource ______________________________________________________________________

The structure of PCLn database tables provides a basic structure for individual subareas.The name of each subarea must include a two-character cluster name or relation ID.A key structure must also be defined; 40 bytes are available in field SRTFD for this purpose.In the international payroll results, for example, the field RELID contains the cluster name RX and the field SRTFD contains the eight-digit personnel number as well as a five-digit sequence number for each individual payroll result for a payroll period.To enable the import of a record from a PCLn database table, the RELID field must contain the cluster identifier and the SRTFD field must contain the cluster key. The fields CLIENT and SRTF2 are filled by the system.

80

Programming in Human Resource ______________________________________________________________________

If data is imported using macros, the data records are not read directly from table PCLn. Instead, the buffer directory is checked to determine whether the main memory already contains a record with the same key. If this is not the case, the record is read from PCLn to the buffer, and retrieved from the buffer by the report.If data is read using a buffer, the system checks the cluster authorization. The standard import programs follow the RPCLSTxy naming convention, where xy = cluster name.

81

Programming in Human Resource ______________________________________________________________________

With this report, you can display the payroll results for any country. The indicator behind each name shows whether results exist in the selected period.Green: Results existRed: No results existGray: No authorization for displaying personnel numbersPayroll results are stored as structures and internal tables on the database.Each payroll result has a status indicator:

A = Current result P = Previous result O = All other results

82

Programming in Human Resource ______________________________________________________________________

The payroll driver, RPCALCn0, uses HR data (stored in the database tables PAnnnn) and the last payroll result (stored in the database table PCL2) to run the payroll for the specified periodThe program (payroll driver) imports the processing logic in the form of a schema. The schema contains functions that call the subroutines contained in the payroll driver. In many cases, the function is enhanced by rules for specific control of the subroutines.The payroll result generated by the payroll driver is stored in cluster xy of the database table PCL2.Report H99_DISPLAY_PAYRESULT displays the payroll results for PCL2 and, from Release 4.6C, replaces reports RPCLSTxy and HxyCLSTR. The report is used in all country versions and the overview of payroll results is automatically displayed according to the particular country.Report RPCEDTn0, for example, lists the formatted result as a payroll form (n = HR country indicator from table T500L).

83

Programming in Human Resource ______________________________________________________________________

Exporting/Importing DB Tables in HR “Displaying the Last Payroll Result”

At the end of this exercise, you will be able to:

Read the cluster directory with CU_READ_RGDIR.

Process the cluster directory with CD_READ_LAST.

Read the payroll result with PYXX_READ_PAYROLL_RESULT.

Display the wage types from the results table RT.

Suppose you need a report with a list of wage types from the results table for the current (last) payroll result in a for-period.

Write a report to import the results of international payroll to cluster RX and then display them. The report should evaluate the last payroll result for the for-period. Test your program using the personnel number assigned by your trainer.The created list should contain the following information for each employee:

1st line: - Personnel number- Name- Personnel area

2nd line: - For-period- For-payroll area

3rd line: - In-period- In-payroll area

4th line: - Wage type- Wage type text- Amount

84

Look at the example below

Look at the example below

Programming in Human Resource ______________________________________________________________________

Take the name of the employee from the field P0001-ENAME. The information on the period and payroll area can be found in the fields for the field string VERSC, which is a structure in cluster RX.

First use function module CU_READ_RGDIR to read table RGDIR from cluster CU. To determine the sequential number for the last payroll result, transfer table RGDIR to function module CD_READ_LAST.

Then read the payroll result for the sequential number you have determined using the function module PYXX_READ_PAYROLL_RESULT.

The wage types and amounts are saved in table RT. The text belonging to the wage types can be found in table T512T. Only display the first 15 characters of the employee name.

REPORT zpsol080. TABLES: pernr, t512t. "Wage type texts INFOTYPES: 0001. "Organizational Assignment

*Table data containing directory to PCL2 payroll results file DATA: BEGIN OF rgdir OCCURS 100. INCLUDE STRUCTURE pc261. DATA: END OF rgdir. DATA: result TYPE pay99_result. DATA: rt_header TYPE LINE OF hrpay99_rt. DATA: country LIKE t001p-molga, number LIKE pc261-seqnr. "Number of last payroll result

GET pernr. rp_provide_from_last p0001 space pn-begda pn-endda. CALL FUNCTION 'CU_READ_RGDIR' EXPORTING persnr = p0001-pernr IMPORTING molga = country TABLES in_rgdir = rgdir EXCEPTIONS no_record_found = 1 OTHERS = 2.

85

Programming in Human Resource ______________________________________________________________________

IF sy-subrc = 1. WRITE: / 'No records found for '(001), pernr-pernr. ENDIF.

CALL FUNCTION 'CD_READ_LAST' EXPORTING begin_date = pn-begda end_date = pn-endda IMPORTING out_seqnr = number TABLES rgdir = rgdir EXCEPTIONS no_record_found = 1 OTHERS = 2. IF sy-subrc = 1. WRITE: / 'No payroll result found for'(002), pn-paper. ELSE. CALL FUNCTION 'PYXX_READ_PAYROLL_RESULT' EXPORTING clusterid = 'RX' employeenumber = p0001-pernr sequencenumber = number * READ_ONLY_BUFFER = ' ' * READ_ONLY_INTERNATIONAL = ' ' * CHECK_READ_AUTHORITY = 'X' * IMPORTING * VERSION_NUMBER_PAYVN = * VERSION_NUMBER_PCL2 = CHANGING payroll_result = result EXCEPTIONS illegal_isocode_or_clusterid = 1 error_generating_import = 2 import_mismatch_error = 3 subpool_dir_full = 4 no_read_authority = 5 no_record_found = 6 versions_do_not_match = 7 OTHERS = 8.

IF sy-subrc = 0. PERFORM print_rx. ELSE. WRITE: / 'Result could not be read (003).

86

Programming in Human Resource ______________________________________________________________________

ENDIF. ENDIF.

*------------------------------------------------------------** FORM PRINT_RX **------------------------------------------------------------** Print Payroll Result **------------------------------------------------------------*FORM print_rx. FORMAT INTENSIFIED ON. WRITE: / p0001-pernr, p0001-ename(15), p0001-werks, p0001-btrtl. FORMAT INTENSIFIED OFF. SKIP 1. WRITE: / 'For period/payroll area: '(004), 30 result-inter-versc-fpper+4(2), result-inter-versc-fpper+0(4), result-inter-versc-abkrs, / 'In-period/payroll area: '(005), 30 result-inter-versc-inper+4(2), result-inter-versc-inper+0(4), result-inter-versc-iabkrs. SKIP 1. WRITE: 'Results table: '(006). SKIP 1.

LOOP AT result-inter-rt INTO rt_header. PERFORM re512t USING result-inter-versc-molga rt_header-lgart. WRITE: / rt_header-lgart, T512T-LGTXT, rt_header-betrg CURRENCY rt_header-amt_curr. ENDLOOP. ENDFORM.

*------------------------------------------------------------** FORM RE512T **------------------------------------------------------------** Read Wage Type Texts *------------------------------------------------------------*

87

Programming in Human Resource ______________________________________________________________________

FORM re512t USING value(country_grouping) value(wtype). CHECK t512t-sprsl NE sy-langu OR t512t-molga NE country_grouping OR t512t-lgart NE wtype. SELECT SINGLE * FROM t512t WHERE sprsl EQ sy-langu AND molga EQ country_grouping AND lgart EQ wtype. IF sy-subrc NE 0. CLEAR t512t. ENDIF. ENDFORM. *END*

-----------------------------------------------------------------------------------------------------------------------

User Exits

Enhancement PBAS0001 has two function exits.

Function exit EXIT_SAPFP50M_001 allows customer-specific defaults to be entered in a single screen when infotypes are created or copied.

User exit name : ZXPADU01

Function exit EXIT_SAPF50M_002 allows an additional customer-specific check to be performed after data has been entered in a single screen and the fields have been validated.

User Exit name: ZXPADU02

REPORT zuexit_amar_ar .

*(This program when executed will give you all the user exit *associated

*with the Tcode. Click on the exit you will be taken to the SMODE.

*Select the components radio button and click on display.You will be

*taken to the function module exit. Clicking on the function exit you

*will be taken to the actual function module which has the include in

*it where you need to put the extra code).

TABLES : tstc, tadir, modsapt, modact, trdir, tfdir, enlfdir.

88

Programming in Human Resource ______________________________________________________________________

TABLES : tstct.

DATA : jtab LIKE tadir OCCURS 0 WITH HEADER LINE.

DATA : field1(30).

DATA : v_devclass LIKE tadir-devclass.

SELECTION-SCREEN BEGIN OF BLOCK selection

WITH FRAME TITLE text-z80.

PARAMETERS : p_tcode LIKE tstc-tcode OBLIGATORY.

SELECTION-SCREEN END OF BLOCK selection.

SELECT SINGLE * FROM tstc WHERE tcode EQ p_tcode.

IF sy-subrc EQ 0.

SELECT SINGLE * FROM tadir WHERE pgmid = 'R3TR'

AND object = 'PROG'

AND obj_name = tstc-pgmna.

MOVE : tadir-devclass TO v_devclass.

IF sy-subrc NE 0.

SELECT SINGLE * FROM trdir WHERE name = tstc-pgmna.

IF trdir-subc EQ 'F'.

SELECT SINGLE * FROM tfdir WHERE pname = tstc-pgmna.

SELECT SINGLE * FROM enlfdir WHERE funcname =

tfdir-funcname.

SELECT SINGLE * FROM tadir WHERE pgmid = 'R3TR'

AND object = 'FUGR'

AND obj_name EQ enlfdir-area.

MOVE : tadir-devclass TO v_devclass.

ENDIF.

ENDIF.

SELECT * FROM tadir INTO TABLE jtab

WHERE pgmid = 'R3TR'

AND object = 'SMOD'

AND devclass = v_devclass.

SELECT SINGLE * FROM tstct WHERE sprsl EQ sy-langu AND

tcode EQ p_tcode.

FORMAT COLOR COL_POSITIVE INTENSIFIED OFF.

WRITE:/(19) 'Transaction Code - ',

89

Programming in Human Resource ______________________________________________________________________

20(20) p_tcode,

45(50) tstct-ttext.

SKIP.

IF NOT jtab[] IS INITIAL.

WRITE:/(95) sy-uline.

FORMAT COLOR COL_HEADING INTENSIFIED ON.

WRITE:/1 sy-vline,

2 'Exit Name',

21 sy-vline ,

22 'Description',

95 sy-vline.

WRITE:/(95) sy-uline.

LOOP AT jtab.

SELECT SINGLE * FROM modsapt

WHERE sprsl = sy-langu AND

name = jtab-obj_name.

FORMAT COLOR COL_NORMAL INTENSIFIED OFF.

WRITE:/1 sy-vline,

2 jtab-obj_name HOTSPOT ON,

21 sy-vline ,

22 modsapt-modtext,

95 sy-vline.

ENDLOOP.

WRITE:/(95) sy-uline.

DESCRIBE TABLE jtab.

SKIP.

FORMAT COLOR COL_TOTAL INTENSIFIED ON.

WRITE:/ 'No of Exits:' , sy-tfill.

ELSE.

FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.

WRITE:/(95) 'No User Exit exists'.

ENDIF.

ELSE.

FORMAT COLOR COL_NEGATIVE INTENSIFIED ON.

WRITE:/(95) 'Transaction Code Does Not Exist'.

ENDIF.

AT LINE-SELECTION.

GET CURSOR FIELD field1.

90

Programming in Human Resource ______________________________________________________________________

CHECK field1(4) EQ 'JTAB'.

SET PARAMETER ID 'MON' FIELD sy-lisel+1(10).

CALL TRANSACTION 'SMOD' AND SKIP FIRST SCREEN.

91

Programming in Human Resource ______________________________________________________________________

HR Transactions

Master Data PA10   Personnel File                 PA20   Display HR Master Data         PA30   Maintain HR Master Data        PA40   Personnel Events               PA41   Change Hiring Data             PA42   Fast Data Entry for Events PRMD   Maintain HR Master Data             PRMF   Travel Expenses: Feature TRVFD      PRML   Set Country Grouping via Popup      PRMM   Personnel Events                    PRMO   Travel Expenses: Feature TRVCO      PRMP   Travel Expenses: Feature TRVPA      PRMS   Display HR Master Data              PRMT   Update Matchcode  PSO3   Infotype overview                         PSO4   Individual maintenance of infotypes      

Time Management PA51   Display Time Data  PA53   Display Time Data  PA61   Maintain Time Data  PA62   List Entry of Additional Data  PA63   Maintain Time Data  PA64   Calendar Entry  PA70   Fast Data Entry  PA71   Fast Entry of Time Data  PBAB   Maintain vacancy assignments PT01   Create Work Schedule  PT02   Change Work Schedule  PT03   Display Work Schedules

Payroll PC00   Run Payroll PC10   Payroll menu USA PE00   Starts Transactions PE01,PE02,PE03  PE01   Schemas  PE02   Calculation Rules  PE03   Features  PE04   Create functions and operations  PE51   HR form editor PRCA   Payroll calendar PRCT   Current Settings  PRCU   Printing Checks USA  PRD1   Create DME SM31 Maintain Tables SM12 Locked Secessions TSTC Table lookup SPR0 IMG SE16 Data Browser (Table reports)

92

Programming in Human Resource ______________________________________________________________________

PP03 PD Tables PP0M Change Org Unit P013 Maintain Positions PO03 Maintain Jobs

Benefits PA85   Benefits - Call RPLBEN11  PA86   Benefits - Call RPLBEN07  PA87   Benefits - Call RPLBEN09  PA89   COBRA Administration  PA90   Benefits Enrollment – Individual PA91   Benefits - Forms  PA92   Benefits Tables - Maintain  PA93   Benefits Tables - Display  PA94   Benefits - Access Reporting Tree  PA95   Benefits IMG - Jump to Views  PA96   Benefits reporting  PA97   Salary Administration - Matrix  PA98   Salary Administration  PA99   Compensation Admin. - rel.changes  PACP   HR-CH: Pension fund, interface 

Payroll PC00   Run Payroll PC10   Payroll menu USA PE00   Starts Transactions PE01,PE02,PE03  PE01   Schemas  PE02   Calculation Rules  PE03   Features  PE04   Create functions and operations  PE51   HR form editor PRCA   Payroll calendar PRCT   Current Settings  PRCU   Printing Checks USA  PRD1   Create DME SM31 Maintain Tables SM12 Locked Secessions TSTC Table lookup SPR0 IMG SE16 Data Browser (Table reports) PP03 PD Tables PP0M Change Org Unit P013 Maintain Positions PO03 Maintain Jobs

Benefits PA85   Benefits - Call RPLBEN11  PA86   Benefits - Call RPLBEN07  PA87   Benefits - Call RPLBEN09  PA89   COBRA Administration  PA90   Benefits Enrollment – Individual PA91   Benefits - Forms  PA92   Benefits Tables - Maintain 

93

Programming in Human Resource ______________________________________________________________________

PA93   Benefits Tables - Display  PA94   Benefits - Access Reporting Tree  PA95   Benefits IMG - Jump to Views  PA96   Benefits reporting  PA97   Salary Administration - Matrix  PA98   Salary Administration  PA99   Compensation Admin. - rel.changes  PACP   HR-CH: Pension fund, interface 

General/Reporting PM00   Menu for HR Reports  PM01   Dialogs in HR  -  Create custom infotypes PRF0   Standard Form PSVT   Dynamic Tools Menu PAR1   Flexible employee data  PAR2   Employee list

PD - Organizational Management PP0M Change Org Unit PO03 Maintain Jobs PO13   Maintain Position PO10   Maintain Organizational Unit PP01   Maintain Plan Data (menu-guided)  PP02   Maintain Plan Data (Open)  PP03   Maintain Plan Data (event-guided)  PP05   Number Ranges  PP06   Number Range Maintenance: HRADATA  PP07   Tasks/Descriptions PP69   Choose Text for Organizational Unit PP90   Set Up Organization PPO1   Change Cost Center Assignment  PPO2   Display Cost Center Assignment  PPO3   Change Reporting Structure  PPO4   Display Reporting Structure  PPO5   Change Object Indicators (O/S)  PPO6   Change Object Indicators O/S  PPOA   Display Menu Interface (with dyn.)  PPOC   Create Organizational Unit  PPOM   Maintain Organizational Plan  PPOS   Display Organizational Plan PQ01   Events for Work Center  PQ02   Events for Training Program  PQ03   Events for Job  PQ04   Events for Business Event Type  PQ06   Location Events  PQ07   Resource Events  PQ08   Events for External Person  PQ09   Events for Business Event Group  PQ10   Events for Organizational Unit  PQ11   Events for Qualification  PQ12   Resource Type Events  PQ13   Events for Position  PQ14   Events for Task 

94

Programming in Human Resource ______________________________________________________________________

PQ15   Events for Company PSO5   PD: Administration Tools  PSOA   Work Center Reporting  PSOC   Job Reporting  PSOG   OrgManagement General Reporting  PSOI   Tools Integration PA-PD  PSOO   Organizational Unit Reporting  PSOS   Position Reporting  PSOT   Task Reporting

Recruitment PB10   Init.entry of applicant master data  PB20   Display applicant master data  PB30   Maintain applicant master data  PB40   Applicant events  PB50   Display applicant actions  PB60   Maintain applicant actions  PB80   Evaluate vacancies  PBA0   Evaluate advertisements  PBA1   Applicant index  PBA2   List of applications  PBA3   Applicant vacancy assignment list  PBA4   Receipt of application

Useful programs for Schemas and PCRs RPUCTF00 Change Attributes for Schemas and PCRs (change owner) RPUCTI00 Lists Subschemas not called up in any other schema RPUCTJ00 Lists Personnel Calculation Rules which are not called up RPUCCOSE Source text search in PC rules RPUCTX00 Copy Personnel Calculation Rules from client 000 to other clients

RPUSCD10 Schema directory – useful after LCP to see changed schemas, also shows who changed it last and when

RPUCTC00 Displays PCRs full source text

Time Management

RPTQTA10 Display Leave QuotasRPTQTA00 Bulk Leave Quotas UpdateRPTLEACONV Transfer of Remaining Leave from Infotype 0005 to Infotype 2006

Wage Type Utilities

RPU12W0C(HR utility 512W-classes) allows you to reload backups of specific processing classes, cumulations and evaluation classes created with RPU12W0S in T512W

RPU12W0SCreates a backup of T512W in T599U or reloadsthe backup into T512W.

RPU99U0V Displays T599URPU5XX0D Generically deletes entries in T599U, T512W or T512T

95

Programming in Human Resource ______________________________________________________________________

Other Useful programs

RSHOWTIM Displays tips and tricks for ABAP Programming RSANAL00 Program analysisRSABAPIV Lists all ABAP commandsRCCLBISC Display contents of logical filenameRPUTRBK0 Updates infotype 0003 dates after data transferRPUEUSUP Activate Additional Actions infotype 0302RPUDEL20 Deletes payroll results (be careful !)RPDSYS00 Display System DocumentationRSBDCSUB Release batch-input sessions automaticly RSUSR006 List users last login RSPARAM Display all instance parameters RPABRIDD Deletes data in payroll infotypesRPUPROTU maintain/delete the log of report startsRPINCL10 Use RPINCL10 to search through ABAP source codeRPCIFU03 Move TemSe Unix file (e.g. BACS transfer) to PC fileRPLTEMV0 File transfer between TemSe and disc

96

Programming in Human Resource ______________________________________________________________________

References:

The following documents from SAP were referred to do this document:

HR 350

HR 550

HR 050

HR 530

HR 580

The following websites were referred to do this document:

www.planetsap.com

www.atomhr.com

www.sap-img.com

www.abaptools.com

97