Skip to content

Replicate Reports as CDS Views

This article shows how to rebuild ABAP Reports as CDS Views in SAP and how to extract the output using yunIO.

Core Data Services (CDS) Views are the modern, high-performance data modeling approach in SAP S/4HANA and ECC on HANA. Compared to classic SAP Reports, CDS Views offer:

  • Better performance (database pushdown)
  • Reusability
  • Semantic annotations
  • Future-proof architecture

Prerequisites

The article uses standard SAP Report MM60 (Material List) as an example.

original-report

SAP transaction MM60 displays a plant-specific material list including valuation, pricing, and MRP data. To rebuild this report in CDS, identify the following:

  • Source tables
  • Join logic
  • Key fields
  • Price determination logic
  • Filters (such as Valuated Materials Only)

These metrics are the foundation for the CDS View.

Note

Refer to the SAP ABAP team for the analysis.

Before building a CDS View, validate the expected dataset using the Report integration type. Note the following information:

  • Field list
  • Column order
  • Filters used in the variant

Use this output as your reference for comparison.

Create a Base CDS View

A base CDS View serves as the data foundation for CDS Views. Create a new base CDS View based on the analysis of the original Report.

The following sample CDS View recreates the Table joins and core logic behind Report MM60:

Base CDS View
@AbapCatalog.sqlViewName: 'ZMM60BAS'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'MM60 Base - Materials List (Join View)'
@Metadata.ignorePropagatedAnnotations: true

define view ZI_MM60_BASE
as select from mara
  inner join marc
    on marc.matnr = mara.matnr

  left outer join makt
    on makt.matnr = mara.matnr
   and makt.spras = $session.system_language

  /* Valuation data (assuming valuation area = Plant; BWKEY = WERKS) */
  left outer join mbew
    on mbew.matnr = mara.matnr
   and mbew.bwkey = marc.werks

  /* Currency derivation: Plant -> Valuation area -> Company code -> Currency */
  left outer join t001k
    on t001k.bwkey = marc.werks

  left outer join t001
    on t001.bukrs = t001k.bukrs
{
  key mara.matnr                              as Material,
  key marc.werks                              as Plant,

  mbew.bwtar                                  as ValuationType,
  makt.maktx                                  as MaterialDescription,
  mara.laeda                                  as LastChangeDate,

  mara.mtart                                  as MaterialType,
  mara.matkl                                  as MaterialGroup,
  mara.meins                                  as BaseUnit,

  marc.ekgrp                                  as PurchasingGroup,
  marc.maabc                                  as ABCIndicator,

  /* MRP Type */
  marc.dismm                                  as MRPType,

  mbew.bklas                                  as ValuationClass,
  mbew.vprsv                                  as PriceControlType,
  mbew.peinh                                  as PriceUnit,

  @Semantics.amount.currencyCode: 'Currency'
  case
    when mbew.vprsv = 'S' then mbew.stprs
    when mbew.vprsv = 'V' then mbew.verpr
    else mbew.stprs
  end                                         as Price,

  t001.waers                                  as Currency,
  mara.ernam                                  as CreatedBy,

  /*  This is the MM60 checkbox logic as a field */
  case
    when mbew.matnr is not null then 'X'
    else ''
  end                                         as ValuatedMaterialsOnly
};

Create a Reporting CDS View

The reporting CDS View contains the final layout of the CDS View. Build a new reporting CDS View on top of the base CDS View and replicate the original Report's column layout.

The following sample CDS View matches the MM60 column structure:

Reporting CDS View
@AbapCatalog.sqlViewName: 'ZMM60CDS'
@AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'MM60 - Materials List (MM60 Column Order)'
@Metadata.ignorePropagatedAnnotations: true
@Analytics.query: true

define view ZQ_MM60_CDS
as select from ZI_MM60_BASE
{
  /* 1-2 */
  key Material,
  key Plant,

  /* 3-5 */
  ValuationType,
  MaterialDescription,
  LastChangeDate,

  /* 6-10 */
  MaterialType,
  MaterialGroup,
  BaseUnit,
  PurchasingGroup,
  ABCIndicator,

  /* 11 */
  MRPType,

  /* 12-13 */
  ValuationClass,
  PriceControlType,

  /* 14-16 */
  Price,
  Currency,
  PriceUnit,

  /* 17 */
  CreatedBy,

  /*  filter column for checkbox */
  ValuatedMaterialsOnly
};

Extract CDS Views in yunIO

Use the SAP Table and View integration type to extract the CDS View:

  1. Look up the CDS View. The referenced example is named ZMM60CDS.
  2. Use WHERE Clauses. to apply the same filters as used in your referenced Report variant. The referenced example uses:

    ZMM60CDS~PLANT EQ 'FOBP' AND ZMM60CDS~VALUATEDMATERIALSONLY EQ 'x'
    
  3. Compare the results with the original Report output.

You can now use the CDS View with yunIO for high-performance data extractions.


Last update: February 6, 2026
Written by: Bharath Gorapalli, Valerie Schipka