SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

Create a Simple ABAP CDS View in ADT

You will learn how to create a CDS (Core Data Services) view using ABAP Development Tools (ADT).

Overview

🎓 beginner 20 min. ABAP DevelopmentBeginnerSAP Netweaver

You will learn

  • โœ”How to use the new Core Data Services (CDS) tools in ABAP Development Tools for Eclipse (ADT).
  • โœ”How to use the following ABAP and SQL elements in a CDS view:
  • โœ”SELECT statement
  • โœ”CASE statement
  • โœ”WHERE clause
Unknown U Unknown September 18, 2023
Created by March 9, 2023
Contributors

Prerequisites

Prerequisites

  • You have a valid instance of an on-premise AS ABAP server, version 7.51 or higher (some ABAP Development Tools may not be available in earlier versions)
  • You have run the transaction SEPM_DG_OIA_NEW or transaction STC01 -> tasklist SAP_BASIS_EPM_OIA_CONFIG. (If you do not, your CDS view will display empty.)
  • Tutorial: Create an ABAP Project in ABAP Development Tools (ADT)
  • Tutorial: Create an ABAP Package

Steps

Intro

In this tutorial, you will create an ABAP Dictionary-based CDS view. As of ABAP AS 7.57, such views are deprecated. This tutorial is available for compatibility purposes only. For an short, up-to-date tutorial on CDS View Entities, see: Tutorial:Create an ABAP Core Data Services (CDS) View in ABAP On-Premise

CDS is an extension of the ABAP Dictionary that allows you to define semantically rich data models in the database and to use these data models in your ABAP programs. CDS is a central part of enabling code push-down in ABAP applications.

You can find more information about these deprecated CDS Views here:

You can find more information about CDS View Entities here:

Throughout this tutorial, objects name include the suffix XXX. Always replace this with your group number or initials.


Step 1 Create a CDS view
โ€”

  1. In the context menu of your package choose New and then choose Other ABAP Repository Object.

Image depicting step1-newObject
Image depicting step1-newObject

  1. Select Data Definition, then choose Next.

Image depicting step2-DataDef
Image depicting step2-DataDef

  1. Enter the following values, then choose Next:
  • Name = Z_INVOICE_ITEMS_XXX

  • Description = Invoice Items

  • Referenced Object: sepm_sddl_so_invoice_item

    Image depicting step3-enterValues
    Image depicting step3-enterValues

  1. Accept the default transport request (local) by simply choosing Next again.

  2. Select the entry Define View, then choose Finish

Image depicting step5-defineView
Image depicting step5-defineView

Step 2 Enter the data source
+
Step 3 Use an existing CDS association
+
Step 4 Add fields from existing associations
+
Step 5 Add a CASE statement
+
Step 6 Add a WHERE clause
+
Step 7 Check your code and view your changes
+
Step 8 Test yourself
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 8
1. Create a CDS view 2. Enter the data source 3. Use an existing CDS association 4. Add fields from existing associations 5. Add a CASE statement 6. Add a WHERE clause 7. Check your code and view your changes 8. Test yourself

Learn more →