Syntax for how to call method of one comp in other comp     wd java.

Let us assume,
there is method1 in view1 comp1.
tell me syntax for calling method 1 in view2 comp2
thanks in advance.
Edited by: madhu1011 on Nov 9, 2011 11:31 AM

Hi Madhu,
This is the situation:
comp1-> method 1 , view1
comp2-> view2
You need to access method1  in view2 of comp2.
For that, do the following steps:
1.) First create a method (for eg: method1) in comp1 (under implementation of view1).
        eg: public void method1(){
                <......some logic...>
2.)Save the meta data.
3.) In comp2, you will find an option called used components. In that right click and add the component comp2. (Carefully select comp1 itslef).
4.)Save the meta data.
5.) Then go to view2 of comp2 and take implementaion part and right the following logic in wddoinit() (or any other standard or custom method).
wdThis.wdGetComp2Interface().getMethod("method1"); 
By this way, we can access the method1 of comp1 in comp2.
Regards,
Jithin

Similar Messages

  • How to Call Methods of one component into another Component

    Hi Experts,
    I have one requirement...
    I have 2 components A and B, i used A comp in B, i need to call Comp A methods in Component B, can anybody give me the syntax?? please...
    Thanks and Regards,
    Kissna.

    Hi Manas Thanks for your fast reply,
    My question is, for example we have wd_comp_controller or wd_this objects to call methods of view from view and comp controller right.. like this we have any methods to call used component methods? if yes can u please give me the objects syntax?...
    Thanks and regards,
    Kissna.

  • How to call method of one EJB3.0 project in another EJB3.0 project

    Hi,
    I would be thankful if someone could help me in this -
    I am using SAP Netweaver 7.2 and have two EJB3.0 projects.
    Now I am trying to instantiate a class of one EJB project into another and when I get a run time exception as -
    javax.ejb.EJBException: nested exception is: java.lang.RuntimeException: java.lang.NoClassDefFoundError
    I have tried to add it under the Java Build Path -> Projects but it only helps during compile time.
    I have also tried checking the projects under "Project References" but it still gives the same problem
    Here is the code and where exactly its failing -
    import java.util.ArrayList;
    import java.util.logging.Logger;
    import javax.ejb.ActivationConfigProperty;
    import javax.ejb.MessageDriven;
    import javax.jms.Message;
    import javax.jms.MessageListener;
    import org.csagroup.wsecomm.OrderSearch;
    import org.csagroup.wsecomm.SalesOrderSearchQueryInImplBean;
    import VendaOrders.ServiceClientImpl;
    import com.sap.scheduler.runtime.JobContext;
    import com.sap.scheduler.runtime.JobParameter;
    import com.sap.scheduler.runtime.mdb.MDBJobImplementation;
    import com.sap.xi.appl.se.global.SalesOrderID;
    * Message-Driven Bean implementation class for: HelloWorldBean
    @MessageDriven(
              activationConfig = {
                        @ActivationConfigProperty(propertyName = "messageSelector", propertyValue = "JobDefinition='HelloWorldJob'"),
                        @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue") })
    public class HelloWorldBean extends MDBJobImplementation {     
         * @see MessageListener#onMessage(Message)
         public void onJob(JobContext ctx) {
             Logger logger = ctx.getLogger();
             logger.info("Hello World Testing onJob().....");
             try
                  logger.info("Before Order Search...");
                  OrderSearch os = new OrderSearch();   *// this is where it fails*
                  logger.info("Before os...");
                  SalesOrderID salesOrderIdBeginRange = new SalesOrderID();
                  logger.info("Before salesOrderIdBeginRange...");
                  salesOrderIdBeginRange.setValue("1");
                  logger.info("After setValue(1)");
                  SalesOrderID salesOrderIdEndRange = new SalesOrderID();
                  logger.info("Before salesOrderIdEndRange");
                 salesOrderIdEndRange.setValue("99999");
                 logger.info("After 99999");
                 os.setBeginRange(salesOrderIdBeginRange);
                 os.setEndRange(salesOrderIdEndRange);
                 SalesOrderSearchQueryInImplBean salesOrderSearchQueryInImplBean = new SalesOrderSearchQueryInImplBean();
                 logger.info("After salesOrderSearchQueryInImplBean");
             } catch (Exception e){logger.info("Exception is...." + e.getLocalizedMessage());}
            // TODO Auto-generated method stub
    I am able to see the message in my logs till "Before Order Search.." and fails when I try to instantiate OrderSearch class which is in another EJB 3.0 project.
    Thanks for the help in advance.
    Edited by: Shiv Khullar on Aug 19, 2010 10:30 PM

    Hi,
    I am not sure if my posting was in readable format.
    As soon as try to add the code, all the formatting is lost.
    I would explain once again - My code is generated by the webservice "Generate Client code" i.e using WSDL into an EJB 3.0 Project. Now I am trying to call a method of the bean which takes a class object (OrderSearch) as the parameter.
    When I am trying to instantiate this OrderSearch class in my another EJB3.0 project its failing.
    Safter- Thanks for your reply but can someone help me who has worked on a similar issue.
    Thanks,
    Shiv

  • How to call method of one View into another view?

    Hi Gurus,
    I am having 2 views defined in a main window say view1 & view2 i have method get_data defined in view1 & now want to call it in view2.
    Is this possible?
    Can this is also possible if the 2 views belong to a different window?
    Regards
    Rahul

    Hi.
    what type of sample code do you need? You do already have the method.
    What ever you do in it do it in the component controller.
    when calling it from the view instead of wd_this->get_data call wd_comp_controller->get_data( ).
    What data do you fetch in this method?
    If you just read context data you have to put these nodes in the component controller context also to share it between multiple views.
    If you need more info just paste the code of the get data method and explain what you are doing in it.
    Cheers,
    Sascha

  • How to use method of one class in other class.

    Hi.I am new to object orient approach .I am developing a project which has a class as application .My class has it state control as another class which is notification class.I want to use my notification class method (init)in my application class method .i have also used read and write accessors vis.But i have broken lines in my code.Please help me correct it. and print screen is attached below.
    Attachments:
    Application.docx ‏143 KB

    On the left, you have wired 2 sources on the same tunnel/wire, so that's 1 broken wire.
    In the For loop, you are trying to wire a "Red" object from the first subVI to the input of the "Green" subVI, so a "Green" object. If Red is not a descendant class of Green (or share a common ancestor), it is not permitted.
    FInally, the output of the For loop, is a 1D array of "Green" objects, which is probably not the same data type as the input of the last subVI on the right (it's probably a "Green" object scalar).
    Overall, you can use the "List Errors" dialog box (Ctrl+L) to debug your code, and make exhaustive use of the contextual help (Ctrl+H) to see what is going on when focusing a broken wire.
    Regards
    Eric M. - Application Engineering Specialist
    Certified LabVIEW Architect
    Certified LabWindows™/CVI Developer

  • How to call  a method of one view in other view

    Hi
      could any one suggest "how to call  a method of one view in other view "
    thanks
    kaushik

    Hi Kausic,
    Its not possible to call a method from view to View.
    Since view is private entity we can not pass the data directly.
    I suggest you to declare the method in Component/Custom controller and call.
    the code is,
    wdThis.wdGet<Component/Custom Name>Controller().<methodName>();
    Regards,
    <b>Ramganesan K</b>

  • Can I Call method on one JVM from another through a dll?

    Let me explain.
    I have this java jar file that I can only have one instance of running at any given time. I'm using a shared data segment in a dll to store a bool indicating whether the program is already running or not. If it's already running, I have to not run the second instance and give focus to the current running instance.
    The jar file calls a native method "canInstantiate()" on a dll to see if there's already an app running. If there isn't, the env and obj are stored in the shared data segment of the dll and we return true. If there is already an instance of the program running, I want canInstantiate call a function on the current instance of the jar (like a callback) to tell it to request focus. It's not working. Can someone tell me if my code is right?
    The .h file
    #include "stdafx.h"
    #include <jni.h>
    #include "CardServer.h"
    #pragma data_seg("SHARED") // Begin the shared data segment.
    static volatile bool instanceExists = false;
    static JavaVM *theJavaVM = NULL;
    static JNIEnv* theJavaEnv= NULL;
    static jobject instanceObject = NULL;
    static jmethodID mid = NULL;
    static jclass cls = NULL;
    #pragma data_seg()
    #pragma comment(linker, "/section:SHARED,RWS")
    jdouble canInstantiate(JNIEnv *env, jobject obj);
    jdouble instantiate(JNIEnv *env, jobject obj);
    jdouble uninstantiate(JNIEnv *env, jobject obj);
    void grabFocus();
    </code>
    The .cpp file:
    <code>
    #include "MyFunctions.h"
    #include <string.h>
    #include <stdlib.h>
    #include "stdafx.h"
    #include <iostream.h>
    jdouble canInstantiate(JNIEnv *env, jobject obj)
    printf("In canInstantiate!!");
    if (!instanceExists)
    printf("No instance exists!!");
    return (jdouble)0.0;
    else
    printf("An instance already exists!!");
    grabFocus();
    return (jdouble)1.0;
    jdouble instantiate(JNIEnv *env, jobject obj)
    printf("**In CPP: Instantiate!!\n");
    cout << "At start, env is: " << env << endl;
    cout << "At start, obj is: " << obj << endl;
    if (instanceExists == false)
    instanceExists = true;
    theJavaEnv = env;
    instanceObject = obj;
    theJavaEnv->GetJavaVM(&theJavaVM);
    cls = (theJavaEnv)->FindClass("TheMainClassOfTheJar");
    if (cls == 0) {
    fprintf(stderr, "Can't find Prog class\n");
    exit(1);
    mid = (theJavaEnv)->GetMethodID(cls, "grabFocusInJava", "(I)I");
    if (mid == 0) {
    fprintf(stderr, "Can't find grabFocusInJava\n");
    exit(1);
    printf("About to call grabFocusInJava\n");
    grabFocus();
    printf("CPP: After the grab focus command in instantiate!!\n");
    cout << "At end, env is: " << env << endl;
    cout << "At end, obj is: " << obj << endl;
    return 0.0;
    else
    printf("CPP: Finished Instantiate!!\n");
    return 1.0;
    jdouble uninstantiate(JNIEnv *env, jobject obj)
    printf("CPP: In uninstantiate!!\n");
    if (instanceExists == true)
    instanceExists = false;
    theJavaVM = NULL;
    instanceObject = NULL;
    printf("CPP: Finishing uninstantiate!!\n");
    return 0.0;
    else
    printf("CPP: Finishing uninstantiate!!\n");
    return 1.0;
    void grabFocus()
    printf("In CPP::GrabFocus!!\n");
    instanceObject = theJavaEnv->NewGlobalRef(instanceObject);
    cls = (theJavaEnv)->FindClass("CardFormatter");
    if (cls == 0) {
    fprintf(stderr, "Can't find Prog class\n");
    exit(1);
    printf("Got the cls id again!!\n");
    if (cls == 0)
    printf("IT'S INVALID!!\n");
    mid = (theJavaEnv)->GetMethodID(cls, "grabFocusInJava", "(I)I");
    if (mid == 0) {
    fprintf(stderr, "Can't find grabFocusInJava\n");
    exit(1);
    theJavaEnv->CallIntMethod(instanceObject, mid, 2);
    printf("Called grabFocusInJava\n");
    </code>
    thanks in advance

    Can I Call method on one JVM from another through a dll
    ...The rest of your question merely expands on your title.
    And the answer to that question is no.
    When you call a method you are executing a "thread of execution." A thread of execution exists only in a single process. It can not exist in another process.
    If the dll is doing some interesting things then you could call a method that sets a flag. Data can move between instances. But you would then have to have a thread in that different process monitoring that flag. And sharing data in a dll is not a normal process, so it would have to be coded appropriately.
    If all you want to do is set the current focus to the existing application, then that can be done with existing windows functionality. You don't need to do anything special in your dll. You can probably search these forums to find the exact code. If not there are countless examples in windows repositories (like MSDN) on how to do that.

  • How to call more then one Function modules at the same time

    HI ,
    How to call more then one FM at the same time .
    Modertor Message: Interview-type Questions are not allowed.
    Edited by: kishan P on Jan 2, 2012 2:22 PM

    They are a few different models of the MacBook Pro ranging from 15.4" i7's to 17" i7's. I would use the same models together though when imaging them just like I do with PC's. For example I would Ghost 5 Lenovo T420 Thinkpads at the same time which all share the same exact specs and config. Looking to do the same with the MBP. I have .dmg image of OSX 10.8.1 on a firewire drive which I'm using. I image all my MBP's with this drive, the only downside is I have to do each MBP one at a time.
    Thanks

  • How to call method of Component A in Component B

    Hi Friends,
    I want to use Method A of Component A in Component B. Can some one tell me how to call method A on action of a button in component B.
    Regards
    Sankar

    Hi,
      DATA lo_cmp_usage TYPE REF TO if_wd_component_usage.
      lo_cmp_usage =   wd_this->wd_cpuse_method( ).
      IF lo_cmp_usage->has_active_component( ) IS INITIAL.
        lo_cmp_usage->create_component( ).
      ENDIF.
    DATA lo_interfacecontroller TYPE REF TO yiwci_sg_method .
    lo_interfacecontroller =   wd_this->wd_cpifc_method( ).
      lo_interfacecontroller->execute_method(
           i was able to do the above process successfully but how to bind data to the node of component 2.
    In the component 1 : method A i defiend to get records upto 25 rows. now i tried using same method . but how to bind data using this method
    Regards
    sankar

  • How to Call Methods in Ecatt?

    Hello Gurus,
    I dont find CALLMETHOD or CALLSTATIC commands in Ecatt. I am using R/3 4.7 version of SAP.
    My question also is how to call methods. I have a scenario where my test script execution depends on the return type of method. Say if the return type of method is A only then I should run the script else the script should not be executed.
    Your help in this regard is highly appreciated.
    Regards,
    GS.

    >
    Get Started wrote:
    > Hello Gurus,
    >
    > I dont find CALLMETHOD or CALLSTATIC commands in Ecatt. I am using R/3 4.7 version of SAP.
    >
    > My question also is how to call methods. I have a scenario where my test script execution depends on the return type of method. Say if the return type of method is A only then I should run the script else the script should not be executed.
    >
    > Your help in this regard is highly appreciated.
    >
    > Regards,
    > GS.
    Hi GS,
    Please use the command "CallMethod" and it is available with latest SAP version.
    You have to provide the Object Instance Parameter and Instance Method.
    Regards,
    SSN.

  • Is there any way to call methods of one view from another

    Hi experts,
    I am new to webdynpro.I am having some requirement in which I need to call methods of one view from some other view of same component .So is there any way to do this.

    Dear Pradeep,
    This will solve your problem......( plz 1st read everything ..)
    There are 2 views  :
    i) Mandatory Attributes ' view(V1)
    ii) Button' s  View..(V2)
    1. Create a method in Component Controller.( M1).
    2. Goto V2 . In the Action Handler method of Button , call method  M1 of component controller.
    3. Write your Code in M1 instead of  V2 method.
    4. Create an EVENT ( E1 ) in component controller.
    5. Fire this event  from M1 before executing Action Code.
    6. Now  Add the event handler method of  E1 in  V1 ( i.e. Mandatory attributes view. )   ..........clear????? .. set "METHOD TYPE" = Event Handler. instead of  Method.
    7. In this event handler method in V1 , write the "check_mandatory_attribute_view" method.
    8. use necessary flags..
    Regards ,
    Aditya.

  • How to call methode on remot computer

    I have 2 Applcations on 2 computers in Network
    App 1 on PC1 send xml file to App2 on PC2
    how to call Methods in App2 on PC2 to read the file
    // clss A on PC1
    class A
    sendFile(){
    // clss B on PC2
    class A
    readFile(){
    how to cal method readFile from Class A on PC1

    By using Remote Method Invocation, the topic of this forum.
    See the Javadoc and the RMI tutorials.

  • How to copy data from one column to other column

    hi,
    can any one tell me how to copy data of  one column to other column for some specific data
    example
    productno  ocalyear        actualsales  prevplansales   currentplansales
    p001       2007                  100              120                   
    p002       2007                   90               100
    p003       2007                  120              130
    p004       2007                  140              120
    p005       2007                  150              150
    i want to copy data of p001 and p002 from prevplansales to current plansales
    productno  ocalyear        actualsales  prevplansales   currentplansales
    p001       2007                  100              120              120     
    p002       2007                   90               100              100
    p003       2007                  120              130
    p004       2007                  140              120
    p005       2007                  150              150
    is it possible to do?
    please suggest me.
    i will assign points

    Hi,
    I think the needed techniques are already described in the documentation, e.g. in
    http://help.sap.com/saphelp_nw70/helpdata/en/45/e641e4c61256dee10000000a114a6b/frameset.htm
    or
    http://help.sap.com/saphelp_nw70/helpdata/en/45/e641e4c61256dee10000000a114a6b/frameset.htm
    The main techiques used in the above example to bind the filter of the planning function to selected (marked) objects in the analysis item or to drop down boxes (or both). These techniques are used in the above examples.
    Regards,
    Gregor

  • How to move table from one tablespace to other tablespace?

    how to move table from one tablespace to other tablespace?

    887274 wrote:
    how to move table from one tablespace to other tablespace?
    alter table <table_name> move  tablespace <new_tablespace_name>;
    Rebuild the indexes; alter index <index_name> rebuild <new_tablespace_name> online;Example;:
    SQL> create table ttt( ID NUMBER PRimary key);
    Table created.
    SQL> insert into ttt values (1);
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select index_name, status  from dba_indexes where table_name='TTT';
    INDEX_NAME                 STATUS
    SYS_C0010863                 VALID
    SQL> alter table ttt move tablespace users;
    Table altered.
    SQL> select index_name, status  from dba_indexes where table_name='TTT';
    INDEX_NAME                 STATUS
    SYS_C0010863                 UNUSABLE
    SQL> alter index SYS_C0010863 rebuild tablespace users online;
    Index altered.
    SQL> select index_name, status  from dba_indexes where table_name='TTT';
    INDEX_NAME                 STATUS
    SYS_C0010863                 VALID
    SQL>

  • How do I switch to one of my other backups?

    How do I switch to one of my other backups?

    Can you explain what you mean by want to switch to another backup?  Are you trying to restore a backup?

Maybe you are looking for

  • Help!!!! Does anyone know how to fix this problem?

    Hi, everytime I open the software Serato Scratch Live or Traktor a problem appears. I'm not able anymore to open Serato and Traktor software and yesterday Skype crashed too. This is the problem of Serato. Please help me! Process:         Scratch LIVE

  • Missing Instruments in Loops

    I am using Soundtrack Pro in Final Cut Studio 2. The instruments are missing from my loops. It seems the other sound effects and music cues are present (although, I've never seen a list of what, precisely is supposed to be included -- anyone know?).

  • VIEW CUSTOMER ADDRESS DETAILS IN REPORT (TABULAR) FORMAT

    When maintaining the Customer Master, General Details such as Customer Name, Search Term, Address, City, Postal Code, Country, Telephone No, Email etc are updated in the General Data screen that is stored in KNA1. When I run report for KNA1 in SE16 -

  • Index.xml is missing in numbers file

    I am trying to open a file that I created and worked on for long time month ago and now it's saying its invalid and can't be open, saying that index.xml is missing, how can I fix it? Please help me it's an important file and contains very important i

  • How to attach PDF file to product catalog in Internet Sales R/3

    Hi Experts, We are implementing SAP E-Commerce (Internet Sales) for mySAP ERP or SAP R/3, release 5.0. I need to attach a PDF file to the product in the product catalog of the Web Shop. Some where in the documentation I have read that itu2019s possib