Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Creating communication between Java application and SAP

I have to create communication between SAP system and my Java application. I am using JCo and put it in library and class path. While importing package com.sap.mw.jco.*, it shows a compilation error. 

Below is my code:

import com.sap.mw.jco.*;
public void createSnippet() throws JCoException{
         JCO.Client mConnection =
         JCO.createClient("xx", // SAP client
             "xxxx", // username
             "xxxx", // pwrd
             "xxxx", // Select language (null for the default language)
             "xxxx", // Enter application server name
             "xx"); // Enter system number
JCoFunction function = dest.getRepository().getFunction("BAPI_CR");
JCoTable eqptable=function.getTableParameterList().getTable("EQU_LIST");
eqptable.appendRow();
eqptable.setValue("Example1", "MY_VALUE1");
eqptable.setValue("Example", "My_VALUE2");
connection.execute(function);
 }


1 Answer
Anil SAP Gupta

Note that com.sap.conn.jco.JCo can be used as an alternative of com.sap.mw.jco and exists in sapjco.jar. Classes in sapjco.jar files is also different. You can check this link for more details:

com.sap.conn.jco.JCo 


Advertisements

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.