CX Works

CX Works brings the most relevant leading practices to you.
It is a single portal of curated, field-tested and SAP-verified expertise for SAP Customer Experience solutions

Contact-to-Account Relationships in SAP Marketing Cloud (Part 4/5)

9 min read

Overview

Contact-to-Account Relationships in SAP Marketing Cloud | Part 4: Building the custom integration content for Confirmation of Business Partner Replication

Are you using SAP Marketing Cloud in a B2B scenario and your customer contacts are assigned to multiple accounts in the sales system? 

Then the following article series could help to understand the business scenarios and processes behind a B2B-oriented setup in SAP Marketing Cloud – how to build multiple relationships between contacts and accounts and how to implement following best practices in a standardized data model of a business partner over the whole system landscape.

Part 3 of this article series focused on the details of the Business Partner IFlow and shows how the integration content can be built. Part 4 of this article describes the creation of the Confirm Business Partner Replication IDoc. This step is essential for the Business Partner Integration Flow as this will be used to inform SAP CRM of successful Business Partner Replication and also send the Identification Number that SAP CRM stores back to the Business Partner Entity.

After reading through this article, the article series will be continued with the following part:

Table of Contents

Confirm Business Partner Replication to SAP Business Suite

This chapter shows you how the Standard Integration content from SAP Cloud for Customer with SAP CRM can be reused to send the Business Partner confirmation from SAP Marketing Cloud to SAP CRM.

Step 1 - Start from SAP Cloud for Customer Integration with SAP CRM

Standard Integration PackageSAP Cloud for Customer Integration with SAP CRM

IFlow: Confirm Business Partner Replication to SAP Business Suite

The Standard integration package to integrate SAP CRM with SAP Marketing Cloud does not contain a standard Business Partner Replication confirmation Integration Flow to confirm successful business partner replication back to SAP CRM.  This is mandatory when using the SOAP-based replication to SAP Marketing Cloud in order to maintain the IDs mapped between systems. The created Business Partner will have a new ID specific to SAP Marketing Cloud and the confirmation IFlow is responsible to send this information back to SAP CRM so that further Business Partner references can include this ID as a "ReceiverID". 

Therefore here we started by importing the standard integration flow between SAP CRM and SAP Cloud for Customer to our package, which is a good starting point. As mentioned before, the SOAP service structure is very similar which reduces the amount of mappings we have to redo from scratch.

Changes to be done

Before going into the mapping there are a couple of changes we need to implement to the integration steps.

Add Payload Logger

Add payload loggers to log payload that comes from SAP Marketing Cloud and the mapped Payload that goes to SAP CRM, these are optional but will help through our testing and facilitate the analysis of possible errors.

Payload Logger
import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
 
def Message processData(Message message) {
    map = message.getProperties();
    property_ENABLE_LOGGING = map.get("EnableLogging");
    message.setHeader("SAP_IsIgnoreProperties",new Boolean(true));
     
    if (property_ENABLE_LOGGING.toUpperCase().equals("TRUE")) {
        def body = message.getBody(java.lang.String) as String;
        def messageLog = messageLogFactory.getMessageLog(message);
        messageLog.addAttachmentAsString("Payload BP Confirmation to CRM", body, "text/plain");
    }  
 
    return message;
}


Add Content Modifier

Add Content Modifier to Set Monitoring ID as header and add properties to support the mapping.

  • Add header SAP_ApplicationID that comes in the message header properties to allow us to use further at mapping level.


  • The property enableConfirmation is an external parameter that contains true or false depending on if we want to send confirmations or not. This was implemented in the customer landscape for initial Load Performance Improvements, as the confirmations during Initial Load were causing Performance Issues. The Confirmation IDs were imported using a custom report in SAP CRM. This is probably not required in productive environments but you might face challenges in Test-Environments due to the extra load the Confirmation Process Flow creates.

  • Add properties RCVPRN, RCVPOR and SNDPOR. These are external parameters that will be used to define the sender and receiver-specific properties. The values can also be found inside the inbound IDOC in case you don't know them.

  • Add property EnableLogging also as an external parameter which will contain true or false and will allow us to configure the IFlow to enable or disable the payload loggers.


  • Add a router to define if the integration flow should be run in case enableConfirmation flag is set to true, and to discard the payload in case it is set to false.


After the mentioned changes, the IFlow steps should look similar to the ones below:

At this point, the design of the integration content is mostly done in terms of integration steps. Now the focus shifts to the mapping that currently is set up for SAP Cloud for Customer and SAP CRM, and needs to be changed to SAP Marketing Cloud and SAP CRM.

Step 2 - Replace SAP Cloud for Customer SOAP Service WSDL with SAP Marketing Cloud SOAP Service WSDL

In order to start adapting that mapping, the first change to be done is to replace the message WSDL for the SAP Marketing Cloud SOAP-based web service we are going to use for the confirmation message. Although it's the "same" as the one used in SAP Cloud for Customer(BusinessPartnerSUITEBulkReplicateRequest) the messages might not be exactly the same.

To do so we should download it from SAP Marketing Cloud Communication Arrangement SAP_COM_0475 - SAP Business Partner Integration and click the WSDL download button for the Business Partner - Send Confirmation from SAP S/4HANA Cloud to Client.


After downloading the WSDL you will have to upload it to the message mapping of the integration flow:

 

Go to the message mapping edit and replace the target message:


Now that we have the correct target message WSDL the next step is to review the mappings and make sure we do the proper adaptations.

Step 3 - Update mappings for Business Partner Replication Confirmation to SAP Business Suite

Mappings to Update by Sections:

EDI_DC40

Section: /ZCRMXIF_PARTNER_SAVE_M0501/IDOC/EDI_DC40/

  • IDOCTYP

    • This mapping is to be updated in cases where a custom enhanced IDOC is being used. Otherwise remains unchanged.

  • MESTYP

    • This mapping is to be updated in cases where a custom enhanced IDOC is being used. Otherwise remains unchanged.
  • SNDPOR

    • The standard mapping leverages a value mapping to introduce the SNDPOR information, in this case, this was replaced by a mapping that uses a function to map a property defined as an external parameter earlier.

Get Property
//This method returns value of a property, expects one input prop_name i.e. name of the property to be retrieved
def String get_property(String prop_name,MappingContext context) {
 
    def prop = context.getProperty(prop_name);
 
    return prop;
 
}

  • SNDPRN

    • We map the SenderBusinessSystemID instead of the SenderParty InternalID.

  • RCVPOR

    • The standard mapping leverages a value mapping to introduce the RCVPOR information, in this case, this was replaced by a mapping that uses a function to map a property defined as an external parameter earlier.

  • RCVPRN

    • The standard mapping leverages a value mapping to introduce the RCVPOR information, in this case, this was replaced by a mapping that uses a function to map a property defined as an external parameter earlier.

Conclusion

After completing the above changes in the mapping and after all setup is done in SAP Marketing Cloud and SAP CRM (See Part 5 of this article series) you should be ready to receive Business Partners in SAP Marketing Cloud and send a confirmation message back to SAP CRM with the new BP IDs created in SAP Marketing Cloud. In the next chapter, you will briefly learn how to set up the Business Partner Relation Replication, the Key Mapping and which configuration is required in SAP CRM.

This article series consists of the following articles:

Overlay