cancel
Showing results for 
Search instead for 
Did you mean: 

SetHandler

Former Member
0 Kudos

Can anybody explain in detail about the importance of the keyword 'Set Handler' with the SYNTAX OF SETHANDLER keyword particularly in case of 'STATIC EVENT' and in caes of an 'INSTANCE EVENT'.

Accepted Solutions (1)

Accepted Solutions (1)

uwe_schieferstein
Active Contributor
0 Kudos

Hello Sandeep

Irrespective of the level of the event (static vs. instance) the meaning of the statement

SET HANDLER is as following:

If you want to react on an event raised by a class you <b>must </b>to define an event handler. For example, if you want to react on the event DOUBLE_CLICK in an ALV list (instance: go_grid) you need to define an event handler method (e.g. static method handle_double_click of event handler class lcl_eventhandler) and register it:

SET HANDLER:
   lcl_eventhandler=>handle_double_click FOR go_grid.

Alternatively, if the event handler method should handle the event for all grid instances you can use:

SET HANDLER lcl_eventhandler=>handle_double_click FOR ALL INSTANCES.

By default, the event handler is set active:

SET HANDLER:
   lcl_eventhandler=>handle_double_click FOR go_grid.

" ... is identical to:

SET HANDLER:
   lcl_eventhandler=>handle_double_click FOR go_grid ACTIVATION 'X'.

If you want to inactivate an event handler then code:

SET HANDLER:
   lcl_eventhandler=>handle_double_click FOR go_grid ACTIVATION ' '.

Regards

Uwe

Answers (0)