Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
Showing results for 
Search instead for 
Did you mean: 

how to call logical database

Former Member
0 Kudos

hi friends,

plz explain me how to call logical database in a report program?


Former Member
0 Kudos

In your report program screen go to menu bar and click goto -->attribute then you find pop up, in that u find logical database. In that enter your logical database name.

Check these link for more details.



Former Member
0 Kudos

To call logical database for example LFM1, in your report program:

Go to SE38, create program zxxxx choose executable and specify the logical DB name . Save.

report zxxxx.

nodes lfm1, lfa1


write : lfm1-ekogr, lfm1-lifnr .


write:/ ...

Former Member
0 Kudos


u have to specify the logical database name in the attribute screen of program ,then in program u have to specify the nodes statement like tables,then using get and put statement u can acess the logical database

Former Member
0 Kudos


Logical databases are special ABAP programs that retrieve data and make it available to application programs. The most common use of logical databases is still to read data from database tables by linking them to executable ABAP programs.

However, from Release 4.5A, it has also been possible to call logical databases using the function module LDB_PROCESS. This allows you to call several logical databases from any ABAP program, nested in any way. It is also possible to call a logical database more than once in a program, if it has been programmed to allow this. This is particularly useful for programs with type 1.

Logical databases contain Open SQL statements that read data from the database. You do not therefore need to use SQL in your own 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 using an interface work area.

Logical Databases - Views of Data

A logical database provides a particular view of database tables in the R/3 System. It is always worth using logical databases if the structure of the data that you want to read corresponds to a view available through a logical database.

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. Some of these dependencies form tree-like hierarchical structures. Logical databases read data from database tables that are part of these structures.

Advantages of Logical database -

1) No need of programming for retrieval , meaning for data selection

2) Easy to use standard user interface, have check completeness of user input.


1) Fast in case of lesser no. of tables But if the table is in the lowest level of hierarchy, all upper level tables should be read so performance is slower.



Use Tcode SE36 For creating Logical Database.

Here is a simple Program on Logical database.

NODES: spfli,sflight.


WRITE 'Test Program for GET'.

*Fetching SPFLI table

GET spfli.

WRITE: / 'Carrid:', spfli-carrid,

'Connid:', spfli-connid.

*Fetching SFLIGHT table

GET sflight.


WRITE: / 'Carrid:', sflight-carrid,

'Connid:', sflight-connid.

example program




Former Member
0 Kudos

U might probably be asking using LDB's Screen in the selection screen , U can use it by specifyingthe Logical database to be used by clicking on GOTO->ATTRIBUTES->here in the logical Database specify the LDB to be used ex. PNPCE etc.

Reward points if found usefull,



Former Member
0 Kudos

one is dfinately thru Attributes but other is that u can code in pgm

Report Ztest using database PNP.


Naveen Gupta