Application Development and Automation 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: 
Read only

CDS attribute with ABAP-logic

Former Member
0 Likes
837

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

2 REPLIES 2
Read only

maheshpalavalli
Active Contributor
673

Is this the ome you are looking for?

https://blogs.sap.com/2020/01/13/using-virtual-elements-with-cds-in-fiori-elements/

https://help.sap.com/viewer/cc0c305d2fab47bd808adcad3ca7ee9d/7.51.7/en-US/a7fc007921d44263b09ccc0923...

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

Read only

0 Likes
673

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"