CDS

Create your first ABAP CDS View

Let’s create our first CDS View on table MARA (Material Master).

Step1. Right-click on the package in ADT, and choose: New > Other ABAP Repository Object. Enter Data Definition in the search box.

Screenshot of Other ABAP Repository Objects
Fig1. Select or type – Data Definition

Step2. Click on Next. Enter Name and Description for the CDS View. Click Next.

Name – ZFirstCDS_Mara

Description – First CDS View – On Mara Table

Step3. Choose transport or create New transport. Click Finish. This will open a template. You can also choose the template, using the Next button, instead of Finish in this step.

Step 4. Copy Paste the below code. Click Save and Activate. Taadaa, you have made your first CDS View.

@AbapCatalog.sqlViewName: 'ZFIRSTCDS'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Material Data'

define view zfirstcds_mara as select from mara {
        key matnr as Material,
            
            mtart as MaterialType,
            meins as Uom
        
}

We will continue in our next blog – where we discuss the different component of the CDS View.

Leave a Reply

Your email address will not be published. Required fields are marked *

error

Enjoy this blog? Please spread the word :)

Follow by Email
Twitter
LinkedIn
LinkedIn
Share