首页 > 解决方案 > SAP JCo3 表为空,但已连接

问题描述

嗨,我正在使用 SAP JCo3 连接器以及 jar 提供的 .dll 文件。目的地已成功连接。我的问题是,当我执行 function.execute(destination) 时,function.getTableParameterList().getTable("PART_LIST") 返回一个零行的空表 我实现连接的代码如下

JCoDestination dest  = JCoDestinationManager.getDestination("EOMP");
dest.ping();
JCoRepository repo=  dest.getRepository();
JCoFunctionTemplate ftemplate = repo.getFunctionTemplate("Z_BAPI_GET_ESO_PART");
JCoFunction function = ftemplate.getFunction();
JCoParameterList importParams = function.getImportParameterList();

importParams.setValue("ESO","R1S00444");
importParams.toXML();

function.execute(dest);

JCoParameterList tableParamList=function.getTableParameterList();
JCoTable table=tableParamList.getTable("PART_LIST");

标签: javasapsapjco3

解决方案


我建议调试您的 ABAP 代码。如果它会在这个 PART_LIST 表中填充一些行,那么您也可以在 Java 端获取它们。您的 Java 代码中没有明显的错误,除了importParams.toXML()多余且dest.ping()不需要。


推荐阅读