Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Conversion between System.Decimal and DECFLOAT types

Hi All,

I am trying to find an appropriate .NET type best matching DECF16 (eight-byte decimal floating point number, ABAP type a) and DECF34 (sixteen-byte decimal floating point number, ABAP type e) ABAP types. I thought, System.Decimal would be a good candidate for this role. However, when I try to use it for setting a value of a field of type DECF16 in a structure, the following exception is thrown:

...

SAP.Middleware.Connector.RfcTypeConversionException: FIELD F_DF16_DEC of STRUCTURE ZSPF_UT_S_001 (SETTER): cannot convert Decimal into DECF16 ---> SAP.Middleware.Connector.RfcTypeConversionException: Cannot convert decimal -20910087939212300000000000000 into DECF16 ---> SAP.Middleware.Connector.RfcTypeConversionException: Cannot convert string "-20910087939212300000000000000" into DECF16 ---> SAP.Middleware.Connector.RfcTypeConversionException: decfloat shared library could not be loaded

    at SAP.Middleware.Connector.RfcDecFloat.InitRfcDecFloat()

   at SAP.Middleware.Connector.RfcDecFloat.StringToDecFloat16(String value)

   at SAP.Middleware.Connector.RfcScalarMetadataDecF16.ConvertString(String value, ref Object currentValue)

--- End of inner exception stack trace ---

    at SAP.Middleware.Connector.RfcScalarMetadataDecF16.ConvertString(String value, ref Object currentValue)

   at SAP.Middleware.Connector.RfcScalarMetadataDecF16.ConvertDecimal(Decimal value, ref Object currentValue)

--- End of inner exception stack trace ---

    at SAP.Middleware.Connector.RfcScalarMetadataDecF16.ConvertDecimal(Decimal value, ref Object currentValue)

   at SAP.Middleware.Connector.RfcScalarMetadata.ConvertObject(Object value, ref Object currentValue)

   at SAP.Middleware.Connector.RfcDataContainer`1.SetValue(Int32 index, Object value)

--- End of inner exception stack trace ---

    at SAP.Middleware.Connector.RfcDataContainer`1.SetValue(Int32 index, Object value)

   at SAP.Middleware.Connector.RfcDataContainer`1.SetValue(String name, Object value)

...

Am I missing any dependency? Does anybody know how to solve the problem?

replied

Hi Hynek,

correct. Actually, libicudecnumber shared library is part of the delivery of NCo 3.0. @Michail: Simply copy the library to a place, from which your application can load it. Then it will work.

Best regards,

Markus

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question