‎2008 Apr 24 7:00 AM
Hello,
I have a requirement that I have two Radio Buttons. And there are two selection screen blocks which will be enabled or disabled based on the selection of the radio button. How can this be achieved?
‎2008 Apr 24 7:11 AM
Hi,
1.Declaring the radio buttons:
SELECTION-SCREEN: BEGIN OF BLOCK b4 WITH FRAME TITLE text-003 .
PARAMETERS : p_sal RADIOBUTTON GROUP r1 USER-COMMAND fct DEFAULT 'X',
p_inv RADIOBUTTON GROUP r1.
SELECTION-SCREEN END OF BLOCK b4.
2.validating the screens.
START-OF-SELECTION.
IF p_inv EQ c_x.
enabling the first selection screen
ENDIF.
IF p_sal EQ c_x.
Disabling the screen
ENDIF.
Regards,
Shiva.
‎2008 Apr 24 7:15 AM
‎2008 Apr 24 7:22 AM
Hi,
To enable or disable the blocks/screen elements..
Do the following:
Loop at screen.
if the screen element is radiobutton
make it invisible.
Endloop.
The paramter for making invisible :
SCREEN-INVISIBLE = 1: screen represent the display properties of the current screen element. With the exception of length, they can contain 0 or 1, where 1 is "active" and 0 is "inactive".
For more details on syntax of loop at screen, do refer the help
Regards
Shiva
‎2008 Apr 24 11:03 AM
Screen Blocks are disalbed when all the fields within it are flagged as ACTIVE = 0.
‎2008 Apr 24 7:58 AM
use this code
tables:mara.
selection-screen begin of block rad1 with frame .
select-options:matnr for mara-matnr.
parameters: radio1 radiobutton group rad1 user-command test default 'X'.
parameters: radio2 radiobutton group rad1 .
Selection-screen END OF block rad1.
SELECTION-SCREEN BEGIN OF block rad2 with frame.
select-options:mtart for mara-mtart modif id RA1.
Selection-screen END OF block rad2.
at selection-screen output.
loop at screen.
if radio1 = 'X' and screen-group1 = 'RA1'.
screen-active = '0'.
modify screen.
endif.
endloop.
reward if useful
‎2008 Apr 24 8:36 AM
Try the code below,
parameters:
rad1 type c radiobutton group grp1 user-command ucode1 ,
rad2 type c radiobutton group grp1 .
select-options:
carrid for sflight-carrid,
connid for sflight-connid.
at selection-screen output.
if rad1 = 'X'.
loop at screen.
if screen-name = 'CONNID-HIGH' or screen-name = 'CONNID-LOW' .
screen-input = 0.
modify screen.
endif.
endloop.
endif.
if rad2 = 'X'.
loop at screen.
if screen-name = 'CARRID-HIGH' or screen-name = 'CARRID-LOW' .
screen-input = 0.
modify screen.
endif.
endloop.
endif.
Edited by: Rengith Skariah on Apr 24, 2008 9:37 AM
‎2008 Apr 24 11:32 AM
hi,
Here is the code for 2 radio buttons with two selection screen
if u click on first raio button the second selcetion screen diables,just copy n paste in se38 and run the program
TABLES: SSCRFIELDS.
*DATA: T_UCOMM TYPE SY-UCOMM.
SELECTION-SCREEN: BEGIN OF BLOCK B1 WITH FRAME.
PARAMETERS: R1 RADIOBUTTON GROUP RAD1 DEFAULT 'X' USER-COMMAND TE1,
R2 RADIOBUTTON GROUP RAD1 .
SELECTION-SCREEN: END OF BLOCK B1.
SELECTION-SCREEN: BEGIN OF BLOCK B2 WITH FRAME .
PARAMETERS: A_FILE(10) TYPE C MODIF ID FPN.
*parameters: p_file(10) type c modif id fpc.
SELECTION-SCREEN: END OF BLOCK B2.
SELECTION-SCREEN: BEGIN OF BLOCK B3 WITH FRAME.
PARAMETERS: P_FILE(10) TYPE C MODIF ID FPC.
SELECTION-SCREEN: END OF BLOCK B3.
INITIALIZATION.
AT SELECTION-SCREEN OUTPUT.
IF R1 EQ 'X'.
LOOP AT SCREEN.
IF SCREEN-NAME = 'A_FILE'.
SCREEN-INPUT = 1.
SCREEN-ACTIVE = '1'.
MODIFY SCREEN.
ELSE.
SCREEN-ACTIVE = 1.
SCREEN-REQUIRED = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
ENDIF.
IF R2 EQ 'X'.
LOOP AT SCREEN.
IF SCREEN-GROUP1 = 'FPN'.
SCREEN-INPUT = 1.
SCREEN-ACTIVE = '0'.
MODIFY SCREEN.
ELSE.
SCREEN-ACTIVE = '1'.
SCREEN-REQUIRED = 0.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
Reward points if usefull to you,
Regards
Fareeads
Edited by: Fareeda Tabassum S on Apr 24, 2008 4:03 PM
‎2008 Jun 02 9:24 AM