on 06-06-2007 9:36 AM
Hello Everybody,
I'm trying to read (any) tables via TABLE_ENTRIES_GET_VIA_RFC. The individual records - with all fields of the table - are stored in "ENTRY".
How do I unpack BCD fields?
I've used the following code:
private void processRows(JCO.Table table) throws JCO.Exception {
Object[] fieldList = desiredFields.values().toArray();
for (int i=0; i < table.getNumRows(); i++ ) {
table.setRow(i);
String row = table.getField("ENTRY").getString();
appendRow();
for (int f=0; f < fieldList.length; f++) {
FieldInfo fi = (FieldInfo)fieldList[f];
int endIndex = fi._endindex;
if (endIndex > row.length())
endIndex = row.length();
if (fi._offset <= endIndex) {
String val = row.substring(fi._offset, endIndex);
if (fi._type == 'P') {
BigDecimal val1 = new BigDecimal( val );
...
}
try {
setValue(val.trim(), fi._name);
}
catch (JCO.Exception e) {
... }
}
}
}
}
The Exception is thrown at "BigDecimal val1 = new BigDecimal( val );" Any ideas?
Hi Ralf,
please note that "TABLE_ENTRIES_GET_VIA_RFC" is not Unicode-compatible; use "RFC_READ_TABLE" instead.
Oliver
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
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.