cancel
Showing results for 
Search instead for 
Did you mean: 

How to consume a method on the interface controller from another component?

Former Member
0 Kudos

Hello,

I have a project which contains two Components, A & B.

I have exposed a method at the interface controller of Component A. How can I consume it from Component B?

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

First add ComponentA as a used webdynpro component in ComponentB. Then open the Interface Controller of B and switch to Properties Tab. Select Add in the "Required Controllers" section. From the dialog that appears, select A's interface controller. Then you can access A's method from B's interface controller as:


wdThis.wdGetAComponentInterface().<method>;

Regards,

Satyajit.

Former Member
0 Kudos
vijayakhanna_raman
Active Contributor
0 Kudos

Hi,

Declare A it as a used component in B.

Add the interface controller A to the properties tab where ur consuming the method i.e view or controller of B.

Access it by

wdThis.wdget<interfacecontroller A>.methodname();

Regards,

Vijayakhanna Raman

thomas_szcs
Active Contributor
0 Kudos

Hi Roy,

You define a component usage to B from component A. Then retrieve the pointer to the component interface of B and call the method. In WD ABAP, there is a wizard that generates code to call a method of another component.

Best regards,

Thomas

Former Member
0 Kudos

Hey Thomas,

I was already able to solve it on my own but you preceded me with your quick answer. Anyway, thank you for the reply. By the way, before adding it to the properties one must add component A as used component in Component B.

Former Member
0 Kudos

Well, now I see more responses, thank you all for your quick replies...:)