Sunteți pe pagina 1din 38

Day - 3 Programming in HR

Agenda
Logical Database PNP Structure of DB tables in PA Infotype Structure Time Constraints Data Retrieval

Functions of LDB

Functions of LDB
The logical database has three main functions. Data retrieval: HR data is written on an employee by employee basis to the main memory, where it can be processed. Screening: A selection screen enables you to select employees in accordance with organizational criteria. For example, you can select all of the hourly-wage earners in a particular personnel subarea. Authorization check: The system checks that the user starting an evaluation is authorized to access the data.

Structure of DB Tables in PA

Structure of DB Tables in PA (contd..)


The Pnnnn structure contains an infotype's key fields and data fields. The data fields in structure PSnnnn are grouped together to ensure that definitions contain as few redundancies as possible. Structure Qnnnn contains special screen fields for the respective infotype. Structure PERNR contains the standard selections for the logical database PNP.

Structure of DB Tables in PA (contd..)


Database tables PAnnnn and PBnnnn are transparent, which means that: Each infotype has its own database. Each infotype has an individual length, so that you are not required to keep additional space on the database. Information can be found more quickly (using an index search). Infotypes can be evaluated using any SQL tools.

Infotype Structure

Infotype Structure
In Reporting, structure Pnnnn is used as an interface between the program and the database. It contains the data fields of structure PSnnnn, and data fields that occur in every infotype (PSHD1). Key PSKEY contains the fields of structure PAKEY, and an additional field for infotype number nnnn.

Additional Structures for Screen fields

Additional Structures for Screen fields


If fields (such as header lines) are displayed for every infotype, they are stored in structure RP50M. Structure Qnnnn also exists for many infotypes. It contains screen fields for data entry. An employee's form of address, for example, is stored in field P0002-ANRED with a numeric key. The screen, however, must enable the form of address itself to be displayed and entered, not its numeric key. For this reason, additional field Q0002ANREX is used.

Data Retrieval

Processing Master Data

Processing Master Data


Filled infotype structures are stored in the main memory for the GET PERNR event keyword. The infotype records are imported to internal tables Pnnnn (for example, P0006 for infotype 0006). These tables are then processed in a PROVIDEENDPROVIDE loop. The infotype records whose validity period overlaps the period selected in the selection screen (PNBEGDA and PN-ENDDA) by at least one day are placed one after the other in the header of the respective infotype table Pnnnn.

Data Looping

With this form of processing, you should note that the data for the Personal Data (0002) and Address (0006) infotypes is listed sequentially and is not linked.

Time Constraints

Time Constraints
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.

Period Based Data

Infotype data is period-based, in other words, it is only valid for specific periods. For this reason, each record has a start date and an end date. This example shows the jobs that an employee has performed over the course of a year.

Data Selection Period based

The PROVIDE command retrieves data for specific periods, that is, on the basis of the data selection period. The most recent or oldest infotype records can be retreived using RP_PROVIDE_FROM_LAST and RP_PROVIDE_FROM_FRST macros.

Person Selection

Person selection is used to determine a group of employees for whom an evaluation takes place. For example, all of the monthly wage earners in a particular personnel subarea.

Data Selection

The data selection period determines the period in which data is evaluated.

Default Values-Selection Screen

Default Values-Selection Screen


When the INITIALIZATION event occurs, you can set default values for the selection screen. The fields for the data selection are defined in structure QPPNP. Possible values for field PNPTIMED are: D = Today (key date) M = Current month Y = Current year P = To current date F = From today (from current date)

Flow Control for Logical Database

RECAP

Join & Projection


Joining Infotypes Field Projection Time Dependant Table Entries

Join

Join

Join & Time Constraint


Time constraint 1: Saved without gaps and without overlaps Time constraint 2: Saved with gaps and without overlaps, no duplicate assignment Time constraint 3: Gaps and overlaps are permitted If more than one record is valid for an infotype at the same time or in the same period (time constraint 3), the system cannot identify which data is valid for the subinterval of the join. The resulting restriction for the join means that the data of the infotypes in question must remain unique at all times. This means that joins are only possible for infotypes with time constraint 1 or 2.

Join & Subtype


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.

Projection & Contraction

Selecting one or more infotype fields for processing is called PROJECTION. Using projection for specific fields enables you to specify that only the contents of these fields and time-based changes to the contents, are relevant to an evaluation.

Projection & Contraction


Projection is also an operation performed on the time axis. New validity periods are created when the contents of one of the projection fields change. The values stored in fields that are not included in the projection are in an undefined condition, which means they are no longer relevant to output. If the contents of a field included in the projection remain unchanged in several data records, the validity periods of these data records are combined. The process of combining data records during projection is called contraction.

Projection

Join &Projection

Data from several infotypes is read at the same time, and new partial periods are created. Since fields are only selected from infotypes if they are relevant to an evaluation, partial periods are combined. In this way, validity periods with related contents are combined, and data is retrieved for an evaluation from relevant infotype fields and

Join &Projection

Time Dependent Table Entries

To accelerate data entry and save memory, infotype data is usually coded to form a key (for example, infotype P0001, job key). When infotypes are processed, the texts or attributes of keys are read from control tables during runtime. Data is stored for specific validity periods in a series of control tables. If data from time-dependent control tables must be read for a key in an infotype field, the record that is valid for the validity period of the infotype must be determined on the basis of the table

?
Questions

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