|
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..  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.
|