SAP Container

Use

A SAP Container is a control that accommodates other controls, such as the SAP Tree Control, SAP Picture Control, SAP Textedit Control, SAP Splitter Control, and so on. It manages these controls logically in a collection, and provides a physical area in which they are displayed.

All controls live in a container. Since containers are themselves controls, you can nest them. The container is the parent of the control within it.

There are five kinds of SAP Containers:

  • SAP Custom Container allows you to display controls in an area defined on a normal screen using the Screen Painter: CL_GUI_CUSTOM_CONTAINER

  • The SAP Dialogbox Container allows you to display controls in an amodal dialog box or fullscreen. CL_GUI_DIALOGBOX_CONTAINER

  • The SAP Docking Container allows you to attach a control to any of the four edges of a screen as a resizable screen area. You can also detach it so that it becomes an independent amodal dialog box. CL_GUI_DOCKING_CONTAINER

  • The SAP Splitter Container allows you to display more than one control in a given area by dividing it into cells. CL_GUI_SPLITTER_CONTAINER

  • The SAP Easy Splitter Container allows you to divide an area into two cells with a control in each. CL_GUI_EASY_SPLITTER_CONTAINER

All SAP Containers have a common parent with the type CL_GUI_CONTROL. They are all derived from this basic container, and therefore all have the same object-oriented interface.

Displaying and Relinking Containers

Visualization

You should remember the following points about displaying SAP Containers:

  • The default size of a control is the same as the size of its container. You can override this default when you instantiate the control.

  • Each container has a top level container (screen0 to 9) its parent. The top level container is automatically created when you use the corresponding ABAP Objects class, and is the equivalent of a dialog box level 0 to 9. The default screen is the current dialog box when you create the control. If you want to specify a particular screen on which to display the control, pass the screen as the parent when you create the container. For more information, see the documentation of the relevant constructor method.

  • A container can only be displayed at the dialog box level to which it is attached when you create it. When the system leaves a particular level, the lifetime management system destroys all controls from that level. For more information, see Lifetime Management.

  • If you want to display controls dynamically, use the set_visible method.

  • If a parent is not visible, its children are also not visible.

Relinking Containers

You can only relink containers at the same dialog box level and at the top parent level (for example, Custom Container, Docking Container).

To relink containers, use the link method.

Attributes

Instance Attributes

Type / Value

Description / Use

children

CNTO_CONTROL_LIST

List of children

Static Attributes

Type / Value

Description / Use

default_screen

CL_GUI_CONTAINER

Dummy for default top level container (screen)

screen0 to screen9

CL_GUI_CONTAINER

Dummy for default top level0 to top level9 container (screen0 to screen9)