Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

OData Service returning different values than Source CDS View

sap_cohort
Active Contributor
0 Kudos

I have a CDS with Annotation to generate OData Service. When I query the CDS View for a specific set of field values I am returned with 2 like records and the values for each record are correct. Say $100 and $200.

When I query the OData Service for the same set of field values I am returned one record and the value is $0.

I am currently debugging and tracing the Service, but have not been able to find out what might be causing this difference. There is only one client so the service is not in any way pointing somewhere else.

Could anyone give me any insight/thoughts/reasons when the Source CDS View and the Actual OData service might return different values? Thanks!

1 REPLY 1

sap_cohort
Active Contributor
0 Kudos

This was corrected by a CDS View Change.
The CDS View was correctly outputting the results with multiple records as the source table had the value field as part of the table key. But, the OData Service result was incorrectly resulting in a zero value.
What corrected the problem was adding a SUM(Value) to the CDS View under the Consumption CDS View.
Still does not explain why the Service would return a different value than the CDS View.
But now it is working... Hope that helps.