on 03-22-2006 3:02 PM
Hello,
ich would like to read out the table returned by the function module into my java class.
How can I get the dataset of the table into a JCO.Structure class?
JCO.Function function = ftemplate.getFunction();
JCO.Table table = function.getTableParameterList().getTable("EXPORT_TABLE");
for (int loopCounter = 0; loopCounter < table.getNumRows(); loopCounter++) {
table.setRow(loopCounter);
==> here I would like to do the following:
JCO.Structure struc = ???.getStructure(???);
}
Regards,
Friederike
Hi Friederike,
final int fieldCount = table.getFieldCount();
final String[][] columnValues = new String[table .getNumRows()][];
for (int i = 0; i < table.getNumRows(); i++, table.nextRow() ) {
columnValues = new String[fieldCount];
for(int j=0;j<fieldCount;j++) {
columnValues[j] = table.getString(j);
}
}
columnValues contains two dimensional array of table values.
Check this http://help.sap.com/saphelp_nw04/helpdata/en/00/21e23d44d48e5be10000000a114084/frameset.htm
Best regards, Maksim Rashchynski.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Friederike,
From help:
<i>
...
Within this list, access the actual table (getTable()). The class JCO.Table contains all methods that are available for JCO.Structure, together with additional methods for navigation in a table
..
</i>
Why do you need exactly JCO.Structure? It is confusing for ABAPers, because in ABAP type of record table is structure. In java you are accessing fileds directly.
Best regards, Maksim Rashchynski.
User | Count |
---|---|
87 | |
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.