none
SAP RFCTYPE_DATE related error RRS feed

  • Question

  • Hi there,

     

    We are experiencing an error at the adapter level while calling the BAPI_GOODSMVT_CREATE. The schema for this BAPI has several optional date fields. If we do not populate the optional field dates while sending the request, we get an error from the adapter. We suspect the error is being raised while receiving the response back from SAP because the adapter cannot convert an empty value into a date time.

     

    The error is:

     

    Microsoft.ServiceModel.Channels.Common.XmlReaderGenerationException: An error occurred when trying to convert the byte array [30-00-30-00-30-00-30-00-30-00-30-00-30-00-30-00] of RFCTYPE RFCTYPE_DATE with length 8 and decimals 0 to XML format. Parameter/field name: EXPIRYDATE Error message: Year, Month, and Day parameters describe an un-representable DateTime. ---> System.ArgumentOutOfRangeException: Year, Month, and Day parameters describe an un-representable DateTime.

     

    Is there a workaround? What's wrong?

     

    Thanks,

    Rudy

    Friday, June 13, 2008 2:26 PM

Answers

  • With the default settings, the adapter does not consider DATS values of "00000000" to be valid, and hence the exception you see above ("30" in hex is "48" in decimal, which is the ASCII equivalent of "0").

    One workaround is to set the "EnableSafeTyping" binding property to true at both design time (and regenerate your schemas) and run time. When EnableSafeTyping is true, the adapter exposes DATS values as strings instead of DateTime.

    Sunday, June 15, 2008 12:32 AM
  • Unfortunately, this property is not per orchestration, but rather, per send port.

    Coincidentally, we will be releasing a hotfix in about 2 weeks time, which will allow you to keep EnableSafeTyping=false, and at the same time, allow you to specify what DateTime value the adapter should expose when special DATS values like 00000000 or 99999999 are received from SAP. Would that work for you? I can give you the hotfix number when its available.

    Tuesday, June 17, 2008 2:49 PM

All replies

  • With the default settings, the adapter does not consider DATS values of "00000000" to be valid, and hence the exception you see above ("30" in hex is "48" in decimal, which is the ASCII equivalent of "0").

    One workaround is to set the "EnableSafeTyping" binding property to true at both design time (and regenerate your schemas) and run time. When EnableSafeTyping is true, the adapter exposes DATS values as strings instead of DateTime.

    Sunday, June 15, 2008 12:32 AM
  • Thank you for your answer.

     

    That certainly seems to avoid the error, but now we are experiencing some issues around the time zones of the dates we are passing into SAP. It seems the adapter was taking care of converting from the local time into correct time zone (UTC?), but after setting the "EnableSafeTyping" binding property to true, it has stopped doing so. We would like to keep the "EnableSafeTyping" property set to false, as we have a large number of other schemas already generated that way. Is it possible to enable this property at the orchestration level? What's the property schema where this property resides?

     

    Monday, June 16, 2008 1:20 AM
  • Unfortunately, this property is not per orchestration, but rather, per send port.

    Coincidentally, we will be releasing a hotfix in about 2 weeks time, which will allow you to keep EnableSafeTyping=false, and at the same time, allow you to specify what DateTime value the adapter should expose when special DATS values like 00000000 or 99999999 are received from SAP. Would that work for you? I can give you the hotfix number when its available.

    Tuesday, June 17, 2008 2:49 PM
  • The hotfix would definitely work for us. Please let me know the hotfix number when it is released.

     

    Thanks,

    Rudy

    Wednesday, June 18, 2008 12:29 AM
  • The hotfix should be available any day now. The KB number is "954539". You'll have to obtain it via your support channel.

    Tuesday, June 24, 2008 7:54 AM
  • Hi,
     

    Error details: Microsoft.ServiceModel.Channels.Common.XmlReaderGenerationException: An error occurred when trying to convert the byte array [30-00-30-00-30-00-30-00-30-00-30-00-30-00-30-00] of RFCTYPE RFCTYPE_DATE with length 8 and decimals 0 to XML format. Parameter/field name: LAST_RESUB Error message: Year, Month, and Day parameters describe an un-representable DateTime. ---> System.ArgumentOutOfRangeException: Year, Month, and Day parameters describe an un-representable DateTime.

    After applying the patch 954539, I checked the Microsoft.adapter.SAP.dll file version, it is 3.0.4857.0.

    I've set the enablesafetyping to false (both at design and runtime), set enableBizTalkCompatibilityMode="true", enableBusinessObjects="false", and then regenerated the schemas. But I still get the above error when I read the dats values. I've kept the datatypesbehaviors in the send port to defaults.

    Also, I'm exposing theOrchestration as a WCF Service to a .NET Client. Hope I don't get the "Error in deserializing body of reply message for operation" error at the client side.

    Please suggest any resolution for this problem.


    Ashith Raj
    Thursday, June 18, 2009 4:28 PM