Skip to Content
0

Using ODATA Adapter Get Method

Jan 04 at 12:07 PM

62

avatar image

Hi SDNites,

I am trying to retrieve details from S4HANA cloud using Get method of ODATA API. It is not working but also I did not get any parameter to populate use authentication details and also no polling interval being mentioned there. Can you please advise how to use GET method of ODATA to call API of S4HANA cloud?

Regards,

Abhi

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Ivan Mirisola
Jan 04 at 02:00 PM
0

Hi Abhishek,

Have you seen this blog already? I believe what you are looking for is the API Business Hub to get access to the S4HANA APIs and documentation.

Regards,
Ivan

Show 4 Share
10 |10000 characters needed characters left characters exceeded

Hi Ivan,

Thanks for the response.

I am trying to call the S4HANA API using SCP and try to retrive details using Get method of ODATA adapter. Can you please guide me how to use that or any example would be of great help.

Abhi

0

Hi Abhishek,

Please follow the instructions from the blog I mentioned on my 1st answer.

BTW: Method GET doesn't really mean anything in OData. For OData services, this method represents a query on a system, but you need to know which exact service you need to call. S4HANA has several (128) artifacts that you could obtain based on the APIs available on the SAP API Business Hub.

In other words: if you are looking for "Bill Of Materials" listing, you could call the following service:

https://api.sap.com/shell/discover/contentpackage/SAPS4HANACloud/api/API_BILL_OF_MATERIAL_SRV

If you open this URL, you will get a link to "try" the GET method for this service API.

Note: You must be logged in the API business hub to be able to consume the services on this particular API page.
To be able to consume it on SCP you will need to specify an APIKey otherwise you will get a message like "FailedToResolveAPIKey". Besides that, you will need to call this endpoint based on a Destination. This destination can be created via Cockpit and must be based on AppToAppSSO authentication.

Regards,
Ivan

0

Thanks Ivan for the above details.

I have access to API Business Hub and understand that if it needs to be called from SCP that we have to use the API key which is again provided in API business hub.

The place where I am looking for guidance is that using API business hub I am try to call API for Sales Order creation. In order to do that,

1. Do I need to call Get method first to retrieve the token? (I am gettiing this in Purchase Order but not in Sales Order). If this is true then in the iFlow this should be a step before we use post method to create the Sales Order

2. When we use POST method to create Sales Order there are many resource paths like A_PurchaseOrder / A_PurOrdPricingElement. Do we need to call all of them back to back to completely create a Sales Order completely or any one resource path will create full Sales Order.

3. When Calling this API which is called using ODATA format, we have convert XML into JSON within iFlow and then send it to ODATA so that API can be called?

4. Any example of how to create a Sales Order within Business Hub or via iflow or any client would be of help.

Regards,

Abhi

0

Hi Abhi,

Could you please rewrite the question so others are able to help you with that. I am not familiar with that API in particular. But other will try helping only if the question is clear. If you post additional questions on replies it doesn't attract others to contribute.

Also, please don't mark the question as "Cloud Platform" only. The question should be marked as S4HANA Cloud Edition or something similar like "SAP S/4HANA Cloud" topic. Cloud Platform is a broad topic and will mostly attract technical people to the discussion instead of functional experts.

Regards,
Ivan

1