A logical database can be used in the following ways.
By linking it was an executable program in Program Attributes. By using the function module LDB_PROCESS
The SELECTION SCREEN is displayed only if link the Logical Database in the Program Attributes. It is not displayed if you call it using the Function Module LDB_PROCESS.
Editing Logical Databases:
The Logical Database can be edited using the following methods.
By using the Logical Database Builder in ABAP workbench. Transaction SE36 or SLDB the menu path is given below.
Tools---------->ABAP Work Bench--------------->Development------------->Programming Environment-------------->Logical Database Builder
Naming the Logical Database: The name can be upto 20 characters. It can also contain a three to to ten character namespace prefix, enclosed in forward slashes. From the initial screen the Logical Database can be created, copied or deleted. Before deleting the Logical Database its links form any program should be removed. You can use the where used link to find exactly where a Logical Database used before deleting it.
SAP Logical Databasesoffer the following Advantages:
Saves Time: This is because a Logical Database comes along with a pre-defined Selection Screen and Data Retrieval Logic.
A Logical Database can be used in Multiple Programs. Hence if you you create a Logical Database once it can be used along with several of your programs where similar logic is required.
It offers a easy to use and a Standard User Interface
Central Authorization Checks for Database Access.
Flexibility: This is because even though a Logical Database has its own selection screen and data retrieval logic still you can complement this with your selection screens and SELECT statements. This makes the program more powerful
Checks for the User Input, if it is complete, correct and plausible.
Note: One executable program can have only one Logical Database.
A Logical Database is a special ABAP program. Basically what a Logical Database does is it combines the contents of certain database tables. A Logical Database needs to be mentioned in the Program attributes, this is done while creating a new program. A program that has a Logical Database linked to it basically has another program working along with it, but this program works like a single program. It makes use of the additional functionality provided by the Logical Database. The processing blocks of the Logical Database are called by the runtime environment in a particular order.
Basically a Logical Database has two functions one is to
Call the Selection Screen and the Retrieve the data. __________________________________________________
A program that uses Logical Database is Event Driven. The most important Event associated with a Logical Database is the GET EVENT. This EVENT is responsible for retrieving the Data.
Example of a Logical Database: F1S
If you are using a Logical Database, even though the Selection screen and the Data Retrieval is carried out by the Logical Database still you can control the selection screen and the depth of the data retrieval process. This can be achieved with the help of the NODE statement.
Once the Logical database is mentioned in the Program Attributes you can then use the GET EVENT in the main program to determine the depth of the data retrieval. Also the NODES statement in your program interacts with the Selection Screen of the Logical Database. You can use the EXIT or CHECK statements to determine the depth of the GET EVENT.
Always use Pretty Printer and Extended Program Check before releasing the code.
Do not leave unused code in the program. Comment the code thoroughly. Align the comments and the Code. Follow the SAP Standards and SAP Best Practices guidelines. It’s a good practice to take a dump of the code on your local drive.