cancel
Showing results for 
Search instead for 
Did you mean: 

Expose a calculation view as a oData service on Hana XSA.

Former Member
0 Kudos

Hello

This is my scenario:

I have an calculation view with a result of 3 values.

I expose this calculation view as a oData service.

On data access the result is not the expected result.

This happens when I use stack-views. In this example, the exposed view is created by a join between two others calculation views.

! On oData result, only the first value from view is repeated. In this example the first row is repeated for 4 times but only 1 time is expected.

Where can be the problem?

Thank you.

Accepted Solutions (0)

Answers (2)

Answers (2)

lbreddemann
Active Contributor
0 Kudos

The URL you use to access the OData service shows that you request the record count ($count) and not the actual values.

The result (3) is the correct, given your example screenshot.

You may want to adjust the URL to your expected result.

Former Member
0 Kudos

($count) in this case is used to show how many values exists in the TestSet entity(which is the calculation view).

If I adjust the URL in this way .....*xsodata/Test - the number of actual values is also 6 and not 3.

lbreddemann
Active Contributor
0 Kudos

Nothing in your problem description indicates what you just now added. Please be more specific on the how to reproduce this issue and also provide an example of the actual problem.

Former Member
0 Kudos

"Nothing in your problem description indicates what you just now added".. let's try again.

1. I sad that I have a calculation view with a result of 3 rows, as showing the screenshot number 1.

2. I sad that I want to expose this calculation view as a oData service, as showing the screenshot number 2.

3. I sad that when I access the calculation view from oData service, it gives a result with 6 entities, as showing the screenshot number 3.

4. I sad that the ($count) is used only to see how many entities(rows) are in the result when I access the calculation view.

5. I sad that if the $count is removed, it also give the same result because $count is used only to see how many entities the calculation view returned, as showing in the screenshot below.

Please say if now is specific or not.

lbreddemann
Active Contributor

Ok, let's try the other way around: how can this be reproduced? Show us to create this behaviour and maybe somebody is willing to reproduce and analyse this for you. I'm certainly not interested in dealing with your defensive argumentation.

After all, you got the issue and seek help, isn't it? So, you should be interested in helping the folks who could help you.

BenedictV
Active Contributor
0 Kudos

I am not able to infer a lot from the screen shot, but can you check if you are using a prjection or aggregation node in your calc. view. Also the join may be a cross-joins, and not be on an unique field and produces.

Former Member
0 Kudos

I use a projection node in the calculation view. The calculation result(not in oData service) - gives the right result. So, the join shouldn't be the problem, in my point of view.