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

radiobuttons

Former Member
0 Likes
553

hi experts,

we have two blocks in our selection screen.each block have one radio button .

what i require is if we select one radioo button in first block ,the radiobutton which is in other block will have to enable.how?

i want logic also.

thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
531

HI Surendra

Radiobuttons are treated as a group. So we need more than one in your group, whereas your requirement seems to be 1:1. So if the blocks have two radiobutton of different groups, once the radiobutton is selected it can never be un-selected. In this case itz better to go for Checkboxes. Please check on the requirement.

Below code might give you some idea on the same:

selection-screen begin of block blk1 with frame.
   parameters: p_chk1 as checkbox user-command ABC.
selection-screen end of block blk1.

selection-screen begin of block blk2 with frame.
   parameters: p_chk2 as checkbox.
selection-screen end of block blk2.

at selection-screen output.

   loop at screen.
      check screen-name = 'P_CHK2'.
      if p_chk1 is initial.
         screen-active = 0.
      else.
         screen-active = 1.
      endif.
      modify screen.
   endloop.

Kind Regards

Eswar

hi experts,

we have two blocks in our selection screen.each block have one radio button .

what i require is if we select one radioo button in first block ,the radiobutton which is in other block will have to enable.how?

i want logic also.

thanks in advance.

4 REPLIES 4
Read only

Former Member
0 Likes
531

hai

u give different radiobutton group for each one.

and use this,

AT SELECTION-SCREEN ON RADIOBUTTON GROUP rad1.

within this u write coding for diable another block radiobutton

Read only

Former Member
0 Likes
532

HI Surendra

Radiobuttons are treated as a group. So we need more than one in your group, whereas your requirement seems to be 1:1. So if the blocks have two radiobutton of different groups, once the radiobutton is selected it can never be un-selected. In this case itz better to go for Checkboxes. Please check on the requirement.

Below code might give you some idea on the same:

selection-screen begin of block blk1 with frame.
   parameters: p_chk1 as checkbox user-command ABC.
selection-screen end of block blk1.

selection-screen begin of block blk2 with frame.
   parameters: p_chk2 as checkbox.
selection-screen end of block blk2.

at selection-screen output.

   loop at screen.
      check screen-name = 'P_CHK2'.
      if p_chk1 is initial.
         screen-active = 0.
      else.
         screen-active = 1.
      endif.
      modify screen.
   endloop.

Kind Regards

Eswar

Read only

anversha_s
Active Contributor
0 Likes
531

hi,

pls chk this logic.

u can give radio buton in the blocks. now i gave parameters.

by slight chnages u can adopt this logic.

report abc.


*-------------------------------------------
PARAMETERS : R1 RADIOBUTTON GROUP RG USER-COMMAND R DEFAULT 'X'.
PARAMETERS : R2 RADIOBUTTON GROUP RG .


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


selection-screen begin of block b2 with frame.
parameters : c(20) type c modif id def.
parameters : d(20) type c modif id def.
selection-screen end of block b2.

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


IF R1 = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'DEF'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.

IF R2 = 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'ABC'.
SCREEN-INPUT = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.

Regards

Anver

Read only

Former Member
0 Likes
531

Surendra,

one radio button in one group is not necessary. Each group atleat two radio buttons required. if the radio button in 2nd group want to diable, write code in first group radio button selection.