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: 

ABAP Logical Database ADA

Former Member
0 Kudos
1,749

Hi All, I am quite familiar with Logical Databases but I need to understand the following.

1) I am using LDB ADA, but I want to use my own Selection Screen and not the default one that the LDB provides. I know I must put something in AT SELECTION-SCREEN but am unsure what.

2) Once I get the data, I want to store the data in an internal table - how do I go about doing this? If you can provide a code example that would be great.

Points for any relevant help.

1 ACCEPTED SOLUTION

rainer_hbenthal
Active Contributor
0 Kudos
433

IF the ldb supplies a selection screen, you cant hide this. You can add your own selection blocks.

If you want to store that data in an internal table you can just pick them up in the GET event.

6 REPLIES 6

rainer_hbenthal
Active Contributor
0 Kudos
434

IF the ldb supplies a selection screen, you cant hide this. You can add your own selection blocks.

If you want to store that data in an internal table you can just pick them up in the GET event.

Former Member
0 Kudos
433

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.

Logical database structures

There are three defining entities in an SAP logical database. You must be clear on all three in order to create and use one.

Table structure: Your logical database includes data from specified tables in SAP. There is a hierarchy among these tables defined by their foreign keys (all known to SAP), and you are going to define a customized relationship between select tables. This structure is unique and must be defined and saved.

Data selection: You may not want or need every item in the referenced tables that contributes to your customized database. There is a selection screen that permits you to pick and choose.

Database access programming: Once you’ve defined your logical database, SAP will generate the access subroutines needed to pull the data in the way you want it pulled.

Creating your own logical database

Here’s a step-by-step guide:

1) Call up transaction SLDB (or transaction SE36). The path you want is Tools | ABAP Workbench | Development | Programming Environment | Logical Databases. This screen is called Logical Database Builder.

2) Enter an appropriate name in the logical database name field. You have three options on this screen: Create, Display, and Change. Choose Create.

3) You’ll be prompted for a short text description of your new logical database. Enter one. You’ll then be prompted to specify a development class.

4) Specify a root node, or a parent table, as the basis of your logical database structure. You can now place subsequent tables under the root table as needed to assemble the data object you want. You can access this tree from this point forward, to add additional tables, by selecting that root node and following the path Edit | Node | Create. Once you’ve saved the structure you define in this step, the system will generate the programming necessary to access your logical database. The best part is you don’t have to write a single line of code.

Noted point is we cant add any selection criteria thru our se38 program if you are attaching any LDB to program.Ist of no use.

If you want to change selection criteria to the existing LDB, you have to goto SE36 tcode and provide LDB name and choose "Change" mode by selecting "Selections" Radio button.

declaration of params is different compared to normal se38 program in some aspects.

PARAMETERS :p_curr LIKE bkpf-waers FOR TABLE bkpf OBLIGATORY.

this BKPF table should be one of the node in the "Structure" Radio button.

Thanks

Sivaparvathi

Please reward points if helpful.

Former Member
0 Kudos
433

WRite i managed to sort the first issue out.

Say i want to read table ANLAV. What would I write

GET ANLAV FIELDS xx xx xx xx.

but then I would like to read them into my internal table gt_anlav

What would I write? Thanks in anticipation.........

0 Kudos
433

Hi dipesh,

1. use something like this.

GET ANLAV

gt_anlav = anlav.

append anlav.

2. Suppose there are 50 records,

so GET will be called 50 times automatically, (one for each record),

and so the append will get execute 50 times.

3. THEN

4. after all GET, u want your own logic processing,

then use

END-OF-SELECTION.

my logic.

regards,

amit m.

0 Kudos
433

This is getting quite frustrating now. I put this code in

GET ANLAV.

CHECK SELECT-OPTIONS.

MOVE-CORRESPONDING ANLAV TO GW_ANLAV.

APPEND GW_ANLAV TO IT_ANLAV.

I have only put company as POLA which brings back many records on SE16 for ANLA. Henceforth ANLAV will have as many records. However it is bringing back one records when I am debugging. What am i doing wrong

evern if i change MOVE-CORRESPONDING ANLAV TO GW_ANLAV. to GW_ANLAV = ANLAV

Whoever solves this will get full 20 points

0 Kudos
433

Hi,

I am new to SAP.

ANLAV is not a table to store data, it is structure.

But how we are getting the data when we write the statement GET ANLAV.

Can anyone please explain me.