Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

selection screen

Former Member
0 Likes
422

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

1 ACCEPTED SOLUTION
Read only

ferry_lianto
Active Contributor
0 Likes
397

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

3 REPLIES 3
Read only

Former Member
0 Likes
397

You can handle this in event AT SELECTION-SCREEN OUTPUT -

IF RB1 = 'X'

LOOP AT SCREEN

IF SCREEN-NAME = RB2 / RB3, change screen input property to o

endloop.

endif.

Similar code you can do for remaining radio buttons.

Hope this helps.

AT SELECTION-SCREEN OUTPUT.

if rad1 = 'X'.

LOOP AT SCREEN.

IF SCREEN-NAME = 'RAD2' or SCREEN-NAME = 'RAD3'.

SCREEN-INPUT = 0. "TO make it read only

SCREEN-ACTIVE = 0. " TO Hide based on your requirement use any one line

MODIFY SCREEN.

ENDIF.

ENDLOOP.

endif.

ashish

Message was edited by:

Ashish Gundawar

Read only

ferry_lianto
Active Contributor
0 Likes
398

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

Read only

Former Member
0 Likes
397

Hi Ferry,

It got Solved.

regards,AJ