Skip to Content
Author's profile photo Former Member

How to use extraction capability of CDS to SAP BW


Consider a migration scenario of analytical reports from SAP BW to S4H Embedded analytics. There will be lot of customizations and it’s difficult to replace all of them in short time. It will be good to use CDS views marked with data extraction as a source to embedded BW objects and use Bex features on top of these to develop analytical reports referring to existing BW system. After successful conversion, analytical reports which can be replaced by CDS consumption views can be identified.

    I am considering sales scenario, to identify Quotation, Order & Contract amounts by Customer and Sales value by Material.

    I will develop CDS views (Extraction capable) & BW objects as one flow. I will develop CDS Views (Consumption) as another flow.

    Then validating the results of both approaches will help in deciding the right source of analytical reports.


Image 1.PNG

Step by Step Process:

I. Create Basic views for all the required dimensions with required attributes.

  • Customer Basic View – Includes Account group, Region & Country
  • Material Basic view – Includes Material Group, Base UOM

II. Create View for Sales order Header and associate with Customer. Mark this view for Data extraction

          Below annotations are required to mark the view for data extraction

          @Analytics.dataCategory: #FACT

          @Analytics.dataExtraction.enabled: true

          Sales Header View.PNG

III. Create Sales order Item and associate with Material. Mark this view for Data extraction

          Sales Item View.PNG

IV. Create Data sources based on CDS views enabled for data extraction

    Select ODP – ABAP CDS Views as Source System type

    CDS as source.PNG

    Select CDS views created for Data extraction

    CDS selection.PNG

  Data source based on Sales Header CDS view was created

    CDS as Data source.PNG

    Repeat the same steps to create the data source on Sales Item CDS view

    Data sources queues will be identified in ODQMON

    ODP Queue.PNG

V. Develop Open ODS views referring data sources created on CDS views earlier

    BW Modeling perspective is required in Eclipse to carry out these steps.

    Select source Type ‘Data source’ and select the data sources created in previous step to get the fields into Open ODS


          Open ODS view.PNG

    Create Open ODS views for Sales Header & Item data.



              Net Price will set with aggregation ‘Maximum’ to check the behavior.

          No need to generate the data flow as we will use these objects as logical layer

VI. Include these open ODS views into Composite provider

          Aggregation to be set again at composite provider if it is different from ‘Summation’.


VII. Develop Bex queries on top of the composite provider

        Bex queries were also developed in Eclipse editor.

          RKFs were created to get Order, Quotation & Contract amount separately.

    Query 1.PNG

    Query 2.PNG

VIII. Develop CDS views on top of basic views created and mark them for analytics

          Composite views were built to pass parameters for currency conversion & Union of different document types.

          Attached document has details of the CDS views Z_PY_SALES & Z_PY_Sales_Itm

        To mark the views for consumption below annotations were required.

          @VDM.viewType: #CONSUMPTION

          @Analytics.query: true

          Output of these queries can be verified in Fiori launch pad.

          We can validate the same using RSRT by prefixing with ‘2C’. Output for the consumption views was shown in next step.

          CDS view – Sales value by Customer                                            CDS view – Sales value by Material

              Source – Sales Header Data                                                            Source –  Sales Item Data                                               

    CDS I.PNG            CDS II.PNG

IX. Validate the data from CDS & Bex queries output

    Customer Sales Validation between CDS & BEx   

Customer Sales CDS.PNG

Customer Sales BEx.PNG

    Sales Value & Price validation between CDS & BEx using Sales Item data flow

Sales Value by Material CDS.PNG

Sales Value by Material BEx.PNG

As both are matching these reports can be replaced by CDS views easily. The reports referred in example are quite simple but analytical reports in BW

will have lot of logic in transfomrations & Bex Query Designer. Hence this approach will help in identifying the analytical reports which are good for converting to S4H Embedded Analytics using CDS consumption views.

Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Prakash K
      Prakash K

      Nice Blog and much informative.