Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect to a SAP System using sapjco3 and Eclipse?

I need to connect to SAP Systems via standard BAPI calls. I already installed JCo (sapjco3) and added the .jar to my build path in Eclipse.

But due to the fact that I am rather a beginner regarding network/server programming, I have no idea how to setup a connection between Eclipse and the SAP Systems...can anyone provide a basic solution or some ideas for that?

Thank you and greetings!

like image 339
Jan Konrad Avatar asked Sep 02 '15 15:09

Jan Konrad


2 Answers

I solved the question by myself after having found a good documentation with examples regarding that topic on the SAP homepage. First you need to define a destination, basically setting up your host and all other relevant information for the network connection. You can find it here: http://help.sap.com/saphelp_nwes72/helpdata/de/48/5fb9f9b523501ee10000000a421937/content.htm

Then you can test your connection by creating a method that gets attributes of the server you are connecting with. You can find the code here: http://help.sap.com/saphelp_nwes72/helpdata/de/48/840186ab5a2722e10000000a42189d/content.htm?frameset=/de/48/874bb4fb0e35e1e10000000a42189c/frameset.htm&current_toc=/de/b4/3f9e64bff38c4f9a19635f57eb4248/plain.htm&node_id=498

The site provides good examples for working with a SAP System in Java.

like image 76
Jan Konrad Avatar answered Nov 04 '22 02:11

Jan Konrad


Setting Up Of SAP Connection using SAP JCO3 in Eclipse IDE One Can Setup SAP Application connection with Java Application using below steps:

Steps to Produce:

  1. Download SAP Java connectors SAPJCO3 (32bit or 64bit based on your System architecture) from SAP Marketplace.
  2. Create a separate folder and keep the downloaded sapjco3 zip file and unzip it.
  3. Copy the location of sapjco3.jar file in the newly created folder.
  4. Now go to Environment Variables and create system variables CLASSPATH if not exist and add location of sapjco3.jar followed by ; ex: D:\sapjco3-NTAMD64-3.0.16\sapjco3.jar;
  5. Edit System Variable PATH and add newly created folder location followed by ; ex: D:\sapjco3-NTAMD64-3.0.16;
  6. Now Go to Eclipse and Create a new project.
  7. Create a new Class with any name for connecting to SAP application.
  8. Right Click on Newly created project and go to build path and click Configure Build Path.
  9. Click on Libraries and Add External Jars.
  10. Now select sapjco3.jar file just downloaded.
  11. Make your class name as same as you created in step 7.
  12. Write the Java code
like image 22
Sameer Kumar Choudhary Avatar answered Nov 04 '22 04:11

Sameer Kumar Choudhary