04-27-2006 10:29 AM
Hi all,
I have two groups of radio buttons on my screen. While display the first radio button from both the groups gets selected by default. How to deselect the first button in teh second group when the screen gets displayed.
Pls help.
Aarthi.M
04-27-2006 10:37 AM
Hi,
pls refer this code :
PARAMETERS: p_radio1 RADIOBUTTON GROUP g1 USER-COMMAND comm,
p_date1 TYPE sy-datum,
p_radio2 RADIOBUTTON GROUP g1 DEFAULT 'X',
p_date2 TYPE sy-datum.
AT SELECTION-SCREEN OUTPUT.
IF p_radio1 = 'X'.
LOOP AT SCREEN.
CASE screen-name.
WHEN 'P_DATE1'.
screen-input = '1'.
WHEN 'P_DATE2'.
screen-input = '0'.
ENDCASE.
MODIFY SCREEN.
ENDLOOP.
ELSEIF p_radio2 = 'X'.
LOOP AT SCREEN.
CASE screen-name.
WHEN 'P_DATE1'.
screen-input = '0'.
WHEN 'P_DATE2'.
screen-input = '1'.
ENDCASE.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
Hope it may be helpful to u.
regards,
Latheesh.
04-27-2006 10:33 AM
Hi Arathi,
In case you want only one button among several buttons to be active at one time, you have to assign all of those buttons to one radio button group.
Regards,
Aniket
Please award points if you find it helpful.
04-27-2006 10:35 AM
While creating you can specify "DEFAULT X" syntax to any one and always create a group for different set of radio buttons as
p_ckflcm TYPE c RADIOBUTTON GROUP rbl1 default 'X'.
If you do not want tomake any one default, use Checkbox instead.
Regards
Rohit
PS Reward points
04-27-2006 10:36 AM
Aarthi,
At any point of time, one radi button has to be active in both the groups. If you want to have specific button to be enabled you can set the default value X to that button.
You cannot have a case, where all the radio buttons in a group are unchecked.
Regards,
Ravi
Note : Please mark the helpful answers
04-27-2006 10:37 AM
Hi,
pls refer this code :
PARAMETERS: p_radio1 RADIOBUTTON GROUP g1 USER-COMMAND comm,
p_date1 TYPE sy-datum,
p_radio2 RADIOBUTTON GROUP g1 DEFAULT 'X',
p_date2 TYPE sy-datum.
AT SELECTION-SCREEN OUTPUT.
IF p_radio1 = 'X'.
LOOP AT SCREEN.
CASE screen-name.
WHEN 'P_DATE1'.
screen-input = '1'.
WHEN 'P_DATE2'.
screen-input = '0'.
ENDCASE.
MODIFY SCREEN.
ENDLOOP.
ELSEIF p_radio2 = 'X'.
LOOP AT SCREEN.
CASE screen-name.
WHEN 'P_DATE1'.
screen-input = '0'.
WHEN 'P_DATE2'.
screen-input = '1'.
ENDCASE.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
Hope it may be helpful to u.
regards,
Latheesh.
04-27-2006 10:44 AM
Is this possible in dialog programming... not in selection screens ?
04-27-2006 10:46 AM
04-27-2006 10:47 AM
Its possible both in dialog programming as well as on selection screens.
Regards,
Ravi
Note :Please mark the helpful answers
04-27-2006 10:51 AM
hi
yes its possible..using the above code.
u will be grouping the radiobttons by specifying the the same group name in their propeties window.
hope this helps,
priya.
04-27-2006 10:54 AM
hi,
try this.
data: v_r1 type c,
v_r2 type c.
group these radiobuttons.
In PBO, v_r2 = 'X'.
Regards,
Sailaja.
04-27-2006 11:01 AM
Hi ,
It is possible to select your own radio button .
Supposing that you have created 2 radio buttons RAD1 and RAD2 of the same group.
By default , RAD1 will be selected.
If you want RAD2 to be selected instead of RAD1,
1)Declare two variables
data: RAD1 type C,
RAD2 type C.
2) In PBO,
RAD1 = space.
RAD2 = 'X'.
That is it.
Hope your query is solved.
Regards,
SP.
04-27-2006 11:17 AM
IF SCR1000-RAD1 = 'X'.
LOOP AT SCREEN.
CASE screen-name.
WHEN 'SCR1000-RAD2'.
screen-input = 0.
ENDCASE.
MODIFY SCREEN.
ENDLOOP.
ENDIF.
I gave the above code and the button got deselected. But i am not able to select that button again.. What should be done for this..?
I tried with SCR1000-RAD2 = ' '. That too dint work.