Mentor SAP

 

Linking of the Representative Instance and the Handler Method

The SET HANDLER statement links handler methods with the event triggers.

In the figure, there is the on_double_click static method of the lcl_event_handler class. This method is called if the ALV instance, to which the go_alv_grid object refers, triggers the double_click event.

 

For more information about registering handler methods for events, refer to the keyword documentation for the SET HANDLER statement.

 

In the figure, a static method is used for the handling. To use an instance method, the syntax is SET HANDLER lcl_event_handler_object->on_double_click FOR go_alv_grid.

 

Note the different component selectors: => for static methods and -> for instance methods. The SET HANDLER statement has linked the handler method with the ALV grid control.