To call a module, use the flow logic statement
The system starts the module mod of the ABAP program. A module must have been defined for the same event block in which the call occurs.
If you only use simple modules in the screen flow logic, the data transport between the ABAP program and the screen is as follows:
· In the PAI event, all of the data from the screen is transported to the ABAP program (as long as there are program fields with the same names as the screen fields) after the automatic input checks and before the first PAI module is called. This includes the contents of the system fields (for example, sy-ucomm, which contains the current function code).
· At the end of the last PBO module, and before the screen is displayed, all of the data is transported from the ABAP program to any identically-named fields in the screen.
Data is transported between the screen and the ABAP program at the beginning and end of each dialog step on the application server. Do not confuse this with the data transport between a screen on the application server and the SAPgui on the presentation server.
Simple module call
DATA: ok_code TYPE sy-ucomm,
save_ok LIKE ok_code,
wa_spfli TYPE spfli.
CALL SCREEN 100.
MODULE init_screen_100 OUTPUT.
MOVE-CORRESPONDING wa_spfli TO demo_conn.
MODULE status_0100 OUTPUT.
SET PF-STATUS 'STATUS_100'.
SET TITLEBAR '100'.
MODULE clear_ok_code INPUT.
save_ok = ok_code.
MODULE get_data INPUT.
MOVE-CORRESPONDING demo_conn TO wa_spfli.
MODULE user_command_0100 INPUT.
cityfrom airpfrom cityto airpto fltime deptime arrtime
INTO CORRESPONDING FIELDS OF wa_spfli
WHERE carrid = wa_spfli-carrid AND connid = wa_spfli-connid.
The statically-defined next screen number for screen 100 is 100. It uses components of the structure DEMO_CONN , copied from the ABAP Dictionary, and looks like this:
The screen flow logic is as follows:
In the GUI status STATUS_100, the symbol (F12) is active with the function code CANCEL, and the functions DISPLAY and CLEAR are assigned to the function keys F5 and shift+F2 respectively.
The program has a similar function to the example program in the section Processing Input/Output Fields.