Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Enabling and disabling fields on selection screen

Hi there experts...

I Have the following code, but i need to do add more conditions but I'm not able to do so.

PARAMETERS: ch_alv AS CHECKBOX DEFAULT 'X' USER-COMMAND cmd.
PARAMETERS: ch_tot AS CHECKBOX DEFAULT 'X' USER-COMMAND cmd MODIF ID cht.
PARAMETERS: rb1 RADIOBUTTON GROUP rb1 DEFAULT 'X' MODIF ID rbg.
PARAMETERS: rb2 RADIOBUTTON GROUP rb1 MODIF ID rbg.

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.
    IF CH_TOT = 'X'. 
      IF SCREEN-GROUP1  = 'RBG'.
        SCREEN-INPUT = 1. 
      ENDIF.
    ELSE. 
      IF SCREEN-GROUP1  = 'RBG'.
        SCREEN-INPUT = 0. 
      ENDIF.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.

Now what I want is to only enable ch_tot, rb1 and rb2 parameters if ch_alv is checked, but I want to maintain the condition of enable RBG only if ch_tot is checked.

Can it be done?

Thanks

Edited by: Hermano.Andrade on Apr 3, 2009 1:27 PM

Former Member
Former Member replied
PARAMETERS: ch_alv AS CHECKBOX DEFAULT 'X' USER-COMMAND cmd.
PARAMETERS: ch_tot AS CHECKBOX DEFAULT 'X' USER-COMMAND cmd MODIF ID cht.
PARAMETERS: rb1 RADIOBUTTON GROUP rb1 DEFAULT 'X' MODIF ID rbg.
PARAMETERS: rb2 RADIOBUTTON GROUP rb1 MODIF ID rbg.

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.
    IF CH_ALV = 'X'.
      IF SCREEN-GROUP1  = 'RBG' OR SCREEN-GROUP1  = 'CHT'.
        SCREEN-INPUT = 1.
      ENDIF.
    ELSE.
      CLEAR CH_TOT.
      IF SCREEN-GROUP1  = 'RBG' OR SCREEN-GROUP1  = 'CHT'.
        SCREEN-INPUT = 0.
      ENDIF.
    ENDIF.

    IF CH_TOT = 'X'.
      IF SCREEN-GROUP1  = 'RBG'.
        SCREEN-INPUT = 1.
      ENDIF.
    ELSE.
      IF SCREEN-GROUP1  = 'RBG'.
        SCREEN-INPUT = 0.
      ENDIF.
    ENDIF.
    MODIFY SCREEN.
  ENDLOOP.
0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question