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

Radiobuttons

Former Member
0 Likes
664

How many radio buttons can we have on the selection screen?

1 ACCEPTED SOLUTION
Read only

former_member189059
Active Contributor
0 Likes
635

Hello Kush,

I made this program to dynamically generate a program with the number of radio buttons you specify and ran it on a 4.6c system and an ECC6 system

It ran properly for 199 buttons, but gave an error for 200 buttons

So I guess that's your answer


*&---------------------------------------------------------------------*
*& Report  ZKRIS_DYNAMICRADIO
*&---------------------------------------------------------------------*
*& Author  : Kris Donald
*& Date    : 12-05-2008
*& Purpose : Generate a program dynamically with radio buttons
*&---------------------------------------------------------------------*

report  zkris_dynamicradio.

* Example: how to create a dynamic selection screen

selection-screen begin of block b1 with frame title f1_ttl.
  parameters: p_rbcnt type i default 5.
selection-screen end of block b1.

initialization.
  f1_ttl = 'Number of radio buttons'.

start-of-selection.

* The dynamic program source table
data: begin of inctabl occurs 10,
line(72),
end of inctabl.

data: lv_radiocount type string.
data: lv_currentcount type i.
data: lv_radioname type string.

* Create the dynamic internal table definition in the dyn. program
inctabl-line = 'program zdynpro.'. append inctabl.

*inctabl-line = 'data: begin of dyntab occurs 10,'. append inctabl.

do p_rbcnt times.
  lv_radiocount = lv_currentcount.
  concatenate 'rb_' lv_radiocount into lv_radioname.
  concatenate 'parameter:' lv_radioname 'radiobutton group rg01.'
    into inctabl-line separated by space.

  append inctabl.

  lv_currentcount = lv_currentcount + 1.
enddo.

inctabl-line = 'start-of-selection.'. append inctabl.
inctabl-line = 'write: rb_0.'. append inctabl.

* Create and run the dynamic program
insert report 'ZDYNPRO' from inctabl.
if sy-subrc = 0.
  submit zdynpro VIA SELECTION-SCREEN.
else.
  write : / 'error'.
endif.

Hello Kush,

I made this program to dynamically generate a program with the number of radio buttons you specify and ran it on a 4.6c system and an ECC6 system

It ran properly for 199 buttons, but gave an error for 200 buttons

So I guess that's your answer


*&---------------------------------------------------------------------*
*& Report  ZKRIS_DYNAMICRADIO
*&---------------------------------------------------------------------*
*& Author  : Kris Donald
*& Date    : 12-05-2008
*& Purpose : Generate a program dynamically with radio buttons
*&---------------------------------------------------------------------*

report  zkris_dynamicradio.

* Example: how to create a dynamic selection screen

selection-screen begin of block b1 with frame title f1_ttl.
  parameters: p_rbcnt type i default 5.
selection-screen end of block b1.

initialization.
  f1_ttl = 'Number of radio buttons'.

start-of-selection.

* The dynamic program source table
data: begin of inctabl occurs 10,
line(72),
end of inctabl.

data: lv_radiocount type string.
data: lv_currentcount type i.
data: lv_radioname type string.

* Create the dynamic internal table definition in the dyn. program
inctabl-line = 'program zdynpro.'. append inctabl.

*inctabl-line = 'data: begin of dyntab occurs 10,'. append inctabl.

do p_rbcnt times.
  lv_radiocount = lv_currentcount.
  concatenate 'rb_' lv_radiocount into lv_radioname.
  concatenate 'parameter:' lv_radioname 'radiobutton group rg01.'
    into inctabl-line separated by space.

  append inctabl.

  lv_currentcount = lv_currentcount + 1.
enddo.

inctabl-line = 'start-of-selection.'. append inctabl.
inctabl-line = 'write: rb_0.'. append inctabl.

* Create and run the dynamic program
insert report 'ZDYNPRO' from inctabl.
if sy-subrc = 0.
  submit zdynpro VIA SELECTION-SCREEN.
else.
  write : / 'error'.
endif.

2 REPLIES 2
Read only

former_member189059
Active Contributor
0 Likes
636

Hello Kush,

I made this program to dynamically generate a program with the number of radio buttons you specify and ran it on a 4.6c system and an ECC6 system

It ran properly for 199 buttons, but gave an error for 200 buttons

So I guess that's your answer


*&---------------------------------------------------------------------*
*& Report  ZKRIS_DYNAMICRADIO
*&---------------------------------------------------------------------*
*& Author  : Kris Donald
*& Date    : 12-05-2008
*& Purpose : Generate a program dynamically with radio buttons
*&---------------------------------------------------------------------*

report  zkris_dynamicradio.

* Example: how to create a dynamic selection screen

selection-screen begin of block b1 with frame title f1_ttl.
  parameters: p_rbcnt type i default 5.
selection-screen end of block b1.

initialization.
  f1_ttl = 'Number of radio buttons'.

start-of-selection.

* The dynamic program source table
data: begin of inctabl occurs 10,
line(72),
end of inctabl.

data: lv_radiocount type string.
data: lv_currentcount type i.
data: lv_radioname type string.

* Create the dynamic internal table definition in the dyn. program
inctabl-line = 'program zdynpro.'. append inctabl.

*inctabl-line = 'data: begin of dyntab occurs 10,'. append inctabl.

do p_rbcnt times.
  lv_radiocount = lv_currentcount.
  concatenate 'rb_' lv_radiocount into lv_radioname.
  concatenate 'parameter:' lv_radioname 'radiobutton group rg01.'
    into inctabl-line separated by space.

  append inctabl.

  lv_currentcount = lv_currentcount + 1.
enddo.

inctabl-line = 'start-of-selection.'. append inctabl.
inctabl-line = 'write: rb_0.'. append inctabl.

* Create and run the dynamic program
insert report 'ZDYNPRO' from inctabl.
if sy-subrc = 0.
  submit zdynpro VIA SELECTION-SCREEN.
else.
  write : / 'error'.
endif.

Read only

Former Member
0 Likes
635

HI,

Maximum 999