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.
cancel
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?

6 REPLIES 6

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.

http://help.sap.com/saphelp_nw04/helpdata/en/9f/db99b435c111d1829f0000e829fbfe/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb2d4d358411d1829f0000e829fbfe/content.htm

http://www.itcserver.com/blog/2006/06/26/events-in-abap/

Regards,

Maha

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

GET LFM1 .

write : lfm1-ekogr, lfm1-lifnr .

GET LFA1.

write:/ ...

Former Member
0 Kudos

hi,

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

hi,

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.

Disadvantages

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.

GO THROUGH THE LINKS

http://www.sap-basis-abap.com/saptab.htm

http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9bfa35c111d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/c6/8a15381b80436ce10000009b38f8cf/frameset.htm

/people/srivijaya.gutala/blog/2007/03/05/why-not-logical-databases

www.sapbrain.com/FAQs/TECHNICAL/SAP_ABAP_Logical_Database_FAQ.html

www.sap-img.com/abap/abap-interview-question.htm

www.sap-img.com/abap/quick-note-on-design-of-secondary-database-indexes-and-logical-databases.htm

http://help.sap.com/saphelp_nw04/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/content.htm

http://help.sap.com/saphelp_nw2004s/helpdata/en/9f/db9bb935c111d1829f0000e829fbfe/content.htm

Use Tcode SE36 For creating Logical Database.

Here is a simple Program on Logical database.

NODES: spfli,sflight.

START-OF-SELECTION.

WRITE 'Test Program for GET'.

*Fetching SPFLI table

GET spfli.

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

'Connid:', spfli-connid.

*Fetching SFLIGHT table

GET sflight.

SKIP 5.

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

'Connid:', sflight-connid.

http://help.sap.com/saphelp_nw04/helpdata/en/60/183d78163011d2953c0000e8353423/frameset.htm

example program

http://help.sap.com/saphelp_nw04s/helpdata/en/9f/db9be035c111d1829f0000e829fbfe/frameset.htm

regards,

pavan

REWARD POINTS IF USEFUL

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,

Regards,

Rahul

Former Member
0 Kudos

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

Report Ztest using database PNP.

Regards

Naveen Gupta