SAP - ABAP CDS Development User Guide

Download as pdf or txt
Download as pdf or txt
You are on page 1of 150

2/19/2023

SAP - ABAP CDS Development User Guide


Generated on: 2023-02-19 16:30:06 GMT+0000

SAP Business Technology Platform (SAP BTP) | Cloud

PUBLIC

Original content: https://help.sap.com/docs/BTP/f859579898c7494dbe2449bb7f278dcc?locale=en-


US&state=PRODUCTION&version=Cloud

Warning

This document has been generated from the SAP Help Portal and is an incomplete version of the official SAP product
documentation. The information included in custom documentation may not re ect the arrangement of topics in the SAP Help
Portal, and may be missing important aspects and/or correlations to other topics. For this reason, it is not for productive use.

For more information, please visit the https://help.sap.com/docs/disclaimer.

This is custom documentation. For more information, please visit the SAP Help Portal 1
2/19/2023

About the ABAP CDS Development User Guide

Scope of Documentation
This documentation describes the functionality and usage of tools for Core Data Services (CDS) in ABAP development for SAP
HANA scenarios. In particular, it focuses on use cases for creating, editing, testing, and analyzing ABAP CDS entities using the
Eclipse-based IDE.

Context
This guide provides documentation about features which are client-speci c or require a speci c back-end version.

Consequently, this documentation covers all client-speci c and back-end-speci c dependencies.

ABAP Development Tools provides features that are client-speci c or require a speci c back-end version. Consequently, this
overview covers all client-speci c and back-end-speci c dependencies. To highlight and contrast back-end-speci cs in the
relevant context, the following icons are used:

Icon Deployment Model Description

 On-premise/Private Cloud Used for SAP S/4HANA and for SAP S/4HANA Cloud, private edition

 Public Cloud Used for SAP BTP ABAP environment and SAP S/4HANA Cloud ABAP
Environment

Target Audience
ABAP developers who are involved in creating and de ning data models including code push-downs.

Validity of Documentation
This documentation belongs to the ABAP Development Tools with the client version 3.32 and refers to the range of functions
that have been shipped as part of the standard delivery for:

 On-premise/Private Cloud shipments:

SAP NetWeaver 7.3 EHP1 SP04 and higher

SAP NetWeaver 7.4 SP02 and higher

SAP NetWeaver 7.5 SP00 and higher

SAP NetWeaver AS for ABAP 7.51 innovation package SP00 and higher

SAP NetWeaver AS for ABAP 7.52 SP00 and higher

Application Server ABAP 7.53 SP00 and higher (a.k.a. ABAP platform 1809)

Application Server ABAP 7.54 SP00 and higher (a.k.a. ABAP platform 1909)

Application Server ABAP 7.55 FPS 00 and higher (a.k.a. ABAP platform 2020)

Application Server ABAP 7.56 FPS 00 and higher (a.k.a. ABAP platform 2021)

Application Server ABAP 7.57 FPS 00 and higher (a.k.a. ABAP platform 2022)
This is custom documentation. For more information, please visit the SAP Help Portal 2
2/19/2023
SAP S/4HANA Cloud, private edition

 SAP BTP ABAP environment

 SAP S/4HANA Cloud ABAP Environment

More on ABAP for SAP HANA Scenario

 Tip
To view discussions and nd further resources on how ABAP-based applications can leverage, you can also visit our SAP
HANA and ABAP Development spaces on SAP community.

CDS Annotations
A CDS annotation (or annotation for short) enables you to add ABAP and component-speci c metadata to the source code of
any CDS entity.

Types in Accordance to the Evaluating Runtime


In accordance with consistency and how validity of annotations is evaluated, SAP's annotations are divided into the following
categories:

ABAP annotations are evaluated by the ABAP runtime environment.

Component annotations are evaluated by the relevant SAP framework.

Use
You can use code completion ( Ctrl + Space ) to add annotations directly in a data de nition, for example, before the
define statement or within a select list in a CDS view. The validity of the annotation then depends on the corresponding
position where you use it. If they are added at the wrong position, the source editor will mark and underline them in red.

In addition, you can use annotations in metadata extensions to de ne customer-speci c metadata for a CDS view without
modifying SAP's CDS entities itself. When using metadata extensions, you can overwrite speci c annotation values de ned in a
data de nition or add additional annotation values to an entity. Note that you can only use those annotations in metadata
extensions that are not relevant when activating CDS entities.

 Example
@AbapCatalog.sqlViewName: 'CUSTOMER'
@AccessControl.authorizationCheck: #NOT_REQUIRED
@Metadata.allowExtensions: true
DEFINE VIEW cust_book_view_entity
AS SELECT FROM scustom
JOIN sbook
ON scustom.id = sbook.customid
{
@EndUserText.label: 'Customer ID'
scustom.id,
@EndUserText.label: 'Customer Name'
scustom.name,
@EndUserText.label: 'Customer Booking ID'
sbook.bookid
}

This is custom documentation. For more information, please visit the SAP Help Portal 3
2/19/2023
The example from above demonstrates how you can use annotations and at which positions you can add annotations:

Annotations that are used before the define view statement are valid for the whole cust_book_view_entity
CDS view:

@AbapCatalog.sqlViewName: 'CUSTOMER': After activation, the CUSTOMER CDS database view is


created in the ABAP Dictionary.

@AccessControl.authorizationCheck: #NOT_REQUIRED: There is no access control required to


retrieve the selected data from the database.

@Metadata.allowExtensions: true: Allows you or other developers to overwrite or add annotations in


a metadata extension.

The @EndUserText.label annotation used before an element in the select list provides a text for the
corresponding eld.

Activation
Errors resulting from the use of component annotations do not prevent activation or creation of a CDS entity at the rst time.
They are only evaluated if the activation of the entity was successful.

Component annotations can result in the generation of other ABAP repository objects.

 Example
An OData service is generated when using the @OData.publish: true annotation. In this case, the annotation is
highlighted with a marker that provides additional information about the generated object.

Marker that highlights the creation of an OData service

 Note
When the CDS entity is activated, the OData service is generated automatically. After activation, it can be opened from the
ABAP Element Information popup of the corresponding database table. To do this, select the underlined "OData-Service" link
in the Generated Object section.

Related Information
 ABAP CDS - Annotations
 CDS Annotations
Annotation Propagation
Active Annotations View
Displaying Annotation Values of an Active CDS View
Extracting CDS Annotations to a Metadata Extension

This is custom documentation. For more information, please visit the SAP Help Portal 4
2/19/2023

Annotation Propagation
The values of CDS annotations can be inherited and merged between CDS entities.

Use
You as an ABAP developer have the following possibilities to use annotations in order to provide metadata in your data model:

Use another CDS view as the data source

Use a data element

Use metadata extensions to enrich a CDS entity with customer-speci c annotation values

You can build hierarchies when selecting data from other CDS views. In accordance to this hierarchy and the corresponding
elements in the select list, the annotation values are propagated from bottom to top.

Using Metadata Extensions


In addition, you can also use metadata extensions. They can also re ect a hierarchy when assigning several metadata
extensions to a CDS view.

You can assign customer-speci c metadata through annotations in one or more metadata extensions to one data de nition.

The precedence of the annotations contained in the metadata extensions is determined by the layer of the extension.

For this, the following values are provided:

Value Description

CUSTOMER Used by SAP's customers to de ne their own metadata

 Example
@Metadata.layer: #CUSTOMER

In this example, the value CUSTOMER is used for a metadata extensions.

 Note
All annotations provided in metadata extensions are compounded with the
annotations in the corresponding data de nition. Element annotations (scope
ELEMENT) are propagated in the entity hierarchy.

CUSTOMER is the highest level. If there are several metadata extensions


provided for a data de nition, the metadata extension with the highest value
will be considered.

PARTNER Used by SAP partners to de ne their own metadata

INDUSTRY Used by SAP to de ne metadata for industry solutions

LOCALIZATION Used by SAP to de ne regional or country-speci c metadata

CORE Used by SAP to de ne metadata of their basis applications

Annotation Propagation View


This is custom documentation. For more information, please visit the SAP Help Portal 5
2/19/2023
The value of annotations can be propagated within the entity hierarchy.

You use the Annotation Propagation view to display the currently active and inactive values of CDS annotations and the CDS
entities from which these values have been propagated in accordance to the current position of the cursor in the DDL editor.

This view displays the following information:

Source CDS entity from which the value of a CDS annotation originates.

If you provide several metadata extensions for a data de nition, you can reproduce how metadata extensions provide
metadata on different layers.

After generating, all involved annotation values and their corresponding data sources are listed. The effective entries are
highlighted in black. Based on this list, you can now check which values are considered from your data de nition.

 Note
The metadata that is ignored is highlighted grey.

You can also adapt the selection of the data source at any time. To do this, choose the corresponding Browse... button in the
Selection area. Select then the relevant data source or key.

Related Information
 ABAP CDS - Evaluation of Annotations (ABAP Keyword Documentation)
Annotation Propagation View
Analyzing Annotation Propagations

Data De nitions
A CDS data de nition is an ABAP repository object. It is created using the CDS DDL of the ABAP CDS in data de nition language
(DDL) source code.

Data de nitions de ne CDS entities that can be accessed as a data type in ABAP programs and as a data source in reading
ABAP SQL statements.

You can create and de ne data de nitions for the following CDS entities:

CDS Views

CDS Projection Views

CDS DDIC-Based Views

CDS Custom Entities

CDS Abstract Entities

To do this, in the creation wizard use the relevant code template.

Related Information
Creating and Activating Data Models
ABAP CDS Code Templates
 ABAP CDS - Data De nitions (ABAP Keyword Documentation)
This is custom documentation. For more information, please visit the SAP Help Portal 6
2/19/2023

ABAP CDS Entities


A CDS entity is a structured object in ABAP CDS. It represents a data model based on the data de nition language (DDL)
speci cation and are managed by ABAP Dictionary.

The following types of ABAP CDS entities are supported:

CDS View Entities

CDS Custom Entities

CDS Abstract Entities

Related Information
 ABAP CDS in ABAP Dictionary (ABAP Keyword Documentation)

CDS View Entities


CDS view entities are at the core of semantically rich data models. They are optimized for fast execution on the SAP HANA
database.

Introduction
CDS view entities are currently some of the most important CDS models. They are based on the SQL-92 DDL standard, but
offer additional features on top of those offered by SQL. You can use the many features that they offer to structure your data.

Use
CDS view entities serve as the building blocks for your application. They provide a framework for de ning and consuming
semantically-rich data models. This means that the user can use CDS, which is an enhancement of SQL, to structure their data
as needed. Additionally, they can use CDS to enrich their data with metadata by the use of annotations.

CDS view entities support many features that make data modeling simple for the user. For instance, users can use expressions
to make calculations and queries in the data model. Associations are also possible and replace joins with simple path
expressions. CDS view entities also enable code-pushdown, which means that all calculations are performed on the database
layer (instead of the application layer), which results in faster data retrieval.

De ning CDS Views Entities


A CDS view entity is de ned by the syntax DEFINE [ROOT] VIEW ENTITY and selects data from one or more data sources.
An example of this syntax, as well as the syntactic structure of a CDS view entity, can be found below.

The cust_book_cds_view_entity CDS view entity de ned below de nes a data selection from the database tables
scustom and sbook by joining both tables. The view contains the ID, the name, and the booking ID of all customers for which
the bookings exist.

 Example
DEFINE VIEW ENTITY I_CUST_BOOK AS SELECT FROM scustom
JOIN sbook
ON scustom.id = sbook.customid
{
scustom.id as ID,
This is custom documentation. For more information, please visit the SAP Help Portal 7
2/19/2023
scustom.name as Name,
sbook.bookid as BoookID
}

Accessing CDS View Entities in ABAP SQL


CDS view entities can be used in ABAP SQL for data selection. The following method lists a customer's booking data that is
stored in the underlying database tables. As demonstrated in the listing below, the CDS entity (in this case:
cust_book_cds_view) is used for data selection in the ABAP source code.

 Example
CLASS cl_demo_access_cds_entity IMPLEMENTATION.
...
METHOD get_data.

SELECT id name bookid


FROM cust_book_cds_view
INTO TABLE @DATA(result_data)
WHERE ... .

ENDMETHOD.
...
ENDCLASS.

Help Content
The following tools documentation is provided for the relevant types of CDS views:

CDS Projection Views

Related Information
 ABAP CDS - View Entities

CDS Views
A CDS view entity is an ABAP repository object and part of a data de nition in the ABAP CDS DDL source code.

Use
A CDS view entity is de ned for existing database tables, views, or other non-abstract CDS entities using the DEFINE VIEW
statement.

CDS views are the predecessor of CDS view entities. It is advised to generally use CDS view entities, but there is still a small
number of features that require the use of CDS views.

 Recommendation
SAP recommends using CDS view entities instead of DDIC-based view due to technical improvements, such as performance
at activation, and so on.

Comparison of CDS DDIC-Based Views vs. CDS View Entities


This is custom documentation. For more information, please visit the SAP Help Portal 8
2/19/2023
The following table shows the difference between CDS view entities and CDS views:

Description CDS DDIC-Based Views CDS View Entities

Optimized CDS activation The CDS entity, CDS DDIC-based view, and
Only the CDS entity and the
the database view need to be activated.
respective database view on SAP
HANA need to be activated.
Consequently, the performance of
the activation runs faster.

Simpli ed handling of CDS extends

Syntax and annotation checks Simple checks Stricter checks that indicate critical
situations more explicitly

Client handling
Based on different algorithms Automatized for complete
transparency
Controlled using the
ClientHandling.type and No annotation allowed for client
ClientHandling.algorithm handling
annotations

Database object View / table function View

CDS-managed DDIC view in ABAP Creation upon activation No CDS-managed DDIC view is generated
Dictionary upon activation

Naming convention Three names for the CDS object, CDS One name for the CDS object, CDS entity,
entity, and the CDS-managed DDIC view on and database view on SAP HANA
SAP HANA

Sample Code

DEFINE VIEW cust_book_cds_view_entity AS SELECT FROM scustom


JOIN sbook
ON scustom.id = sbook.customid
{
scustom.id,
scustom.name,
sbook.bookid
}

The CDS view cust_book_cds_view works with the database tables scustom and sbook. It joins both tables and speci es
the elements of both database tables in the select list.

Related Information
 CDS View (ABAP Keyword Documentation)
Creating and Activating Data Models
Editing DDL Source Code

CDS Projection Views


A CDS projection view is a view that is based on another CDS view and exposes only a subset of elements of the projected
entity.

This is custom documentation. For more information, please visit the SAP Help Portal 9
2/19/2023

Use
Projection views are the top-most layer of your CDS data model. They are based on a CDS view entity or CDS DDIC-based view
(deprecated). A projection view enables you to expose a subset of data from an underlying data model, for example, to be used
in an OData service.

There are three types of projection views that serve different purposes and are designed for different use cases:

CDS transactional queries: Used for modeling the projection layer of a business object in the ABAP RESTful Application
Programming Model (RAP). The projected entity is a CDS view entity. See CDS View Entities.

CDS transactional interfaces: Stable public interface, for example, in RAP extensibility scenarios. The feature set of CDS
transactional interfaces is restricted to projecting elements from the projected entity. The projected entity is a CDS view
entity.

CDS analytical queries: Used for modeling analytical queries within a CDS data model, for example, performing
analytical evaluations and calculations. The projected entity is an analytical cube view or analytical dimension view.

The type of projection view is speci ed in a so-called provider contract. See CDS DDL - PROVIDER CONTRACT (ABAP- Keyword
Documentation) for more information. If no provider contract is speci ed, the projection view is treated as transactional query.
Projection views without provider contract are deprecated.

 Example
An application needs to expose only a subset of data of a CDS view entity. Because the CDS view entity might be used by
other applications, a change may lead to errors. Therefore, you expose the data subset in a project-speci c projection view.

Creating Projection Views


CDS projection views are de ned in data de nition development objects. The wizard for data de nitions provides a template for
projection views. For a detailed description on how to create projection views, see Creating a Data De nition.

For more details about the projection view syntax, see De ne View Entity as Projection (ABAP Keyword Documentation).

Related Information
 ABAP CDS - Projection Views (ABAP Keyword Documentation)

CDS DDIC-Based Views


A CDS DDIC-based view is a CDS view that is technically based on a CDS-managed DDIC view in the ABAP Dictionary. It is
de ned with the CDS DDL statement DEFINE VIEW.

De nition
A CDS DDIC-based view is a CDS entity that is de ned in a CDS data de nition.

Use
Using CDS views, you can rearrange the table elds according to application-speci c needs from the ABAP source code of your
implementation.

This is custom documentation. For more information, please visit the SAP Help Portal 10
2/19/2023

 Recommendation
 SAP recommends using CDS view entities instead of CDS DDIC-based view due to technical improvements, such as
performance at activation, and so on.

Activating CDS DDIC-Based Views


When activating a CDS view, the following objects are created in the ABAP Dictionary:

The actual CDS entity

A CDS-managed DDIC view

Overview of Process and Architecture


The following gure combines the main components of the view-building architecture and also displays the most important
activities that are involved in the view-building process. Using a wizard within the Eclipse-based IDE, you rst create the data
de nition as the relevant development object. In ABAP Development Tools (ADT), the text-based DDL editor is used to write
source code in which you specify the data de nition for a new CDS view. For each CDS DDIC-based view that is de ned in the
data de nition, you will generate – using the activation process – exactly one CDS-managed DDIC view and the corresponding
CDS entity in the ABAP Dictionary.

CDS view building architecture

 Note
When activating a data de nition, a CDS entity and CDS-managed DDIC view form a unity with the data de nition as
development object. So, after transporting the data de nition, the name of the CDS entity and CDS-managed DDIC view can
no more be changed. To rename any part of this unity, you need to delete the corresponding data de nition. Consequently,
you recreate it and use the new name for the relevant part.

This is custom documentation. For more information, please visit the SAP Help Portal 11
2/19/2023

 Caution
Before deleting DDL, check whether it is still being used by other development objects. To nd out if an object is still in use,
call the where-used function (Searching Usages (Where-Used)).

Related Information
 ABAP CDS - DDIC-Based Views (ABAP Keyword Documentation)
CDS Views
CDS Views Extension
Creating and Activating Data Models
Editing DDL Source Code

CDS Custom Entities


A CDS custom entity is a non-SQL CDS entity with a custom query implemented in an ABAP class. They do not come with a
select statement on the data source.

Use
CDS custom entities are used for data models whose runtime is implemented manually.

They make it possible ...

to provide data in AS ABAP using classes.

to split the signature and implementation of the CDS entity.

 Note
It is no longer possible to change the type of the implementation once the CDS custom entity is transported.

Use Cases
The following use cases apply for custom entities:

Data is stored in non-relational storage, for example, Binary Large Objects (BLOB)

Data is stored in LiveCache and access is done using ABAP APIs

Data cannot be computed by means of CDS due to additional logic on application server side

Data model can be de ned using CDS views, but data control language (DCL) feature set is not sufficient to de ne the
necessary authorizations

Related Information
 ABAP CDS - Custom Entities (ABAP Keyword Documentation)

CDS Abstract Entities


A CDS abstract entity de nes the type attributes of a CDS entity without de ning a database object.
This is custom documentation. For more information, please visit the SAP Help Portal 12
2/19/2023

Use
CDS abstract entities can be employed and used as ...

data types whose type attributes go beyond the regular DDIC structures in the ABAP Dictionary

prototype de nitions of data models without being created as instances of a data object

Use Cases
As an application developer, you want to ...

type both the input parameters and the result type of actions.

de ne the data model for outside-in scenarios.

Related Information
 ABAP CDS - Abstract Entities (ABAP Keyword Documentation)

ABAP CDS Code Templates


ABAP CDS code templates are structured descriptions of code patterns that can be used in the ABAP CDS source code.

De nition
Templates provide code patterns for CDS entities that contain ABAP CDS keywords and variables, enclosed in ${} that are
used as placeholder(s). At creation of a CDS object, if possible, the placeholder will be replaced with the actual value in the
source code.

Overview
ABAP CDS code templates ...

are provided for all ABAP CDS objects and CDS entities by SAP.

are displayed and available in the creation wizard, Templates view, and code completion in the source code editors.

can be created for all CDS objects and extended from the Templates view or the Data De nition Templates preference
page.

 Note
This documentation describes the possibility using the preferences page for data de nitions. In addition, the following
preference pages are available for ABAP CDS development:

Access Control Templates

Annotation De nition Templates

Behavior De nition Templates

Metadata Extension Templates

can be imported or exported to share them, for example, with other ABAP developers of your team.

This is custom documentation. For more information, please visit the SAP Help Portal 13
2/19/2023

Use
You can use templates to replicate ...

the whole structure of a CDS object or

a code snippet, for example, a statement.

You add a template to your source code or CDS object to be created by ...

double-clicking it in the Templates view,

using code completion ( Ctrl + Space ), or

selecting it in the Creation Wizard.

 Recommendation
If you want to create your own templates, SAP recommends to ...

use the supported variables. To nd all supported variables, see the Data De nition Templates preferences page.

create the template in the relevant template context. For ABAP development, there is only one template context
provided. For ABAP CDS development, there is a template context for each CDS entity provided.

Template Context
A context is a group that contains one or more templates for each CDS entity, such as, CDS view entity, CDS DDIC-based view,
CDS hierarchy, and so on. Only templates, created in the creation context, will be available in the creation wizard.

Templates, can be created in accordance to the context in the Templates preference page and Templates view.

In the creation wizard, you can only use a template for a CDS entity of your choice which is part of the relevant context.

 Note
If you create a new CDS object on base of a referenced object, the variables in the template will be replaced in accordance to
its usage in the referenced object.

The data_source_elements variable is used to insert the elements of the referenced object.

 Recommendation
The Data De nitions (deprecated) context contains the templates that have been previously de ned. SAP recommends, do
not create your new templates in this context. The templates in this context will no more be updated by SAP.

SAP also recommends, to move the templates under the deprecated creation contexts to the relevant creation context.

Related Information
Using ABAP CDS Code Templates for Data De nitions
ABAP Code Templates
Creating a Data De nition

This is custom documentation. For more information, please visit the SAP Help Portal 14
2/19/2023

Code Element Information for Data De nitions


The Element Information popup and the ABAP Element Info view display details of ABAP Dictionary Objects used in the context
of CDS.

Use
You can use the Element Information popup and the ABAP Element Info view while programming to get further details, for
example, which element of a data source can be used for creating a data model and how it is typed.

You can display the details of:

Data sources used in from clauses, joins, and as targets of associations/compositions, including details about their
elements

Data elements used as parameter types and in cast statements

Overview
You open the Element Information popup from the relevant element in the CDS source code by choosing F2 or Source Code
Show Code Element Information from the context menu.

From this popup you can open the ABAP Element Info view by choosing the @ "Show in ABAP Element Info view" icon. You use
this view, to display your CDS source code and the element information simultaneously.

In this example, the Element Information popup and the ABAP Element Info view display CDS source code information for a CDS view

Here you will get the following information:

This is custom documentation. For more information, please visit the SAP Help Portal 15
2/19/2023
1. Name of the CDS entity and their types

2. The label speci ed in the @EndUserText.label annotation

3. Information about the automatic client handling for the CDS entity

The Client Handling checkboxes provide additional information about the client handling of the CDS entity that is de ned
for the underlying data model.

They provide an effective summary of the following client handling properties:

Client dependent if the CDS entity returns data that is speci c to the logon client

Client session variable used is set if the @ClientHandling.algorithm CDS annotation is added with the
SESSION_VARIABLE value to the CDS entity itself or to a CDS entity in the entity hierarchy

 Note
This checkbox represents the effective state of the property in the system. Therefore, the checkbox and the
speci ed annotation value might deviate in some cases.

4. One or more object links that refer to the relevant extensions of the CDS view

5. Details about the structure, for example, key elements, elements, parameters, and their types

6. Details about the public associations of the CDS entity

If you use an extension for a CDS view, you can also display the structure of the extend view in the append structure popup. To
do this, choose the Detail view with include/append structure icon from the bottom or the toolbar.

Example of the append structure popup of the extend view

This tree displays the elements from the select list and the elements from the extend view. By selecting the link in the Data
Element column, you can navigate to the relevant type.

Related Information
Displaying Code Element Information in Source Code Editors

Extending CDS Entities


You can extend CDS entities of the SAP standard in order to add customer-speci c functionality to a data model without
resulting in modi cations.

This is custom documentation. For more information, please visit the SAP Help Portal 16
2/19/2023

CDS View Extensions


A CDS view extension is a transportable extension of a CDS view that can be used to add elds from the entities used by the
view (and other clauses) to the view without making modi cations.

You use a CDS view extension to:

add new elements or CDS annotations to a CDS view from its underlying data source or

de ne new associations for the CDS view.

You can use the following CDS view extensions to extend CDS entities:

CDS Views Extension to add new elements to a CDS view from its underlying data source or de ne new associations for
the CDS view.

Metadata Extensions to overwrite existing or add new CDS annotations to a one or more elements or parameters of a
CDS entity.

Overview
The following example shows you how to extend a CDS view:

 Example
In the select list of the cust_book_view_entity CDS view:

The metadata of the scustom.id, scustom.name, and scustom.bookid elds is overwritten by the metadata
extension. When the corresponding data de nition is consumed, the metadata of the metadata extension is taken
into account.

The scustom.street and scustom.city database elds are added through the extend view. When you select
data from the corresponding data de nition, the data of these database elds will also be retrieved.

This is custom documentation. For more information, please visit the SAP Help Portal 17
2/19/2023

Possibilities to overwrite existing CDS annotations as well as to add elements to a CDS view

After creating a CDS view extension, the indicator is added at the define view statement to indicate that the select
list of the view has been extended.

Marker that indicates that the select list of the CDS view has been extended

CDS Views Extension


An CDS view extension is a repository object that extends an existing CDS view using the extend view statement. The CDS
view extension itself is not a CDS entity.

Use
When extending, you add further element(s) from the data source (such as a database table or another CDS view) to the select
list of an existing CDS view. So, you can enrich a CDS view that is, for example, part of the SAP standard without resulting in
modi cations.

This is custom documentation. For more information, please visit the SAP Help Portal 18
2/19/2023

Creating and De ning View Extensions


You create CDS view extensions on the basis of the Extend View template that is provided in the creation wizard of data
de nitions.

Entry to add the Extend View template through the creation wizard of data definitions

In this template, the following placeholders are provided and need to be adapted:

${sql_view_append_name}: Name of the append view to be created in the ABAP Dictionary when activating the
extend view

${ddl_source_description}: Description to provide further information about the extend view

${view_name}': Name of the CDS view to be extended

${ddl_source_name_editable}: Name of the extend view

${data_source_name}: Name of the data source from which you want to add new elements to the CDS view

${element_name}: Name of the element(s) (for example, elds or associations) to be added

 Sample Code
@AbapCatalog.sqlViewAppendName: 'DEMO_EXT_VIEW'
@EndUserText.label: 'Demo'
extend view Demo_Data_Model_Base with Demo_Extend_View {
spfli.countryfr as CountryFrom,
spfli.countryto as CountryTo
}

The Demo_Extend_View extend view extends the select list of the Demo_Data_Model_Base CDS view with the
countryfr and countryto elds. This data is now also provided whenever the Demo_Data_Model_Base CDS view is

This is custom documentation. For more information, please visit the SAP Help Portal 19
2/19/2023
used.

Activating Extend Views


When activating a data de nition containing the extend view statement,

an append view that represents the added eld(s) is created in the ABAP Dictionary

the extended eld(s) is added to the existing CDS view on the database

 Note
They are then

considered for every occurrence where the extended CDS view is used.

represented in the SQL Create statement.

Related Information
 ABAP CDS - EXTEND VIEW (ABAP Keyword Documentation)
Creating CDS View Extensions
Creating a Data De nition

Metadata Extensions
Metadata extenstions enable you to add customer-speci c annotations to SAP's CDS entities. Note that these changes do not
result in modi cations.

De nition
A metadata extension is a development object that provides CDS annotations in order to extend the CDS annotations used in a
CDS entity. The standard ABAP Workbench functions (transport, syntax check, activation, and so on) are supported.

Use
Metadata extensions enable you to write the annotations for a CDS entity in a different document to separate them from the
CDS entity.

Overview
The metadata of CDS entities are not extensible by default.

To use a metadata extension for a CDS entity, you have to consider the following conditions:

1. In the de nition of the CDS entity, the @Metadata.allowExtensions annotation with the value true is added. This
annotation explicitly allows the use of metadata extensions.

2. In the metadata extension, you have to de ne the name of the CDS entity to be annotated in the annotate view
statement.

3. In the Switch Framework, metadata extensions are switchable.

This is custom documentation. For more information, please visit the SAP Help Portal 20
2/19/2023

Advantages
You can bene t from the following advantages using metadata extensions:

1. Separation of Concerns: Separating the metadata speci ed in the annotations from the implementation of the entity:

Improves the readability of the source code

Simpli es the development and maintenance of the CDS entity

In addition, the metadata can be developed and updated independently of the data de nition.

2. ABAP Dictionary-independent activation: When activating a CDS entity, the metadata extensions will be ignored. This
results in the following advantages:

It reduces the number of ABAP Dictionary (mass) activations required to develop and maintain the CDS entity.

It speeds up the overall development process.

It facilitates changing the metadata of a CDS entity in a running system, thereby reducing downtime.

3. Modi cation-free enhancements: Customers, partners, and industries can customize the metadata without modifying
the CDS entity.

In addition, metadata extensions are switchable. This means, the metadata can be speci cally enabled or disabled
depending on the use case.

Activation
In general, in a metadata extension only those annotations are permitted that do not affect the ABAP Dictionary
activation/generation or the activation/generation of secondary objects (for example, OData services). For example, the ABAP
annotation @EndUserText and the component-speci c annotations @UI can be speci ed in metadata extensions. A syntax
error occurs if annotations that are not permitted are speci ed.

Related Information
Extracting CDS Annotations to a Metadata Extension
Creating Metadata Extensions
Annotation Propagation

Documentation of CDS Objects


A knowledge transfer document (KTD) is a development object. It can contain documentation of a development object and their
elements for which it has been created. A KTD is based on markdown markup language with plain text formatting syntax.

Use
You use a KTD to provide documentation for the following CDS objects:

Data de nitions (DDLS)

Service de nitions (SRVD)

Creation
You create a KTD from the context menu of the supported CDS object in the Project Explorer. To do this, select the CDS object
and choose New Knowledge Transfer Document.

This is custom documentation. For more information, please visit the SAP Help Portal 21
2/19/2023
After creation, a development object is created for the KTD in the back-end and added to the Texts folder in the Project
Explorer.

Related Information
Knowledge Transfer Documents
Working with Knowledge Transfer Documents

CDS Scalar Functions


A CDS scalar function enables you to accept one or more scalar input parameters and to return a scalar output parameter in
CDS views that are executable in the assigned engine. You can then make this function usable within regular ABAP CDS syntax.

Use

 Restriction
Currently, CDS scalar functions can only be created, edited, or extended by SAP. You, as an SAP customer, can only use them
in CDS projection views for which a provider contract with analytical query is implemented.

In ABAP Development Tools (ADT), you create a scalar function de nition at rst. You then create the according scalar function
implementation and assign an engine to it. Each engine has its own set of built-in CDS scalar functions.

 Restriction
Currently, only the analytic engine is supported.

CDS Scalar Function De nition


A CDS scalar function de nition is a transportable repository object that de nes input values and one output type of the CDS
scalar function.

You can add one or more input parameter(s) and its output type.

 Example
In the following sample, three input parameters (p1, p2, p3) and the output parameter of type abap.dec(10,3) are
de ned.

 Sample Code

DEFINE SCALAR FUNCTION demo_scalar_func_def


WITH PARAMETERS
p1: /DMO/AGENCY_ID,
p2: /DMO/AIRPORT_ID,
p3: /DMO/CARRIER_ID
RETURNS abap.dec(10,3)

CDS Scalar Function Implementation

This is custom documentation. For more information, please visit the SAP Help Portal 22
2/19/2023
A CDS scalar function implementation is a transportable repository object that can be opened in a form-based editor. It is used
as a reference that assigns the scalar function de nition to the engine.

You, as an SAP internal developer, create a scalar function implementation on base of the relevant scalar function de nition. To
do this, choose New Scalar Function Implementation from its context menu in the Project Explorer. In the creation wizard, you
need to add the _ANA suffix to the Name.

After activation, the CDS scalar function de nition can be used in CDS views that are executable in the assigned engine. Note
that the calculation itself is de ned in the engine.

Related Information
ABAP Managed Database Procedures (AMDP)

Access Controls
ABAP Core Data Services (CDS) has its own authorization concept CDS access controls using a data control language (DCL).
The authorization concept of ABAP CDS uses conditions de ned in CDS and can draw upon classical (PFCG) authorizations to
check the authorizations of users.

The CDS authorization concept coexists with the classical authorization concept of Application Server ABAP (AS ABAP). You can
use the concepts together or independently from another. The classical authorization concept is based on authorization objects.
The authorization of a user occurs either implicitly, for example while calling a transaction, or explicitly with the statement
AUTHORITY-CHECK. The CDS authorization concept is based on implicit authorization checks that occur during access
attempts to CDS entities over ABAP SQL.

Overview of Process and Architecture


The following gure shows the main components for creating access controls (DCLs). First you create the CDS entities you
want to protect in data de nitions (DDLs). Next, use a wizard within the Eclipse-based ABAP IDE to create the access controls
for the authorization objects. In access controls you de ne CDS roles.

A developer de nes a CDS role in a separate CDS source code for a CDS entity using the DCL statement DEFINE ROLE. When
a CDS entity is accessed using ABAP SQL, the following is checked:

1. Is a CDS role de ned for the CDS entity?

If no CDS role is de ned for a CDS entity, there are no restrictions on the data returned by the query.

 Note
There are cases where a CDS role is de ned, but it is not taken into account at runtime.

The developer of the DDL source has set the annotation @AccessControl to #NOT_ALLOWED.

The DDL has been inherited by another CDS entity. Only the CDS role for the parent DDL is relevant at
runtime. If the parent DDL has no CDS role or the annotation @AccessControl has been set to
#NOT_ALLOWED, then the CDS role is masked and ignored at runtime.

The developer has added the keywords WITH PRIVILEGED ACCESS in the FROM clause of an ABAP SQL query.

2. Does the current user have the required authorizations?

If a CDS role is de ned for the CDS entity, access control management checks the current user for authorizations. The
system only reads data for which an authorization exists. CDS roles are assigned to all users implicitly.

This is custom documentation. For more information, please visit the SAP Help Portal 23
2/19/2023
When you activate an access control, AS ABAP generates the artifacts access control management needs and saves them in
the ABAP runtime environment. At runtime, an application accesses a CDS entity using ABAP SQL and ABAP adds the
restrictions to the selection conditions.

Defining an Access Control (DCL Source) in the Access Control Editor

Notes
We recommend that you continue to use the classical authorization concept for start authorizations. Start authorizations check
whether a user can start an application in the rst place. The CDS authorization concept can be used within an application to
perform instance-based authorization checks. Instance-based authorization checks the authorization of a user as de ned by the
data model and the data in question.

Related Information
Adding Access Controls to CDS Entities
ABAP CDS - Access Control (ABAP Keyword Documentation)

Adding Access Controls to CDS Entities

Prerequisites
You have the standard developer authorization pro le to create ABAP development objects.

Context
Use access controls to develop access-control logic for Core Data Services (CDS) entities from AS ABAP. Access controls
enable you to lter access to data in the database based on static values or conditions based on user data (classical
authorization objects). Use data control language (DCL) to write access controls. If no access control was created and deployed
for the CDS entity, a user who can access the CDS entity has access to all data returned by the entity.

 Example
For example, you provide a view of sales orders. You can add a condition that users can only view open sales orders or only
sales orders for companies, which are in the countries that are listed in a classical authorization object.

 Tip
We recommend that you protect applications that use CDS entities with classic start authorizations available from AS ABAP.

This is custom documentation. For more information, please visit the SAP Help Portal 24
2/19/2023

Procedure
1. Create the access control development object.

2. Edit the source code of the access control.

Edit the source code of the access control just as you would data de nition source code.

There is no support for the following:

Quick xes

Adding and removing comments

Comparing source code versions of access controls

3. Check the syntax of the access control.

Check the syntax of access controls just as you would check the syntax of data de nitions.

4. Activate the access control.

Activate access controls just as you would activate data de nitions.

Activation logs for access controls are not supported.

Related Information
Creating Access Controls
Editing DDL Source Code
Checking Syntax of DDL Source Code
Activating Data De nitions
Access Controls

Creating Access Controls


An access control enables you to limit the results returned by a CDS entity to those results you authorize a user to see.

Prerequisites
You have the standard developer authorization pro le to create development objects.

You have created the CDS entities for which you want to restrict access.

Context
An access control is a development object, which supports standard functions such as transport, syntax check, and activation.

Procedure
1. In your ABAP project, select the relevant package node in the Project Explorer.

2. Open the context menu and choose

New Other ABAP Repository Object Core Data Services Access Control .

3. In addition to the Project and Package, enter the Name and the Description for the access control to be created.

4. [Optional:] If you want to create an access control for a speci c CDS entity, enter the relevant entity name as the
Protected Entity.

This is custom documentation. For more information, please visit the SAP Help Portal 25
2/19/2023

 Note
You can only protect CDS entities.

5. Choose Next.

6. Assign a transport request.

7. Choose Next.

8. Determine if you want to use a template for the access control.

Option Description

Use a template. SAP offers example templates for access controls. The
template provides you with example coding for you to modify.

Do not use a template. The tool creates an empty access control for you to code.

9. Choose Finish.

Results
In the selected package, AS ABAP creates an inactive version of an access control and stores it in the ABAP Repository. In the
Project Explorer, the new access control is added to the Access Controls folder of the corresponding package node. As a result
of this procedure, the access control editor opens. De ne the role for the CDS entity.

Related Information
Access Controls
Editing DDL Source Code

Creating and Activating Data Models


ABAP Core Data Services (CDS) enables you to de ne semantic data models which can be used in business applications.

In ABAP Development Tools (ADT), you de ne the CDS entities for your data model using data de nitions.

To create a data de nition, you use the creation wizard. After you create the data de nition, the back-end creates an inactive
version of it in the ABAP Repository and opens it in the source-based editor. From here you can start de ning the CDS entity.

When activating the inactive version of a data de nition, the CDS entity is created in the ABAP Dictionary and it can then be
used in business applications.

 Note
In the creation wizard, ADT provides different templates to de ne different types of CDS entities.

Choose the relevant template for the required entity.

Related Information
Creating a Data De nition
Using ABAP CDS Code Templates for Data De nitions
Creating ABAP CDS Objects With Reference to Other Objects
This is custom documentation. For more information, please visit the SAP Help Portal 26
2/19/2023
Activating Data De nitions

Creating a Data De nition


A data de nition is a repository object that allows you to de ne a CDS entity using the CDS DDL of ABAP CDS in DDL source
code. It also accesses the standard functionality (transport, syntax check, activation).

Prerequisites
You need the standard developer authorization pro le to create development objects.

Context
A CDS entity can be used, for example, as a data source in other CDS entities.

You can create the following CDS entities using a data de nition:

List of the Supported CDS Entities

CDS Entity Template Context Back-End Use Case Further Information


Dependencies

CDS view entity CDS View Entity You want to create a data model
CDS Views
which retrieves the relevant
data, for example, from a
 CDS DDL -
database table on the
DEFINE VIEW
recommended way.
ENTITY (ABAP
Keyword
 Recommendation Documentation)
SAP recommends using
CDS view entities due to
technical improvements,
such as performance at
activation, and so on.

CDS view extension Extend View You want to extend an existing


CDS view.  CDS DDL -
EXTEND VIEW
ddic_based_view
(ABAP Keyword
Documentation)

CDS view extension Extend View Entity You want to extend an existing
entity CDS view entity.  CDS DDL -
DEFINE VIEW
ENTITY (ABAP
Keyword
Documentation)

This is custom documentation. For more information, please visit the SAP Help Portal 27
2/19/2023

CDS Entity Template Context Back-End Use Case Further Information


Dependencies

Abstract CDS entity Abstract Entity You want to model an abstract


CDS Abstract
CDS entity like a structure
Entities
without persisting a new ABAP
Dictionary object. To do this,
 ABAP CDS -
you use abstract entities, for
DEFINE
example, during development
ABSTRACT
of an action for an OData
ENTITY (ABAP
service. In this case, abstract
Keyword
entities are used to de ne the
Documentation)
type information for the action
parameters.

CDS custom entity Custom Entity You want to access data that
CDS Custom
exceeds the CDS feature set.
Entities

 CDS DDL -
DEFINE CUSTOM
ENTITY (ABAP
Keyword
Documentation)

CDS hierarchy Hierarchy You want to structure


application data to make it  ABAP CDS -
easier to consume. This Hierarchies
enables you, for example, to (ABAP Keyword
select data that is relevant for a Documentation)
speci c time frame or to handle
grouped objects
simultaneously.

CDS projection view Projection View In a transactional scenario, you


CDS Projection
want to create and de ne, for
Views
example, a consumption-
speci c OData service that only
 CDS DDL -
exposes relevant data of an
DEFINE VIEW
underlying data model using a
ENTITY AS
service de nition and service
PROJECTION
binding.
(ABAP Keyword
Documentation)

CDS table function Table Function You want to use a CDS table
function as the data source in  CDS DDL -
ABAP SQL read statements. DEFINE TABLE
FUNCTION
(ABAP Keyword
Documentation)

This is custom documentation. For more information, please visit the SAP Help Portal 28
2/19/2023

CDS Entity Template Context Back-End Use Case Further Information


Dependencies

CDS DDIC-based view CDS DDIC-Based You want to create a data model
CDS View
View which retrieves the relevant
Entities
data, for example, from a
database table.
 CDS DDL -
DEFINE VIEW
 Recommendation ddic_based
 SAP recommends using (ABAP Keyword
CDS view entities due to Documentation)
technical improvements,
such as activation, and so
on.

Procedure
1. In your ABAP project, select the relevant package node in the Project Explorer.

2. Open the context menu and choose New Other... Core Data Services Data De nition to launch the creation
wizard.

3. In addition to the Project and Package, enter the Name and the Description for the data de nition to be created.

4. [Optional:] If you want to create a data de nition using the elements from another CDS entity, enter the relevant name
as the Referenced Object.

 Note
You can refer to another CDS entity or a database table and insert all elements by default.

5. Choose Next.

6. Assign a transport request.

7. Choose Next.

8. [Optional:] Select the code template to be inserted in the created DDL source code.

 Note
By default, ABAP Development Tools (ADT) considers the template for creation that you have selected at the last
time. If you select the Use the selected template checkbox, ADT will always use the selected template by default and
jumps over the template page at the next creation.

ADT only displays the templates that can be used at this point of your implementation.

You can create and use your own templates. For more information, see ABAP CDS Code Templates

9. Choose Finish.

Results
In the selected package, the ABAP back-end system creates an inactive version of a data de nition and stores it in the ABAP
Repository.

In the Project Explorer, the new data de nition is added to the Core Data Services folder of the corresponding package node.
As a result of this creation procedure, the source editor will be opened. Here, you can start de ning a CDS entity.

In addition, you can start modifying the inserted code template and add annotations to the relevant elements and/or
parameters.

This is custom documentation. For more information, please visit the SAP Help Portal 29
2/19/2023
The CDS entity is de ned at activation of the data de nition.

Related Information
CDS View Entities
Editing DDL Source Code
ABAP Development Objects

Using ABAP CDS Code Templates for Data De nitions


Code templates can help to reduce the time spent on routine coding.

Use
ABAP Development Tools (ADT) provides a number of prede ned code templates for data de nitions. In addition, you can create
further templates for your own use.

When creating a data de nition, the creation wizard provides different templates to de ne different types of data de nitions.
Choose the relevant template.

To search for all templates available ...


1. Open the Preferences page ABAP Development Editors Source Code Editors Data De nition Templates from
the menu bar.

To use a template ...

 Recommendation
 If you want to de ne a CDS view, SAP recommends using the defineViewEntity template.

1. In the empty DDL source code editor, trigger code completion ( Ctrl + Space ).

A popup is opened which displays the available templates.

Example for displaying and selecting the available templates for data definitions

2. Select the relevant template to be inserted.

 Tip
Alternatively, you can use the Templates view to insert the code template in the DDL editor using drag & drop.

To create an additional template for your own use ...


This is custom documentation. For more information, please visit the SAP Help Portal 30
2/19/2023
1. Open either the Templates view or the Preferences page (referred above).

2. Open the New Template dialog.

3. Specify the Name and the Description

 Tip
If you want to add the new template to the data de nition creation wizard, select Data De nition (creation) as the
Context.

4. To add or edit the Pattern of the template, choose Ctrl + Space or the Insert Variable... button from below at the
relevant position.

5. Improve the format for the source code template manually.

6. Save the new template with OK.

Related Information
Creating and editing templates
Java Editor Template Variables

Creating ABAP CDS Objects With Reference to Other Objects


A referenced object is a repository object that relates to or is based on another development object.

Context
You want to create a CDS object that relates to another CDS entity or database table. This enables you, for example, to create
a metadata extension that contains all elements of a particular data de nition.

Procedure
1. In your ABAP project, select the relevant package node and data de nition in the Project Explorer.

2. Open the context menu and choose New Other ABAP Repository Object Core Data Services Metadata Extension
to launch the creation wizard.

The creation wizard is opened.

3. In addition to the Project and Package, enter the Name and the Description for the data de nition to be created.

4. Enter or search the name of the Referenced Object.

 Note
In the Creation Wizard, the label of this input elds depends on the type that you want to refer or base on your new
CDS object. In the context of ABAP CDS development, you can use the reference functionality when creating the
following CDS objects:

Data de nitions: You want to insert all elements from a referenced CDS entity or database table when
creating a data de nition. To do this, enter the name of the underlying Referenced Object in the Creation
Wizard.

Access control: You want to protect a CDS entity by creating an access control. To do this, enter the name of
the underlying Protected Entity.

Metadata extension: You want to extend the elements of a CDS entity by creating a metadata extension. To do
this, enter the name of the underlying Extended Entity.

This is custom documentation. For more information, please visit the SAP Help Portal 31
2/19/2023
Service de nition: You want to expose a CDS entity by creating an access control. To do this, enter the name
of the underlying Exposed Entity.

If you select the referenced object in the Project Explorer and create the CDS object from the context menu, its name
will be displayed automatically inserted.

If you use the content assist, only the supported objects will be offered.

5. Choose Next.

6. Assign a transport request.

7. Choose Next.

8. [Optional:] If requested, select a template.

 Note
ABAP Development Tools (ADT) only displays the templates in a table that are relevant for the current case.

By default, ADT Tools considers the template for creation that you have selected at the last time.

9. Choose Finish.

Results
In the selected package, the ABAP back-end system creates an inactive version of a metadata extension and stores it in the
ABAP Repository.

In the Project Explorer, the new metadata extension is added to the Core Data Services folder of the corresponding package
node. As a result of this creation procedure, the source editor will be opened and contains the elements of the referenced data
de nition. Here, you can start de ning a metadata extension.

After developing and checking your new object, you can activate it.

Related Information
Creating a Data De nition
Creating Metadata Extensions

Activating Data De nitions


At activation of a data de nition, the appropriate CDS entities and CDS objects are implicitly created in the ABAP Dictionary.

Prerequisites
Make sure that the data de nitions you wish to activate is syntactically correct. The system performs a syntax check of the
entire object before it is activated.

Context
You want to generate a CDS view.

Procedure

This is custom documentation. For more information, please visit the SAP Help Portal 32
2/19/2023
To trigger activation of data de nitions, you have the following possibilities:

1. From the DDL editor ...

a. Open the relevant data de nition in the DDL editor.

b. Choose the icon (Activate the ABAP Development Object) in the toolbar.

 Tip
Alternatively, you can use the shortcut Ctrl + F3 .

2. From the Project Explorer ...

a. Select the node of the relevant data de nition in the ABAP project in the Project Explorer.

b. Open the context menu and choose Activate.

Results
In the selected ABAP package, the back-end system creates an active version of the CDS view and the CDS database view and
stores them in the ABAP Dictionary. The data de nition is added to the Core Data Services folder of the selected package.

 Note
You can specify the client dependency of the CDS view using the @ClientHandling CDS annotation. If the CDS view is
client-dependent, the client eld is automatically added to the CDS database view.

Related Information
Displaying the ABAP Dictionary Log and the Activation Graph
Status of a Development Object
Previewing Data Records

Displaying the ABAP Dictionary Log and the Activation Graph


When a data de nition object is activated, the ABAP Dictionary log protocols all changes. The activation graph visualizes the
information of the ABAP Dictionary log in a graphical way.

Context
You want to get further details about impact of your changes, for example, in case of errors at activation.

You can open the following views to get more information:

Dictionary Log to get more detailed technical information on diagnosis and troubleshooting in a tabular way

Activation Graph to visualize the order of activation from the ABAP Dictionary and CDS objects which are involved and
possible effects for mass activation on depending CDS objects

You have the following possibilities to display further details:

1. For an error item displayed in the Problems view

2. For example, for an activation issue from the context menu in the DDL editor, select the corresponding function in the
context menu:

To open the Dictionary log, choose Open with Dictionary Log .

This is custom documentation. For more information, please visit the SAP Help Portal 33
2/19/2023
To display the Activation Graph, choose Open with Activation Graph .

 Note
view: SelectBoth functionalities can also be triggered from a selected data de nition in the Project Explorer.

Related Information
Troubleshooting for Activation Errors in the Context of ABAP Dictionary Objects

Viewing Generated SQL Statements


You can display the SQL create statement that was generated at database level for each CDS entity in a popup.

Context
You want to realize some unexpected behavior which took place when you were accessing CDS entities for data selection. Then,
you will possibly need to check the syntax of the native SQL statements generated at database level.

 Example
You might be interested in checking ...

the generated SQL data types, based on their de nition in the CDS table functions when running AMDP procedures.

the JOIN structure at database level when using associations in CDS view de nitions.

 Note
You can use the SQL statement viewer for active, inactive, and even unsaved data de nitions – if the source code is
syntactically correct. Otherwise, you receive a corresponding message DDL Statement could not be created. Check
data definition for syntax errors.

Procedure
1. Open the relevant CDS entity (CDS view, CDS table function) in the DDL source editor.

2. Position the cursor somewhere in the DDL source code.

3. Open the context menu and choose Show SQL CREATE Statement.

Results
The corresponding SQL create statement is displayed in the Element Information Popup.

 Example

This is custom documentation. For more information, please visit the SAP Help Portal 34
2/19/2023

The SQL syntax for CREATE FUNCTION is displayed in the Element Information Popup

 Note
The SQL create statement depends on the CDS entity from which you trigger it. Consequently, the create statement might
differ from the example above.

 Tip
From within the Element Information Popup, you have the option to open the ABAP Element Info view by clicking the Show in
ABAP Element Info View icon ( @ ).

Migrating CDS DDIC-Based Views to CDS View Entities


The migration and simulation wizard performs the migration of one or more CDS DDIC-based views to the CDS view entities for
you.

Prerequisites
In advance, you can de ne your speci c ABAP repository tree that contains the data de nitions to be converted.

For more information, see

Creating an ABAP Repository Tree

Opening and Searching CDS Objects

Context
You want to migrate data de nitions which de ne CDS DDIC-based views to CDS view entities.

 Note
In order to check and test the results of the migration before performing any changes, you can simulate the actual migration
in advance.

This is custom documentation. For more information, please visit the SAP Help Portal 35
2/19/2023

Procedure
1. In your ABAP project, navigate to the Core Data Services Data De nitions folder and select the relevant data
de nitions containing the CDS DDIC-based view to be migrated in the Project Explorer.

2. Open the context menu and choose Migrate to CDS View Entity....

The Migration of CDS DDIC-Based Views to CDS View Entities wizard is opened and displays the data de nition(s) to be
migrated.

3. [Optional:] To add or remove data de nitions, choose the Add or Remove button.

4. Choose Next.

The Select Migration Options page is opened.

5. Choose one of the following modes:

Simulation

Migration

Simulation checks and tests for errors and warnings before performing any changes. No object will be migrated
productively.

Migration will generate inactive CDS view entities which you have to activate manually.

In case of a migration, the Select a Transport Request page is opened.

6. [Optional:] Assign a transport request.

7. Choose Finish to trigger migration or simulation.

In case of migration, the changes on the CDS DDIC-based views are performed.

At the end, the CDS DDIC-Based View Migration Log page is opened. The result is structured as a tree in the log. The
latter displays the name of the CDS object and the name of the passed checks and rules, as well as other progress
information. Error, warnings, or positive results are highlighted in accordance.

This is custom documentation. For more information, please visit the SAP Help Portal 36
2/19/2023
Sample of a result from a simulation

8. [Optional:] In case of an issue, an error or warning is displayed. To get more detailed information, you can select the
name of the displayed CDS object, check, or rule.

When selecting the issue or respectively the name of the CDS object/check, the following information is displayed in the
log:

Issue/Selection Displayed Information

Name of the CDS object The Code Comparison highlights the changes between the
original source code and the migrated source code of the
selected data de nition. This helps you to understand and
check the changes.

Name of the check or rule The wizard performs prede ned checks before and while
running the migration. In case of an issue, the root cause and
the recommendation on how to solve the issue is displayed.

After the migration, the consistency of the migrated data


de nition itself is checked.

These features support you in controlling the migration.

The column Description provides a short summary of the most relevant information.

9. [Optional:] In the log page, you can select the Only show objects with errors checkbox to limit the number of messages.

This improves readability of the log and makes it easier for you to check the migration result.

10. Choose Close to nish simulation or migration.

Results
In case of a migration, the adaptations on the source code of CDS DDIC-based view(s) are performed. If you now open the data
de nition containing the CDS DDIC-based view to be migrated, the adapted source code will be displayed.

 Note
The migration will become effective after you have activated the migrated data de nitions.

 Caution
A migration cannot be reverted when the migrated CDS view entity has been activated.

Related Information
Creating a Data De nition

Editing DDL Source Code


 Note
In the current version of the DDL editor within ABAP Development Tools, you can only de ne one CDS entity in a data
de nition.

This is custom documentation. For more information, please visit the SAP Help Portal 37
2/19/2023

Related Information
Getting Support from the Content Assist
Getting Help for DDL Source Code
Displaying Details in the Element Information Popup and the ABAP Element Info View
Navigating Associations
Applying Quick Fixes
De ning ON Conditions by Use of a Wizard (Obsolete)
Adding and Removing Comments
Hiding CDS Annotations and Comments
Changing Colors of DDL and DCL Source Code
Comparing DDL Source Code Versions
Formatting DDL
Checking Syntax of DDL Source Code

Getting Support from the Content Assist


In the CDS source code editor, the content assist proposes valid keywords and identi ers that can be inserted into the source
code at the cursor position. Consequently, you can reduce the time spent on code editing and ensure that you are using the
valid syntax and source code elements.

You can reduce the time spent on code editing and ensure that you are using the valid syntax and source code elements by
using the content assist.

The following content assist functions are provided for CDS objects:

Content Assist Description

Keyword Completion Proposed automatically as soon as you start typing to get the best
matching keyword in the completion popup.

Code Completion Proposed at the position where you have triggered the Ctrl +
Space shortcut with

All matching keywords or the

Semantic identi ers like the best matching data sources,


parameters, or elements of an ABAP Dictionary artifact

in the code completion popup.

Related Information
Getting Support from the Content Assist

Keyword Completion
In the DDL source code editor, the best matching keyword is automatically displayed as soon as you start typing the keyword.

Procedure
1. In the DDL editor, start typing the keyword.

This is custom documentation. For more information, please visit the SAP Help Portal 38
2/19/2023
The editor opens the completion popup and displays the most relevant keyword to be inserted.

Keyword completion in the DDL source code editor

2. To use the keyword in your DDL source code, choose the tabulator key.

Related Information
Keyword Completion

Code Completion
In the CDS source code editor, you can trigger code completion manually at any position to get the list of the best matching
keywords or identi ers.

Context
You want to get a list with proposals of keywords or identi ers that can be added at the current cursor position.

This functionality enables you to:

Add possible keywords or identi ers such as elds, data elements, CDS annotations, and parameters that are typed with
a data element or a prede ned ABAP type

 Note
You can use wildcards like the asterisk (*) to limit the list of relevant entries if you do not know the quali ed name of
the identi er.

Using the asterisk at the leading position is not supported.

If you use several segments within a identi er path, only the asterisk in the last segment is supported.

Select and add the component of the related identi er, such as one or more elds from a data source (for example, a
database table or a select from another CDS view)

to your ABAP CDS source code.

Procedure
Code completion depends on the position from where you trigger it within the source code. You have the following possibilities
to trigger code completion manually:

1. To trigger code completion for keywords, proceed as follows:

a. At the position (for example, at the beginning of a row or after an identi er) where you want to add a keyword,
type its rst letter(s).

This is custom documentation. For more information, please visit the SAP Help Portal 39
2/19/2023
b. Choose Ctrl + Space .

The popup with the list of the relevant keywords will be opened.

Example of a code completion popup for keywords

c. Select the relevant keyword and choose Enter .

2. To trigger code completion for the name of an identi er, for example, the name of a data source and its parameters,
proceed as follows:

a. At the position where you want to add an identi er, type the rst letter(s) of the name from the data source.

b. Choose Ctrl + Space .

The list with the elements of the signature is automatically displayed after you have typed a dot as the
component selector. This enables you to add a component of a table to your CDS source code.

Example: Adding a data source to the DDL source code

The list with the elements of the signature is automatically displayed after you have typed a dot as the
component selector. This enables you to add a component of a table to the DDL source code.

This is custom documentation. For more information, please visit the SAP Help Portal 40
2/19/2023

Completion of elements in the DDL source code editor

c. To add a keyword or an identi er, choose Enter . To add a parameter binding for a data source, choose Shift +
Enter .

 Note
Code completion is context-sensitive and detects when parameter binding is required. It then also
automatically inserts parameters when choosing a column or a CDS entity from the completion popup, also
when you simply press Enter .

Related Information
Adding the Name of Data Sources to Elements as Pre x Automatically
Adding Elements
Inserting CDS Annotations
Keyword Completion
Code Completion
Non-Keyword Completion
Inserting or Overwriting Source Code

Adding the Name of Data Sources to Elements as Pre x


Automatically
You can con gure the code completion preferences for CDS entities to add the name of a data source as the pre x before an
element automatically.

Procedure
1. Open the ABAP Development Editors Source Code Editors CDS Code Completion Preferences page.

2. To always add the name of the relevant data source to the element as the pre x, choose the Always pre x elements with
data source name checkbox in the preferences.

3. Choose Apply to add your changes and con rm with OK.

This is custom documentation. For more information, please visit the SAP Help Portal 41
2/19/2023

Results
If you now add the name of an element that is not unique and contained inside multiple data sources, ADT will automatically add
the name of the relevant data source as the pre x. This makes it clear which element is used.

The names of the data source and the element are separated with a dot.

Adding Elements
You can add any CDS elements and CDS entities to CDS source code using code completion.

Context
The names of identi ers (such as CDS entities, elds, parameters, and associations) used in a CDS object are added in
accordance with their de nition. When adding an identi er using code completion, the names are added in the same case
(camel case, lower case, and so on) in which they were originally de ned in their original DDL source code. This ensures that
identi er names are used consistently (same casing) in CDS sources.

Additionally, identi ers in CDS objects are always formatted on save, independent of the DDL formatter settings. This ensures
consistent casing.

Related Information
Adding Aliases for Inserted Elements from Database Table

Adding Aliases for Inserted Elements from Database Table


When creating a data de nition, using a database table as data source, and performing Insert all elements or when creating a
data de nition referenced to a database table, ABAP Development Tools (ADT) will generate an alias for each element in the
select statement.

Context
You want to create a data de nition that contains all elements of its data source(s). An alias should be automatically generated
for all elements of a database table.

 Note
Aliases will only be automatically generated in DDL source code if a database table is used as data source. The aliases will
then be generated for all element names as follows:

The rst character of the element name will be changed in upper case.

The character following an underscore will be changed in upper case, while the underscore is removed.

This behavior is enabled by default on the ABAP Development Editors Source Code Editors CDS Code Completion
preference page. To deactivate it, deselect the Always pre x elements with data source name checkbox.

Related Information
Inserting or Overwriting Source Code

This is custom documentation. For more information, please visit the SAP Help Portal 42
2/19/2023
Adding Elements

Inserting CDS Annotations


You can con gure the code completion preferences for CDS objects how to insert CDS annotations in the de nition part or for
elements.

Context
You want to add the array of a CDS annotation at in one line or structured with tab stops across several lines.

 Tip
Inserting CDS annotations across several lines might make your ABAP CDS source code more readable.

 Sample Code
Sample for a at insertion in one line:

@Consumption.valueHelpDefinition: [{additionalBinding: [{element: ''}]}]

Sample for a structured insertion across several lines:

@Consumption: {
valueHelpDefinition: [{
additionalBinding: [{
element: ''
}]
}]
}

Procedure
1. Open the ABAP Development Editors Source Code Editors CDS Code Completion Preferences page.

2. In the Insertion of CDS Annotations section, choose the relevant option:

Flat

Structured

3. Choose Apply to add your changes and con rm with OK.

Results
If you choose ...

Flat insertion, the array will be added in one line.

Structured insertion, the array will be added across several lines and indent with a tab stop.

Related Information
 ABAP CDS - ABAP Annotation Syntax
This is custom documentation. For more information, please visit the SAP Help Portal 43
2/19/2023

Getting Help for DDL Source Code


When editing DDL source code, you will generally need to make use of the ABAP CDS reference documentation. Is part of the
ABAP Keyword Documentation. Here, you will nd more information about the syntax and meaning of ABAP CDS language
elements.

To get access to it, ABAP Development Tools provides a context-sensitive link (F1 help) from the ABAP CDS keywords within the
DDL editor. This help content is displayed in a ABAP Language Help view.

In addition, you may need to display the de nition and documentation of elements used, like database tables, views, or
individual table elds that you used when de ning CDS views in the DDL editor. For this purpose, choose F2 to access the
Element information popup.

Accessing the ABAP Keyword Documentation (F1)


To access the ABAP Keyword documentation with contains the ABAP CDS language reference documentation, position the
cursor on an ABAP CDS language element or SAP annotation for which you need help and choose F1 .

Context-sensitive language help in DDL editor

 Tip
 In addition, you will nd the complete ABAP CDS - Language Elements (ABAP Keyword Documentation) on the SAP Help
Portal.

This is custom documentation. For more information, please visit the SAP Help Portal 44
2/19/2023

Accessing Code Element Information


In the DDL editor, move the cursor to the element of your interest and choose F2 .

Opening the code Element information popup

From the toolbar within the Element information popup, you have the following options:

To open the selected development object, choose the Open in Editor (F3) icon

To search for elements within theElement information popup, choose the Find (Ctrl+F) icon

To change the display mode, choose the Detail view with include/append structure

To open the ABAP Element Info view, choose the "@" Show in ABAP Element Info View icon.

Example of an ABAP Element Info view:

This is custom documentation. For more information, please visit the SAP Help Portal 45
2/19/2023

Tree display for a table with appends/includes

 Note
From the table, you have the option to show a tree-based display that indicates the includes or append structures – if
they are de ned for the table elds.

Displaying Details in the Element Information Popup and the


ABAP Element Info View
You can display details of ABAP Dictionary objects used in the context of CDS in the Element Information popup and the ABAP
Element Info view.

Context
You want to display details about a CDS view used in a data de nition to get further information.

Procedure
1. In the ABAP CDS source code, position the cursor on the CDS view name in the implementation and choose F2 or
Source Code Show Code Element Information from the context menu.

The Element Information popup is opened and displays the corresponding details.

2. You can render the same information in the ABAP Element Info view.

a. Choose the @ "Show in ABAP Element Info view" icon.

3. You can navigate in the Element Information popup / ABAP Element Info view, for example, to get more information
about an element's type.

a. Position the cursor on the name of the type in the corresponding element information.

The type name becomes a link.

b. To navigate, select the link.

The element information for the selected type is now displayed.

This is custom documentation. For more information, please visit the SAP Help Portal 46
2/19/2023
4. You can open a development object in the relevant source code editor from the Element Information popup / ABAP
Element Info view.

a. Open the context menu from the relevant element and choose Open in Editor (F3).

Alternatively, choose the icon.

5. You can display information about the append structures that are generated when the CDS entity is extended with an
extend view.

a. Choose the Detail view with include/append structure icon.

 Note
This icon is only available if the append structure can be evaluated.

The elements of the data source and the extend view are displayed as a tree in the append structure popup.

6. You can browse within the Element Info popup / Element Information view.

a. Choose one of the following shortcuts:

Alt + Left to navigate backward in the history

Alt + Right to navigate forward in the history

7. You can increase/reduce font size in the Element Info popup / Element Information view.

a. Choose Ctrl + + / Ctrl + - .

8. You can search within the Element Information popup / Element Information view.

a. Choose the nd icon from the bottom or the toolbar.

The search input eld is opened.

b. Enter the search string and choose Enter.

The relevant search results are highlighted.

c. To navigate within the search results, choose one of the following shortcuts, icons, or keys:

Enter or choose to nd the next occurrence of your search string

Shift + Enter or choose to nd the previous occurrence of your search string

F3 to open the selected search result in its editor

F2 to navigate to the selected search result within the Element Information popup

The cursor navigates to the relevant results.

d. To skim through search results, you can use the following icons:

To lock the current display in order to compare, for example, details of several data sources, choose the
icon.

To link the display of the selected details with the current cursor position, choose the icon.

The display will then automatically be refreshed in accordance to the selected cursor position within the
source code.

Related Information
Code Element Information for Data De nitions
Displaying Code Element Information in Source Code Editors

This is custom documentation. For more information, please visit the SAP Help Portal 47
2/19/2023

Displaying Details About Buffering From CDS View Entities

Context
You want to display information about the actual valid buffering for a CDS entity view in the Element Information popup.

Procedure
Choose F2 on the occurrence of the relevant CDS view entity in your ABAP CDS source code.

Results
The Element Information popup is opened.

Sample for displaying information about buffering in the element information popup

In addition, the following information is displayed:

Checkbox Bufferable is checked if the currently opened CDS view entity can be buffered.

Checkbox Buffered is checked if the currently opened CDS view entity is buffered by another CDS entity buffer.

Type de nes which records are loaded into the buffer entity when it is accessed.

 Note
If the type is underlined, it is linked. You can then navigate to the CDS entity buffer that de nes the respective
settings.

Related Information
Creating a CDS Entity Buffer

Navigating Associations
In addition to the F3 Eclipse navigation functionality, you can also navigate between the origin, the de nition, and the target of
the associations you are using in your data de nition.

You have the following options:

Navigating to the Association Origin


If an association originates in another data source or is de ned within the same data source, you can navigate to its origin or
de nition as follows:

This is custom documentation. For more information, please visit the SAP Help Portal 48
2/19/2023
1. In the DDL editor, select the name of the association.

2. Open the context menu on the name and choose Navigate To.

 Note
Alternatively, you can press F3 or Ctrl + click . A small dialog is then opened below the association name. Here
you choose Navigate To.

The corresponding data de nition id is opened and highlights the relevant origin or navigates to the relevant de nition within
the same data de nition. In both cases, the selected occurrences and names are highlighted.

Navigating to Association Targets


You can navigate to the origin data source of the association's target – for example, another CDS entity or a database table –
as follows:

1. In the DDL editor, select the name of the association.

2. Open the context menu on the name and choose Navigate To Target.

 Note
Alternatively, you can press Ctrl + click . A small dialog is then opened below the association name. Here, you then
choose Navigate To Target.

The target of the association is opened in the appropriate DDL editor.

Related Information
Opening Development Objects

Applying Quick Fixes


Quick xes enable you to resolve errors and warnings in the DDL source code using the corresponding functionality that is
provided in the Quick Fix popup.

In the DDL editor, the following quick xes are provided:

Description Effect

Name of CDS database view is missing Adds the annotation @AbapCatalog.sqlViewName:


'SQL_VIEW_NAME' , which speci es the name of the CDS
database view to be generated in the ABAP Dictionary.

Name of CDS database view append is missing Adds the annotation @AbapCatalog.sqlViewAppendName:
'APPEND_VIEW_NAME', which speci es the name of the append
view that will be generated in the ABAP Dictionary.

GROUP BY clause is missing Adds the GROUP BY clause that is required if aggregate functions
(MAX, SUM, ...) are contained in the SELECT list. In addition, all
elements not de ned using aggregate functions are speci ed after
GROUP BY.

This is custom documentation. For more information, please visit the SAP Help Portal 49
2/19/2023

Description Effect

EXTEND GROUP BY clause is missing If the GROUP BY clause is already added, you can extend this
group to include all elements not de ned using aggregate functions
and not yet part of the GROUP BY clause. The latter elements,
when included, are also added to the existing GROUP BY clause.

Alias is missing Adds an alternative name (alias) for each aggregate function that is
used as an element in the SELECT list.

To execute a quick x ...


You can trigger quick xes in any of the following ways:

1. From the Problems view:

a. Click on the error to open the context menu.

b. Choose Quick Fix.

c. In the list of possible quick xes, double-click the relevant quick x function.

2. From the ruler bar in the DDL editor:

a. Click the error decorator in the ruler bar.

b. In the list of possible quick xes, double-click the relevant quick x function.

Adding annotation for missing CDS database view name

3. From the Quick Assist view:

a. In the DDL editor, position the cursor where the error occurs and is highlighted.

b. In the Proposals tree, double-click the relevant quick x function.

Adding and Removing Comments


Within DDL source code, double slashes (//) introduce a comment that continues until the end of the line.

You can also use the following shortcuts for comments in the DDL editor:

Shortcut Menu Entry Description

Ctrl + < Add Comment The editor inserts a double slash (//) at the
beginning of each selected line.

This is custom documentation. For more information, please visit the SAP Help Portal 50
2/19/2023

Shortcut Menu Entry Description

Ctrl + > Remove Comment The editor removes an existing double


slash (//) at the beginning of each selected
line.

Ctrl + 7 Toggle Comment The editor inserts or removes a double


slash asterisk (//) at the beginning of each
selected line.

 Note
Alternatively, you can access the comments functions using the context menu entries of the DDL source editor ( Source
Add Comment... )

Hiding CDS Annotations and Comments


In the source code of a CDS object (such as data de nitions, metadata extensions, and access controls), you can hide CDS
annotations and comments to improve readability to get a better visual overview of your coding.

Context
You want to get a clear overview, for example, of the elds in a define view statement from which you can select data.

To do this, proceed as follows:

Procedure
1. Open the context menu from the ruler in the DDL source editor.

2. Choose Hide Annotations (Ctrl+Alt+F6) to mask CDS annotations or Hide Comments (Ctrl+Alt+F7) to mask comments
from the source code.

Results
The rows with the comments and annotations disappear from the DDL editor but the row numbering remains as before
execution.

Note that the content is not deleted and still available for your CDS object. To display hidden content again, choose the relevant
entry that is highlighted with a tick in the same context menu.

 Note
In addition, you can also use the following functionalities to gain a better overview and improve readability of your source
code:

Position the cursor on the entity name and press F2 in order to open the ABAP Element Info view.

Extract the relevant annotations from the select list elements to a metadata extension in order to relocate
them.

Related Information

This is custom documentation. For more information, please visit the SAP Help Portal 51
2/19/2023
Using Code Folding
Extracting CDS Annotations to a Metadata Extension

Changing Colors of DDL and DCL Source Code


The source code editor displays the DDL and DCL source code and annotation types with prede ned colors. However, you can
change these default settings to adapt them to your personal needs.

Context
You can de ne the color for displaying the keywords, identi ers, annotation, or further code elements in DDL and DCL source
code.

Procedure
1. Open the General Appearance Colors and Fonts preference page.

2. Expand the CDS folder.

3. Select the text type you want to change and click the Edit... button.

4. Select the color and con rm with OK.

 Remember
To restore the default color settings, click the Restore Defaults button.

Results
The new color settings become immediately effective in the corresponding editor.

Comparing DDL Source Code Versions


The following options are available for comparing DDL source code:

Comparing local changes using the local change history

Comparing changes from one transported version to another

Comparing changes across the ABAP systems.

For details, see also: Comparing Source Code

Formatting DDL
You format DDL source code (such as a CDS statement, including the element list, Boolean expressions, JOINs, association
de nitions, and so on) to structure the code and to improve its readability.

 In the context of editing DDL source code, the following use cases are supported:

1. Using the SAP standard pro le: You want to use the standard pro le prede ned by SAP. This pro le is provided by
default and can be used immediately.

 Note

This is custom documentation. For more information, please visit the SAP Help Portal 52
2/19/2023
The SAP standard pro le is persisted in the back end. This ensures that the formatting result is always consistent –
independently of the installed ADT client version.

2. Creating your own pro le: If the SAP standard pro le does not meet your needs, you can create and use your own
pro le. In addition, you can import or export a pro le to reuse/share it from/with other ADT developers.

 Note
The local con guration is persisted in the Eclipse-based IDE workspace.

3. Overruling the SAP standard pro le for your team or company: If a team decides to use its own pro le, they can export a
pro le and make it available for all data de nitions of an ABAP package.

 Note
A team pro le is persisted in the back end. It does not need to be enabled. On the basis of the ABAP package, the
DDL formatter detects whether the SAP standard pro le or the team pro le is to be used.

The DDL formatting settings are con gured in the ABAP Development preferences.

Example of the first Preferences page for configuring the DDL formatter

Starting from the ABAP Development Editors Source Code Editors DDL Formatter Preferences page, you have the
following general options:

DDL formatting is not automatically executed by default. To perform this, select the Format DDL on save checkbox in
advance.

DDL formatting is con gured through pro les. Thus, you can:

Select the pro le you want to work with on your local IDE.

Create your own pro le(s), Edit it (them) at a later point in time, and Remove it (them).

Work with SAP 's standard pro le where the settings of the DDL formatter are already pre-con gured.

Import/Export the pro le as an XML le from/to another local IDE.

Overrule the SAP standard pro le at package level.

You can Restore Defaults to cancel your changes and revert to the default provided by SAP.

This is custom documentation. For more information, please visit the SAP Help Portal 53
2/19/2023
To execute the DDL formatter, use the context menu Source Code Format or the Shift + F1 shortcut at every position.
If you have selected the Format DDL on save checkbox on the DDL Formatter preferences page, formatting is automatically
performed when you save your changes.

Related Information
Creating a Pro le
Editing Pro les
Importing Local Pro les
Exporting Local Pro les

Creating a Pro le
You can create a pro le to con gure your own client-speci c formatting of data de nitions or to provide your pro le to a team of
ABAP developers using ADT.

Procedure
1. Open the ABAP Development Editors Source Code Editors DDL Formatter preference page.

The DDL Formatter preferences page is opened.

2. In the Active pro le section, choose the New... button.

The New Pro le dialog is opened.

3. Enter the Name of the pro le to be created.

4. [Optional:] To reuse the con guration of another pro le, select the relevant one from the Initialize settings with the
following pro le: dropdown listbox.

5. [Optional:] To con gure your pro le at a later point of time, deselect the Open the edit dialog now checkbox.

6. Choose OK to continue.

The Pro le page is opened. The following tabs are provided for con guring the data de nition formatting for:

Indentation: add a prede ned number of spaces at the beginning of a statement, clause, or expression

Boolean Expressions: add line breaks and spaces before/after the AND / OR keywords

Entity Name: add line breaks and spaces before/after entity names

Data Source: add line breaks and spaces before/after data sources

Joins: de ne the alignment, line breaks, and spaces before/after joins

Element List: add line breaks and spaces before/after element lists in general

Element List Entries: add spaces before/after element lists entries in general

Association De nitions: align association de nitions

WHERE and HAVING Clause: align occurrences of WHERE / HAVING keywords

In these tabs, you can de ne the following settings:

Name Values Description Source Code Example Before Execution (Default)

This is custom documentation. For more information, please visit the SAP Help Portal 54
2/19/2023

Name Values Description Source Code Example Before Execution (Default)

Alignment To handle the Alignment = Same line


Same line
alignment
Separate at/before/after a ...
line speci c define view sample_define_view
occurrence – for with parameters
Break example, an entity p_carrid: s_carrid
after AND name ...
/ OR

Break
before
AND / OR

Align in To align keywords Alignment in columns = Enabled


Enabled
columns or identi ers in
Disabled the same column ...
over several rows define view
sample_define_view
with parameters
p_carrid: s_carrid
as select from scarr as carriers
left outer join spfli on spfli.carrid =
and spfli.fltype <>
...

Delimiter To add a line Delimiter positions = Comma/semicolon at the end


Comma /
positions break before or
Semicolon
after the ...
at the end
occurrence of a {
Comma / comma/semicolon key carriers.carrname as carrname,
Semicolon @EndUserText.label: 'Flight No.'
at the @EndUserText.quickInfo: 'Flight No.'
beginning key spfli.connid as fid,
@EndUserText.label: 'Date'
sflight.fldate as fldate,
@EndUserText.label: 'From'
apfrom.name as airpfrom
}
...

Existing To keep or remove Existing blank lines = Leave as is


Leave as
blank lines empty rows
is
@AbapCatalog.sqlViewName: 'S_SAMPLE_1'
Remove @AbapCatalog.compiler.compareFilter: true
@AccessControl.authorizationCheck: #NOT_REQUIRED
@EndUserText.label: 'Sample: Define View Statement'

define view sample_define_view


...

This is custom documentation. For more information, please visit the SAP Help Portal 55
2/19/2023

Name Values Description Source Code Example Before Execution (Default)

Indentation To add the Indentation = Indent


Indent
prede ned
Indent number of spaces ...
based on at the beginning of define view
join the next line – for sample_define_view
hierarchy example, after an with parameters
entity name p_carrid: s_carrid
None as select from scarr as carriers
left outer join spfli on spfli.carrid
and spfli.fltype
...

Indentation Input eld To prede ne the Indentation spaces = 2


size number of spaces
that should be ...
added when define view sample_define_view
starting the with parameters
subsequent p_carrid: s_carrid
line/block as select from scarr as carriers
left outer join spfli on spfli.carrid
and spfli.fltype
...

 Note
Some of the settings might depend on each other. To make them available, you will need to adjust another setting in
advance.

7. [Optional:] A preview enables you to check the effect of your current setting in your source code. Select the relevant
setting to get an impact of its consequence in the source code.

You can see the current formatting and the result of your currently selected formatting.

8. Choose OK to save your con guration.

9. Choose Apply and OK to make your pro le available.

Results
The con gured pro le can now be used in the data de nition source editor.

 Note
If the data de nition source code is not formatted as de ned, check if the relevant pro le is selected on the DDL Formatter
preference page.

Related Information
Editing Pro les

Editing Pro les


You can edit pro les to update a con guration used by the DDL formatter.

This is custom documentation. For more information, please visit the SAP Help Portal 56
2/19/2023

Prerequisites
You have created or imported a pro le.

Procedure
1. Open the ABAP Development Editors Source Code Editors DDL Formatter preference page.

The DDL Formatter preference page is opened.

2. In the Active pro le section, select the relevant pro le from the dropdown listbox of .

3. Choose the relevant Edit... button in the same section.

If your IDE contains several ABAP projects, the Project Selection dialog is opened. Choose the relevant project.

The Pro le page is opened.

4. In the corresponding tab(s), edit the relevant settings.

 Note
For further information about the displayed settings, see the Related Information section below.

5. Choose OK to add your changes.

6. Choose Apply and then press OK to complete your changes.

Results
Your changes are saved and will be considered the next time the DDL formatter is executed.

Related Information
Creating a Pro le

Importing Local Pro les


You can import another pro le for the purpose of reusing a DDL formatting.

Prerequisites
To import another pro le, you need the corresponding XML le available on the le system.

Procedure
1. Open the ABAP Development Editors Source Code Editors DDL Formatter preference page.

The DDL Formatter preference page is opened.

2. In the Active pro le area, choose the Import... button.

The Open dialog is opened.

3. Select the relevant le location and le.

4. Choose Open.

5. To start importing, choose OK.

This is custom documentation. For more information, please visit the SAP Help Portal 57
2/19/2023

Results
After the import has nished, the imported pro le will be available in the dropdown listbox and automatically selected in the
Active pro le section of the DDL Formatter preference page.

The DDL Formatter preference page is closed.

Related Information
Exporting Local Pro les

Exporting Local Pro les


You can export your pro le to provide this DDL formatting to other ADT developers.

Procedure
1. Open the ABAP Development Editors Source Code Editors DDL Formatter preference page.

The DDL Formatter preference page is opened.

2. In the Active pro le area, choose the Export... button.

The Save as dialog is opened.

3. Select the relevant le location and enter the le name.

When you save the pro le, the XML le name is proposed in accordance with the pro le name to be exported.

4. Choose Save.

5. To start exporting, choose OK.

Results
The XML le is created and saved in the selected le location.

The DDL Formatter preference page is closed.

If you want to overrule the SAP standard pro le at package level with your exported pro le, you can copy its XML content to the
BAdI implementation class.

Related Information
Importing Local Pro les

Checking Syntax of DDL Source Code

Context
With the editor check function, you can check whether the source code of DDL source code is syntactically correct or not.

To enable the check function, there are two options available:

Automatic syntax check: This option is enabled by default for all source code based editors.
This is custom documentation. For more information, please visit the SAP Help Portal 58
2/19/2023

 Note
If you wish to disable the automatic syntax check, you have to switch off the corresponding setting in the preferences:
ABAP Development Editors Source Code Editors Automatic syntax check .

Explicit syntax check: You can use this option whenever the automatic syntax check is disabled.

To trigger an explicit syntax check, proceed as follows:

Procedure
1. Open the editor with the relevant DDL source code.

2. Click the icon (Check ABAP Development Object) in the toolbar. Alternatively, you can use the keyboard shortcut
Ctrl + F2 .

Results
If errors occur during the check, these will be issued to the Problems view and displayed there as ABAP Syntax Check Problem.
In addition, the code line with the error is labeled with a decorator in the DDL source editor.

Displaying syntax error in the DDL source

 Tip
The DDL editor offers corrections to some problems found. In case of missing annotation, for example, you can take
advantage from the quick x for that speci c error item.

This is custom documentation. For more information, please visit the SAP Help Portal 59
2/19/2023

Accessing quick fix in the Problems view using the context menu of the error item

Related Information
Activating Data De nitions
Previewing Data Records

Creating CDS Simple Types


A simple type (in short: type) allows you to de ne a custom-de ned type wherever a build-in type can be used in a data model or
to derive one or more new types in turn.

Prerequisites

Context
You want to create a new custom-de ned type that can be used within your data model, for example for elements.

Procedure
1. In your ABAP project, select the relevant package node in the Project Explorer.

2. Open the context menu and choose New Other... Core Data Services Type .

3. In addition to the Project and Package, enter the Name and the Description for the type to be created.

4. Choose Next.

5. Assign a transport request.

6. Choose Finish.

Results
In the selected package, the ABAP back-end system creates an inactive version of the type and stores it in the ABAP Repository.

This is custom documentation. For more information, please visit the SAP Help Portal 60
2/19/2023
In the Project Explorer, the new type is added to the Core Data Services folder of the corresponding package node. As a result
of this creation procedure, the source editor is opened. Here, you can start de ning a type by using the define type
statement and assign a name, data types, and annotations.

The type is de ned at activation. You can then use the simple type in CDS view entities.

Related Information
Simple Types
 ABAP CDS - Simple Types (ABAP Keyword Documentation)

Extending Data Models


You want to extend an existing data model with customer-speci c data in order to retrieve additional data without creating
redundant development objects or modi cations.

In general, you can extend the structure and the metadata of CDS views as follows:

Extending the Structure of Data Models to add additional element(s) to the CDS view from its used data sources.

Extending the Metadata of Data Models to add or overwrite the CDS annotations of a CDS entity in a separate
development object.

Related Information
Extending CDS Entities

Extending the Structure of Data Models


You can add further element(s) to the select list of a CDS view to extend its structure. This is achieved without modi cations.

After activation, the additional element(s) will be available for the extended CDS view each time it is used.

You have the following possibilities to add and display structural extensions:

Creating CDS View Extensions

Displaying and Navigating to CDS View Extensions

Related Information
CDS Views Extension

Creating CDS View Extensions


An CDS view extension allows you to extend the structure of an existing CDS view that is provided, for example, in the SAP
standard. This extension will then not cause any modi cations.

Prerequisites
You need the standard developer authorization pro le to create ABAP development objects.
This is custom documentation. For more information, please visit the SAP Help Portal 61
2/19/2023

Context
You want to add new elements, for example, to a CDS view of the SAP standard. Your changes need to be stable when
upgrading your ABAP system.

 Note
In the source code, you can use the standard functions, such as transport, syntax check, code completion, and activation.

Procedure
1. In your ABAP project, select the relevant package node in the Project Explorer.

2. Open the context menu and choose New Other... Core Data Services Data De nition to launch the creation
wizard.

3. In addition to the Project and Package, enter the Name and the Description for the data de nition to be created.

 Note
You cannot specify the same name as the data de nition of the CDS view you want to extend.

4. Choose Next.

5. Assign a transport request.

6. Choose Next.

7. [Optional:] Select the Extend View code template to be inserted in the created DDL source code.

8. Choose Finish.

Results
In the selected package, the ABAP back-end system creates an inactive version of a data de nition and stores it in the ABAP
Repository.

In the Project Explorer, the new data de nition is added to the Core Data Services folder of the corresponding package node.
As a result of this creation procedure, the source editor will be opened. Here, you can start to enter the name of the CDS entity
to be extended and the element(s) that is to be added.

In the extended data de nition, the indicator is added to the define view statement. It indicates that an extension exists
for this development object. You can navigate to the extend view by hovering over the indicator and following the link provided in
the extension popup.

When activating the data de nition that represents the extend view,

An append view is created in the ABAP Dictionary.

The extended element(s) is added to the existing CDS view.

Related Information
CDS Views Extension
Viewing Generated SQL Statements

Displaying and Navigating to CDS View Extensions


This is custom documentation. For more information, please visit the SAP Help Portal 62
2/19/2023
A CDS view extension provides additional elds, elements, or CDS annotations for a CDS view.

Context
A CDS view extension is an extend view or a metadata extension.

You want to investigate possible client handling properties and/or to open the CDS view extension(s) of a CDS view.

Procedure
1. In the vertical ruler of the DDL source editor, select the marker.

 Note
This marker indicates for each CDS view that a CDS view extension is assigned to the data de nition.

 It enables you to navigate to the extend view directly.

An Extension popup will be opened.

Example of an extension popup

Form here you will get the following information:

Name of the CDS entity

Content provided from the @EndUserText.label annotation

Object link that refers to the extension of the relevant CDS view

2. To navigate to the CDS view extension that exist in the system, choose the underlined object name from the Extended
with section in the Element Information popup.

Results
The CDS view extension is opened.

Extending the Metadata of Data Models


You can add customer-speci c metadata to a CDS entity of the SAP standard that does not result in modi cations. To do this,
you provide additional CDS annotations.

You have the following possibilities to create and work with metadata extensions:

Creating Metadata Extensions to handle customer-speci c metadata in a separate development object

Extracting CDS Annotations to a Metadata Extension to create a new metadata extension on the basis of a selection of
CDS annotations from an existing CDS view
This is custom documentation. For more information, please visit the SAP Help Portal 63
2/19/2023

Related Information
Metadata Extensions

Creating Metadata Extensions


A metadata extension allows you to extend a CDS entity with your own CDS annotations or to modify existing CDS annotations.

Prerequisites
You need the standard developer authorization pro le to create ABAP development objects.

Context
You want to provide additional metadata using CDS annotations to a CDS entity.

Procedure
1. In your ABAP project, select the relevant package node in the Project Explorer.

2. Open the context menu and choose New Other ABAP Repository Object Core Data Services Metadata Extension
to launch the creation wizard.

3. In addition to the Project and Package, enter the Name and the Description for the metadata extension to be created.

4. [Optional:] If you want to create a metadata extension for a speci c CDS entity, enter the relevant entity name as the
Extended Entity.

 Note
You can only extend CDS entities.

5. Choose Next.

6. Assign a transport request.

7. Choose Next.

8. [Optional:] If requested, select a template.

By default, ABAP Development Tools considers the template for creation that you have selected at the last time.

9. Choose Finish.

Results
In the selected package, the ABAP back-end system creates an inactive version of a metadata extension and stores it in the
ABAP Repository.

In the Project Explorer, the new metadata extension is added to the Core Data Services folder of the corresponding package
node. As a result of this creation procedure, the source editor will be opened. Here, you can start de ning a metadata
extension.

After developing and checking your new object, you can activate it.

Related Information
Activating Development Objects

This is custom documentation. For more information, please visit the SAP Help Portal 64
2/19/2023

Extracting CDS Annotations to a Metadata Extension


You can create a metadata extension object that contains the annotations of a speci c data de nition.

Prerequisites
You need the standard developer authorization pro le to create ABAP development objects.

Context
You want to relocate the annotations of a data de nition to a new metadata extension to be created.

 Note
The annotations are removed from the data de nition after extraction.

You can only extract those annotations that are allowed for usage in metadata extensions.

Procedure
1. Open the source editor for the relevant data de nition.

2. Open the context menu in the source editor and choose Source Code Extract Metadata Extension to launch the
Extract Metadata Extension wizard.

The Extract Metadata Extension

Wizard page for defining a new metadata extension to be created

3. In addition to the Project and wizard is opened.Package, enter the Name and the Description wizard for the metadata
extension to be created.

 Note
The maximum length for names of metadata extensions is 30 characters.

This is custom documentation. For more information, please visit the SAP Help Portal 65
2/19/2023
4. Choose Next.

The second page of the creation wizard is opened.

Wizard page for defining the annotations to be extracted to the new metadata extension

The annotations of the data de nition that can be extracted to the new metdata extension are listed here.

5. Select the annotation(s) to be relocated from the data de nition.

 Note
Annotation values of type array must be set in square brackets in metadata de nitions. If the array values in your
data de nition are not set in square brackets, you can use the Insert missing square brackets for annotation values
of type array checkbox to automatically insert the brackets when the annotation is extracted.

6. Choose Next.

The Selection of Transport Request page is opened.

7. Assign a transport request.

8. Choose Finish.

Results
The ABAP back-end system creates an inactive version of a metadata extension and stores it in the ABAP Repository.

In the Project Explorer, the new metadata extension is added to the Core Data Services folder of the corresponding package
node. The source editor of the metadata extension is opened and the extracted annotations are added. Therefore, the source
code of the metadata extension becomes dirty.

The editor of the data de nition also becomes dirty. Here, the annotations are deleted from its source code.

Consequently, you must save and activate both development objects to apply the changes.

Related Information
This is custom documentation. For more information, please visit the SAP Help Portal 66
2/19/2023
Annotation Propagation View
Creating Development Objects
Annotation Propagation

Analyzing Dependencies in Complex CDS Views


The Dependency Analyzer provides several possibilities to evaluate the relationships and complexity from a CDS entity with
regards to its SQL de nition.

Prerequisites
The SQL dependency can only be calculated for the active version of a data de nition.

Context
You want to display SQL dependencies of a CDS view. You can also use it to identify, for example, performance issues.

Procedure
1. In the Project Explorer, select the data de nition that you want to analyze.

2. Open the context menu and choose Open with Dependency Analyzer .

 Tip
Alternatively, you can open the same context menu from the DDL source editor of the relevant CDS entity.

The dependencies of data sources involved in the CDS view are calculated. The SQL Dependency Tree tab is opened by
default and displays the result in a tree structure.

3. To display the relevant information from the SQL Dependency Tree tab, proceed as follows:

To get this data for the CDS view: Open the Complexity Metrics subtab. The aggregated statistics are listed
there.

To get this data for a speci c data source: Select the relevant SQL Name entry and choose Show Metrics
Complexity from the context menu. The Properties view is opened where the aggregated statistics are then
displayed.

To visualize this data for the CDS view, open the SQL Dependency Graph tab.

Results
Based on the relevant information, you can now, continue your work and improve your data model.

Related Information
Dependency Analyzer

Analyzing Annotation Propagations


You use the Annotation Propagation view to understand how the metadata was merged for a CDS View.

Prerequisites
This is custom documentation. For more information, please visit the SAP Help Portal 67
2/19/2023
The CDS View is active.

Context
You want to reproduce how the value for an element annotation was derived.

Procedure
1. In the Project Explorer, select the data de nition you want to analyze.

2. Open the context menu and choose Open With Annotation Propagation .

 Tip
Alternatively, you can open the same context menu from the DDL editor of a data de nition.

The Annotation Propagation view is opened and displays by default the values that are propagated for the view
annotations.

 Note
If you have placed the cursor on an annotation or an element in the DDL editor, then this element or annotation will
be pre-selected and value propagations for this selection will be displayed.

3. In the <Selection> section, enter the details of the element annotation you want to investigate.

a. In the <Annotations For *> input eld, enter the name of the element.

b. In the <Annotation Filter> input eld, enter the name of the annotation.

 Tip
Use the content assist (shortcut Ctrl + Space ) in the input elds to get proposals for the names. Alternatively,
you can choose the <Browse ...> button and search for names.

4. To display the value propagation for the selected element annotation, choose the <Apply> button.

Results
All objects which assign a value to the element annotation are listed in the <Value Propagation> section. The objects are listed
in the order of precedence. The active value of the annotation is highlighted together with information about the contributing
object.

Related Information
Annotation Propagation View

Displaying Annotation Values of an Active CDS View


In the Active annotations view, you can display the following content for an active data de nition: Which elements/parameters
have been annotated, their current value, and their origin.

Prerequisites
The data de nition you are currently editing has already been activated.

This is custom documentation. For more information, please visit the SAP Help Portal 68
2/19/2023

Context
You want to nd out which annotation values (including the propagated ones) does a CDS view contain and where the individual
annotation values are originated from.

You can open the Active annotations view from the Project Explorer as follows:

Procedure
1. In the Core Data Services ABAP repository tree, open the context menu from the relevant data de nition.

2. Choose Open with Active Annotations .

 Note
Alternatively, you can open the same context menu from the DDL editor of a CDS view.

Results
The Active Annotations view is opened in the structured mode. It displays all the CDS annotations that are de ned in the CDS
view itself or are inherited from the underlying data sources or data elements.

If the values are inherited from underlying data sources or data elements, you can navigate to these development objects.

Related Information
Active Annotations View

Previewing Data Records


Data Preview provides a test environment that enables you to verify the output (result set) of a CDS view.

Procedure
In the Project Explorer view, open the context menu of a data de nition and choose Open Data Preview.

 Note
In addition, you can also open the Data Preview view from the source code editor of a data de nition. Then choose Open
With Data Preview from the context menu.

Results
The following possibilities might occur:

1. If the CDS View does not require any parameters, the Data Preview displays the result set directly.

2. If the CDS View requires parameters, a dialog to enter parameter values appears:

This is custom documentation. For more information, please visit the SAP Help Portal 69
2/19/2023

a. Enter your parameter values.

b. Choose OK.

The Data Preview displays the result set.

The Outline view displays parameter values of a CDS View. If you want to modify parameter values, choose the
Parameter option that appears in the Data Preview tool.

 Note
If the result set contains less records than you expect, there may be a access control role for the CDS entity that lters the
data returned by the preview.

Related Information
Activating Data De nitions

Following Associations in the CDS Data Preview


In CDS, an association represents the relationship between a CDS entity and a data source.

Context
In the CDS Data Preview, you follow associations to identify related data sources and display their contents.

Procedure
1. In the Project Explorer view, open the context menu of a data de nition and choose Open Data Preview.

 Note
In addition, you can also open the Data Preview view from the source code editor of a data de nition. Then choose
Open With Data Preview from the context menu.

This is custom documentation. For more information, please visit the SAP Help Portal 70
2/19/2023

 Note
If the selected CDS view requires parameters, a wizard for providing parameter values appears.

The Data Preview tool appears and displays the top 100 records by default.

2. In the table context menu, choose Follow Association.

 Note
You can also choose > in the breadcrumb bar to follow an association.

The selected row/column is not relevant.

Associations de ned for the CDS view are listed.

3. Choose an association.

Results
The Data Preview displays the result set for the selected association. You can apply lters to the current result set or use the
breadcrumb to navigate to the previous result set. Any lters applied to the result sets are retained.

You can repeatedly follow associations through navigating into the hierarchy de ned by the associations.

This is custom documentation. For more information, please visit the SAP Help Portal 71
2/19/2023
You can use the Console option on the Data Preview menu to display the generated Open query for an association. The
generated query uses the CDS database view to display records.

Previewing Analytical Queries


You can preview the data of analytical queries with the Custom Analytical Queries (F1572) app.

Prerequisites
You have added ABAP packages required for your work in the favorite list. For information, see Adding a Favorite
Package.

You have created a CDS-based analytical query.

Procedure
1. In the Project Explorer view, choose the ABAP project.

2. Choose the ABAP package.

3. Once the data de nition is annotated with the @Analytical.query: true annotation, you can open the app by
right-clicking on data de nition listed in Package Explorer, Open With Data Preview .

4. You can also open the app by right-clicking on the data de nition editor and choose Open With Data Preview , or by
pressing F8 in the data de nition editor.

Results
The Preview Analytical Queries app opens in your browser.

Preview Analytical Queries app

Working with Behavior De nitions


Based on the existing CDS data model, you can create and edit behavior de nitions to de ne the behavior of business objects in
the ABAP RESTful programming model. To implement the behavior, create a behavior implementation class.

This is custom documentation. For more information, please visit the SAP Help Portal 72
2/19/2023

Related Information
Creating Behavior De nitions
Editor Features
Creating Behavior Implementations
Business Object
Documenting Behavior De nitions

Creating Behavior De nitions

Context
To de ne the behavior of business objects in the ABAP RESTful programming model, create a behavior de nition as the
corresponding ABAP repository object. You create a behavior de nition as follows:

Procedure
1. In the Project Explorer, select the relevant node for the data de nition that contains the CDS root entity for which you
want to create a behavior de nition.

2. Open the context menu and select New Behavior De nition to launch the creation wizard.

3. The Project and Package are inserted automatically. You can change them if needed.

 Note
The Name of the behavior de nition is the same as the name of its root entity. It is automatically inserted and cannot
be modi ed.

4. Enter a Description for the behavior de nition.

5. The Root Entity that you selected in Project Explorer is automatically inserted.

 Note
If you triggered the New Behavior De nition wizard not from the referenced CDS view, the Root Entity is not lled in
automatically. In this case, select the Root Entity manually by using the Browse button.

This is custom documentation. For more information, please visit the SAP Help Portal 73
2/19/2023

Creation wizard

6. From the drop-down list of the Implementation Type eld, select Managed or Unmanaged implementation type.

 Note
If you create a Behavior De nition from a projection root entity, select Projection or Interface as implementation
type. For more information on the different implementation types, see CDS BDL - implementation type (ABAP -
Keyword Documentation).

7. Select Next.

8. Assign a transport request.

9. Select Finish.

Results
The created behavior de nition object represents the root node of a new business object in ABAP RESTful programming model.

In the Project Explorer, the new behavior de nition is added to the Core Data Services folder.

In the editor, a new behavior de nition is created with a basic structure. You can now start editing or re ning the behavior
de nition using prede ned CDS BDL - entity behavior de nition (ABAP - Keyword Documentation).

Related Information
Editor Features

This is custom documentation. For more information, please visit the SAP Help Portal 74
2/19/2023
Creating Behavior Implementations
Business Object

Editor Features
You can de ne and edit the behavior of the business object in the created behavior de nition.

The following table gives you an overview of the supported features.

Availability of features

Feature Types Features Key Shortcuts Availability

Activation Ctrl + F3

Deleting
Standard

Duplicating

Editing

Search
Where-Used Search Ctrl + Shift + G

Source Search Ctrl + H

Convenience
Formatting Shift + F1

Navigation F3

Outline

Quick Outline Ctrl + O

Quick Assists Ctrl + 1

Code Completion Ctrl + Space

Syntax Highlighting

Automatic Syntax Check

Element Information F2

Others
Comparing Source Code

Version History

Share Link

This is custom documentation. For more information, please visit the SAP Help Portal 75
2/19/2023

Related Information
Working with Behavior De nitions
Creating Behavior De nitions
Creating Behavior Implementations

Creating Behavior Implementations

Prerequisites
You created a behavior de nition object. The object is activated.

Context
To implement the behavior of business objects de ned in the behavior de nition, create a behavior implementation class.

Procedure
1. In the behavior de nition, after implementation in class, write the name of the behavior implementation class
that you want to create.

2. Trigger the quick x and select the proposal to create an implementation class.

3. The creation wizard is opened. The Package and Description are automatically inserted. If needed you can change them.

Creation wizard for a behavior implementation class

4. Select Next.

This is custom documentation. For more information, please visit the SAP Help Portal 76
2/19/2023
5. Assign a transport request.

6. Select Finish.

Results
The behavior implementation class is created. In Project Explorer, the new behavior implementation is added to the
corresponding folder.

The Local Types tab is automatically opened. In the tab, local lcl_handler and lcl_saver classes are created.

Related Information
Working with Behavior De nitions
Creating Behavior De nitions
Editor Features
Business Object

Quick Fixes For Creating Behavior Implementations


In case of missing implementation classes or missing methods, corresponding warnings are displayed in the Behavior De nition
Editor and in the Problems View. You can apply Quick Fixes to generate the entire implementation class or missing methods.

Quick Fix to Generate the Implementation Class

This is custom documentation. For more information, please visit the SAP Help Portal 77
2/19/2023

Quick Fixes to Generate Missing Methods

To trigger the Quick Fix proposals, you can:

Click the lightbulb icon in the marker bar.

Choose Ctrl + 1 on the underlined source code position.

Use context menu in the Problems View.

Documenting Behavior De nitions


You can document behavior de nitions as follows:

1. From the Project Explorer, select the behavior de nition you want to document. Use the context menu to create a
knowledge transfer document.

The created document is opened in the Knowledge Transfer Document Editor.

2. The behavior de nition is displayed with its elements, such as actions, functions, associations, and standard operations,
structured as a tree in the Object Structure section. In the Documentation section, you can document the object and
each element.

This is custom documentation. For more information, please visit the SAP Help Portal 78
2/19/2023

Knowledge Transfer Document Editor

Related Information
Knowledge Transfer Documents

Working with Business Services


In the context of the ABAP RESTful programming model, a business service is a RESTful service which can be called by a
consumer. It is de ned by exposing its data model together with the associated behavior.

A business service consists of a service de nition and a service binding.

 Note
The subsequent help content is provided in the context of ABAP CDS development. To get more information in the context of
ABAP core development, see Working with Business Services

Related Information
Creating Service De nitions
Creating Service Binding

Creating Service De nitions


A service de nition provides the CDS entities that are part of the data model to be exposed as a business service.

Prerequisites
You need the standard developer authorization pro le to create ABAP development objects.

This is custom documentation. For more information, please visit the SAP Help Portal 79
2/19/2023

Context
You want to de ne the data to be exposed as a business service by one or more service bindings.

 Note
To add CDS entities to an existing service de nition without modifying the service de nition itself, create a service de nition
extension. For more information, see Creating a Service De nition Extension.

Procedure
1. In your ABAP project, select the relevant package node in the Project Explorer.

2. Open the context menu and choose New Other ABAP Repository Object Business Services Service De nition
to launch the creation wizard.

3. In addition to the Project and Package, enter the Name and the Description for the service de nition to be created.

4. [Optional:] If you want to create a service de nition that exposes another CDS entity, ...

 Note
You can only expose another CDS entity.

a. choose De nition from the Type drop-down listbox and

a. enter the relevant entity name as Referenced Object.

5. Choose Next.

6. Assign a transport request.

7. Choose Next.

8. Choose a template which you want to base your service de nition.

9. Choose Finish.

Results
In the selected package, the ABAP back-end system creates an inactive version of a service de nition and stores it in the ABAP
Repository.

In the Project Explorer, the new service de nition is added to the Business Services folder of the corresponding package node.
As a result of this creation procedure, the source editor will be opened. Here, you can start enter the CDS entities to be
exposed as a business service.

Related Information
Service De nition

Creating a Service De nition Extension


A service de nition extension enables you to add CDS entities to an existing service de nition without modifying the service
de nition itself.

Prerequisites
You need the standard developer authorization pro le to create ABAP development objects.

This is custom documentation. For more information, please visit the SAP Help Portal 80
2/19/2023
You can only extend a service de nition if the @AbapCatalog.extensibility.extensible CDS annotation using the
value true is added.

 Note
Currently, service de nition extensions are only supported in the ABAP language version Standard ABAP and ABAP for
Cloud Development.

Context
You want to add, for example, your own CDS entity to an existing service de nition which is part of the SAP standard, but you do
not want to cause any modi cations on it. To do this, you want to create a service de nition extension that refers to this service
de nition.

 Note
You create a service de nition extension with the same creation wizard provided for service de nitions.

Procedure
1. In your ABAP project, select the relevant package node in the Project Explorer.

2. Navigate to the service de nition to be extended and choose New Other ABAP Repository Object Business
Services Service De nition to launch the creation wizard.

3. In addition to the Project and Package, enter the Name and the Description for the service de nition to be created.

4. To create a service de nition extension, ...

 Note
When creating a service de nition extension from the context menu of a service de nition in the Project Explorer, the
subsequent items and input elds will already be preselected and entered.

a. choose Extension from the Type drop-down listbox and

a. enter the name of the service de nition to be extended as Referenced Object.

5. Choose Next.

6. Assign a transport request.

7. Choose Next.

8. Choose the Extend Service template.

9. Choose Finish.

Results
In the selected package, the ABAP back-end system creates an inactive version of a service de nition and stores it in the ABAP
Repository.

In the Project Explorer, the new service de nition is added to the Business Services folder of the corresponding package node.
As a result of this creation procedure, the source editor will be opened. Here, you can start typing the CDS entities to be added
to the service de nition.

 Note
Once activated, the type of the service de nition cannot be changed anymore.

This is custom documentation. For more information, please visit the SAP Help Portal 81
2/19/2023
You cannot add CDS annotations to a service de nition extension nor extend CDS annotations of the referred service
de nition.

Related Information
Creating Service De nitions
Service De nition

Creating Service Binding


Using a service binding you can enable a service de nition to create a business service with a protocol of your choice.

Prerequisites
You need the standard developer authorization pro le to create ABAP development objects.

You have created the relevant Service De nition.

Context
You can use an existing service de nition to create a business service with an OData V2, OData V4, SQL, or InA protocol.

Procedure
1. In your ABAP project, select the relevant package node in the Project Explorer.

2. Open the context menu and choose New Other ABAP Repository Object Business Services Service Binding to
launch the creation wizard.

3. In addition to the Project and Package, enter the Name and the Description for the service binding to be created.

 Note
The maximum length for names of a service binding is 26 characters.

4. Select the Binding Type.

 Note
The binding types are OData V2, OData V4, SQL, and InA.

5. If not yet speci ed, search for the Service De nition that you want to use as a base for your service binding.

6. Choose Next.

This is custom documentation. For more information, please visit the SAP Help Portal 82
2/19/2023

Service Binding Wizard

7. Choose Next.

8. Assign a transport request.

9. Choose Finish.

 Restriction
CDS view with parameters that have simple types are not supported.

Related Information
Business Service
Service Binding

Service Binding Features


This is custom documentation. For more information, please visit the SAP Help Portal 83
2/19/2023
The following table gives you an overview of the supported features.

Availability of features

Features Availability

Version History

Version Compare

Related Information
Creating Service Binding

Using Service Binding Editor for OData V2 Service


You can expose a RAP business service as an ODataV2 service. Use the Service Binding editor to work with an OData V2 service.

After you create a service binding, the editor is displayed. The following actions can be done here:

Type Action

OData V2 (UI) The Service Versions section shows the service version and the associated service de nition.

You can add a new service version for an active service de nition by clicking Add.... Similarly,
choose Remove to remove a service version.

The Service Version Details section shows the local service endpoint and lists the entity sets. You
can click Service URL to view the service document. Select an entity set and click Preview to open a
preview of the SAP Fiori elements app in an external browser. Alternately, you can do this by right-
clicking an entity set and selecting Open Fiori Elements App Preview. You can also copy the
preview URL. For each entity set, the navigation shown represents the association with another entity
set.

In the service version, you can specify semantic versioning, by adding minor version and patch
version to the service version.

Use the Publish button to see the service details for each service version. After you've published
the service, you can choose Unpublish to revert to the unpublished state. The service information
doesn’t appear for a service that is unpublished.

 For each service version, an authorization value is generated. Choose Default Authorization
Values to open the Authorization Default Values editor. For maintaining default authorization values,
see SAP Cloud Platform - ABAP Development User Guide.

This is custom documentation. For more information, please visit the SAP Help Portal 84
2/19/2023

Type Action

OData V2 (Web API) The Service Versions section shows the service version, API state, and the associated service
de nition.

You can add a new service version for an active service de nition by clicking Add.... Similarly,
choose Remove to remove a service version.

You can change the API state for a service version using the context menu under API State and
selecting API State. For more information, see Released APIs.

The Service Version Details section shows the service information and lists the entity sets. For each
entity set, the navigation shown represents the association with another entity set.

In the service version, you can specify semantic versioning, by adding minor version and patch
version to the service version.

Use the Publish button to see the service details for each service version. After you've published
the service, you can choose Unpublish to revert to the unpublished state. The service details don’t
appear for a service that is unpublished.

 For each service version, an authorization value is generated. Choose Default Authorization
Values to open the Authorization Default Values editor. For maintaining default authorization values,
see SAP Cloud Platform - ABAP Development User Guide.

Test Class Generation You can generate automated tests for the OData service you've created using service binding. The test
provides guidance on how to access the OData service using ABAP Units and provides the test code for
performing CRUD operations on an entity set. Perform the following steps to generate a test class for a
selected entity set:
1. Choose Publish.

2. Select an entity set, right click and then, choose New ABAP Test Class.

3. Provide a name and description for the test class.

4. Choose Next and then, Finish.


A test class is generated in which local test classes for each CRUD operation in the selected entity set can
be viewed. You can either create a separate test class for each entity set or copy and paste the generated
code, then change the name of the entity set accordingly for writing ABAP Units for other entity sets.

In the selected package, the ABAP back-end system creates a service binding and an OData V2 service.

In the Project Explorer, the new service binding is added to the Business Services folder of the corresponding package node. As
a result of this creation procedure, the form editor is opened.

Service Binding Editor for OData V2 (UI)

This is custom documentation. For more information, please visit the SAP Help Portal 85
2/19/2023

Service Binding Editor for OData V2 (Web API)

Using Service Binding Editor for OData V4 Service


You can expose a RAP business service as an OData V4 service. Use the Service Binding editor to work with an OData V4
service.

After you create a service binding, the editor is displayed. The following actions can be done here:

Type Action

OData V4 (UI) The Services section displays multiple services and the service versions under each service. Every
service version is associated to a service de nition.

You can add a new service by clicking on Add Service... . When the service is added, a service
version is also automatically added. The service version points to the service de nition that you
provided in the Add Service dialog.

You can add a new service version for an active service de nition by right-clicking on a service or
version and choosing Add Service Version.... Choose Remove to remove a service or service
version. You can select the Service Version to view the service URL and the entity sets.

You can select service to view the Service Name. You can change the service name if the Local
Service Endpoint is unpublished. When you change the Service Name, you can see the change on
the Service URL for each service versions under that service. The change can be seen in the Service
URL (Preview) eld.

In the service version, you can specify semantic versioning, by adding minor version and patch
version to the service version.

You can choose a service version to view the service URL and entity sets with associations. You can
click Service URL to view the service document. Select an entity set and click Preview to open a
preview of the SAP Fiori elements app in an external browser. Alternately, you can do this by right-
clicking an entity set and selecting Open Fiori Elements App Preview. You can also copy the
preview URL. For each entity set, the navigation shown represents the association with another entity
set.

Choose the Publish button to see the service details for each service version. After you've published
the service, you can choose Unpublish to revert to the unpublished state. The service information
doesn’t appear for a service that is unpublished.

 The authorization value is generated. Choose Default Authorization Values to open the
Authorization Default Values editor. For maintaining default authorization values, see SAP BTP -
ABAP Development User Guide.

This is custom documentation. For more information, please visit the SAP Help Portal 86
2/19/2023

Type Action

OData V4 (Web API) The Services section displays multiple services and service versions under each service, API state,
and the associated service de nition.

You can add a new service by clicking on Add Service... . When the service is added, a service
version is also automatically added. The service version points to the service de nition that you
provided in the Add Service dialog.

You can add a new service version for an active service de nition by right-clicking on a service or
version and choosing Add Service Version.... Choose Remove to remove a service or service
version. You can select the Service Version to view the service URL and the entity sets.

In the service version, you can specify semantic versioning, by adding minor version and patch
version to the service version.

You can select service to view the Service Name. You can change the service name if the Local
Service Endpoint is unpublished. When you change the Service Name, you can see the change on
the Service URL for each service versions under that service. The change can be seen in the service
URL Preview eld.

You can choose a service version to view the service URL and entity sets with associations. You can
click Service URL to view the service document. For each entity set, the navigation shown represents
the association with another entity set.

You can change the API state for a service version using the context menu under API State and
selecting API State. For more information, see Released APIs.

Use the Publish button to see the service details for each service version. After you've published
the service, you can choose Unpublish to revert to the unpublished state. The service details do not
appear for a service that is unpublished.

 The authorization value is generated. Choose Default Authorization Values to open the
Authorization Default Values editor. For maintaining default authorization values, see SAP BTP -
ABAP Development User Guide.

Test Class Generation You can generate automated tests for the OData service you've created using service binding. The test
provides guidance on how to access the OData service using ABAP Units and provides the test code for
performing CRUD operations on an entity set. Perform the following steps to generate a test class for a
selected entity set:
1. Choose Publish.

2. Select an entity set, right click and then, choose New ABAP Test Class.

3. Provide a name and description for the test class.

4. Choose Next and then, Finish.


A test class is generated in which local test classes for each CRUD operation in the selected entity set can
be viewed. You can either create a separate test class for each entity set or copy and paste the generated
code, then change the name of the entity set accordingly for writing ABAP Units for other entity sets.

This is custom documentation. For more information, please visit the SAP Help Portal 87
2/19/2023

Service Binding Editor: OData V4-UI

Service Binding Editor: OData V4-Web API

Using Service Binding Editor for InA Service


You can expose CDS Analytical Queries via Information Access (InA) service. Use the service binding editor to work with
Information Access (InA) service.

After you create a service binding, the editor is displayed. The following actions can be done here:

Type Action

InA The Service section shows the service name and the associated service de nition.

The Service Details section shows the external service name for your query. The external service
name gets generated only after activating the service binding.

 Note

The query should not be exposed through other service bindings.

The service de nition should expose only one query.

This is custom documentation. For more information, please visit the SAP Help Portal 88
2/19/2023

Service Binding Editor- InA Service

Using Service Binding Editor for SQL Service


You can expose a RAP business service as an SQL service. Use the Service Binding editor to work with an SQL service.

Context
After you create a service binding, the editor is displayed. The following actions can be done here:

Type Action

SQL The Service section shows the service name and the associated service
de nition.

 Note
The service de nition should expose only view entities.

The service binding name also acts as the schema name for SQL service consumers. Therefore, mixed-case names are
supported in the creation of SQL service bindings.

Related Information
Accessing ABAP-Managed Data from External ODBC-Based Clients
Creating a Service De nition and an SQL-Typed Service Binding

Documenting Service Binding

This is custom documentation. For more information, please visit the SAP Help Portal 89
2/19/2023
You can document development objects in the Knowledge Transfer Document Editor.

Context
You can document service binding as follows:

Procedure
1. In the Project Explorer, select the service binding you want to document. Use the context menu to create a knowledge
transfer document. For more information, see Creating Knowledge Transfer Documents.

The created document opens in the Knowledge Transfer Document Editor.

The service binding is displayed with its elements, such as service name and service version, in a tree structure in the
Object Structure section.

2. In the Documentation section, you can document at the service and version level. For more information, see Editing
Knowledge Transfer Documents.

Tuning Access to SAP HANA


You want to improve the performance of your applications, for example, by reducing the response time when retrieving data
from datasources stored in database tables on SAP HANA.

You can use database tuning objects to optimize the consumption of resources and the performance when accessing data on
SAP HANA.

 Recommendation
Using database tuning objects requires memory space on the database. This space is not available for other database
operations. Therefore, SAP recommends pondering if the memory space that is required for the aggregation results is
smaller than the space that is required for the dynamic caches.

Related Information
Creating Dynamic Caches
Creating a CDS Entity Buffer
 ABAP CDS - Tuning Objects (ABAP Keyword Documentation)

This is custom documentation. For more information, please visit the SAP Help Portal 90
2/19/2023

Creating Dynamic Caches


A dynamic cache is a development object that supports the standard functionality (transport, syntax check, and activation).

Prerequisites

Context
You want to improve the performance of evaluating a data model by reusing the result of intense aggregations.

 Note
You can temporarily store the result of one or more aggregations (for example, sum, min, max, avg) in a dynamic cache. This
avoids repetitive calculations of frequently executed queries, and improves performance.

Procedure
1. In your ABAP project, select a package node in the Project Explorer.

2. To launch the creation wizard, open the context menu and choose New Other... ABAP Dictionary Dynamic
Cache .

3. In addition to the Project and Package, enter a Name and Description for the dynamic cache to be created.

 Note
The maximum length for names of dynamic caches is 30 characters.

4. Choose Next.

5. Assign a transport request.

6. Choose Next.

7. Select the Define Dynamic Cache template.

By default, ABAP Development Tools takes the last used template for creation.

8. Choose Finish.

Results
In the selected package, the ABAP back-end system creates an inactive version of a dynamic cache, and stores it in the ABAP
Repository.

In the Project Explorer, the new dynamic cache is added to the Dictionary folder of the corresponding package node.

As a result of this creation procedure, the source editor is opened. Here, you can start adding the database table, and de ne its
data to be cached.

 Note
 To view and manage the dynamic cache con gurations, you can use the Manage Database Cache Configuration
app.

Related Information
Dynamic Result Cache
This is custom documentation. For more information, please visit the SAP Help Portal 91
2/19/2023
 Manage Database Cache Con guration
 DDIC - Dynamic Caches (ABAP Keyword Documentation)

Creating a CDS Entity Buffer


A CDS entity buffer (in short, entity buffer) speci es the layer-speci c buffering type for table buffering on AS ABAP that caches
the data retrieved from a CDS view entity in the shared memory of the AS ABAP instance.

Prerequisites
The owner of the relevant CDS view entity, from which you want to buffer data, needs to specify that it is suitable for buffering.
To do this, he or she adds the @AbapCatalog.entityBuffer.definitionAllowed CDS annotation with the value true
to the de nition.

Context
You want to buffer data, retrieved by a CDS view entity, in order to minimize processing time of your data model.

Procedure
1. In your ABAP project, select the relevant package node in the Project Explorer.

2. Select the CDS view entity from which you want to buffer data.

3. Open the context menu and choose New Entity Buffer to launch the creation wizard.

4. In addition to the Project and Package, enter the Name and the Description for the entity buffer to be created.

5. [Optional:] Enter the name of the underlying CDS view entity in the Entity Buffer input eld or Browse for it.

 Note
When triggering creation from the CDS view entity in advance, this input eld will already be lled.

6. Choose Next.

7. Assign a transport request.

8. Choose Next.

The Templates page is opened.

 Note
By default, ABAP Development Tools (ADT) considers the De ne Entity Buffer template for creation.

9. Choose Finish.

Results
In the selected package, the ABAP back-end system creates an inactive version of an entity buffer and stores it in the ABAP
Repository.

In the Project Explorer, the new entity buffer is added to the Core Data Services folder of the corresponding package node. As a
result of this creation procedure, the source editor is opened. Here, you can start editing.

Related Information
This is custom documentation. For more information, please visit the SAP Help Portal 92
2/19/2023
 ABAP CDS - Table Buffering of CDS View Entities (ABAP Keyword Documentation)
 CDS DDL - DEFINE VIEW ENTITY BUFFER (ABAP Keyword Documentation)
Displaying Details About Buffering From CDS View Entities

Ensuring Quality with ABAP Unit


You can ensure the quality of DDL code using CDS Test Double Framework.

CDS Test Double Framework enables you to test the logic expressed in their CDS entities. It helps you to break dependencies
between the object under test and the database and to take control over the data.

Related Information
ABAP CDS Test Double Framework
Creating a Test Class Using a Wizard
Unit Testing with ABAP Unit

De ning ON Conditions by Use of a Wizard (Obsolete)


A wizard helps you to de ne the ON conditions in the JOIN clauses and ASSOCIATION de nitions of your CDS view de nition.

Prerequisites
This function affects the CDS view in the currently opened editor.

Context
You can use the ON conditions wizard when de ning:

Joins between two data sources (JOIN condition) in a CDS view.

Conditions for an association in a SELECT statement.

The wizard considers the used data sources and their elements and provides proposals (strategies) for joining data sources. As
a developer, you can also specify the elements for a JOIN manually using drag and drop (User De ned strategy).

To launch the wizard, proceed as follows:

Procedure
1. Open the CDS view in the DDL editor.

2. In the CDS source code, position the cursor on the ON keyword where you want to de ne an ON condition for a join or
association.

3. Press CTRL + 1 key shortcut.

This is custom documentation. For more information, please visit the SAP Help Portal 93
2/19/2023

Starting the ON conditions wizard from the quick fix view

A quick x view appears.

4. On the quick x view, double-click the De ne ON conditions entry to start the wizard.

 Note
If the ON condition already exists, the mapping between elements of data sources will be displayed on the wizard
page, where you can then modify them.

5. To specify the condition expression, de ne the mapping between the source and the target data source.

The wizard offers you automatic proposals for mapping elements of the data sources:

Strategy > By Name: Elements with identical names are mapped to each other.

Strategy > By Foreign Key: Based on the foreign key relationship, that has been de ned for a table in the ABAP
Dictionary, mappings are suggested for each key de nition.

When using the User De ned option, you can map the elements in a straightforward manner using drag & drop.

In addition, the wizard provides you with additional functionality, so that you can:

Filter the data sources and their elements by

Name

Dictionary type

Built-in type

Expand or collapse all elements of the

$parameter

$projection

data source

Access context menu functions to...

Delete a selected condition

Delete all conditions

Restore the initial mapping

 Tip
To open the context menu on the wizard page, select the relevant element from the Source or Target area.

This is custom documentation. For more information, please visit the SAP Help Portal 94
2/19/2023

For defining mapping drag and drop relevant elements from source to target

6. Choose Finish.

Results
The wizard inserts the corresponding condition expression after the ON keyword into the DDL source code.

 Note
The wizard does not check the syntax or semantic correctness of a CDS view. So, the modi ed coding might contain syntax
or semantic errors.

Related Information
 ABAP CDS – SELECT, Association (ABAP Keyword Documentation)
 ABAP CDS – SELECT, JOIN (ABAP Keyword Documentation)

Active Annotations View


The Active Annotations view displays the CDS annotations that are used for an active CDS view and the relevant data sources
in a tabular way. The content, displayed in the Active Annotations view, depends on the underlying data de nition.

Metadata Origin

This is custom documentation. For more information, please visit the SAP Help Portal 95
2/19/2023
CDS annotations and their values can be de ned in the CDS view itself or inherited from the underlying data sources or data
elements.

Annotation values are only inherited for elements ( elds and associations) and parameters. Parameters can only inherit from
the corresponding data elements, not from underlying data sources.

In addition, CDS annotations de ned by SAP in metadata extensions are also merged.

Overview
In the Active Annotations view, the following columns are displayed:

Annotated Elements: The view, its parameters, elds, and associations, and their active annotations

Annotation Value: Values or text in the original language of the corresponding annotation

Translated Text: Text that is provided for the corresponding annotation in the respective logon language

Origin Data Source: Name of the development object, for example, a data de nition or database table from which the
corresponding annotation is inherited. You can navigate to this object by double-clicking its name.

Origin Data Element: Name of the data element from which the corresponding annotation is inherited. You can navigate
to this object by double-clicking its name.

The Active Annotations view provides you the following possibilities:

In the search eld, you can enter a lter text to display only speci c entries in the whole view.

From the View Menu in the toolbar, you can toggle between the at or structured display of the active annotations. To
switch the display mode, choose the arrow button from the view toolbar and select the relevant entry.

 Note
The structured mode groups the annotations by their parent node, and is set by default.

The at mode lists the annotations in accordance to their fully quali ed names.

 Example

This is custom documentation. For more information, please visit the SAP Help Portal 96
2/19/2023

Example of a setup from an Active Annotations view and its functionalities

The Active Annotations view for the SEPM_I_SalesOrderItemCube data de nition provides the following information:

1. Integrated toolbar

2. Filter eld to search for entries in the whole view

3. Entity annotations

4. Parameter and its parameter annotation

5. Element and its element annotations

6. Current values of the corresponding annotations

7. Data source where the annotation value is inherited from, and in brackets its object type

8. Data element where the annotation value is inherited from

9. Associations

Related Information
Displaying Annotation Values of an Active CDS View

Annotation Propagation View

De nition
The Annotation Propagation view displays the CDS entity or metadata extension from which the value of a CDS annotation has
been propagated.

Use

This is custom documentation. For more information, please visit the SAP Help Portal 97
2/19/2023
In a data model, the values of the CDS annotations might derive from different CDS objects. In order to understand how the
values of the used CDS annotations are determined and to visualize this merge process, the Annotation Propagation view is
provided.

Overview
Element annotations in data de nitions and metadata extensions are compounded and propagated along the hierarchy of CDS
entities.

In the hierarchies of CDS entities, the element annotation values are propagated from the underlying CDS object to the CDS
objects above.

To reproduce the CDS objects from which propagation has been evaluated, you can open the Annotation Propagation view. Note
that values which are not considered or will be overwritten are marked in gray.

 Example

Example of an Annotation Propagation view

In this example, you as a developer have triggered the Annotation Propagation view with the following selection:

Entity: CDS_View_2

Annotations For*: < eld_4> is the eld within the select list.

Annotation Key: The annotation EndUserText.label which is speci ed for < eld_4>.

The value View 2 de ned in the CDS_VIEW_2 data de nition is overwritten by the value 'PARTNER Extension2' that is
de ned in the PARTNER_EXTENSION_2 metadata extension. Therefore, CDS_VIEW_2 is displayed gray.

In the Value Propagation section, the following general information is provided:

Origin Source: Transport object name of the contributing object

In this example, the eld represents the name of the CDS object where the annotation is de ned.

Annotation For: Name of the annotated element, parameter, or data source that is speci ed in the Selection area

Annotation Key: Name of the annotation for which you have created the Annotation Propagation view or which lter for

Annotation Value: Current value of the corresponding annotation

This is custom documentation. For more information, please visit the SAP Help Portal 98
2/19/2023
Layer: Value that is added to the @Metadata.layer annotation that was assigned to the contributing metadata
extension.

 Note
This value is used internally by the ABAP infrastructure to implement the precedence of the annotations speci ed in
metadata extensions.

This column is empty if the contributing object is not a metadata extension.

Entity Name: Name of the contributing CDS entity or metadata extension

 Note
This column is empty if the contributing object is not a CDS object.

Switch Status. The following columns provide information about the Switch state of a metadata extension:

Switch Status: Displays the switch state of a metadata extension as follows:

If the value ON is displayed, the metadata extension is enabled.

If OFF is displayed, then the metadata extension does not contribute to the metadata of a CDS entity.

If a Switch is not assigned to the metadata extension, then the metadata extension is always enabled. In
this case, the entries in the Switch Package and Switch Name columns are empty.

Switch Package: Name of the corresponding metadata extension's package if a Switch is assigned to the
metadata extension

Switch Name: Name of the Switch which is assigned to the metadata extension

Layer Number: Numeric value of the metadata extension's layer

 Note
This value is used SAP-internally only to implement the precedence of the annotations speci ed in metadata
extensions.

Annotations can be de ned/inherited in/from data de nitions or metadata extensions.

For a given layer annotations might be inactive. If so, they are displayed in gray and not considered for evaluation. Active
annotations are displayed in black.

Related Information
Annotation Propagation
Displaying Annotation Values of an Active CDS View
Analyzing Annotation Propagations
Metadata Extensions

Dependency Analyzer
The Dependency Analyzer evaluates the relationships and complexity from a CDS entity with regards to its SQL de nition.

You use the Dependency Analyzer to investigate which database objects (such as CDS database views, database tables,
database views, and CDS table functions) are used in your CDS view.

This is custom documentation. For more information, please visit the SAP Help Portal 99
2/19/2023
In addition, it helps you to understand SQL dependencies and complexity that might negatively affect the performance of your
query.

The Dependency Analyzer provides you with the following tabs:

The SQL Dependency Tree tab displays dependencies as hierarchy.

The SQL Dependency Graph tab displays dependencies in a graphical map.

The Complexity Metrics tab displays a statistical summary of selected key gures (such as used data sources, SQL
operations, function calls, and expressions).

Related Information
Analyzing Dependencies in Complex CDS Views

SQL Dependency Tree


The SQL Dependency Tree tab displays SQL dependencies of a CDS view on other database objects.

Use Cases
You as a developer open the SAP Dependency Tree tab in the following cases:

You want to edit a CDS view: You want to check the top to bottom SQL dependencies of a CDS view.

You want to reuse a CDS view: You want to understand the dependencies of a CDS view before reusing it.

If there are performance or activation issues, you want to nd out which database object may be the cause.

Overview
The data sources involved are determined recursively and the result is displayed in a tree structure. The following database
objects are possible as data sources:

CDS database view

CDS table function

Database view

External view

 Note
External views are used to access the SAP HANA-based views in the ABAP source code. To access this kind of data
model, your ABAP systems needs to be connected with a SAP HANA database.

Database table

This is custom documentation. For more information, please visit the SAP Help Portal 100
2/19/2023

Example of a SQL dependency tree

A dependency tree provides the following columns:

SQL Name: Name of the database object

SQL Relation: How a database object may be related to its parent object.

 Example
The following relations might be displayed:

Select: (SELECT) FROM

Joins: INNER, LEFT OUTER, RIGHT OUTER

Set operations: UNION, UNION ALL

Type: Name of the database object type

Entity Name: Name of the CDS view

Database Object: Status if the corresponding artifact physically exists in the database. Then, the value true is
displayed.

 Note
If the eld is empty, the corresponding artifact does not exist in the database.

Access Control: Status of the object's access controls with respect to analyzed CDS views

The following status are displayed:

De ned: The access control is de ned for the CDS view as root node of the dependency tree.

This is custom documentation. For more information, please visit the SAP Help Portal 101
2/19/2023
Masked: The access control is de ned for the CDS view(s) as a sub node of the dependency tree.

None: No access control is de ned for the CDS view.

[Empty]: The database object is no CDS view and provides therefore no information about access controls.

 Note
To nd the access control that is de ned, choose Open Other from the context menu of the relevant Defined or
Masked status.

Additional Functionality
In addition to displaying dependencies, you can perform the following functions:

Toolbar

To refresh the dependency tree, for example, after modi cations have been made and the data de nition has been
activated, choose the Refresh icon from the toolbar.

To expand/collapse all nodes in the tree structure, choose the Expand All or Minimize All icons from the toolbar.

To export the graph as PNG le, choose the icon from the toolbar.

Tree

To navigate to the listed data sources through double-click or using the context menu.

To search for objects, enter the relevant name in the Find eld of the search toolbar. If the search toolbar is not
displayed, choose the Show Search icon from the graph toolbar to make it available.

Context Menu

To display the complexity metrics of a CDS or database object, select the relevant object and choose Show Complexity
Metrics from the context menu. Then, the Properties view opened where the relevant information is displayed.

Related Information
SQL Dependency Graph
Complexity Metrics

SQL Dependency Graph


The SQL Dependency Graph visualizes SQL dependencies between ABAP Dictionary objects and CDS views.

Use Case
You want to visualize the dependencies of a complex CDS view and its neighboring objects in order to investigate their
relationships.

Overview
The SQL Dependency Graph tab contains the same information as the SQL Dependency Tree tab but it visualizes the data
model in a graph. This means the closer the nodes representing the objects are, the closer is their relationship. Hierarchies are
represented by the reference to objects on the subsequent level. Objects, that are on the same level, are, if possible, displayed
on the same imaginary line. Relations are displayed as circles.

This is custom documentation. For more information, please visit the SAP Help Portal 102
2/19/2023

Example of a calculated SQL Dependency Graph

 Note
The coloring of the elements used in the SQL Dependency Graph is prede ned. To adapt the coloring, open the ABAP
Development Graphical Tools Dependencies Analyzer preference page and assign another color to the element.

Additional Functionality
In addition to displaying dependencies, you can perform the following functions:

Toolbar

To toggle between the SQL Name and Entity Name in the graph, select the @ icon from the toolbar.

To export the graph as a PNG le, choose the icon from the toolbar.

To maximize or minimize the current position, choose the relevant value from the zoom dropdown listbox in the toolbar.

Graph

To display general and statistical information about a CDS or database object in the tooltip popup, mouse over the
relevant object.

To follow the dependencies of neighboring objects, select the corresponding node. Then, the contrast of the relevant
dependencies is highlighted.

To search for objects, enter the relevant name in the Find eld of the search toolbar. If the search toolbar is not
displayed, choose the Show Search icon from the graph toolbar to make it available.

This is custom documentation. For more information, please visit the SAP Help Portal 103
2/19/2023
To display the complexity metrics of a CDS or database object, select the relevant one and choose Show Complexity
Metrics from the context menu. The Properties view will open where the relevant information is displayed.

You can highlight the elements of the graph in the context of their interdependencies.

You can mask the following attributes:

Object type

State of SQL interrelations,

To highlight them, choose Highlight from the context menu on the white area of the graph. Then select the relevant
entries from the submenus of one or more attributes.

 Note
If you select one or more entries:

from the submenu of the same attribute, all relevant elements will be highlighted that match at least one of
the selected entries.

from several submenus of different attributes, only those elements will be highlighted that match the
selection from the submenu of the same attribute and from the submenus of the other ones.

Outline

To navigate within large graphs, move the highlighted area in the Outline view as required.

Related Information
SQL Dependency Tree
Complexity Metrics

Complexity Metrics
The Complexity Metrics tab enables you to check CDS views regarding performance issues.

Use Case
You want to check the characteristics that in uence the performance of your CDS view.

Overview
This tab summarizes statistical information about a CDS view in the following sections:

Used Data Sources: List of the aggregated number of database objects that depend on the selected CDS view

 Note
Each usage is counted separately. Identical data sources are not grouped.

SQL Operations: List of the aggregated number of the SQL operations that might be most relevant for performance
issues

Performance Related Function Calls and Operations: List of the aggregated number of expressions and function calls

This is custom documentation. For more information, please visit the SAP Help Portal 104
2/19/2023

Related Information
SQL Dependency Tree
SQL Dependency Graph
 ABAP CDS - SELECT, Prede ned Functions (ABAP Keyword Documentation)

Glossary

Access Control
ABAP development object that is used to de ne authorizations for CDS entities

An access control allows you to limit the results returned by a CDS entity to those you authorize a user to see.

Core Data Services (CDS)


CDS introduce a common set of domain-speci c languages (DSL) and services for de ning and consuming semantically rich
data models.

CDS Database View


Projection onto one or multiple relational database tables or other views

An CDS database view is generated in the ABAP Dictionary after activation of the data de nition. The structure of a CDS
database view is de ned in a CDS entity. A CDS database view is a technical representation of the CDS entity.

CDS Entity
Part of a data de nition

The de nition of a CDS entity is introduced with the DEFINE VIEW statement. A CDS entity is used to specify the structure of a
CDS database view.

CDS Entity Under Test (CUT)

The "system under test". It is short for "whatever thing we are testing" and is always de ned from the perspective of the test.
When we are writing unit test the SUT is whatever class (a.k.a. CUT), object (also known as OUT) or method(s) (also known as
MUT) we are testing; when we are writing customer tests, the SUT is probably the entire application (also known as AUT) or at
least a major subsystem of it. The parts of the application that we are not verifying in this particular test may still be involved as
a DOC.

Clones
Creating a temporary clone (copy) of the CUT in the same database schema.

For all purposes, this clone serves as the CDS entity under test. The logic implemented in the original CDS entity is preserved in
the clone but the depended-on components are replaced by the corresponding Test Doubles that are created by the CDS
Test Double Framework.

Data Control Language (DCL)


This is custom documentation. For more information, please visit the SAP Help Portal 105
2/19/2023
DCL is used to de ne authorizations for CDS entities. The main goal of CDS is to make the usage of SQL easier for application
developers. DCL offers a possibility to de ne the authorizations needed for the CDS entities in a modeled, declarative way.

Data De nition
ABAP development object that is used to de ne a CDS view entities

A data de nition is created in ABAP Repository using a wizard of ABAP Development Tools.

DCL Editor
Text-based editor for editing DCL sources, such as access controls

The DCL editor is part of ABAP Development Tools and allows you to de ne the role or access policy for the CDS entity.

Data De nition Language (DDL)


Subset of SQL

DDL statements are used to create and delete the entities of a relational database. In AS ABAP, DDL is integrated into ABAP
Dictionary.

DDL Editor
Text-based editor for editing development objects containing DDL such as data de nitions and metadata extensions

The DDL editor is part of ABAP Development Tools.

Depended-on components (DOC)


An individual class or a large-grained component on which the system under test (SUT) depends. The dependency is
usually one of delegation via method calls. In test automation, it is primarily of interest in that we need to be able to examine
and control its interactions with the SUT to get complete test coverage.

For more information, see http://xunitpatterns.com/DOC.html.

Metadata Extension
ABAP development object that is used to annotate CDS entities with metadata without modi cations.

Tips and Tricks (ABAP CDS Tools)


The following chapters provide an overview of tips and tricks when working with the ABAP CDS tools in the ABAP Development
Tools (ADT) to make your daily work easier.

Scope
The focus is on ABAP CDS development working with the ADT features to create and edit data models.

Target Group
This is custom documentation. For more information, please visit the SAP Help Portal 106
2/19/2023
This content is for all ...

ABAP CDS developers (beginners) who want to start developing data models using the ABAP CDS tools in ADT and learn
how to handle general use cases in this context.

ABAP CDS developers (experts) who want to learn more about the unknown tools when developing ABAP CDS data
models with ADT and how to handle speci c use cases in this context.

Contents
You will nd here tips and tricks for the following areas in the context of ABAP CDS development:

Accessing CDS Objects

Creating CDS Objects

Editing CDS Objects

Opening and Searching CDS Objects

Formatting ABAP CDS Source Code

Extending CDS Objects

Analyzing CDS Objects

Error Handling

Using Help Content

 Note
The subsequent content refers to the latest back-end versions of your SAP product and Eclipse version. Consequently, some
ADT features described here may not be supported in previous ABAP systems.

Related Information
Tips and Tricks (ABAP Core Tools)

Accessing CDS Objects


Use Case Description

This is custom documentation. For more information, please visit the SAP Help Portal 107
2/19/2023

Use Case Description

Checking if the relevant data can be You can check if your datamodel can access the relevant data on the data source without
selected with an underlying access control using an access control. In this case, you can use the WITH PRIVILEGED ACCESS
addition, for example in a FROM clause of an ABAP SQL query. This enables you to check
which data a CDS entity results with or without CDS access control.

 Note
The addition WITH PRIVILEGED ACCESS in a SELECT statement in ABAP source
code disables access control. Your user needs speci c permissions to execute ABAP
source code which contains the WITH PRIVILEGED ACCESS addition.

 Example
Here, the access control does no provide the selected data of your CDS entity from the
database in the SQL Console:

Empty SQL Console when retrieving using an access control

Here, the WITH PRIVILEGED ACCESS addition is used which provides the selected
data in this case:

Content (that is selected by a CDS entity using the WITH PRIVILEGED ACCESS addition)
displayed in the SQL Console

For more information, see:

Access Controls

 SELECT, FROM data_source (ABAP Keyword Documentation)

Data is missing or only parts of the Your user might not have the appropriate permissions to access the relevant data.
expected data is displayed in the Data
For more information, contact the SAP administrator of your ABAP system.
Preview

Creating CDS Objects


Use Case Description

This is custom documentation. For more information, please visit the SAP Help Portal 108
2/19/2023

Use Case Description

Duplicating or copying CDS objects You can duplicate or copy a CDS object.

Select the object to be duplicated or copied in the Project Explorer and choose Duplicate
... or Copy from the context menu.

Duplicating and copying CDS objects from the context menu in the Project Explorer

If you duplicate, specify a Package and a new Name of the new CDS object in the dialog
which will be opened.

If you copy, paste the entity to be created into the relevant package.

 Note
After duplicating the object, you can use the Tab key to navigate to the positions in
the source code which you want to modify, for example the entity name.

Handling empty CDS entities after creation If you de ne a CDS object from scratch, you can use the content assist ( Ctrl Space )
to select a template.

Using content assist to define a CDS object from scratch

When creating a CDS object using the creation wizard, you can use a template. To do this,
you need to select the Use the selected template checkbox on the Templates page. When
deselecting the checkbox, no template will be used.

This is custom documentation. For more information, please visit the SAP Help Portal 109
2/19/2023

Use Case Description

Context-sensitive list of templates in the creation wizard

 Note
SAP provides several templates for different types of CDS entities.

The templates will be proposed depending on the ...

underlying (for example, referenced) object, which de nes what can be created
at the current position.

type of CDS object you are creating.

This is custom documentation. For more information, please visit the SAP Help Portal 110
2/19/2023

Use Case Description

Creating ABAP CDS code templates You can create your own templates ...

in the Window Preferences... ABAP Development Editors Source Code


Editors Data De nition Templates preferences or

from the Templates view .

To do this, choose the New icon from the integrated toolbar or the New button from the
sidebar.

You can create your own templates to cover the following use cases:

A context contains the whole structure for a CDS entity. The contexts – to that
templates are assigned – are labeled with the suffix (creation). Templates which
contain the whole structure of the CDS entity are labeled with the suffix (creation).

 Note
When creating a CDS object only the (creation) templates will be proposed in
the creation wizard.

Context type "Creation"

 Recommendation
If you have created your own creation templates in deprecated context,
reassign them.

The remaining templates can contain one or more source code pattern(s).

You can use SAP's default ABAP CDS code templates when creating CDS objects or your
own templates when ...

performing the content assist Ctrl + Space in the DDL editor. They will then be
displayed in the dialog.

when selecting New Data De nition Templates from the context menu or in
the creation wizard. Note that this is only possible when they are of the context
type (creation).

For additional information, see here a video

This is custom documentation. For more information, please visit the SAP Help Portal 111
2/19/2023

Use Case Description

Specializing the data model of a business In the context of the ABAP Programming Model for SAP Fiori (RAP), you use a CDS
object projection view to expose a subset of elements and associations from the underlying CDS
DDIC-based view or a CDS view entity that is required for a business service. Furthermore,
it is possible to specialize such a projection of a business object by creating a WHERE
condition, applying eld aliasing, adding lters to exposed associations.

To create a CDS projection view, create a data de nition and use the
defineProjectionView code template. After creation, you can use the content assist
Insert all elements in the SELECT list to insert all the elds of the underlying data source.
Delete the elds which you want to hide.

Using quick assist Insert all elements to get all fields from the data source

For more information, see Providing a Data Model for Projections

Editing CDS Objects


Use Case Description

This is custom documentation. For more information, please visit the SAP Help Portal 112
2/19/2023

Use Case Description

De ning ON conditions Use de ned foreign keys for database tables to de ne the conditions of JOINs and
associations in a data de nition.

To do this, position the cursor on the ON keyword of your condition and trigger the quick
assist ( Ctrl 1 ). Choose the De ne ON conditions quick assist.

Defining ON conditions using content assist

In the On Conditions wizard, select the By Foreign Key strategy and choose the foreign
key de nition you want to use in the Variant drop-down box. The corresponding elds in
the source and target data sources will then be mapped in accordance to your selection.

Wizard to define ON conditions

Sample for an inserted ON condition in a data definition

To insert, choose Finish.

 Note
This wizard also enables you to ...

Filtering the data sources and their elements

Expanding or collapsing elements

Accessing further functions from the context menu

For more information, see De ning ON Conditions by Use of a Wizard (Obsolete)

This is custom documentation. For more information, please visit the SAP Help Portal 113
2/19/2023

Use Case Description

Creating the implementing method of a CDS Use the Create method ... quick assist to create the implementing method of your CDS
table function table function.

Position the cursor on the method name in the data de nition and use the quick assist (
Ctrl 1 ) and choose Create method ....

After performing the quick assist, the name of the AMDP method from the speci ed class
will be added in the data de nition.

Using code completion to add the class implementation

Inserting comments in CDS entities Use comments, for example, to add further information to your source code or to exclude
elds.

In the CDS editors, text that appears after a double forward slash (//) or between a
forward slash and an asterisk (/*...*/) is interpreted as a comment. It will then be
highlighted in gray.

 Note
// can be used for end-of-line comments or for complete-line comments.

/*...*/ allows you to insert comment text that extends over multiple lines.

To insert a comment in a complete line, position the cursor in the line or select several lines
and choose Ctrl + 7 (Toggle Comment).

Adding and Removing Comments

Use, for example, comments to exclude fields

This is custom documentation. For more information, please visit the SAP Help Portal 114
2/19/2023

Use Case Description

Navigating to the target entity of an You can navigate to the target entity of an association used in a data de nition. To do this,
association position the cursor on the association name and press F3 or Ctrl + Click and choose
Navigate To Target from the popup.

To navigate to the origin of the association, select Navigate To from the popup or position
the cursor on the association name and press F3 .

Sample for navigation to the origin of an association

Using code completion to insert the You can insert the signature of a CDS view with parameters, a CDS table function, and/or
signature of a CDS view with parameters, built-in SQL functions which you use in your data de nition. To do this, choose content
CDS table functions, and/or built-in SQL assist ( Ctrl + Space ) and select the object you wish to insert with Shift + Enter .
functions

Sample for selecting an object from the code completion list

After insertion, use the Tab to navigate to the placeholders which need to be modi ed.

Sample for navigation between the placeholders

This is custom documentation. For more information, please visit the SAP Help Portal 115
2/19/2023

Use Case Description

Making a data de nition more readable Use code folding in the DDL editors to collapse and expand blocks of annotations and
comments.

To do this, check that folding is enabled. Open the context menu on the vertical ruler of the
editor and select Folding Enable Folding .

Sample for using code folding from the vertical ruler

Alternatively, you can also hide the comments and/or annotations by choosing Hide
Comments or Hide Annotations in the vertical ruler of the editor.

Entries from the context menu to hide comments or annotations

Opening and Searching CDS Objects


Use Case Description

Displaying the Source Types of CDS Data You can display the source type of a CDS data de nition (in short, data de nition) in the
De nitions Properties view, the ABAP Repository Tree, or when opening/searching them.

This helps you to limit your scope, for example when you want to nd or open a speci c
source type.

The source type is displayed in the Speci c tab of the Properties view for a data
de nition.

This is custom documentation. For more information, please visit the SAP Help Portal 116
2/19/2023

Use Case Description

Sample for displaying the source type View Entity from a data definition

In addition, you can enter type:ddls and sourcetype: in the lter eld when opening a
data de nition using Ctrl + Shift + A .

Sample for use of source code type filtering when opening data definitions

When creating an ABAP repository tree, choose the Data De nitions by Source Type
template.

Sample of an ABAP repository tree displaying the source type tree for data definitions

You can also do the same sorting for folders in the Project Explorer. To do this, choose the
relevant Core Data Services subfolder and select Expand Folder By... from the context
menu. In the popup, select the Source Type radio button.

This is custom documentation. For more information, please visit the SAP Help Portal 117
2/19/2023

Use Case Description

Sample for expanding the Core Data Services folder by the source type

For more information, see

Creating an ABAP Repository Tree

Opening Development Objects

Source Type

Displaying Properties of Development Objects

Displaying the Source Types of CDS Service You can display the source type of a CDS service de nition (in short, service de nition) in
De nitions the Properties view, the ABAP Repository Tree, or when opening them.

This helps you to limit your scope when you want to nd or open the speci c source types
Definition and Extension.

The source type is displayed in the Speci c tab of the Properties view for a data
de nition.

Sample for displaying the source type Definition from a data definition

In addition, you can enter type:srvd and sourcetype: in the lter eld when opening a
service de nition using Ctrl + Shift + A .

Sample for use of source code type filtering when opening service definitions

This is custom documentation. For more information, please visit the SAP Help Portal 118
2/19/2023

Use Case Description

When de ning an ABAP repository tree, enter type:srvd as the Property Filter in order
to make tree level Source Type available.

Defining an ABAP repository tree in order to make the source type tree level available for service
definitions

The tree will then be displayed in accordance in the Project Explorer.

Sample of an ABAP repository tree displaying the source type tree for service definitions in the
Project Explorer

For more information, see

Creating an ABAP Repository Tree

Opening Development Objects

Displaying Properties of Development Objects

Formatting ABAP CDS Source Code


Use Case Description

This is custom documentation. For more information, please visit the SAP Help Portal 119
2/19/2023

Use Case Description

Con guring casing of ABAP CDS keywords Identi ers in ABAP CDS are not case-sensitive. To ensure consistency across all data
and identi ers de nitions, the ABAP CDS keywords and identi ers are automatically formatted on save.

The identi ers are formatted to match the way the corresponding entity or element was
de ned. Preserving the case of the identi ers increases readability and potentially
increases the interoperability of ABAP and CDS in SAP HANA.

 Note
It is not possible to deactivate this formatting. If you wish to change the formatting of
an entity or element name, de ne an alias.

To format the whole ABAP CDS source code of your CDS object, choose Shift + F1 . To
format selected source code blocks, choose Ctrl + Shift + F1 .

For more information, see also Formatting ABAP Source Code

Con guring the text size and color in the Use the Window Preferences... ABAP Development Editors Source Code
ABAP CDS editors Editors preferences and choose Colors and Fonts to navigate to the general color and
font preferences.

Preference page from which you can navigate to the Color and Fonts settings

Edit the Text Font in the Basic folder to change the text size and color in your CDS editor.
Edit the settings in the CDS folder to change the highlighting of your ABAP CDS keywords,
annotations, identi ers, and so on.

This is custom documentation. For more information, please visit the SAP Help Portal 120
2/19/2023

Use Case Description

Preference page to set the font and size of text

You can also modify the settings in Window Preferences... General Editors Text
Editors Accessibility to modify the appearance of your IDE.

Extending CDS Objects


Use Case Description

Extending the structure of data models Use extends to add further element(s) to the select list, for example, of an existing CDS
view, to extend its structure in the SAP standard without causing any modi cations.

After activation, the additional element(s) will be available any time it is used.

In the extended CDS view, CDS view extensions are highlighted with the marker in the
vertical ruler of the editor. When hovering the marker, you can display further details or
navigating to the extend view directly from the extension popup.

Extending the metadata of data models Use metadata extensions to add customer-speci c metadata to a CDS entity of the SAP
standard without causing modi cations. The metadata is provided in CDS annotations.

You can create a metadata extension from the New Other ABAP Repository Object
Core Data Services Metadata Extension creation wizard.

In addition, you can extract CDS annotations, de ned in a data de nition, into a new
metadata extension. To do this, open the data de nition in the DDL editor. Choose
Source Code Extract Metadata Extension from the context menu to launch the
Extract Metadata Extension wizard. From here, select the relevant annotations. This
enables you to handle customer-speci c metadata in a separate development object.

Analyzing CDS Objects


This is custom documentation. For more information, please visit the SAP Help Portal 121
2/19/2023

Use Case Description

Getting a better overview of all the elds Use the Element Information popup to get an overview of the elds and associations
and associations provided by a data provided by your data de nition and to navigate within a data model.
de nition
Position the cursor on the name of your CDS object or data source in your data de nition
and choose F2 .

Sample for the content of an element info for the data source of a data definition

Select the underlined elements to open the Element Information popup.

The Outline view also provides an overview of the structure from a data de nition.
Annotated elements are decorated with the @ icon. If the view is not visible in your IDE,
open the Outline view through the Window Show View Outline menu.

This is custom documentation. For more information, please visit the SAP Help Portal 122
2/19/2023

Use Case Description

Sample of an Outline view that displays the structure of a data definition

Finally, you can hide the comments and annotations in a data de nition to focus on the
implementation details of your elements. Choose Hide Comments or Hide Annotations
from the context menu in the vertical ruler of the editor.

This is custom documentation. For more information, please visit the SAP Help Portal 123
2/19/2023

Use Case Description

Hiding comments and annotations from the context menu in the vertical ruler

Displaying the details of the data sources Use the Element Information view or navigate to the data sources and element types used
and elements used in a data de nition to see more details.

To do this, position the cursor on the name of the data source or element in the data
de nition and choose F2 to open the Element Information popup or F3 to navigate.
Within the Element Information you can access further details by clicking on hyperlinked
elements.

Sample for an Element Info popup from which you can navigate to an element

You can open the Element Information popup and view by clicking on the @ icon Show in
ABAP Element Info View. The ABAP Element Info view will then be automatically updated
whenever you select an identi er.

This is custom documentation. For more information, please visit the SAP Help Portal 124
2/19/2023

Use Case Description

Displaying the database tables and entities Under the from node of the SELECT statement in the Outline view ( Window Show
which a data de nition uses View Outline ), the data sources used in the FROM clause of a data de nition are listed.

Sample of the data sources listed in the from node in the Outline view

 Note
This, however, does not include the data sources which are used in path expressions
when you access elements of other entities through associations.

The SQL CREATE statement generated for your entity displays the SQL names of all the
data sources used in a data de nition (including the data sources used in path
expressions) in the FROM clause. To display the statement, select the data source and
choose Show SQL CREATE Statement from the context menu.

Sample of an SQL CREATE statement triggered from a data source

You can see the transitive dependencies of a data de nition in the Dependency Analyzer (
Open With Dependency Analyzer ). The SQL Dependency Tree and SQL
Dependency Graph display the relationship between all the data sources used both
directly and indirectly in a data de nition. This is relevant, for example for the
performance of your entity.

Sample of the display from a dependency analyzer

This is custom documentation. For more information, please visit the SAP Help Portal 125
2/19/2023

Use Case Description

Other performance relevant metrics of a data de nition can be found in the Complexity
Metrics view.

Displaying the SQL CREATE statement You can display the SQL CREATE statement generated for a data de nition.
which is generated for a data de nition
Choose Show SQL CREATE Statement from the context menu from any position within the
data de nition.

Context menu to show the SQL CREATE statement from a data source

Sharing CDS entities with colleagues Use the Share Link functionality for data de nitions and access controls to share them
with other ABAP CDS developers of your team or company.

Choose Share Link... in the context menu of the CDS object in the Project Explorer.

Entry from the context menu to share a CDS object with other developers

You can email a link to your object directly to your colleagues or copy it to the clipboard.

If you choose ...

HTTP Link a web link will be generated. You can paste it into a document, an email,
and so on. Your colleagues can open the link in a web browser. In this case, your
colleagues do not need to have ADT installed, but they need to have access to the
ABAP system.

ADT Link, an ADT link will be generated. You can paste it in a document or directly
in an email client. In this case, your colleagues do need to have ADT installed and
access to the ABAP system.

This is custom documentation. For more information, please visit the SAP Help Portal 126
2/19/2023

Use Case Description

Popup to select the link type to be shared

 Note
For both link types, you can choose Email link to open the default email client of your
operating system or Copy link to clipboard to paste the link in a document, and so on.

Performing Where-used for data de nitions You can search for usages (Where-used list) for your CDS object. Select the object in the
and access controls Project Explorer and choose Get Where-used List... from the context menu.

The results are displayed in the Search view. You can lter the results using the Filter
Dialog of the Search view.

Sample of a Where-list triggered for a data definition

To lter the search result, for example for ABAP packages or users, choose the lter icon
from the integrated toolbar.

 Note
If you perform Where-used for a CDS DDIC-based view, the search is performed for
your CDS entity and the generated CDS-managed DDIC view separately.

In this case, you should always perform Where-used twice: Once for the entity and
again for the generated CDS-managed DDIC view. This enables you to nd all usages of
a data de nition.

This is custom documentation. For more information, please visit the SAP Help Portal 127
2/19/2023

Use Case Description

Finding a data de nition on base of the SQL


 Note
view name
The subsequent steps are not relevant for CDS view entities, because there is no CDS-
managed DDIC view generated at creation.

If you know the name of the CDS-managed DDIC view of a CDS DDIC-based view, you can
navigate to the data de nition where it is used.

Choose Ctrl Shift A to open the CDS-managed DDIC view and double-click the
name of the data de nition.

Alternatively, you can select the CDS-managed DDIC view in the Project Explorer and
navigate to the data de nition from the context menu entry Open with De nition .

Sample for opening a data definition from the context menu of a CDS-managed DDIC view

Testing a data de nition Iterative Testing

Use the Data Preview to see and check which data is selected for the query implemented
in your data de nition. Choose Open with Data Preview from the context menu to
open the data de nition or choose F8 .

You can also follow any public associations using the Data Preview bread crumb.

Sample for testing and checking a data model using the data preview

Unit Testing

Use the ABAP CDS Test Double Framework to test the logic expressed in CDS entities in an
automated way.

You have to create a test class to reduce the entry barrier. You then write a unit test for your
CDS entity using quick assist proposals.

Error Handling
This is custom documentation. For more information, please visit the SAP Help Portal 128
2/19/2023

Use Case Description

Activation issues Use the Dictionary Log to get detailed technical information on diagnosis and
troubleshooting in a tabular way. Open it from the Open with Dictionary Log context
menu in the DDL editor.

Use the Activation Graph to visualize the order of activation from the ABAP Dictionary and
CDS objects which are involved and possible effects for mass activation on depending
CDS objects. Open it from the Open with Activation Graph context menu in the DDL
editor.

Context menu to trigger the Dictionary Log or Activation Graph

To get a more detailed log, press Ctrl and choose the hyperlink (for example, See log
[User]xyz:ACT) in the Dictionary Log. Another log will be opened and lists, for example,
all CDS objects where your selected data de nition is used and which are also activated.

Sample for opening and navigating to a more detailed Dictionary log

The Activation Graph visualizes the information of the Dictionary Log in a graphical way.

Sample for displaying the dependencies in a graphical way in the activation graph

Problems view

This is custom documentation. For more information, please visit the SAP Help Portal 129
2/19/2023

Use Case Description

Quick xes provided in the Problems view If a quick x exists for a problem reported in the Problems view, you have the following
possibilities to trigger the quick x:

1. In the vertical ruler of the DDL editor, the light bulb decorator indicates that a
quick x is provided for a problem. Select this decorator and choose the proposed
quick x from the dialog to be opened.

Sample for triggering a quick fix in CDS view entity

Alternatively, you can choose Ctrl + 1 on the highlighted problem in the DDL
editor.

2. In the Problems view, select the problem and choose Quick Fix from the context
menu.

Sample for triggering the quick fix from the problem in the Problems view

Displaying active annotations You can use the Active Annotations view to investigate which annotations have been
propagated/inherited from the underlying data sources and which annotations are currently
active for your data de nition. To open it, choose Open With Active Annotations
from the context menu of the data source.

This is custom documentation. For more information, please visit the SAP Help Portal 130
2/19/2023

Use Case Description

Context menu path to trigger creation of the Active Annotations view

The Active Annotations view displays the CDS annotations that are used for an active
CDS view and the relevant data sources in a tabular way.

Sample for content displayed in the Active Annotations view

This is custom documentation. For more information, please visit the SAP Help Portal 131
2/19/2023

Use Case Description

Understanding errors and warnings You can view the descriptions of errors and warnings that relate to the opened editors in the
displayed in the Problems view Problems view. The Error Log lists all errors, warnings, and information of your IDE in the
context of your current development activities on a chronological tabular way.

To display further detailed information, navigate to the relevant error or warning in the
Problems view. If a description has been maintained for the problem, you can choose
Problem Description from the context menu. The ABAP Problem Description dialog will
be opened and provides, for example, information about diagnosis, system response, and
the possible solution.

Sample to open the ABAP Problem Description view to get more information

In case of an error or warning, the short text will be displayed in the Problems view. In case
that a long text is available, the decorator will be added to the icon.

To display the long text, select the error or warning and choose Problem Description from
the context menu. The ABAP Problem Description view will be opened and will display
the additional information.

Sample of a message long text provided for a warning

Comparing the versions of a CDS entity You can compare different versions of a CDS object within the system landscape or local
versions of your object which are automatically stored on your client while you are editing
the source code.

Choose Compare With (Ctrl+Alt+C) from the context menu of a data de nition. From the
submenu, choose the relevant system connection or another entry.

Sample for comparing two versions of the same CDS object in two different ABAP systems

Changing the package assignment of a CDS Select the CDS object in the Project Explorer and choose Change Package Assignment in
entity the context menu.

This is custom documentation. For more information, please visit the SAP Help Portal 132
2/19/2023

Use Case Description

Renaming a CDS DDIC-based view / CDS-


 Note
managed DDIC view after transport
The subsequent content is not relevant for CDS view entities, because there is no CDS-
managed DDIC view generated at creation.

You cannot rename a CDS DDIC-based view / CDS-managed DDIC view after it has been
activated or transported. To avoid inconsistencies in the transport landscape, you should
not change the name of the CDS DDIC-based view or the CDS-managed DDIC view name of
a data de nition after it has been transported. You can only safely change the names by
deleting a de nition and transporting the deletion. Thereafter, you can re-de ne a CDS
DDIC-based view using the new names.

Using Help Content


Use Case Description

Context help You can nd detailed information about the ABAP CDS tooling in ADT from the Help
Help Contents SAP - ABAP CDS Development User Guide menu.

Where available, you can also access context-speci c help content about the currently
used tool by clicking on the Help icon.

Sample for opening the context help from the creation wizard

ABAP Keyword Documentation for ABAP Position the cursor on an ABAP CDS keyword in your CDS object and choose F1 . The
CDS keywords ABAP Keyword Documentation will be opened in the ABAP Language Help view.

Sample for opening the ABAP Keyword Documentation for an ABAP CDS keyword

This is custom documentation. For more information, please visit the SAP Help Portal 133
2/19/2023

Use Case Description

List of keyboard shortcuts You can nd a list of all the relevant keyboard shortcuts through the menu Help Show
Active Keybindings... (Ctrl+Shift+L) .

To search for the relevant keyboard functionality in the dialog, begin typing.

Displayed list of supported key bindings

 Tip
The list of the Keyboard Shortcuts for ABAP Development also provides you an
overview of the most relevant Eclipse and ADT keyboard shortcuts in the context of
ABAP development.

What's New in ABAP CDS Tools


ABAP CDS tools are an integral part of the client installation of ABAP Development Tools (ADT). ADT is released to customers in
combination with the corresponding back end shipment. This means, in order to use certain ADT functionalities, you need to
provide the corresponding back end.

The following table gives you an overview of the released ADT versions and ABAP back ends:

 ABAP environment
The following list gives you an overview of the released ADT client versions:

Version 3.32

Version 3.30

Version 3.28

Version 3.26

Version 3.24

Version 3.22

Version 3.18

Version 3.14

Version 3.12

Version 3.6

This is custom documentation. For more information, please visit the SAP Help Portal 134
2/19/2023
Version 3.4

Version 3.0

Version 3.32
ABAP CDS tools are an integral part of the client installation of ABAP Development Tools (ADT). ADT is released to customers in
combination with the corresponding back end shipment. This means, in order to use certain ADT functionalities, you need to
provide the corresponding back end.

Here is an overview of the most signi cant changes in the context of ABAP CDS development that relate to the following:

The subsequent release information relates to ...

ADT client version 3.32

Back-end version(s):

 SAP BTP ABAP environment 2302

 SAP S/4HANA Cloud ABAP Environment 2302

 Note
The following features that are highlighted with '*' are ADT-client-speci c and are therefore available for all supported ABAP
systems.

In this topic, you will nd release information about the following:

Displaying the Source Types of CDS Data De nitions

Displaying the Source Types of CDS Service De nitions

Migrating CDS DDIC-Based Views to CDS View Entities

Creating CDS Simple Types

Supported Features in Service Binding

Displaying the Source Types of CDS Data De nitions


You can now display the source type of a CDS data de nition (in short, data de nition) in the Properties view, the ABAP
Repository Tree, or when opening/searching them.

This helps you to limit your scope, for example when you want to nd or open a speci c source type.

The source type is displayed for a data de nition in the Speci c tab of the Properties view.

This is custom documentation. For more information, please visit the SAP Help Portal 135
2/19/2023
Sample for displaying the source type View Entity from a data definition

In addition, you can enter type:ddls and sourcetype: in the lter eld when opening a data de nition using Ctrl + Shift
+ A .

Sample for use of source code type filtering when opening data definitions

When creating an ABAP repository tree, choose the Data De nitions by Source Type template.

Sample of an ABAP repository tree displaying the source type tree for data definitions

You can also do the same sorting for folders in the Project Explorer. To do this, choose the relevant Core Data Services
subfolder and select Expand Folder By... from the context menu. In the popup, select the Source Type radio button.

Sample for expanding the Core Data Services folder by the source type
This is custom documentation. For more information, please visit the SAP Help Portal 136
2/19/2023
For more information, see

Creating an ABAP Repository Tree

Opening Development Objects

Source Type

Displaying Properties of Development Objects

Displaying the Source Types of CDS Service De nitions


You can now display the source type of a CDS service de nition (in short, service de nition) in the Properties view, the ABAP
Repository Tree or when opening them.

This helps you to limit your scope when you want to nd or open the speci c source types Definition and Extension.

The source type is displayed in the Speci c tab of the Properties view for a data de nition.

Sample for displaying the source type Definition from a data definition

In addition, you can enter type:srvd and sourcetype: in the lter eld when opening a service de nition using Ctrl +
Shift + A .

Sample for use of source code type filtering when opening service definitions

When de ning an ABAP repository tree, enter type:srvd as the Property Filter in order to make tree level Source Type
available.

This is custom documentation. For more information, please visit the SAP Help Portal 137
2/19/2023

Defining an ABAP repository tree in order to make the source type tree level available for service definitions

The tree will then be displayed in accordance in the Project Explorer.

Sample of an ABAP repository tree displaying the source type tree for service definitions in the Project Explorer

For more information, see

Creating an ABAP Repository Tree

Opening Development Objects

Displaying Properties of Development Objects

Migrating CDS DDIC-Based Views to CDS View Entities


You can now migrate CDS DDIC-based views to CDS view entities. This means, a new wizard performs the migration of one or
more data de nitions for you. Migration will apply the relevant changes to your source code after choosing Finish. The migration
will become effective after you have activated the migrated data de nitions.

In order to check and test the results of the migration before performing any changes, you can simulate the actual migration in
advance.

In both cases, a log shows all errors and warnings. You can use this log for further investigations. In addition, you can compare
the representation of your source code before and after the migration.

This is custom documentation. For more information, please visit the SAP Help Portal 138
2/19/2023

Sample of a result from a simulation

To trigger the CDS migration wizard, select the relevant data de nition(s) in the Core Data Services Data De nitions tree
in the Project Explorer and choose Migrate to CDS View Entity... from the context menu.

For more information, see Migrating CDS DDIC-Based Views to CDS View Entities

Creating CDS Simple Types


You can now create and edit CDS simple types (in short, simple types) in a source-based editor.

To open the creation wizard, choose New Other... Core Data Services Type from the menu.

For more information, see Creating CDS Simple Types

Supported Features in Service Binding


You can now view the version history and version compare of a service in a service binding.

For more information, see Service Binding Features.

Version 3.30
ABAP CDS tools are an integral part of the client installation of ABAP Development Tools (ADT). ADT is released to customers in
combination with the corresponding back end shipment. This means, in order to use certain ADT functionalities, you need to
provide the corresponding back end.

This is custom documentation. For more information, please visit the SAP Help Portal 139
2/19/2023
Here is an overview of the most signi cant changes in the context of ABAP CDS development that relate to the following:

The subsequent release information relates to ...

ADT client version 3.30

Back-end version(s):

 SAP BTP ABAP environment 2211

 Note
The following features that are highlighted with '*' are ADT-client-speci c and are therefore available for all supported ABAP
systems.

In this topic, you will nd release information about the following:

Removal of the ON Conditions Wizard

Removal of the ON Conditions Wizard


The ON Conditions wizard will be removed in near future.

To de ne ON conditions, edit the ABAP CDS source code in den relevant data de nition editor.

For more information, see De ning ON Conditions by Use of a Wizard (Obsolete)

Version 3.28
ABAP CDS tools are an integral part of the client installation of ABAP Development Tools (ADT). ADT is released to customers in
combination with the corresponding back end shipment. This means, in order to use certain ADT functionalities, you need to
provide the corresponding back end.

Here is an overview of the most signi cant changes in the context of ABAP CDS development that relate to the following:

The subsequent release information relates to ...

ADT client version 3.28

Back-end version(s):

 SAP BTP ABAP environment 2208

 SAP S/4HANA Cloud ABAP Environment 2208

 Note
As of Application Server ABAP 7.57 FPS00, certain ADT features that have already been enabled for SAP BTP ABAP
environment and SAP S/4HANA Cloud ABAP Environment, are now also valid in the context of on-premise for the ABAP
platform. The documentation has been adapted accordingly.

 Note
The following features that are highlighted with '*' are ADT-client-speci c and are therefore available for all supported ABAP
systems.

This is custom documentation. For more information, please visit the SAP Help Portal 140
2/19/2023
In this topic, you will nd release information about the following:

Using CDS Scalar Functions in ABAP CDS Syntax

Creating a Service De nition Extension

Using CDS Scalar Functions in ABAP CDS Syntax


You can now use CDS scalar functions to accept one or more scalar input parameters and to return a scalar output parameter
in CDS views. This enables you to make these functions usable within regular ABAP CDS syntax.

CDS scalar functions are realized as ...

CDS scalar function de nitions where the input parameter(s) and the output parameter are de ned.

CDS scalar function implementations as the reference where the CDS scalar function de nition is assigned to the
engine.

 Restriction
CDS scalar functions are provided by SAP only. Currently, you, as an SAP customer, cannot create nor edit them.

For more information, see CDS Scalar Functions

Creating a Service De nition Extension


You can now create service de nition extensions. This enables you to extend SAP's service de nitions or the service de nitions
of your company.

For more information, see Creating a Service De nition Extension

Version 3.26
Here is an overview of the most signi cant changes in the context of ABAP CDS development that relate to the following:

The subsequent release information relates to ...

ADT client version 3.26

Back-end version(s):

 SAP BTP ABAP environment 2205

 Note
The following features that are highlighted with '*' are ADT-client-speci c and are therefore available for all supported ABAP
systems.

Displaying Details About CDS Entity Buffering in the Element Information Popup
You can open the CDS entity view in the Element Information popup to get more information about the table buffering currently
in use.

This is custom documentation. For more information, please visit the SAP Help Portal 141
2/19/2023

Sample for displaying further buffering information in the element information popup

The following information is displayed:

Bufferable

Buffered

Type

 Note
If the type is linked, you can navigate to the CDS entity buffer that de nes the respective settings.

For more information, see Creating a CDS Entity Buffer

Version 3.24
Here is an overview of the most signi cant changes in the context of ABAP CDS development that relate to the following:

The subsequent release information relates to ...

ADT client version 3.24

Back-end version(s):

 SAP BTP ABAP environment 2202

 SAP S/4HANA Cloud ABAP Environment 2202**

 Note
**In the context of SAP S/4HANA Cloud ABAP Environment, the ADT capabilities are only available for
members of the SAP Early Adopter program.

 Note
The following features that are highlighted with '*' are ADT-client-speci c and are therefore available for all supported ABAP
systems.

Creating a CDS Entity Buffer


You can now create a CDS entity buffer (in short, entity buffer) using the creation wizard.

An entity buffer speci es the layer-speci c buffering type for table buffering on AS ABAP that caches the data retrieved from a
CDS view entity in the shared memory of the AS ABAP instance.

For more information, see Creating a CDS Entity Buffer


This is custom documentation. For more information, please visit the SAP Help Portal 142
2/19/2023

Version 3.22
Here is an overview of the most signi cant changes in the context of ABAP CDS development that relate to the following:

The subsequent release information relates to ...

ADT client version 3.22

Back-end version(s):

 SAP BTP ABAP environment 2111

 SAP S/4HANA Cloud ABAP Environment 2111**

 Note
**In the context of SAP S/4HANA Cloud ABAP Environment, the ADT capabilities are only available for
members of the SAP Early Adopter program.

 Note
The following features that are highlighted with '*' are ADT-client-speci c and are therefore available for all supported ABAP
systems.

Inserting CDS Annotations


You can now prede ne how to insert the array of CDS annotations when using code completion. From the ABAP Development
Editors Source Code Editors CDS Code Completion preference page, choose the Flat or Structured option in the
Insert CDS Annotations section. This enables you then to insert CDS annotations on a structured way across several lines or in
one line.

For more information, see Inserting CDS Annotations

Version 3.18
Here is an overview of the most signi cant changes in the context of ABAP CDS development that relate to the following:

Client: ABAP Development Tools (ADT) 3.18

Back end version:  SAP Cloud Platform ABAP Environment 2105

 Note
The following features that are highlighted with '*' are ADT-client-speci c and are therefore available for all supported ABAP
systems.

Tips and Tricks (ABAP CDS Tools)


You as an ABAP CDS tools expert can now use the tips and tricks provided for the ABAP CDS tools. This documentation provides
condensed concept and task information from ADT features which might have a positive impact on your development activities
in a more effective way.

The content is structured in a tabular way that supports you nding the relevant content easily.

This is custom documentation. For more information, please visit the SAP Help Portal 143
2/19/2023
For more information, see Tips and Tricks (ABAP CDS Tools)

Version 3.14
Here is an overview of the most signi cant changes in the context of ABAP CDS development that relate to the following:

Client: ABAP Development Tools (ADT) 3.14

Back end version:  SAP Cloud Platform ABAP Environment 2011

 Note
The following features that are highlighted with '*' are ADT-client-speci c and are therefore available for all supported ABAP
systems.

Adding Alias for "Insert All Elements" in CDS Code Completion Preference
When creating a data de nition, using a database table as data source, and performing Insert all elements or when creating a
data de nition on base of a database table, ADT will generate an alias for each element and add it and the name of the element
in the select statement of the data de nition by default

For more information, see Adding Aliases for Inserted Elements from Database Table

Version 3.12
Here is an overview of the most signi cant changes in the context of ABAP CDS development that relate to the following:

Client: ABAP Development Tools (ADT) 3.12

Back end version:  SAP Cloud Platform ABAP Environment 2008

 Application Server ABAP 7.55 FPS 00 and higher

 Note
The following features that are highlighted with '*' are ADT-client-speci c and are therefore available for all supported ABAP
systems.

In this topic, you can nd release information about:

Creating and Activating Data Models

Documenting Development Objects

Displaying Element Information for CDS Annotations in Source Code Editors

Using Wildcards When Performing Code Completion for CDS Annotations

Creating and Activating Data Models


Creating and Editing CDS View Entities

You can now create and edit the new CDS view entities that provide improved functionalities, such as activation, and so on.

This is custom documentation. For more information, please visit the SAP Help Portal 144
2/19/2023
To do this, you create or edit a data de nition using the define view entity template/statement.

 Recommendation
SAP recommends using CDS view entities instead of CDS DDIC-based view due to technical improvements, such as
performance at activation, and so on.

For more information, see

CDS Views

Creating a Data De nition

Creating ABAP CDS Objects With Reference to Other Objects

When creating, for example, a data de nition, you can now refer to an existing CDS object or database table. This enables you
to insert all elements of a referenced object in your new CDS object to be created.

Referencing at creation is provided in the following creation wizards and source code editors:

Data de nitions: You want to insert all elements from a referenced CDS entity when creating a data de nition.

Note that inserting all elements is only realized for data de nitions.

Access control: You want to protect a CDS entity by creating an access control.

Metadata extension: You want to extend a CDS entity by creating a metadata extension

Service de nition: You want to expose a CDS entity by creating an access control.

For more information, see Creating ABAP CDS Objects With Reference to Other Objects

Documenting Development Objects


Providing Documentation for Data De nitions and Service De nitions

In the context of ABAP CDS development, you can now provide documentation using knowledge transfer documents (KTD) for
data de nitions and service de nitions. This enables you to note details about the development goal of your CDS object for
other ABAP developers of your team.

To create a KTD, choose New Knowledge Transfer Document from the context menu of the relevant CDS object in the Project
Browser.

For more information, see

Documentation of CDS Objects

Knowledge Transfer Documents

Creating Knowledge Transfer Documents

Editing DDL Source Code


Displaying Code Element Information for CDS Annotations in Source Code Editors

The Element Information popup now also displays the

This is custom documentation. For more information, please visit the SAP Help Portal 145
2/19/2023
name of the related main annotation,

related subannotation(s),

enumeration values of CDS annotations, and

technical details.

Sample for displaying technical details

In addition, you can navigate from the main annotation to the element information of the selected subannotation using the
Element Information popup and vice versa.

Sample for navigating from a main annotation to a subannotation using the Element Information popup

These features support you while developing a data model.


This is custom documentation. For more information, please visit the SAP Help Portal 146
2/19/2023
They are available in the source code editors for ...

data de nitions (DDLS),

access controls (DCLS),

metadata extensions (DDLX), and

service de nitions (SRVD).

For more information, see Displaying Code Element Information in Source Code Editors

Using Wildcards When Performing Code Completion for CDS Annotations

You can now use wildcards like the asterisk (*) to limit the list of relevant entries if you do not know the quali ed name of the
annotation when performing code completion for access controls, service de nitions, and metadata extensions.

For more information, see Code Completion

Version 3.6
Here is an overview of the most signi cant changes in the context of ABAP CDS development that relate to the following:

Client: ABAP Development Tools (ADT) 3.6

Back end version:  SAP Cloud Platform ABAP Environment 1911

 Note
The following features that are highlighted with '*' are ADT-client-speci c and are therefore available for all supported ABAP
systems.

In this topic, you can nd release information about:

 Extending Data Models Using Metadata Extensions

 Tuning Access to SAP HANA

Using Wildcards for Code Completion in the CDS Source Code Editor

Extending Data Models

Extending the Metadata of Data Models

In ABAP environment, you can now also use metadata extensions in the context of ABAP environment.

Metadata extenstions are development objects that are saved in the ABAP Repository and can be transported within your
ABAP system landscape.

You specify metadata extenstions to extend and to adapt the behavior of CDS entities with customer-speci c metadata using
CDS annotations.

This enables you to specify your own annotations in metadata extensions to overwrite metadata used in data de nitions
without causing modi cations. When creating metadata extensions, you can use a set of prede ned code templates.

This is custom documentation. For more information, please visit the SAP Help Portal 147
2/19/2023
For more information, see

Metadata Extensions

Extending the Metadata of Data Models

 Tuning Access to SAP HANA


In ABAP environment, you can now also temporarily store the result of one or more aggregations (for example, sum, min, max,
avg) in a dynamic cache. This avoids repetitive calculations of frequently executed queries, and improves performance.

 Note
To view and manage the dynamic cache con gurations, you can use the Manage Database Cache Configuration app.

For more information, see Creating Dynamic Caches

Editing DDL Source Code


Using Wildcards for Code Completion in the CDS Source Code Editor

You can now use wildcards like the asterisk (*) to limit the list of relevant entries if you do not know the quali ed name of the
identi er.

To bene t from this feature, start typing a character in the CDS source code editor and add the asterisk to complete your
search string. Finally, trigger code completion ( Ctrl + Space ) and takeover the relevant proposal from the code completion
list. The selected nding will then be added.

This is custom documentation. For more information, please visit the SAP Help Portal 148
2/19/2023

Using code completion in the definition and implementation of CDS entities

 Note
Using the asterisk at the leading position is not supported.

If you use several segments within a identi er path, only the asterisk in the last segment is supported.

For more information, see Code Completion

Version 3.4
This is an overview of the most signi cant changes in ABAP CDS development that relate to the following:

Client: ABAP Development Tools (ADT) 3.4

Back end version:  SAP Cloud Platform ABAP Environment 1908

 Note
The following features that are highlighted with '*' are ADT-client-speci c and are therefore available for all supported ABAP
systems.

 Tuning Access to SAP HANA


This is custom documentation. For more information, please visit the SAP Help Portal 149
2/19/2023

Creating Dynamic Caches

In ABAP environment, you can now also temporarily store the result of one or more aggregations (for example, sum, min, max,
avg) in a dynamic cache. This avoids repetitive calculations of frequently executed queries, and improves performance.

 Note
To get an overview of the dynamic caches that are created for a database table, you can use transaction
S_DBCACHE_CONFIG in the back-end.

 To view and manage the dynamic cache con gurations, you can use the Manage Database Cache Con guration app.

For more information, see Tuning Access to SAP HANA

Version 3.0
Here is an overview of the most signi cant changes in the context of ABAP CDS development that relate to the following:

Client: ABAP Development Tools (ADT) 3.0

Back end version:  SAP Cloud Platform ABAP Environment 1902

 Note
The following features that are highlighted with '*' are ADT-client-speci c and are therefore available for all supported ABAP
systems.

 Ensuring Quality with ABAP Unit


In the context of ABAP environment, you can now also use ABAP CDS Test Double Framework and ABAP SQL Test Double
Framework for CDS entities and ABAP classes respectively. These frameworks allow you to replace data sources with test
doubles in an ABAP Unit test so that the object under test accesses the test double instead of the actual component.

For more information, see

Managing Database Dependencies with ABAP Unit

ABAP CDS Test Double Framework

ABAP SQL Test Double Framework

This is custom documentation. For more information, please visit the SAP Help Portal 150

You might also like