cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CDS View with aggregation

Julien_Rouillard
Explorer
0 Likes
380

Hello,

I would like to know if what I want to do is possible in CDS views without doing ABAP.

Is it possible to create a custom CDS view that have aggregation (sum of stock) already calculated in it. The goal would be to join this view to another one with aggregation.

We would like to do a report with available and reserved stock group by Material/Plant/Storage Location (basically MB52 with reserved)

First try, I create a Custom view on I_MATERIALSTOCK_2 with Material/Plant/Storage as Key and configured the Stock as sum with Element Properties.
Then, I create another custom view with I_ReservationDocumentItem similarly.
Then, I join those two view on the keys Material/Plant/Storage and create an analytical query on this view. This gives wrong values because each stock is multiplied by the number of lines from the other view.

Second try, I wanted to join the C_MaterialStockActual view to I_ReservationDocumentItem. But this fails as I cannot use C_MaterialStockActual in another CDS View.

Any guidance or feedback is appreciated.

Julien

Accepted Solutions (0)

Answers (0)