Skip to Content

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 like to explain 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.

To report this post you need to login first.

5 Comments

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

  1. 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…..

    (1) 

Leave a Reply