Skip to Content
avatar image
Former Member

RFC_READ_TABLE

Hello experts,

I try to use this BAPI so:

private static void bapi(JCoDestination jcoDestination) throws JCoException{

JCoFunction function1 = jcoDestination.getRepository().getFunction("RFC_READ_TABLE");

if(function1 != null){

System.out.println("ok");

}

function1.getImportParameterList().setValue("EKKO", "QUERY_TABLE");

function1.getImportParameterList().setValue("-", "DELIMITER");

function1.execute(jcoDestination);

JCoTable codes1 = function1.getTableParameterList().getTable("DATA");

JCoTable codes2 = function1.getTableParameterList().getTable("FIELDS");

for (int i = 0; i < 100; i++){

System.out.println("gut3");

codes1.setRow(i);

System.out.println(codes1.getString("WA"));

}

}

if I do it like this, I get nothing, no error, just nothing. And I'm sure the table is not empty. Also I try it with EKPO, EKBE.

Futhermore I try in the gui and I get also empty tables DATA, just the table FIELD is not empty???

Does anyone know the reason, or has the same problem??

regard

Igor

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    avatar image
    Former Member
    Jul 26, 2011 at 10:31 AM

    > Futhermore I try in the gui and I get also empty tables DATA, just the table FIELD is not empty???

    You are saying that DATA is empty

    but

    FIELD is not empty...right ??

    well in your code you are trying to fetch data from DATA infact...!

    JCoTable codes1 = function1.getTableParameterList().getTable("DATA");
    JCoTable codes2 = function1.getTableParameterList().getTable("FIELDS");
    
    for (int i = 0; i < 100; i++){
    System.out.println("gut3");
    codes1.setRow(i);
    
    System.out.println(codes1.getString("WA"));
    }
    }

    replace

    codes1.setRow(i);

    with

    codes2.setRow(i);

    Add comment
    10|10000 characters needed characters exceeded