Technical Articles
Configuring SAP Master Data Integration service for Business Partners replication
Please note that this blog post contains outdated information. For the latest information, please see https://blogs.sap.com/2022/08/11/configuring-sap-master-data-integration-service-for-business-partner-replication-using-soap-apis-2022/.
(Note: Some features mentioned here might not be available in your environment. Please get in touch with SAP support if you face any such discrepancy.)
SAP Master Data Integration service serves as a central entry point for master data integration within the Intelligent Suite. There are many articles such as this one that explain how the service can help our customers achieve true integration for various Domain models in the cloud.
In this blog, I will go through the steps required to enable the SAP Master Data Integration service and replicate Business Partners. It is important to note that these steps are valid only for Business Partners replication. If your scenario requires replication of objects such as Cost center etc. then additional steps might be required.
I. Service Instance Creation for Business Partner Read and replicate.
- Go to the SAP BTP subaccount where you want the SAP MDI instance to be created. On the left-hand side, under Services, click on Instances and Subscriptions.
- Click on Create on the top right side.
- Select the service name and provide an Instance Name. Click Next.
- Use this JSON to create the service instance.
{ "businessSystemId": "<Business_System_Name>", "application": "<application_type>", "xs-security": { "xsappname": "<Service-Clone-Name>", "authorities": [ "$XSMASTERAPPNAME.BPCommonRead", "$XSMASTERAPPNAME.BPSensitiveDataRead" ] } }
– Provide a service clone name, a unique v4 UUID. You can use this link to generate a v4 UUID https://www.uuidgenerator.net/
– For BusinessSystemId, provide the logical system identifier of the client system that you will connect to the MDI instance. For E.g. if I want to connect my SAP S/4 HANA Cloud system CG4 to this system, I will use its logical system 0LOI36K.
In SAP S/4HANA Cloud system this value is can be found under Communication systems tile and then filter by Own System.
In SAP S/4HANA On-premise system, open transaction se37 and execute Function Module LCR_GET_OWN_BUSINESS_SYSTEM.– For application type, provide one value from mdg, s4, c4c, ariba, cdc, commerceCloud, hrc (SAP Subscription Billing) depending upon the type of your client system. This value is mandatory if you want to persist Key Mapping in MDI. In case your system type is not listed above, please contact SAP MDI development team.
- Select the service instance you created and click on Create Service Key. Click Next and then Finish.
- We are now done with Instance Creation for Business Partner read and replicate. Please note that for each new client system that you want to connect to MDI, you would have to follow this step again.
II. Setting up Generic Configuration
In this step we provide a unique identifier to the MDI tenant. This is necessary because during Key Mapping creation a corresponding MDI entry is created along with the Key Mapping of the client Business partner. At that moment, this identifier is referenced in MDI Key Mapping.
- Create a new MDI Service Instance. Use the below JSON to create the instance.
{ "xs-security":{ "xsappname":"<service-clone-name>", "authorities":[ "$XSMASTERAPPNAME.BPGenericConfigRead", "$XSMASTERAPPNAME.BPGenericConfigWrite" ] } }
Provide a v4 UUID for service-clone-name parameter.
- Generate service keys.
- In the Postman Client, create a POST Request for the following endpoint. This endpoint in OAuth2.0 protected. Use the service keys that were generated.
https://one-mds.cfapps.<region>.hana.ondemand.com:443/businesspartner/v0/odata/API_GENERIC_CONFIGURATIONS/GenericConfigurations
Use the following payload.
{ "BusConfignVersion": "4294967296", "BusConfignIsDeleted": null, "Id": "<Unique_V4_Uuid>", "ConfigurationName": "Business System", "ConfigurationValue": "<identity-zone>", "AllowedValues": null }
Replace the identity-zone parameter value with the identityzone from the service keys. To generate a V4 UUID: https://www.uuidgenerator.net/
Please refer to the Troubleshooting section to generate access token via the Postman client.
III. Create SOAP Outbound Destinations to the client System
The Business partner implementation in MDI utilizes the BTP subaccount destinations that are defined in a specific format.
- Navigate to your subaccount and click on the Destinations tab on the right side. (Your user should have relevant security authorisations)
- Click on “New Destination”.
- In the Name placeholder provide value <Business_System_Name>_BPOUTBOUND. Make sure “Business_System_Name” value is the same as the one used in section I of this blog.
- Type: HTTP
- The URL placeholder value can retrieved in two ways depending upon whether your system is is a Cloud or OnPremise.
For the S/4H OnPremise system login to your ERP system and create BP SOAP endpoint as mentioned in section IX of this blog here. Use the final URL created in this field.
For the Cloud system, open a communication arrangement of type SAP_COM_0008 and copy the inbound Services URL. - Proxy Type: OnPremise for S/4HANA on-premise system / Internet for S/4HANA Cloud system. Additionally, a cloud connector setup would be required for OnPremise systems.
- Username and Password for the S/4HANA system.
- Click on “New Property” and add MDOConsumer. Set its value True.
- Click on Save. The final result should look like this.
- Repeat steps 3-7 and create the following destination:
a. <Business_System_Name>_BPCONFIRM
b. <Business_System_Name>_BPRELOUTBOUND
c. <Business_System_Name>_BPRELCONFIRMNOTE: Optionally you can also configure
d. <Business_System_Name>_KEYMAPCONFIRM
e. <Business_System_Name>_KMOUTBOUND
These interfaces are part of the Communication Arrangement SAP_COM_0539 & SAP_COM_0540.
IV. Subscribing to Master Data Orchestration
In the sub-account, click on “Instances and Subscriptions” on the left side. Search for the “Master Data Integration (Orchestration)” service and click Subscribe.
V. Configuring access for Master Data Orchestration Fiori application
To view the Master Data Orchestration tiles, your user should have the necessary roles assigned to it.
- Under the Security dropdown on the left side, click on Role Collections. (You should have a Security Administrator authorisation to perform this step).
- Click on + sign and create a new Role collection with the name MDOAdmin. Search for the role MasterDataOrchestrationAdmin & MasterDataOrchestrationDisplay to the role collection. Finally, add your user to the role collection.
- Once your user is assigned, go back to Instances and Subscriptions and click on “Go to Application”.
- You should now have access to all the Master Data Orchestration tiles.
V. Creating MDO Distribution Model for Business Partner Replication
- Open the “Manage Distribution Model”.
- Provide a name for the model and select “Business Partner” in the Business Object Type dropdown.
- Set the continuous distribution checkbox if you want the business partners to be replicated as soon as they are created/updated.
- Provide a value for Package Size. Package size specifies up to how many objects are contained in a single outbound XML message from MDI to the client system
- Select the latest stable API : MDI_SOAP_BUSINESS_PARTNER
- Now, to create a Provider and Consumer, click the create button and select the provider: MDI
Similarly for the consumer, select the target destination. You can select the appropriate “Application Category” if required. - Set Data filters if required.
- Activate the Replication Model. The configuration is now complete. You can now replicate the Business Partners from the SAP Master Data Integration service to client systems.
Troubleshooting
- Checking if the Business Partner is replicated
Using the credentials generated in Step 1 of the blog, perform a GET request on:https://one-mds.cfapps.<region>.hana.ondemand.com/businesspartner/v0/odata/API_BUSINESS_PARTNER/BusinessPartner?$format=json&$filter=BusinessPartner eq '<BP_Number>'
The endpoint is OAuth2.0 protected. SAP MDI adopts the BP Number of the sender system. So, you can use the BP Number of the sender system for the GET request.
Additionally, you can expand on an entity to see the details. Eg:
https://one-mds.cfapps.<region>.hana.ondemand.com/businesspartner/v0/odata/API_BUSINESS_PARTNER/BusinessPartner?$format=json&$filter=BusinessPartner eq '<BP_Number>'&$expand=to_Person
- Accessing MDI Business Partner Endpoints
https://one-mds.cfapps.<region>.hana.ondemand.com:443/businesspartner/v0/soap/BusinessPartnerBulkReplicateRequestIn?tenantId=<identity_zone> https://one-mds.cfapps.<region>.hana.ondemand.com:443/businesspartner/v0/soap/BusinessPartnerRelationshipBulkReplicateRequestIn?tenantId=<identity_zone> https://one-mds.cfapps.<region>.hana.ondemand.com:443/businesspartner/v0/soap/BusinessPartnerBulkReplicateRequestConfIn?tenantId=<identity_zone> https://one-mds.cfapps.<region>.hana.ondemand.com:443/businesspartner/v0/soap/BusinessPartnerRelationshipBulkReplicateRequestConfirmIn?tenantId=<identity_zone> https://one-mds.cfapps.<region>.hana.ondemand.com:443/businesspartner/v0/soap/KeyMappingBulkReplicateRequestIn?tenantId=<identity_zone> https://one-mds.cfapps.<region>.hana.ondemand.com:443/businesspartner/v0/soap/KeyMappingBulkReplicateRequestConfirmIn?tenantId=<identity_zone>
These endpoints are Basic Authenticated. Client_Id is the username and clientsecret is the password. Both of the values are available in the service keys of the MDI Instance.
- Using Postman Client with OAuth2.0 authenticated endpoints.
Hello Shivkant,
Thanks for the detailed blogs.It was helpful to start with the setup.
I have followed the blogs to setup the replication of BP using MDI and have few queries related to setup.
Could you please clarify the following?
mentioned in the post request payload for Generic instance is constant!! Is this correct?Should we use the relevant Instance ID in Service key of Generic MDI instance?
<Business_System_Name>_KMOUTBOUND
Regards,
Siva
Hello Shivankit,
Thanks for the good blog on explaining the MDI configurations.
Along with Siva questions, I have couple points need some light. Can you please explain
Thanks in advance
Thanks,
Srikanth
You can think of it as assigning a Logical System Id to MDI. Something like S/4 systems have Id's ER9_001
The "Id" value can be any valid V4 UUID.
<Business_System_Name>_KMOUTBOUND: Send MDI Key Mapping information to the client system
@Shivankit, Don't know what's purpose of MDI instance with the name Generic Configuration either. Feel like there's useless of Generic Configuration.
If it was useless, it would not be in this blog.
MDI creates a Key Mapping, corresponding to each Business Partner. The "Business System" value provided in Generic Configuration is used to create that Key Mapping.
This Key mapping is later distributed via SOAP or Log API.
Hi Shivankit,
Here is my scenario: MDI -> CPI(by SOAP).
First, I would have to put "BusinessPartner" data into MDI, however, postman always gives "500 Internal Server Error". So, from your side, do you have the correct SOAP BP payload?
The payload sent to MDI is incorrect. Please reach out at MDI General Slack Channel for the payload.
Hi Shivankit,
I am trying to implement this at a client :
Integrating Public Sector Master Data from SAP Business Technology Platform Master Data Integration to Employee Central :
https://help.sap.com/viewer/8737092aab7848d997cdd11a0f6ff13c/2105/en-US/c00f40ed0ae044ae8d5685d807bb4d93.html
I am very new and educating myself on this topic of MDI enablement in BTP. What I am gathering is that to utilize the above services for Public Sector Master Data integration, the enablement of the "SAP Master Data Integration service in the BTP subaccount" as you have described in this blog is a Pre-Req step that needs to be performed first. Would you agree?
Are there any learning journeys or official implementation guides coming out on this topic in the future do you know?
Any further information for a beginner on this topic is very appreciated. Thank you for your insightful blog and efforts in educating the community on this niche and promising topic. Keep it on!!
Best,
Srikanth
Hi, these steps are not required for Public Sector Master Data. For the exact steps please get in touch with MDI Team on our Slack General channel
Hi Shivankit,
How does one get on the Slack General Channel as a Consulting Partner? This is a new channel that I am unaware of. Appreciate it if you can point me to that.
Thanks,
Srikanth
Hi,
I was not aware that you are a Consulting Partner. Please get in touch with michael.rieker@sap.com who can provide you the latest information on your scenario.
Thanks
Hi Shivankit,
regarding the Generic Configuration why its required to insert identify_zone of our client service key
, in the parameter "ConfigurationValue".
It's not possible to use any name for the MDI BusinessSystemname like e.g. MDIDEV ?
Thank you
BR
Muhammet
Yes, any value is possible. However, Please make sure that the same value is reference in soamanager and drfimg.
Hi Shivankit,
I am getting below error which configuring MDI instance in trial BTP account
Service broker error: Service broker one-mds-service-broker failed with: Trial is not supported, this service plan must only be used for SAP-to-SAP integrations
For maintaining Business System using API_GENERIC_CONFIGURATION. Information on the payload to be used and authorization is documented below.
https://help.sap.com/viewer/c7713d6177ad479d9ea00958db9f2f81/CLOUD/en-US/15564ec4dd434e81b20c857dd550494a.html
https://help.sap.com/viewer/c7713d6177ad479d9ea00958db9f2f81/CLOUD/en-US/1afed34e287640ee90a27d29043e0f34.html
Thank you for the update Manasi.
There are still some points which for me are not that clear and would be great if an expert could clarify those:
Thnak you very much in advance for taking time to reply to these questions! It would help a lot!
Alina
Hi,
Please find the answers below :
Regards,
Manasi Sridhar
Thank you very much Manasi for the reply to the individual questions!
I have deeper dived and managed to resolve one of them (point 2), but for the others is still not clear. So I'm giving bellow the current status/question, where advice is highlly appreciated.
2. for automatic replication of BP after change I found another blog with indications, and after activating in transaction CRMC_BUT_CALL_FU the function MDG_BS_BP_OUTBOUND_DRF, I could see the same error in SRT_UTIL as when using DRFOUT
3. Which would be the best way to reach MDI-MDO team for this issue no 3?
4. I was not referring to the SOAP destinations, but to the main destination representing the S4 On-premise system which needs to be setup as a consumer in the Pull distribution model from MDI to S4 . This one is mentioned also in the SAP Help that needs to have the property MDIInstanceID setup, but is not clear where to take the value, and no matter which of the 3 values I use I still get the same error (Service ID from the Service key of the Instance ( like a44ab28a-f529-46b9-91........... ) or the Instance name itself = CAL-onprem-MDI or the business system name from instance creation).
And one more new question:
5. How do we mark entities as extensible in the SAP One Domain Model with a corresponding annotation (annotation: @odm.extensible:['primitives']), in order to add extension fields ? Do we need to use Sap graph or how ? Is it documented somewhere so we can follow the steps?
Thank you again for the reply in advance!
When sending SOAP messages to MDI
Hi Shivankit,
I have done all the configuration related to MDI but mdi get API returning empty response
{
"@odata.context": "$metadata#Logs",
"value": [],
"@odata.deltaLink": "/v1/odm/2.1.1/sap.odm.businesspartner.BusinessPartner/events?$deltatoken=F3uAu5u2.1.1u1u4u1u0u31u0u0u0u0u0u0u0u0u0u0u0u0u0u0u0u0"
}
can you please tell if i am missing some steps or what's going wrong here ?
Thanks
Hi Shivankit,
I am unable to get data from mdi api even after doing all the configuration .
mdi get api is returning empty response .
{
"@odata.context": "$metadata#Logs",
"value": [],
"@odata.deltaLink": "/v1/odm/2.1.1/sap.odm.businesspartner.BusinessPartner/events?$deltatoken=F3uAu5u2.1.1u1u4u1u0u31u0u0u0u0u0u0u0u0u0u0u0u0u0u0u0u0"
}
please let me know if i am missing some steps or why mdi not returning any data even replication is successful from s4 side .
Thanks
Hi Shivankit,
during the creation of the MDI instance for Generic Configuration I got the following error:
Service broker error: Service broker one-mds-service-broker failed with: Failed to validate app scopes: {"message":"Authority requested is not allowed. Please remove BPGenericConfigRead,BPGenericConfigWrite authority, and try again"}
If I remove the mentioned authority which other authorities I should use?
Thank you
Eugen