Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Events

Former Member
0 Likes
559

Hi All,

can u tell about the events in the abap programming and how they going to trigger.

explain in detail.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
535

Hi,

The events in abap r

Initialisation

Top of page

start of selection

end of page

end of selection

at line selection

at user command

Initialisation: TO put the calculated values in the parameters and select options we will use it.

top-of-page.-it will trigger when the first write statement trigger .

at line selection- to goto secondary lists by double clicking on the basic list

at iser command. when one button is clicked then certain code need to be excecuted then this event is useful.

Plzz reward points if it helps.

3 REPLIES 3
Read only

Former Member
0 Likes
536

Hi,

The events in abap r

Initialisation

Top of page

start of selection

end of page

end of selection

at line selection

at user command

Initialisation: TO put the calculated values in the parameters and select options we will use it.

top-of-page.-it will trigger when the first write statement trigger .

at line selection- to goto secondary lists by double clicking on the basic list

at iser command. when one button is clicked then certain code need to be excecuted then this event is useful.

Plzz reward points if it helps.

Read only

0 Likes
535

Hi,

Thanks for your rly

Read only

Former Member
0 Likes
535

Hi Kumar

Pls find some below contents.

Pls reward pts if help.

Regards

deepanker.

Triggering and Handling Events

In ABAP Objects, triggering and handling an event means that certain methods act as triggers and trigger events, to which other methods - the handlers - react. This means that the handler methods are executed when the event occurs.

This section contains explains how to work with events in ABAP Objects. For precise details of the relevant ABAP statements, refer to the corresponding keyword documentation in the ABAP Editor.

Triggering Events

To trigger an event, a class must

· Declare the event in its declaration part

· Trigger the event in one of its methods

Declaring Events

You declare events in the declaration part of a class or in an interface. To declare instance events, use the following statement:

EVENTS ) TYPE type ..

To declare static events, use the following statement:

CLASS-EVENTS ... ...

It links a list of handler methods with corresponding trigger methods. There are four different types of event.

It can be

· An instance event declared in a class

· An instance event declared in an interface

· A static event declared in a class

· A static event declared in an interface

The syntax and effect of the SET HANDLER depends on which of the four cases listed above applies.

For an instance event, you must use the FOR addition to specify the instance for which you want to register the handler. You can either specify a single instance as the trigger, using a reference variable ...

The registration applies automatically to the whole class, or to all of the classes that implement the interface containing the static event. In the case of interfaces, the registration also applies to classes that are not loaded until after the handler has been registered.

Timing of Event Handling

After the RAISE EVENT statement, all registered handler methods are executed before the next statement is processed (synchronous event handling). If a handler method itself triggers events, its handler methods are executed before the original handler method continues. To avoid the possibility of endless recursion, events may currently only be nested 64 deep.

Handler methods are executed in the order in which they were registered. Since event handlers are registered dynamically, you should not assume that they will be processed in a particular order. Instead, you should program as though all event handlers will be executed simultaneously.

Pls reward pts if help.