我正在将我的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);结果是records = 0。当我在同一个表上运行JCO2代码时,结果是records = 2。
请告诉我我错过了什么。
发布于 2014-05-21 18:37:43
显然,您还没有阅读API文档:
`int getRow()`
Returns the current row number. The first row number is 0, the second is 1, and so on.您可能希望切换到getNumRows()。
https://stackoverflow.com/questions/23790820
复制相似问题