|
ABAP Tutorials -
ABAP UI Programming
|
|
Written by Ban-Gun
|
|
Saturday, 13 September 2008 16:36 |
|
An online program consists not only of the screens and their Flow Logic, but also ABAP program components: Global data, PBO modules, PAI modules, and subroutines. All of these components are incorporated into a main ABAP program. The name of this program must begin with “SAPM”. The last 26 characters in the program “SAPMaaa...” can be letters or numbers (let’s assume that our online program is named “SAPMZAVG”). The global data for an online program is declared in the Top Include program. The system will automatically name this include program “MzaaaTOP” (e.g., “MZAVGTOP”). The PBO and PAI modules contain the main processing logic of the online program and are “called” from within the Flow Logic of the screens. The PBO modules will be in one include program automatically named “MzaaaO01” (e.g., “MZAVGO01”). The “O” refers to PROCESS BEFORE OUTPUT. The PAI modules will be in one include program automatically named “MzaaaI01” (e.g., “MZAVGI01”). The “I” refers to PROCESS AFTER INPUT. The subroutines (if necessary) are in a separate include program automatically named “MzaaaF01” (e.g., “MZAVGF01”). The “F” refers to FORM.
Processing Control:
The run-time environment of an online program is made up of two components: dynpro (online) processor and ABAP processor. The dynpro processor controls the Flow Logic code and the ABAP processor controls the code in the ABAP modules. During the execution of an online program, control is constantly switching between the two processors. When an ABAP module is “called” from the Flow Logic, control switches from the dynpro processor to the ABAP processor. Once the module is finished executing, control switches back to the dynpro processor.
Work Areas:
 An online program consists of two distinct work areas – the screen work area and the program (module pool) work area. When you refer to a field in any ABAP program component or in Flow Logic, you are referring to a program field, not a screen field. Global program fields are defined in the Top Include. Local program fields are defined in the ABAP modules (PBO or PAI) or in subroutines. Because you are referencing program fields, the values that the user inputs into the screen fields must be transported to the program work area. This transport (and the transport from the program work area to screen fields) occurs if the field names are identical. Values are transported between the screen work area and the program work area: - After all the modules are executed in the PBO event, values are transported from the program work area to the screen fields with the same names.
- When the PAI event is triggered, values are transported from the screen work area to the program fields with the same names before any PAI modules are executed.
|