Entering content frame

Automatic Input Checks Locate the document in its SAP Library structure

In the PAI event, the screen makes a series of automatic input checks. These are carried out before any data is transferred to the ABAP program, and before the screen flow logic is processed. Before the automatic input checks, you can call a single dialog module unconditionally using a special function type. You normally use this dialog module to bypass the checks and leave the screen directly.

If the automatic input checks find an error, a message appears in the status bar of the screen, and the corresponding fields remain ready for input. The user must correct the entries and trigger the PAI again. The actual PAI processing does not start until there are no more errors.

The automatic input checks run in the following order:

This example applies to German only.

If a field is defined as a mandatory field in the Screen Painter, the user must enter a value for it before the PAI processing can start.

Input format

The values entered in the input fields on the screen must correspond to the data format of the corresponding screen field. For example, the format of a date field (type DATS) is eight characters and has the format YYYYMMDD. All of the characters must be numeric. MM must be 12 or less, and DD must be 31 or less. The system also checks that the specified day is valid for the month.

ABAP Dictionary Checks

If you create an input field in the Screen Painter by Structure linkcopying an ABAP Dictionary field, the screen checks whether:

·        The value satisfies any foreign key relationship to another database table, that is, the system checks whether the value is contained in the check table as a Structure linkforeign key. This is only checked if the Foreign key attribute is set in the Screen Painter for the input field. The input check is not necessarily identical with the input help. The programmer is responsible for ensuring that the input help presents values that will all pass any foreign key check.

·        That the value is one of the fixed values of the Structure linkdomain of the fields, that is, the system checks the definition of the underlying domain in the ABAP Dictionary. The fixed values of the domain can also be used as input help. However, the value table of a domain is not checked. It is only used as a default value for the check tables of the fields that refer to the domain.

Example

Automatic input checks

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(sabapdocu) WITH text-001.
ENDMODULE.

The next screen (statically defined) for screen 100 is 100. It has the following layout:

This graphic is explained in the accompanying text

The date field date from the program is assigned to the input field Date. The other input fields are the CARRID; CONNID, and MARK components of the ABAP Dictionary structure DEMO_CONN. All of the fields are mandatory. The function code of the pushbutton is EXECUTE.

In the GUI status STATUS_100, the icon This graphic is explained in the accompanying text (F12) is active with function code CANCEL and function type E. Furthermore, the function key F8 is assigned to the function code EXECUTE.

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 be in the check table SCARR

·         The flight number must exist for the corresponding airline in the check table SPFLI

·         The selection MARK must be one of the fixed values of the domain S_FLAG.

The user can leave the screen using Cancel (This graphic is explained in the accompanying text, F12) without entering all values correctly, since the module call is programmed using AT EXIT-COMMAND.

 

 

 

 

Leaving content frame