Skip to Content
Product Information
Author's profile photo Deepak G Deshpande

SAP Integration Suite – “Settings” for Message Mapping

Introduction

SAP Cloud Integration version 6.27.**, one of the capabilities of SAP Integration Suite, comes with support of “Settings” in Message Mapping artifact.

This enables integration flow developer on OpenAPI Spec JSON message mapping to configure on how to handle to basic type (basic data type) when the OpenAPI Spec JSON is used in the target mapping schema.

SAP Cloud Integration version 6.27.** software update is planned on end of May 2022 or beginning of June 2022 (date subjected to change).

Limitation:  Currently, when there is a message mapping with source as XML Schema and target as OpenAPI Spec JSON, when target JSON schema has basic type as, e.g., Boolean, in runtime if a source value comes-in as false, the target JSON output payload’s value becomes “false”, treating it as a string.

Through this settings feature, this limitation has been fixed.

Mapping Settings

Below is a screenshot of mapping settings.

 

Settings button in message mapping editor

 

Mapping%20Settings%20dialog

Mapping Settings dialog

By default, the first radio button is selected, it is just to support the existing mappings which already producing the string content in the target JSON payload, e.g. where users might have might have created a work around with some means to remove quotes from the String value. This settings is not only meant for Boolean, but other JSON basic types, like integer, number, would also be considered

Note: Introduction of this setting’s default selection to first radio button for the OpenAPI spec JSON (in source) to OpenAPI Spec JSON (in target) mappings, will not hamper the currently built mappings. In JSON to JSON mapping, if source has value of false, the same is assigned to target node and if a source value has “false”, again the same is assigned to target. If you wish the target node value should adhere to JSON basic type, then 2nd radio button configuration can be selected.

Example

Let’s check on how it impacts the OpenAPI Spec JSON output in message mapping. Consider below message mapping and integration flow where the message mapping is defined.

Sample%20Message%20Mapping

Sample Message Mapping

The above message mapping has source schema as XSD and target schema as OpenAPI Spec JSON

 

Sample Integration Flow which consume above message mapping

Let the Mapping Settings be at default 1st radio button (as in the above Mapping Settings dialog)

Let’s simulate this integration flow by adding simulation start and end points as below

 

Click on the simulation start button, which opens up a dialog. Enter/upload the test payload in body section as show in below screenshot

Mapping%20test%20payload

Mapping test payload

 

Click on Run Simulation, on the integration flow simulation section

 

 

Once simulation completes, select the envelop icon at simulation end point on the sequence connector, which opens up the properties, check the Body section, as shown in sample screenshot below

 

As we can observe in above image highlighted sections, the values of numberType, booleanType and integerType are enclosed with quotes, making them as string values. It is the default and existing behaviour as mentioned in Limitation section above.

 

Open the mapping editor again, change the settings to 2nd radio as shown in below screenshot. Click on OK in the dialog and OK in the mapping editor to save the changes.

Option to handle basic type

Now, reset/clear the integration flow simulation (clear simulation screenshot below),

 

Repeat the steps of adding start and end simulation, and uploading the test payload and run simulation. After simulation completes, check the output as per the screenshot below.

 

As we can observe in above image highlighted sections, the values of numberType, booleanType and integerType are not with quotes but parsed as per their basic types, which fixes the above mentioned limitation in Limitation section.

Next steps

As next step, this settings will be extended to handle the behaviour of source value’s having empty and null content at complete mapping level. I will keep this blog updated once we release this next increment.

Assigned Tags

      6 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Mounika Ravilla
      Mounika Ravilla

      Nice one..!!

       

      But we do have this problem while dealing with integers too, they are considered as strings.

      Using this, are we dealing only Boolean types?

       

       

      Author's profile photo Deepak G Deshpande
      Deepak G Deshpande
      Blog Post Author

      Hi Mounika,

      As I have mentioned in above blog -> "This settings is not only meant for Boolean, but other JSON basic types, like integer, number, would also be considered"

      Hope this clarifies

       

      Thanks

      Deepak

      Author's profile photo Vinay Devalla
      Vinay Devalla

      Hi Deepak, I tried doing the same however only boolean values are transformed correctly. the numbers are integer data types are still shown in quotes. Is it only valid for boolean type?

      Author's profile photo Deepak G Deshpande
      Deepak G Deshpande
      Blog Post Author

      Hi Vinay,

      As I have mentioned in above blog -> "This settings is not only meant for Boolean, but other JSON basic types, like integer, number, would also be considered"

      If you face the issue of it is not working for integer, share your JSON schema, I will get it crosschecked with my team.

      Thanks

      Deepak

      Author's profile photo Dennis Sentler
      Dennis Sentler

      Hello Deepak G Deshpande

      for when do you plan to support this feature:

      "As next step, this settings will be extended to handle the behaviour of source value’s having empty and null content at complete mapping level. I will keep this blog updated once we release this next increment."?

      I have a case, that I can either set a boolean type, or null. But for now, I can only set it to boolean, or don't map it at all. Mapping it to "field":"" (empty string) results in an error of course.

      Don't map the field at all will not update the field in the target system during PATCH operation.

      BR - Dennis

      Author's profile photo Deepak G Deshpande
      Deepak G Deshpande
      Blog Post Author

      Hi Dennis,

      Due to reprioritisation of the topics at our end, I didn't continue on this feature (feature of extending the settings to handle the behaviour of source value’s having empty and null content).

      To add further, SAP has introduced SAP influence to allow Customer to provide feedback and requirements. Refer blog post for more details. https://blogs.sap.com/2020/05/29/central-sap-cloud-platform-feedback-requirements-channel-for-customers-and-partner-now-available/

      I request you to kindly submit the above request in SAP Influence, under SAP Cloud Integration Suite section, for the benefit of better visibility and updates from product management team. This helps product team to bring the above feature in priority.

      Thanks

      Deepak