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

abap

Former Member
0 Likes
361

im having 3 radio buttons on selection screen. if i select one radio button the rest two selection screen blocks should be disabled or made invisible.

how could this be done. pls provide source code ?

1 ACCEPTED SOLUTION
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
334

You can try this sample program. Depending on the radiobutton a corresponding field will be presented.



report zrich_0001.


parameters: p_rad1 radiobutton group grp1 default 'X'
                         user-command check,
            p_rad2 radiobutton group grp1  ,
            p_rad3 radiobutton group grp1  .

parameters: p_fld1 type c  modif id rd1 ,
            p_fld2 type c  modif id rd2 ,
            p_fld3 type c  modif id rd3 .

at selection-screen output.


  loop at screen.
    if p_rad1 = 'X'
       and ( screen-group1 = 'RD2'
          or screen-group1 = 'RD3' ).
      screen-active = '0'.
    endif.

    if p_rad2 = 'X'
       and ( screen-group1 = 'RD1'
          or screen-group1 = 'RD3' ).
      screen-active = '0'.
    endif.

    if p_rad3 = 'X'
       and ( screen-group1 = 'RD1'
          or screen-group1 = 'RD2' ).
      screen-active = '0'.
    endif.


    modify screen.
  endloop.

Regards,

Rich Heilman

2 REPLIES 2
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
335

You can try this sample program. Depending on the radiobutton a corresponding field will be presented.



report zrich_0001.


parameters: p_rad1 radiobutton group grp1 default 'X'
                         user-command check,
            p_rad2 radiobutton group grp1  ,
            p_rad3 radiobutton group grp1  .

parameters: p_fld1 type c  modif id rd1 ,
            p_fld2 type c  modif id rd2 ,
            p_fld3 type c  modif id rd3 .

at selection-screen output.


  loop at screen.
    if p_rad1 = 'X'
       and ( screen-group1 = 'RD2'
          or screen-group1 = 'RD3' ).
      screen-active = '0'.
    endif.

    if p_rad2 = 'X'
       and ( screen-group1 = 'RD1'
          or screen-group1 = 'RD3' ).
      screen-active = '0'.
    endif.

    if p_rad3 = 'X'
       and ( screen-group1 = 'RD1'
          or screen-group1 = 'RD2' ).
      screen-active = '0'.
    endif.


    modify screen.
  endloop.

Regards,

Rich Heilman

Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
334

Please make sure to award points for any helpful answers that you may recieve and mark your posts as solved when solved completely. Thanks.

Regards,

Rich Heilman