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.
Before activating a program you need to check if the program is syntactically correct. This can easily be done in the ABAP editor with the following tools
Syntax Check Extended Program Check _________________________________________
The menu pat is as follows
Program >>>>>> Check >>>>>> Syntax Program >>>>>> Check >>>>>> Extended Program Check _________________________________________________________________
Syntax Check (Standard Syntax Check)
Here the syntax is checked by the system and if an error occurs the check stops and immediately an error message is displayed. Also the system suggests error correction. Any SAP ABAP program before execution needs to be Activated and before activation a Syntax check is necessary. If the program has not been checked for Syntax, and directly activated then during the activation process you have an option to ignore the errors and activate anyway. If you choose this option, the syntax errors are displayed while executing the program.
In case you are running a Syntax check on an Include program then automatically the system combines it with the TOP INCLUDE. In case the systems generates WARNINGS in the syntax check, then you can still run the program as some of the WARNINGS can be ignored. But its a good practice to correct all the warnings as they could lead to unforeseen errors and can give trouble in future SAP releases.
Extended Program Check
The extended program check does a more complete check of the program. It actually does a Syntax check on all the interfaces called from your program. All these check are excluded from the Standard Syntax check explained above. Basically there are 2 types of errors in any program
Static Errors and Runtime Errors
The Runtime errors are not checked by the Standard Syntax Check explained above. Even the Extended Program Check is a Syntax Check for Static Errors. Sometimes in extended program check you may get warnings that cannot be corrected, the code that produces such warnings should be commented for extended check or you can put pseudo comments ("#EC). All other Warnings should be corrected before activating the program. Technically the development is not considered to be complete if the Extended Program Check shows errors/warnings.
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.