cancel
Showing results for 
Search instead for 
Did you mean: 

event in wd abap

Former Member
0 Kudos

Hi,

i am having a event in component controller. event handler is made in first view.

Now how can i fire the event from second view, so that event handler in first view wil get trigered.

Regards,

Pankaj Aggarwal

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Pankaj,

When you have created the event handler in first view, you have to specify the event defined in the component controller.

Then in second view, just do the following to fire the event:


DATA lo_componentcontroller TYPE REF TO ig_componentcontroller .
  lo_componentcontroller =   wd_this->get_componentcontroller_ctr( ).

    lo_componentcontroller->fire_evt( ).

evt is the event name in the above code.

the event handler in the first view gets executed automatically when you fire the event.

Hope this helps!

Regards,

Srilatha

Former Member
0 Kudos

Hi,

I am not able to fire the event. the error i m getting is fire_event is not known. fire_event is the name for the event.

I can call the event handler with this piece of code if event handler is in component controller.

but my que is how can i fire the event of component controller if event handler is in view. Please suggest.

Former Member
0 Kudos

Hi pankaj,

To fire a event the syntax is

fire_<event_name>_evt() is the syntax.

So replace <event_name> with your event name in the controller.

IF it is from component controller then the code should be

wd_comp_controller->fire_fire_event_evt( ).

However the event handler should be active to listen and proceses this event.

Former Member
0 Kudos

Hi thanks it works fine..

one que i want to ask if there are 2 event handlers for a event in 2 differnent views and i fire the event now from third view..

then which event wil get trigered.

Former Member
0 Kudos

Hi,

My theory is that both events will be triggered but only the active view will handle the events. The order of processing is not reliable.

Why dont you try for it yourself and share your experience.

Goodluck with that.

Answers (0)