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: 

Radiobutton - enable/disable parameters

Former Member
0 Kudos

HI ALL,

i have one radiobutton 'rad1' on the screen.under which there are two parameters.

so my requirement is if i select 'rad1' then only two parameter will be enable otherwise they should be disable...

does anybody can provide code for it.

thanks

Divya.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

U need to do a loop at screen. and identify the the group of the parameter which u need to deactivate.

Thanx,

Akhil

6 REPLIES 6

Former Member
0 Kudos

Hi,

U need to do a loop at screen. and identify the the group of the parameter which u need to deactivate.

Thanx,

Akhil

Former Member
0 Kudos

Hi

See the Sample code 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.

Regards

Anji

Former Member
0 Kudos

Hi Divya,

U can use modif ID to enable disable radio-buttaon.

refer following program.

REPORT zfibwdwn.

TABLES : BSIS ,

BSAS.

*

PARAMETERS : a RADIOBUTTON GROUP gr1 USER-COMMAND flag MODIF ID bl0.

PARAMETERS : b RADIOBUTTON GROUP gr1 MODIF ID bl0.

SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.

SELECT-OPTIONS: s_budat FOR bsis-budat MODIF ID bl1 ,

s_augdt FOR bsis-augdt MODIF ID bl1 .

SELECT-OPTIONS : s_bukrs FOR bsis-bukrs MODIF ID bl1 ,

s_belnr FOR bsis-belnr MODIF ID bl1 ,

s_hkont FOR bsis-hkont MODIF ID bl1 .

SELECTION-SCREEN END OF BLOCK b1.

*

*

SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME.

SELECT-OPTIONS: sb_budat FOR bsas-budat MODIF ID bl2 ,

sb_augdt FOR bsas-augdt MODIF ID bl2.

SELECT-OPTIONS : sb_bukrs FOR bsas-bukrs MODIF ID bl2,

sb_belnr FOR bsas-belnr MODIF ID bl2.

SELECTION-SCREEN END OF BLOCK b2.

*

*

*

*

AT SELECTION-SCREEN OUTPUT.

write : / 'test'.

LOOP AT SCREEN.

IF a = 'X' AND screen-group1 = 'BL2'.

screen-active = '0'.

ELSEIF b = 'X' AND screen-group1 = 'BL1'.

screen-active = '0'.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

Former Member
0 Kudos

hi divya

if your screen is dialog means do the below process.

1. go to the screen

2.double click the parameters one attribute window will show.

3. in that window one GROUP NAME field is there give the name 'G1'

4.repeat 2 and 3 step for another parameter too.

5.then activate the screen

in pbo screen.

PROCESS BEFORE OUTPUT.

MODULE TABLEE.

module TABLEE output.

IF FLG = 0.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'G1'.

SCREEN-INVISIBLE = 1.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

ENDIF.

endmodule.

module USER_COMMAND_9200 input.

CASE SY-UCOMM.

WHEN 'PUR4'. (radio button user command)

BREAK-POINT.

FLG = 1.

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'G1'.

SCREEN-INVISIBLE = 0.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

regards

baskaran

former_member208856
Active Contributor
0 Kudos

Hi,

Take help from this code :

tables : spfli, sflight.

selection-screen begin of block b1 with frame.

PARAMETERS: rad1 RADIOBUTTON GROUP rad USER-COMMAND radio.

SELECT-OPTIONS: s_carrid FOR spfli-carrid MODIF ID sl1,

s_connid FOR spfli-connid MODIF ID sl1.

PARAMETERS: rad2 RADIOBUTTON GROUP rad.

SELECT-OPTIONS: s_fldate FOR sflight-fldate MODIF ID sl2.

selection-screen end of block b1.

at selection-screen output.

loop at screen.

IF rad1 = 'X'.

IF screen-group1 = 'SL2'.

screen-input = 0.

ENDIF.

ELSEIF rad2 = 'X'.

IF screen-group1 = 'SL1'.

screen-input = 0.

ENDIF.

ENDIF.

Modify screen.

endloop.

I hope, it can help you,

Reward points, if helpful,

Sandeep Kaushik

Former Member
0 Kudos

hi! Divya

1. create Modif Id for the Parameters you have.

2. write a loop modification at screen .

3. give the modif id number which you don't want to display.

SELECTION-SCREEN BEGIN OF BLOCK b1.

PARAMETERS : p1 LIKE sy-datum MODIF ID pp1,

p2 LIKE vbrk-vbeln MODIF ID pp2.

SELECTION-SCREEN END OF BLOCK b1.

SELECTION-SCREEN BEGIN OF BLOCK b2.

PARAMETERS: r1 RADIOBUTTON GROUP g1 USER-COMMAND rusr,

r2 RADIOBUTTON GROUP g1.

SELECTION-SCREEN END OF BLOCK b2.

AT SELECTION-SCREEN OUTPUT.

IF r1 = 'X'.

***********P2 will be enable when r1 is selected*********************

LOOP AT SCREEN.

IF screen-group1 = 'PP1'.

screen-active = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ELSE.

***********P1 will be enable when r2 is selected*********************

LOOP AT SCREEN.

IF screen-group1 = 'PP2'.

screen-active = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

Try this code. hope this code will solve your problem.

if useful reward me.

Thanks and Regards,

Nagulan.