JCo( Java Connector)

Hi Guys,
Any one give some info abt JCo( Java Connector). Thanks in advance.
Thanks
Kiran.B

Hi Kiran,
Check the following example
SAP Java Connector - Excample 1: Simple RFC call
Scenario
We will call the RFC function module ZNAS_HIE1_GET_MEMBER_FARM.that returns members that have owned a farm. Input to the function is a farm number, and output is a table of members that have owned the farm and Owner number (Sequence number of owners).
Class testJCO is excuted and calls class GetMemberFarm method GetMemberFarmFromSap. Input parameters to GetMemberFarm are Farm and Owner number.
GetMemberFarmFromSap executes RFC ZNAS_HIE1_GET_MEMBER_FARM, that returns a table of members that have owned the farm from the input parameters.
GetMemberFarmFromSap loops through the table and finds the member where ZZCHCODE (Owner numer), is equal owner number from the input-parameters. and returns the member.
Code
Class testJCO
public class testJco
     public static void main(String[] args)
          GetMemberFarm testGetMemberFarm = new GetMemberFarm();
          String memberFarm= testGetMemberFarm.GetMemberFarmFromSap("0111020155","02");
          System.out.println("Memberfarm: " + memberFarm);
Class GetMemberFram
import com.sap.mw.jco.*;  //The JCO
public class GetMemberFarm {
  public String GetMemberFarmFromSap(String farm, String OwnerNumber)   
  {  String zzmemb ="";
        String memberFarm = "";
     JCO.Repository mRepository;
     JCO.Client mConnection = null;
     JCO.Function myFunction = null;
     //Create Connection to SAP
       try
            mConnection = JCO.createClient("800",           //SAP client
                                        "HFR",       //User ID
                                        "vimmer3",     //Password
                                        "EN",            //Language
                                        "53.205.22.71", //Host
                                        "03");           //System
         mConnection.connect();
         System.out.println("Connection OK");
       catch (Exception ex)
            System.out.println(ex);
      // Create function and parameters
      try
        //Create repository
        mRepository = new JCO.Repository( "GetMember", mConnection );
        //Get a function template from the repository
        IFunctionTemplate ftemplate = mRepository.getFunctionTemplate("ZNAS_HIE1_GET_MEMBER_FARM");
        //Create function
        myFunction = new JCO.Function(ftemplate);
        System.out.println("Function created");
        //Set import parameter
        JCO.Field zzfarm = myFunction.getImportParameterList().getField("ZZFARM");
        zzfarm.setValue(farm);
        System.out.println("Parameters ok");
     catch (Exception ex)       
          System.out.println(ex);
     // Execute function
     try
          mConnection.execute(myFunction);
        System.out.println("RFC Call OK");          
     catch (Exception ex)      
      {  System.out.println(ex); //Exception from function          
     // Handle return table GT_HIERARCHY
     // Loop over the table and find the record that
     // has ZZCHCODE = OwnerNumber from the
     // method parameters, and return Member for the
     // record
     JCO.Table gt_HIERARCHY = null;
     try
          gt_HIERARCHY=myFunction.getTableParameterList().getTable("GT_HIERARCHY");
          //Loop thhrough table and return the member that has
          // changecode (ZZCHCODE) = 02
          for (int i = 0; i < gt_HIERARCHY.getNumRows(); i++)
          {   gt_HIERARCHY.setRow(i);
              String zzchcode = gt_HIERARCHY.getString("ZZCHCODE");
              if (zzchcode.equals(OwnerNumber))                        
                   zzmemb = gt_HIERARCHY.getString("ZZMEMB");                   
     catch (Exception ex)      
      {  System.out.println(ex);           
     // Disconnect from SAP
     try
         mConnection.disconnect();  
         System.out.println("Disconnected from SAP");
      catch (Exception ex)
           System.out.println(ex);
      return zzmemb;
} //public class GetMemberFarm
Tips and tricks for the Java connector
How to set and import parameter - Field
Give the import parameter SALESDOCUMENT the value "00006973":
JCO.Field SalesDocumentField = jcoFunction.getImportParameterList().getField("SALESDOCUMENT");
SalesDocumentField.setValue("00006973");
How to handle an import parameter - Table
JCO.Table ORDER_PARTNERS = jcoFunction.getTableParameterList().getTable("ORDER_PARTNERS");
ORDER_PARTNERS.appendRow();
ORDER_PARTNERS.setValue("AG","PARTN_ROLE");
ORDER_PARTNERS.setValue("0000001032","PARTN_NUMB");
How to handle an import parameter - Structure
JCO.Structure order_header_inx = jcoFunction.getImportParameterList().getStructure("ORDER_HEADER_INX");
order_header_inx.setValue("I","UPDATEFLAG");
order_header_inx.setValue("X","DOC_TYPE");
How to handle an export parameter - Table
JCO.Table myTable = jcoFunction.getTableParameterList().getTable("STATUSINFO");
for (int i=0; i < myTable.getNumRows(); i++)
  myTable.setRow(i);
  // Retrieve the value of the field DOC_DATE
  oDocDate = myTable.getField("DOC_DATE").getValue();
How to handle BAPI return table
Meesage type and message is stored in vector bapiReturn.
Vector bapiReturn;
JCO.Table jcoReturn = jcoFunction.getTableParameterList().getTable("RETURN");
    for (int i = 0; i < jcoReturn.getNumRows(); i++)
    { jcoReturn.setRow(i);
      String Message = jcoReturn.getField("TYPE").getValue() + " " +
                       jcoReturn.getField("MESSAGE").getValue();
      bapiReturn.setSize(i + 1);
      bapiReturn.setElementAt(new String(Message),i );
Using COMMIT
    try
     { // Get a function template from the repository
       IFunctionTemplate ftemplate = mRepository.getFunctionTemplate("BAPI_TRANSACTION_COMMIT");
       // Create a function from the template
       jcoCommit = new JCO.Function(ftemplate);
       if ( jcoCommit == null )
         // Do something..;
    catch (Exception mException)
     {  mException.printStackTrace(); }
    // Execute COMMIT
    try
     { sapConnection1.mConnection.execute(jcoCommit);
    catch (Exception mException)
     { mException.printStackTrace(); }
Thanks and Good Luck
AK

Similar Messages

  • JCos (Java Connectors) from one GRC server to multiple clients on same DEV

    I have installed SAP GRC Access Controls RAR on a server.
    I have connected the RAR using JCo's to a client (800) on a DEV R/3 (4.7) box.  I have also performed analysis succesfully on the roles and users in this DEV client.
    I now have another development client on the DEV box (500) which I need to perform analysis for.  This client is HR specific.
    I know I can create a new JCo to connect to client 500.  But what will be the impact on my analysis results?  How will I distinguish between the results found from client 500 and those found from client 800?
    How would you suggest the best way of doing this?
    Many thanks in advance.

    You will need to create a second JCO to the second client as JCO's are client specific (username password combinations to log on etc etc)
    You distinguish the results in Risk ANalyses by choosing the JCO (system) when you create the reports eg: Client 500, Client 800 or ALL.
    It can be very confusing and you have to be careful otherwise you will interpret the results incorrectly.
    If your new client is HR specific make sure that you have the HR RTA installed as well and patch the HR and Non-HR RTAs up to the latest versions.

  • IPV6 support by SAP Java Connector (SAP JCo)

    Hi there,
    Does anyone know if IPV6 is supported by SAP Java Connector (SAP JCo) ?
    Thanks

    See http://help.sap.com/saphelp_nwmobile71/helpdata/en/46/cd5ee2c45365dde10000000a155369/content.htm
    but unfortunately I couldn't make it work. Has anyone made it work? thanks,

  • ABAP to Java Connector (JCo)

    Hi All,
    Currently this is what I have:
    ABAP program uses OPEN SQL of course collect information from SAP database, then using NATIVE SQL goes thru DBCON to transfer information directly to another application (Non SAP system) database (not SAP database).
    I just dont like this idea anymore since I was reading about the Java Connector.
    So what I want to do is...Not sure feasible this is where I need your help on:
    Remove all my NATIVE SQL statements, use JCo and rewrite those statements in Java language and communicate to the Non SAP application thru their API (their API is also Java base)
    Will reward points.
    Tim

    hi,
    you will find more info on.
    http://www.sapgenie.com/faq/jco.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/47/80f671ee6e4b41b63c0fe46bd6e4f8/content.htm
    http://www.sapdevelopment.co.uk/java/jco/bapi_jco.pdf
    http://searchsap.techtarget.com/tip/1,289483,sid21_gci854012,00.html
    http://www.sap.info/public/INT/int/glossary/int/glossaryletter/Word-64134159551ecde70_glossary/S
    for installing JCO zip file...
    http://help.sap.com/saphelp_nw04/helpdata/en/47/80f671ee6e4b41b63c0fe46bd6e4f8/content.htm
    http://publib.boulder.ibm.com/infocenter/wbihelp/v6rxmx/index.jsp?topic=/com.ibm.wbia_adapters.doc/doc/mysap4/mysap437.htm
    You simply have to have a connection with SAP system and then you can call BAPI with which you can read / update the data in the SAP system.
    Hope this info proves useful.
    Regards,
    Richa.

  • Java Connector (JCO) desupported?

    Dear all,
    does somebody know whether the Java Connector (JCO) will be desupported and if so when?
    I would like to use it in a new project because it may be easier to introduce than the whole XI infrastructure.
    But if there is an official desupport notice I have to switch my strategy.
    If this may be the wrong forum please advise me to the right one.
    Thanks in advance,
    Frank

    As far as I know,JCo is needed for the communication between ABAP stack and JAVA stack.In XI , ABAP stack and JAVA stack are mandatory and you need JCo.
    "I would like to use it in a new project because it may be easier to introduce than the whole XI infrastructure."
    Can you be a little more clearer abt what u mean by the above statement.

  • SAP Business One - Java Connector

    Hi All,
    <br/><br/>
    We have a SAP Business One Application installed on a laptop. The requirement is to be able to use the SAP Java API to update tables in the system. We are not allowed to connect directly to the database and was advised to use the API instead.
    <br/><br/>
    The downloaded API that we are using is "sapjco30P_6-10005324 32 bit.zip". I have included the dll file contained in this package in the WINDOWS/system32 folder. I am using Eclipse as IDE and already included the "sapjco3.jar" in the classpath.
    <br/><br/>
    First question: Am I using the right Java Connector for SAP Business One?
    <br/><br/>
    I got sample code on how to connect using JCO:
    <br/><br/>
    package sample;<br/><br/>
    import java.io.File;<br/>
    import java.io.FileOutputStream;<br/>
    import java.util.Properties;<br/>
    import java.util.concurrent.CountDownLatch;<br/><br/>
    import com.sap.conn.jco.AbapException;<br/>
    import com.sap.conn.jco.JCoContext;<br/>
    import com.sap.conn.jco.JCoDestination;<br/>
    import com.sap.conn.jco.JCoDestinationManager;<br/>
    import com.sap.conn.jco.JCoException;<br/>
    import com.sap.conn.jco.JCoField;<br/>
    import com.sap.conn.jco.JCoFunction;<br/>
    import com.sap.conn.jco.JCoFunctionTemplate;<br/>
    import com.sap.conn.jco.JCoStructure;<br/>
    import com.sap.conn.jco.JCoTable;<br/>
    import com.sap.conn.jco.ext.DestinationDataProvider;<br/><br/>
    public class StepByStepClient<br/>
    {<br/>
        static String ABAP_AS = "ABAP_AS_WITHOUT_POOL";<br/>
        static String ABAP_AS_POOLED = "ABAP_AS_WITH_POOL";<br/>
        static String ABAP_MS = "ABAP_MS_WITHOUT_POOL";<br/>
        static<br/>
        {<br/>
            Properties connectProperties = new Properties();<br/>
            connectProperties.setProperty(DestinationDataProvider.JCO_ASHOST, "localhost");<br/>
            connectProperties.setProperty(DestinationDataProvider.JCO_SYSNR,  "06");<br/>
            connectProperties.setProperty(DestinationDataProvider.JCO_CLIENT, "000");<br/>
            connectProperties.setProperty(DestinationDataProvider.JCO_USER,   "manager"); //sapuser<br/>
            connectProperties.setProperty(DestinationDataProvider.JCO_PASSWD, "manager"); //sap1234<br/>
            connectProperties.setProperty(DestinationDataProvider.JCO_LANG,   "en");<br/>
            createDataFile(ABAP_AS, "jcoDestination", connectProperties);<br/><br/>
            connectProperties.setProperty(DestinationDataProvider.JCO_POOL_CAPACITY, "3");<br/>
            connectProperties.setProperty(DestinationDataProvider.JCO_PEAK_LIMIT,    "10");<br/>
            createDataFile(ABAP_AS_POOLED, "jcoDestination", connectProperties);<br/><br/>
            connectProperties.clear();<br/>
            connectProperties.setProperty(DestinationDataProvider.JCO_MSHOST, "localhost");<br/>
            connectProperties.setProperty(DestinationDataProvider.JCO_R3NAME,  "SID");<br/>
            connectProperties.setProperty(DestinationDataProvider.JCO_CLIENT, "000");<br/>
            connectProperties.setProperty(DestinationDataProvider.JCO_USER,   "manager"); //sapuser<br/>
            connectProperties.setProperty(DestinationDataProvider.JCO_PASSWD, "manager"); //sap1234<br/>
            connectProperties.setProperty(DestinationDataProvider.JCO_GROUP, "GROUP");<br/>
            connectProperties.setProperty(DestinationDataProvider.JCO_LANG,   "en");<br/>
            createDataFile(ABAP_MS, "jcoDestination", connectProperties);<br/>
        }<br/><br/>
        static void createDataFile(String name, String suffix, Properties properties)<br/>
        {<br/>
            File cfg = new File(name"."suffix);<br/>
            if(!cfg.exists())<br/>
            {<br/>
                try<br/>
                {<br/>
                    FileOutputStream fos = new FileOutputStream(cfg, false);<br/>
                    properties.store(fos, "for tests only !");<br/>
                    fos.close();<br/>
                }<br/>
                catch (Exception e)<br/>
                {<br/>
                    throw new RuntimeException("Unable to create the destination file " + cfg.getName(), e);<br/>
                }<br/>
            }<br/>
        }<br/><br/>
        public static void step1Connect() throws JCoException<br/>
        {<br/>
            JCoDestination destination = JCoDestinationManager.getDestination(ABAP_AS);<br/>
            System.out.println("Attributes:");<br/>
            System.out.println(destination.getAttributes());<br/>
            System.out.println();<br/><br/>
            destination = JCoDestinationManager.getDestination(ABAP_MS);<br/>
            System.out.println("Attributes:");<br/>
            System.out.println(destination.getAttributes());<br/>
            System.out.println();<br/>
        }<br/><br/>
        public static void main(String[] args) throws JCoException<br/>
        {<br/>
            step1Connect();<br/>
        }<br/>
    }<br/>
    <br/><br/>
    Each time I run the application I run into an error:
    <br/><br/>
    Attributes:<br/>
    Exception in thread "main" com.sap.conn.jco.JCoException: (102) JCO_ERROR_COMMUNICATION: Connect to SAP gateway failed<br/>
    Connection parameters: TYPE=A DEST=ABAP_AS_WITHOUT_POOL ASHOST=localhost SYSNR=06 PCS=1<br/><br/>
    LOCATION    CPIC (TCP/IP) on local host with Unicode<br/>
    ERROR       connection to partner '127.0.0.1:3306' broken<br/>
    TIME        Mon May 09 10:46:46 2011<br/>
    RELEASE     720<br/>
    COMPONENT   NI (network interface)<br/>
    VERSION     40<br/>
    RC          -6<br/>
    MODULE      gwxx.c<br/>
    LINE        646<br/>
    DETAIL      NiIRead: P=127.0.0.1:3306; L=0.0.0.0:50496<br/>
    SYSTEM CALL GwRead<br/>
    ERRNO       10054<br/>
    ERRNO TEXT  WSAECONNRESET: Connection reset by peer<br/>
    COUNTER     2<br/><br/>
         at com.sap.conn.jco.rt.MiddlewareJavaRfc.generateJCoException(MiddlewareJavaRfc.java:662)<br/>
         at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcClient.connect(MiddlewareJavaRfc.java:1362)<br/>
         at com.sap.conn.jco.rt.ClientConnection.connect(ClientConnection.java:721)<br/>
         at com.sap.conn.jco.rt.PoolingFactory.init(PoolingFactory.java:103)<br/>
         at com.sap.conn.jco.rt.ConnectionManager.createFactory(ConnectionManager.java:293)<br/>
         at com.sap.conn.jco.rt.DefaultConnectionManager.createFactory(DefaultConnectionManager.java:46)<br/>
         at com.sap.conn.jco.rt.ConnectionManager.getFactory(ConnectionManager.java:262)<br/>
         at com.sap.conn.jco.rt.RfcDestination.initialize(RfcDestination.java:509)<br/>
         at com.sap.conn.jco.rt.RfcDestination.getAttributes(RfcDestination.java:347)<br/>
         at com.sap.conn.jco.rt.RfcDestination.getAttributes(RfcDestination.java:27)<br/>
         at sample.StepByStepClient.step1Connect(StepByStepClient.java:74)<br/>
         at sample.StepByStepClient.main(StepByStepClient.java:304)<br/>
    Caused by: RfcException: [null]<br/>
        message: Connect to SAP gateway failed<br/>
    Connection parameters: TYPE=A DEST=ABAP_AS_WITHOUT_POOL ASHOST=localhost SYSNR=06 PCS=1<br/>
    <br/><br/>
    Second question: What seems to be the problem with my sample application? Do I need to use a different Java Connector for SAP Business One or SAP Business One does not support Java Connector?
    <br/><br/>
    Please help.
    <br/><br/>
    Thank you all.
    Edited by: kevinroy on May 9, 2011 4:51 AM

    Hi,<br/>
    Thank you very much for the reply. I am now able to move forward with what I am doing.<br/>
    I used the following code in connecting but am encountering an error:<br/>
    public class ConnectSAP {
         // company interface
         public ICompany company;
         private SBOErrorMessage errMsg = null;
         public static void main(String[] args) {
              ConnectSAP company = new ConnectSAP();
              company.conn();
         //method make connection andinitialize company instance
         public int conn() {
              int rc = 0;
              try {
                   company = SBOCOMUtil.newCompany();
                   company.setServer("192.168.0.216"); //192.168.0.216
                   company.setCompanyDB("SBODemoUS");
                   company.setUserName("manager");
                   company.setPassword("manager");
                   company.setDbServerType(SBOCOMConstants.BoDataServerTypes_dst_MSSQL2005);
                   company.setUseTrusted(new Boolean(false));
                   company.setLanguage(SBOCOMConstants.BoSuppLangs_ln_English);
                   company.setDbUserName("username"); 
                   company.setDbPassword("password");
                   //company.setAddonIdentifier("...");     
                   //company.setLicenseServer("...");
                   rc = company.connect();
                   if (rc == 0) {
                        System.out.println("Connected!");
                   } else {
                        errMsg = company.getLastError();
                        System.out.println(
                             "I cannot connect to database server: "
                                  + errMsg.getErrorMessage()
                                  + " "
                                  + errMsg.getErrorCode());
              } catch (Exception e) {
                   e.printStackTrace();
                   return -1;
              return rc;
         public void freeConnection(){
              company.disconnect();
    }<br/>
    I am getting the error "Failed to Connect to SBOCommon -111".<br/>
    Error is still the same even if I set UseTrusted to true and comment the DbUserName and DbPassword.<br/>
    Do I need to specify the license? Or login to SAP before connecting?<br/>
    Thank you.

  • How to get pdf file from sap presentation server using java connector

    Hi Friends,
    with the below code i am able to get po details in pdf in presentation server.
    DATA : w_url TYPE string
           VALUE 'C:\Documents and Settings\1011\Solutions\web\files\podet.pdf'.
    CALL FUNCTION 'ECP_PDF_DISPLAY'
            EXPORTING
              purchase_order       = i_ponum
           IMPORTING
      PDF_BYTECOUNT        =
             pdf                  = file  " data in Xsting format
    *Converting Xstring to binary_tab
          CALL FUNCTION 'SCMS_XSTRING_TO_BINARY'
            EXPORTING
              buffer                = file
      APPEND_TO_TABLE       = ' '
    IMPORTING
      OUTPUT_LENGTH         =
            TABLES
              binary_tab            = it_bin " data in binary format
    **Downloading into PDF file
          CALL FUNCTION 'GUI_DOWNLOAD'
            EXPORTING
      BIN_FILESIZE                    =
              filename                        = w_url
              filetype                        = 'BIN'
             TABLES
              data_tab                        = it_bin
    when i am using java connector , to retirve the file from presentation server , the follwoing error i am getting...
    init:
    deps-jar:
    compile-single:
    run-single:
    com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: Error in Control Framework
            at com.sap.mw.jco.rfc.MiddlewareRFC$Client.nativeExecute(Native Method)
            at com.sap.mw.jco.rfc.MiddlewareRFC$Client.execute(MiddlewareRFC.java:1244)
            at com.sap.mw.jco.JCO$Client.execute(JCO.java:3842)
            at com.sap.mw.jco.JCO$Client.execute(JCO.java:3287)
            at PdfGen.<init>(PdfGen.java:35)
            at PdfGen.main(PdfGen.java:78)
    Java Result: 1
    BUILD SUCCESSFUL (total time: 1 second)
    i debugged too, problem with <b>gui_download......</b>
    I am very glad to all with your suggestions!!
    Regards,
    Madhu..!!

    Hi
    You can try to create an external command (transaction SM69).......sorry I've forgotten,,,,they works on application
    How do you call CL_GUI_FRONTEND_SERVICES=>EXECUTE?
    Max
    Edited by: max bianchi on Oct 13, 2011 10:27 AM

  • Is this possible: SAP Java Connector - XI - R3 with XI RFC Adapter?

    Hi,
    I try to call a RFC on a remote R/3 System over the XI Server in a Java Application with SAP Java Connector.
    I have configured a RFC Sender Adapter in XI. I get the
    following Exception:
    "lookup of alternativeServiceIdentifier via CPA-cache failed for channel 'SenderChannel_RFC"!
    Is this scenario possible? Or do the connection from
    a SAP Java Connector App to the XI RFC Adapter not work?
    You can't set the Client and System ID of a Third-Party or
    Standalone Java system in the SLD.
    Thanks for any help!
    Regards
    Wolfgang

    Hi,
    We use a JCO for directly connecting to sap systems.
    In that case we need not use any XI also.
    But if you want to use RFC adapter and java application the best way is to use java proxies as sender and reciever as RFC adapter.
    I donot think there is any  architectural significance in using rfc adapter of XI while using JCO.
    Let me know if I mis-understood the context.

  • Using Java Connector Calling RFC.....But it's not returning correct result

    Hi Friends,
    In the code ....
    I am calling Remote Function module ZRFC_PO_VEND_VALID using java connector and passing PO_Number and Vendor Number as input parameters and after execution it returns (E_POVALID =1 [PO_NUMBER exists for Vendor number] otherwise E_POVALID = 0 )
    when i am executing the below code ....in both cases it is returning Zero value.
    I tested the function module in se37 its working....
    may i know the reason for this....
    import com.sap.mw.jco.*;
    @author Thomas G. Schuessler, ARAsoft GmbH
    http://www.arasoft.de
    public class TutorialBapi1 extends Object {
    JCO.Client mConnection;
    JCO.Repository mRepository;
    public TutorialBapi1() {
    try {
    // Change the logon information to your own system/user
    mConnection =
    JCO.createClient("100", // SAP client
    "abap", // userid
    "abap", // password
    "en", // language
    "sapdev1", // application server host name
    "00"); // system number
    mConnection.connect();
    mRepository = new JCO.Repository("ARAsoft", mConnection);
    catch (Exception ex) {
    ex.printStackTrace();
    System.exit(1);
    JCO.Function function = null;
    JCO.Table codes = null;
    try {
    function = this.createFunction("ZRFC_PO_VEND_VALID");
    if (function == null) {
    System.out.println("ZRFC_PO_VEND_VALID" +
    " not found in SAP.");
    System.exit(1);
    //mConnection.execute(function);
    JCO.Field vendID = function.getImportParameterList().getField("I_EBELN");
    JCO.Field poID = function.getImportParameterList().getField("I_LIFNR");
    vendID.setValue("20081");
    poID.setValue("4500000017");
    try {
    mConnection.execute(function);
    catch (Exception ex) {
         ex.printStackTrace();
         System.exit(1);
    JCO.Field povalid =
         function.getExportParameterList().getField("E_POVALID");
    //if (povalid.getValue() == null ){
         // System.out.println("Error Message");
    System.out.println(povalid.getValue());
         //if (povalid == null ){
              //System.out.println(povalid.getValue("E_POVALID"));
              //System.out.println("Error Message");
              //System.exit(1);
    catch (Exception ex) {
         ex.printStackTrace();
         System.exit(1);
    mConnection.disconnect();
    public JCO.Function createFunction(String name) throws Exception {
         try {
         IFunctionTemplate ft =
         mRepository.getFunctionTemplate(name.toUpperCase());
         if (ft == null)
         return null;
         return ft.getFunction();
         catch (Exception ex) {
         throw new Exception("Problem retrieving JCO.Function object.");
         public static void main (String args[]) {
         TutorialBapi1 app = new TutorialBapi1();
    with warm regards,
    Madhu.

    Hi Ravi ,
    I tried as per your sugggestion..still getting the same problem.
    Regards,
    Madhu!!

  • Integrating SAP Java Connector with SAP XI

    Hi XI experts
    We are about to integrate our SAP ERP2004 system with a new WMS system.  The vendors of the WMS system normally integrates with ERP directly through SAP Java Connector, but we would like to put SAP XI between the two systems so we have good way of monitoring the messages beeing sent.
    I would like to make a synchronous test scenario where we send a ARTMAS idoc from SAP to XI which sends it to the WMS. After WMS system receives the ARTMAS Idoc it sends an acknowledgement back to XI which passes it on to SAP.
    The integration would then look like this:
    SAP ERP <-> SAP XI <-> WMS (Jco)
    Is this scenario possible? And if so, how would you suggest to set it up?
    I was thinking of using the RFC adapter to connect to the Java Connector of WMS, but am not sure if this is the right approach or how it should be set up.
    Any help or comments would be greatly appreciated.
    Best Regards
    Chris

    I have made a setup like this:
    SAP <-> XI <-> WMS
    The Scenario is like this:
    SAP sends an ARTMAS03 idoc to XI which maps it directly to the same ARTMAS03 idoc structure (need a few changes in the future so thats why im not using IDOC tunnelling) then it uses a RFC receiver adapter to connect to our SAP gateway, where the WMS is registrered through JCO.
    When I first sent the idoc, i got a "RfcAFWException: failed to read funtionname from XML document: missing namespace declaration(2)" then after reading Q23 in note 730870, I used the RFCNormalizer xslt to change the namespace to a "urn:sap-com:document:sap:rfc:fuctions" instead of the "urn:sap-com:document:sap:idoc:messages". The error is now "functiontemplate from repository was <null>".
    As far as i can see the error is because the metadata repository defined in the RFC adapter cant find the function module that normally would be in the root of a RFC-XML. But I dont know how I can send an Idoc through the rfc adapter to the gateway then. Anyone got some ideas?
    Thanks
    Chris

  • DI Java Connector

    Hello All,
    First of all i have to say that im sick of searching abt this.......so if anyone can help it'll mean a lot to me. im trying to connect to SAP Business One from Java, in the SDK help file it says that i can connect to B1 through DI API, but how can i do it with Java???...........it says to use "SAPbobsCOM67.dll" file to connect with java....how can i do this??........and it says it includes the packages "com.sap.smb.sbo.api" , "com.sap.smb.sbo.util" , "com.sap.smb.sbo.wrapper.util" but i cant find it......i downloaded the SAP JCo 2.0 too from SAP Service Market Place....but it only has classes to connect to SAP R/3 System. What i need to do is connect to Business One with pure Java Code........using those class packages i listed above....but i don't seem to find it on the internet.....somebody pls help me on this.....because im not into VB .Net.... Thanks.

    Hi Malinda,
    You have to install the DI API and the SBO SDK to have the Java Connector (JCO)libraries and to have the JCO help file.
    In basic the API is the same as with .NET, but there are some differences.
    You can scan this forum for some samples.
    Regards
    Ad

  • Java Connectors

    Hello Experts,
    We have a real time requirement for getting data from r3 to bi and none of our data sources are delta enabled.
    So we are planning to use java connectors for this. I found that the SAP Query Connector could report realtime from BI or R3. But we need something which gets data from r3 to BI.
    Can you please lead me by guiding me towards the connectors that could be used for getting data from r3 to bi realtime?
    thanks,
    Sri.
    P.S. I promise to award points for helpful answers. Thanks Again!
    Message was edited by:
            Srirama Chandra

    use jco interface to get data from r/3

  • Download Sap Java connector

    Where can I download sap jco?

    Hi Alfonso !!!
    You can navigate through http://service.sap.com/connectors
    it's the place for all kind of SAP Connectors family.
    So, under the option *Overview choose SAP Java Connector link, at this point the left navigation menu will be wide open, so the last step is be able to find there the option "Tools&Services", the page with title Tools & Services: Support and Release Strategy, License Terms, Software Download will be opened, there is the place where you can find all versions of JCO for all supported OS.
    Be sure you also have an "SS" user (Sap Service User like SXXXXXXXXX) to certify your access to this link.

  • Sharing the Metadata Repository (SAP Java Connector)

    Is it possible to share the metadata repository across multiple client processes in the context of the SAP Java Connector?  If so, can someone point me to the technique that I have to implement?
    Each client process creates its own JCO.Pool (with a unique key) and obtains a repository by invoking JCO.createRepository(...).
    Thanks in advance.

    Hi jim,
    You will probably find the answer in this article :
    <a href="http://www.winfobase.de/lehre/lv_materialien.nsf/intern01/84528E02791D4B16C1256E7B004B9571/$FILE/Tips&Tricks_JCo_Programming.pdf">Tips and Tricks in JCO Programming</a>
    Regards,
    Mathieu

  • WDA accessing MySQL DB through Java Connector

    Hi,
    Im having some issues to interfacing a web dynpro abap application with a MySQL DB through a java connector connexion.
    Here what I want to do:
    Doing queries on my MySQL DB after input fields of search criteria and get the results back to display them in the web dyn pro application. (reporting tool-)
    Accessing the data of a MySQL Database in my SAP, to avoid a duplication of data.
    I would like to know how to send a query  to my Java application ?
    And how to send the result of this query to the Webdynpro ABAP ?
    Whats the best and easiest solution ?
    Thanks !

    Found my way through JCo Server.
    I need an rfc or BAPI that have specific parameters --> a table with several specific fields and several fields for search criteria.
    The user enter the search criteria than I send those to my Java server, the Java server retrieve those parameters and perform a SQL query on the MySQL DB. I fill in the table parameter with the result and send the whole table to the abap
    How is it possible ?
    Thanks !

Maybe you are looking for

  • External drive corruption after 10.8.5 update

    Hi, After the upgrade to 10.8.5. my Mini server at home, which had been running for months on end without a hitch prior to that, started having big problems. I have a late 2012 Mini, with a Sharkoon 5 disk cabinet hooked up through USB3.0. The cabine

  • Deselect after moving will delete content!

    Hello! I have a huge problem with the selection tool and I need to know how to fix it because it totally destroys my workflow. (Photoshop CS6) If I move content of a selection and deselect a part, it will delete the part I deselected. How can I turn

  • No luck with CD burning!!!!!!

    I ,as with everyone else on this subject, is curious why Apple is not nipping this MAJOR problem in the bud.Again with me everything was fine until I upgraded. I just bought $12 worth of songs that I can do nothing with since copyright dosn't allow a

  • Why do email recipients receive "Part 1.2.3" attachments?

    Every email sent using Mail that has attachments also includes an extra file, named "Part 1.2.3" or something. Anyone NOT using Mail as an email client gets these files. The file contents are something like "<html><body style="word-wrap: break-word;

  • LSO-Wbt in Class room

    Hi, I have a requirement, Learner can see the Course type but can't book(needs to restrict). Only Training Admin need to book that course. How to do . Please help. Regards, Sushma