SAP NetWeaver AS ABAP Release 740, ©Copyright 2014 SAP AG. All rights reserved.
ABAP Keyword Documentation → ABAP Programming Guidelines → Robust ABAP → Modularization units →Dialog Modules and Event Blocks
Background
Besides procedures, there are two further types of processing blocks. However, they do not have a parameter interface and do not allow declaration of local data: (AT SELECTION-SCREEN and GET are exceptions but they should not be exploited):
Rule
No implementations in dialog modules and event blocks
Only use dialog modules and event routines if they are necessary from a technical viewpoint. In these cases, do not implement the required function. Instead, call the relevant (local) methods.
Details
Since it is not possible to declare local data in dialog modules and event blocks, you cannot implement any useful program logic. Therefore, dialog modules and event blocks # provided that they are still necessary # should only contain one method call. If you use ABAP Objects consistently, only the following elements are required:
Note
Using LOAD-OF-PROGRAM in a function group is basically the same as using a static constructor in a global class. In executable programs, you can use INITIALIZATION instead, if any parameters passed using SUBMIT need to be evaluated.
Example
The following source code shows the PAI modules of the function groupDEMO_CR_CAR_RENTAL_SCREENS from the package SABAP_DEMOS_CAR_RENTAL_DYNPRO. The screens in this package can be called using transaction DEMO_CR_CAR_RENTAL. These dialog modules adhere to the above rule. They do not contain their own implementations. They call methods of a local class of the function group.