Welcome to SAP Central
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Dynamic registration and de-registration of handler methods in ABAP Objects

Go down

Dynamic registration and de-registration of handler methods in ABAP Objects Empty Dynamic registration and de-registration of handler methods in ABAP Objects

Post  Uma_ABAP Sun Apr 01, 2012 12:48 pm


Handler methods can be registered or deregistered dynamically by the optional key word “ACTIVATION”. Activation can register new method or deregister existing method using a variable .

The variable must be character type of length 1. Note if the variable contains the Value as ‘x’ then the method is registered and if it contains the value as space then the method is deregistered. Let’s take an example

Start-of-selection.
Data: my_object type ref to test.
Create object: my_object.
SET HANDLER my_object->event_method FOR test. “ registering the handler
SET HANDLER my_object->event_method FOR test ACTIVATION ‘x’. “deregistering the
handler
SET HANDLER my_object->event_method FOR test ACTIVATION SPACE. “registering the
handler.

Uma_ABAP

Posts : 56
Join date : 2012-03-31

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum