Friday, January 17, 2014

TAW10 - FLOW OF AN ABAP PROGRAM

CLIENT/SERVER ARCHITECTURE OF THE SAP NETWEAVER


The software-oriented client/server principle powers the modular architecture of the SAP NetWeaver Application Server.
A relational database management system or RDBMS is used for managing data at the lowest level, called the database level.
The ABAP programs run at the application server level. They read data from the database; process it; and store the new data if necessary.
The third level or the presentation server level contains the user interface. Here each user can access the program; enter new data; and receive the results of a work process.
The assignments of these different levels to different systems serve as the basis for the scalability of the system.

EXCERPT FOR AN ABAP PROGRAM
ABAP programs are processed on the application server. When writing application programs, the design of user dialogs and database accesses is of particular importance.
This simplified graphic does not explicitly show the dispatcher and the work process. However, interaction between one user and one ABAP program will be the area of interest.

VIEW FOR THE USER
The average user has a practical interest in the business process and how data can be entered or displayed. This does not include knowledge of the precise process flow of an ABAP program. Thus the SAP system is like a "black box" to them.

INTERPLAY BETWEEN SERVER LEVELS AND PROGRAM FLOW


If a user performs a user action, such as choosing Enter or a function key, the control is passed from the presentation server to the application server.
If a further user dialog is triggered from within the ABAP program, the system transmits the screen and control back to the presentation server.
A program normally comprises not just a single block, but several reusable “modularization units.” In a good program, the database accesses will be encapsulated in such reuse units. This creates a division between the design of the user dialog and the database accesses.

PROGRAM START


Whenever a user logs on to the system, a screen is displayed. This screen helps the user start an ABAP program through the menu path.

SYSTEM LOADS PROGRAM CONTEXT

The system first loads the program context onto the application server. The Repository, which is a special part of the database, passes on all this program information to the runtime system.
The sample program has a selection screen as the user dialog; a variable and a structure as data objects; and one ABAP processing block.
The ABAP runtime system controls the subsequent program flow.

RUNTIME SYSTEM SENDS SELECTION SCREEN


As the program contains a selection screen, the ABAP runtime system sends it to the presentation server. The presentation server controls the program flow until the user finishes entering data in the input fields.

INPUT VALUES ARE INSERTED INTO DATA OBJECTS


After you finish entering the data on the selection screen, you can trigger further processing of the program by choosing Execute. The entered data are automatically placed in their corresponding data objects in the program and the ABAP runtime system resumes control of processing.
If your entries do not have the correct type, you will get an automatically triggered error message. You must then correct the entries.


REUSE UNIT LOADING
A reusable unit is called in the processing block that encapsulates the database access. With this, the program in which it is contained is also read from theRepository and loaded to the application server.


REUSE UNIT IS CALLED


The required data is transferred to the called program and the reuse unit is executed. As the execution is synchronous, you know that the calling program waits until the reuse unit is processed completely.


PROGRAM REQUESTS DATA RECORD FROM THE DATABASE

Information about the database table to be accessed and the row in the table to be read is passed on to the database.

DATABASE SUPPLIES THE DATA RECORD


The database returns the requested data record to the program and the runtime system ensures that this data is placed in the appropriate data objects.

REUSE UNIT RETURNS THE DATA


The processing of the reuse unit ends and the control is returned to the calling program, which resumes immediately after the call. The data that was read from the database is written to a corresponding data object for the calling program.


RUNTIME SYSTEM SENDS THE LIST
The ABAP processing block receives statements for structuring the list with which the result is to be displayed. After the execution of the processing block, the runtime system sends the list as a screen to the presentation server.

No comments:

Post a Comment