cancel
Showing results for 
Search instead for 
Did you mean: 

Interface Controller

Former Member
0 Kudos

Hi Friends,

how to call the methods in interface controller?

For Example:-

I have to comps:- COMP1, COMP2.

In COMP2, I have my execution method is there.

In this scenario how to Call the COMP2 method in COMP1.

Thanks & Regards,

Murali

Accepted Solutions (1)

Accepted Solutions (1)

lokesh_kamana
Active Contributor
0 Kudos

Hi,

Your requirement is to call comp1-->method in comp2. Below is the process to do it.

Step1:-

Comp1:-

Create a method in interface controller and add the component controller (Double click on component controller you find poperties tab.clcik on add and select the component controller in which your method is there).

Step2:-

Comp1:-

Call the method of the component controller(test is the method in comp controller) in the interface controller method created above.

Below is the code.


  public void test2( )
  {
    wdThis.wdGetComp1Controller().test();
  }

Step3:-

Comp2:-

Add the comp1 as used webdynpro component in comp2 and there by you create a component usage.

Step4:-

Comp2:-

Go to component controller and in required controller select under the component usage created the interface controller created by you and then you can call the method of the previous component.


    wdThis.wdGetComp1usageInterface().test2();

Note:-Since the only thing that will be visible outside the component is interface controller So we should make sure whatever the methods or context we require should be available with it.

Thanks & Regards,

Lokesh Kamana

Former Member
0 Kudos

Hi lokesh kamana,

My Requirement is how to call COMP2----> Method in COMP1, using interface controller.

Regards,

Murali

vijay_kumar49
Active Contributor
0 Kudos

Hi Murali,

One Web Dynpro Component may declare the use of another Web Dynpro Component to form a u201CParent-Childu201D usage relationship. In such cases, the only point of interaction between the parent and child components is the functionality found in the childu2019s interface controller.

For more information about Interface Controller [Please check this document|http://help.sap.com/saphelp_nw70/helpdata/en/42/baf70eb0731d69e10000000a1553f6/frameset.htm]

For more clarification please refer this link: [Web Dynpro Java Controller and Interface Concept|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/f0ba2c45-0518-2a10-73be-9b785e10aef1]

I hope this is help full for you,

Regards

Vijay

lokesh_kamana
Active Contributor
0 Kudos

Hi,

All the process holds good.

Just do the steps whatever i mentioned for step 1 & step2 -


>for component 2

and step3 & step4 --->for component1.

Note:-wherever i use comp1 make it comp2 and for comp2 make it comp1.

Let me know if you have any issues.

Thanks & Regards,

Lokesh Kamana

Former Member
0 Kudos

Hi Vijay,

Thanks for sending. Solved my problem.

These are help full documents.

Regards,

Murali

Answers (2)

Answers (2)

p330068
Active Contributor
0 Kudos

Dear Murali

As steted in the above response, if there is a method XYZ in the component controller then you call the method from interface controller XYZ in the same webdynpro component. In the same way you can access the interface controller method XYZ from another interface controller method say ABC then call ABC method of the intface controller from component controller.

Refer to [Inter Application Communication and Navigation (Design Time) in WebDynpro|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0ae5f90-1679-2c10-4183-8c64cf932088?quicklink=index&overridelayout=true]

Hope it will helps

Best Regards

Arun Jaiswal

junwu
Active Contributor
0 Kudos

add comp2 to comp1 as used component

wdThis.wdGet<UsageName>Interface().execution()

if you have issue with wdThis.wdGet<UsageName>Interface()

please add reference to comp2 in references tab of comp1