Register Login

Logical database (LDB) in SAP

Updated Feb 23, 2024

A logical database is a special SAP ABAP/4 program that combines the contents of certain database tables. A SAP user can link a logical database to an ABAP/4 report program as an attribute. The logical database then supplies the report program with a set of hierarchically structured table lines that can be taken from different database tables.

GET will fetch the table data immediately


In the LDB when you define the table structure in the hierarchy, first it will fetch the higher node data and then all the below node tables data and comes to a second record in the top node table for this GET Late is used.

The T-code for LDB is SE36

There are two ways of using a logical database: 

  • By linking it with an executable program

  • By using the function module LDB_PROCESS in any ABAP program. This allows you to call several logical databases from any ABAP program, nested in any way.

LDBs contain Open SQL statements that read data from the database. You do not therefore need to use SQL in your programs. The logical database reads the program, stores them in the program if necessary, and then passes them line by line to the application program or the function module LDB_PROCESS.

The data structure in a logical database is hierarchical. Many tables in the R/3 System are linked to each other using foreign key relationships.

After each table line is transferred, a GET event occurs and the executable program (report) can process it by activating the appropriate processing block. If you do not specify a logical database in the program attributes, the GET events never occur.

In the processing blocks after the GET events, you only have to specify the statements for analyzing the data and writing the results to the screen.

Advantages of LDB

  • Logical databases have a built-in selection screen. You can modify the pre-generated selection screen as per your program needs. 
  • It offers check functions to check whether user input is complete, correct, and plausible. 
  • It offers reasonable data selections.
  • It contains central authorization checks for database accesses. 
  • Good read access performance (for example, with views) while retaining the hierarchial data view determined by the application logic.