ABAP Events - AT SELECTION-SCREEN ON field - Introduction With Sample Program.
AT SELECTION-SCREEN ON <field> Event With A Sample Program This event can be used if the user wants checks or validations to be carried out for a particular field on the selection screen. At Selection-Screen On <field> and At Selection-Screen events , both do the same job i.e. validating the input fields present on the selection screen. The only difference is At Selection-screen event is used to validate all the fields on the selection screen where as At Selection-Screen On <field> event is used to validate a particular field in the selection screen. Suppose there are 4 input fields in the selection screen, we want validation for input field FIELD1 only. Using AT-SELECTION-SCREEN ON <field>: REPORT ztest. PARAMETERS: p_field1 TYPE char10, p_field2 TYPE char10, p_field3 TYPE char10, p_field4 TYPE char10. AT SELECTION-SCREEN ON p_field1. IF p_field1 IS INITIAL. MESSAGE 'Please enter a value in Field1.' TYPE 'E'. ENDIF.