on 08-19-2005 6:33 PM
hello,
i am trying to connect my system to Sap system through java class...
in my class i used the following statements...
import com.sap.mw.jco.*;
public class Connect1 extends Object {
JCO.Client mConnection;
it is giving errors as
"the import com.sap.cannot be resolved"
"JCO cannot be resolved to a type"
does the java lib comes with com.sap.mw.jco or we have install these ones separately...
thank you,
aj.
You have to install JCO on your local machine, or obtain the java library sapjco.jar and add it to your classpath.
If you use SAP developer studio, this library comes with it.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ajay,
Nice hear that you got the JCo. Please award point for those replies that helped you.
Please check the below link for details
https://www.sdn.sap.com/sdn/index.sdn?page=crp_help.htm
Thanks
Kathir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
thx balakrishnana and liu,
i have got sapjco jar file...
cheers aj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ajay,
You can download the SAP Java Connector from <b>http://service.sap.com/connectors -> SAP Java Connector</b>. You should have a login at Service Market Place.
Once downloaded copy the sapjco.jar into <b><JAVA_HOME>\jre\lib\ext</b> folder and copy the <b>librfc32.dll</b> and <b>sapjcorfc.dll</b> into the C:\WINNT\system32 folder (or appropiate folder where you have the OS).
That's it and you will be able to run JCo programs.
Thanks & Regards,
Kathirvel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kathirvel,
I am migrating my application from Jboss to SAP WAS 6.40. We were using SAP r/3 adaptors in JBoss, where we were deploying a sap.rar file comprising of the sapjar file.
Do i ned to do a similar thing in SAP WAS or is it al integrated into the Netweaver Application Server? Also do i still need the dll files on my path?
Also in SAP WAS, do i need to deploy the adaptor, if yes where can i configure it.
any help is much appreciated.
thanks
Dushy
Hi Dushy,
You can follow the following steps while integrating ur application to Netweaver Application Server (NAS) -
Note - Only EAR files can be deplyed in NAS. So build it if you dont have
Add these files to the build path:
aii_proxy_rt.jar
aii_util_misc.jar
SAPmdi.jar
sapjco.jar
They can be found under the plugins com.sap.ide.jcb.core\lib\ and com.sap.mw.jco\lib\.
Open your project in Netweaver and do following configurations -
Goto Windows -> Preferences -> On the the right side tree menu click on SAP j2EE Engine
On left side of the screen put the IP Address and Port number of SAP server
Now you will have to Make a SAP connector Using this Engine, by following the steps given :-
Click on File -> New -> Other -> Choose SAP connectivity
Give the name of package in which you want to generate the Proxy Classes which will connect to SAP BAPIs
Give the name of the class file which will contain the information of BAPI
Click on Finish
You need the following code to connect to SAP server -
JCO.Client jcoclient =
JCO.createClient(
"CLIENT",
"USER",
"PASSWORD",
"LANGUAGE",
"SERVER",
"SYSTEM",
"GROUP");
jcoclient.connect();
You need to create an instance of the generated proxy class, supply the proxy instance with a JCo connection, and get the output from the function module
Add the following code:
MyProxy_PortType myproxy = new MyProxy_PortType();
myproxy.messageSpecifier.setJcoClient(jcoclient);
Choose Save.
You will see that you need to handle exceptions if any.
After all execution disconnect the connection by using - jcoclient.disconnect();
Build Your Application EAR and right Click on it to Deploy on the Server This will ask for SDM password. Your application is now deplyed now you have to run the application.
Running Appliaction -
Click on Run -> Run - > Click on J2EE configuration option and Click New
Under Web Objects Tab -> Give your EAR file and welcome file
Under J2EE engine Tab give Click on Select for choosing the instance of J2EE Engine which you have configured previously
GIve the Host Name and Port Number of SAP server
Click on Apply and Run
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.