What is it?
With the introduction of SAP API Business Hub, SAP has facilitated further opportunities for the Partners/Customers to utilize the SAP Cloud Platform capabilities more efficiently and consume these APIs in their own productive way.
Currently, there are more than 100 APIs published which can be used in multiple ways and be integrated with other platforms.
Talking about the same, Master Data Management (MDM) has also come up with its Business Partner and Product Master OData services. These come handy when we discuss the two most important Master Data types – Business Partner and Product Master. Be it any CRUD operation, these APIs would help you to do these operations effortlessly. You can find these APIs under API Package SAP S/4HANA Cloud as shown in the following screen shot:
How to Consume?
These APIs are easy to use. As SAP has recently partnered with Apple, let us take this as an example. Here we show how to consume our APIs to build native iOS App.
To start with, follow these steps:
- Host the service on SAP Cloud Platform (formerly known as HANA Cloud Platform)
- Install and connect SAP HANA Cloud Connector to your SAP Cloud Platform trial landscape. For more information, refer to hereSAP Help Portal. H
- Thus, you should have a working Connectivity in your HCP trial Cockpit.
- OData Provisioning
- In your HANA Trial Account, establish connection between HCP and cloud connecter via OData Provisioning by selecting the OData service for Business Partner exposed at API Hub.
- Choose Go to Service.
- Register the required business partner service “API_BUSINESS_PARTNER” with the appropriate destination.
- Once registered, you can see the XML for active Service that is hosted to Cloud Platform through “Open Service Document”.
- Building App on Cloud Platform
- Under Services from the left panel menu, enable Development and Operations and navigate to the service.
- The following screen appears. Create a new application as highlighted.
- Enter details on the screen that appears, and click Save.
This creates an application that hosted on Cloud Platform.
- Go to “Back End” tab and enter details as the following screen shot.
Note: For this demo, we are using basic Authentication, but you can change authentication as per your requirement.
- Creating an iOS App using ‘HCP SDK for iOS’
Follow these steps to create the Xcode project using HCPSDKforiOSAssistant:
Open HCP SDK for iOS Assistant on mac machine, which must be inside the Applications folder.
Click on Open if you get this popup.
The HCP SDK for iOS Assistant is opened now.
We will test the settings once again.
Click on Settings icon.
HCP Ms Instances:
Select the your C/I/D instance from the list.
HCP SDK for iOS library path:
Make sure the path is pointing to the correct folder.
It should be:
Click on Save button.
HCP Ms instances settings:
HCP iOS Library path:
Final it should like this:
We will now create the Xcode project.
Click on + button on right side.
Tab1: Project Properties
Enter the following parameters.
Product Name: SampleDemo
Destination folder where the project will be created.
Click on Next
Tab2: HCPms Configuration
Click on Use Existing.
Click on Select from HCPms.
You would see the list of app configurations that you would have configured in your HCPms account on HCPms admin portal.
Select your app ID as the one that is created on Cloud Platform in previous steps.
Click on OK button.
And then, click on Next button to go to Tab3.
Tab3: oData Services
It should list out app configuration automatically under Connections.
Select the relevant one from the list.
Click on Next button.
Tab4: Optional Features
Lets have default selections as it is. Do not change anything.
Click on Finish.
The Assistant will create the Xcode project on Desktop with foldername as SampleDemo.
In SAP S/4HANA Cloud, to access a set of data from an application, you should call the specific/corresponding API. The APIs will not only help you leverage the entire functionality of the application with the flexibility of selecting your own UI, but also streamline the Business Process.
The end user can easily use the Business Partner and Product Master APIs to create their Native App which could be built on the platform of their choice, be it iOS, Fiori or Android.