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: 

Dynamic radio button display

Former Member
0 Kudos
127

Hi all

when we click on the radio button of the selection screen if should display further more radio buttons down on the same screen, Can anybody please say me how it can be done.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
68

Hi,

Refer the following code:

Copy & paste it & see the output.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.

PARAMETERS:R1 RADIOBUTTON GROUP RAD1 USER-COMMAND ABC DEFAULT 'X' ,

R2 RADIOBUTTON GROUP RAD1 .

SELECTION-SCREEN END OF BLOCK B1.

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME.

PARAMETERS:R3 RADIOBUTTON GROUP RAD2 USER-COMMAND XYZ DEFAULT 'X' MODIF

ID SC1,

R4 RADIOBUTTON GROUP RAD2 MODIF ID SC2,

R5 RADIOBUTTON GROUP RAD2 MODIF ID SC3,

R6 RADIOBUTTON GROUP RAD2 MODIF ID SC4,

R7 RADIOBUTTON GROUP RAD2 MODIF ID SC5,

R8 RADIOBUTTON GROUP RAD2 MODIF ID SC6.

PARAMETERS: R9 RADIOBUTTON GROUP RAD3 USER-COMMAND LMN

DEFAULT 'X' MODIF ID SC7,

R10 RADIOBUTTON GROUP RAD3 MODIF ID SC8,

R11 RADIOBUTTON GROUP RAD3 MODIF ID SC9,

R12 RADIOBUTTON GROUP RAD3 MODIF ID SCP,

R13 RADIOBUTTON GROUP RAD3 MODIF ID SCQ,

R14 RADIOBUTTON GROUP RAD3 MODIF ID SCR.

SELECTION-SCREEN END OF BLOCK B2.

AT SELECTION-SCREEN.

CHECK SY-UCOMM = 'ABC'.

CHECK SY-UCOMM = 'LMN'.

CHECK SY-UCOMM = 'XYZ'.

AT SELECTION-SCREEN OUTPUT.

IF R1 = 'X' .

LOOP AT SCREEN.

IF SCREEN-GROUP1 ='SC7'.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

IF SCREEN-GROUP1 = 'SC8'.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

IF SCREEN-GROUP1 = 'SC9'.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

IF SCREEN-GROUP1 = 'SCP'.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

IF SCREEN-GROUP1 = 'SCQ'.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

IF SCREEN-GROUP1 = 'SCR'.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

IF R2 = 'X' .

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'SC1'.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

IF SCREEN-GROUP1 = 'SC2'.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

IF SCREEN-GROUP1 = 'SC3'.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

IF SCREEN-GROUP1 = 'SC4'.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

IF SCREEN-GROUP1 = 'SC5'.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

IF SCREEN-GROUP1 = 'SC6'.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

Hope this helps.

Reward if helpful.

Regards,

Sipra

4 REPLIES 4

Former Member
0 Kudos
68

HI,

Look at the demo program <b>demo_sel_screen_user_command</b>

Regards

Sudheer

Former Member
0 Kudos
68

Hello,

This is possible.

Ususally radibutton functionaly is to select one of options at a time out of many.

You define the radiobutton with a user commad. When I click on the second radiobutton RB02 it should show other three radibuttons RB04, RB05, RB06.

RB01 RADIOBUTTON DEFAULT 'X' GROUP <GRP1>

USER-COMMAND <UCOM>.

RB02 RADIOBUTTON GROUP <GRP1>

RB03 RADIOBUTTON GROUP <GRP1>

-


RB04 RADIOBUTTON DEFAULT 'X' GROUP <GRP2> MODIF ID XX .

RB05 RADIOBUTTON GROUP <GRP2> MODIF ID XX

RB06 RADIOBUTTON GROUP <GRP2> MODIF ID XX

-


AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF RB02 EQ 'X'.

IF SCREEN-GROUP1 EQ 'XX'.

SCREEN-ACTIVE '1'.

MODIFY SCREEN.

ESLE.

SCREEN-INVISIBLE = '1'.

MODIFY SCREEN.

ENDIF.

ENDIF.

ENDLOOP.

Regards,

A.Singh

Former Member
0 Kudos
69

Hi,

Refer the following code:

Copy & paste it & see the output.

SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME.

PARAMETERS:R1 RADIOBUTTON GROUP RAD1 USER-COMMAND ABC DEFAULT 'X' ,

R2 RADIOBUTTON GROUP RAD1 .

SELECTION-SCREEN END OF BLOCK B1.

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME.

PARAMETERS:R3 RADIOBUTTON GROUP RAD2 USER-COMMAND XYZ DEFAULT 'X' MODIF

ID SC1,

R4 RADIOBUTTON GROUP RAD2 MODIF ID SC2,

R5 RADIOBUTTON GROUP RAD2 MODIF ID SC3,

R6 RADIOBUTTON GROUP RAD2 MODIF ID SC4,

R7 RADIOBUTTON GROUP RAD2 MODIF ID SC5,

R8 RADIOBUTTON GROUP RAD2 MODIF ID SC6.

PARAMETERS: R9 RADIOBUTTON GROUP RAD3 USER-COMMAND LMN

DEFAULT 'X' MODIF ID SC7,

R10 RADIOBUTTON GROUP RAD3 MODIF ID SC8,

R11 RADIOBUTTON GROUP RAD3 MODIF ID SC9,

R12 RADIOBUTTON GROUP RAD3 MODIF ID SCP,

R13 RADIOBUTTON GROUP RAD3 MODIF ID SCQ,

R14 RADIOBUTTON GROUP RAD3 MODIF ID SCR.

SELECTION-SCREEN END OF BLOCK B2.

AT SELECTION-SCREEN.

CHECK SY-UCOMM = 'ABC'.

CHECK SY-UCOMM = 'LMN'.

CHECK SY-UCOMM = 'XYZ'.

AT SELECTION-SCREEN OUTPUT.

IF R1 = 'X' .

LOOP AT SCREEN.

IF SCREEN-GROUP1 ='SC7'.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

IF SCREEN-GROUP1 = 'SC8'.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

IF SCREEN-GROUP1 = 'SC9'.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

IF SCREEN-GROUP1 = 'SCP'.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

IF SCREEN-GROUP1 = 'SCQ'.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

IF SCREEN-GROUP1 = 'SCR'.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

IF R2 = 'X' .

LOOP AT SCREEN.

IF SCREEN-GROUP1 = 'SC1'.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

IF SCREEN-GROUP1 = 'SC2'.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

IF SCREEN-GROUP1 = 'SC3'.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

IF SCREEN-GROUP1 = 'SC4'.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

IF SCREEN-GROUP1 = 'SC5'.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

IF SCREEN-GROUP1 = 'SC6'.

SCREEN-ACTIVE = 0.

ENDIF.

MODIFY SCREEN.

ENDLOOP.

ENDIF.

Hope this helps.

Reward if helpful.

Regards,

Sipra

Former Member
0 Kudos
68

parameters p_scogs radiobutton group grp1.

parameters p_slcs radiobutton group grp1.

parameters p_slcs1 radiobutton group grp2.

AT selection-screen output.

loop at screen.

if screen-name = 'P_SLCS2'.

if p_slcs is not initial.

screen-invisible = '0'.

else.

screen-invisible = '1'.

endif.

modify screen.

endif.

endloop.