Skip to Content
author's profile photo Former Member
Former Member

Is it possible to have Radiobuttons on the SAP Toolbar ?

Hi all,

I'm using CL_GUI_TOOLBAR in my application. I want to have Radiobuttons ( 2 of them ) on this toolbar, based on the selection of which I want to switch between two other control elements on my screen.

The method ADD_BUTTON_GROUP of this class has a tables parameter of structure type STB_BUTTON. The field BUTN_TYPE of this structure has an option to provide Radio buttons, but I do not see them on the toolbar as Radio buttons. They appear as ordinary Pushbuttons.

Any help on this one is greatly appreciated.

Thank you.

Regards,

Poornanand Mandalika.

Add comment
10|10000 characters needed characters exceeded

4 Answers

  • Posted on Jul 13, 2004 at 05:29 PM

    Not sure but haven't seen that before so my bet would be that it is not possible ...

    Not much of a help I know 😊

    Steven

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 15, 2004 at 12:24 AM

    Hi!

    I have not seen any standard SAP program using that screen functionality. But the question is why do you need to do it? There could be some other way to do it. Is it not possible to put it as a regular control and not on the toolbar?

    Anyway, technique I could offer is to search for any SAP Standard program which has that functionality (w/c I dont know where) and copy the code on how it is able to do it.

    Regards,

    Jkyle

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 23, 2004 at 01:24 PM

    Hi all,

    so far I know, it is not a build in feature. Appart from that it should be easy to achive it on your own.

    Just add two buttons (butntype = cntb_btype_check) and watch them. In case one button is pushed, call method set_button_state of the alternate one to deselect it.

    Regards Johannes

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jul 27, 2004 at 01:31 PM

    Many thanks to Steven,Jkyle and Johannes for your replies.

    <u><b>Jkyle :</b></u> The simplest reason I wanted to do it was the user had asked me if it was possible.

    The scenario was something like this - There are two Custom Control Areas on a screen, one of which is used to contain a Toolbar. The other Custom Control will contain one of a set of two ALV Grids, depending on what the user wants. And the user should be able to alternate between the two grids. The most logical option ( which coincided with what the user wanted ) is to let the user select one of two Radio Buttons, enabling him to choose which Grid he wants displayed. But the user wanted the radio buttons to be a part of the toolbar, so that the overall look and feel of the screen-elements is not disturbed ( there are no other elements on the screen besides these two custom controls ).

    Since I was not able to put a Radio-Button on the toolbar, I have used a Pushbutton on the toolbar whose text and function code I modify dynamically within the program each time the user toggles between the ALV Grids.

    <u><b>Johannes :</b></u> The solution that you have provided is equally good. But I have already completed the code the as explained above. And the user is also <i>okay</i> with it.

    But if the number of ALV Grids increases to more than 2 ( which is likely ), then I guess I will have to come back to your solution.

    Add comment
    10|10000 characters needed characters exceeded