0
votes

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.

Here is a snipet of my JCO3 code:


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

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.

1

1 Answers

1
votes

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().