on ‎2023 Sep 05 8:09 AM
Hi experts,
I'm trying to add a row with the result of the summatory of a field using the annotation @Aggregation.default: #SUM but I have faced a great number of errors and now i am stucked. I will detail the steps that I have taken before arriving to the last error:
1. Add the annotation @Aggregation.default: #SUM into the field of the consumption view. -> Error: Transformation @OBJECTMODEL.VIRTUALELEMENTCALCULATEDBY on element DRAFTADMINISTRATIVEDATAUUID is not allowed in analytical views
This happens because when we use this annotation the view is transformed to an analytical view and then the objects takes an analytical key either than the semantic key.
2. Disable the draft functionality of the consumption view -> Error: Aggregation functions cannot be used in transactional views.
3. I erase the annotation from the consumption, add it to the interface view and repeate steps 1 and 2 -> same errors.
4. Based in this blog https://blogs.sap.com/2019/10/06/aggregation-using-cds-view-for-any-given-slice-and-dice-in-odata-pa... the annotation @Aggregation.default: #SUM should be used in the consumption view but the documentation says this about this type of annotations:
Aggregate functions are not supported in scenarios with projection CDS views. Aggregation annotations in projection view cause an error on service compilation. Aggregation annotations in projected entities are ignored.
Based on this, I will use it in the interface view, but I still have the problem because it is a transactional view.
5. In the documentation it is said that this type of annotations can only be used in views with dataCategory: #CUBE, #FACT, #DIMENSION. I add the annotations @Analytics.query: true and @Analytics.dataCategory: #FACT to the interface view -> I don't get the error caused by the transactional view but when I try to retreive data I get the next error: FETCH API (direct DB access) is not supported for entity ZI_ENTITY.
This problem is discussed in this blog https://blogs.sap.com/2019/01/24/error-messages-you-might-encounter-when-using-the-restful-abap-prog... but doesn't solve my problem.
¿Am I doing the correct steps to achieve what I want? ¿Is there any problem I have not faced correctly?
Request clarification before answering.
Hello,
I guess that it is because you shouldn't use @analytics.query : true but the new way of creating analytics queries : https://community.sap.com/t5/enterprise-resource-planning-blogs-by-sap/cds-analytical-projection-vie...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 23 | |
| 20 | |
| 18 | |
| 17 | |
| 10 | |
| 9 | |
| 8 | |
| 3 | |
| 3 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.