Using at Selection Screen output in SAP ABAP

Using Selection Screen output for dynamic dynamic modifications on selection screen in SAP ABAP

+ -

At Selection Screen output is a selection-screen event, which is used to manipulate dynamic changes on selection-screen.

Loop At Screen. Screen is structure with Name, Group1, Group2, Group3, Group4, invisible, active, intensified etc fields, this holds the screen information at run time, Loop at Screen...Endloop. is used to loop through screen elements, and based on the values in above structure (SCREEN) we can manipulate changes.

MODIF ID : MODIF ID is a three character id (without quotes), we can process a screen elements group using this MODIF ID, this will be stored in SCREEN-GROUP1.

All Screen modifications should be done under AT SELECTION-SCREEN OUTPUT event only.

MODIFY SCREEN is keyword which is used to apply screen modification.

The below is the sample code for dynamic screen modification .

Selection Screen dynamic modifications

When ever we check enable input field check box, one input field will be enabled.

At selection screen output

REPORT  ZSPN_SELECTION_SCREEN_OUTPUT.
PARAMETERS P_ENABLE AS CHECKBOX USER-COMMAND UC1.
PARAMETERS: INPUT(5) TYPE C MODIF ID IN1 . "Based on modif id we will perform dynamic operations

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.
    IF P_ENABLE = 'X'  . " If check box is selected
      IF SCREEN-GROUP1 = 'IN1' .
        SCREEN-ACTIVE = 1.
        MODIFY SCREEN.
      ENDIF.
    ELSE.
      IF SCREEN-GROUP1 = 'IN1' .
        SCREEN-ACTIVE = 0.
        MODIFY SCREEN.
      ENDIF.
    ENDIF.
  ENDLOOP.

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 54 People out of 56 think this lesson helpful


    Lesson Navigation

    ←Previous Chapter
    Next Chapter →