Skip to Content

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?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Sep 15, 2014 at 10:38 AM

    Hi,

    perhaps you obtain the libicudecnumber.dll from the NW RFC SDK

    Contents of the NW RFC SDK - Components of SAP Communication Technology - SAP Library

    There is a reference in the sapnco_utils.dll to the above library.

    Hynek

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Hynek Petrak

      Hi Petrak

      Michail uses SAPNCO inside of AnyCPU - Applications... and because this is not supported by SAP .. he resolves the x86/x64 dll's with the Assembly-Resolve-Event (which Points to x86/x64)... this is the reason why the managed dlls are found... and the unmanaged are not.

      (the managed-dlls are referenced in the .Net - App... but they are not directly in the ExecutionPath... so .Net can't find them... and hits the Assembly-Resolve)