Thursday, May 27, 2010

Thomas G. Schuessler, ARAsoft GmbH: "SAP Java Connector" Tutorial

Thomas G. Schuessler, ARAsoft GmbH: SAP Java Connector TutorialCopyright © 2000 ARAsoft GmbH (http://www.arasoft.de). All rights reserved Thomas G. Schuessler, ARAsoft GmbH: "SAP Java Connector" Tutorial Introduction SAP's new Java middleware, the SAP Java Connector (JCO) allows customers and partners to easily build SAP-enabled components in Java. JCO supports both inbound (Java calls ABAP) and outbound (ABAP calls Java) calls in desktop and server applications. Goal and Scope of This Article Before JCO, there was an interface called "Common RFC Interface for Java" (CRI4J) that had been implemented by HAHT, IBM, and SAP. This article does not assume any experience with CRI4J. If you have built CRI4J-based applications without proxies before, you can learn how to convert them to JCO by reading the article Converting "Common RFC Interface for Java" Applications to the New "SAP Java Connector" after or instead of this one. Future articles will discuss the proxies generated for the JCO middleware and how to convert

CRI4J proxy-based applications. The current article does not make the study of the JCO documentation superfluous, but it should help you to get started. It is probably a good idea to look at the Javadoc for the various classes in a separate window while you read this article. We assume that you already know Java and SAP's BAPIs or other RFC-enabled Function Modules (RFMs). Copyright © 2000 ARAsoft GmbH (http://www.arasoft.de). All rights reserved Sample Program Tutorial1 In this tutorial, we want to connect to SAP and call two BAPIs. Import statements Any program using JCO should contain the following import statement. import com.sap.mw.jco.*; Otherwise, you have to fully qualify each class and interface which is very inconvenient. Connecting to SAP All tutorials other than Tutorial4 use direct connections to SAP. If you are interested in session pooling, please refer to Tutorial4. JCO.Client mConnection; A connection (or session) with SAP is handled by class JCO.Client. try { mConnection = JCO.createClient("400", // SAP client "c3026902", // userid "********", // password "EN", // language "iwdf5020", // host name "00"); // system number mConnection.connect(); } catch (Exception ex) { ex.printStackTrace(); System.exit(1); } A Client object is created via a call to createClient(). You can...

Website: osdir.com | Filesize: 37kb
No of Page(s): 12
Download Thomas G. Schuessler, ARAsoft GmbH: "SAP Java Connector" Tutorial.pdf

No comments:

Post a Comment