SAP DYNP FIELD MESSAGES



Get Example source ABAP code based on a different SAP table
  



ABAP_DYNPRO - FIELD, Handling of Messages from the PAI Event
If the statement FIELD in the event block for PAI is linked with a MODULE statement, the statement controls the handling of warnings and error messages, which are sent in the called module using the statement MESSAGE.

Handling Outside a Processing Chain
If FIELD is specified outside a processing chain introduced using CHAIN, and if a warning or an error message is sent in the dialog module specified after MODULE, PAI processing is interrupted and the screen layout is displayed again without raising the event PBO. The input field belonging to dynp_field is the only field ready for input on the current screen and can be overwritten by the user. If the value in the input field is changed by the user, PAI processing is continued after a user action with the first FIELD statement or CHAIN statement linked with the dynpro field dynp_field. If the value in the input field is not changed by the user, PAI processing is continued again with the current FIELD statement. Previous statements of the PAI event block are not executed again.

Handling within a Processing Chain
If FIELD is specified within a processing chain, introduced by CHAIN, and if a warning or an error message was sent within a module called within the processing chain, PAI processing is interrupted and the screen displayed again without raising the event PBO. All input fields of the dynpro fields are ready for input that are specified within the processing chain after FIELD statements. If the value of at least one of these input fields is changed by the user, PAI processing continues after a user action at the first FIELD or CHAIN statement that linked with one of the changed dynpro fields. If none of the input fields is changed by the user, the PAI processing continues again directly at the CHAIN statement of the current processing chain. Previous statements of the PAI event block are not processed again.



Latest notes:

If an error message occurs after user input, the user must correct the input values until no error message is sent, whereas after a warning, the input values can be confirmed unchanged. The warning is not sent again when the MESSAGE statement is executed again.
If warnings or error messages are sent in modules without reference to FIELD or CHAIN, PAI processing is interrupted and the screen layout is displayed again without raising the event PBO and without a field on the screen layout being ready for input. In the event of an error message, the user must terminate the processing. To do this, an appropriate option must be created on the user interface, otherwise the program can only be terminated from outside.
User actions linked with function codes that set the OK field also count as changes to input fields. A prerequisite for this is that the OK field is defined in the dynpro and that function codes are not evaluated exclusively by the system field sy-ucomm.
ABAP_HINT_END

ABAP_EXAMPLES_ABEXA
Automatic Input Checks
Input Checks in Dialog Modules
ABAP_EXAMPLE_END