Skip to Content

SAP JCo – Method JCoMetaData.getLength() does not returns the real length given in the data element

Sep 28, 2017 at 10:07 AM


avatar image
Former Member

I have a question about the method getLength(String fieldname) or getLength(int index) in JCoMetaData (release e.g. 3.0.17).

According to API it should return the max length of the given data field.

If I use this method on a field of type BCD (TYPE_BCD) the result always differs from the length given in the dictionary data element. It seems always: result = <real length> / 2 + 1


Field DSCT_PCT1 in Table ACCOUNTRECEIVABLE, Length: 5, decimal places: 3

But jcoMetaData.getLength("DSCT_PCT1") returns 3. Why not 5?

What shoud I do to get always the real length of such fields?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers