Part 5: Discover, Explore and Manage SAP S/4 HANA Cloud APIs in SAP Cloud Platform API Management
SAP API Business Hub is the central catalog of all SAP and partner APIs for developers to build sample apps, extensions and open integrations with SAP. In this blog, we would show case the discovery, exploration and consumption of the SAP S/4HANA Cloud APIs to build a Fiori Application.
In part 1 of the blog series the Discover, Explore and Testing of the SAP S/4HANA Cloud APIs (Read Planned Orders) was captured and in part 2 the consumption of the Read Planned Orders API in a Fiori application was showcased. In part 3, and part 4 the Configurations on the SAP S/4HANA Cloud System required to access the Read Planned Orders API and the management of the Read Planned orders API via SAP Cloud Platform API Management was covered.
Fiori application generated in Part 2 of this blog series, connects via SAP API Business Hub , API Sandbox. API Sandbox enables the application developers to quickly build and test a digital application for quick prototyping. For the productive purposes, application developers would have to connect to their own production/ test endpoints of the required APIs. In this part, we will be showcasing the changes required on the Read Planned Orders generated Fiori application of part 2 to connect to the SAP Cloud Platform API Management managed Read Planned orders APIs.
Destination to SAP Cloud Platform API Management
To connect generated Fiori application to the SAP Cloud Platform API Management managed Read Planned orders APIs, a destination to the API Proxy host would be required. In this section steps to create a destination to connect to the Read Planned Orders API Proxy is covered.
- Navigate to https://account.hanatrial.ondemand.com/cockpit
- Click on Neo Trial
- Click on Destinations tab under Connectivity. Click on New Destinations to create destination to the API Proxy endpoint.
- Enter Name as myS4HANA, URL as the API proxy endpoint and select Authentication as BasicAuthentication in the Destination Configuration screen.
- Enter the Communication User and Password ( say COM_104 as created in section Creation of Communication User of Part 3 of this series).
- Enter additional property named WebIDEUsage with value set to true so that this Destination configuration can be used from SAP Cloud Platform Web IDE. Click on Save to persist the changes.
Changes on Fiori applications
In this section, the changes required on generated Fiori applications to connect via the newly created destinations is covered.
- Open SAP Cloud Platform Web IDE Full stack service.
- Expand the generated MyPlannedOrders ( generated as described in part 2 of this blog series) to view all the generated files.
- Click on manifest.json from the expanded project in WorkSpace explorer and change the mainService datasource to remove the /apihub_sandbox from the uri.
- Click on neo-app.json from the expanded project in WorkSpace explorer and change the /apihub_sandbox path , target type application of the generated code.
- Change path from /apihub_sandbox to /s4hanacloud, target type from application to destination, name from webidecp to myS4HANA ( destination name as specified in the section Destination to SAP Cloud Platform API Management section), entryPath from /destinations/apihub_sandbox to /s4hanacloud.
- Select index.html and click on Run button to Launch Fiori application.
- MyPlannedOrders Fiori application is launched on a new tab, which connects to your SAP S/4HANA Cloud tenant via SAP Cloud Platform API Management.
Monitor Fiori application usage via SAP Cloud Platform API Management
With the Fiori application connected via SAP Cloud Platform API Management to your SAP S/4HANA Cloud APIs, usage of the Read Planned Orders APIs can be monitored and governed by SAP Cloud Platform API Management.
- Open your SAP Cloud Platform API Management API Portal
- Navigate to the Analytics tab, click on the Day view to view the usage of the Read Planned Orders APIs.
SAP Cloud Platform, API Management also offers many out of the box API Security best practices which includes security policies for Authentication and Authorization, Traffic Management and many more.
- API Security Best Practices blog series.
- Monitor and Analytics blog.
- Enchanced developer experience blog.
For more blogs on SAP Cloud Platform API Management visit us at SAP Community