Application Development 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: 

Disabling Selection screen control on selection od Radio button

Former Member
0 Kudos

Hi ,

I am having four controls on the selection screen of which 2 are radio button .Is it possible to hide or disable one control at the click of one radio button.

If yes , pls tell me the method.

Thanks n Regards

Manik L Dhakate

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

See the sample programs and do accordingly

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS: pa_file TYPE rlgrap-filename MODIF ID abc,

pa_lifnr TYPE lfa1-lifnr MODIF ID abc,

pa_vkorg TYPE vbak-vkorg MODIF ID abc.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.

PARAMETERS: pa_kunnr TYPE vbak-kunnr MODIF ID def.

SELECT-OPTIONS: s_lifnr FOR gs_lfa1-lifnr MODIF ID def,

s_date FOR gs_lfa1-erdat MODIF ID def,

s_augru FOR gs_vbak-augru MODIF ID def,

s_vbeln FOR gs_vbak-vbeln MODIF ID def.

SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: pa_upd RADIOBUTTON GROUP g1 USER-COMMAND uc01 DEFAULT 'X'."#EC *

SELECTION-SCREEN COMMENT 3(60) text-004 FOR FIELD pa_upd.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: pa_rep RADIOBUTTON GROUP g1 ."#EC *

SELECTION-SCREEN COMMENT 3(60) text-005 FOR FIELD pa_rep.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b3.

IF pa_rep EQ gc_x.

LOOP AT SCREEN.

IF screen-group1 = gc_abc.

screen-input = gc_zero_num.

ELSEIF screen-group1 = gc_def.

screen-active = gc_one_num.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ELSEIF pa_upd EQ gc_x.

*For Reprocessing

LOOP AT SCREEN.

IF screen-group1 = gc_def.

screen-input = gc_zero_num.

ELSEIF screen-group1 = gc_abc.

screen-active = gc_one_num.

ENDIF.

MODIFY SCREEN.

CLEAR pa_upd.

ENDLOOP.

ENDIF.

***********************************************************

REPORT zrich_001.

PARAMETERS: p_rad1 RADIOBUTTON GROUP grp1 DEFAULT 'X'

user-command chk,

p_rad2 RADIOBUTTON GROUP grp1.

SELECT-OPTIONS: s_datum1 FOR sy-datum MODIF ID d1,

s_datum2 FOR sy-datum MODIF ID d2.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF p_rad1 = 'X'

AND screen-group1 = 'D2'.

screen-active = '0'.

ENDIF.

IF p_rad2 = 'X'

AND screen-group1 = 'D1'.

screen-active = '0'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Reward points for useful Answers

Regards

Anji

7 REPLIES 7

Former Member
0 Kudos

Hi

See the sample programs and do accordingly

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS: pa_file TYPE rlgrap-filename MODIF ID abc,

pa_lifnr TYPE lfa1-lifnr MODIF ID abc,

pa_vkorg TYPE vbak-vkorg MODIF ID abc.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.

PARAMETERS: pa_kunnr TYPE vbak-kunnr MODIF ID def.

SELECT-OPTIONS: s_lifnr FOR gs_lfa1-lifnr MODIF ID def,

s_date FOR gs_lfa1-erdat MODIF ID def,

s_augru FOR gs_vbak-augru MODIF ID def,

s_vbeln FOR gs_vbak-vbeln MODIF ID def.

SELECTION-SCREEN END OF BLOCK b2.

SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: pa_upd RADIOBUTTON GROUP g1 USER-COMMAND uc01 DEFAULT 'X'."#EC *

SELECTION-SCREEN COMMENT 3(60) text-004 FOR FIELD pa_upd.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN BEGIN OF LINE.

PARAMETERS: pa_rep RADIOBUTTON GROUP g1 ."#EC *

SELECTION-SCREEN COMMENT 3(60) text-005 FOR FIELD pa_rep.

SELECTION-SCREEN END OF LINE.

SELECTION-SCREEN END OF BLOCK b3.

IF pa_rep EQ gc_x.

LOOP AT SCREEN.

IF screen-group1 = gc_abc.

screen-input = gc_zero_num.

ELSEIF screen-group1 = gc_def.

screen-active = gc_one_num.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ELSEIF pa_upd EQ gc_x.

*For Reprocessing

LOOP AT SCREEN.

IF screen-group1 = gc_def.

screen-input = gc_zero_num.

ELSEIF screen-group1 = gc_abc.

screen-active = gc_one_num.

ENDIF.

MODIFY SCREEN.

CLEAR pa_upd.

ENDLOOP.

ENDIF.

***********************************************************

REPORT zrich_001.

PARAMETERS: p_rad1 RADIOBUTTON GROUP grp1 DEFAULT 'X'

user-command chk,

p_rad2 RADIOBUTTON GROUP grp1.

SELECT-OPTIONS: s_datum1 FOR sy-datum MODIF ID d1,

s_datum2 FOR sy-datum MODIF ID d2.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF p_rad1 = 'X'

AND screen-group1 = 'D2'.

screen-active = '0'.

ENDIF.

IF p_rad2 = 'X'

AND screen-group1 = 'D1'.

screen-active = '0'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Reward points for useful Answers

Regards

Anji

0 Kudos

Hi Thanks for your reply .

But the code u sent requires us to press enter before it disables the controls.

I want to disable the control at the click of radio button .

Is it possible??

Former Member
0 Kudos

Try something like this

AT SELECTION SCREEN OUTPUT.

LOOP AT SCREEN.

CASE screen-name.

WHEN 'RB_LAY1' OR 'RB_LAY2'.

IF rb_rep1 <> 'X'.

screen-active = 0.

ENDIF.

WHEN 'RB_REP5' OR 'RB_REP6' OR 'RB_REP51' OR 'RB_REP52' OR

'RB_REP53' .

IF rb_rep56 <> 'X'.

screen-active = 0.

ENDIF.

WHEN 'RB_REP31' OR 'RB_REP32' .

IF rb_rep3 <> 'X'.

screen-active = 0.

ENDIF.

WHEN 'RB_REP41' OR 'RB_REP42' .

IF rb_rep4 <> 'X'.

screen-active = 0.

ENDIF.

ENDCASE. " CASE screen-name.

CASE screen-group1.

WHEN 'MD1'.

IF rb_lay2 EQ 'X' AND rb_rep1 = 'X'.

screen-active = 0.

ENDIF.

WHEN 'MD2'.

IF rb_rep3 EQ 'X'.

screen-active = 0.

ENDIF.

WHEN 'MD4' OR 'MD6' OR 'MD7' OR 'MD8' OR 'M10' OR 'M12'.

IF rb_rep56 <> 'X'.

screen-active = 0.

ENDIF.

WHEN 'M11' OR 'M13'.

IF rb_rep56 <> 'X' AND rb_rep4 <> 'X'.

screen-active = 0.

ENDIF.

ENDCASE. " CASE screen-group1.

MODIFY SCREEN.

ENDLOOP. " LOOP AT SCREEN.

Reward points if useful.

Regards,

Atish

Simha_
Employee
Employee
0 Kudos

Hi,

Check this example. U will get an idea..

report zrich_0001 .

type-pools: vrm.

parameters: p_list type i as listbox visible length 5.

parameters: p_parm1 type c modif id pm1,

p_parm2 type c modif id pm2.

initialization.

perform build_drop_down_list.

at selection-screen output.

loop at screen.

if ( p_list = '1'

and screen-group1 = 'PM2' )

or ( p_list = '2'

and screen-group1 = 'PM1' ).

screen-input = 0.

modify screen.

endif.

endloop.

start-of-selection.

write:/ p_list.

************************************************************************

  • build drop_down_list

************************************************************************

form build_drop_down_list.

data: name type vrm_id,

list type vrm_values,

value like line of list.

clear list. refresh list.

name = 'P_LIST'.

clear value.

value-key = 1.

value-text = 1.

append value to list.

clear value.

value-key = 2.

value-text = 2.

append value to list.

  • Set the values

call function 'VRM_SET_VALUES'

exporting

id = name

values = list.

endform.

Cheers,

Simha.

Reward all the helpful answers..

Former Member
0 Kudos

Former Member
0 Kudos

Hi,

Yes..it is possible..

ex..



parameters: p_r1 radiobutton user-command USR GROUP g1 DEFAULT 'X',
                  p_r2 radiobutton GROUP g1.

parameters: p_matnr type matnr MODIF ID M1,
                  p_werks type werks_d MODIF ID M2.


at selection-screen output.

LOOP AT SCREEN.

  IF p_r1 = 'X' and SCREEN-GROUP1 = 'M2'.
    SCREEN-ACTIVE = 0.
  ENDIF.

  IF p_r2 = 'X' and SCREEN-GROUP1 = 'M1'.
    SCREEN-ACTIVE = 0.
  ENDIF.

  MODIFY SCREEN.

ENDLOOP.


Thanks

naren

Former Member
0 Kudos

Hi,

Check the below code.

PARAMETERS : A RADIOBUTTON GROUP R1 USER-COMMAND USR,
B RADIOBUTTON GROUP R1.
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE BLOCK1.
PARAMETERS P1 MODIF ID P1.
SELECTION-SCREEN END OF BLOCK B1.

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE BLOCK2.
PARAMETERS P2 MODIF ID P2.
SELECTION-SCREEN END OF BLOCK B2.

AT SELECTION-SCREEN OUTPUT.
  LOOP AT SCREEN.
    IF SCREEN-GROUP1 = 'P2' AND A = 'X'.
      SCREEN-ACTIVE = 0.
      MODIFY SCREEN.
    ELSEIF SCREEN-GROUP1 = 'P1' AND B = 'X'.
      SCREEN-ACTIVE = 0.
      MODIFY SCREEN.
    ENDIF.
  ENDLOOP.

Reward Points if it is Useful.

Thanks,

Manjunath MS