Skip to Content

ABAP CDS Views

Hello All,

I am trying to create a cube like structure for a simple sales order. I need my sums to be displayed by sales org. In order to accomplish I followed the following

1. Created a BASIC CDS View with VBELN, VKORG, NETWR association with SalesOrg Description (Annotation @VDM.viewType: #BASIC) - displays data.

2. Created a COMPOSITE View with the same columns (@VDM.viewType:#CUBE, @DefaultAggregation: #SUM for SalesAmount with Currency) and it activates and displays data..

When It displays data, even if I select columns Sales Org, Description and Amount, it is not summarizing by sales Org and it still shows individual rows of Sales Amount, though I am not displaying Sales Order.

How can I make the CDS to display summary data by Sales Org and if detail needed with Sales Order.

What changes are to be done to the view?

Should I create a #CONSUMPTION view and OData.publish and the summation will happen at the front end?

Appreciate your reply,

Thanks,

Arthur.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • Best Answer
    Mar 25 at 02:07 PM

    You need to create another view on top of your Composite view

    define view ZCDS_something
      as select from ZCDS_something_else
    
    {
       key vkorg,
           @DefaultAggregation: #SUM
           sum(netwr) as total
    }
    group by vkorg

    You could also publish the composite view as an odata service as you suggested and let the visualisation do the calculation for you.

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 08 at 12:58 PM

    Arthur Alexis, the two you ask about sere a very different purpose:

    Composite view functions as a Cube-like structure, it typically has one or more fact "tables" and lots of associations to master-data views. Pretty much like star-join node in HANA CalcViews or BW Cube (depends on your background)

    Consumption view is pretty much a query, with no associations, but potentially lots of parameters, restricted & calculated measures, structure of rows/columns, fields exposed from associations (see above), etc.

    Add comment
    10|10000 characters needed characters exceeded