My application sends a lot of data to SAP. To do this, he creates an SAP table object and sends it. I get this error somewhat regularly, but not reliably:
System exception thrown while marshaling .NET type 20081219 to RFCTYPE_BCD
at SAP.Connector.Rfc.RfcMarshal.NetFieldToRfcField(Object src, RFCTYPE type, Encoding encoding, Byte[] dest, Int32 offset, Int32 len, Int32 charSize, Int32 decimals)
at SAP.Connector.Rfc.RfcStructureUtil.ToRfcStructure(Object obj, Byte[] dest, Type t, Encoding encoding, Boolean isUnicode, PropertyInfo[] propinfos, RfcStructInfo structInfo)
at SAP.Connector.Rfc.RfcStructureUtil.GetITabFromList(SAPConnection conn, Object list, Type t, RfcStructInfo structInfo, Int32 itab)
at SAP.Connector.Rfc.RfcClient.PrepareClientParameters(Type classType, MethodInfo m, Boolean isTQRfc, Object[] MethodParamsIn, RFC_PARAMETER[]& paramsIn, RFC_PARAMETER[]& paramsOut, RFC_TABLE[]& tables, ParameterMap[]& paramMaps)
at SAP.Connector.Rfc.RfcClient.RfcInvoke(SAPClient proxy, String method, Object[] methodParamsIn)
at SAP.Connector.SAPClient.SAPInvoke(String method, Object[] methodParamsIn)
What is strange is that this does not happen every time. Also, the .NET type that he complains about, "20081219" is the data I pass in (date), not the type. I think the type of this field RFCTYPE.RFCTYPE_TIME.
Any suggestions for fixing this intermittent error? Is there some kind of state that I have to clear between calls in the SAP RFC?
Update:
As requested, here is the code that calls SAP:
Using sapConnection As New MySapProxy(ConnectionString)
sapConnection.Connection.Open()
sapConnection.TheSapRfcICall(SapOpCode, Nothing, Nothing, sapTable, ResultTable)
End Using
I think multiple threads are using the same connection. Using SAP.Connector.GetNewConnectioninstead has not changed anything.
Update:
, ! ?
, , ?
Update:
@ Igal Serban, , . () ! .
Update:
librfc32.dll 6403.3.78.4732.