Skip to Content
Technical Articles
Author's profile photo Indu Sankar

Replicate Products from SAP S/4HANA Cloud to Master Data Integration service

SAP Master Data Integration service is a central hub to which applications can integrate to synchronize their master data. The blog post details the steps involved in replicating the Products from SAP S/4HANA Cloud to SAP Master Data Integration.

The steps for this include creating an SAP Master Data Integration instance, configuring the communication arrangement at SAP S/4HANA Cloud and finally creating a distribution model in Master Data Orchestrator.

 

1. Create SAP Master Data Integration service instance:

1.1 Login to your Business Technology Platform (BTP) subaccount.

1.2 Open ‘Instances and Subscription’.

1.3 Click on create. Enter the below details

Service: SAP Master Data Integration

Plan: sap-integration

Runtime Environment: Cloud Foundry

Space: <your required space>

Instance Name: < A suitable name of your choice>

1.4 Click on Next

Figure 1: Instance creation

 

1.5 Provide the below json

{

    "businessSystemId": "<Business System ID>",

    "application": "s4",

    "xs-security": {

        "xsappname": "<Unique id> ",

        "authorities":[

         "$XSMASTERAPPNAME.PSGenericConfigRead",

         "$XSMASTERAPPNAME.PSGenericConfigWrite"

      ]

    }

}​

businessSystemId: an identifier for your SAP S/4HANA Cloud system. You can also pick this value from Communication systems tile in the SAP S/4HANA Cloud system by filtering by ‘Own System’.

xsappname: a unique value. You can use  the UUID generated from https://www.uuidgenerator.net/.

1.6 Click on Next.

1.7 Click on create

1.8 For the newly created SAP Master Data Integration service instance, Click on actions button (the 3 dots …)

1.9 Select ‘Create Service Key’

1.10 Provide a name for the service key.

1.11 Click on create.

 

2. Setup Generic configuration

2.1 In postman client, get the access token corresponding to the SAP Master Data Integration service instance.

Figure 2: Get access token

The url, client id, client secret can be copied from the service key created in the above step.

Figure 3: Service key

 

2.2. Perform a POST request to

https://one-mds.cfapps.<region>.hana.ondemand.com/product/v0/odata/MD_PRODUCT_BUSINESS_CONFIGURATION/GenericConfiguration

with body as given below. Provie the access token created in previous step.

{"ConfigName":"Business System","ConfigValue": "<System Name>","AllowedValues": "AlphaNumeric"}

System Name: Provide a suitable system name.

 

2.3 You can perform a GET request to confirm that the business system has been set.

https://one-mds.cfapps.<region>.hana.ondemand.com/product/v0/odata/MD_PRODUCT_BUSINESS_CONFIGURATION/GenericConfiguration(‘Business%20System’) 

 

3. Create a communication user in SAP S/4HANA Cloud.

3.1 Open ‘Maintain Communication User’ in SAP S/4HANA Cloud system. Click on New.

3.2 Enter User Name, Description.

3.3 Click on ‘Propose Password’. This gives a password. Note down the password as this is needed while creating destination in BTP if you want to replicate data to SAP S/4HANA Cloud later.

3.4 Click on create.

 

4.Create Communication System

4.1 Open ‘Communication Systems’. Click on New.

4.2 Provide a system ID. This should be the same value that you used in step 2.2.

4.3 Provide Host Name. This can be copied from the uri field of SAP Master Data Integration service key-  eg: one-mds.cfapps.eu10.hana.ondemand.com

4.4 Provide logical system name, Business System Name. Business system name should be same as the value provided in Step 2.2.

4.5. Set ‘Users for Inbound Communication ‘. Click on ‘+’ button.  Provide the username created in step 4. Authentication method should be ‘User Name and Password’.

4.6 Set ‘Users for Outbound Communication’.  Click on ‘+’ button. Provide clientid and clientsecret from the service key of SAP Master Data Integration service instance as the User Name and Password respectively.

4.7 Save the communication system.

 

5. Create Communication arrangement

5.1 Open Communication Arrangements. Click on New.

5.2 Select Product Integration as the scenario. Provide an arrangement name and click on create.

5.3 Set the communication system created in step 4.

5.4 Set Product Number Harmonization as 2.

Figure 4: Communication arrangement

 

5.4 ‘Replicate Product from S/4 System to Client’ with protocol as IDOC service can be set to inactive.

5.5 ‘Product Master – Replicate from SAP S/4HANA Cloud to Client’

i. Set path as /product/v0/soap/ProductMDMBulkReplicateRequestIn?tenantHost=<BTP subaccount name> &tenantId=<BTP Subaccount ID>&sourceSystem=<OWN SYSTEM Name>. 

Own system name can be found under common data in the same communication arrangement.

ii. Provide a Replication Model Name.

iii Replication Mode: Change Replication

iv Output Mode: Direct Output.

Figure 5: Replication

 

5.6 Product Master – Confirmation from SAP S/4HANA Cloud to Client

/product/v0/soap/ProductMDMBulkReplicateConfirmationIn? tenantHost=<BTP subaccount name> &tenantId=<BTP Subaccount ID>&sourceSystem=<OWN SYSTEM Name>

5.7 Click on Save.

 

6. Create a Downstream system which reads the events from SAP Master Data Integration service

6.1 Create another SAP Master Data Integration service instance from BTP cockpit with the below payload.

{

    "businessSystemId": "<Business System ID>",

    "application": "<Application type>",

    "xs-security": {

        "xsappname": "<Unique id> ",

        "authorities":[

         "$XSMASTERAPPNAME.MDOModelMaintain",

         "$XSMASTERAPPNAME.MDOObjectTypeOwnerMaintain",

         "$XSMASTERAPPNAME.MDOTriggerReplication",

         "$XSMASTERAPPNAME.MDOScopeMaintain",

         "$XSMASTERAPPNAME.MDOCopyModel",

         "$XSMASTERAPPNAME.PSGenericConfigRead",

         "$XSMASTERAPPNAME.PSGenericConfigWrite"

      ]

    }

}​

Set the businessSystemId, xsappname as in step 1.5.

Application type can be s4, c4c, commerceCloud etc depending upon the type of your client system.

6.2 Create service key for the instance.

 

7.Subscribe to Master Data Orchestration

Master Data Orchestration provides you a UI where you can create a dsitribution models specifying the mode of data flow, the consumer system, filters etc. You can also configure monitoring, manage business object type and manage data ownership.

7.1 In the subaccount, Select ‘Instances and Subscriptions.’

7.2 Click on Create.

7.3 Select Master Data Integration (Orchestration)

7.4 Select Plan as Standard.

7.5 Click on Create.

 

8. Assign the required roles

8.1. Open Role Collections in BTP cockpit.

8.2. Create a new Role Collection.

8.3 Add roles MasterDataOrchestrationAdmin, MasterDataOrchestrationDisplay.

8.3 Add user by providing mail id.

 

9. Create Distribution model

In distribution model, you can specify the mode of data flow, provider, consumer, frequency etc. You can also specify filters that determine which master data will be distributed.

9.1 Open Master Data Integration (orchestration).

9.2 Open ‘Manage Distribution Model’

9.3 Create a new model.

9.4 Provide a name for the Model.

9.5 Select Product (sap.odm.product.Product) as the Business Object Type

9.6 Set Mode as pull.

Figure 6: Distribution Model

 

9.7 Select Provider Interface as MDI_LOG_PRODUCT

9.8 Select SAP Master Data Integration as provider.

9.9 Select the system that was created in step 6 as the consumer. You can find the system based on the businessSystemId that was provided.

9.10 Save and activate the distribution model.

 

Test the setup

Create a new product in SAP S/4HANA Cloud system from Manage Product Master Data. Check the log API of SAP Master Data Integration by provide access token created based on client id, secret of the downstream system that was created in step 6.

Sample log API endpoint: https://one-mds.cfapps.eu10.hana.ondemand.com/v1/odm/2.3.0/sap.odm.product.Product/events

In the log API if you are able to receive the product that was created in SAP S/4HANA Cloud then your set up is complete!

 

What Next?

If you would like to replicate BuisnessPartners, you can follow this blog post.

 

This blog post has detailed the steps to replicate Product data from SAP S/4HANA Cloud to SAP Master Data Integration service. Next you can connect SAP Master Data Integration to other systems like SAP S/4HANA on-premise, SAP Sales Cloud etc and ensure consistency of product master data data across these different systems.

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.