Event Handler Technique in Object oriented ABAP

By Satya Mahanandia,HCL Technologies

Event is a mechanism by which method of one class can raise method of another class, without the hazard of instantiating that class. It provides to raise the method (event handler method) of one class with help of another method in the same or different class (triggering method).

The below steps is required to have the event handler in the class:-

  • Create an event in a class.

  • Create a triggering method in the same class which will raise the event. 

  • Create an event handler method for the event in same/other class. 

  • Register the event handler method in the program. 

Now, the above settings are complete for event handler in class. Create an object from the class containing the event and call the triggering method to raise the event.

By taking the above steps, the following sample examples will demonstrate the event handler technique in Class.

1.       Events with Handler Method in the same class.

This example tells that how to raise method, if the triggering method and event handler method presents in the same class.

Sample code and Output.



Click here to continue...

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image