How to receive IDOC from non unicode SAP system using WCF SAP Adapter RRS feed

  • Question

  • There is very old SAP system having schema release of 4.0b and the encoding is non unicode (unicode support came into picture after 4.6 SAP release).


    Now when we try to receive schema from this SAP system we get error as "metadata cannot be matched" as WCF always expect the encoding to be unicode.


    How can we configure the WCF Adapter to receive the IDOC from this Old SAP system.


    Thanks in advance!!!

    Ajeet Kumar
    • Moved by Ben Cline1Moderator Thursday, April 1, 2010 8:58 PM Relates to adapters (From:BizTalk Server General)
    Thursday, April 1, 2010 3:29 PM

All replies

  • You may need to use a custom pipeline component to change the encoding of the inbound data to unicode.


    If this answers your question, please use the "Answer" button to say so | Ben Cline
    Thursday, April 1, 2010 8:57 PM
  • Do you mean to use receiveIdocFormat property to use as String and then use custom pipeline to convert to XML??

    Can you pls elaborate how can we receive the IDOC from non unicode SAP system.

    Ajeet Kumar
    Thursday, April 1, 2010 11:02 PM
  • Hi,

    Sap 4.0b is not supported by WCF-SAP adapter.

    But, It should be possible to receive the IDOC if you deploy the metadata for the correct release.
    And the incoming IDOC has the correct relaease number in  it's DOCREL  filed.
    (many times even though you are reciving an IDOC of a different release , SAP populates the DOCREL field with the default SYSREL of SAP)

    Can you give the exact exception being thrown by the adapter ?


    Friday, April 2, 2010 7:23 AM
  • Well I am out on holiday so don't have exact exception but it says like "not able to match metadata. ABAP not supported". After some googling I find out this error comes when BizTalk tries to read metadata from a non unicode SAP System.

    Also the system release is 4.0b (its really very old system), so is there any way to read the IDOC.

    In the link, its menioned the lowest supported SAP version is 4.6c, but I can able to receive 4.6b (system release 4.6b).

    Ajeet Kumar
    Friday, April 2, 2010 9:24 AM
  • Here is the exact error message:

    The adapter "WCF-Custom" raised an error message. Details "Microsoft.ServiceModel.Channels.Common.MetadataException: RFC IDOC_INBOUND_ASYNCHRONOUS could not be resolved against SAP system because its metadata could not be obtained. ---> Microsoft.Adapters.SAP.RFCException: Details: ErrorCode=RFC_FAILURE. AdapterErrorMessage=Could not convert ABAP Internal type identifier "" "" to RFC type identifier. Such ABAP Types are not supported..
       at Microsoft.Adapters.SAP.RFCException.HelperThrow(Int32 retCode, String additionalErrorMessage)
       at Microsoft.Adapters.SAP.RfcFields.ConvertExidToRfcType(Char exid)
       at Microsoft.Adapters.SAP.RfcFields..ctor(Char paramClass, String parameterName, Char exid, Int32 position, Int32 offset_b1, Int32 length_b1, Int32 offset_b2, Int32 length_b2, Int32 decimals, String defaultVal, String description, Char optional, String tableName, String fieldName)
       at Microsoft.Adapters.SAP.RfcClientConnection.GetRfcFunctionInterface(String rfcName)
       at Microsoft.Adapters.SAP.SapFunctionMetadata.ResolveOperationMetadataUsingSdk(String absoluteName, String displayName, String funcName, String operationNamespace, SAPConnection sapConnection, Boolean isTrfc, MetadataLookup metadataLookup, TimeoutHelper timeoutHelper)
       --- End of inner exception stack trace ---
       at Microsoft.ServiceModel.Channels.Common.Design.AdapterAsyncResult.End()
       at Microsoft.ServiceModel.Channels.Common.Channels.AdapterReplyChannel.EndTryReceiveRequest(IAsyncResult result, RequestContext& requestContext)
       at Microsoft.Adapters.Internal.LayeredChannelBindingElement.LayeredInboundChannel`1.System.ServiceModel.Channels.IReplyChannel.EndTryReceiveRequest(IAsyncResult result, RequestContext& context)
       at System.ServiceModel.Dispatcher.ReplyChannelBinder.EndTryReceive(IAsyncResult result, RequestContext& requestContext)
       at System.ServiceModel.Dispatcher.ErrorHandlingReceiver.EndTryReceive(IAsyncResult result, RequestContext& requestContext)".

    For more information, see Help and Support Center at

    Ajeet Kumar
    Monday, April 5, 2010 3:17 PM
  • From the stack trace, it looks like we are using Version 3 IDOC (The called RFC is IDOC_INBOUND_ASYNCHRONOUS ), can we try version 2 IDOC(the called RFC in that case would be -"INBOUND_IDOC_PROCESS").  My guess is - Version 3 IDOCs might not be available for this SAP system.

    Friday, April 9, 2010 8:43 AM
  • From MSDN-




    This function module is used for releases up to 4.0. It processes IDOCS in record types that are valid for 3.x releases. It is also possible to use this function module in 4.x.

    The parameters to this RFC include:

    ·         idoc_control (SAP structure is EDI_DC)

    ·         idoc_data (SAP structure is EDI_DD)


    So , I think, we should be good , if we use version 2 IDOC.

    Friday, April 9, 2010 4:16 PM
  • Even I tried with version 2 IDOCs...we are getting the same error..the ONLY difference being INBOUND_IDOC_PROCESS RFC getting called.

    Seems the error has to do with Non-Unicode.

    We had a call with Microsoft on this and the information I got is Product team have not tested WCF Adapter with such an old and NON-UNICODE SAP system.

    So now the question Is there any way (may be custom binding but not sure) we can make WCF work with 4.0b Non-Unicode system?

    Ajeet Kumar
    Friday, April 16, 2010 4:17 PM
  • Hi,

    From the exception - Could not convert ABAP Internal type identifier "" "" to RFC type identifier, it looks like-
    When the adapter is  trying to retrive metadata for the the RFCs  INBOUND_IDOC_PROCESS/IDOC_INBOUND_ASYNCHRONOUS,
    the Exid(which is basically the SAP Internal ABAP type id) is coming as Blank, for one of the RFC parameters.

    This can possibly occur if the RFC-SDK version does't match the version of the SAP system.

    What is the version of the RFC-SDK being used ?

    Tuesday, April 20, 2010 3:58 PM