Java项目tomcat连接SAP

1.tomcat目录下放配置文件

tomcatHome\bin\sapconnection.jcoDestination

内容:

#SAP connection properties
#Sat Oct 17 10:10:24 CST 2015
jco.client.lang=ZH
jco.client.codepage=8400
jco.client.sysnr=00
jco.client.client=777

jco.client.user=test
jco.client.passwd=testpwd
jco.client.ashost=192.168.0.999

 

2.jdk目录下要有.dll文件

C:\Program Files\Java\jdk1.6.0_33\jre\bin\sapjco3.dll

 

3.项目中要导入sapjco3.jar包

4.java中直接调用:

JCoDestination destination = JCoDestinationManager.getDestination("配置文件名");
JCoRepository repository = destination.getRepository();
JCoFunction function = repository.getFunction(RFC名称);
JCoParameterList importList = function.getImportParameterList(); // 输入参数

JCoParameterList tableList = function.getTableParameterList(); // 表输入参数
JCoParameterList tableList = function.getTableParameterList(); // 表输出参数

 

 

你可能感兴趣的:(sap连接,java)