Skip to content

ABAP Keyword Documentation →  ABAP − Reference →  SAP GUI User Dialogs →  General Dynpros →  Input Checks →  Input Checks - Examples 

Dynpros, Automatic Input Checks

The example demonstrates 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 dynpro number of dynpro 100 is 100. The date field (taken from the program) date is assigned to the input field Date. The remaining input fields are the components CARRID, CONNID, and MARK of the structure DEMO_CONN (taken from ABAP Dictionary). All of the fields are mandatory. 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. Additionally, the function key F8 has the function code EXECUTE assigned to it. The screen flow logic is as follows:

PROCESS BEFORE OUTPUT.
  MODULE init_screen_100.
PROCESS AFTER INPUT.
  MODULE cancel AT EXIT-COMMAND.
  MODULE pai.

The user must fill all of the input fields with valid values before the PAI module can be called:

  • All of the input fields must contain values
  • The date entry must have the correct format
  • The airline must exist in the 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 dynpro using Cancel (F12) without correctly entering all values, since the module call was programmed accordingly using AT EXIT-COMMAND.