Connect to SAP API Business Hub from an MDK app
Last Updated: 05-May-2021
Last week, i was asked from one of our internal teams on how to connect to SAP API Business Hub end point from a Mobile development kit application. It might be helpful for others if looking for similar requirement.
The SAP Mobile Development Kit enables developers and technical business users to build multi-channel applications. It allows you to build your application once, in an integrated development environment, and run it natively on mobile devices (Android & iOS) and as a web application (online) in the browser.
SAP API Business Hub is one stop shop or central catalog of SAP and selected partner APIs where you can discover, search, test, consume APIs in building solution like extending Line of Business (LoB) apps, developing a mobile apps etc. Please check https://api.sap.com/ for more details.
Find an API from SAP API Business Hub
- Log on to https://api.sap.com/ and search Customer Material (SAP S4/HANA Cloud).
- Click on Customer material (A2X)
3. Click on “Show API Key” and copy/paste it’s value in a text pad. (make sure that you have logged on to the same page)
4. Now, let’s test one of it’s operation and also to find it’s endpoint URL.
5. scroll down and then click on “Execute” . (i am not modifying any of the parameters, leaving it to default)
Configure application in SAP Mobile Services Cockpit
MDK Mobile applications access the data source via Mobile Services destination.
1. In SAP Mobile Services cockpit, configure a new app.
|Name||SAP MDK APIHub App|
2. Select Mobile Development Kit Application from drop-down > Finish
3. Click on “Mobile Connectivity” to add the API Hub endpoint
4. Click on “create” icon
5.Provide below information
|Customer Header||APIKey: <value>|
|SSO Mechanism||No Authentication|
6. you can also cross check if back-end data is accessible from Mobile Services by clicking on below circled icon
Create a new destination to your MDK Web application
MDK Web applications access the data source via BTP destination.
- Navigate to Destinations to create an BTP destination.
- Provide below info
Start Your MDK Application in the Editor
- Create a new MDK project by clicking Start from template option in Welcome page (if you don’t see Welcome page, launch it from Help menu)
2. Provide basic information
3.In Service Configuration step, select Mobile Services OData Source and app configuration details
4. In OData Collections step, select data collections and Finish the project creation.
5. In order for MDK Web applications to access the data, you need to provide APIKey value in a custom header.
Open CustomerMaterial.service file > Headers
Deploy the Application
Application.appand select MDK: Deploy.
2. Select deploy target as Mobile & Cloud.
MDK editor will deploy the metadata to Mobile Services (for Mobile application) followed by to Cloud Foundry (for Web application).
Run the Application
To run the app in Mobile client
- Download and install SAP Mobile Services Client on your iOS or Android device
- Double-click the
Application.appto open it in MDK Application Editor and click Application QR Code icon to populate the QR code
- Follow the steps (iOS/Android) to on-board the MDK client
To run the app in Web browser:
- Click the highlighted button to open the MDK Web application in a browser. Enter your SAP BTP credentials if asked. (You can also open the MDK web application by accessing its URL from
New to MDK development?
Follow these tutorials to learn more about Mobile development kit
- Create your Mobile Development Kit (MDK) app in SAP Business Application Studio
- MDK documentation:
Product Management, SAP Mobile Services