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: 

Syntax for radio button?

Former Member
0 Kudos

Hi,

Waht is the syntax to create radiouton on the screen?

4 REPLIES 4

Former Member
0 Kudos

Hi,

You use the following syntax:

PARAMETERS <name> ...... RADIOBUTTON GROUP <radi>......

<name> is created with type C and length 1, and is assigned to group <radi>. The maximum length of string <radi> is 4.

You must assign at least two parameters to each <radi> group.

Only one parameter per group can have a default value assigned using the DEFAULT addition. The default value must be 'X'. If you do not use the DEFAULT addition, the first parameter of each group ist set to 'X'.

e.g.

PARAMETERS: R1 RADIOBUTTON GROUP RAD1,

R2 RADIOBUTTON GROUP RAD1 DEFAULT 'X',

R3 RADIOBUTTON GROUP RAD1,

S1 RADIOBUTTON GROUP RAD2,

S2 RADIOBUTTON GROUP RAD2,

S3 RADIOBUTTON GROUP RAD2 DEFAULT 'X'.

regards

Deepak

Former Member
0 Kudos

PARAMETERS: p_radio1 RADIOBUTTON GROUP g1 USER-COMMAND comm,

p_radio2 RADIOBUTTON GROUP g1 DEFAULT 'X'.

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.

Reward Points if it is helpful

Thanks

Seshu

Former Member
0 Kudos

Hi Ajay,

<b>PARAMETERS: name RADIOBUTTON GROUP radi.</b>

Displays the parameter on the selection screen as a radio button (selection field). All parameters assigned in this way to the same group radi (which can be up to 4 characters long) form a group of radio buttons on the selection screen, i.e. if the user presses one of these buttons, the others are set to "not pressed".

When you define one of these parameters, you are not allowed to make type or length specifications. However, you can use LIKE to point to a field of length 1 and type C .

Check the code for syntax of radio button

SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME TITLE T5.
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 1(30) F5.
SELECTION-SCREEN POSITION 40.
PARAMETERS: ASC  RADIOBUTTON GROUP ORD,
            DESC RADIOBUTTON GROUP ORD.
SELECTION-SCREEN END OF LINE.
SELECTION-SCREEN END OF BLOCK B2.

Check this link for syntax and more about Radio button

http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/paramete.htm

Thanks,

Vinay

Former Member
0 Kudos

hi Ajay,

*Code used to Initiate the 'AT selection-screen' EVENT from radiobuttons.
selection-screen begin of block group with frame title text-s04.
parameters: p_sel1 type c radiobutton group sel user-command upd.
parameters: p_sel2 type c radiobutton group sel.
parameters: p_sel3 type c radiobutton group sel.
selection-screen end of block group.

Refer

http://www.sapdevelopment.co.uk/tips/tips_iparams.htm

Regards,

Santosh