Splitter Container PDF Print E-mail
User Rating: / 1
PoorBest 
ABAP Tutorials - Programming with Control Frameworks
Written by admin   
Wednesday, 13 August 2008 05:44

Often there is a requirement to have different items on screen and possibility to re size them. This can be achieved by making use of Splitter containers. The concept of splitter containers is really simple.

Prerequisite is  that you understand the basic concepts of SAP control frame works. To understand that you can refer to our other tutorials in the "ABAP Tutorials section".

You can create a splitter container from a custom container. Then you can obtain the references of each splitted container and place a control in the individual containers. A simple code example is shown below:

1. Create a Custom container first. This container is of type CL_GUI_CUSTOM_CONTAINER
    CREATE OBJECT container
                  EXPORTING container_name = 'CUSTOM'.

 2. Create a splitter container.Here we are splitting it into 1 row and 2 columns.The splitter is of type CL_GUI_SPLITTER_CONTAINER

    CREATE OBJECT splitter
                  EXPORTING parent = container
                            rows    = 1
                            columns = 2.

3. Now get the container reference of splitted container.Here container_1 is of type CL_GUI_CONTAINER.

    CALL METHOD splitter->get_container
                      EXPORTING row      = 1
                                column   = 1
                      RECEIVING container = container_1.

4. Place control in the container - this is really simple. Here a picture control is placed.

    CREATE OBJECT picture_1
                  EXPORTING parent  = container_1.

Easy right.. Smile

Some useful methods:

1. Set the width and height of the container - Use the methods SET_ROW_HEIGHT and SET_COLUMN_WIDTH to set the dimentions of the container. The trick here is that if you want to minimize the size or hide the complete container, then you can set the dimensions to 0.

2. Use GET_ROW_HEIGHT and GET_COLUMN_WIDTH to retrieve the height and adjust accordingly. For example if you want to divide the containers in a specefic ratio.

Comments
Add New Search
Koro González  - Very useful, many thanks!!   |address213.96.155.168 |2009-05-27 09:03:39

Thank you very much!!
Anonymous   |address125.16.17.152 |2009-06-10 23:59:58
rama  - Get height of Splitter   |address145.253.156.210 |2010-01-07 08:37:11
Well, i have trying to get the height of the Splitter when the user drags it as
per his use..but not able to save those settings

i am using Get_Row_Height
method and the result is always shown as 0.

Can anyone help me in this
regard?

Best Regards,
rama
Stanislav  - Get height of Splitter   |address217.5.142.148 |2010-04-06 05:29:08
Hi,
You can try so:
splitter_container->get_row_height(
EXPORTING
id
= 1
IMPORTING
result = result ).
CALL METHOD cl_gui_cfw=>flush.
Write comment
Name:
Email:
 
Title:
UBBCode:
[b] [i] [u] [url] [quote] [code] [img] 
 
 
:angry::0:confused::cheer:B):evil::silly::dry::lol::kiss::D:pinch:
:(:shock::X:side::):P:unsure::woohoo::huh::whistle:;):s
:!::?::idea::arrow:
 
Please input the anti-spam code that you can read in the image.

3.26 Copyright (C) 2008 Compojoom.com / Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

Last Updated ( Thursday, 18 September 2008 03:50 )
 

Advertisement

 

Google Search

Advertisement