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: 

Set the position of push buttons

Former Member
0 Kudos

Hi,

I have created two push buttons using the method add_button of cl_gui_toolbar class. But those two push buttons are coming side by side. But I need to show them one after the other.

Is there any way to display the buttons one after the other. I tried set_position, set_left, set_height. But still they are coming side by side.

Plesae guide me in this regard.

Regards,

Kishore

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos

>But those two push buttons are coming side by side. But I need to show them one after the other.

I am not sure what you want from this....side by side and one after the other

* append a separator to normal toolbar
    CLEAR ls_toolbar.
    MOVE 3 TO ls_toolbar-butn_type. "<----Separator
    APPEND ls_toolbar TO e_object->mt_toolbar.
* append an icon to show booking table
    CLEAR ls_toolbar.
    MOVE 'BUTTON' TO ls_toolbar-function.
    MOVE icon_employee TO ls_toolbar-icon.
    MOVE 'Show Bookings'(111) TO ls_toolbar-quickinfo.
    MOVE 'Detail'(112) TO ls_toolbar-text.
    MOVE ' ' TO ls_toolbar-disabled.
    APPEND ls_toolbar TO e_object->mt_toolbar.
* append a separator to normal toolbar
    CLEAR ls_toolbar.
    MOVE 3 TO ls_toolbar-butn_type. "<----Separator
    APPEND ls_toolbar TO e_object->mt_toolbar.
* append an icon to show booking table
    CLEAR ls_toolbar.
    MOVE 'BUTTON2' TO ls_toolbar-function.
    MOVE icon_ok TO ls_toolbar-icon.
    MOVE 'Show Flight'(113) TO ls_toolbar-quickinfo.
    MOVE 'Flights'(114) TO ls_toolbar-text.
    MOVE ' ' TO ls_toolbar-disabled.
    APPEND ls_toolbar TO e_object->mt_toolbar.

Now you will get a separator in between the two buttons.

|   BUTTTON1  |   BUTTON2

4 REPLIES 4

former_member188685
Active Contributor
0 Kudos

>But those two push buttons are coming side by side. But I need to show them one after the other.

I am not sure what you want from this....side by side and one after the other

* append a separator to normal toolbar
    CLEAR ls_toolbar.
    MOVE 3 TO ls_toolbar-butn_type. "<----Separator
    APPEND ls_toolbar TO e_object->mt_toolbar.
* append an icon to show booking table
    CLEAR ls_toolbar.
    MOVE 'BUTTON' TO ls_toolbar-function.
    MOVE icon_employee TO ls_toolbar-icon.
    MOVE 'Show Bookings'(111) TO ls_toolbar-quickinfo.
    MOVE 'Detail'(112) TO ls_toolbar-text.
    MOVE ' ' TO ls_toolbar-disabled.
    APPEND ls_toolbar TO e_object->mt_toolbar.
* append a separator to normal toolbar
    CLEAR ls_toolbar.
    MOVE 3 TO ls_toolbar-butn_type. "<----Separator
    APPEND ls_toolbar TO e_object->mt_toolbar.
* append an icon to show booking table
    CLEAR ls_toolbar.
    MOVE 'BUTTON2' TO ls_toolbar-function.
    MOVE icon_ok TO ls_toolbar-icon.
    MOVE 'Show Flight'(113) TO ls_toolbar-quickinfo.
    MOVE 'Flights'(114) TO ls_toolbar-text.
    MOVE ' ' TO ls_toolbar-disabled.
    APPEND ls_toolbar TO e_object->mt_toolbar.

Now you will get a separator in between the two buttons.

|   BUTTTON1  |   BUTTON2

Former Member
0 Kudos

Hi,

I tried with the separator. But I need the buttons one after the other.

I want Button1 at line 1 and Button2 at line2.

Regards,

Kishore.

0 Kudos

Do you have any sample program where you see the buttons in 2 rows.I never come across having buttons from Top to bottom. (The usual behaviour is Left to Right).

0 Kudos

create object <toolbar>

exporting

parent = <container>

display_mode = CL_GUI_TOOLBAR=>M_MODE_VERTICAL