Professional Documents
Culture Documents
Topics
1. What is HR and SAP-HR Concepts & Components 2. Why HR ABAP is different from normal ABAP. 3. Logical Databases and other HR related tables 4. Overview on HR Macros 5. Programming using Logical data bases and Macros
6. Report Categories
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
SAP HR Components
PA Personnel Administration and Payroll Accounting PD Personnel Planning and Development.
Organizational :
Job, Position and Organizational unit.
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
10
For example, these are the frequently used infotypes. -Actions: Infotype 0000 stores all actions for an employee.
-Org Assignment: 0001 stores all information on employees Organization Specific status
-Personnel Data: 0002 stores all information on name, birth date, Sex etc.
-Basic Pay: 0008 stores all information on pay for employee. For each employee, there can be many records stored in each infotype, each with a start and end date.
11
- Personnel number - 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 employees master data and working time data (infotypes). subtypes are subdivisions of infotypes. An infotypes subtypes can have different time constraints and form their own histories.
- Subtype -
12
TC 2: No more than one valid data record of the infotype in question can exist at any one time. Ex: IT 0032 Internal Data
TC 3: Any number of valid data records of the infotype in question can exist at any one time. EX: IT0022 - Education TC A: Infotype exists just once from Jan.1 1800 to Dec.12 9999 Ex: IT 0003 Payroll Status TC T :Time constraint is based on subtype or subtype table Ex: IT 0008 Basic pay 15
16
17
18
PAnnnn
INFOTYPES: <nnnn>. ... CALL FUNCTION 'HR_READ_INFOTYPE'...
SAP AG 1999
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.
19
SAP AG 1999
= return = P0002 = 1 = 2.
SAP AG 1999
20
21
22
23
Structure of Infotypes.
The Data dictionary contains Pnnnn corresponds to the table PAnnnn. The infotype is defined in the Data Dictionary as a structure without a database. The Pnnnn structure of the infotype is used as the field structure for the infotype entry screen. The effect of INFOTYPES statement is that it will create an internal table Pnnnn as follows:
DATA BEGIN OF Pnnnn OCCURS 10. INCLUDE STRUCTURE Pnnnn. DATA END OF Pnnnn VALID BETWEEN BEGDA AND ENDDA. (eg) INFOTYPES 0001.
The infotype records can be processed using the infotype structure when the report is run. PERNR structure. 24
Event keywords for data retrieval from a logical database have the following syntax. GET <TABLE>.
The logical HR database used the table PERNR. You must declare it in the TABLES statement. At the GET PERNR event, the PERNR structure contains the data for a personnel number chosen on the basis for selection screen entries. The PERNR-PERNR field contains the personnel number which is selected for processing. Only the PERNR-PERNR field should be read from the work area of the PERNR table. The other fields are intended for internal use only.
25
A join processes records from two or more infotypes. The data from these infotypes is provided for a specific partial period. To know in which time period an employee worked at which job at which address he or she resided during this time. The following addresses data is available: Jan March California April June Stamford The following work center data is available: Jan April Developer May November Team Lead If the address and work center data are provided for specific partial periods, the following cases. Jan Feb California / Developer March October Stamford / Team Leader.
The following program will fetch the results.
26
Note: Changing data in any one of the infotypes linked by a join causes a split in the selection period.
27
An employee has worked as developed for 2 years in the three different personnel areas. The following organizational assignment data is available. Jan 2001 Jan 2002 Jan 2003 - Dec 2001 Developer / Personnel area 1. - Dec 2002 Developer / Personnel area 2. -Dec 2003 Developer / Personnel area 3.
28
If we only require the time period during which an employee performs a specific job and not the personnel area for an evaluation, the following applies. January 2003 to Dec 2003 Developer.
REPORT ZTEST_PROJECTION. TABLES: PERNR. INFOTYPES: 0001. GET PERNR. PROVIDE STELL FROM P0001 BETWEEN PN-BEGDA AND PNENDDA. WRITE: / PERNR-PERNR, P0001-STELL, P0001-BEGDA, P0001-ENDDA. ENDPROVIDE.
29
30
31
The internal infotype table is filled with all records existing between the lowest and highest system date. The internal table has the name Pnnnn, where nnnn is the infotype number.
The syntax is as follows: PROVIDE * FROM Pnnnn BETWEEN PA$BEGDA AND PA$ENDDA. WRITE: / Pnnnn-<FIELD>. ENDPROVIDE. The relationship between the infotype and the data selection period of the selection screen is established using the PA$BEGDA AND PA$ENDDA variables. Often only require the most recent or earliest infotype record, not all infotype records. In this case, use one of the following statements: PAP_PROVIDE_FROM_LAST Pnnnn SPACE PA$BEGDA PA$ENDDDA. (or) PAP_PROVIDE_FROM_FRST Pnnnn SPACE PA$BEGDA PA$ENDDA. These statements make the newest or oldest record in the PA$BEGDA TO PA$ENDDA data selection period available in the structure Pnnnn.
32
33
34
35
36
37
SAP AG 1999
38
Example Report: Report Ztest_Macro. Tables: PERNR. INFOTYPES: 0001. GET PERNR. RP_PROVIDE_FROM_LAST P0001 SPACE PN-BEGDA PN-ENDDA. PNP-SW-FOUND = 1. write: / PERNR-PERNR, P0001-STELL, PN-BEGDA, PN-ENDDA. ELSE. REJECT. ENDIF.
39
Infotypes 2000 to 2999 are time infotypes. They are stored in tables PA2000 to PA2999. Infotypes are declared with the INFOTYPE statement, and data is made available for processing in the internal infotype tables (infotype 2011 is an exception). You should not load all the infotype records from the earliest to most recent system dates into the main memory. This would quickly lead to memory overload, especially if a front-end time recording system is connected to the HR system. That is why time data should be read only for a specific period. Use the infotype declaration supplement MODE N to define that the internal time infotype tables should be declared but not filled at the GET PERNR event. Time infotype tables are processed with the LOOP statement since the PROVIDE statement limits, and thus changes, the infotype start and end dates to the data selection period.
40
Using Macro RP_READ_ALL_TIME_ITY PN-BEGDA PN-ENDDA To control the amount of time required to read time infotypes, MODE N Is assigned to the infotypes in declaration. The time infotype tables are subsequently filled using the RP_READ_ALL_TIME_ITY macro, however, only in the specified period.
41
42
Report Categories
You can create your own report categories for your report programming Using Logical Database PNP. Instead of standard PNP logical data base selection screen, your own selection Will appear .
43
Report Categories
Go to Attributes click HR Report Category Button.
44
Report Categories
It takes you to report categories maintenance view, press new entries
45
Report Categories
It takes you to report categories maintenance view, press new entries Give the Report Category Name and save.
46
Report Categories
Double click the Allowable Selection Criteria in left hand side. Give your own selection options.
47
Report Categories
Save the entries.
48
Report Categories
Go to SE38 and execute the program , you can see your own Selected Selection screen options.
49
End of Session
50