on ‎2020 Sep 16 4:03 PM
Hello everyone,
I've created a CDS view in eclipse and one column should be filled with data pulled out of SAP S/4 HANA. I have seen that we can use virtual element to this purpose but since my CDS view is used in an ALP template I get this error "Calculated elements are not allowed in analytical".
I've created another view which does not contain any chart (apparently if a CDS view contains a chart it's automatically an analytical view) and everything works for that. When I access: "/Z_FALP_QMDASHBOARD_INSTR_CDS/Z_FALP_QMDASHBOARD_INSTR?sap-client=199&$top=10" the column contains the right data (ABAP debug stops in the method call).
I've then created a third CDS view which is a union with a fourth CDS view and the result of this union is used in the first view.
Finally there are 4 views:
- V1 (uses virtual elements)
- V2
- V3 = V1 Union V2
- V4 = analytic view which returns V3
The thing is that when I execute V4 the virtual element is not filled out (ABAP breakpoint not reached) but when I execute V1 it is.
How can I work this out?
Thanks
Request clarification before answering.
you cannot use aggregations and virtual elements together. If the odata service entity that is linked to the cds view is having aggregation annotations then the virtual elemtns code will be skipped by SADL framework. One probable reason why sap did that is it will cause huge performance issue as you have to aggregate it at the abap level
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
A possible solution for this scenario could be to add a "dummy" emtpy field instead of the virtual field.
Next create a separate odata project using SEGW based on your V4 cds view. In het DPC_EXT class redefine the relevant get_entityset method, first call the super implementation which will call the SADL framework to retrieve the data.
Next supply your dummy field with the right data using your logic. Maybe this could be an option for you, but it could cause some other issues regarding analytical features/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 8 | |
| 7 | |
| 4 | |
| 4 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.