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.
Showing results for 
Search instead for 
Did you mean: 

Distance of a Docking Container from the Top

Former Member
0 Kudos


it is possible to distance an docking container from the top. The container is class CL_GUI_DOCKING_CONTAINER.

I want to show an textfield above the container in my dynpro.



ich habe ein Problem.

Ich erzeuge einen Docking Container der Klasse CL_GUI_DOCKING_CONTAINER und möchte nun, dass dieser zum Top einen Abstand hat, damit auf meinem Dynpro noch ein Textfeld überhalt angezeigt wird.

Ist dies möglich?


Former Member
0 Kudos

Can nobody help me?

Active Contributor
0 Kudos

Hi Sebastian ,

Class constructor has ratio parameter to set the size of it. By using cl_gui_textedit class you can display text or use for input. After creating the cl_gui_docking_container instance , set instance as text_editor's parent.

The code sample is below ;

DATA : text_editor     TYPE REF TO cl_gui_textedit  .
DATA : go_dock_container TYPE REF TO cl_gui_docking_container .

  IF go_dock_container IS INITIAL.
    CREATE OBJECT go_dock_container
        EXPORTING side = cl_gui_docking_container=>dock_at_left
                  extension = 320
                  ratio     = 25
                  repid     = sy-repid
                  dynnr     = '0100'.

if text_editor IS INITIAL.
  CREATE OBJECT text_editor
      max_number_chars       = '600'
      wordwrap_mode            = cl_gui_textedit=>wordwrap_at_fixed_position
      wordwrap_position         = line
      wordwrap_to_linebreak_mode = cl_gui_textedit=>true
     parent                                    =  go_dock_container
     error_cntl_create      = 1
     error_cntl_init        = 2
     error_cntl_link        = 3
     error_dp_create        = 4
     gui_type_not_supported = 5
     OTHERS                 = 6

  CALL METHOD text_editor->set_toolbar_mode
      toolbar_mode           = false
      error_cntl_call_method = 1
      invalid_parameter      = 2
      OTHERS                 = 3.

  CALL METHOD text_editor->set_statusbar_mode
      statusbar_mode         = false
      error_cntl_call_method = 1
      invalid_parameter      = 2
      OTHERS                 = 3.

  CALL METHOD text_editor->set_readonly_mode .


Former Member
0 Kudos

thanks for this example, but it does not work.

if i try this, my docking container isn't wide enough.

and i want to show the text ahead the docking container and not right of it.

Active Contributor
0 Kudos

Hi ,

You just need to change cl_gui_docking_container=>dock_at_left part with cl_gui_docking_container=>dock_at_top to display the cont. at the top. And the code is just the key parts of your request. There are sample programs that illustrates the usage of cl_gui_textedit. For example DEMO_CUSTOM_CONTROL .

If you can specify your request , i could send you the complete code.


Former Member
0 Kudos

but my problem is, that my alv grid control from type cl_gui_alv_grid is not show correctly when i use the texteditor

i need to show a text ahead my alv.

is there another possibilty?

0 Kudos

nobody an idea?

0 Kudos


you can dock the container to the bottom and size it lower in percentage. The maximum is 95 %. When you use a smaller size you can place some fields above to the docking container.

  CREATE OBJECT gx_dock_cont
      repid                       = gv_repid
      dynnr                       = gv_dynnr
      side                        = cl_gui_docking_container=>dock_at_bottom
      name                        = 'DOCKING'
      ratio                       = 95
      cntl_error                  = 1
      cntl_system_error           = 2
      create_error                = 3
      lifetime_error              = 4
      lifetime_dynpro_dynpro_link = 5
      OTHERS                      = 6.

Hope this helps.



Former Member
0 Kudos


this works.

but how i set the text?

0 Kudos

Hi Sebastian,

Check the below code......

I hav used selection screen as base screen and a docking container at top (for texteditor) and a docking container at bottom (for ALV grid).........

 PARAMETER p.                           " Dummy

 DATA : container1  TYPE REF TO cl_gui_docking_container,
        container2  TYPE REF TO cl_gui_docking_container,
        text_editor TYPE REF TO cl_gui_textedit,
        alv_grid    TYPE REF TO cl_gui_alv_grid,
        lt_mara     TYPE TABLE OF mara       WITH HEADER LINE,
        lt_texttab  TYPE soli_tab.


   CHECK container1 IS NOT BOUND.

   CREATE OBJECT container1 EXPORTING repid      = sy-repid
                                      dynnr      = sy-dynnr
                                      side       = cl_gui_docking_container=>dock_at_top
                                      extension  = '100' .

   CREATE OBJECT text_editor EXPORTING parent            = container1
                                       wordwrap_mode     = '1'.

   APPEND 'First line in TextEditControl' TO lt_texttab.

   text_editor->set_text_as_r3table( EXPORTING table = lt_texttab[] ).

   CHECK container2 IS NOT BOUND.

   CREATE OBJECT container2 EXPORTING repid      = sy-repid
                                      dynnr      = sy-dynnr
                                      side       = cl_gui_docking_container=>dock_at_bottom
                                      extension  = '300' .

   CREATE OBJECT alv_grid EXPORTING i_parent = container2.

   SELECT * FROM mara INTO TABLE lt_mara UP TO 20 ROWS.

   alv_grid->set_table_for_first_display( EXPORTING i_structure_name = 'MARA'
                                          CHANGING  it_outtab        = lt_mara[] ).



Edited by: Jose on Jun 6, 2008 10:58 AM

Former Member
0 Kudos

i tried to create the text with:

CALL METHOD text_editor->set_text_as_stream
          text = text_tab.

my text_tab is:

DATA: line(256) TYPE c,
        text_tab LIKE STANDARD TABLE OF line.
  line = 'First line in TextEditControl'.
  APPEND line TO text_tab.

but the text isn't shown. what is wrong?

Former Member
0 Kudos


that works fine!