SAP Cloud Platform Integration (CPI) Part 8 – Palette Functions 2 – Message Transformers

In this post, we will explore SAP Cloud Platform Integration (CPI) Part 8 – Palette Functions 2 and learn about the standard range of functions available in CPI.

Outline of this blog series:

  1. SAP CPI Introduction
  2. SAP BTP tools and features overview (BTP, Global Account, Sub-Account, Entitlements, Connectivity, Security)
  3. SAP CPI Web IDE overview
  4. Registering a trial account and enrolling to SAP CPI service
  5. Deep dive into Cloud Integration features with real world scenario example
  6. Use cases of palette functions
  7. Adapter configurations
  8. Using Cloud connector for connecting to backend SAP systems
  9. Overview on API Management & Open Connectors
  10. Integration using Open Connectors with real world example

In short, below is the content we will elaborate in this tutorial:

  1. Message Transformers

Today we will see about standard SAP offered range capabilities in CPI. In the past posts, we covered the initial 5 of the beneath featured range capabilities. Prior to moving to the Planning part, we will go through the Message transformers which are an essential piece of the joining system.

  1. Message Transformers

In the message transformers, we do have many transformation tools/palette functions available, such as:

Content Modifier

Converter – CSV to XML / EDI to XML / JSON to XML / XML to JSON / XML to CSV / XML to EDI

Decoder – Base64 Decoder / GZIP Decompression / MIME Multipart Decoder / ZIP Decompression

EDI Extractor

Encoder – Base64 Encoder / GZIP Compression / MIME Multipart Encoder / ZIP Compression

Filter

Message Digest

Script – GroovyScript / JavaScript

XML Modifier

Content Modifier:

This is the most significant and most involved range capability in the IFlow advancement. As the name recommends, adjusting the substance of the approaching payload is utilized. Content in the sense, not just the body of the payload and furthermore the headers and properties.

You can likewise store the approaching payload in property and use it later for any reason. For putting away the approaching payload, you would utilize camel articulation.

I have made one boundary called IdocPayload and source worth will be the body of the approaching payload, thus gave as ${in.body}. Since it is an articulation, I have chosen Articulation as the Source Type. Its not simply just the articulation, we have many Source Types.

Steady, Worldwide Variable, Number Reach, Articulation, XPath, Header, Neighborhood Variable, Property.

You can later reference IdocPayload anyplace in the IFlow by calling the property name with property as a prefix. For e.g.: ${property.IdocPayload}.

These properties won’t be shipped off the recipient side, as it is only for the IFlow improvement. Headers work in the comparative manner as the properties, yet mainly, headers will be shipped off target framework.

Anything you are passing in the Message body part of the substance modifier will be shipped off the subsequent stage of the IFlow, regardless of the approaching payload from source framework.

Converter:

As said before, there are numerous converters accessible. We will see a portion of the habitually utilized converters:

XML to CSV:

Way to Source Component in XSD – You need to give the XPath of the hub from which the CSV to be changed over.

For eg: XML

<message>
   <content>
        <from>webmaster@w3resource.com</from>
        <to>webmaster@w3resource.com 
        <subject>On xml</to>
        <body>Nesting of xml elements must be proper, in a well-formed xml document</body>
   </content>
</message>

Here the XPath will be-/message/content.

Field Separator in CSV – Comma as a matter of course.

Incorporate field name as Headers – On the off chance that you want field name as headers in the primary line of the CSV document, then this choice ought to be empowered.

An Incorporate Parent component – Select this checkbox if you have any desire to incorporate the parent component of the XML document in CSV record.

The Incorporate trait values – Select this checkbox if you have any desire to remember characteristic qualities for the CSV document.

XML to JSON:

JSON prefix separator – Default colon will be chosen. It is the separator among key and worth. For e.g., “key”:”value”. The other dropdown values are: comma, dab, pipe, semicolon, space.

JSON Result encoding – Default is “from header or property”. Framework will peruse the CamelCharsetName encoding design from header or property that is coming in approaching message. On the off chance that no such header or property exists, default UTF-8 will be utilized. The other dropdown values are: UTF-16BE, UTF-16LE, UTF-32BE, UTF-32LE, UTF-8.

Stifle JSON root component – to eliminate root component after change to JSON, then this choice can be empowered.

For eg:

XML:

<note>
  <to>Tove</to>
  <from>Jani</from>
  <heading>Reminder</heading>
  <body>Don't forget me this weekend!</body>
</note>

JSON (upon selecting suppress root element – note is removed):

{
  "to": "Tove",
  "from": "Jani",
  "heading": "Reminder",
  "body": "Don't forget me this weekend!"
}

Streaming – With streaming you can determine whether the entire XML report or just indicated XML components are to be introduced by JSON clusters. In the event that you empower Streaming, you would get another extra field “Convert XML components to JSON Cluster” with dropdowns “Determined ones” and “All”. In the event that you select Determined ones, you need to give the XPath of that hub.

Decoder:

This range can be utilized to decipher the message content which is gotten over network. There are no designs that should be finished in CPI. Simply add it in your IFlow, rest itself take cares.

We have different decoder given:

Base64 Decipher: Disentangles base64-encoded message content.

GZIP De-pressurize: De-pressurizes the message content utilizing GNU zip (GZIP).

Compress De-pressurize: De-pressurizes the message content utilizing compress.

Emulate Multipart Interpret: Changes an Emulate multipart message into a message with connections. In the event that the multipart headers are important for the message body, select Multipart Headers Inline. In the event that this choice isn’t chosen and the substance type camel-header isn’t set to a multipart type, no translating happens.

On the off chance that this choice is chosen and the body of the message isn’t an Emulate multipart (with Emulate headers in the body), the message is taken care of as an Emulate remark and the body is vacant a while later.

For encoders, we truly do have a similar range capabilities, however it is for encoding.

EDI Extractor:

EDI Extractor empowers you to remove EDI headers and move to camel headers. This component separates information from single approaching EDI record and adds it to the trade with the end goal that this data can be utilized further in message handling. EDI extractor can peruse both level document and XML design.

Filter:

It filters required node or list of nodes or value of specific node from the incoming XML message.

For eg:

XML:

<message>
   <content>
      <from>webmaster@w3resource.com</from>
      <to>webmaster@w3resource.com 
      <subject>On xml</to>
      <body>Nesting of xml elements must be proper, in a well-formed xml document</body>
   </content>
</message>

Output XML:

<content>
  <from>webmaster@w3resource.com</from>
  <to>webmaster@w3resource.com 
  <subject>On xml</to>
  <body>Nesting of xml elements must be proper, in a well-formed xml document</body>
</content>

Message Digest:

Beneath URL would make sense of the usecase of Message Summary.

Script:

In PI/PO, we would involve Java for complex planning situations. In CPI, we have Awesome and JavaScript, where Sweet is overwhelming one utilized in CPI people group.

In later posts, we will explore in detail how SAP Cloud Platform Integration (CPI) Part 8 – Palette Functions 2 can be effectively utilized in IFlow development. Stay tuned to discover the full range of functionalities and how they can enhance your integration processes.

 

YOU MAY BE INTERESTED IN

Introduction to ABAP on Cloud

SAP ABAP vs SAP Basis

Epic Evolution of ABAP Programming

 

WhatsApp WhatsApp us