Skip to Content

To Create Radio Buttons and Inputs Fields Dynamically

Jan 09 at 10:32 AM


avatar image

Hello Experts,

I'm developing one report where I'm creating Input Fields Dynamically, in order to create Parameters and Select Options dynamically, I've used FM FREE_SELECTIONS_INIT. Now, I wants to create radio button using the same, but unfortunately, I'm not getting any option in order to do the same. Is it possible to create radio buttons using the same FM? Else alternate solution any?

Thanks in advance!

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
Sourabh Khadilkar Feb 21 at 10:12 AM

Hi All..

Resolved my query using following FM:-


Thank you for your answers.

10 |10000 characters needed characters left characters exceeded
Michelle Crapo Jan 09 at 02:00 PM

Are you trying to do this with a report? How are they determined? I would use loop at screen. Then when you want to make then visible just loop again. I'm not sure what you are trying to do.

             rb2 RADIOBUTTON GROUP GRP1.
data: gv_field(3).

gv_field = 'RB1'.
IF screen-name = 'RB1'.
screen-invisible = '1'.

Show 3 Share
10 |10000 characters needed characters left characters exceeded

Hi Michelle,

My requirement is:-

we have some programs across multiple system, in order to access those programs user has to login to multiple systems, now we are developing one generic program in a system so that user can access all programs from one system only. Since dependent tables and data can not be moved across system. I've created one RFC in System A which will fetch all input details of a program and returns to System B. Later System B will show input screen to the user. Since we are getting input fields details through RFC I'm generating input fields dynamically. In order to do the same, I've used FM FM FREE_SELECTIONS_INIT. But I'm not getting an option to create radio button in the same. Can you please help me regarding the same?


I see you are running this program from the calling system. The program brings back the fields. Now you want a function module that will bring back the radiobuttons. Correct?

Since you created an RFC you had to have wrapped some code around the function module. Why not use that code to select the radio buttons that can be displayed. Add another table to the function module for the radio buttons. You can put that logic after the FREE_SELECTIONS_INIT.


Hi Michelle,

My RFC will return the selection screen as follows:-


It'll gives me all input fields along with radio buttons too. As far as FREE_SELECTIONS_INIT is being concern, I know that you needs to pass Input Parameters and Input Text to that function module. Upon calling FREE_SELECTIONS_DIALOG, SAP will automatically creates a screen on top of our program. Once you enters input value and press execute button on the screen it'll return the values that are entered by user. You'll get values in tables tab of that FM. Since, screen is generating dynamically, we can not put logic of radio buttons after it.



it-output.png (17.6 kB)
Sandra Rossi Jan 10 at 07:51 AM

Try to do it with an ALV Grid. For starting, you could extend the code for checkboxes of Enno Wulff: Variations Of Selecting Multiple Options From A List ...

10 |10000 characters needed characters left characters exceeded
Tibor Gerke Jan 10 at 01:39 PM

It is not possible to create radio buttons and check buttons with function module FREE_SELECTIONS_INIT.

The technical reason is, that you can not change/convert dynamically the 'Element type' from an Input/Output field to radio button group or checkbox.

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks Tibor!! Is there any alternate way through which we can able to achieve this functionality?