SAP求指导
我们部门的脚本和公司有一些数据通讯,使用SAP传输一些数据,但是有时候传输数据时会丢失,现在要去修改,不管是不是成功都要将数据发给财务,由于第一次接触SAP,所以对SAP一点都不了解,求高人指点,谢谢public void RFCJAVAR3(String proj, String perso, String detail)
{
JCO.Client client = null;
try {
// Get a function template from the repository
IFunctionTemplate ftemplate = repository.getFunctionTemplate("ZRFC_GET_PERSO");
// if the function definition was found in backend system
if(ftemplate != null) {
// Create a function from the template
JCO.Function function = ftemplate.getFunction();
// Get a client from the pool
client = JCO.getClient(SID);
// Fill in input parameters
JCO.ParameterList input = function.getImportParameterList();
// input.setValue("0000000004", "ZINFO" );
//?????????? input.setValue("0000000003", "INPUT_SO" );
Structure dd =input.getStructure("INFO");
dd.setValue(proj, "PROJ");
dd.setValue(perso, "PERSO");
dd.setValue(detail, "DETAIL");
input.setValue(dd, "INFO" );
// Call the remote system
client.execute(function);
// Print return message
//JCO.Structure ret = function.getExportParameterList().getStructure("WA_VBAK");
JCO.ParameterList ret = function.getExportParameterList();
System.out.println("-----------------------------------------");
System.out.println("ZRFC_JAVA_LINK_R3 Done" );
}
else {
System.out.println("ZRFC_JAVA_LINK_R3 not found in backend system.");
}//if
}
catch (Exception ex) {
System.out.println("Caught an exception: \n" + ex);
}
finally {
// Release the client to the pool
JCO.releaseClient(client);
}
}
传输的应该是这块代码吧,以前做写这个的同事都不在了,麻烦指点
补充:企业软件 , ERP/CRM