Skip to Content
Technical Articles
Author's profile photo Akshay Kumar

Calling ‘GET’ method of SAP S/4HANA Cloud API from SAP API Business Hub

[Last reviewed for Updates: January 18, 2019]

In previous episode of my blog I had explained about how we start with SAP API Business Hub:

https://blogs.sap.com/2017/11/20/getting-started-with-sap-api-business-hub/

In this episode I would be explaining how we call GET method of SAP S/4HANA Cloud API from SAP API Business Hub.

For complete utilization of information present in this blog, it is recommended to go through my earlier blogs as part of this series if not done already.

In our example here, we will fetch a list of top 10 Purchase Orders from SAP S/4HANA Cloud system by putting a filter criteria using GET method. Lets have a look at the steps to achieve this.

Note: Every API might be having multiple entities in it. Hence based on our requirement we have to  select a relevant entity.

1. Click on the entity ‘A_PurchaseOrder’ and then click ‘GET /A_PurchaseOrder’:

2.  Put value ’10’ in parameter ‘$top’ (as we want to retrieve top 10 Purchase Orders from our SAP S/4HANA Cloud system):

Note: We can even leave all parameters blank, in case we want to retrieve all values.

3. Click ‘Try it out’ to finally trigger the request in SAP S/4HANA Cloud system (as configured in earlier blog):

4.  The response would be received in JSON format similar to the snapshot below:

 

In case we want to fetch details of one specific Purchase Order, we can use another entity ‘GET /A_PurchaseOrder(‘{PurchaseOrder}’)’ :

Here we will provide Purchase Order Number in ‘PurchaseOrder’ parameter and Click ‘Try it out’:

This will fetch details of a given Purchase Order as result.

We are now successful in reading the details of ‘Purchase Orders’ from SAP S/4HANA Cloud using API via SAP API Business hub.

In my next blog I would explain the steps to create a Purchase Order in SAP S/4HANA Cloud using API, triggered from SAP API Business Hub.

Stay Tuned!

Disclaimer: This blog is based on SAP S/4HANA Cloud 1711 release.

Assigned Tags

      7 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Rahul Rastogi
      Rahul Rastogi

       

      Good one....

      Author's profile photo Ranju Gupta
      Ranju Gupta

      Good one Akshay.. Thanks for sharing 🙂

       

      Author's profile photo Akshay Kumar
      Akshay Kumar
      Blog Post Author

      Thanks Ranju!

      Author's profile photo Ajay Mathur
      Ajay Mathur

      This blog series is extremely good Akshay! I went through all 3 blog posts and am now more confident of trying out these API calls myself whenever required! Thank you.....

      Author's profile photo Akshay Kumar
      Akshay Kumar
      Blog Post Author

      Thanks a lot Ajay!

      Author's profile photo Vipin Nagpal
      Vipin Nagpal

      Hi Expert,

      If i add new custom field via in app extension in business partner object in S/4 HANA Public cloud, then will i get extended field in O data get method of business partner?

      Thanks

      Author's profile photo Akshay Kumar
      Akshay Kumar
      Blog Post Author

      If the relevant OData API is enabled for extensibility then YES!