Skip to Content

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 S/4 HANA Cloud APIs to build a Fiori Application.

SAP Cloud Platform Web IDE a powerful web-based integrated development tool that simplifies end-to-end application development enables developers to quickly discover APIs from SAP API Business Hub to generate Fiori applications.

In the blog Discover, Explore and Consume APIs from SAP API Business Hub, generation of a Fiori application using APIs available in SAP API Business Hub is captured. In this blog, deployment of the generated application in SAP Cloud Platform account would be showcased.

Build Fiori application consuming APIs published in SAP API Business Hub

All the APIs from SAP API Business Hub API Sandbox are protected using API Key.  During the preview of the generated application, SAP API Business Hub project settings takes care of setting the required API Key of the logged in user.  Before deploying the generated application on SAP Cloud Platform account, this api key would have to set explicitly in the generated code.

In this section, the changes required on generated Fiori applications to set the generated api key is shown.

  • Login to SAP API Business Hub to get your API sandbox key ( as described in part 1 of Discover, Explore and Consume SAP API Business Hub APIs blog series)

 

  • Click on the Copy API Key to use it from the API Sandbox. Take some time to read through Disclaimer about the API key usage (*Disclaimer: The SAP API Business Hub provides an API Sandbox to try out APIs. The API Sandbox is intended solely for evaluation purposes and should not be relied on for any productive use. Please refer to official SAP documentation and developer websites for package and API information for SAP packages. SAP does not represent or warrant that the information provided on this website is current, complete or error-free, or that this website will continue to be made available.)

 

  • Open SAP Cloud Platform Web IDE Full stack service.
  • Build a Fiori application named MyPlannedOrders as described in part 2 of Discover, Explore and Consume SAP API Business Hub APIs blog series.

 

 

 

 

 

 

 

 

  • Expand the generated MyPlannedOrders.
  • Click on manifest.json from the expanded project in WorkSpace explorer and change the mainService datasource to set a custom http header named apikey to the API sandbox api key
 "" : {
 "dataSource": "mainService",
 "preload": true,
 "settings":{
 "headers": {
 "apikey": "YOUR_API_KEY_FOR_API_SANDBOX"
 }
 }
 }

 

 

Deploy Fiori application to SAP Cloud Platform

  • Select the generated MyPlannedOrders Fiori application, click on the menu button Deploy. Select Deploy to SAP Cloud Platform option.

 

  • In the Deploy Application to SAP Cloud Platform dialog, provide an application name ( say myplannedorders)  and click Deploy.

 

  • Click on Open the active version of the application link to open the deployed application in a new tab with the url like below https://myplannedorders-yourcloudplatformtenant/?hc_reset

 

 

  • This responds with HTTP status code 404 – Not Found.

 

 

  • To view the application, /webapp/index needs to be appended removing ?hc_reset from the application URL in browser ( e.g https://myplannedorders-yourcloudplatformtenant/webapp/index.html)

 

To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

  1. parthibaraja vijayan

    Hi Divya,

     

    Thanks for the well explained blog.

     

    Is it possible to deploy the Fiori application created consumed from SAP API management into an on premise system such as a Gateway system.

    Appreciate your response.

     

    Regards,

    Parthibaraja

    (0) 
    1. Divya Mary Post author

      Hi Parthibaraja,

      Thanks a lot for the kind words.

      Today SAP Cloud Platform API Management is more tailored for the cloud to cloud or cloud to on premise scenario, i.e, Fiori application running on Cloud ( SAP Cloud Platform) and accessing data from Cloud endpoints or on premise endpoints ( via SAP Cloud Connector ).

      Details about running Fiori application in on premise system is captured here.

      Thanks and Best Regards,

      Divya

      (0) 
  2. Michael Kaufmann

    Hi,

     

    that does not work like described in the article

     

    there are some basic steps missing regarding the Fiori Master Detail development

     

    Regards,

    Michael

    (0) 

Leave a Reply