DI API Java Connector

Hello,
Je recherche des exemples d'utilisation de l'API Java avec SAP Business One. En effet, les exemples fournis en VB.Net fonctionne correcteement, par contre, je n'arrive pas à effectuer une connexion en Java.
Help me please !
A+

Hello Laurent,
here's a bit of source code that should work; I hope it helps!
Sorry, but it would take too long to reply in French
Frank
private ICompany m_cmp;
int rc = 0;
try
// initializing the company object                 
  m_cmp = SBOCOMUtil.newCompany();
  m_cmp.setUseTrusted(false);// just as a sample
  m_cmp.setLanguage(SBOCOMConstants.BoSuppLangs_ln_English);
  m_cmp.setUserName("manager");
  m_cmp.setPassword("manager");
  m_cmp.setDBUserName("sa");
  m_cmp.setDBPassword("");
  m_cmp.setCompanyDB("SBODemo_US");
  m_cmp.setServer("(local)");
  rc = m_cmp.connect();
  if(rc == 0)
  else

Similar Messages

  • From Where i can get DI-API Java Connector ?

    Hi,
      Can any one tell me path to install DI-API Java Connector.
    Thanks ,

    Hi,
    If you load the DI-API, the JCO will be installed also
    Regards
    Ad

  • 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.

  • 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 connector example code

    are there any java connector code samples which demonstrate on how to do simple queries as searching a customer and displaying the customer's address details? or modify an existing customer entry and such?
    kind regards
    pascal

    thanks, this was really helpful!
    now i need to get the right vCompany. according to the api-docs that's an instance of ICompany and it seems like this is the way to set all the connection parameters... how do i do that?
    maybe i should be more precise.. what exact properties of the ICompany do i have to set in order to connect to a company?
    i tried with the folowing but did not succeed:
    vCompany = SBOCOMUtil.newCompany();
    vCompany.setServer("10.0.0.152"); //the sap / sql server's ip address
    vCompany.setCompanyDB("SBODemo_Swiss");
    vCompany.setUserName("username");
    vCompany.setPassword("password");
    vCompany.connect(); //returns -8008 (Error while trying to initialize database)
    (of course i replaced username and password with those of a valid user)
    if i add those two lines before the connect statement:
    vCompany.setDbUserName("sa");
    vCompany.setDbPassword("password");
    connect returns -111 which means "Connection to SBO-Common has failed"
    adding a line that sets the language doesn't change anything..
    now i don't know if this really was a step forward or not, but i think it was since i get -8008 even if i enter the wrong ip ...
    what am i missing?
    if all these questions have already been answered in a tutorial or in any document, please give me a link or a hint what to look for, since i didn't find it so far.
    kind regards
    pascal suter
    <i>i keep updating this post as i proceed and as long as i don't get an answer ;)</i>
    Message was edited by: Pascal Suter

  • Thru Java connector to update SAP by BAPI

    Dear...
    How to bring the data from external application through the Java connector to SAP?  Pls help....

    Hai Check the following Document & Links
    Bapi to create customer master 
    BAPI_CUSTOMER_CREATEFROMDATA
    BAPI_CUSTOMER_CREATEFROMDATA1
    Or you can use FM SD_CUSTOMER_MAINTAIN_ALL
    what is BAPI?
    BAPI stands for Business API(Application Program Interface).
    I have answered this question before..
    A BAPI is remotely enabled function module ie it can be invoked from remote programs like standalone JAVA programs, web interface etc..
    You can make your function module remotely enabled in attributes of Function module but
    A BAPI are standard SAP function modules provided by SAP for remote access. Also they are part of Businees Objest Repository(BOR).
    BAPI are RFC enabled function modules. the difference between RFc and BAPI are business objects. You create business objects and those are then registered in your BOR (Business Object Repository) which can be accessed outside the SAP system by using some other applications (Non-SAP) such as VB or JAVA. in this case u only specify the business object and its method from external system in BAPI there is no direct system call. while RFC are direct system call Some BAPIs provide basic functions and can be used for most SAP business object types. These BAPIs should be implemented the same for all business object types. Standardized BAPIs are easier to use and prevent users having to deal with a number of different BAPIs. Whenever possible, a standardized BAPI must be used in preference to an individual BAPI.
    The following standardized BAPIs are provided:
    Reading instances of SAP business objects
    GetList ( ) With the BAPI GetList you can select a range of object key values, for example, company codes and material numbers.
    The BAPI GetList() is a class method.
    GetDetail() With the BAPI GetDetail() the details of an instance of a business object type are retrieved and returned to the calling program. The instance is identified via its key. The BAPI GetDetail() is an instance method. BAPIs that can create, change or delete instances of a business object type
    The following BAPIs of the same object type have to be programmed so that they can be called several times within one transaction. For example, if, after sales order 1 has been created, a second sales order 2 is created in the same transaction, the second BAPI call must not affect the consistency of the sales order 2. After completing the transaction with a COMMIT WORK, both the orders are saved consistently in the database.
    Create( ) and CreateFromData! ( )
    The BAPIs Create() and CreateFromData() create an instance of an SAP business object type, for example, a purchase order. These BAPIs are class methods.
    Change( )
    The BAPI Change() changes an existing instance of an SAP business object type, for example, a purchase order. The BAPI Change () is an instance method.
    Delete( ) and Undelete( ) The BAPI Delete() deletes an instance of an SAP business object type from the database or sets a deletion flag.
    The BAPI Undelete() removes a deletion flag. These BAPIs are instance methods.
    Cancel ( ) Unlike the BAPI Delete(), the BAPI Cancel() cancels an instance of a business object type. The instance to be cancelled remains in the database and an additional instance is created and this is the one that is actually canceled. The Cancel() BAPI is an instance method.
    Add<subobject> ( ) and Remove<subobject> ( ) The BAPI Add<subobject> adds a subobject to an existing object inst! ance and the BAPI and Remove<subobject> removes a subobject from an object instance. These BAPIs are instance methods.
    Check these Links out
    http://searchsap.techtarget.com/ateQuestionNResponse/0,289625,sid21_cid558752_tax293481,00.html
    http://www.sap-img.com/abap/interview-question-on-bapi-rfc-abap-objects-tables.htm
    http://www.sap-img.com/fu033.htm
    http://www.sap-img.com/abap/ale-bapi.htm
    Please check out this thread..
    Re: bapi
    Also refer to the following links..
    www.sappoint.com/abap/bapiintro.pdf
    www.sap-img.com/bapi.htm
    www.sap-img.com/abap/bapi-conventions.htm
    www.planetsap.com/Bapi_main_page.htm
    www.sapgenie.com/abap/bapi/index.htm
    <b>Checkout !!
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    http://techrepublic.com.com/5100-6329-1051160.html#
    http://www.sap-img.com/bapi.htm
    http://www.sap-img.com/abap/bapi-conventions.htm
    http://www.sappoint.com/abap/bapiintro.pdf
    Java Connector(JCO) can call not only BAPI's but also the function modules which are remotely enabled..
    BAPI's as i said earlier are remotely enabled function modules..
    Hence, JCO can call also BAPI's(n not only BAPI's as u mentioned).</b>
    Thanks & regards
    Sreenivasulu P

  • Java Connector hangs

    we have a java application which runs 24 hours/days.
    After an update to SBO 2004 Patch 14 the system hangs from time to time.
    Anybody knows a workaround. The following program reproduces the problem:
    Program to make the java connector hang:
    import com.sap.smb.sbo.api.ICompany;
    import com.sap.smb.sbo.api.IRecordset;
    import com.sap.smb.sbo.api.Recordset;
    import com.sap.smb.sbo.api.SBOCOMUtil;
    import com.sap.smb.sbo.wrapper.com.Dispatch;
    import com.sap.smb.sbo.wrapper.com.Variant;
    public class sapbotest2
      public static void main(String[] args)
        sapbotest2 s=new sapbotest2();
        try {
          for (int i=0;i<10000;i++ ) {
            System.out.println("iteration= "+ i);
            s.run();
        } catch (Exception e ) {
        e.printStackTrace();
      public void run() {
        ICompany company = SBOCOMUtil.newCompany();
        //Database settings:
        company.setServer("localhost");
        company.setDbPassword("471880");
        company.setDbUserName("sa");
        //Business One settings:
        company.setUserName("manager");
        company.setPassword("manager");
        String dbname="";
        // find company database
        IRecordset recordSet=company.getCompanyList();
        for (int i=0;i<recordSet.getRecordCount().intValue();i++) {
          String name=(String) recordSet.getFields().item
    ("cmpName").getValue();
          if (name.compareToIgnoreCase("OEC Computers")
    ==0) {
            dbname=(String) recordSet.getFields
    ().item("dbName").getValue();
            break;
           recordSet.moveNext();
        //recordSet.release();
        recordSet=null;
        company.setCompanyDB(dbname);
        System.out.println("connecting");
        // connect now
        int nResult = company.connect();
        // throw exception if failed
        if ( nResult != 0 )
          System.out.println("Could not connect");
          System.exit(0);
        System.out.println("connected");
        company.disconnect();
        System.out.println("disconnected");

    hello Frank,
    I  tried reusing the company object. The execution is much faster since no objects are created, however is still hangs after 600 or 1000 repetitions.
    It is interesting that the Java Connector always hangs inside the "disconnect()" method.
    The code is now:
    for (int i=0;i<10000;i++ ) {
      System.out.println("iteration= "+ i);  
      company.setServer("localhost");
      company.setDbPassword("471880");
      company.setDbUserName("sa");
      company.setUserName("manager");
      company.setPassword("manager");
      company.setCompanyDB(dbname);
      int nResult = company.connect();
      if ( nResult != 0 )
        System.out.println("Could not connect "+ company.getLastErrorDescription());
        System.exit(0);
      System.out.println("connected");
      company.disconnect();
    Marcos

  • Java Connector setup

    Hi Guys,
    I have to set up the java connector for my appplication, but I ma not able to find the jar library files. Is there any location to find these files or do I need to make use of any other file ?
    Any help is highly appreciated.
    Regards
    Siva

    Hi Gianluigi ,
    Many thanks for ur reply.
    I am using B1 2005 Sp1. I have installed all the components from the installer, but I still dont find the folder " SAP B1 DI API " installed under program files / sap. Am I missing something or do I need to download a different installer.
    Please assist.
    Thanks
    Siva

  • Java connector to update an R3 table from XI

    Hi,
    Is it possible to use java connector to update an R3 table?
    For instance, an 850 was sent to XI from R3 . 
    XI will then update/create a new entry in the R3 table using the Purchase Order ID, Shipment ID and Material number obtained from the 850.
    I have tried using jco only to read a table but not to update a table.
    Thanks a ton!

    Hi,
    Use lookup and in the function module write ur code to update/crreate.
    Refer the below weblog:
    /people/alessandro.guarneri/blog/2006/03/27/sap-xi-lookup-api-the-killer
    /people/bhavesh.kantilal/blog/2006/11/20/webservice-calls-from-a-user-defined-function
    chirag

  • Java connector Approach

    HI,
    MY requirment is as follows :
    the customer has employee base of 1000, he has SAP R/3 installed for which he has only 100 user license available.
    The customer wants to implement HR module which should be used by all 1000 employees in the organization.
    Our Approach :  we want to implement the Java Connector which will be consuming only one license  to acces the data from R/3
    EX :
    mConnection =
    JCO.createClient("400", // SAP client
    "user", // userid
    "********", // password
    "EN", // language
    "iwdf5020", // host name
    "00"); // system number
    mConnection.connect();
    and develop a web Application, which we will be updating the standard infotypes in R/3.
    Finally deploy the application some Tomcat server and make it available across the organization
    Please let me know the approach is feasible or any other option is available ???
    Thanks & Regards,
    vijay.

    thanks, this was really helpful!
    now i need to get the right vCompany. according to the api-docs that's an instance of ICompany and it seems like this is the way to set all the connection parameters... how do i do that?
    maybe i should be more precise.. what exact properties of the ICompany do i have to set in order to connect to a company?
    i tried with the folowing but did not succeed:
    vCompany = SBOCOMUtil.newCompany();
    vCompany.setServer("10.0.0.152"); //the sap / sql server's ip address
    vCompany.setCompanyDB("SBODemo_Swiss");
    vCompany.setUserName("username");
    vCompany.setPassword("password");
    vCompany.connect(); //returns -8008 (Error while trying to initialize database)
    (of course i replaced username and password with those of a valid user)
    if i add those two lines before the connect statement:
    vCompany.setDbUserName("sa");
    vCompany.setDbPassword("password");
    connect returns -111 which means "Connection to SBO-Common has failed"
    adding a line that sets the language doesn't change anything..
    now i don't know if this really was a step forward or not, but i think it was since i get -8008 even if i enter the wrong ip ...
    what am i missing?
    if all these questions have already been answered in a tutorial or in any document, please give me a link or a hint what to look for, since i didn't find it so far.
    kind regards
    pascal suter
    <i>i keep updating this post as i proceed and as long as i don't get an answer ;)</i>
    Message was edited by: Pascal Suter

  • Java connector license

    Our company purchased business one 2005A.  Our SAP business partner told us that to use the sdk java connector for our own purposes we needed to purchase a license (~10K US).  Originally they said we could do any customization we wanted without any additional cost but when we asked for the SDK they said to cough up the money.  Can someone tell me what we need in order to do use the java connector inhouse?

    Hi Chester,
    If you are going to be doing any development using the DI API (which includes the Java connector) then you must have a development license from SAP. I'm not sure on pricing but $10K sounds about right. There used to be a restriction that you needed at least one person in your company who was certified as a development consultant but I don't know if this rule still applies.
    You can develop using the UI API without the development license but this only allows customisation of the user interface of the SBO client.
    Kind Regards,
    Owen

  • 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.

  • Error while deploying MDM Java Connector for EP

    Hi,
    i am a newbie to MDM.i am trying to develop a portal component with the blog "Using MDM5.5 Java Connector with SAP Enterprise Portal 6.0" as reference.
    i created an MDM system in portal and the connection tests passed.
    But when i deploy the code i get the following exception-
    java.lang.NullPointerException
         at com.sap.mdm.connector.connection.MdmConnectionFactory.getConnectionEx(MdmConnectionFactory.java:170)
         at com.sap.portal.ivs.internalconnector.ConnectionProvider.getConnection(ConnectionProvider.java:304)
         at com.sap.portal.ivs.internalconnector.ConnectionProvider.getConnection(ConnectionProvider.java:258)
         at com.sapportals.portal.ivs.cg.ConnectorService.getConnection(ConnectorService.java:478)
         at com.sapportals.portal.ivs.cg.ConnectorService.getConnection(ConnectorService.java:85)
         at com.cts.mdm.MDMtestcomp.doContent(MDMtestcomp.java:36)(this points to the line <b>connection = cgService.getConnection("MDM_SYSTEM_ALIAS", prop);</b>)
         at com.sapportals.portal.prt.component.AbstractPortalComponent.serviceDeprecated(AbstractPortalComponent.java:209)
         at com.sapportals.portal.prt.component.AbstractPortalComponent.service(AbstractPortalComponent.java:114)
         at com.sapportals.portal.prt.core.PortalRequestManager.callPortalComponent(PortalRequestManager.java:328)
    This is my code-
    IConnectorGatewayService cgService = (IConnectorGatewayService)
                   PortalRuntime.getRuntimeResources().getService(IConnectorService.KEY);
              ConnectionProperties prop =
              new ConnectionProperties(request.getLocale(), request.getUser());
                   IConnection connection = null;
                   connection = cgService.getConnection("MDM_SYSTEM_ALIAS", prop);
         INative nativeInterface = connection.retrieveNative();
                        CatalogData catalog = new CatalogData();
                             catalog = (CatalogData)
                   nativeInterface.getNative(CatalogData.class.getName());
                        ResultSetDefinition rsd = new ResultSetDefinition("Customers");
              rsd.AddField("Name");
              Search search = new Search("Customers");
              A2iResultSet rs = null;
                             rs = catalog.GetResultSet(search,rsd,"Name",true,0);
    response.write(rs.GetFields().toString());
    Have i missed anything?
    Should i deploy any .jar file? (i've already deployed MDM4J.jar) and referenced it in portalapp!
    Thanks in advance
    SwarnaDeepika

    Hello Swarna:
    I believe than rather than deploying the MDM4J.jar, you should deploy this components:
    com.sap.mdm.tech.mdm4j.sda
    com.sap.mdm.tech.connector.sda
    BPMDMTECHN00_0.sca
    BPMDMAPPLI00_0.sca
    Once you deploy those, you should have no problems. Another solution would be to take your MDM4J.jar and wrap it into an SDA, then deploy, but that would be pretty much the same.
    Those components are included on your MDM CD. Please ensure you use the same Version/support package/hotfix all over your landscape.
    I hope that helps
    Alejandro

  • RFC JAVA CONNECTOR CAUSING THE JAVA TO BE IN SAFE MODE

    Hi GURUS :
    We have SolMan with JAVA as Add in . Now during the JSPM Launch the JSPM Aborts with the Err Messages as shown :
    in trace file dev_jrfc.trc and in defaultTrace we have this same message :
    >>>>
    #1.5 #0003BA951BE1004C0000000500007486000456B88DE8595D#1221250561628#com.sap.engine.services.rfcengine##com.sap.engine.services.rfcengine#J2EE_GUEST#0##n/a##d7e28da080f311ddc3de0003ba951be1#SAPEngine_Application_Thread[impl:3]_27##0#0#Error#1#/System/Server#Plain###Bean SLDJAVA_ACCESSOR_REQUESTnot found on host <fqdn of host name> ProgId =JCOLDAPI: Path to object does not exist at rfcaccessejb_stateful, the whole lookup name is rfcaccessejb_stateful/SLDJAVA_ACCESSOR_REQUEST.registered entries for FuctionName=JNDIName : {}#
    #1.5 #0003BA951BE1004C0000000600007486000456B88DE85D04#1221250561629#com.sap.engine.services.rfcengine##com.sap.engine.services.rfcengine.handleRequest#J2EE_GUEST#0##n/a##d7e28da080f311ddc3de0003ba951be1#SAPEngine_Application_Thread[impl:3]_27##0#0#Error##Plain###java.lang.RuntimeException: Bean SLDJAVA_ACCESSOR_REQUESTnot found on host <fqdn of host name>, ProgId =JCOLDAPI: Path to object does not exist at rfcaccessejb_stateful, the whole lookup name is rfcaccessejb_stateful/SLDJAVA_ACCESSOR_REQUEST.#
    #1.5 #0003BA951BE1004C0000000700007486000456B88DE85E8C#1221250561629#com.sap.engine.services.rfcengine##com.sap.engine.services.rfcengine.handleRequest#J2EE_GUEST#0##n/a##d7e28da080f311ddc3de0003ba951be1#SAPEngine_Application_Thread[impl:3]_27##0#0#Error##Plain###java.lang.RuntimeException: Bean SLDJAVA_ACCESSOR_REQUESTnot found on host <fqdn of host name>, ProgId =JCOLDAPI: Path to object does not exist at rfcaccessejb_stateful, the whole lookup name is rfcaccessejb_stateful/SLDJAVA_ACCESSOR_REQUEST.
         at com.sap.engine.services.rfcengine.RFCDefaultRequestHandler.handleRequest(RFCDefaultRequestHandler.java:138)
         at com.sap.engine.services.rfcengine.RFCJCOServer$J2EEApplicationRunnable.run(RFCJCOServer.java:254)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
    <<<
    Now , this JCOLDAPI is Java RFC Connector with User PORTALADMIN and at the ABAP Side we see that the J2EE_ADMIN pwd was changed by this PORTALADMIN !! We had at the same time stamp, the message in the log file of the JSPM that credential supplied to log in to J2EE Engine is not valid ( 'cause, the PORTALADMIN had changed the PW
    of the J2EE_ADMIN ) - While attempting to Launch the JSPM for JAVA Patches > It aborts with the same above message !!
    Half of the SW Comp were updated and rest half aborts repeatedly with the above message.
    Same way the Vis Admin won't start with the msg that Credential to connect J2EE is not valid. Although there was no change at the Config Tool Secure Store > J2EE Admin and SAPSR3DB passwords !!
    I have changed both the J2EE_ADMIN and the PORTAL ADMIN to the User Type Service User ( note 622464 ) ..have
    kept the same pw at ABAP and configtool secure store. But the java is not coming up neither through SMICM nor through the startsap j2ee command as SMPADM.
    i.e. it would comeup only in SAFE Mode !!
    This JCOLDAPI RFC Java Connector 's PORTALADMIN has several rights at the ABAP Side and is used for EWA Purpose.
    JAVA is running in SAFE mode and no matter how many time I try at the config tool Side to bring it in normal mode it is not swithcing to normal mode > I disble the safe mode at the ConfigTool Side > Apply > Save . > Restart the JAVA through the jcmon > shutdown and restart cluster under #10 Cluster Admin Menu > it is coming up only in SAFE mode again with the abvoe error message !!! Restart through the SMICM don't even work at all !!. Also, the system is slow ..even to come in safe
    mode JAVA takes about 45 minutes !!!
    Also, since the JAVA is coming up only in safe mode the SLD and the browser page is not available. The jcomon displays the instance status as ' Synchronizing Binaries' since
    last 20 hours ..this  means that the instance is in hang state.
    Any idea how to solve this problem ?
    Thanks a Lot in Advance,
    Regards,
    - Ishan
    Edited by: ISHAN P on Sep 13, 2008 2:54 PM

    hi ishan,
    do you have solved the problem?? as ??
    thanks
    umberto

  • 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

Maybe you are looking for

  • Disc image file & CSS encoding?

    I originally exported a project with CSS encoding from DVDSP to a DLT tape for replication. (DDP 2.0 with CSS) I then created a disc image file of this project and don't remember if I had checked CSS format. Is there a way to determine this by lookin

  • IC Weclient 2007 -Configuring Sales Order and Taxes for Standalone

    Gurus, I need documents for standalone configuration for Sales order and tax configuration. I have already created products but having problems with configuring SO. Please could pls share some documents with me. Regards, Shreya Kadu Edited by: Shreya

  • Why do some elements of a Powerpoint presentation not appear on screen?

    While running through a Powerpoint Presentation, some slides didn't show all elements? is this an issue with how the PPT is built prior to upload? are there specific products that can be installed that would allow for the appearance of all elements i

  • ALV report for Purchase Requisitions(PR)

    Hai All!   i am developing an ALV report for Purchase Requisitions(PR) tht are not approved ( ie IN RELEASE status), so i want to get who has approved PR and who has not approved it... from which table & which field i can get this data... plz help me

  • Problem about file content type and firefox

    Hi, The Firefox made me mad because cant do a simple job : download a XML file. I have a big XML file that crash Firefox when try to open it, so download may be best choice but always Firefox start to show XML files. what is the solution? It is first