0% found this document useful (0 votes)
7 views

content enricher and its use cases

The document discusses the use of the Content Enricher component in SAP Cloud Platform Integration, highlighting its limitations and providing a solution using the ProcessDirect adapter. It details a business scenario where order data from an Order Management System is enriched with customer information from a Customer Relationship Management System. The implementation process is outlined, demonstrating how to overcome the limitations of the Content Enricher by preparing a separate integration process to handle external data sources effectively.

Uploaded by

tsreddy.sr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

content enricher and its use cases

The document discusses the use of the Content Enricher component in SAP Cloud Platform Integration, highlighting its limitations and providing a solution using the ProcessDirect adapter. It details a business scenario where order data from an Order Management System is enriched with customer information from a Customer Relationship Management System. The implementation process is outlined, demonstrating how to overcome the limitations of the Content Enricher by preparing a separate integration process to handle external data sources effectively.

Uploaded by

tsreddy.sr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 22

Community

 SAP Community

 Products and Technology

 Technology

 Technology Blogs by Members

 Cloud Platform Integration: Enrich your content wi...

Technology Blogs by
Members
Explore a vibrant mix of technical expertise, industry
insights, and tech buzz in member blogs covering SAP
products, technology, and events. Get in the mix!
Blog Search

Authentication Failed.

 Authentication Ticket Mismatched, failed authentication.

Cloud Platform Integration: Enrich your content with


ProcessDirect
bhalchandraswcg
Contributor Options

2018 Jul 23 7:06 AM


13 Kudos

14,499

 SAP Managed Tags:

 SAP Integration Suite,

 Cloud Integration

In this blog, the limitations of the Content Enricher component are listed. Next, a
solution to overcome said limitations is demonstrated with an example.

Content Enricher
Content Enricher is a message transformer that uses an external data source to
augment a message with missing information [1].

Content Enricher in SAP Cloud Platform


Integration
"The content enricher adds the content of a payload with the original message in
the course of an integration process. This converts two separate messages into a
single enhanced payload." [2].

Here are some blogs that demonstrate the use of Content Enricher using
SuccessFactors adapter

 SAP HANA Cloud Integration: Content Enricher, Content Modifier

 Blog 5: Content Enricher Pattern in Integration Flows

Limitations

 Only supports SuccessFactors, Soap1.x, and OData adapters

 Only supports XML format

 External data source services requiring a request body (other than the
current one in the exchange) are not supported
Scenario
Let us consider a business use case showcasing limitations of Content Enricher
component in SAP CPI.

Orders will be transferred from an Order Management System (OMS). The OMS
exposes Order data using the OData protocol. The receiver wants the customer's
information for each order in addition to the order data. A Customer Relationship
Management System (CRM) maintains customer information and exposes the data
as an HTTP service and supports JSON format only.

Note: Northwind Test Service is used to act as OMS and CRM [3].

Implementation

The key to the solution is the ProcessDirect adapter. The ProcessDirect adapter can
be used to establish communication between integration processes within the same
tenant [4].

External Data Source Integration Process

To overcome Content Enricher's limitations, we will prepare a separate integration


process to

 Invoke the external data source service using HTTP adapter but expose using
ProcessDirect adapter
 Prepare the response body in XML format

The External Data Source Integration Process expects orders having CustomerID.
Then, the CustomerID filter is prepared to make the HTTP request to CRM. Next,
service is invoked. Finally, JSON output is converted to XML format.

To Content Enricher, this integration process acts as External Data Source


instead of CRM.

Main Integration Process

The main integration process

1. Gets orders from OMS


2. Uses Content Enricher with ProcessDirect adapter

3. Logs the body

Content Enricher is configured as follows:

Example Run
Inside Main Integration Process

The main integration process runs once.

An example output of getting orders is


<Orders>
<Order>
...
<OrderID>10248</OrderID>
...
<CustomerID>VINET</CustomerID>
...
</Order>
<Order>
...
<OrderID>10249</OrderID>
...
<CustomerID>TOMSP</CustomerID>
...
</Order>
...
</Orders>

This will be supplied to the External Data Source Integration Process as input.

Inside External Data Source Integration Process

From the input, CustomerID filter is prepared for $filter parameter:

CustomerID eq 'VINET' or CustomerID eq 'TOMSP' ...

An HTTP GET request is performed


Endpoint https://services.odata.org/V2/Northwind/Northwind.svc/Orders

Query Parameters

$forma
JSON
t
$filter CustomerID eq 'VINET' or CustomerID eq 'TOMSP' ...

The output of the HTTP request

{
"d": {
"results": [
{
...,
"CustomerID": "TOMSP",
"CompanyName": "Toms Spezialitäten",
...
},
{
...,
"CustomerID": "VINET",
"CompanyName": "Vins et alcools
Chevalier",
...
},
...
]
}
}

Finally, the output is converted to XML format ready to be used by Content Enricher

<d>
<results>
...
<CustomerID>TOMSP</CustomerID>
<CompanyName>Toms Spezialitäten</CompanyName>
...
</results>
<results>
...
<CustomerID>VINET</CustomerID>
<CompanyName>Vins et alcools Chevalier</CompanyName>
...
</results>
...
</d>

Note that further actions could be performed on XML data but are skipped to keep
the example simple.

Examples of further actions can be

 Removing the metadata and deferred links

 Renaming d tag to Customers and results tag to Customer

Back to Main Integration Process

Order data is enriched with Customer details using Content Enricher and the body is
logged.

<Orders>
<Order>
...
<OrderID>10248</OrderID>
...
<CustomerID>VINET</CustomerID>
<results>
...
<CustomerID>VINET</CustomerID>
<CompanyName>Vins et alcools
Chevalier</CompanyName>
...
</results>
...
</Order>
<Order>
...
<OrderID>10249</OrderID>
...
<CustomerID>TOMSP</CustomerID>
<results>
...
<CustomerID>TOMSP</CustomerID>
<CompanyName>Toms Spezialitäten</CompanyName>
...
</results>
...
</Order>
...
</Orders>

Conclusion
In summary, using ProcessDirect adapter to develop an integration process to act as
External Data Source has several advantages as follows:

 Preparation of external data in XML format


 The External Data Source can use any communication protocol and may
expect body in the request payload

 Extra transformations can be performed on data before feeding the data to


Content Enricher

References
[1] Enterprise Integration Patterns - Content Enricher. 2018. Enterprise Integration
Patterns - Content Enricher. [ONLINE] Available
at https://www.enterpriseintegrationpatterns.com/patterns/messaging/
DataEnricher.html. [Accessed 22 July 2018].

[2] SAP Help Portal. 2018. Define Content Enricher. [ONLINE] Available
at: https://help.sap.com/viewer/fd940ad7e2034505a055f14e457c6d5b/Cloud/en-
US/8827f9feb94e4264aaf42ac1c6c.... [Accessed 22 July 2018].

[3] https://services.odata.org/V2/Northwind/Northwind.svc

[4] SAP Help Portal. 2018. Configure Communication Channel with ProcessDirect
Adapter. [ONLINE] Available
at: https://help.sap.com/viewer/149e1c8f944645c79f7989e6ed7f5042/Cloud/en-
US/74457187451f431298355fbbf80.... [Accessed 22 July 2018].

Authors

 sanjali.salian01
 bhalchandra.wadekar

 content enricher
 CPI
 enterprise integration patterns
 HCI
 ProcessDirect
 SAP Cloud Platform Integration
 sap hana cloud integration

8 Comments

agnie
Explorer
2018 Jul 25 9:13 PM
2 Kudos

Simple! Informative! Thank you. Keep posting, please!


former_member332934
Explorer
2018 Aug 01 7:52 AM
0 Kudos

Hi Sanjali/Bhalchandra,

Have you tried to use the content in your sourcemessage after the JSON to XML
converter? As far as I know you have to add the 'nodes/subtrees' of the enriched
fields manually to your xsd/wsdl sourcemessage, right? Or do you have an other
way :)?

Regards, Jelle
bhalchandraswcg
Contributor
2018 Aug 01 9:49 PM
0 Kudos

Hi Jelle,

In the example scenario, after JSON to XML converter, only response from
External Data Source is available. The next step after JSON to XML converter is
Content Enricher. After Content Enricher, source message is available enriched with
external data. At this time, if you need the XML Schema of enriched message you
can:

1. Get the schema from Target System


2. Prepare the schema manually

Kind regards,

Bala

babruvahana
Contributor
2020 May 02 10:27 AM
0 Kudos

Hi bhalchandra.wadekar ,

Thanks for the detailed blog.


I am using the above approach in my requirement.

Requirement:

Send invoices to ECC. But, the receiver wants the customer’s information for each
invoice.
I need to call the customer from Receiver3 based on the customerID present in the
Get_Invoices payload which is dynamic.

Please let me know, how I can filter customerID and do the get call?

Regards,

Pavan

bhalchandraswcg
Contributor
2020 May 06 9:59 PM
1 Kudo

Hi babruvahana,

The Input from the Main Integration Process is:

<Orders>
<Order>
...
<OrderID>10248</OrderID>
...
<CustomerID>VINET</CustomerID>
...
</Order>
<Order>
...
<OrderID>10249</OrderID>
...
<CustomerID>TOMSP</CustomerID>
...
</Order>
...
</Orders>

I used Groovy Script to prepare the request for getting the Customers like so:

import com.sap.gateway.ip.core.customdev.util.Message

def Message processData(Message message) {

def Orders = new XmlSlurper().parse(message.getBody(Reader))

def customerIdFilter = Orders.Order.collect {


"CustomerID eq '${ it.CustomerID }'"
}.join(' or ')

message.setProperty('CustomerIdFilter', customerIdFilter)

return message
}

In HTTP Adapter configuration, I set Query as $filter=$


{property.CustomerIdFilter}&$format=json.
Hope this helps,

Bala

babruvahana
Contributor
2020 May 07 9:58 AM
0 Kudos

Thanks, bhalchandra.wadekar

It worked for me.

I have also tried another way of doing it.

I saved the customerID XPath in the exchange property of Content modifier and
used in the HTTP address as https:/HOST/v1/invoices/${property.customerID}

This will fetch the customer which is coming from the Get_invocies XML.

Regards,

Pavan
shankar7891
Explorer
2021 Dec 01 7:23 PM
0 Kudos

Hi BhalChandar.

Does it make sense to add the $filter property in the Content Enricher Lookup even
when the Key ELement of the Original message is already a unique key like person-
id-external instead of say location code or customer id, which need not be unique as
multiple orderIDs can have same customer ID in your example?

In other words,

my scenario: I get Employee master data using CompoundEmployee SFAPI, and for
every employee I have to get additional information from a custom portlet. I am
planning to use a Content Enricher to look up SuccessFactors with OData V2, and
want to enhance the message with the information from Custom Portlet. So, I will be
passing the employee id as the Key Element in the "Original Message" Parameter.

So, for my scenario, do I still need to pass the $filter parameter with relevant
employee ids, as I need the information for all employee id in the XML?
bhalchandraswcg
Contributor
2021 Dec 03 10:49 AM
0 Kudos

Hi ts.shankarnarayanan,

The $filter helps in reducing the response payload. This way the Content Enricher
performs the enrichment faster.

In your case, if you need all employee data, no need to use the $filter parameter.

Hope this helps,


Bala

Labels in this area

 "as_written_by_Marian_Zeis"1
 "automatische backups"1
 "Data Source Migration"1
 "Integration Challenges"1
 "regelmäßige sicherung"1
 "SAP BW 7.4"1
 "SAP BW"5
 "SAP VARIANT CONFIGURAITION2
 "SAP_BUILD_APPS"1
 "SAPDatasphere"2
 "TypeScript" "Development" "FeedBack"1
 *SAP"1

You might also like