ABAP Keyword Documentation → ABAP - Reference → User Dialogs → Dynpros → Statements in the Screen Flow Logic → FIELD → Handling of messages at event PAI → Input Checks - Examples
Screens, Automatic Input Checks
The example illustrates what an automatic input check does.
Other versions: 7.31 | 7.40 | 7.54
Source Code
PROGRAM demo_dynpro_automatic_checks .
DATA: ok_code TYPE sy-ucomm,
date TYPE d.
TABLES demo_conn.
CALL SCREEN 100.
MODULE init_screen_100 OUTPUT.
SET PF-STATUS 'STATUS_100'.
ENDMODULE.
MODULE cancel INPUT.
LEAVE PROGRAM.
ENDMODULE.
MODULE pai INPUT.
MESSAGE i888(sabapdemos) WITH text-001.
ENDMODULE.
Description
The static next screen number of screen 100 is 100. The date field (taken from the program) date
is assigned to the input field Date. The remaining input field are the components
CARRID, CONNID and MARK of the structure DEMO_CONN (taken from the ABAP Dictionary). All input fields are obligatory. The function code of the pushbutton is EXECUTE.
In the GUI status STATUS_100, the symbol Cancel (F12) is activated by the function code CANCEL with the function type E. In addition, the function code EXECUTE is assigned to the function key F8. The screen flow logic is:
PROCESS BEFORE OUTPUT.
MODULE init_screen_100.
PROCESS AFTER INPUT.
MODULE cancel AT EXIT-COMMAND.
MODULE pai.
The user must first correctly fill all input fields, before the module PAI can be called:
- all input fields must be populated with values.
- the format of the date input must be correct.
- the airline must exist in check table SCARR.
- the flight number must exist in the check table SPFLI and match the airline.
- the marker MARK must be one of the fixed values of the domain S_FLAG.
The user can exit the screen via Cancel
(F12) without correctly entering all values, as the module call was programmed accordingly with AT EXIT-COMMAND
.