0

我正在将我的 JCO2 代码重写为 JCO3 代码以在 64 位 Windows 服务器上运行。当我尝试使用 JCO3 代码读取我的 SAP 表时,它返回一个空表。但是,当我运行 JCO2 代码时,表中有 2 条记录。

这是我的 JCO3 代码的片段:


try
 {
System.out.print("after try");
try {
    ABAP_AS2 = JCoDestinationManager.getDestination(ABAP_MS);
    }
    catch (Exception e) {
        ABAP_AS2 = null;
        System.out.print("ABAP_AS2 = null");
    }
    ABAP_AS2.ping();
JCoFunction function = ABAP_AS2.getRepository().getFunction("ZPC_RFC_READ_QMLN");
        function.execute(ABAP_AS2);
        System.out.println("STFC_CONNECTION finished:");
        JCoTable return_table = function.getTableParameterList().getTable("DATA");   
        Sytem.out.println("get table");
   int records = return_table.getRow();
        System.out.println(records);

结果是记录 = 0。当我在同一张表上运行 JCO2 代码时,结果是记录 = 2。

请告诉我我错过了什么。

4

1 回答 1

1

显然你还没有阅读 API 文档:

`int getRow()`
Returns the current row number. The first row number is 0, the second is 1, and so on.

您可能想切换到getNumRows().

于 2014-05-21T18:37:43.573 回答