Duration of an Abap Function call from Java using Jco3

Hi guys!
I would like to use this discussion to get some refernces of the duration Timespan of an RFC call from Java to SAP. At the moment, i need at last about 200ms to call the Abap function. I'm just using one simple import and export parameter (so no deep structures). I think that the reason for my poor performance is, that the Java Tool and the SAP instance are not in the same network. So, i hope some of you have some data, how fast an RFC call from Java using Jco can be executed.
greetings, Hannes

Hi Hannes,
I think you have already got the answer to your question - the network set-up you have is probably the bottleneck.  Whenever I've worked with Java <-> ABAP and they are in the same network, I've had no performance problems at all.
Does your RFC contain any complex logic or business processes?  Are you able to try and call something that does nothing, say it just accepts an input string and returns it straight away as an export.  Do you have any scope for testing with your Java tool on the same network as the SAP system?
Cheers,
G.

Similar Messages

  • Dll call from java using Jbuilder?

    Please?
    Does anyone know how I do dll calls from java (jubuilder).
    I have tried but did not manage to get it wright???
    / thanks carlos

    Research JNI (java native interface)

  • How to Call abap functn/program from java layer

    Hi all,
        I have to develop a program which has to call abap function/program from java side or how to call a abap program through java ..
    pls send me related links or explanations.. dont send unrelated answers..
    Regards,
    Arivarasu S

    Hi,
    You mean accessing ABAP functions from J2EE perspective, then I think we can do this by using SAP Java Resource Adapter and also through webservices.
    SAP Java Resource Adapter (SAP JRA) can be used as an add-on for the SAP JCo SAP JRA enables the implementation of standard interfaces from diverse J2EE servers to the SAP JCo in the SAP Web AS. The SAP JRA thus simplifies
    communication with ABAP within heterogeneous J2EE landscapes.
    Go through the following links which has Good documentation on how to achieve this
    Accessing BAPIs Using the SAP Java Resource Adapter
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ad09cd07-0a01-0010-93a9-933e247d3ba4]
    Connectivity and Interoperability
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/326d82e5-0601-0010-fca4-9caf27b89c26]
    Finally with WebServices. Accessing SAP Business Functions (ABAP) via Web Services
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/06adbf03-0a01-0010-f386-d8e45561a3c4]
    Regards
    Raghu

  • CNTL_ERROR while calling a function module from Java webdynpro

    I am calling a RFC function module from javawebdynpro app
    which inturn calls a function module performing BDC on CAPP transaction. When I run this from SE37 of the same system or a different system everything works fine. But when called from Java webdynpro app, it raises a CNTL_ERROR exception and creates a short dump.
    Any help on this is highly appreciated

    Good catch, BI Learner. This was exactly it: when assigning the values from SOURCEFIELDS directly to the import/export parameters, you have to make sure that the types are EXACTLY the same, otherwise it will not work (the routine stops with an error when calling the FM, but there is no dump).
    Therefore, to solve my problem, I created the declarations precisely as expected by the FM and assigned the values to these fields:
    DATA:
          SOURCEVAL TYPE  /BIC/OIINVQTY,
          SOURCEUOM TYPE  /BIC/OIUSUOM,
          USITM TYPE  /BIC/OIUSITM,
          TARGETUOM TYPE  /BIC/OIUSUOM,
          CONVERTED_COST TYPE  /BIC/OIINVQTY.
    DATA PRODUCTION_UOM TYPE /BIC/OIUSUOM.
    " get the Production UOM
        SELECT SINGLE I~/BIC/USPRDUOM
          FROM /BIC/PUSITM AS I
          INTO PRODUCTION_UOM
          WHERE I~/BIC/USITM = SOURCE_FIELDS-/BIC/USITM AND I~OBJVERS = 'A'.
        IF ( SY-SUBRC = 4 ). " no records found
          "RAISE PARTNO_NOT_FOUND.
          RAISE EXCEPTION TYPE CX_RSROUT_SKIP_RECORD.
        ENDIF.
    " load the parameters
        SOURCEVAL = SOURCE_FIELDS-/BIC/USFRZMFC.
        SOURCEUOM = SOURCE_FIELDS-BASE_UOM.
        USITM = SOURCE_FIELDS-/BIC/USITM.
    " then you can call the FM
        CALL FUNCTION 'Z_CA_CONVERT_US_COST'
          EXPORTING
            PSOURCEVAL                = SOURCEVAL
            PSOURCEUOM                = SOURCEUOM
            PUSITM                    = USITM
            PTARGETUOM                = PRODUCTION_UOM
          IMPORTING
            PTARGETVAL                = CONVERTED_COST
          EXCEPTIONS
            CONVERSION_NOT_MAINTAINED = 1
            PARTNO_NOT_FOUND          = 2
            OTHERS                    = 3.
    " ... [do the rest]
    Thanks for your help,
    Dennis

  • How to call a C function calling a Java Method from another C function ?

    Hi everyone,
    I'm just starting to learn JNI and my problem is that I don't know if it is possible to call a C function calling a Java Method (or doing anything else with JNI) from another C function.
    In fact, after receiving datas in a socket made by a C function, I would like to create a class instance (and I don't know how to do it too ; ) ) and init this instance with the strings I received in the socket.
    Is all that possible ?
    Thank you very much for your help !

    Hard to understand the question, but by most interpretations the answer is going to be yes.
    You do of course understand that JNI is the "API" that sits between Java and C and that every call between the two must go through that. You can't call it directly.

  • Call ABAP function module from script?

    Hi,
    I have an ABAP function module, which works fine when I call it in a transformation.
    Since I don't need to execute this function for each record but rather for each file I process, I would like to move the call from the DataFlow to a script in the WorkFlow. When I click on the 'functions' button the ABAP FM is available in my SAP Datastore, so I drag and drop it into my script. I also make sure to populate all required variables.
    There are no error messages or warning when I check my job definition.
    When I execute it, I get the following RFC error:
    Function call <xxx  ( abcd ) > failed, due to error <150413>: <RFC CallReceive exception <FUNCTION_NOT_FOUND>.>.
    Is it just not possible to call an RFC enabled function module in SAP from a script or am I doing something wrong here?
    Thanks,
    Jan.

    Could you please let me know how I can call an abap function module from a transformation? (from abap xslt program). I know how we can call methods of a class from the transformations, but no idea how we can call function modules. Any suggestions or a sample code snippet towards this will be very useful for me.
    Thanks,
    Shashi.

  • Java function call from Trigger in Oracle

    Moderator edit:
    This post was branched from an eleven-year-old long dead thread
    Java function call from Trigger in Oracle
    @ user 861498,
    For the future, if a forum discussion is more than (let's say) a month old, NEVER resurrect it to append your new issue. Always start a new thread. Feel free to include a link to that old discussion if you think it might be relevant.
    Also, ALWAYS use code tags as is described in the forum FAQ that is linked at the upper corner of e\very page. Your formulae will be so very much more readable.
    {end of edit, what follows is their posting}
    I am attempting to do a similar function, however everything is loaded, written, compiled and resolved correct, however, nothing is happening. No errors or anything. Would I have a permission issue or something?
    My code is the following, (the last four lines of java code is meant to do activate a particular badge which will later be dynamic)
    Trigger:
    CREATE OR REPLACE PROCEDURE java_contact_t4 (member_id_in NUMBER)
    IS LANGUAGE JAVA
    NAME 'ThrowAnError.contactTrigger(java.lang.Integer)';
    Java:
    CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED "ThrowAnError" AS
    // Required class libraries.
    import java.sql.*;
    import oracle.jdbc.driver.*;
    import com.ekahau.common.sdk.*;
    import com.ekahau.engine.sdk.*;
    // Define class.
    public class ThrowAnError {
    // Connect and verify new insert would be a duplicate.
    public static void contactTrigger(Integer memberID) throws Exception {
    String badgeId;
    // Create a Java 5 and Oracle 11g connection.
    Connection conn = DriverManager.getConnection("jdbc:default:connection:");
    // Create a prepared statement that accepts binding a number.
    PreparedStatement ps = conn.prepareStatement("SELECT \"Note\" " +
    "FROM Users " +
    "WHERE \"User\" = ? ");
    // Bind the local variable to the statement placeholder.
    ps.setInt(1, memberID);
    // Execute query and check if there is a second value.
    ResultSet rs = ps.executeQuery();
    while (rs.next()) {
    badgeId = rs.getString("Note");
    // Clean up resources.
    rs.close();
    ps.close();
    conn.close();
    // davids badge is 105463705637
    EConnection mEngineConnection = new econnection("10.25.10.5",8550);
    mEngineConnection.setUserCredentials("choff", "badge00");
    mEngineConnection.call("/epe/cfg/tagcommandadd?tagid=105463705637&cmd=mmt%203");
    mEngineConnection.call("/epe/msg/tagsendmsg?tagid=105463705637&messagetype=instant&message=Hello%20World%20from%20Axium-Oracle");
    Edited by: rukbat on May 31, 2011 1:12 PM

    To followup on the posting:
    Okay, being a oracle noob, I didn't know I needed to tell anything to get the java error messages out to the console
    Having figured that out on my own, I minified my code to just run the one line of code:
    // Required class libraries.
      import java.sql.*;
      import oracle.jdbc.driver.*;
      import com.ekahau.common.sdk.*;
      import com.ekahau.engine.sdk.*;
      // Define class.
      public class ThrowAnError {
         public static void testEkahau(Integer memberID) throws Exception {
         try {
              EConnection mEngineConnection = new EConnection("10.25.10.5",8550);
         } catch (Throwable e) {
              System.out.println("got an error");
              e.printStackTrace();
    }So, after the following:
    SQL> {as sysdba on another command prompt} exec dbms_java.grant_permission('AXIUM',"SYS:java.util.PropertyPermission','javax.security.auth.usersubjectCredsOnly','write');
    and the following as the user
    SQL> set serveroutput on
    SQL> exec dbms_java.set_output(10000);
    I run the procedure and receive the following message.
    SQL> call java_contact_t4(801);
    got an error
    java.lang.NoClassDefFoundError
         at ThrowAnError.testEkahau(ThrowAnError:13)
    Call completed.
    NoClassDefFoundError tells me that it can't find the jar file to run my call to EConnection.
    Now, I've notice when I loaded the sdk jar file, it skipped some classes it contained:
    c:\Users\me\Documents>loadjava -r -f -v -r "axium/-----@axaxiumtrain" ekahau-engine-sdk.jar
    arguments: '-u' 'axium/***@axaxiumtrain' '-r' '-f' '-v' 'ekahau-engine-sdk.jar'
    creating : resource META-INF/MANIFEST.MF
    loading : resource META-INF/MANIFEST.MF
    creating : class com/ekahau/common/sdk/EConnection
    loading : class com/ekahau/common/sdk/EConnection
    creating : class com/ekahau/common/sdk/EErrorCodes
    loading : class com/ekahau/common/sdk/EErrorCodes
    skipping : resource META-INF/MANIFEST.MF
    resolving: class com/ekahau/common/sdk/EConnection
    skipping : class com/ekahau/common/sdk/EErrorCodes
    skipping : class com/ekahau/common/sdk/EException
    skipping : class com/ekahau/common/sdk/EMsg$EMSGIterator
    skipping : class com/ekahau/common/sdk/EMsg
    skipping : class com/ekahau/common/sdk/EMsgEncoder
    skipping : class com/ekahau/common/sdk/EMsgKeyValueParser
    skipping : class com/ekahau/common/sdk/EMsgProperty
    resolving: class com/ekahau/engine/sdk/impl/LocationImpl
    skipping : class com/ekahau/engine/sdk/status/IStatusListener
    skipping : class com/ekahau/engine/sdk/status/StatusChangeEntry
    Classes Loaded: 114
    Resources Loaded: 1
    Sources Loaded: 0
    Published Interfaces: 0
    Classes generated: 0
    Classes skipped: 0
    Synonyms Created: 0
    Errors: 0
    .... with no explanation.
    Can anyone tell me why it would skip resolving a class? Especially after I use the -r flag to have loadjava resolve it upon loading.
    How do i get it to resolve the entire jar file?
    Edited by: themadprogrammer on Aug 5, 2011 7:15 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:21 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:22 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:23 AM
    Edited by: themadprogrammer on Aug 5, 2011 7:26 AM

  • Java functions call from C++ App

    Hi,
    I'm new to Java, One of our client have generic APIs for there business logic, those are written in JAVA, now we want to use some of these APIs in C++ application. Can any one suggest/address me the better way to do this?
    Thanks in advance.
    Thanks,
    --Ravi Kiran.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    To call Java functions from C++ you need a VM running in your process, and JNI is the interface you need to use in the C++ code.
    One of the interfaces in JNI lets you create a VM. You generally only want one VM, so if the application started out in Java, you have a VM already and you don't need to create one.
    Note that JNI is really a C <-> Java interface, and usually any C++ code called from Java is C++ 'extern "C"' functions. Java won't know anything about C++ objects. And you use JNI to get C++ to understand Java objects.
    Hope this was helpful.

  • BAPI function call in Java

    Hi,
    I am trying to make BAPI function call in JAVA. I am using the following libraries for IBM AIX version and the sapjco.jar
    1) librfccm.o
    2) libsapjcorfc.so
    The above 2 libraries are in my java lib path.
    But I get a exception and it is referring to sapjcorfc.dll (which is a windows version) instead of referring to libsapjcorfc.so
    What should I do so that it refers to libsapjcorfc.so and not sapjcorfc.dll
    Error Details:   java.lang.ExceptionInInitializerError: JCO.classInitialize():
    Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'
    JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc
    [sapjcorfc (A file or directory in the path name does not exist.)]. java.library.path
    [/usr/java14_64/jre/bin:/usr/java14_64/jre/bin:/usr/java14_64/jre/bin/classic:/usr/java14_64/jre/bin:
    /usr/sap/DP0/DVEBMGS42/exe:/usr/sap/DP0/DVEBMGS42/exe:/usr/sap/DP0/DVEBMGS42/exe:
    /tmp/sapinst_exe.1081378.1199455057:/usr/sap/DP0/SYS/exe/run:/home/db2inst1/sqllib/lib64:
    /usr/sap/DP0/DVEBMGS42/exe::/usr/lib:/usr/sap/DP0/DVEBMGS42/j2ee/os_libs:/usr/sap/DP0/DVEBMGS42/exe:
    /usr/sap/DP0/DVEBMGS42/exe:/usr/sap/DP0/DVEBMGS42/exe:/usr/lib:/lib:/usr/sap/DP0/SYS/exe/run:
    /home/db2inst1/sqllib/lib64]

    Hi Jawed,
    when  I try it as a stand alone java code on IBM AIX version BAPI connection works and it fetches the roles listed for an user from the ACTIVITYGROUP table.
    The same piece of code bundled in an ear and when deployed in SAP netweaver portal gives different errors. My sapjco.jar is in application lib folder and it is referred in classpath
    first time when i access the application url it gives me
    Error Details: java.lang.ExceptionInInitializerError: JCO.classInitialize():
    Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'
    JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc
    http://sapjcorfc (A file or directory in the path name does not exist.). java.library.path
    [/usr/java14_64/jre/bin:/usr/java14_64/jre/bin:/usr/java14_64/jre/bin/classic:/usr/java14_64/jre/bin:
    /usr/sap/DP0/DVEBMGS42/exe:/usr/sap/DP0/DVEBMGS42/exe:/usr/sap/DP0/DVEBMGS42/exe:
    /tmp/sapinst_exe.1081378.1199455057:/usr/sap/DP0/SYS/exe/run:/home/db2inst1/sqllib/lib64:
    /usr/sap/DP0/DVEBMGS42/exe::/usr/lib:/usr/sap/DP0/DVEBMGS42/j2ee/os_libs:/usr/sap/DP0/DVEBMGS42/exe:
    /usr/sap/DP0/DVEBMGS42/exe:/usr/sap/DP0/DVEBMGS42/exe:/usr/lib:/lib:/usr/sap/DP0/SYS/exe/run:
    /home/db2inst1/sqllib/lib64]
    when i acess the application url next time it gives me
    Application error occurred during request processing.
      Details:   java.lang.NoClassDefFoundError: com.sap.mw.jco.JCO (initialization failure)
    Exception id: [00145EB7604700720000000F000C20FE00047CA4F0EF0615]
    Below is my my javacode - I am calling the method getUserRoles
    package com.mysap.sso;
    import com.sap.mw.jco.*;
    import java.util.ArrayList;
    import java.util.List;
    public class BapiConnection {
         private static JCO.Client mConnection;
         private static JCO.Repository mRepository;
         private static JCO.Function createFunction(String functionName)
                   throws Exception {
              try {
                   IFunctionTemplate ft = mRepository.getFunctionTemplate(functionName
                             .toUpperCase());
                   if (ft == null) {
                        return null;
                   } else {
                        return ft.getFunction();
              } catch (Exception ex) {
                   throw ex;
         public List getUserRoles(String user) {
              JCO.Function function = null;
              JCO.Table activitygroups = null;
              List rolesList = null;
              mConnection = null;
              mRepository = null;
              mConnection = JCO.createClient("300", "INVTRY_SEGMT", "Welcome%1",
                        null, "ade00fe", "22");
              try {
                   //Connect to the WebAS ABAP with the parameters above
                   mConnection.connect();
                   //Create a function repository to be able to build a function
                   mRepository = new JCO.Repository("INVTRY_SEGMT", mConnection);
                   //Get the function
                   function = createFunction("BAPI_USER_GET_DETAIL");
                   //Set the only import parameter
                   function.getImportParameterList().setValue(user, "USERNAME");
                   //Execute the function
                   mConnection.execute(function);
                   //Get the 'ADDRESS' return structure
                   activitygroups = function.getTableParameterList().getTable(
                             "ACTIVITYGROUPS");
                   rolesList = new ArrayList();
                   for (int i = 0; i < activitygroups.getNumRows(); i++, activitygroups
                             .nextRow()) {
                        System.out.println(activitygroups.getString("AGR_NAME"));
                        logger.debug(activitygroups.getString("AGR_NAME"));
                        rolesList.add(activitygroups.getString("AGR_NAME"));
                   mConnection.disconnect();
              } catch (Exception ex) {
                   System.err.println(ex.toString());
              return rolesList;

  • ABAP Proxy generation from JAVA

    Hi,
    Is it possible to generate ABAP proxy classes from JAVA?
    If possible then how do we call them during runtime from JAVA?
    Here is what I am trying to do.
    I have XSD  ( Open Travel  Standards schemas). I want to generate ABAP proxy classes for these XSDs.
    So that I can call these ABAP proxy classes from JAVA during runtime. Real implementation of these methods will be implemented in ABAP.
    Thanks,
    Amara.

    hi amara,
    check this link
    http://help.sap.com/saphelp_nw04/helpdata/en/14/555f3c482a7331e10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nwpi71/helpdata/en/3e/e3fb40f17af66fe10000000a1550b0/content.htm
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a068cf2f-0401-0010-2aa9-f5ae4b2096f9
    let me know am i reach u r point
    bvr

  • Using ABAP function calls in HANA

    Hi everyone,
    I am very new to the ABAP workspace. Is it possible to call ABAP function modules from the HANA database? We have a long raw field in a table that we would like to convert to text. Any help would be greatly appreciated!
    Thanks,
    Anu

    Hi Anu,
    Please try the following.
    Take the transaction iuuc_repl_content for the advanced replication settings.
    Select the configuration and then select the table.
    You should be able to add ABAP code for a field using this transaction.
    Check the OSS note 1733714 for more information.
    Thanks
    Vinod

  • How can i measure BAPI runtime which has called from JAVA

    Hi abapers
    how can i get run time for BAPI called from JAVA through JCO.
    i know that i can use SE30 from ABAP by executing from SAP.
    may be ST05 useful for me i did it but when display trace
    i am getting big list by seeing this list i am not able to find the runtime for that BAPI.
    please any one can explain
    reagdrs
    ramesh

    Hi Ramesh,
       Irrespective of whether the call is from an external system or within sap, the bapi will be executed in R/3 only.
    So, you can safely measure the runtime using se30 only.
    If it is taking more time when called from JCo , then you can be sure that the problem is not with SAP and is actually due to the JCo connectivity with R/3.
    Regards,
    Ravi

  • Execute Oracle Package Function call from FORTE

    Has anyone EVER successfully execute an Oracle Package Function call from FORTE
    via " sql execute procedure "?
    Here's my question, I am able to execute a stored procedure but hasn't figured
    out a way to execute a function which defined in a package. The syntax goes
    like this: sql execute procedure <PackageName>.<FunctionName> ( input
    input_parm, output output_parm). If anyone EVER successfully execute a
    function, please let me know, thanks.

    You'll need to provide a column alias for the function call:
    select func(val) as alias from dual

  • Just now i started learning ABAP and basically from JAVA background.

    hi,
    Just now i started learning ABAP and basically from JAVA background.Can anyone tell me how to implement(steps) java in sap(from where i have to start).
    regards,
    Venkat.

    Hi Venkat,
         if u know java very well, then u can take up EP. ABAP is also very easy one to read and understand, as ur basically from prgming background.
    To start with go thro the classical abap and then come to abapoo.
    u can find so many link when u search for doc in sdn.
    all the best,
    Regards
    Sathish

  • Send Datetime2 value to a SQL Procedure from Java using Hibernate

    Hi All,
    I Have a Procedure which takes a parameter of type datetime2.
    The procedure is called from Java Hibernate.
    How can I Pass datetime2 value to SQL procedure from Java?
    Thanks in advance,
    Shraddha Gore

    You may define a global empty array in some package. Then you can do:
    SQL> CREATE OR REPLACE PACKAGE pkg
    AS
       g_empty   DBMS_SQL.varchar2_table;
    END pkg;
    Package created.
    SQL> CREATE OR REPLACE PROCEDURE p (
       p_tuids   IN   DBMS_SQL.varchar2_table "DEFAULT pkg.g_empty"
    AS
    BEGIN
       NULL;
    END p;
    Procedure created.
    SQL> BEGIN
       p ();
    END;
    PL/SQL procedure successfully completed.

Maybe you are looking for

  • Function module to get the month name when start date and end date given

    Hey Experts,                    I am creating a employee bonus report. In this report each and every employee's month wise working days have to be calculated and displayed in the report. I need to find a function module which helps me split the given

  • S_P00_07000218: Print Customer Invoice

    I tried executing program S_P00_07000218 from FI >> AR >> Reporting >> Singapore. This program is named "Print Customer Invoice" However, I encountered an error message: "In comp.code BP01 for program RFKORDP2 the default form set  is missing" How sh

  • WAP200 and .1x/radius authentication with multiple SSIDs

    Apparently it's not possible to define more than a single radius server when using multiple SSIDs with WAP200. Unfortunately WAP200 doesn't add the name of the SSID as a radius attribute, so it's not possible to make distinction whether the user is t

  • MCBE report-drilldown variance in values

    Hi All, When i am running report MCBG, I enter plant value as SP*  and the MRP controller say; MR2, and i get "Valuated stock value".  The problem is when i run the same report with values SP* and M*, and check the values for MRP controller MR2, the

  • TRYING TO RECOVER PREVIOUS BE

    I am running latest Solaris release and mirrored root in zfs. I created a new BE for patching, I applied patches to that BE, I then activated the new BE, this is the message I got: The target boot environment has been activated. It will be used when