Setup of CPI iFlow with Custom Business Object

This blog post will explain how you can model your iFlow to insert and update data in your Custom Business Object. As a prerequisite you should read blog post https://blogs.sap.com/2017/05/12/usage-of-odata-service-of-custom-business-object/.

Overall iFlow

The iFlow consists of 8 steps for mass data coming in through a SOAP service and mapping to the OData service of a custom business object (CBO). Each step is explained in detail.

The HTTP session handling is set to “On Integration Flow” to ensure that the same session is used for all calls to SAP Hybris Marketing instead of creating multiple sessions. This increases performance:

In this example the payload of an incoming SOAP Service looks like this: 6 EXTERNAL Max Mustermann 7 EXTERNAL Ellen Musterfrau 8 EXTERNAL John Doe

Step 1: Iterating Splitter to package mass data into chunks of 1000

In order to not overload the CBO backend system the data is handled in chunks of 1000. An iterating splitter is used for that purpose. The incoming payload is split at the token :

After the split the payload looks like this: 6 EXTERNAL Max Mustermann 7 EXTERNAL Ellen Musterfrau 8 EXTERNAL John Doe

Step 2: Process Call to Local Integration Process “Enrich SAP_UUID”

To update or delete an entry, the SAP_UUID as technical key is needed. Therefore for each entry the SAP_UUID is enriched in a local integration process, if the entry already exists in the CBO.

Step 3: Iterating Splitter to handle each entry in a seperate call

Currently CPI does not support batch processing for OData GET calls. Therefore each entry must be handled seperatly. But they can be processed in parallel. The splitting is again done at the Token but this time without grouping:

Step 4: Content Modifier to save the semantic key in properties

The semantic keys of the OData service of the CBO are ContactId and IdOrigin. In the Content Modifier the values are saved in properties for usage in step 5:

Step 5: Content Enricher to read the technical key SAP_UUID

A Get request is made to the SAP Hybris Marketing system to get the technical key SAP_UUID. The properties ContactId and IdOrigin are given over in the filter expression. As the content enricher needs a matching field from the existing payload and from the receiving payload, also the ContactID is requested:

In the Content Enricher properties the result is then mapped to the current payload:

If a SAP_UUID is returned by SAP Hybris Marketing, the payload looks as follows after the content enrichment: 7 00163e35-616b-1ed7-b5b9-662f3d264ba0 7 EXTERNAL Ellen Musterfrau

If no SAP_UUID is returned, the payload looks like this: 8 EXTERNAL John Doe

Step 6: Mapping After Enrichment

As the payload looks different after the content enrichment for new and changed objects, a mapping is introduced that maps both cases to the same structure. As result structure already the OData structure of the CBO is used. The fields ContactID, IDOrigin, Field1 and Field 2 can directly be assigned:

For the field SAP_UUID a complex expression is build. It is checked if the tag SAP_UUID exists in the incoming payload. In this case the SAP_UUID is taken over. In case the tag does not exist, an empty constant is written to the target SAP_UUID tag:

Step 7: Gathering of SAP_UUID Enrichment Calls

In the last step of the local integration process all calls are gathered and enhanced by an overall tag . The overall tag is needed by CPI for further XML processing.

After the gathering the payload looks like this: 00163e0c-0f31-1ee7-8eae-19ed448a1944 6 EXTERNAL Max Mustermann 00163e35-616b-1ed7-b5b9-662f3d264ba0 7 EXTERNAL Ellen Musterfrau 8 EXTERNAL John Doe

Step 8: Map request chunk to OData Batch Processing

The last step of the whole integration flow maps a chunk of 1000 to batch processing of the CBO OData service. The tag is mapped to the tag . The target tag gets an empty constant assigned. The tag is mapped to the tag . The target tags and have a complex expression based if the entry needs to be created or updated. The target tag is not needed and therefore disabled. The target tags and get an empty constant. The target tag has a complex expression. The fields ContactID, IDOrigin, Field1 and Field2 are mapped directly from source to target.

The target tag can either be POST for a new entry or PUT for a changed entry. If the source tag is empty (SAP_UUID equals string ”) then the constant POST is assigned to tag . Else the constant PUT is assigned:

The target tag is only needed for changed entries. Therefore the complex expression is as follows: If the source tag is empty (SAP_UUID equals string ”), revise the result (Not). Only if the revised result is true, create the tag . The creation of the tag is created by concatenation of constant value YY1_HCI_ID_ID_ORIGIN(guid’ with source SAP_UUID and next concatenation to constant value ‘):

The complex expression for the target tag is similar to the target tag . Only if the source SAP_UUID is filled the target tag is created:

The payload now looks as follows: PUT YY1_HCI_ID_ID_ORIGIN(guid’00163e0c-0f31-1ee7-8eae-19ed448a1944’) 00163e0c-0f31-1ee7-8eae-19ed448a1944 6 EXTERNAL Max Mustermann PUT YY1_HCI_ID_ID_ORIGIN(guid’00163e35-616b-1ed7-b5b9-662f3d264ba0’) 00163e35-616b-1ed7-b5b9-662f3d264ba0 7 EXTERNAL Ellen Musterfrau POST 8 EXTERNAL John Doe

Batch requests to an OData service are always send as a POST request. Therefore the Receiver Channel needs to be setup like that:

The timeout is configured with 5 minutes as this is the normal runtime in SAP Hybris Marketing system.

  http://bit.ly/2Cpbpm1 #SAP #SAPCloud #AI

A Digital Marketer Offers Digital Marketing Enthusiasts Timeless Advice

What made you choose digital marketing?

My first attempt at marketing anything on a large scale was when I started my first online prfessional software business. I didn’t know much about marketing, but I was committed to learn everything I could. For the most part I was self-taught and would spend hours watching videos online about marketing. Then I soon realized I had slowly developed a valuable skill set that could help other business owners get more leads and sales even with a little budget. That was when I decided to start a digital marketing agency.

What innovation are you are bringing to the industry?

I am changing the way businesses do marketing. The old ways of marketing are slowly petering out. Print ads, TV commercials, and radio ads are simply not as effective anymore. I believe social media and influencer marketing is the new wave of effective and result based marketing.

What is the biggest challenge you have faced in your journey as an entrepreneur?

With my first website, I had a problem with my payment processing company. I was processing so many orders a day that they had to shut down my account as they thought the volume of conversion was fraudulent. Finding a new payment processing company that would allow me handle large volumes of financial transaction took me a long time.

How did you overcome that challenge?

Sensing that I could lose a great chunk of money and business if I delayed for too long, I stayed up an entire night (after the shutdown) sending applications to payment processing companies in hopes I could get a new account the next day. It worked!

What is your advice for upcoming entrepreneurs?

Hustle! Being an entrepreneur is extremely difficult. You are the captain of your own ship. Nobody wants to hear how you failed unless you succeed at the end. Understand that nothing is going to happen overnight. But if you hustle and never cheat the grind eventually you will get there. These are some of the secrets I teach entrepreneurs looking to master e-commerce.

What advice do you have for millenials reading this?

Understand that it is not going to be easy. Anything that is worth accomplishing is going to be difficult because if it wasn’t it wouldn’t be worth accomplishing. It’s going to take guts, but if you remain consistent and determined with your purpose, there is nothing you can’t accomplish. As I always emphasize, hustle! http://bit.ly/2Cmx2mS #SAP #SAPCloud #AI