cancel
Showing results for 
Search instead for 
Did you mean: 

How to fire outbound plugs of a window?

Former Member
0 Kudos

I have a component which I want to re-use in applications. The component should have 2 outbound (interface) plugs which can be wired into parent applications. When the user clicks buttonA in the component it should fire outboundPlugA, likewise for buttonB we have outboundPlugB. My problem is that I can only seem to fire outbound plugs of the view and not of the window.

Until now, we've solved this by firing interface events of the component controllers but it seems plugs would be more elegant.

How does one fire outbound plugs of the window?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

If you want to fire a window plug from a view , just write the code in event handler.

Data:l_ref_test TYPE REF TO ig_<window name>.

*Create reference for of itself

l_ref_test = wd_this->get__<window name>_ctr( ).

*Call the exit plug of the window

l_ref_test->fire_<plug name>_plg( ).

Former Member
0 Kudos

OK, I've done what you said and have the following in the event handler (action of a button) in my view:


  DATA:l_ref_test TYPE REF TO ig_comp1_window.
  l_ref_test = wd_this->get_comp1_window_CTR( ).

The compiler error message is:

Method "GET_COMP1_WINDOW_CTR" is unknown or PROTECTED or PRIVATE.

This method does not exist as far as I can see.

Yashpal
Active Contributor
0 Kudos

Create the controller usage of window in the view ... in the property tab of view.. .then only u will be able to call the plug of window...

Data: lr_ref_ TYPE REF TO ig_<window name>.

lr_ref = wd_this->get__<window name>_ctr( ).

lr_ref->fire_<plug name>_plg( ).

Regards

Yash

Former Member
0 Kudos

Thanks, that solved it!

Apparently I still need to get used to this concept of "usage" everywhere!

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

As far as I am aware, you cannot directly fire an outbound plug of a window from a view. What you can do however is, define an inbound plug for the window. Create a navigation link between the outbound plug of the view and inbound plug of the window. Fire the outbound plug of the view. This will invoke the event handler of the inbound plug of the window. In the event handler method of the inbound plug of the view, fire the outbound plug of the window. This is a round-about way, but it should work.

Regards

Wenonah

Former Member
0 Kudos

This is convoluted but I am going to try it out. Surely there is a more elegant way of using plugs to communicate between components...

Edited by: Marc Cawood on Mar 12, 2008 9:58 AM

Former Member
0 Kudos

Hi,

please check [documentation|http://help.sap.com/saphelp_nw2004s/helpdata/en/99/ab034105d0f223e10000000a155106/frameset.htm] on Window Plugs.

grtz,

Koen

Former Member
0 Kudos

Koen: Thanks for the link. It does not seem to answer my specific question though: "How does one fire outbound plugs of the window?".

I now have implemented Wenonah's method where you fire a view's outbound plug which is wired to an inbound window plug wired to an outbound (interface) window plug . Is this correct or "orthodox" or is it more of a hack?