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

changing radio button property dynamically

former_member671224
Participant
0 Likes
782

Hi,

I decalred two blocks in selection screen named B1 and B2, each have 2 radio buttions.

B1 has radio button named B1R1 and B1R2.

B2 has radio button named B2R1 and B2R2.

If i select B1R1 then B2R1 should be selected and B2R2 should be disabled(user should not able to select).

If i select B1R2 then B2R2 should be selected and B2R1 should be disabled(user should not able to select).

Can anyone please tell me how to do this.

Thanks,

Amal

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
732

Hi

Try this

SELECTION-SCREEN: BEGIN OF BLOCK b1.
  PARAMETERS: b1r1 RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND ucomm1,
              b1r2 RADIOBUTTON GROUP g1.
SELECTION-SCREEN: END OF BLOCK b1.

SELECTION-SCREEN: BEGIN OF BLOCK b2.
  PARAMETERS: b2r1 RADIOBUTTON GROUP g2 USER-COMMAND UCOMM2 MODIF ID MD1,
              b2r2 RADIOBUTTON GROUP g2 MODIF ID MD2.
SELECTION-SCREEN: END OF BLOCK b2.

AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
  IF b1r1 = 'X'.
    if screen-group1 = 'MD2'.
      screen-input = 0.
    endif.
  ELSEIF b1r2 = 'X'.
    if screen-group1 = 'MD1'.
      screen-input = 0.
    endif.
  ENDIF.

  MODIFY SCREEN.
  ENDLOOP.

  AT SELECTION-SCREEN.
    IF b1r1 = 'X'.
    b2r1 = 'X'.
    b2r2 = ''.

  ELSEIF b1r2 = 'X'.
    b2r2 = 'X'.
    b2r1 = ''.

  ENDIF.

Hi,

I decalred two blocks in selection screen named B1 and B2, each have 2 radio buttions.

B1 has radio button named B1R1 and B1R2.

B2 has radio button named B2R1 and B2R2.

If i select B1R1 then B2R1 should be selected and B2R2 should be disabled(user should not able to select).

If i select B1R2 then B2R2 should be selected and B2R1 should be disabled(user should not able to select).

Can anyone please tell me how to do this.

Thanks,

Amal

4 REPLIES 4
Read only

Former Member
0 Likes
732

Why do you even need radio button group B2 on the screen then? You can use check boxes and set those based on the radio button B1 group value

Read only

0 Likes
732

Just for example i used 2 radio buttons. In actual senario there are more radio buttons and each has differrent process. So user should be able to select only one option.

Thanks,

Amal

Read only

0 Likes
732

look at the solution in this thread

Read only

Former Member
0 Likes
733

Hi

Try this

SELECTION-SCREEN: BEGIN OF BLOCK b1.
  PARAMETERS: b1r1 RADIOBUTTON GROUP g1 DEFAULT 'X' USER-COMMAND ucomm1,
              b1r2 RADIOBUTTON GROUP g1.
SELECTION-SCREEN: END OF BLOCK b1.

SELECTION-SCREEN: BEGIN OF BLOCK b2.
  PARAMETERS: b2r1 RADIOBUTTON GROUP g2 USER-COMMAND UCOMM2 MODIF ID MD1,
              b2r2 RADIOBUTTON GROUP g2 MODIF ID MD2.
SELECTION-SCREEN: END OF BLOCK b2.

AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
  IF b1r1 = 'X'.
    if screen-group1 = 'MD2'.
      screen-input = 0.
    endif.
  ELSEIF b1r2 = 'X'.
    if screen-group1 = 'MD1'.
      screen-input = 0.
    endif.
  ENDIF.

  MODIFY SCREEN.
  ENDLOOP.

  AT SELECTION-SCREEN.
    IF b1r1 = 'X'.
    b2r1 = 'X'.
    b2r2 = ''.

  ELSEIF b1r2 = 'X'.
    b2r2 = 'X'.
    b2r1 = ''.

  ENDIF.