Application Development and Automation 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: 
Read only

OOABAP - CL_GUI_TOOLBAR functions in a split container

Former Member
0 Likes
1,962

Hi, I have created one custom split container and split it to 2 rows.I'm adding push buttons in both rows(containers) using CREATE OBJECT toolbar_object & CALL METHOD toolbar_object->add_button

Could any one please help me out with:

(1) when I add push buttons in conainer, buttons are appearing without any gap. how do we have buttons with some space.

(2) how do we have header/title to identify the corresponsing containers/rows as I have created one custom split container and split it to 2 rows.

Thanks in advance.

1 ACCEPTED SOLUTION
Read only

Former Member
1,335

thanks Marcin for the first one. for second one, yes please I wants to display titles/headers on each container.

some thing like after splitting and creating buttons it will look like:

-


button1 button2 ...

-


button3 button4 .....

-


but I would like to have some identification by header/titles like:

...header1/title1----


button1 button2 ...

-header2/title2--


button3 button4 .....

-


Hi, I have created one custom split container and split it to 2 rows.I'm adding push buttons in both rows(containers) using CREATE OBJECT toolbar_object & CALL METHOD toolbar_object->add_button

Could any one please help me out with:

(1) when I add push buttons in conainer, buttons are appearing without any gap. how do we have buttons with some space.

(2) how do we have header/title to identify the corresponsing containers/rows as I have created one custom split container and split it to 2 rows.

Thanks in advance.

4 REPLIES 4
Read only

MarcinPciak
Active Contributor
0 Likes
1,335

1)


type-pools: cntb.

  call method mr_toolbar->add_button
    exporting
      fcode     = ''
      icon      = ''
      butn_type = cntb_btype_sep.   "separator

2) not sure here what you want. Do you wan header to be dispalyed above each toolbar?

Regards

Marcin

Read only

Former Member
1,336

thanks Marcin for the first one. for second one, yes please I wants to display titles/headers on each container.

some thing like after splitting and creating buttons it will look like:

-


button1 button2 ...

-


button3 button4 .....

-


but I would like to have some identification by header/titles like:

...header1/title1----


button1 button2 ...

-header2/title2--


button3 button4 .....

-


Read only

0 Likes
1,335

To achieve that you will have to split custom container into 4 parts (with cl_gui_splitter_container ). Now top row would be for heading, second for toolbar, next for heading, 4th for toolbar.

In each heading you can place dynamic document to display your header/title


DATA: r_dd_document TYPE REF TO cl_dd_document,   "dynamic document ref.variable
      r_custom_container TYPE REF TO cl_gui_custom_container.

CALL SCREEN 900.

MODULE pbo OUTPUT.
  
   "first your initial custom container
  CREATE OBJECT r_custom_container
    EXPORTING
      container_name    = 'CUSTOM_CONTROL'.

   "here you need to split cutom container in 4 parts
   ....

  "now create dd document
  CREATE OBJECT r_dd_document
    EXPORTING
       no_margins = 'X'.

  "add header text
  CALL METHOD r_dd_document->add_text
    EXPORTING
      text             = 'Some heading'
      sap_style        = cl_dd_area=>HEADING.

  "dispaly it in one of the containers
  CALL METHOD r_dd_document->display_document
    EXPORTING
      parent    = "here give reference to one of the containers you have

ENDMODULE.

Regards

Marcin

Read only

Former Member
0 Likes
1,335

thanks Marcin. Appreciate your help and problem is resolved.

Points given. Thanks once again...