on 03-25-2019 2:00 PM
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.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Mark appreciate your reply.
It is not only Sales Org, there are multiple other characteristics (Distribution Channel, Division, Sales Group,Sales Partners, Customer, Customer Group, Material Type, Material Group, Week, Month, Quarter and Year, so far that is all been identified as requirement, may be more). In HANA models I can list all characteristics and aggregate on KYF and when consuming it will do the sum as the characteristics used. .
Is it similar to that? so I can list all the group by characteristics in the next view?
(BASIC --> COMPOSITE --> CONSUMPTION)
Can I create a consumption view and publish it, will the front end do the summation by various characteristics?
Thank you,
Arthur.
Mark,
I made it to work by removing the Key from the underlying views and it shows the summarized value. But still 2 things I would need to get clarified to build proper models.
1. The Key and how it will affect
2. The CONSUMPTION and COMPOSITE VIEW Difference. Also will try additional key characteristics and key figures.
Thank you,
Arthur.
HANA CDS appears to be more feature-rich than ABAP CDS. I don't think you can get summary data within Eclipse without creating a view where you 'Group By'. You could publish the view where you group your characteristics, as an OData service - this can be done on a view which is either annotated as a #COMPOSITE or #CONSUMPTION. I've found that some functionality in Fiori Elements is only available when the CUBE (@Analytics.dataCategory: #CUBE) is published as an OData service and NOT when the annotation @Analytics.query: true is set.
From memory you'll need a key if you're annotating a view with @analytics.query: true
Have a look here https://blogs.sap.com/2017/10/09/abap-core-data-services-part-2virtual-data-model-types/ for info about Views.
aalexis, 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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.