At selection screen on the field and at selection screen are selection-screen events which are used for input validations in SAP report programming.
At Selection Scteen on Field | At Selection Screen |
---|---|
This event is used to validate a single input field. | This event is used to validate multiple input fields. |
If we this event, if any, error the error field will be highlighted and the remaining fields will be disabled. | By using this event, the error field is heightened and all the remaining fields will be enabled. |
Example to explain At Selection-Screen on the field and At Selection-Screen difference.
In the below example we are going to validate two input fields and we will see the difference in screen behavior.
At Selection Screen | At Selection Screen on Field |
---|---|
REPORT ZSPN_SELECTION_SCREEN_EVENT. PARAMETERS P_FIELD1 TYPE CHAR10 . PARAMETERS P_FIELD2 TYPE CHAR10. AT SELECTION-SCREEN. IF P_FIELD1 IS INITIAL. MESSAGE 'Please enter field1' TYPE 'E'. ENDIF. IF P_FIELD2 IS INITIAL. MESSAGE 'Please enter field2' TYPE 'E'. ENDIF. |
REPORT ZSPN_SELECTION_SCREEN_EVENT. PARAMETERS P_FIELD1 TYPE CHAR10 . PARAMETERS P_FIELD2 TYPE CHAR10. AT SELECTION-SCREEN ON P_FIELD1. IF P_FIELD1 IS INITIAL. MESSAGE 'Please enter field1' TYPE 'E'. ENDIF. AT SELECTION-SCREEN ON P_FIELD2. IF P_FIELD2 IS INITIAL. MESSAGE 'Please enter field2' TYPE 'E'. ENDIF. |
![]() After error message both input fields are enabled for input. |
![]() After error message all input fields are disabled, only the error field will be enables and heightened . |