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

splitter container columns and rows

Former Member
0 Likes
2,008

is it possible to have two columns and two rows. the issue is that i want to have in the first column only one row and in the second column two rows. is that possible?

1 ACCEPTED SOLUTION
Read only

naimesh_patel
Active Contributor
1,351

Yes, it is possible.

1. Create 2 columns splitter container

2. In the 2nd Column, again create a 2 Row splitter container.


DATA: w_container   TYPE REF TO cl_gui_custom_container,
      w_splitter    TYPE REF TO cl_gui_splitter_container,
      w_child1        TYPE REF TO cl_gui_container,
      w_child2        TYPE REF TO cl_gui_container,
      w_splitter2     TYPE REF TO cl_gui_splitter_container,
      w_child21       TYPE REF TO cl_gui_container,
      w_child22       TYPE REF TO cl_gui_container.

**  create a container for the control
  CREATE OBJECT w_container
    EXPORTING
      container_name = 'CC_ALV'
    EXCEPTIONS
      cntl_error                  = 1
      cntl_system_error           = 2
      create_error                = 3
      lifetime_error              = 4
      lifetime_dynpro_dynpro_link = 5.
  IF sy-subrc <> 0.
    MESSAGE a000(tree_control_msg).
  ENDIF.

**  Instance of Splitter control - 2 columns
  CREATE OBJECT w_splitter
                EXPORTING parent = w_container
                          rows    = 1
                          columns = 2.

**  Assign first column to continer
  CALL METHOD w_splitter->get_container
    EXPORTING
      row       = 1
      column    = 1
    RECEIVING
      container = w_child1.

**  Assign 2nd child to holding container
  CALL METHOD w_splitter->get_container
    EXPORTING
      row       = 1
      column    = 2
    RECEIVING
      container = w_child2.

**  Instance of Splitter control - 2 rows
  CREATE OBJECT w_splitter2
                EXPORTING parent = w_child2
                          rows    = 2
                          columns = 1.

**  Assign first row of 2nd column to continer
  CALL METHOD w_splitter2->get_container
    EXPORTING
      row       = 1
      column    = 1
    RECEIVING
      container = w_child21.

**  Assign 2nd row 2nd column to continer
  CALL METHOD w_splitter2->get_container
    EXPORTING
      row       = 2
      column    = 1
    RECEIVING
      container = w_child22.

Regards,

Naimesh Patel

is it possible to have two columns and two rows. the issue is that i want to have in the first column only one row and in the second column two rows. is that possible?

4 REPLIES 4
Read only

naimesh_patel
Active Contributor
1,352

Yes, it is possible.

1. Create 2 columns splitter container

2. In the 2nd Column, again create a 2 Row splitter container.


DATA: w_container   TYPE REF TO cl_gui_custom_container,
      w_splitter    TYPE REF TO cl_gui_splitter_container,
      w_child1        TYPE REF TO cl_gui_container,
      w_child2        TYPE REF TO cl_gui_container,
      w_splitter2     TYPE REF TO cl_gui_splitter_container,
      w_child21       TYPE REF TO cl_gui_container,
      w_child22       TYPE REF TO cl_gui_container.

**  create a container for the control
  CREATE OBJECT w_container
    EXPORTING
      container_name = 'CC_ALV'
    EXCEPTIONS
      cntl_error                  = 1
      cntl_system_error           = 2
      create_error                = 3
      lifetime_error              = 4
      lifetime_dynpro_dynpro_link = 5.
  IF sy-subrc <> 0.
    MESSAGE a000(tree_control_msg).
  ENDIF.

**  Instance of Splitter control - 2 columns
  CREATE OBJECT w_splitter
                EXPORTING parent = w_container
                          rows    = 1
                          columns = 2.

**  Assign first column to continer
  CALL METHOD w_splitter->get_container
    EXPORTING
      row       = 1
      column    = 1
    RECEIVING
      container = w_child1.

**  Assign 2nd child to holding container
  CALL METHOD w_splitter->get_container
    EXPORTING
      row       = 1
      column    = 2
    RECEIVING
      container = w_child2.

**  Instance of Splitter control - 2 rows
  CREATE OBJECT w_splitter2
                EXPORTING parent = w_child2
                          rows    = 2
                          columns = 1.

**  Assign first row of 2nd column to continer
  CALL METHOD w_splitter2->get_container
    EXPORTING
      row       = 1
      column    = 1
    RECEIVING
      container = w_child21.

**  Assign 2nd row 2nd column to continer
  CALL METHOD w_splitter2->get_container
    EXPORTING
      row       = 2
      column    = 1
    RECEIVING
      container = w_child22.

Regards,

Naimesh Patel

Read only

0 Likes
1,351

and can i edit the wideness of the left splitter1?

Read only

0 Likes
1,351

Explore the class CL_GUI_SPLITTER_CONTAINER. You will find all the methods to set Splitter conatiner properties.


    CALL METHOD W_SPLITTER->SET_COLUMN_WIDTH
      EXPORTING
        ID    = 1
        WIDTH = 40.

Regards,

Naimesh Patel

Read only

0 Likes
1,351

your great it works .