‎2010 Oct 01 8:00 AM
Hi Friends,
I have a requirement in which two radio button are required on selection screen. But initially both of them should be unchecked. User should go on select either of the two.
Is it possible to achive this? Please guide me how this can be achieved.
Thanks,
Punit
‎2010 Oct 01 8:05 AM
If you are using radiobuttons on your selection screen then by default one of them will be checked.
‎2010 Oct 01 8:08 AM
‎2010 Oct 01 8:15 AM
If u really want to achive it through radio button , declare another radiobutton default 'X' , and the make the text of that radiobutton blank .
Make Sure user can not execute the report when the 3rd radiobutton is checked by giving message .
‎2010 Oct 01 10:04 AM
by default, one radiobutton will be enabled..Even programatically, we cant do..
‎2010 Oct 01 8:29 AM
HI Punit
Yes this is possible.
You need to create two radio buttons on selection screen one with default check, like:
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
PARAMETERS: p_rdbt1 RADIOBUTTON GROUP gi default 'X',
p_rdbt2 RADIOBUTTON GROUP gi.
SELECTION-SCREEN END OF BLOCK B1.
after that you need to do the coding accordingly.
like:
if p_rdbt1 = 'X'.
<do your coding here>.
elseif p_rdbt2 = 'X'.
<do your coding>.
endif.
I hope this will work for you.
Thanks
Lalit Gupta
‎2010 Oct 01 8:32 AM
Hi Punit,
You can try below logic.
PARAMETERS : r1 RADIOBUTTON GROUP g1 DEFAULT 'X',
r2 RADIOBUTTON GROUP g1,
r3 RADIOBUTTON GROUP g1.
Now hide this radiobutton r1 by using loop at screen
AT SELECTION-SCREEN OUTPUT.
LOOP AT SCREEN.
IF screen-name = 'R1'.
screen-invisible = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.
Regards,
Pawan
‎2010 Oct 01 9:10 AM
Hi Pawan,
I tried the same. But on hiding the first radiobutton(R1) it automatically selecting the next radiobutton(R2).
Thanks,
Punit
‎2010 Oct 01 9:27 AM
Hi Punit,
Not sure whether it is a good idea or not but can you try deselecting the radiobutton R2 and R3 after hiding R1
otherwise you should have to go for checkbox only.
Regards,
Pawan
‎2010 Oct 01 9:36 AM
@Pawan,
have you ever seen any screen or situation like this where two radiobuttons are there and none of them are checked?
This is very simple characteristics of radiobutton , if there are two radiobuttons one must be checked .
if you hide any radiobutton even if you declare it as default 'X' , it wil not be checked anymore .
‎2010 Oct 01 9:46 AM
Pawan,
Even by that code also you can not select two radio button at the same time. SAP is providing check box facility for this.
Regards,
Sourabh Batwara
‎2010 Oct 01 10:09 AM
Hi,
You can do this only using check box. In the at selection screen event, you have to ensure that both are not selected simultaneouly and only one has been selected.
Hope it helps.
Sujay
‎2010 Oct 01 10:14 AM
Hi,
Always when you use the radiobuttons gets displayed with one them being tick marked.
We cant do anything to it even programmitically.
Thanks.
‎2010 Oct 08 9:00 AM
Check the following code Hide one radio button .
<<copy-paste from http://www.sapfans.com/forums/viewtopic.php?f=13&t=12324 removed>>
Moderator Message: Copy-paste is a serious offense, which can lead to account deletion.
Edited by: kishan P on Oct 8, 2010 7:50 PM