Copyright 2020 - BV TallVision IT

The SAP HR module is the only module that still utilizes logical databases. For good reason: it has added value - mainly because of the timely fashion (information has a validity period) data is maintained in the system. Every bit of HR information (held in infotypes) has a start and an end date. 

HR data is held on infotypes, for which a wide variety of types is available. Infotypes are in fact a set of fields with a validity period. The Abap programming language even supports a statement, especially for HR infotypes: INFOTYPES: 0000, 0001, 0004. which is used to define which infotypes are required to be available in your program.

The logical database

The other thing you shouls seriously consider is the use of Logical databases (defined on the report attributes and information is retrieved from the logical database using the GET statement). Logical databases have earned their respect, even though HR is the main customer - check out transaction SE36 (before SE37 and SE38).

The use of logical databases will help compose your selection screen, allow quite complex selection of the Organisational Structure elements and take care of the selection of your report. It's not only handy to use the logical database for HR reports, it's a great help. 

Information from infotypes is available in a set of transparent tables with the names PA0001 for infotype 0001 (etc).

Infotypes

Infotypes form the data-storage methodology in SAP HR. All information is held for a specific period of time, it has a start date and an end date (which may well be 31.12.9999). An infotype has a number in the 0001 to 9999 range, and the actual information on infotypes is held in tables PA0001 (PAnnnn) (personnel), PBnnnn (applicants) and HRPnnnn (organizational units). Infotypes on personnel and applicants are very similar. Infotypes on organisational units work with a status (ISTAT) and a Planvariant (usually 01). The planvariant supports a mechanism where forecasts and transportable organization plans can be used, but in practice only planvariant '01' is used.  Use function module RH_GET_PLVAR to be prepared for everything.

The other quite important thing in HR selections is relations, which is available in HRP1001 table. The organisational structure is described in relations which live on this table. Relations are described bottom-up as well as top-down, so every direction is available to you (RSIGN=A - Bottom up, RSIGN=B - Top down). 

The employee

Work schedule for an employee: you may find this a very convenient bit of logic: function module HR_PERSONAL_WORK_SCHEDULE. In fact, function group PTWS has many more handy modules.