How to invoke a RFC with JCo

hello,
    I want to invoke a function through jco. The parameter of the function is a table. I do not know how to pass the table parameter to the function. Do I need to use the Claa JCO.MetaData. Would you please give me a example? Thanks!

Hi,
Have you read the documentation ([SAP JCo Client Programming|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/35/42e13d82fcfb34e10000000a114084/frameset.htm])? There is a page about [Table Manipulation|http://help.sap.com/saphelp_nw70ehp1/helpdata/en/35/42e13d82fcfb34e10000000a114084/frameset.htm].
Regards,
Pierre

Similar Messages

  • Urgent please ! How to invoke java method with diffrent argument types?

    Hi,
    I am new to JNI.
    I had gone through documentation but it is not of much help.
    Can any one help me out how to invoke the below java method,
    // Java class file
    public class JavaClassFile
    public int myJavaMethod(String[] strArray, MyClass[] myClassArray, long time, int[] ids)
    // implementation of method
    return 0;
    // C++ file with Invokation API and invokes the myJavaMethod Java method
    int main()
    jclass cls_str = env->FindClass("java/lang/String");
    jclass cls_MyClass = env->FindClass("MyClass");
    long myLong = 2332323232;
    int intArray[] = {232, 323, 32, 77 };
    jclass cls_JavaClassFile = env->FindClass("JavaClassFile");
    jmethodID mid_myJavaMethod = env->GetMethodID( cls_JavaClassFile, "myJavaMethod", "([Ljava/lang/String;[LMyClass;J[I)I");
    // invoking the java method
    //jint returnValue = env->CallIntMethod( cls_JavaClassFile, mid_myJavaMethod, stringArray, myClassArray, myLong, intArray ); --- (1)
    //jint returnValue = env->CallIntMethodA( cls_JavaClassFile, mid_myJavaMethod, ...........); --- (2)
    //jint returnValue = env->CallIntMethodV( cls_JavaClassFile, mid_myJavaMethod, ...........); --- (3)
    Can any one tell me what is the correct way of invoking the above Java method of (1), (2) and (3) and how ?
    The statement (1) is compilable but throws error at runtime, why ?
    How can I use statements (2) and (3) over here ?
    Thanks for any sort help.
    warm and best regards.

    You are missing some steps.
    When you invoke a java method from C++, the parameters have to be java parameters, no C++ parameters.
    For example, your code appears to me as thogh it is trying to pass a (C++) array of ints into a java method. No can do.
    You have to construct a java in array and fill it in with values.
    Here's a code snippet:
    jintArray intArray = env->NewIntArray(10); // Ten elments
    There are also jni functions for getting and setting array "regions".
    If you are going to really do this stuff, I suggest a resource:
    essential JNI by Rob Gordon
    There is a chapter devoted to arrays and strings.

  • How to invoke a function with arguments in JSTL expressions

    Hi ,
    I want to know how to send arguments in the JSTL expression.
    I have a scenario like this
    for (int i=0; i<nicList.size(); i++)
                          NavigationItemControl nic = nicList.get(i);
                          ni = nic.getNavigationItem();
                          //scr
                          if (nic.isAvailable(Mask.SYSTEM))
                          { %>
                            <option value="<%=ni.getInternalHandle()%>"  <% if(pi.getNavigationItemHandle().equals(ni.getInternalHandle())) {%>selected<%}%> ><%=nic.getLabel()%></option>
                          <%
                        }   I was changed these code into JSTL ,the new one is
    <c:forEach var="nic" items="${nicList}">                                             
                                                 <c:set var="ni" value="${nic.navigationItem}"/>
                                                 <c:set var="nicAvailableMaskSystem" value="${*nic.available*}"/>
                                                 <c:set var="navigationItemHandle" value="true" />                                             
                                                      <c:if test="${nicAvailableMaskSystem}">
                                                           <option <c:if test="${pi.navigationItemHandle==ni.internalHandle}">  selected </c:if> value="${ni.internalHandle}" >
                                                                     ${nic.label}
                                                           </option>
                                                      </c:if>
                                            </c:forEach>in the above code I have problem with nic.isAvailable(Mask.SYSTEM),
    Can any one help me on this how can I invoke a function in JSTL with arguments.
    -Bhaskar

    JSTL can only handle getter/setter methods. You can't pass parameters to the methods.
    There are a couple of ways around this
    1 - set up "mask" as a seperate attribute of the NavigationItemControl bean.
    ie getMask() setMask()
    and then have your isAvailable method as
      public boolean isAvailable(){
        return internalIsAvailable(getMask());
      }Another solution is to define a static function and invoke it as a function.
    public static boolean navigationAvailable(NavigationItemControl, Mask);
    What does the isAvailable() method do? How complicated is it?
    Hope this helps,
    evnafets

  • How to invoke Dictation & Speech with a keyword

    Hello,
    In Yosemite command and control Speech functionality (found under Accessibility in Mavericks, and called Speakable Items) has been combined with Dictation & Speech control panel. I like what has been done mostly. However it's caused me a new challenge I'm not sure how to solve. Let me explain.
    Since Snow Leopard I've used the command and control Speech functionality in OS X. It was very useful to me because I could invoke it by just prefixing the command I wanted executed with a keyword. For example I could say: Computer Apple Menu to open the Apple Menu, Computer Microphone On (to execute an AppleScript I wrote to turn the Dragon Dictate microphone on).
    Executing custom commands is still possible in Dictation & Speech. What doesn't appear to be possible, or at least I can't find it, is a way to invoke the speech command using a keyword (i.e., hands-free). You apparently now have to do some sort of shortcut to activate Speech. That involves a keyboard or mouse action. I haven't found anywhere to use a custom keyword or phrase.
    This is a problem for me because I am physically disabled. Paralyzed from the neck down. If I'm sitting in my wheelchair I could pick up my mouthstick and do one of the keyboard shortcuts. However, I don't always have access to my mouthstick. Sometimes I'm using my computer from bed by voice only. It appears with this new system without a keyword to invoke things, I'm out of luck.
    If I have missed something, or you have an idea for a workaround, please let me know.
    Thanks...
    Todd

    Hello,
    In Yosemite command and control Speech functionality (found under Accessibility in Mavericks, and called Speakable Items) has been combined with Dictation & Speech control panel. I like what has been done mostly. However it's caused me a new challenge I'm not sure how to solve. Let me explain.
    Since Snow Leopard I've used the command and control Speech functionality in OS X. It was very useful to me because I could invoke it by just prefixing the command I wanted executed with a keyword. For example I could say: Computer Apple Menu to open the Apple Menu, Computer Microphone On (to execute an AppleScript I wrote to turn the Dragon Dictate microphone on).
    Executing custom commands is still possible in Dictation & Speech. What doesn't appear to be possible, or at least I can't find it, is a way to invoke the speech command using a keyword (i.e., hands-free). You apparently now have to do some sort of shortcut to activate Speech. That involves a keyboard or mouse action. I haven't found anywhere to use a custom keyword or phrase.
    This is a problem for me because I am physically disabled. Paralyzed from the neck down. If I'm sitting in my wheelchair I could pick up my mouthstick and do one of the keyboard shortcuts. However, I don't always have access to my mouthstick. Sometimes I'm using my computer from bed by voice only. It appears with this new system without a keyword to invoke things, I'm out of luck.
    If I have missed something, or you have an idea for a workaround, please let me know.
    Thanks...
    Todd

  • JCO3 Server: How to invoke a RFC callback to client

    Dear Community,
    i have created a working jcoserver program.
    Now this program needs additional information from client (in this case a sap-system).
    In classic RFC Lib and in Netweaver RFC SDK i can find some samples how to do this.
    Look here:
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5070f62a-6acd-2c10-8cb5-858ef06adbb9?QuickLink=index&…
    Page 10-12 and Page 16 contain information how to do this.
    But i can't find anywhere an example for JCO3 or a documentation.
    Is someone able to point me into the right direction or has a working code-snipplet?
    Kind Regards,
    Tom

    Hi Markus,
    oh, that is to easy, As i'm converting from Classic-C such easy ways are simply overlooked.
    Correct code is then:
    //JcoFunctionTemplate "temp" is initialized before
    JCoFunction func = temp.getFunction();
      func.execute ( JCoDestinationManager.getDestination ( "BACK" ) );
    right?
    Thank's a lot Markus, you helped me very much!
    Is there any documentation where one can find out about such build ins ?
    Not only related to JCO, similar for build in rfc function in server programs like RFC_DOCU and so on ?
    Best regards,
    Tom

  • How to invoke a WebService with more than 1 value in parameter?

    I have a webservice, with a request parameter as an Array of String.
    In an invoing xml it should looks like:
    <GetPersonsData_Request>
    <request>
    <PersonIdList>
    <string> 111 </string>
    <string> 222 </string>
    <string> 333 </string>
    </PersonIdList>
    A problem i have:
    How I can to assign a differents values to this list?
    i assigned first element directly and then tried to add a new one with append:
    <bpelx:append>
    <bpelx:from>'12345'</bpelx:from>
    <bpelx:to>$GetPersonsData_Request.parameters/ns2:request/ns5:PersonIdList</bpelx:to>
    </bpelx:append>
    I receive:
    <GetPersonsData_Request>
    <request>
    <PersonIdList>
    <string> 111 </string>
    '12345'
    </PersonIdList>
    </request>
    Its added as a single string, no as a Structure Element.
    What i missed???

    ok, i tried.
    add a new string type variable:
    <variable name="string" element="ns6:string"/>
    next assigned to $string my text and tried to append it to list:
    <bpelx:append>
    <bpelx:from>$string</bpelx:from>
    <bpelx:to>$GetPersonsData_Request.parameters/ns2:request/ns5:PersonIdList</bpelx:to>
    </bpelx:append>
    and as a result i receive a correct structure:
    <GetPersonsData_Request>
    <request>
    <PersonIdList>
    <string> 111 </string>
    <string> 12345 </string>
    </PersonIdList>
    </request>
    BUT!!! When i next use a countNode:
    <assign name="ac">
    <copy>
    <from>ora:countNodes('GetPersonsData_Request','parameters','ns2:request/ns5:PersonIdList/ns8:string') - it shows me 1 !!!
    <to>$counter</to>
    </copy>
    In EM:
    Updated variable "counter"
    <payload>
    <counter>
    <counter xsi:type="def:int">1</counter>
    </counter>
    Why???
    Is it really correct example and it should to work?

  • How to invoke we service with utl_dbws?

    How do you call a web service from utl_dbws?

    There's an example in the Callout download.
    You can also read about it here:
    http://www.oracle-base.com/articles/10g/utl_dbws10g.php
    here: http://www.orafaq.com/maillist/oracle-l/2005/03/17/0742.htm
    and here: http://download.oracle.com/owsf_2003/40064.ppt

  • How to invoke action class with in a function in jsp in struts

    ex
    if(condion)
    we have to use tag
    window.location="example.do";
    thank u
    sreevatsa adiraju

    hi,
    if that condition is like validation means, better to use client side script to execute when your condition is satisfied....
    if my above answer is not satisfied to you means,,
    post your code & ask in that...

  • Invoking an rfc from a repository filter

    Hi,
    I have to invoke an ABAP rfc from a repository filter.
    To invoke an rfc using JCo or Connector Framework, we need the "request (of type IPortalComponentRequest)" object.
    Is this object available with in the filter?
    Or is there any other way to invoke an rfc from a Repository Filter?
    Kindly help me.
    Thanks and regards
    RB

    The notion of "IPortalComponentRequest" makes no sense withing a repository filter.
    Imagine a repository manager which is queried by some automatically running tasks on the server (e.g. nightly created reports). You don't have something like a request there!
    I don't know rfc, so there might be other options which don't need the request.
    Regards,
    Dieter

  • How to invoke JavaScript for Premiere Pro CC?

    Hi,
    I am new to Adobe CC products/scripting and I'm trying to control Adobe Premiere Pro CC from another desktop application. Using ExtendScript Toolkit, from its UI, I can invoke JavaScript commands or files.
    But I can't find any way for my desktop application to invoke JavaScript commands. I can't seem to find any command line tool for it (no documentation either and JavaScript doesn't seem to be officially supported). Any help regarding this would be greatly appreciated.
    I tried using the Socket object on a .jsx file to act as a server (to listen for commands from my desktop application) and placing it on the common startup script folder. But the start up script blocks the UI of the Premiere Pro application entirely (even if I use "$.sleep(milliseconds)" function in between  the "poll" function for acquiring a connection). This wouldn't work for my application as I can't block the UI.
    For After After Effects CC, I can use the "afterfx.exe" on Windows and AppleScript with "DoScript" command on Mac, to execute JavaScript expressions or files. But this doesn't seem to work with Premiere Pro or any Adobe CC products. For Photoshop, I can just open any .jsx file with Photoshop (for e.g. "Open With") and it runs the .jsx file. But this technique doesn't work with all the other Adobe CC products (even the ones which support JavaScript officially).
    According to Adobe Premiere Pro developer centre, there is no mention of any JavaScript support. But since the functionality does seem to be there (as discovered through ExtendScript Toolkit), I am hoping I can get away just by using JavaScript commands to control Premiere, as opposed to using the native SDK for Plugins. However, I really hope Adobe Premiere Pro folks are seeing this and they officially support JavaScript soon .
    Thanks for your help.

    Hi all,
    Any help? Seems that the general Adobe Premiere forum is a lot more active in terms of responses. That is why I originally kept in the general forum at first.
    Due to the lack of documentation, I ended up spending even more time just to figure out how to invoke Premiere Pro with a JavaScript file, from the command line. But no luck still . Any advice would be greatly appreciated.
    Thanks.

  • How to invoke RFC function module from XI interface

    Hi all,
    I am having one question, How to invoke RFC function module from XI interface.
    Please reply me as soon as possible.
    Thanks in advance,
    Radhika

    Hi,
    To call the RFC in mapping u need to create the RFC lookups...check these links.
    How we have to create the lookups?
    Check this weblogs with some screenshots on how to achieve this:
    /people/siva.maranani/blog/2005/08/23/lookup146s-in-xi-made-simpler
    /people/sravya.talanki2/blog/2005/12/21/use-this-crazy-piece-for-any-rfc-mapping-lookups
    /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    /people/sap.user72/blog/2005/12/06/optimizing-lookups-in-xi
    /people/morten.wittrock/blog/2006/03/30/wrapping-your-mapping-lookup-api-code-in-easy-to-use-java-classes
    lookups in xi
    XI Design Guidelines
    Re: RFC Lookup API
    /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a03e7b02-eea4-2910-089f-8214c6d1b439
    Regards,
    Phani

  • How do you invoke a method with native int array argument?

    Hi,
    Will someone help me to show me a few codes samples on how to invoke a method which has only one argument, an int [] array.
    For exampe:
    public void Method1(int [] intArray) {...};
    Here is some simple code fragment I used:
    Class<?> aClass = Class.forName("Test2");
    Class[] argTypes = new Class[] {int[].class};
    Method method = aClass.getDeclaredMethod("Method_1", argTypes);
    int [] intArray = new int[] {111, 222, 333};
    Object [] args = new Object[1];
    args[0] = Array.newInstance(int.class, intArray);
    method.invoke(aClass, args);I can compile without any error, but when runs, it died in the "invoke" statement with:
    Exception in thread "main" java.lang.IllegalArgumentException: object is not an instance of declaring class
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
         at java.lang.reflect.Method.invoke(Unknown Source)
         at Test1.invoke_Method_1(Test1.java:262)
         at Test1.start(Test1.java:33)
         at Test1.main(Test1.java:12)
    Any help is greatly appreciated!
    Jeff

    Sorry, my bad. I was able to invoke static methods and instance methods with all data types except native int, short, double and float, not sure the proper ways to declare them.
    After many frustrating hours, I posted the message for help, but at that time, my mind was so numb that I created a faulted example because I cut and pasted the static method invocation example to test the instance method passing int array argument.
    As your post suggested, "args[0] = intArray;", that works. Thanks!
    You know, I did tried passing the argument like that first, but because I was not declaring the type properly, I ended up messing up the actual passing as well as the instantiation step.
    I will honestly slap my hand three times.
    jml

  • How can I retrieve a List of BAPIs with JCO?

    Hello!
    I want to retrieve a list of BAPIs in Java. Does anyone have a code sample how to do this with JCO and SWO_QUERY_API_METHODS?
    Regards,
    Jan

    Hi Diana,
    I've written a small example here (refresh my rusty JCo!) which returns just the function names in a Vector.
    Hope this helps,
    Gregor
    * Fetch a list of BAPIs
    * @author Gregor Brett
    import com.sap.mw.jco.*;
    import java.util.*;
    public class GetBapis
       private JCO.Client client;     
       private JCO.Repository repository;
       private Vector bapis;
       public GetBapis()
          try
             client = JCO.createClient("CLIENT","USERNAME","PASSWORD","EN","SERVERNAME","00");
             client.connect();
             repository = new JCO.Repository("Gregor", client);
               IFunctionTemplate ftemplate = repository.getFunctionTemplate("SWO_QUERY_API_METHODS");
               JCO.Function function = ftemplate.getFunction();
               client.execute(function);
                JCO.Table table = function.getTableParameterList().getTable("API_METHODS");
                bapis = new Vector();
             do
                JCO.Field functionName = table.getField("FUNCTION");
                   bapis.add(functionName.getString());
               while(table.nextRow());
          catch(Exception e)
             System.out.println("Error: " + e.getMessage());
             e.printStackTrace();
       public Vector getBapiList()
               return bapis;
       public static void main(String[] args)
               GetBapis gb = new GetBapis();
               Vector v = gb.getBapiList();
               System.out.println("Fetched " + v.size() + " BAPIs.");

  • How to invoke crystal reports from Oracle forms 11g R2 along with passing p

    How to invoke crystal reports from Oracle forms 11g R2 along with passing parameter to it.
    how to pass parameters to crystal report, please help.

    how to pass parameters to crystal report, please help.This would entirely depend on crystal reports and you might find informations on crystal reports related communities more likely...I for one have seen crystal reports the last time about 12 years ago. And even back then I simply acknowledged it's existence instead of working with it.
    Maybe crystal reports can be invoked via a URL call which would make it simple as you'd need simply build an URL and show the report using web.show_document. But that's pure speculation. Also you might not be the first with this requirement, so the solution to your problem might be right under your nose and just a little google search away ;)
    cheers

  • How to consume sap xi pi web services or sap RFC with oracle 11g forms.

    Dear All
    how to consume sap xi pi web services or sap RFC with oracle 11g forms.
    or
    how to config 11g forms with sap xi....
    or how to call sap xi web services in 11g forms....
    or can send sample code....
    Regards
    smfatmi
    Edited by: smfatmi on Oct 17, 2011 2:16 AM
    Edited by: smfatmi on Oct 17, 2011 2:17 AM

    Dear All
    how to consume sap xi pi web services or sap RFC with oracle 11g forms.
    or
    how to config 11g forms with sap xi....
    or how to call sap xi web services in 11g forms....
    or can send sample code....
    Regards
    smfatmi
    Edited by: smfatmi on Oct 17, 2011 2:16 AM
    Edited by: smfatmi on Oct 17, 2011 2:17 AM

Maybe you are looking for

  • Need advice & answers about updating DV7 Processor

    I've had an HP Pavilion dv7t Intel Core 2 Duo T6400 2.0GHz 4GB 320GB 17.3" for a little over a year. (I have no idea what the processor # is) Recently the fan started getting louder so I took it in to be cleaned b/c my hands are paralyzed and I can't

  • So, why can i not save a jpeg in cs6?

    OI, i just installed my new Photoshop cs6 (with the design standard package, student edition), and set about to make some graphics. i selected a new file, 300ppi, and set to work. after a while, i flatten the image and go to save when i go to save dr

  • DL DVD will not play

    I have an SD DL DVD authored in DVD Studio Pro. There is a lot of content, so I needed to use a Dual Layer DVD. I was able to build the DVD with a suitable layer break point. The build and the format went fine. If course, the DVD and an IMG file work

  • DataGrid Refreshing Problem

    Hi All, First let me explain my problem clearly.I am facing the problem with refreshing datagrid for add,update,delete operations. For adding task(todo app) i am using another mxml component(PopUpwindow).when i do add,delete or update, changes are ha

  • Unable to send iPhoto by email since changing email P/W

    unable to send iPhotos by email since changing email P/W