Understanding ABAP Object
page 10 of 12
by Arindam Ghosh
Feedback
Average Rating: 
Views (Total / Last 10 Days): 55429/ 62

Events

Objects or classes can use events to trigger event handler methods in other objects or classes. One method can be called by any number of users in a normal method call. When an event is triggered, any number of event handler methods can be called. Until runtime, the link between the trigger and the handler is not established. The calling program determines the methods that it wants to call in a normal Method call and it must exist. With events, the handler determines the events to which it wants to react. It is not necessary that for every event there has to be a handler method registered.

With the help of RAISE EVENT statement, the events of a class can be triggered in the methods of the same class. You can declare a method of the same or a different class as an event handler method for the event <evt> of class <class> by using the addition FOR EVENT <evt> OF <class>. Events have a similar parameter interface to methods, but only have output parameters. These parameters are passed by the trigger (RAISE EVENT statement) to the event handler method, which receives them as input parameters.

Using the SET HANDLER statement, the link between trigger and handler is established dynamically in a program. The trigger and handlers can be objects or classes, depending on whether you have instance or static events and event handler methods. When an event is triggered, the corresponding event handler methods are executed in all registered handling classes.


View Entire Article

User Comments

Title: understanding ABAP Objects..   
Name: Anony
Date: 2008-10-06 8:28:45 AM
Comment:
Its worth reading and after this we need some lessons with examples to work it out and see abap objects in action...
Keep up the good work.

Thanks.
Title: Understanding ABAP Object   
Name: Reena
Date: 2008-07-15 12:41:28 PM
Comment:
Hi Arindam Ghosh,

I have read the entire article. Its indeed very useful and self explanatory.
Thank you providing the information so elaborately.
If given an example, it would have been even more appreciable...

Thanks and REgards

Product Spotlight
Product Spotlight 





Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2024 ASPAlliance.com  |  Page Processed at 2024-03-28 9:23:08 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search