cancel
Showing results for 
Search instead for 
Did you mean: 

Treating BCDs when reading tables through TABLE_ENTRIES_GET_VIA_RFC

Former Member
0 Kudos

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?

Accepted Solutions (0)

Answers (1)

Answers (1)

Oliver_Baer
Explorer
0 Kudos

Hi Ralf,

please note that "TABLE_ENTRIES_GET_VIA_RFC" is not Unicode-compatible; use "RFC_READ_TABLE" instead.

Oliver