Logical Database

Tuesday, March 24, 2009 |

Logical database are special ABAP programs that read data from database tables. We can use logical database in a executable program by just specifying the name of the logical database in the program attributes. When you run your executable program the logical database program will also run simultaneously with it.


SAP supplies logical database for all categories.


In Human Resources (HR), the following logical databases can be used as a data source for HR InfoSets:



  • PNP (PNPCE)

  • PAP

  • PCH 

  • Structure

  • Selection

  • Database Program

Structure


The structure of a logical database determines the database tables which it can access. It adopts the hierarchy of the database tables defined by their foreign key relationships. This also controls the sequence in which the tables are accessed.


Selection


Every logical database has its own selection screen. Every executable program can use the selections defined in the logical database and it can add its own specific selections.


The selection screen 1st displays the selection of the logical database followed by the selection of the calling program.


The logical database provides several selection criteria. These are divided into the following three groups:



  • Person selection


  • Sorting the person selection


  • Data selection

Database Program


The database program of a logical database is a container for special subroutines, in which the data is read from the database tables. These subroutines are called by the reporting processor in the runtime environment in a predefined sequence.


The most important functions of the logical database are:


• Data Retrieval


Using only a single get pernr statement in our executable program, the logical database can extract the data for an employee one at a time which we can use for further processing.


• Data Selection


The logical database has its own selection screen. Depending upon the selection criteria given in the logical database selection screen, it will extract the data. For ex if we want to extract all the employees from a particular payroll area, just specify that payroll area in the logical database selection screen and it will read all the employees in that payroll area. No need to write any extra code.


• Authorization


The logical database executes an authorization check for personnel data. It checks whether the master record of the user who starts the report contains the authorizations for the data that is to be read in the report. A distinction is made between a person and a data authorization. The system first checks whether the user has an authorization for the employee in accordance with the criteria of organizational assignment. Employees for which the user has no authorization are not evaluated. The system then checks whether the user is authorized to process the infotypes of the specified report.

0 comments:

Post a Comment