on 02-26-2008 1:02 PM
Hello,
I'm programming a Server using JCo.
1)
I call the function from ABAP:
call function 'Z_ZZ_ETI_PRINT'
destination p_rfc
exporting
i_lines = it_lines
exceptions
others = 1.
2)
Here is the java part (the error should be here, because the other function works fine)
if (function.getName().equals("Z_ZZ_ETI_PRINT")) {
System.out.println("[CALL_PR01]");
JCO.Table lines = tables.getTable("I_LINES");
if (lines!=null) {
System.out.println("[CALL_PR01b]");
for (int i = 0; i < lines.getNumRows(); i++) {
lines.setRow(i);
System.out.println(">"+lines.getString("TEXT") + "\n");
}
}
System.out.println("[CALL_PR02]");
}
The variable lines is not null but the table is empty (in any case the loop has no steps).
Thank you for any hint!
Regards,
Tommaso
Try this:
JCO.Table lines = function.getTableParameterlist.getTable("I_LINES");
for(int i=0;i<lines.getNumRows();i++,lines.getNextRow()){
lines.setRow(i);
System.out.println(">"+lines.getString("TEXT") + "\n");
}
lines.getNextRow() method is used to get next row in JCO
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.