Skip to content

ABAP Keyword Documentation →  ABAP - Reference →  Calling and leaving program units →  Calling Processing Blocks →  Call Event Handler →  SET HANDLER 

SET HANDLER - static_event

Short Reference

Other versions: 7.31 | 7.40 | 7.54

Syntax


SET HANDLER handler1 handler2 ... [ACTIVATION act]. 

Addition

... ACTIVATION act

Effect

This statement registers the event handlers handler1 handler2 ... for the associated static events. The addition ACTIVATION can be used to deregister event handlers or perform a dynamic registration.

An event handler is executed if the associated static event is triggered using RAISE EVENT. The list handler1 handler2 ... has the same form as for instance events, but can only contain event handlers for static events declared using CLASS EVENTS.

The event that can be handled by an event handler for static events is already defined uniquely by its definition using the statement [CLASS-] METHODS. The addition FOR (required when registering or deregistering instance event handlers to determine the triggering instances) cannot be specified. The registration or deregistration of an event handler for static events is independent of the instance and is applies globally to the current internal session.

Addition

... ACTIVATION act

Effect

The same applies to the syntax and semantics of the addition ACTIVATION as to the statement SETHANDLER for instance events.


Note

As long as the registration of an instance method as an event handler for a static event is not canceled using ACTIVATION " ", the associated object cannot be deleted by the garbage collector, since it is still used by the runtime environment.