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: 

Logical database

Former Member
0 Kudos

Hi Guys,

Could u plz tell me how to create a LDB and use it in a Report with example. Best solutions will be rewarded.

Thanks in advance,

Alson

1 ACCEPTED SOLUTION

former_member386202
Active Contributor
0 Kudos

Hi,

Use SE36 to create logical database and give the name of logical data base

int the attributes of program.

Regards,

Prashant

4 REPLIES 4

former_member386202
Active Contributor
0 Kudos

Hi,

Use SE36 to create logical database and give the name of logical data base

int the attributes of program.

Regards,

Prashant

Former Member
0 Kudos

Hi alson dsouza,

I think this will b usefull.

Creating a Logical Database

To create a new logical database, you should follow the procedure below. The Logical Database Builder then saves you work by using components that you have already defined to generate proposals for other components. Some of the most important attributes of a logical database are set when you define its structure. When you have defined the structure, the Logical Database Builder automatically generates a proposal for the selection include. The system then generates an input mask for the database program, based on the structure of the logical database and the selections.

These generated proposals allow you to create a working logical database quickly. However, you must program refinements such as authorization checks and performance optimization yourself.

Procedure for Creating a Logical Database

...

1. Enter a name on the initial screen of the Logical Database Builder and choose Create.

2. A dialog box appears. Enter a short text. You can change this later by choosing Extras ® Short text or Administration info.

3. Once you have entered the short text, you must define the root node of the logical database. Enter the node name and its attributes. There are three different types of nodes:

§ Database tables. The table must be active in the ABAP Dictionary. Tables always have a flat structure. The name of the node must correspond with the name of the table.

§ Data types from the ABAP Dictionary: The node may refer to any data type in the ABAP Dictionary. The node name and the name of the data type do not have to be the same. You can use deep data types as nodes.

§ Data types from type groups: The node can also refer to a data type from a type group in the ABAP Dictionary. Enter the name of the type group in the corresponding field. You must choose Other types before specifying this type. Data types in type groups were the forerunners of real data types in the ABAP Dictionary. Wherever possible, you should use ABAP Dictionary data types. They have all of the semantic properties of their underlying data elements. This is useful, for example, when you use a logical database to create ABAP Queries.

You can use the Text from Dictionary function to adopt the text stored in the ABAP Dictionary for the relevant table or data type.

4. The structure editor of the Logical Database Builder appears. On the left is the name of the root node, followed by a code for the node type: T for a database table, S for a ABAP Dictionary type, and C for a type from a type group. The new logical database now has a structure with a single node.

5. You can now extend the structure as described in Editing the Structure.

6. If you choose Next screen (right arrow in the application toolbar), a screen appears on which you can enter a search help for the logical database as described under Editing Search Helps.

7. If you choose Next screen (right arrow in the application toolbar), a dialog box appears, asking you whether the system should generate the selections for the logical database. When you have confirmed the dialog box, a list appears, on which you can select all of the nodes that you want to use for field selections or dynamic selections. The fields that you select are included in the source code generated by the system for the selection include.

8. The generated selection include is displayed in the ABAP Editor. You can change it as described in Editing Selections.

9. If you choose Next screen (right arrow in the application toolbar), a dialog box appears, asking you whether the system should generate the database program for the logical database. The database program is generated from the structure and the selection include. It has a modular structure, consisting of several include programs and all of the necessary subroutines, with proposals for the statements that will read the data.

10. The generated database program is displayed in the ABAP Editor. You can change it as described in Editing the Database Program.

11. If you repeatedly choose Previous screen (left arrow in the application toolbar), you can display and change the general attributes of the logical database.

12. Finally, you can maintain optional selection texts and documentation.

IF ITS USEFULL PLZ REWARD POINTS

.

Thanks & Regards .

Arun

Former Member
0 Kudos

hi

see the doc

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

Sample code

TABLES: SPFLI,

SFLIGHT,

SBOOK,

SCARR.

START-OF-SELECTION.

GET SPFLI.

WRITE:/ ’SPFLI: ’, SPFLI-CARRID, SPFLI-CONNID,

SPFLI-AIRPFROM, SPFLI-AIRPTO.

GET SFLIGHT.

WRITE:/ ’ SFLIGHT: ’, SFLIGHT-CARRID, SFLIGHT-CONNID, SFLIGHT-FLDATE.

GET SBOOK.

WRITE:/ ’ SBOOK: ’, SBOOK-CARRID, SBOOK-CONNID,

SBOOK-FLDATE, SBOOK-BOOKID.

GET SFLIGHT LATE.

WRITE:/ ’ GET SFLIGHT LATE: ’, SFLIGHT-FLDATE.

Former Member
0 Kudos

Hi,

Please go thru the link below :

<a href="http://help.sap.com/saphelp_47x200/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/frameset.htm">http://help.sap.com/saphelp_47x200/helpdata/en/9f/db9b5e35c111d1829f0000e829fbfe/frameset.htm</a>

Thanks,

Sriram Ponna.