SAP offers the SAP Account Engagement for a “out of the box” data integration between the two CX products stated above, the SAP Sales Cloud and SAP Emarsys Customer Engagement, in the context of the master data integration between them. For more information refer: SAP Account Engagement.

In addition to the standard data integration with SAP Account Engagement, the data integration for extension scenarios will be provided via the SAP Cloud Integration including extended customer fields, unsupported data fields during data integration (current state: 25.10.2022).

This blog post describes a simple extension scenario regarding the integration of master data between SAP Sales Cloud and SAP Emarsys Customer Engagement. The scenario is realized with an SAP Cloud Integration – Integration Flow.

Note: The scenario is quite simple and describes only the straight way. It doesn’t cover a complex scenario/requirement. It should provide a basic design idea for the SAP Cloud Integration – Integration Flow.

The following table depicts the steps of the integration flow.

 

Scenario

 

    • SAP Sales Cloud

In SAP Sales Cloud the master data object “Corporateaccount”(B2B Accounts) and the related object “Contact Person” were extended with customer data fields, which are available in  SAP Sales Cloud OData Service.

    • SAP Emarsys Customer Engagement

As a prerequirement, the extension fields in the contact data structure in SAP Emarsys Customer Engagement needs to be created.

    • SAP Cloud Integration – Integration Flow

The process starts with the query of the CorporateAccountCollection in SAP Sales Cloud.

(–>Note: The integration flow was designed for initial load and did not include a delta mechanism. Nevertheless, it would be beneficial to execute only changed data fields in SAP Sales Cloud. This can be achieved with a dynamic date property, which can be used as a filter query on the OData attribute:”EntityLastChangedOn”. For example a generated dynamic date   “Today() -1day” via groovy script. The query would deliver the accounts, which were changed since the date property.)

After receiving the CorporateAccountCollection, the message will be split into a single account and will be enriched via OData, with the Contact Person data of the executed account.

The router step checks if any contact person was contained in the replied message. If not, the process will be route to the end event.

If at least one contact person exists, the message will be routed to a XSLT mapping step. Here it’s possible to include some extension fields of the contact person in SAP SAP Sales Cloud.

The mapping step prepares the message to the target structure of the Emarsys API, which will be converted to JSON afterwards.

The Groovy script generates the Header: X-WSSE, which is required as authentication for Emarsys API (Refer to SAP Emarsys Customer Engagement documentation: https://dev.emarsys.com/docs/emarsys-api/ZG9jOjI0ODk5NzAx-authentication).

Finally, the prepared message will be send to Emarsys API using a HTTP Adapter.

Hence, the contact data in SAP Emarsys Customer Engagement will be updated.

The following table gives a short overview of the integration flow steps in the scenario:

Step Description 
Start Event -Timer Periodically execution of the integration flow (e.g., every day).
OData Call SAP Sales Cloud (Request-Reply) OData query which delivers the Corporate Accounts in SAP Sales Cloud.

    • OData Adapter
    • Address: {HOST}/sap/c4c/odata/v1/customer/CorporateAccountCollection
    • GET Method
Splitter Split the Corporate Account Collection XML in single objects.
Content Modifier Create required exchange properties/header for processing (e.g., AccountID for enrichment OData call).
Content Enricher( Enrich Account with ContactPerson) The OData query to enrich the splitted corporate account with their assigned contact persons. The account id was used as filter for the OData query.

    • OData Adapter
    • Address: {HOST}/sap/c4c/odata/v1/customer/CorporateAccountHasContactPersonCollection
    • GET Method
Router Condition check for contact person. If the cooperate account don’t have any contact person, the integration flow will route to end event.
XSLT Mapping XSLT script for map the message in the required structure for the SAP Emarsys API.
XML to JSON Convert XML structure to JSON.
Groovy Script-Authentication Header

Script to generate the X-WSSE header, which is required for the authentication to SAP Emarsys API.

(Refer to SAP Emarsys Customer Engagement documentation: https://dev.emarsys.com/docs/emarsys-api/ZG9jOjI0ODk5NzAx-authentication).

Send to Emarsys API (Request Reply) Http call to Emarsys API with generated JSON message.

    • Http adapter
    • Address: {HOST}/api/v2/contact/?create_if_not_exists=1&includenulls=true
    • PUT Method

Requested Header: X-WSSE

Overall, I hope that this blog article has given you a general overview and an idea of how a SAP Cloud Integration – Integration Flow may be created for the extension scenario between SAP Sales Cloud and SAP Emarsys Customer Engagement.

Sara Sampaio

Sara Sampaio

Author Since: March 10, 2022

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x