Application Development and Automation 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: 
Read only

Radio Button on Selection screen

Former Member
0 Likes
1,895

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

13 REPLIES 13
Read only

GauthamV
Active Contributor
0 Likes
1,857

If you are using radiobuttons on your selection screen then by default one of them will be checked.

Read only

Sandeep_Panghal
Product and Topic Expert
Product and Topic Expert
0 Likes
1,857

not possible via radio-buttons , use check box instead.

Read only

0 Likes
1,857

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 .

Read only

0 Likes
1,857

by default, one radiobutton will be enabled..Even programatically, we cant do..

Read only

Former Member
0 Likes
1,857

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

Read only

Former Member
0 Likes
1,857

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

Read only

0 Likes
1,857

Hi Pawan,

I tried the same. But on hiding the first radiobutton(R1) it automatically selecting the next radiobutton(R2).

Thanks,

Punit

Read only

0 Likes
1,857

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

Read only

0 Likes
1,857

@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 .

Read only

0 Likes
1,857

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

Read only

Former Member
0 Likes
1,857

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

Read only

Former Member
0 Likes
1,857

Hi,

Always when you use the radiobuttons gets displayed with one them being tick marked.

We cant do anything to it even programmitically.

Thanks.

Read only

Former Member
0 Likes
1,857

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