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

what is logical database

Former Member
0 Likes
2,110

Hi all

What is the importance of logical database? Do we use it in programming?

Thanks & Regards

Shiva

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,543

Hello,

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.

Thanks,

8 REPLIES 8
Read only

Former Member
0 Likes
1,544

Hello,

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.

Thanks,

Read only

0 Likes
1,543

hi,

look here:

regards Andreas

Read only

Former Member
0 Likes
1,543

hi,

Naren has provided 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

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.

Regards,

Richa

Read only

former_member189629
Active Contributor
0 Likes
1,543

Hi Shiva

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

If you find it useful, please reward me for the same.

Good luck

Karthik Potharaju

Read only

Former Member
0 Likes
1,543
Read only

ashok_kumar24
Contributor
0 Likes
1,543

Hi shiva nanda ,

LOGIGAL SYSTEM means usually the SLD entry "logical system" resp the name which is given by customizing in transaction SALE. It is only used for IDoc traffic. I dont know where you found that in the proxy.

Proxy deoes not require any logical name of the system. This is the entry made in transaction SALE.

Refer to following weblog for proxy.

/people/vijaya.kumari2/blog/2006/01/26/how-do-you-activate-abap-proxies - Activate Proxy

/people/siva.maranani/blog/2005/04/03/abap-server-proxies - ABAP Server Proxy

/people/ravikumar.allampallam/blog/2005/03/14/abap-proxies-in-xiclient-proxy - ABAP Client Proxy

Check this demo of ABAP Proxy.

https://www.sdn.sap.com/irj/sdn/docs?rid=/webcontent/uuid/110ff05d-0501-0010-a19d-958247c9f798#xi [original link is broken]

Logical databases are special ABAP programs that retrieve data and make it available to application programs. The most common use of logical databases is to read data from database tables by linking them to executable ABAP programs.

However, from Release 4.5A, it has also been possible to call logical databases 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.

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.

Tasks of Logical Databases

1.Reading the same data for several programs.

2.Defining the same user interface for several programs.

3.Central authorization checks

4.Improving performance

First part of your question

So,if i am not wrong, LDB cannot be completely considered as object oriented programmming.

I have highlighted some important points above

For understanding this in detail you can go through the sap help .(if you donot know go through the below path

sap library

+ Basis Components

-Abap Programing and runtime enviornment

-BC-ABAP Programming(noe serach for ldb

Now your second part of question.

In the scenario which you have mentioned we can use ldb.But i am not sure whether it is a typical scenario of ldb.LDB is just a specific access routine to support database access for some application (report generation) needs.We can define a logical database to shorten our ABAP coding .

Here I am mentioning a link which shows a complete implementation of an LDB.

http://homepages.wmich.edu/~r2raviko/HandsOnQuest/HO9.doc

I suppose after going through the reply(or sap help) and the link mentioned above all your doubts regarding LDB will be cleared.

Good Luck and reward me for the same

Thanks

Ashok.N

Read only

Former Member
0 Likes
1,543

hi,

In Human Resources (HR), the following logical databases can be used as a data source for HR InfoSets:

PNP

PAP

PCH

By selecting a logical database, you determine the HR data that can be reported on using an InfoSet.

Logical Database PCH

This logical database generally enables you to report on all HR infotypes. However, you are advised not to use this logical database unless you want to report on Personnel Planning data.

Logical Database PNP

Use logical database PNP to report on HR master data. It is possible to use logical database PCH to access this data, but PNP meets such reporting requirements more quickly because it is best suited to the task of selecting persons.

Logical database PNP enables you to access HR master data and infotypes from Personnel Planning. For example, you have the following options:

Reporting on the costs, number of attendees booked, and instructor for a business event on which an employee is booked

Reporting on working time and planned compensation for a position that an employee occupies

Reporting on the validity and proficiency of a qualification that an employee fulfils

From a technical perspective, this means you can use PNP to report on all of the infotypes that exist for objects (infotype 1000) that have a direct relationship (infotype 1001) with the Person object.

The ability to access infotypes from Personnel Planning using logical database PNP is a special feature that you can only use in the context of SAP Query and Ad Hoc Query. You cannot use this functionality for ABAP reports you programmed yourself.

You can also use logical database PNP to report on data from Personnel Time Management (infotypes 2000 to 2999) and Payroll (special payroll infotypes for the USA and customer infotypes; for more information, access Customizing for the Human Resources Information System and see Payroll Results).

Logical Database PAP

Logical database PAP enables you to access data from Recruitment.

also check this link:

http://help.sap.com/saphelp_nw04/helpdata/en/ca/d08606a44f11d1950c0000e82de14a/content.htm

regards,

keerthi.

Read only

Former Member
0 Likes
1,543

hi shiva,

Hi please go the following site to find more info abt it.

http://www.sap-basis-abap.com/sapta003.htm

Logical Database - SE36

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.

Reading a SAP standard logical database (DB M - MRP Documents) in your ABAP/4 program.

start-of-selection.

  • get is equal to select * from....

get mdkp.

check field-name.

get mdtb.

check field-name

end-of-selection.

-


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,

Naveen