Introduction
The control framework was introduced in SAP 4.5b at the same time than ABAP Objects, to improve the rendering and conviviality of screens. For example, before that, hierarchical data was rendered using monospaced characters and spaces were used to indent child nodes, and text input was only possible using input fields limited to 128 characters maximum.
The application logic runs on the SAP application server (automation client), which drives the custom control (automation server) at the frontend.
A Control is the application running on the frontend, which is in charge to display data transmitted by the SAP system. For example, there are the following controls: ALV Grid, TextEdit, HTML Viewer, Tree, etc. (see list next chapter).
A control on the frontend side can be accessed by an ABAP program through a corresponding ABAP Object class on the server side.
Here are the steps to work with an X control:
- A classic screen must be created with a special area named "custom container" at a given position and a given size
- During the Process Before Output event (just before the screen is displayed), once:
- A custom container control must be instantiated using ABAP Object and the name of the custom container in the screen must be transmitted to the custom container control
- The X control must then be instantiated and assigned to the custom container, and data are sent to the control through method calls
- It is also possible to ask the control to react to some events and trigger an ABAP Object Event in the ABAP program (without triggering the Process After Input event)
- In the Process After Input event (just after a function key of the screen (or the control) is pressed), or during the ABAP Object Event processing, the data from the control may be read through method calls
Links:
Container controls
As briefly introduced above, SAP provides other container controls. They are used to contain and arrange other controls. They are:
Control name |
Class |
Description |
---|---|---|
SAP Custom Container |
CL_GUI_CUSTOM_CONTAINER |
The SAP Custom Container allows you to display controls in an area defined on a normal screen using the Screen Painter |
SAP Dialog Box Container |
CL_GUI_DIALOGBOX_CONTAINER |
The SAP Dialog Box container allows you to display controls in an amodal dialog box or fullscreen |
SAP Docking Container |
CL_GUI_DOCKING_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 |
SAP Splitter Container |
CL_GUI_SPLITTER_CONTAINER |
The SAP Splitter Container allows you to display more than one control in a given area by dividing it into cells. The Easy splitter is used to divide the area into two cells |
List of controls to put inside containers
Control |
Class |
Description |
---|---|---|
CL_GUI_ALV_GRID |
|
|
CL_GUI_CALENDAR |
|
|
CL_GUI_HTML_VIEWER |
If you want to create an HTML page, use Dynamic Document control below |
|
CL_GUI_PICTURE |
|
|
CL_GUI_TEXTEDIT |
|
|
CL_GUI_TOOLBAR |
|
|
CL_GUI_SIMPLE_TREE, |
|
|
CL_SIMPLE_TREE_MODEL, |
|
|
Object is instantiated by C_OI_CONTAINER_CONTROL_CREATOR methods, it may be manipulated via the following interfaces: |
inline display of excel, word, and other documents using OLE-enabled applications |
|
CL_DD_AREA, |
Builds HTML pages, used to replace obsolete list processing. Uses the HTML viewer |
|
|
CL_GUI_BARCHART |
Wrapper for Barchart. Check demo program BARCBO01 |
|
CL_GUI_SELECTOR |
Color Selector (as avaliable in Smartforms). Check demo program DEMO_COLORSEL |
FAQ
Where are some good examples of using controls in ABAP?
- Look at the examples in transaction code DWDM. Also look at the Reuse Library (transaction SE83).
- Using Classic ActiveX Controls in the ABAP Control Framework
- Using .Net Windows Controls in the ABAP Control Framework
- Make your SAPGUI Talk
- MS Word like spell checker in SAPGUI
Where are some good examples of using the CL_GUI_ALV_GRID?
Look at any program which starts with BCALV*. Also look at the Reuse Library (transaction SE83).