cancel
Showing results for 
Search instead for 
Did you mean: 

Using the SAP Cloud Platform SDK for Service Development to expose OData V2 Services

former_member583217
Discoverer
0 Kudos

I have a quick question about the SCP SDK for Service Development, specifically on the service provisioning part: I could not find any tutorials and / or packages in the sdk that would allow me to provision OData Services for OData V2, only V4. Does the SDK really only provides services in OData V4?

I'm asking this because we have several projects that need custom implementations of QCRUD operations (especially read operations) and the clients that consume these services (e.g. OData Offline Store from the iOS and Android mobile SDK and SAPUI5 applications) are restricted to using OData V2 only.

One main use case that exemplifies this necessity is regarding the Defining Requests used by the Offline OData Store in mobile applications. We need the Mobile App to send to the back end some user informations that the backend would use to perform some additional filtering before returning the data to the client (e.g.: When the client issues a GET Request on ".../service.svc/SalesOrders?$filter=PartnerId eq '1234'", return the SalesOrders for the BussinessPartner associated with the user logged in the applcation along with the orders for all the partners below him on the Hierarchy). This is so far the optimanl solution since we need to have deltas enabled and only send to the mobile client the absolute minimal data necessary (we are dealing with very restricted mobile devices).

From my understanding, the correct architectural choice would be to use CDS Views along with custom logic hooks as instructed by the new Application Programming Model. However, for Business and Commercial Reasons, CDS is out of our reach.

Up until this point me and the team have been using Olingo V2 for JPA processing in order to expose the backend services. If the SDK doesn't provide V2, is there any alternative available that would not require too much implementation in Olingo?


Thank you all!

Accepted Solutions (1)

Accepted Solutions (1)

Ivan-Mirisola
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Gustavo,

The SDK provides both versions of the OData protocol.

There are two artifacts:

1) For OData V2

<groupId>com.sap.cloud.servicesdk.prov</groupId>
<artifactId>projects-parent-odatav2</artifactId>

and for OData V4

<groupId>com.sap.cloud.servicesdk.prov</groupId>
<artifactId>odata-v4</artifactId>

CAP on WebIDE uses CDS notation to define both the data model and OData service V2 based on HANA DB.

Please check the following blogs on SDK for Service Development here:

V2:

https://blogs.sap.com/2018/03/01/sap-cloud-platform-sdk-for-service-development-overview-of-blogs/

V4:

https://blogs.sap.com/2017/09/11/creating-odata-v4-services-using-sap-cloud-platform-sdk-for-service...

S4/HANA

https://blogs.sap.com/2018/06/05/deep-dive-9-use-the-sap-s4hana-cloud-sdk-in-the-application-program...

Best regards,
Ivan

Answers (0)