Application Development and Automation 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: 
Read only

LDB

ak_upadhyay
Contributor
0 Likes
605

Hi,

i need to create a logical database for HR Recruitment report.

how can i create my own LDB, plz give me the full steps for that. i am first working with LDB n m totally confused.

Thanks

3 REPLIES 3
Read only

Former Member
0 Likes
553

Hi,

LOGICAL DATABASES:

-


  • Logical Databases are used to generate report.

  • It is a repository object, not a data dictionary object.

  • Under one logical database, a node is created first for the corresponding table in the database.

  • A logical database can have any number of related nodes in the hierarchical manner.

  • First node of the logical database is called as ROOT NODE.

  • SLDB or SE36 to create logical databases.

Navigations to Create Logical Database:

-


SLDB -> Specify LDB name starting with Z or Y -> Click on Create -> Opens an interface -> Enter short description

-> Create -> Save under a package and assign request number -> Opens an interface

-> Specify Root Node name (MARA) -> Enter short description for the Root node

-> Specify Database Table name (MARA) -> Create -> Opens an interface

-> Select the Root Node (KNA1) -> Click on SELECTIONS pushbutton from Appn.

Toolbar -> Click on Yes to generate Selection Screens from the Structure

-> Click on No to Search Help -> Opens an Interface

-> Select the checkboxes to create Field Selections and Free Selections

-> TRansfer -> Opens an Include Program -> Decomment Select-Options statement and specify range variable as follows:

SELECT-OPTIONS : MATNUM FOR MARA-MATNR.

-> Save -> Activate -> Come back.

Select the Node -> Click on SOURCE CODE pushbutton

-> Click on Yes to generate source code from Structure and Selections -> Opens a report with two Include Files :

include DBZLOGICAL_DATABASE1TOP . " header

include DBZLOGICAL_DATABASE1NXXX . " all system routines

-> Double click on Header File to declare global variables -> Specify Following code:

TABLES : MARA * Autogenerated

DATA IT_MARA LIKE MARA OCCURS 0 WITH HEADER LINE.

-> Save -> Activate -> Come back -> Double click on System Routine file, where the fetching operations are done

-> Opens an Include File with three subfiles as follows:

include DBZLOGICAL_DATABASE1N001 . " Node MARA

include DBZLOGICAL_DATABASE1FXXX . " init, PBO, PAI

include DBZLOGICAL_DATABASE1SXXX . " search help

-> Double click on the first file -> Specify SELECT operation statement as follows:

select * from mara into table it_mara where matnr in MATNUM.

PUT MARA. * AUTOGENERATED CODE

loop at it_mara.

write 😕 it_mara-matnr, it_mara-mtart, it_mara-mbrsh, it_mara-meins.

endloop.

-> Save -> Activate.

To Access LDB node, create SE38 PROGRAM, Specify LDB name in ATTRIBUTES section -> Specify following code in SE38:

NODES MARA.

GET MARA.

-> Save -> Activate -> Execute.

Regards,

Priya.

Read only

0 Likes
553

Thanks Priya,

it works.

But i have to fetch data for 23 fields from

around 12 tables. in this case what should i do.

its urgent....

Read only

Former Member
0 Likes
553

Logical databases - data retrieval programs delivered by SAP that return data in a hierarchically

logical sequence

Are special data collection programs data delivered by SAP

Provide your program with data in a hierarchically logical

sequence

Contain data base accesses that have been optimized for

performance

Supply a dynamic selection screen

Contain all necessary authorization checks

the steps are

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

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

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.

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.

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

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.

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.

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

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.

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

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

Finally, you can maintain optional selection texts and documentation.

Do Reward if Useful