Container controls provide areas on the screen that can be used for application controls. The most important container controls are encapsulated in the following global classes²:
CL_GUI_CUSTOM_CONTAINER: When you create an object of this class, you must link it to a custom control on a screen via the IMPORTING parameter container_name of its constructor. You can use theScreen Painter to create one or several custom controls within the area of one screen, and you can use custom controls together with classical screen elements. Any application control that you link to a custom container will appear within its screen area.
CL_GUI_DOCKING_CONTAINER: When you create an object of this class, you must link it to one of the four edges of a screen. By doing so, you createa new area docked to a screen without using the Screen Painter. Any application control that you link to a docking container will appear within that screen area.
CL_GUI_SPLITTER_CONTAINER: When you create an object of this class, you must link it to an already existing container control. By doing so, you split the area of the existing control either vertically or horizontally into two newareas, as was done to create the screen in Figure 1. You can then link application controls to the new areas. You can also nest splitter controls to create more areas.
After creating objects of container controls, you can create objects of application controls - the components you want to use onscreen. You must link each application control to an object of a container control.You can do this by simply passing the respective reference to the parameter parent of the application control's constructor. Important application controls and their respective global classes are:
CL_GUI_ALV_GRID: This control allows you to display interactive lists. (ALV stands for ABAP List Viewer, which replaces classical list processing.)
CL_GUI_HTML_VIEWER: This control allows you todisplay HTML documents. For example, the new help viewer of the ABAP keyword documentation uses an HTML control.
CL_GUI_PICTURE: This control allows you to display any given picture on an R/3 screen. For example, the airplane in Figure 1 is displayed in a picture control. SAP Easy Access is another example of a picture control as background.
CL_GUI_SIMPLE_TREE: This control allows you to displayand work with a tree structure. In addition to the simple tree, there are also other kinds of trees available. For example, the Object Navigator of the ABAP Workbench uses a tree control.
CL_GUI_TEXTEDIT: This control implements a full-fledged editor for viewing and maintaining texts. For example, the ABAP Editor uses a textedit control.
You use the methods defined in thecontrol's classes to work with the controls displayed on the screen. In general, you work with the methods of the application controls. You would use these, for example, to fill text from an internal table into the text editor of the textedit control. But sometimes you will also call methods of the CFW. In order to minimize the network load between backend and frontend, method calls are buffered inan automation queue before being sent to the frontend at defined synchronization points, such as at the end of PBO (Process Before Output) processing. To force a synchronization point in your program, you can call the static method cl_gui_cfw=> flush.
Control Events and Event Handling
User actions on controls can trigger events. However, the events of controls are not classical screen events,which trigger the PAI processing at the application server and send a function code. Instead, they are declared as ABAP Objects events in their global wrapper classes. For performance reasons, a user action on controls is not automatically passed back to the application server. If you want an event to be passed back to the application server, you must register it in your program using the...