At selection screen on field and at selection screen difference

Difference between at selection screen on field and at selection screen events in SAP ABAP programming.

+ -

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.

Dynamic Selection Screen modification

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.
At Selection Screen

After error message both input fields are enabled for input.

Selection Screen dynamic modification

After error message all input fields are disabled, only the error field will be enables and heightened .

Learner Questions


No Questions by learners, be first one to ask ..!!

    Please Sign in to ask a question

    Was this lesson helpful to you? Yes No 45 People out of 47 think this lesson helpful


    Lesson Navigation

    ←Previous Chapter
    Next Chapter →