2020 Aug 25 11:54 AM
Hey together,
Is it possible to provide individual attributes of a CDS view with ABAP logic?
We often work with Fiori Elements and use the CDS annotation "OData.publish: true". The OData generated there work very well. But as soon as we need even one line of abap, we switch to the SEGW to place the ABAP code there. Unfortunately the oDate implemented there often cause more problems than the generated ones. So it would be very practical if we could use the ABAP code directly with an attribute in the CDS-View.
Thank you and best regards
Hey together,
Is it possible to provide individual attributes of a CDS view with ABAP logic?
We often work with Fiori Elements and use the CDS annotation "OData.publish: true". The OData generated there work very well. But as soon as we need even one line of abap, we switch to the SEGW to place the ABAP code there. Unfortunately the oDate implemented there often cause more problems than the generated ones. So it would be very practical if we could use the ABAP code directly with an attribute in the CDS-View.
Thank you and best regards
2020 Aug 25 12:02 PM
Is this the ome you are looking for?
https://blogs.sap.com/2020/01/13/using-virtual-elements-with-cds-in-fiori-elements/
Btw I saw somewhere that with ABAP programming model for fiori, using referenced odata source is the best approach as we have the flexibility the flexibility to extend the odata service functionality. Even a lot of sap standard services does it this way instead of odata.publish annotation
2020 Aug 26 11:59 AM
Hello Mahesh
thank you for the answer. It is the right way, but in my case it will not work. Because virtual elements are not allowed in analytical views. In my CDS view I need the annotation "@DefaultAggregation: #SUM"