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

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?

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.

Similar Messages

  • How to create  in the Interface controller of a component

    Hi  Gurus............
    Could any one tel  How to create a method  in the interface controller of component
    and  use that componet  into other  comoponent as  Used Contoller .
    I  Found  following  Tutorial  but it was not cleared  Description.
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/2e71ce83-0b01-0010-11a4-98c28a33195f
    Thanks in Advance.

    Hi all,
    My actual requirement is as follows..
    I have implemented some functionality in One component .
    Here I  want to create a new method in the interface controller, so that I should be able to access this method in another component by declaring this component as used component in another one.
    My problem is, I am unable to create new method in interface controller of my component,
    It is appearing i n 'disabled' mode.
    Can any one please suggest me the appropriate solution?
    Thanks in advance
    SivaKumar

  • Calling a method in the view controller from the component controller

    Hi
    Is there anyway to call a method in the view implementation from the component controller??
    Thanks
    jack

    Thanks for all your replies. I want this kind of a functionality because Im trying to invove a DC (Child DC) from a Parent DC such that the Child DC's view is displayed onto the view container of the Parent DC. I have embedded using 'interface view of a component instance' in the Parent Window and am able to create the component and set usage though the onPlugDefault of the Child View.
    But I observe that when i make a call from the parent, the flow is like this:
    1. The wdDoInit of the Child Component Controller gets triggered first.
    2. Then the wdDoInit of the Child's <b>VIEW</b> gets triggered
    3. and <b>THEN</b> the onPlugDefault of the Child Component Interface View
    What I had actually wanted was to Fire onPlugDefault where Im calling a method LoadData(), after which the Child DC's view must be triggered so it can display the fetched data.
    What is actually happening is the view gets displayed, but no data is displayed in the view.
    Right now I have just given a work around where Im triggering <b>LoadData()</b> of the <b>COmponent COntroller</b> from the <b>wdDoInit</b> of the <b>VIEW</b>.
    Is there a better way to do this? I find it strange that I have to load the Data from the view.
    Thanks
    Jack

  • How to load DataBlock based on the Multiple Condition from another block

    Hi
    How to load a Data Block based on the Multiple values from another block. For eg.EMP is the Master Data block and SAL is the child Datablock.When query JOS% in the Master Block(EMP) then display all the Sal details in the SAL block for all the employees starting with JOS , When clicking one buton or if it is possible in the loadin of the MasterBlock

    Hi,
    I presume you are using database block relations.
    Put automatic query = yes in relation properties.
    Do you have block level trigger ON-POPULATE-DETAILS?
    In that you can find the relation and query - Using built-ins
    Find_Relation and Query_Master_Details

  • How do I call methods with the same name from different classes

    I have a user class which needs to make calls to methods with the same name but to ojects of a different type.
    My User class will create an object of type MyDAO or of type RemoteDAO.
    The RemoteDAO class is simply a wrapper class around a MyDAO object type to allow a MyDAO object to be accessed remotely. Note the interface MyInterface which MyDAO must implement cannot throw RemoteExceptions.
    Problem is I have ended up with 2 identical User classes which only differ in the type of object they make calls to, method names and functionality are identical.
    Is there any way I can get around this problem?
    Thanks ... J
    My classes are defined as followes
    interface MyInterface{
         //Does not and CANNOT declare to throw any exceptions
        public String sayHello();
    class MyDAO implements MyInterface{
       public String sayHello(){
              return ("Hello from DAO");
    interface RemoteDAO extends java.rmi.Remote{
         public String sayHello() throws java.rmi.RemoteException;
    class RemoteDAOImpl extends UnicastRemoteObject implements RemoteDAO{
         MyDAO dao = new MyDAO();
        public String sayHello() throws java.rmi.RemoteException{
              return dao.sayHello();
    class User{
       //MyDAO dao = new MyDAO();
       //OR
       RemoteDAO dao = new RemoteDAO();
       public void callDAO(){
              try{
              System.out.println( dao.sayHello() );
              catch( Exception e ){
    }

    >
    That's only a good idea if the semantics of sayHello
    as defined in MyInterface suggest that a
    RemoteException could occur. If not, then you're
    designing the interface to suit the way the
    implementing classes will be written, which smells.
    :-)But in practice you can't make a call which can be handled either remotely or locally without, at some point, dealing with the RemoteException.
    Therefore either RemoteException must be part of the interface or (an this is probably more satisfactory) you don't use the remote interface directly, but MyInterface is implemented by a wrapper class which deals with the exception.

  • Call method of interface controller from component controller

    hi,
    I have created one method in the interface controller of a component. Now i have this method along with attributes to the component controller. Now from the component controller i want to call the method of the interface controller. How do i do it???

    Hi,
    You dont need to call the method from the interface controller when you are in the same component.
    You can call the method which is in the component controller.
    Interface controller is used to expose some methods to a different component.
    Ex Comp a want to expose a method which will be used by comp b then  you need the interface controller in comp a.
    Comp b will use comp a as used component
    then it will invoke the methods.
    Regards
    Ayyapparaj

  • Public functions in the interface controller

    Hi all,
    My project includes 3 components. Each component has its own Iview and public functions.
    The application will run a main component that uses those 3 components.
    What is the right way to call the public functions?
    Should I announce them in the interface controller?
    Or should I use plugging for doing it?
    If I announce them in the interface controller, how I am calling them from the main component?
    Thanks,
    Noy

    I can't see the public function. I try to do:
    wdThis.wdGet<componentName>ComponentUsage().
    And
    wdThis.wdGet<componentName>ComponentUsage().getInterfaceController().
    To be clearer:
    I got 2 components: component A, which uses component B.
    Component B has a public function in the component controller called "func1". This function is also announced as a method in the interface controller.
    What I want to do is to call func1 from the component controller of component A.

  • Hi How do we create Methods inside the Business objects of Z

    Hi Abapers,
                        How do we create Methods inside the Business objects (z objects) and how *** an import parameter or export parameter  to be defined for the new Methods.
    Regards
    Bhaskar Rao.M

    Hi Bhaskar,
    that ´s not difficult.
    Open your Bus.Obj. in SWO1 with CHANGE/EDIT
    Click on the "Methods" header line and then use the button for "Create".
    If you want to add the method on basis of a function module, choose next in the next pop up. Then the system will offer you the ex/import parameter from the function module. So this is a really simple way.
    If you don´t have a FM, it is a little bit more difficult.
    Choose No on the quetion about a FM, fill in the next pop up  methode name (no blanks allowed).
    Dialogue is for user related method (call screen...) synchronous for methods which have to give back a result directly in to the workflow.
    After completing the screen the method will be displayed as new method at the end of method list. Now add parameters (first click on the method name, then choose parameter button, same functionality to add program to the method).
    Programm:
    Code snip:
    BEGIN_METHOD ZWFCHECKMIRO CHANGING CONTAINER.
    DATA:
          ZBELNR TYPE RBKP-BELNR,
          ZGJAHR TYPE RBKP-GJAHR,
          RESULT TYPE HRP1001-ISTAT,
          BELNR TYPE BKPF-BELNR,
          GJAHR TYPE BKPF-GJAHR,
          BUKRS TYPE BKPF-BUKRS.
    to import parameter
      SWC_GET_ELEMENT CONTAINER 'Zbelnr' ZBELNR.
      SWC_GET_ELEMENT CONTAINER 'Zgjahr' ZGJAHR.
    *(or SWC_GET_TABLE)
    here add the functionality of your method!
    to export parameter
    SWC_SET_ELEMENT CONTAINER 'Result' RESULT.
      SWC_SET_ELEMENT CONTAINER 'Belnr' BELNR.
    *(or SWC_SET_TABLE)
    !!! Important: naming convention!!! Use same writing of parameter names in
    PARAM area (button PARAMETER) and here in code.
    To use your method, change it to implemented after adding your code.
    -> Edit -> Change release status -> object type component -> into implemented
    (Sorry , have a german screen here, possibly terms are a little bit different.
    Hope this helps a little bit.!
    regards
    Dirk

  • How to call java method having array as argument from c++ ?

    Hello sir,
    how to call java method having array as arguments from c++;
    here is java code which is called from c++
    class PQR {
         public void xyz(int[] ia) {
         System.out.println("hi");
              for (int i = 0; i < ia.length; i++)
                   System.out.println(ia);
    suppose all jvm invocation is done...                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    For someone well versed in java, C++ and JNI although tedious that should be obvious.
    For someone not well versed in all three it is going to be very difficult.
    Even for someone that does have knowledge in all of those areas coming up with a C++ interface that reflects that functionality in a dynamic way such that anyone is will to use it is going to be quite an adventure.
    At any rate to start building it you do exactly the same thing that you would in java.
    1. Extract everything in the jar via the zip package
    2. For each found instance extract all of the methods, return types, parameters, etc and build a description tree for each class.
    Doing all of that in C++ is going to take a LOT of code. If someone wanted an estimate from me it would take me 6 months to do it. And before I would even attempt it I would get them to explain to me in detail exactly how they thought they were going to use it when I was done because I can't see any reasonable way to do that.
    I left out the description tree itself. I suppose you could duplicate the entire reflection api in C++.
    Now perhaps if it was much, much more constrained, like to only those classes that implement a single interface then that would be more reasonable.

  • How to call inner class method in one java file from another java file?

    hello guyz, i m tryin to access an inner class method defined in one class from another class... i m posting the code too wit error. plz help me out.
    // test1.java
    public class test1
         public test1()
              test t = new test();
         public class test
              test()
              public int geti()
                   int i=10;
                   return i;
    // test2.java
    class test2
         public static void main(String[] args)
              test1 t1 = new test1();
              System.out.println(t1.t.i);
    i m getting error as
    test2.java:7: cannot resolve symbol
    symbol : variable t
    location: class test1
              System.out.println(t1.t.geti());
    ^

    There are various ways to define and use nested classes. Here is a common pattern. The inner class is private but implements an interface visible to the client. The enclosing class provides a factory method to create instances of the inner class.
    interface I {
        void method();
    class Outer {
        private String name;
        public Outer(String name) {
            this.name = name;
        public I createInner() {
            return new Inner();
        private class Inner implements I {
            public void method() {
                System.out.format("Enclosing object's name is %s%n", name);
    public class Demo {
        public static void main(String[] args) {
            Outer outer = new Outer("Otto");
            I junior = outer.createInner();
            junior.method();
    }

  • Private method in the comp controller

    HI
    How do ui declare the private method in the componenet controller and declare the parameter one as the node and other as structure, when i click on methods tab it declears the public method with green logo in the implementation view, while i need to define a private method that should reflect with the red like logo in the outline view , when i click implementation tabr
    rgds
    Akeel

    you can write the private method in hte end of the implementation in the other hooks
    //@@begin others
    //write the code here
      //@@end
    Regards,
    Sarbjeet Singh

  • My Mac crashed. I got a new hard drive. I reinstalled Lightroom. Fortunately ircats are stored on an external drive. How do I import all of the old catalogues from external drive into a new LR catalogue. I have done it before. It has just been many years

    My Mac crashed. I got a new hard drive. I reinstalled Lightroom. Fortunately ircats are stored on an external drive. How do I import all of the old catalogues from external drive into a new LR catalogue. I have done it before. It has just been many years and I can't recall how.

    If you had stored your catalog files on an external drive, then all you have to do is double-click on them to open them and use them.
    Or you could move them to the internal drive and double-click on them once the move is completed.
    To create a single catalog file from multiple ones, you could use File->Import from Another Catalog

  • How can I erase (or remove) the hard drive from a dead Time Capsule?

    How can I erase (or remove) the hard drive from a dead Time Capsule?

    I found this having had the same problem...
    http://forums.macrumors.com/showthread.php?t=553818
    Having removed the hard drive I'm finding I can't reformat it. I manage to mount the HD but Disk Utility crashes when trying to format (HD attached to Mac via Newer Tech. SATA cables to USB) and causes what I think is a kernal panic on my Mac which hard crashes. I see 3 partitions when attempting to mount one of which is AFP. Anyone got any ideas about how to do this? I've dug around but the only progress I've made is to note others have had to work around ACL's when replacing the logic board of the TC. Not sure if this even relates to the problem. However the tool for doing this seems to have been removed from SL. (Forum references to this procedure all relate to 10.5).

  • How can i Flash and restore the firmware ( EFI ) from a Macbook pro ( late 2008 , 5.1 ) ??

    How can i Flash and restore the firmware ( EFI ) from a Macbook pro ( late 2008 , 5.1 ) ??
    Please help me !!

    The Seagate backup drive I bought doesn't support 10.5.8
    The only reason I can see for that is it's formatted NTFS, which would likely be Read Only in 10.5.x, if you can reformat it MacOS extended, which would erase everything on it now, then that should work for your purposes.

  • How can I copy and paste the art work from album covers?

    How can I copy and paste the art work from album covers?

    I don't think the list style transfers. Copy and paste the text in to Mail, select it and then choose "Insert Numbered List" as a work around.

Maybe you are looking for

  • How to fix black horizantal black lines on 2010macbook pro 17' screen?

    Hi everyone! I come to the community for help after  looking everywhere on the internet. I've had a problem now with my computer for a while where these strange black lines (always horizontal in nature) appear on my screen. I have two pictures below:

  • Conversion Exit Error?

    Hi Experts, I am loading data to Sap demo cube(Purschasing Data) from flat file,I am getting the following error CONVERSION_EXIT_CUNIT_INPUT for field BASE_UOM. The unit in T code CUNI it is ST and is items,but what changes do I need to do in Transfe

  • Classic OS 9/ 10.3.5

    Here is the scoop...Then my questions I have an iMac that can definetly run OS 9...but I am currently running 10.3.9 I got this computer from a friend and initially I was running OS 9 and then decided to upgrade to 10.3.9. Now I find I have some prog

  • How can I set up a smart album that looks for keywords?

    Hi everyone, I'm in the middle of a rethink on my image management and am wanting to setup smart albums that will search for and display images that have a certain keyword. When I create a new smart album to do this, I'm only given the ability to cho

  • Photo black cartridge life too short

    The photo black cartridge in the Photosmart 7525 has a very short lifespan compared to the other cartridges.  I rarely print photos.  Can this cartridge be bypassed to save on ink?