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: 

index for radiobuttons

Former Member
0 Kudos

Hi

if there any way to get wich radiobutton was selected?

i mean without doing IF my_radio = 'X'.

here is the code

parameters: it2001 radiobutton group grp1 default 'X',

it2002 radiobutton group grp1,

it2003 radiobutton group grp1,

it2004 radiobutton group grp1,

it2005 radiobutton group grp1,

it2006 radiobutton group grp1,

it2007 radiobutton group grp1,

teven radiobutton group grp1.

selection-screen end of block b1.

some function module or some index may help me?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Javier,

check the below code.

data: begin of itab occurs 0,

i2001 type c,

i2002 type c,

i2003 type c,

i2004 type c,

i2005 type c,

i2006 type c,

i2007 type c,

end of itab.

parameters: it2001 radiobutton group grp1 default 'X',

it2002 radiobutton group grp1,

it2003 radiobutton group grp1,

it2004 radiobutton group grp1,

it2005 radiobutton group grp1,

it2006 radiobutton group grp1,

it2007 radiobutton group grp1.

*teven radiobutton group grp1.

data v_one.

data v_index type sy-index.

start-of-selection.

move it2001 to itab-i2001.

move it2002 to itab-i2002.

move it2003 to itab-i2003.

move it2004 to itab-i2004.

move it2005 to itab-i2005.

move it2006 to itab-i2006.

move it2007 to itab-i2007.

append itab.

loop at itab.

do 7 times

varying v_one from itab-i2001 next itab-i2002.

if not v_one is initial.

move sy-index to v_index.

write:/2 v_index,

40 v_one.

endif.

enddo.

endloop.

2 REPLIES 2

Former Member
0 Kudos

Hello Javier,

I do not understand your requirement.

When user select radio button,then it will have 'X' Value.

parameters: it2001 radiobutton group grp1 default 'X',

it2002 radiobutton group grp1,

it2003 radiobutton group grp1,

it2004 radiobutton group grp1,

it2005 radiobutton group grp1,

it2006 radiobutton group grp1,

it2007 radiobutton group grp1,

teven radiobutton group grp1.

selection-screen end of block b1.

let me say one example :

it2001 -> this is radio button ,when user select it2001 Radio button,then it2001 = 'X'.

then i will write condition,other than i will not do anything.

But i can help you what i understand.

Thanks

Seshu

Former Member
0 Kudos

Hi Javier,

check the below code.

data: begin of itab occurs 0,

i2001 type c,

i2002 type c,

i2003 type c,

i2004 type c,

i2005 type c,

i2006 type c,

i2007 type c,

end of itab.

parameters: it2001 radiobutton group grp1 default 'X',

it2002 radiobutton group grp1,

it2003 radiobutton group grp1,

it2004 radiobutton group grp1,

it2005 radiobutton group grp1,

it2006 radiobutton group grp1,

it2007 radiobutton group grp1.

*teven radiobutton group grp1.

data v_one.

data v_index type sy-index.

start-of-selection.

move it2001 to itab-i2001.

move it2002 to itab-i2002.

move it2003 to itab-i2003.

move it2004 to itab-i2004.

move it2005 to itab-i2005.

move it2006 to itab-i2006.

move it2007 to itab-i2007.

append itab.

loop at itab.

do 7 times

varying v_one from itab-i2001 next itab-i2002.

if not v_one is initial.

move sy-index to v_index.

write:/2 v_index,

40 v_one.

endif.

enddo.

endloop.