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

Logical Database

Former Member
0 Likes
1,628

HI everyone,

I have to develop a report in HR, does anybody know what is a Logical Database and hot to create it?

the tables used are pa0001, pa0002, pa0014, pa0007

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,518

Hi sai,

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.

*----


1. To get a taste of it.

2. create a new z program.

3. while creating type PNP

in logical database field.

4. paste this code and execute.

REPORT ABC.

*----


infotypes : 0001.

TABLES : PERNR.

*----


GET PERNR.

WRITE 😕 PERNR-PERNR.

5. The selection screen which u see

is coming from logical database PNP program.

6. Execute

7. U will get a list of pernr.

-


SAPDBPNP

this is the main program of LDB PNP

which does the main work.

SAPDB + ldb name.

regards,

amit m.

10 REPLIES 10
Read only

Former Member
0 Likes
1,518

Hi,

Logical database is the one which you can call directly into the report program. It will give you the following:

1) selection-screen

2) Select- Data

3) Authorization.

So it is very useful.

Example is PNP logical database.

For creating Logical database:

You have to go to SE36 tcode and then create ur zldb:

In this give these tables pa0001, pa0002, pa0014, pa0007 as nodes and write the select statements...put zldb...and proceed further.

For reference, you can view PNP logical databse.

Regards,

Sushil.

Read only

Former Member
0 Likes
1,518

Thanks very much, I will try it

Read only

0 Likes
1,518

HI,

You can even try the example given in the abapdocu document. It will be useful.

Pls try this and reward the points if yoyu think its useful.

Sushil.

Read only

Former Member
0 Likes
1,518

Hi,

For information about LDB and its structure kindly refer the following threads which i`d answered to various queries on LDB.

Apart from that, before proceeding to create your own LDB kindly consider the following points ;

1. Check whether standard LDBs PNP, PCH would solve ur problem.

2. For a report which links only 4 transparent tables, is it really necessary that you have an LDB. Since You can have a better performing report by using joins. Consider the options of INNER JOINS before proceeding further.

Reward if helfpul.

Rgds

Read only

Former Member
0 Likes
1,518
Read only

Former Member
0 Likes
1,518

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.

Check this for LDB

http://help.sap.com/saphelp_46c/helpdata/EN/c6/8a15381b80436ce10000009b38f8cf/content.htm

http://www.cs.ucc.ie/~abf/CS507-8/l37c.pdf.

Good tutorial to start with.

http://www.thespot4sap.com/Articles/SAP_ABAP_Queries_FunctionalAreas_LogicalDB.asp

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

Also check this thread,

Please reward if it helps.

Message was edited by: Prakhar Saxena

Read only

Former Member
0 Likes
1,519

Hi sai,

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.

*----


1. To get a taste of it.

2. create a new z program.

3. while creating type PNP

in logical database field.

4. paste this code and execute.

REPORT ABC.

*----


infotypes : 0001.

TABLES : PERNR.

*----


GET PERNR.

WRITE 😕 PERNR-PERNR.

5. The selection screen which u see

is coming from logical database PNP program.

6. Execute

7. U will get a list of pernr.

-


SAPDBPNP

this is the main program of LDB PNP

which does the main work.

SAPDB + ldb name.

regards,

amit m.

Read only

Former Member
0 Likes
1,518

I used inner joins before, so its better to use inner joins or use the LDB?

Read only

0 Likes
1,518

HI,

If its an HR report uyou can use PNP or PCH ldb instead of inner joins. You can select the selection screen of your choice as well as you can get the authorization also by using the LDB.

For restricting the access to the database while using Logical database, you can use the provide...end provide statement.

Sushil.

Read only

Former Member
0 Likes
1,518

I try to use the Logical Databse PNP, but i am geting an error

"pernr is not defned for the current logical database"

is there any customisation to do?