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

Fundamentals of events in ABAP Objects

Go down

Fundamentals of events in ABAP Objects Empty Fundamentals of events in ABAP Objects

Post  Uma_ABAP Sun Apr 01, 2012 12:43 pm

Events are like one of the class components, events are triggered when certain set of
conditions is met, and unlike normal method they cannot be called using the call method statement. Events denote the state of an object, that is what is the current status of an object, in layman’s word events adds the dimension of time to the modeled entity.

Events enable objects or classes to trigger event handler methods in other objects or classes. Whereas a method can have any number of callers in regular method calls, any number of event handler methods can be called by triggering an event The life of an event consists of four stages.

  1. Creating an event
    Creating an event handler method for the event
    Registering the handler method to the event
    Raising the event


Few points to note:

Events have a parameter interface similar to methods; however, they have only output
parameters, no input parameters. These parameters can be passed to the event handler methods by the triggering object/class (statement RAISE EVENT). The event handler methods use them as input parameters.

Code:


Creating an event
Events can be created like normal class component
CLASS test DEFINITION.
PUBLIC SECTION.
EVENTS: test_event.
ENDCLASS.

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