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: 

To Create Radio Buttons and Inputs Fields Dynamically

0 Kudos

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!

1 ACCEPTED SOLUTION

0 Kudos

Hi All..

Resolved my query using following FM:-

ABAP4_CALL_TRANSACTION

Thank you for your answers.

8 REPLIES 8

mmcisme1
Active Contributor
0 Kudos

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.

PARAMETERS : rb1 RADIOBUTTON GROUP GRP1,
             rb2 RADIOBUTTON GROUP GRP1.
data: gv_field(3).


AT SELECTION-SCREEN OUTPUT.
gv_field = 'RB1'.
LOOP AT SCREEN.
IF screen-name = 'RB1'.
screen-invisible = '1'.
MODIFY SCREEN.
ENDIF.
ENDLOOP.



0 Kudos

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?

mmcisme1
Active Contributor
0 Kudos

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.

0 Kudos

Hi Michelle,

My RFC will return the selection screen as follows:-

it-output.png

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.

Thanks,

Sourabh

Sandra_Rossi
Active Contributor
0 Kudos

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 ...

Former Member
0 Kudos

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.

0 Kudos

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

0 Kudos

Hi All..

Resolved my query using following FM:-

ABAP4_CALL_TRANSACTION

Thank you for your answers.