Vendor Master Replication in a 2-Tier Scenario
In this blog, we will have a look at Vendor Master replication from ECC to S/4 HANA Cloud. We will cover multiple options like Direct Replication, Data Replication Framework and Replication via iFlow (Approach 2 and 5 in the blog).
In the Direct Replication scenario, a Vendor Master in ECC is created as a Business Partner in S/4 HANA Cloud with relevant roles. The data is replicated via IDoc / ALE. More on this mode of replication can be found here.
We will now go through the configurations required in S/4 HANA Cloud and SAP ECC.
Configuration in SAP S/4 HANA Cloud:
For the SAP S/4 HANA Cloud system to communicate with outside system, Communication Arrangement needs to be set up. The relationship between Communication Arrangement, Scenario, System and User is shown below.
Fig. 1: Overview of Communication User, System, Scenario and Arrangement
- Create a Communication User in SAP S/4 HANA Cloud system. This user credential will be used while setting up an RFC connection in ECC system.
- Maintain a Communication System to specify the host details.
Fig. 2: Overview of Communication User, System, Scenario and Arrangement
- Maintain a Communication Arrangement to facilitate inbound and outbound scenarios. The Communication Scenario used for Vendor Master Replication is SAP_COM_0008.
Fig. 3: Communication Arrangement
- (Optional) AIF enables monitoring of the inbound and outbound messages into SAP S/4HANA Cloud system. First, we need to assign recipients to the namespace and then users to the recipients. For this, we need to create a business role by using the template SAP_BR_CONF_EXPERT_BUS_NET_INT, and assign this to the administrator in the SAP S/4HANA Cloud system.
Configuration in SAP ECC:
For direct replication, we need to maintain Application Link Enabling (ALE) configurations in ECC system.
- Maintain RFC destination to connect to S/4 Cloud system (SM59). The login details should be same as the Communication User set up in S/4 HANA Cloud system. Create an RFC destination of type “G”.
Fig. 4: Maintain RFC Connection (SM59)
- Maintain the Port from where the data will be sent (WE21). Create Port of type XML HTTP. The RFC destination should be the one entered in previous step.
Fig. 5: Maintain Port (WE21)
- Maintain the Partner Profile details. The partner type maintained is Logical system (LS) (WE20). The Port created in Step 2 needs to be assigned to the message type CREMAS.
Fig. 6: Maintain Partner (WE20)
- Maintain the Distribution model with Sender & Receiver logical system and Message Type as CREMAS.
Fig. 7: Maintain Distribution Model (BD64)
- Change Pointer Configuration needs to be done if modified data needs to be replicated. The configuration for CREMAS can be done in SALE -> IDoc Interface -> Modelling and Implementing Business Processes -> Master Data Distribution -> Replication of modified data.
- Field mapping needs to be done for Certain fields. For eg: Company Codes and Purchasing Organizations might have to be mapped.
Fig. 8: Maintain Mapping
- Install the Certificate of S/4 HANA Cloud system and SAP HCI tenant in the SAP ECC system. More info on how to do it can be found here.
Now create a Vendor with relevant data (XK01). Note the Vendor number created. As a last step, to replicate the data, use transaction BD14 (Send Vendor) with the following data.
Fig. 9: BD14 to initiate replication of Vendor Master
Replication using Data Replication Framework (DRF)
In this case, instead of using BD14, we will use Data Replication framework to replicate the Vendor. The configuration on S/4 HANA Cloud remains the same. One of the pre-requisites for Vendor replication using DRF is CVI configuration needs to be enabled in ECC system.
Additional Configuration in SAP ECC:
- Maintain Business System (DRFIMG -> Data Replication -> Define Custom Settings for Data Replication -> Define Technical Settings for Business Systems). Here maintain the business system and the logical system. The logical system is defined in SALE -> IDoc Interface -> Basic Settings -> Logical Systems -> Define logical systems. The logical system defined here should already have the partner profile, port and RFC destination configured as mentioned earlier in the blog.
- Define Replication Model (DRFIMG -> Data Replication -> Define Custom Settings for Data Replication -> Define Replication Models). Define a model name. In “Assign Outbound Implementation” node, enter the relevant Outbound Implementation for Vendor Master. In “Assign Receiver System”, enter the name of the Business System created in the first step.
Fig. 10: Maintaining the DRF customizing
Once the Vendor is created, the replication can be started by using transaction DRFOUT as shown below.
Fig. 11: Initiate the replication using DRFOUT
Replication using iFlow
This option is used when customer would want more roles than the standard ones offered by S/4 HANA Cloud when the Vendor gets converted to BP. The four standard roles are Business Partner, Business Partner Financials, Supplier and Supplier (Fin. Accounting).
Configuration in S/4 HANA Cloud:
For Communication System (Fig. 2), the Host Name should contain the URL of the SAP HCI tenant.
Configuration in SAP ECC:
The RFC destination (Fig. 4) should point to the SAP HCI tenant along with credentials.
Development and Configuration in SAP HCI:
This is what the iFlow would look like:
Fig. 12: iFlow to integrate ECC (Vendor Master) and S/4 HANA Cloud (Business Partner)
As depicted in the picture, the input to the iFlow is an IDOC (CREMAS03/CREMAS) and output is SOAP service to create a Business Partner in S/4 HANA Cloud.
The SOAP service needs be configured as shown below. The Address can be obtained from Communication arrangement (see Fig. 3). In case authentication is chosen as basic, the Credential name should contain the Communication User credentials of S/4 HANA Cloud system.
Fig. 13: Maintain the credentials for SOAP service
The next important component in iFlow is the mapping between IDOC and WSDL file of SOAP service. The source and target needs to be given for mapping. The easiest way to obtain an XSD file from message type CREMAS03 is:
WE60->Documentation->XML Schema (Give Basic type: CREMAS03). An XSD file is created which needs to be given as Source input for mapping. The target mapping can be downloaded from Communication Arrangement in Fig 3.
Fig. 14: Process to get the Message Type in XSD format
Map the source and target fields as per the business use case.
The XSLT transformation in the iFlow can be used if the data needs to be enriched further. In our scenario, we have added a new role. A sample implementation of XSLT transformation to add new role is shown below.
Fig. 15: Sample XSLT to enrich data
Save and deploy the iFlow.
Whenever an IDOC is triggered from ECC system, this iFlow will be triggered. The success/failure of the iFlow can be monitored in “Monitor Message Processing” window in SAP HCI tenant.