1

嗨,我正在使用 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");
4

2 回答 2

0

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

于 2018-09-03T20:43:14.060 回答
0

前几天我也有同样的现象...

过了一会儿,我注意到要传递的参数——如果它是一个字符——必须和字段的大小一样长。

您的字段长度是 12 并且是 char。如果你直接在 SAP 中调用你的函数,你会传递 eg1234567891并得到你想要的结果。

但是,如果从 RFC 连接调用它,则必须准备记录001234567891

查找数据库表。使用表中的给定示例进行尝试。

于 2018-08-15T12:18:21.750 回答