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

Radio Button

Former Member
0 Likes
440

Hi Group,

Have a req:

Have 2 radio buttons on selection screen and two parameters input fields. When first radio button is selected have I have disable the 2 parameter input fields, and when second radio button is selected I have to enable the 2 parameter input fields. By default first radio button is selected, so there itself I have to make that 2 parameter input fields inactive, when second radio button is selected I have to make the 2 input fields as active.

Can you plz help.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
401

Hi,

Here is a code which does what is the funcationality you expect.

Parameters :

RB_1 RADIOBUTTON GROUP G1 USER-COMMAND A1," USER-COMMAND is used to trigger event and got AT SEELCTION-SCREEN , here we do not require it

RB_2 RADIOBUTTON GROUP G1 ,

P1 TYPE MATNR ,

P2 TYPE MATNR .

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF RB_1 = 'X'.

IF SCREEN-NAME = 'P1' OR

SCREEN-NAME = 'P2'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ELSEIF RB_2 = 'X'.

IF SCREEN-NAME = 'P1' OR

SCREEN-NAME = 'P2'.

SCREEN-INPUT = 1.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.

Regards,

Sankar

3 REPLIES 3
Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
401

Hi,

Assing a user-command to the radio buttons.

AT SELECTION-SCREEN OUTPUT.


if rad1 = 'X'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'PAR1' or SCREEN-NAME = 'PAR2'.
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.
if rad2 = 'X'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'PAR1' or SCREEN-NAME = 'PAR2'.
SCREEN-INPUT = 1. "TO make it read only
SCREEN-ACTIVE = 1. " TO Hide based on your requirement use any one line
MODIFY SCREEN.
ENDIF.
ENDLOOP.
endif.

Regards,

Sesh

Read only

gopi_narendra
Active Contributor
0 Likes
401

parameters : chk as checkbox user-command abc.

*--------------- Block 1
selection-screen begin of block b1 with frame .
parameters : a(10) type c modif id bk1.
selection-screen end of block b1.


*--------------- Block 2
selection-screen begin of block b2 with frame .
parameters : b(10) type c modif id bk2.
parameters : c(10) type c modif id bk2.
parameters : d(10) type c modif id bk2.
selection-screen end of block b2.


*----------------------------------
at selection-screen output.

  loop at screen.
    if chk = 'X'.
      if screen-group1 = 'BK1'.
        screen-invisible = 1.
        screen-input = 0.
        modify screen.
      endif.
    endif.

    if chk is initial.
      if screen-group1 = 'BK2'.
        screen-invisible = 1.
        screen-input = 0.
        modify screen.
      endif.
    endif.
  endloop.

Check this similar code with check box instead of radio button.

change the check box to radio buttons.

Regards

Gopi

Read only

Former Member
0 Likes
402

Hi,

Here is a code which does what is the funcationality you expect.

Parameters :

RB_1 RADIOBUTTON GROUP G1 USER-COMMAND A1," USER-COMMAND is used to trigger event and got AT SEELCTION-SCREEN , here we do not require it

RB_2 RADIOBUTTON GROUP G1 ,

P1 TYPE MATNR ,

P2 TYPE MATNR .

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF RB_1 = 'X'.

IF SCREEN-NAME = 'P1' OR

SCREEN-NAME = 'P2'.

SCREEN-INPUT = 0.

MODIFY SCREEN.

ENDIF.

ELSEIF RB_2 = 'X'.

IF SCREEN-NAME = 'P1' OR

SCREEN-NAME = 'P2'.

SCREEN-INPUT = 1.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.

Regards,

Sankar