Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
robyn_hu
Advisor
Advisor
0 Kudos

In Sales, SAP has delivered some analytical reports based on item query CDS views. Such reports contain item-level dimensions and measurements. For example, the Sales Quotations - Flexible Analysis app uses the C_SalesQuotationItemQry (Sales Quotation Item - Query) view.

To add a custom item field to such a standard item-level report, you can simply use the Custom Fields app to enable it for the corresponding analytics data source. For example, the data source can be the item query C_SalesQuotationItemQry. Then the custom item field appears in the Sales Quotations - Flexible Analysis app. However, if you want to use a custom header field for item-level analysis, you should create a custom query and more steps are involved. This blog describes how to achieve this, that is, to add a custom header field to a custom item query (taking sales quotation as an example).

Overview

Step

App Used

Step Description

Remarks

1

Custom Fields

Create a custom header field and enable it for an analytics data source.

The data source is a basic interface view, for example, I_Sales Quotation.

2

Custom CDS Views

Create a custom cube (based on the standard item cube) and add the custom field to your cube.

The standard cube is I_SalesQuotationItemCube_2, which is the underlying view of the standard query (C_SalesQuotationItemQry).

3

Custom Analytical Queries

Create a custom query based on the custom cube.

Compared with the standard query, your custom query additionally contains the custom header field.

Note: To know how to find the queries used by analytical apps and how to find the underlying cube of a query, see question 3 in FAQs about Apps and CDS Views in Sales Analytics. For more information, see CDS Views for Sales and search for app descriptions on SAP Help Portal.

Procedure

1. Create a custom header field via the Custom Fields app using the business context Sales: Sales Document.

2. On the Analytics tab, enable your header custom field (YY1_SD_H_TEXT) to the data source I_SALESQUOTATION.

       Enable custom field.jpg3. In the Custom CDS Views app, create a custom cube based on I_SalesQuotationItemCube_2 (Sales Quotation Item - Cube), which is the underlying view of C_SalesQuotationItemQry (Sales Quotation Item - Query). Add your custom field (YY1_SD_H_TEXT) to the custom cube.

     Note: This field resides under association _SalesQuotation.

         Add custom field 1.jpg

Add custom field 2.jpg

4. In the Custom Analytical Queries app, create a custom query based on your custom cube. For more information, see How to create analytical query from custom CDS View.