共用方式為


The EnableSafeTyping Binding Property

In the November CTP of the Adapter Pack V1, a new binding property has been added to the SAPBinding - "EnableSafeTyping" (a boolean)

When this property is true, DATS, TIMS and NUMC fields are exposed as Strings, and any value can be passed back and forth between the client and the SAP Server.

  • For DATS, you (ideally) should pass DATE values in the format YYYYMMDD in order for SAP to interpret it correctly.
  • For TIMS, it (ideally) should be HHMMSS (24 hour format).
  • For NUMC, you (ideally) should pass in a numeric value ("12345" for example).

The adapter will not validate the values you pass in (or which SAP passes out).

When this property is false, then

  • for DATS, only valid DateTime objects can be passed back and forth. (If SAP returns a DATS value of 00000000, or 99999999, an exception will be thrown by the adapter).
  • For TIMS, only valid DateTime objects can be passed back and forth.
  • For NUMC, you must pass in a numeric value (positive integer), and the assumption is that SAP will do the same when sending back a response. An exception will be thrown if the value is not valid.

NOTE - This is different from the Beta2 behavior, wherein, a DateTime value of 9999-12-31 was sent to SAP as 99999999 (and vice versa) and a DateTime value of 0001-01-01 was sent to SAP as 00000000 (and vice versa).

For more information on how the DateTime values are treated by the adapter, have a look at https://blogs.msdn.com/adapters/archive/2007/10/05/date-time-handling-in-the-microsoft-biztalk-net-sap-adapter-wcf.aspx

For the SAP ADO Provider, for both EXEC and SELECT calls, you need to use the 'DisableDataValidation' option to achieve the same functionality. (https://blogs.msdn.com/adapters/archive/2007/10/15/sap-dats-column-containing-the-value-a-b-c-d-problem-when-sap-ado-is-used.aspx).

Comments

  • Anonymous
    February 11, 2009
    Just a clarification to the above post:Keep the value of EnableSafeTyping, the same during design time(gentating the proxy/XSD) and runtime.Whenever you change the value of EnableSafeTyping Binding Property , you need toREGENRATE the Proxy/XMLSchema, as when this property is turned ON, then DATS, TIMS and NUMC fields are exposed as Strings and when it is turned OFF,  DATS, TIMS and NUMC fields are exposed as their original types.