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: 

Selection part of Logical Database

Former Member
0 Kudos

I read about logical database somewhere on the net but it was not so clear. Can anyone explain to me about the selection part of the logical database???

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Prakash,

The Logical database consists of a number of either database tables or structures which are linked to each other through some relationships like the foreign key relationship.

All the tables are defined in a hierarchical structure.

The fetching of the data in the LDB is controlled by the PUT and the GET events of the LDB program.If you look carefully at any standard LDBs like PSJ and look at their database programs which start as 'SAPDB-LDBName',you will see that the events PUT Node as one of the major events in there.

What happens is,as soon as you mention Get Node keyword in your ABAP program,the control shifts to the Database program of the LDB and goes directly to the PUT event of the corresponding Node.The control then goes to the Form of that corresponding node and fetches the data as mentioned in there.

Similarly,the data from all the tables which fall under the Node mentioned in your program is fetched.

Hence,all the Get events in your program fetch the data one by one and ypou don't have to write even a single Select statement to fetch the data.

But you should always wrte the Get Nodes carefully after examining the hierarchical structure of the LDB else redundant data might be fetched and hence performance issues.

In case you have any further clarifications,do let me know.

Regards,

Puneet Jhari.

Message was edited by:

Puneet Jhari

5 REPLIES 5

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 and linking them to executable ABAP programs while setting the program contents. You edit logical databases using the Logical Database Builder in the ABAP Workbench.

However, since Release 4.5A, it has also been possible to call logical databases independently of this tool 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 executable programs, allowing them to use more than one logical database and process a database more than once.

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.

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

***************

A logical database is a special ABAP/4 program which combines the contents of certain database tables. You 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 which can be taken from different database tables.

GO THROUGH 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

*****************

Logical databases are SAP standard programs that are desinged with selections screens that helps easy retrival and access of data from various tables in and efficient manner.

You can get to know more about the logical databases from the SAP documentation or the following links.

A logical database is a special ABAP/4 program which combines the contents of certain database tables. You 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 which can be taken from different database tables.

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 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

*****************************

1. A logical database is in fact

a program only.

2. This LDB provides two main things :

a) a pre-defined selection screen

which handles all user inputs and validations

b) pre defined set of data

based upon the user selection.

3. So we dont have to worry about from

which tables to fetch data.

4. Moreover, this LDB Program,

handles all user-authorisations

and is efficient in all respects.

5. tcode is SLDB

good info about Logical Database. you can check the link.

http://www.geekinterview.com/question_details/1506

http://help.sap.com/saphelp_46c/helpdata/EN/35/2cd77bd7705394e10000009b387c12/frameset.htm

http://help.sap.com/saphelp_46c/helpdata/en/9f/db9bed35c111d1829f0000e829fbfe/frameset.htm

Functions for displaying and changing logical databases:

Call Transaction SE36 or

Choose ABAP Workbench -> Development -> Programming environ. -> Logical databases

Interaction between database program and report:

During program processing, subroutines are performed in the database program and events are executed in the report.

To read data from a database tables we use logical database.

A logical database provides read-only access to a group of related tables to an ABAP/4 program.

advantages:-

The programmer need not worry about the primary key for each table.Because Logical database knows how the different tables relate to each other,and can issue the SELECT command with proper where clause to retrieve the data.

i)An easy-to-use standard user interface.

ii)check functions which check that user input is complete,correct,and plausible.

iii)meaningful data selection.

iv)central authorization checks for database accesses.

v)good read access performance while retaining the hierarchical data view determined by the application logic.

disadvantages:-

i)If you donot specify a logical database in the program attributes,the GET events never occur.

ii)There is no ENDGET command,so the code block associated with an event ends with the next event

statement (such as another GET or an END-OF-SELECTION).

1. transaction code SLDB.

2.enter name z<ldb-name>

3.create

4.short text

5.create

6. name of root node (here Ekko)

7. enter short text (f6)

8.node type -> data base table.

9.create

10 change logical DB

riht click on ekko and insert node

here node name ekpo

11.create

12. click on selections

13. press no Should the changed structure of Z<ldb name> be saved first.

14.select tables which you want to join.

15.transfer

16 now you have to o to coding part.

17. save

activate.

19.click to src code

double click on first include and activate

***********************

Regards

Vasu

Former Member
0 Kudos

Hi,

A logical database is a special ABAP/4 program which combines the contents of certain database tables. You 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 which can be taken from different database tables.

LDB offers an easy-to-use selection screens. You can modify the pre-generated selection screen to your 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 data base accesses. Enhancements such as improved performance immediately apply to all report programs that use the logical database.

Less coding s required to retrieve data compared to normal internel tables.

Tables used LDB are in hierarchial structure.

Mainly we used LDBs in HR Abap Programming.

Where all tables are highly inter related so LDBs can optimize the performance there.

Check this Document. All abt LDB's

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.highlightedcontent?documenturi=...

GO THROUGH 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

Gothru the blog which provides info on LDB's:

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

Thanks.

Former Member
0 Kudos

Hi Prakash,

The Logical database consists of a number of either database tables or structures which are linked to each other through some relationships like the foreign key relationship.

All the tables are defined in a hierarchical structure.

The fetching of the data in the LDB is controlled by the PUT and the GET events of the LDB program.If you look carefully at any standard LDBs like PSJ and look at their database programs which start as 'SAPDB-LDBName',you will see that the events PUT Node as one of the major events in there.

What happens is,as soon as you mention Get Node keyword in your ABAP program,the control shifts to the Database program of the LDB and goes directly to the PUT event of the corresponding Node.The control then goes to the Form of that corresponding node and fetches the data as mentioned in there.

Similarly,the data from all the tables which fall under the Node mentioned in your program is fetched.

Hence,all the Get events in your program fetch the data one by one and ypou don't have to write even a single Select statement to fetch the data.

But you should always wrte the Get Nodes carefully after examining the hierarchical structure of the LDB else redundant data might be fetched and hence performance issues.

In case you have any further clarifications,do let me know.

Regards,

Puneet Jhari.

Message was edited by:

Puneet Jhari

Former Member
0 Kudos

hi

good

Static Selections in Logical Databases

The static selections of the logical database are defined in its selection part with the same ABAP statements as the program selections. The input fields for the logical database selections that actually appear on the screen depend on the nodes of the logical database that are specified in the program using the TABLES or the NODES statement.

The following program is linked to logical database F1S.

REPORT DEMO.

NODES SPFLI.

After DEMO has been started, the following selection screen is displayed:

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

=======

Selection Part

The selection part of the logical database defines input fields for selecting data. The runtime environment displays these on the selection screen when you run an executable program linked to the logical database. The corresponding fields are also available in the ABAP program, allowing you, for example, to change their values to insert default values on the selection screen.

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

reward point if helpful.

thanks

mrutyun^

Former Member
0 Kudos

Thanx all