SAP JCo3 table empty

1.3k Views Asked by At

I am re-writing my JCo2 code to JCo3 code to run on a 64 bit Windows server. When I try to read my SAP table with the JCo3 code it is returning an empty table. However when I run the JCo2 code I have 2 records in the table.

The result is records = 0. When I run the JCo2 code on the same table the result is records = 2.

Please tell me what I am missing.

Here is a snippet of my JCo3 code:

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);
1

There are 1 best solutions below

4
On

Apparently you haven’t read the API documentation:

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

You probably want to switch to getNumRows().