Skip to Content
avatar image
Former Member

To Create Radio Buttons and Inputs Fields Dynamically

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!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Feb 21 at 10:12 AM

    Hi All..

    Resolved my query using following FM:-

    ABAP4_CALL_TRANSACTION

    Thank you for your answers.

    Add comment
    10|10000 characters needed characters exceeded

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

    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.
    
    
    
    
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Michelle Crapo

      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

      it-output.png (17.6 kB)
  • 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 ...

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    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.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

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