Skip to Content
Jan 09, 2020 at 09:52 PM

SAPUI5 and OData Modelling approach


Hi Experts,

Apologies for the lengthy verbiage , but this topic for me was always a conflict of interests / perceptions .So wanted to give little more details .

My question is more in terms of Data-Modelling approach rather than a technical bottle-neck.

Our system is on SAP : 7.50 Version

We are working with custom application with SAPUI5 as front-end( not Fiori ) with OData service as the data source. .As in probably many other engagements, we have a separate UI team and SAP Back-end Team.

To illustrate my problem, let me provide a sample use case of a hypothetical sales order business entity :

  1. Sales Order Header with order specific fields and additional fields like Status( Pending, approved, Rejected ) & Country( only one country per order )
  2. Order Header associated to Sales Order Items( 0 to Many ) with item information.
  3. Order Header Associated to Partner(1 to 1) with customer information
  4. Sales Order Items associated to Material ( 1 to 1 ) with Material information.

The object model is depicted as below :

Based on SAP guidelines, I implemented the OData definition using CDS - BOPF - SEGW( referenced data source ) to handle all the CRUD operations .

I strongly believe the OData service should be solely aligned with the business definition. Its associations and hierarchy should be completely independent of the consumption layer.

Now, assume the requirement is to build the UI as per below mock-up.

SAPUI5 team, from their perspective, say they will not be able to refer multiple services( example Master service for status , master and Order Service ) and work on their respective JSON outputs to merge and get the desired output. They would require Direct Data Binding approach for light-weight client side programming. Instead the expectation is to change the OData service as below model, so that using expand calls they get the desired result in one go.

( Note :We don’t see any other consumer for the OData service )

This would require me to either :

  • Create one more wrapper consumption view and expose it for UI, without disturbing the Business CDS View
  • Go with traditional code-based service definition and build the entity hierarchy as per the UI

( I don’t like both of the above options ).

Just wanted to get the thoughts from both SAPUI5 and SAP OData Experts.

Apologies again for the lengthy content.