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: 

Doubt in Radio button

Former Member
0 Kudos
132

Hi experts,

Here i am creating 2 radio button, but in output its selecting the first radio button( default ), but my requirment is no need of default selection. In the output screen no if the user want to choose any one of the two..

How to create tht type of radio button ....

Gowri.

1 ACCEPTED SOLUTION

sreeramkumar_madisetty
Active Contributor
0 Kudos
108

Hi

loop at screen.

if screen-name = 'radiobutton'.

screen-input = 0.

screen-active = 0.

endif.

endloop.

This is the code to make the radio buttons invisible.

Regards,

Sreeram

11 REPLIES 11

kiran_k8
Active Contributor
0 Kudos
108

Gowri,

Create 3 radio buttons and make one invisible.By default one radio button will get selected,make this one invisible so that on the screen you can see only two wherein actually you have created 3.

K.Kiran.

Former Member
0 Kudos
108

hi sorry yaa, how to create invisible radio button,

gowri

Former Member
0 Kudos
108

Hi

It is the property of Radiobutton such that among two or three the first one will be default selected. At a time one of them will be selected.

If you wants to remove that default setting, and wants to make the second or third one as adefault write the code in the intialization event and dot hat.

Reward points if useful

Regards

Anji

Former Member
0 Kudos
108

Hi Gowri,

Usually when radio-buttons are used one must be selected by default. We use them to select either any of them . If we dont need a requirement as such try to use Check boxes.That will solve ur problem.

Regards,

Priyanka.

Former Member
0 Kudos
108

Hi,

You can write the logic at at selection screen out.

Regards

Message was edited by:

skk

Former Member
0 Kudos
108

Hi Gowri,

U HAVE TO SPECIFY A DEFAULT BUTTON . IF USER DON'T SELECT ANY BUTTON THEN THAT DEFAULT BUTTON WILL WORK.OTHERWISE BOTTON THAT USER WILL SELECT WILL WORK.

Please refer this code.

*RADIO BUTTON DEFINITION

SELECTION-SCREEN BEGIN OF BLOCK BL2 WITH FRAME TITLE TEXT-456.

PARAMETERS PO RADIOBUTTON GROUP RADI .

PARAMETERS P1 RADIOBUTTON GROUP RADI DEFAULT 'X'.

PARAMETERS P2 RADIOBUTTON GROUP RADI.

SELECTION-SCREEN END OF BLOCK BL2.

START-OF-SELECTION.

IF PO = 'X'.

WRITE CODE WHAT U WANT TO DO

ELSEIF P1 = 'X'.

WRITE CODE WHAT U WANT TO DO

ELSEIF P2 = 'X'.

WRITE CODE WHAT U WANT TO DO

ENDIF.

REWARD POINTS IF HELPFUL.

REGARDS,

Hemant

sreeramkumar_madisetty
Active Contributor
0 Kudos
109

Hi

loop at screen.

if screen-name = 'radiobutton'.

screen-input = 0.

screen-active = 0.

endif.

endloop.

This is the code to make the radio buttons invisible.

Regards,

Sreeram

Former Member
0 Kudos
108

sorry you cant achieve this. you have to select at least one radio button of agroup initially. you can use check box instead of radio button and disable the other check box when user is selecting one.

do like this...


parameters : chk1 as checkbox user-command chk1,
             chk2 as checkbox user-command chk2.

at selection-screen output.
if chk1 = 'X'.
 loop at screen.
  if screen-name = 'CHK2'.
   screen-input = '0'.
   modify screen.
   endif.
   endloop.
elseif chk2 = 'X'.
  loop at screen.
   if screen-name = 'CHK1'.
   screen-input = '0'.
   modify screen.

  endif.
 endloop.
endif.
start-of-selection.

regards

shiba dutta

Former Member
0 Kudos
108

Hey hi with bith the radio butons try this out..

parameters: r1 radiobutton group radio default ' ',

r2 radiobutton group radio default ' '.

well i think maight work or may not be... because both the button belongs to he same group and it is basicaly used to sellect atleast one from the group so by default it is a mandatory thing... but then also please try my option out...

Regards,

Jayant

PLease award if helpful

kiran_k8
Active Contributor
0 Kudos
108

Gowri,

Try this.

PARAMETERS : r1 RADIOBUTTON GROUP g1,

r2 RADIOBUTTON GROUP g1.

AT SELECTION-SCREEN OUTPUT.

LOOP AT SCREEN.

IF screen-name = 'R1'.

screen-invisible = '1'.

MODIFY SCREEN.

ENDIF.

ENDLOOP.

Former Member
0 Kudos
108

Sorry I was wrong in my previous reply ...in radiobutoon ... you can only give one default to a group and that also it shlud be 'X' not blank... beacuse with radiobutton only dafault 'X' is allowed..

Sorry .

Jayant