1
votes

We are using SAP S4HANA SDK Springboot archetype to build the application in SCP Cloud Foundry.

The requirement is to fetch the OData services from the SAP S4HANA and expose them to the Fiori UI frontend in the form of OData.

From the Java web services, we are getting the responses in JSON format: Sample JSON response

Output what I need is in the below oData format.

oData Format

This is one of the services and the same should be made available to all the java rest services. Found out Apache Olingo for converting it into odata format. But wanted to know if there is any method class in SAP SDK which supports this.

1
Unfortunately, your question is very unspecific. What is "the application"? What exactly are you trying to achieve? where are you getting data from? what format do you expect?...Dennis H
The application is build using s4 hana sdk archetype in SAP Cloud foundry. The requirement is to fetch the data by using odata services from the SAP S4 HANA on premise system to our Java springboot, deployed in SCP CF which we have achieved. Now, we are exposing a java services to our fiori UI. Currently, the java services response is in JSON format. We would like to understand if there is a way to make the responses to an oData format? This would help ease the fiori UI bindings.Arun Kumar
Can you please provide an example that is specific to your application? I.e. please update your question with what your currently get and what you expect to get. (I know what OData is, but "OData format" is not a specific enough term to find out how to help you)Dennis H
@Arun Kumar, be so kind and enhance your question above with more details. Putting the details in the comments might not be obvious for everyone. Furthermore, pls tell us how the JSON you provided looks like in what you call OData format. ThanksEmdee
@Arun Kumar: Thanks for editing. I do see that your first screenshot shows data in JSON format, while the second screenshot shows XML. Thus, I guess what you mean as OData format is the same as XML. Is that a correct implication?Emdee

1 Answers

3
votes

There are several possibilities to solve that problem:

  1. You can fake it, i.e. manually translate all the results into XML yourself just enough so that UI5 accepts it.
  2. You can expose an OData service from your backend using the SAP Cloud Platform SDK for Service Development (that is already modeled as a dependency of the SAP Cloud SDK). You can find information on how to do that here and also here.
  3. Have you considered calling the OData service from your frontend directly?