SAP求指导

幽助 幽助 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
我们部门的脚本和公司有一些数据通讯,使用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 2,693 成员 2,401 内容