Continued: Strongly typed date, time and numerical fields from SAP DATS, TIMS and NUMC support in Azure Logic Apps SAP connector

We're about to release the type handling improvements for Azure Logic App SAP connector previously announced here.

The connection will have a new Boolean (true-false) parameter “SafeTyping”, enabling to treat DATS and TIMS as string rather than their XML equivalents xs:date and xs:time (where xmlns:xs=""). This is an opt-in behavior as we encourage our user to use strong types for early detection of issues. BizTalk Server users will recognize the name but be aware this only applies to date and time, not to NUMC as per earlier note we are handling NUMC as text value and not attempting to coerce them into integers.

      "SafeTyping": {
       "type": "bool",
       "uiDefinition": {
         "displayName": "Safe Typing",
         "description": "Use strong types if false, otherwise use string as safe type.",
         "tooltip": "Enables safe typing, which treats types as string instead of strong types (e.g. Date, Time, Datetime), relaxing type and value validations.",
         "constraints": {
           "required": "false",
       "defaultValue": "false"



This parameter will affect the behavior of all of schema generation, send message (both the payload been sent and the response been received) and trigger.


For schema, with “SafeTyping” enabled, the DATS and TIMS SAP types will map to XML string fields with length restrictions only, like this:

      <xs:element minOccurs="0" maxOccurs="1" name="UPDDAT" nillable="true">
         <xs:restriction base="xs:string">
           <xs:maxLength value="8" />
     <xs:element minOccurs="0" maxOccurs="1" name="UPDTIM" nillable="true">
         <xs:restriction base="xs:string">
           <xs:maxLength value="6" />

With strong typing (default of “SafeTyping” false), DATS and TIMS will map to the more straightforward XML types:

<xs:element minOccurs="0" maxOccurs="1" name="UPDDAT" nillable="true" type="xs:date" />

<xs:element minOccurs="0" maxOccurs="1" name="UPDTIM" nillable="true" type="xs:time" />


Then for sending messages, SAP DATS and TIMS response with “SafeTyping” enabled will look like this:



With strong typing (default of “SafeTyping” false), DATS and TIMS will comply to matching XML type format:



See for reference.


Samples for minimum values







Of interest is the default value by SAP for these fields when the fields are not null:




<DATE d2p1:nil="true" xmlns:d2p1=""></DATE>


Our strong type handling here maps SAP’s default date of 000000000 to XML nil because XML does not allow year, month or date value of 0 and does not have a special initial value other than nil equivalent to SAP’s all zeroes. TIMS SAP default of 000000 is a valid XML time value of 00:00:00.

The same applies when SAP has all spaces stored in the DATS – TIMS fields, XML time will come up as 00:00:00 but date will be nill.


Note that for NUMC fields the original 0s from SAP will be preserved and no trimming will occur. E.g.:


Will be now:



Also we had a bug not translating the SAP null values to XML nil. We use to generate empty string values like this:

<ADDR_NO xmlns="https://Microsoft.LobServices.Sap/2007/03/Types/Rfc/"></ADDR_NO>

<FORMOFADDR xmlns="https://Microsoft.LobServices.Sap/2007/03/Types/Rfc/"></FORMOFADDR>

Which will now be corrected to:

<ADDR_NO d3p1:nil="true" xmlns:d3p1="" xmlns="https://Microsoft.LobServices.Sap/2007/03/Types/Rfc/"></ADDR_NO>

<FORMOFADDR d3p1:nil="true" xmlns:d3p1="" xmlns="https://Microsoft.LobServices.Sap/2007/03/Types/Rfc/"></FORMOFADDR>

Allowing to distinguish between empty string and null values.