Skip to Content

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

selection screen

Hi all,

I have 3 radiobuttons and 3 input fields.

if i have select the 1 radiobutton , the 1 first input only accept the value and other 2,3 input fields are grayed out .

if i have select 2 radio button , the 2 second input filed accept the value and other1 and 3 are grayed out respectively.

please give me the logic.

regards,

Aj

Tags:
Former Member
replied

Hi,

Please check this sample code.

PARAMETERS: P_RAD1  RADIOBUTTON GROUP GRP1 DEFAULT 'X'
                    USER-COMMAND CHECK.
PARAMETERS: P_RAD2  RADIOBUTTON GROUP GRP1,
            P_RAD3  RADIOBUTTON GROUP GRP1.
                                                                        
PARAMETERS: P_FIELD1 TYPE C,
            P_FIELD2 TYPE C,
            P_FIELD3 TYPE C.

AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF ( P_RAD1 = 'X' AND ( SCREEN-NAME = 'P_FIELD2' OR
                            SCREEN-NAME = 'P_FIELD3' ) )
    OR ( P_RAD2 = 'X' AND ( SCREEN-NAME = 'P_FIELD1' OR
                            SCREEN-NAME = 'P_FIELD3' ) )
    OR ( P_RAD3 = 'X' AND ( SCREEN-NAME = 'P_FIELD1' OR
                            SCREEN-NAME = 'P_FIELD2' ) ).
      SCREEN-INPUT = '0'.
    ENDIF.

    MODIFY SCREEN.
  ENDLOOP.   

Regards,

Ferry Lianto

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question