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

Gray out Radiobutton

0 Kudos
701

Hey Experts,

I have two radiobuttons and one Checkbox.

If the Checkbox is checked the radiobuttons should be grayed out and radiobutton one should be selected.

Your help would be appreciated.

1 ACCEPTED SOLUTION
Read only

Jeansy
Active Contributor
662

Hi,

this would be a possible solution for this case:

PARAMETERS: p_rb_01 RADIOBUTTON GROUP rg01 MODIF ID zrb,
            p_rb_02 RADIOBUTTON GROUP rg01 MODIF ID zrb.

PARAMETERS: p_cb AS CHECKBOX USER-COMMAND zcb.

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.
    IF screen-group1 = 'ZRB'.
      IF p_cb IS NOT INITIAL.
        screen-input = 0.
        p_rb_01 = abap_true.
        p_rb_02 = abap_false.
      ELSE.
        screen-input = 1.
      ENDIF.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

I hope this helps you.

Kind regards
Jens

1 REPLY 1
Read only

Jeansy
Active Contributor
663

Hi,

this would be a possible solution for this case:

PARAMETERS: p_rb_01 RADIOBUTTON GROUP rg01 MODIF ID zrb,
            p_rb_02 RADIOBUTTON GROUP rg01 MODIF ID zrb.

PARAMETERS: p_cb AS CHECKBOX USER-COMMAND zcb.

AT SELECTION-SCREEN OUTPUT.

  LOOP AT SCREEN.
    IF screen-group1 = 'ZRB'.
      IF p_cb IS NOT INITIAL.
        screen-input = 0.
        p_rb_01 = abap_true.
        p_rb_02 = abap_false.
      ELSE.
        screen-input = 1.
      ENDIF.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

I hope this helps you.

Kind regards
Jens