Mentor SAP

Events and the Control Framework

The graphical user interface (GUI) in the SAP system is based on SAP GUI windows (screens from the technical view of the programmer). Every user dialog in the system is implemented using the screens of application programs.

 

The application program communicates with the screen at runtime using various runtime system services (ABAP processor and screen processor) and the SAP GUI services, which manage windows and their dialog box levels, data transfer, and so on.

 

You can use screen elements other than those provided in the Screen Painter in SAP GUI windows. These additional screen elements are known as controls. Controls are standalone binary software components that are reusable. As a developer, you can integrate one or more controls into your user dialogs and use the functions they make available.

 

The communication between the control and the application program is different from that of the classic screen elements. Communication for all controls is performed in the same way using the Control Framework (CFW).

 

The CFW uses special services in the SAP GUI and the runtime system on the application server. These services are the automation controller on the presentation server and the CFW service on the application server.

 

 

Controls and ABAP Objects

Every GUI control that communicates with an application program represents an object, which is an instance of a class, on the presentation server. The communication with the instances uses the method calls and events of the objects.

 

There are representative classes (proxy classes) for all GUI controls in the class library. These representative classes access the CFW in a uniform way and package the control-specific communication. These are referred to as control wrappers.

 

Use of a GUI control in an ABAP program involves the following objects:

 

The communication between the ABAP program and a GUI control is performed as follows:

 

The CFW maintains a list of the active instances with which it is communicating, both at the presentation server and on the application server.

 

 

Events

To pass an event to a presentation server control, the following partner levels are involved:

 

 

Processing of ABAP Objects Event

An object triggers events to announce a change in its state. Other objects can contain handler methods that are executed when the event occurs. For the handler methods to be run, they must be registered with the basis services.

 

When the event is triggered, a basis service ensures that the registered methods are executed. The instance that triggers the event does not know the event handler, unlike explicit method calls, where the caller has control and knows the method called. This applies when the event is defined and when the event occurs at runtime.