cancel
Showing results for 
Search instead for 
Did you mean: 

Calculated column on custom CDS view ON S/4 HANA Cloud

0 Kudos

Hi all,

I want to create a custom CDS view (and expose as oData) on S/4 HANA Cloud with a calculated column that sums up all the rows that have the customer column blank in an additional column of the row with the customer not blank. Obviously there are other columns that handle the uniqueness of keys. Below an simplified image of what i have and what i want.

I know that with S/4 HANA on premise i can connect with eclipse and achieve this via code logic but on Cloud i'm not finding the way.

Does anyone has any suggestions how to achieve this?

Thank you in advance,

Ndricim

Accepted Solutions (1)

Accepted Solutions (1)

I044433
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Ndricim,

As such we do not have an option to create a new column/field in SAP S/4HANA Cloud when creating a new custom CDS view using 'Custom CDS View' App. We also need to keep in mind that, when we are creating a new custom CDS view in SAP S/4HANA Cloud, it is created on top of existing data sources (that can be existing standard CDS views in SAP S/4HANA or existing custom CDS views built previously). So in the essence, the custom CDS view only uses the fields from these existing data sources (Primary and Secondary).

You can also refer to following links for additional details-

Link #1

Link #2

Regards

Rohit

Answers (1)

Answers (1)

AndreasRiehl
Advisor
Advisor
0 Kudos

Hello Ndricim,

You can create a (new) calculated field in a Custom CDS View where you e.g. sum 2 other fields. What you cannot do in a Custom CDS View (as of S/4HANA Cloud 2002) is to aggregate.

But, what you can do is to set a default aggregation e.g. as SUM (in the field properties) and then the OData service itself will do the aggregation for you when it is executed with an according selection.

Best Regards,
Andreas