A Module Pool also called a Dialog Program is an ABAP Program of type “M” that requires at least one transaction code in order to be executed. The transaction code usually starts a screen and it’s associated flow logically.
Process flow of Module Pool Execution
Module pools are executed in a very different manner than executable programs. Executing a module pool does not start a process in the runtime environment that sends events to the ABAP program in a specified sequence. Neither can module pools be started by entering their name or using SUBMIT. Transaction code To start a module pool you need to create at least one screen and define a transaction code, which is linked to one of the module pool screens. This screen then becomes the initial screen of a transaction with the ability to call other screens of the module pool.
How is Data Transport from ABAP to Screen and Back?
Data Transport between screens and ABAP programs is automatically handled by the system.
The First data transport occurs after all the PBO Modules have been executed and prior to a screen being displayed. The system will transport the contents of the ABAP work area in the program into the corresponding screen fields.
The Second data transport trigger is done once all the data entry is completed by the user and before the first PAI Module is executed. The system will copy the contents of the screen fields back to the corresponding ABAP work area in the program.
Events in Dialog Programming
- Process Before Output – Actions taken before displaying the output.
- Process After Input – Actions are taken after you input the data or carry some action on the screen.
Things you need to know in Dialog Programming
- Status Icons – Used in screens to indicate visually about the status of the program. It’s a type of screen element and uses the function module ‘ICON_CREATE’ to play around with it.
- Context menu – Content Menu can be created statically using SE41 or dynamically using the class CL_CTMENU.
- Screen keywords – Here are some screen keywords which you need to understand. PROCESS,MODULE,FIELD,ON,LOOP,ENDLOOP,CHAIN,END CHAIN,CALL.
- MODULE <name> at EXIT-COMMAND – This module is called when the user presses BACK, EXIT or CANCEL.
- GUI Status and Title – Check the syntax for SET PF-STATUS and SET TITLEBAR ‘XXXX’.
- Step loops – This helps in displaying tabular data on the screen,
- Table Control – Declare a control variable of type TABLEVIEW using control statements in the program and use the LOOP … ENDLOOP statement.