SAP - ABAP CDS Development User Guide
SAP - ABAP CDS Development User Guide
SAP - ABAP CDS Development User Guide
PUBLIC
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.
This is custom documentation. For more information, please visit the SAP Help Portal 1
2/19/2023
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.
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:
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:
SAP NetWeaver AS for ABAP 7.51 innovation package 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
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.
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:
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.
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 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.
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.
Value Description
Example
@Metadata.layer: #CUSTOMER
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.
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.
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
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
Related Information
ABAP CDS in ABAP Dictionary (ABAP Keyword Documentation)
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.
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
}
Example
CLASS cl_demo_access_cds_entity IMPLEMENTATION.
...
METHOD get_data.
ENDMETHOD.
...
ENDCLASS.
Help Content
The following tools documentation is provided for the relevant types of CDS 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.
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.
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
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
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
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.
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)
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.
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
Use
CDS custom entities are used for data models whose runtime is implemented manually.
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 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)
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.
Related Information
ABAP CDS - Abstract Entities (ABAP Keyword Documentation)
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:
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 ...
You add a template to your source code or CDS object to be created by ...
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
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.
Data sources used in from clauses, joins, and as targets of associations/compositions, including details about their
elements
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
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
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.
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
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.
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
This is custom documentation. For more information, please visit the SAP Help Portal 16
2/19/2023
add new elements or CDS annotations to a CDS view from its underlying data source or
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
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
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
${data_source_name}: Name of the data source from which you want to add new elements to the CDS view
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.
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.
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.
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:
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 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
Use
You use a KTD to provide documentation for the following CDS objects:
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
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.
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
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.
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:
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.
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.
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)
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.
Edit the source code of the access control just as you would data de nition source code.
Quick xes
Check the syntax of access controls just as you would check the syntax of data de nitions.
Related Information
Creating Access Controls
Editing DDL Source Code
Checking Syntax of DDL Source Code
Activating Data De nitions
Access Controls
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.
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.
7. Choose Next.
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
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.
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
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:
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 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 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 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 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.
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
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.
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 ).
Example for displaying and selecting the available templates for data definitions
Tip
Alternatively, you can use the Templates view to insert the code template in the DDL editor using drag & drop.
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.
Related Information
Creating and editing templates
Java Editor Template Variables
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.
3. In addition to the Project and Package, enter the Name and the Description for the data de nition to be created.
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.
7. Choose Next.
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
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:
b. Choose the icon (Activate the ABAP Development Object) in the toolbar.
Tip
Alternatively, you can use the shortcut Ctrl + F3 .
a. Select the node of the relevant data de nition in the ABAP project in the Project Explorer.
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
Context
You want to get further details about impact of your changes, for example, in case of errors at activation.
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
2. For example, for an activation issue from the context menu in the DDL editor, select the corresponding function in the
context menu:
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
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.
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 ( @ ).
Prerequisites
In advance, you can de ne your speci c ABAP repository tree that contains the data de nitions to be converted.
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.
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 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:
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.
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.
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
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
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:
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
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.
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.
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.
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)
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:
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.
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.
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.
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
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
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.
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
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
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: ''
}]
}]
}
Procedure
1. Open the ABAP Development Editors Source Code Editors CDS Code Completion Preferences page.
Flat
Structured
Results
If you choose ...
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
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.
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
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.
This is custom documentation. For more information, please visit the SAP Help Portal 45
2/19/2023
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.
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.
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.
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).
5. You can display information about the append structures that are generated when the CDS entity is extended with an
extend view.
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.
7. You can increase/reduce font size in the Element Info popup / Element Information view.
8. You can search within the Element Information popup / Element Information view.
c. To navigate within the search results, choose one of the following shortcuts, icons, or keys:
F2 to navigate to the selected search result within the Element Information popup
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
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
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.
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.
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.
Related Information
Opening Development Objects
Description Effect
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.
c. In the list of possible quick xes, double-click the relevant quick x function.
b. In the list of possible quick xes, double-click the relevant quick x function.
a. In the DDL editor, position the cursor where the error occurs and is highlighted.
You can also use the following shortcuts for comments in the DDL editor:
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
Note
Alternatively, you can access the comments functions using the context menu entries of the DDL source editor ( Source
Add Comment... )
Context
You want to get a clear overview, for example, of the elds in a define view statement from which you can select data.
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
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.
3. Select the text type you want to change and click the Edit... button.
Remember
To restore the default color settings, click the Restore Defaults button.
Results
The new color settings become immediately effective in the corresponding editor.
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.
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.
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
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
This is custom documentation. For more information, please visit the SAP Help Portal 54
2/19/2023
Break
before
AND / OR
This is custom documentation. For more information, please visit the SAP Help Portal 55
2/19/2023
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.
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
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.
2. In the Active pro le section, select the relevant pro le from the dropdown listbox of .
If your IDE contains several ABAP projects, the Project Selection dialog is opened. Choose the relevant project.
Note
For further information about the displayed settings, see the Related Information section below.
Results
Your changes are saved and will be considered the next time the DDL formatter is executed.
Related Information
Creating a Pro le
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.
4. Choose Open.
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.
Related Information
Exporting Local Pro les
Procedure
1. Open the ABAP Development Editors Source Code Editors DDL Formatter preference page.
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.
Results
The XML le is created and saved in the selected le location.
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
Context
With the editor check function, you can check whether the source code of DDL source code is syntactically correct or not.
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.
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.
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
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.
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)
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
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:
Related Information
CDS Views Extension
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.
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,
Related Information
CDS Views Extension
Viewing Generated SQL Statements
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.
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.
You have the following possibilities to create and work with metadata extensions:
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
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.
7. Choose Next.
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
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.
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.
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.
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.
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
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
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
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.
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
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
b. Choose OK.
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
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.
Note
You can also choose > in the breadcrumb bar to follow an association.
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.
Prerequisites
You have added ABAP packages required for your work in the favorite list. For information, see Adding a Favorite
Package.
Procedure
1. In the Project Explorer view, choose the ABAP project.
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.
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
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.
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.
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.
Availability of features
Activation Ctrl + F3
Deleting
Standard
Duplicating
Editing
Search
Where-Used Search Ctrl + Shift + G
Convenience
Formatting Shift + F1
Navigation F3
Outline
Syntax Highlighting
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
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.
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
This is custom documentation. For more information, please visit the SAP Help Portal 77
2/19/2023
1. From the Project Explorer, select the behavior de nition you want to document. Use the context menu to create a
knowledge transfer document.
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
Related Information
Knowledge Transfer Documents
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
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.
5. Choose Next.
7. Choose Next.
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
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.
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.
5. Choose Next.
7. Choose Next.
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
Prerequisites
You need the standard developer authorization pro le to create ABAP development objects.
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.
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
7. Choose Next.
9. Choose Finish.
Restriction
CDS view with parameters that have simple types are not supported.
Related Information
Business Service
Service Binding
Availability of features
Features Availability
Version History
Version Compare
Related Information
Creating Service Binding
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.
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.
This is custom documentation. For more information, please visit the SAP Help Portal 85
2/19/2023
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.
This is custom documentation. For more information, please visit the SAP Help Portal 87
2/19/2023
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
This is custom documentation. For more information, please visit the SAP Help Portal 88
2/19/2023
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
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 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.
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
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.
6. Choose Next.
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)
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.
8. Choose Next.
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
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
Prerequisites
This function affects the CDS view in the currently opened editor.
Context
You can use the ON conditions wizard when de ning:
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).
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.
This is custom documentation. For more information, please visit the SAP Help Portal 93
2/19/2023
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:
Name
Dictionary type
Built-in type
$parameter
$projection
data source
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)
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.
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
The Active Annotations view for the SEPM_I_SalesOrderItemCube data de nition provides the following information:
1. Integrated toolbar
3. Entity annotations
7. Data source where the annotation value is inherited from, and in brackets its object type
9. Associations
Related Information
Displaying Annotation Values of an Active CDS 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
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 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
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.
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:
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
Note
This value is used SAP-internally only to implement the precedence of the annotations speci ed in 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 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
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:
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
SQL Relation: How a database object may be related to its parent object.
Example
The following relations might be displayed:
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
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.
[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
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
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.
Object type
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.
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.
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 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.
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
Metadata Extension
ABAP development object that is used to annotate CDS entities with metadata without modi cations.
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:
Error Handling
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)
This is custom documentation. For more information, please visit the SAP Help Portal 107
2/19/2023
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:
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
Access Controls
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
This is custom documentation. For more information, please visit the SAP Help Portal 108
2/19/2023
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.
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
Note
SAP provides several templates for different types of CDS entities.
underlying (for example, referenced) object, which de nes what can be created
at the current position.
This is custom documentation. For more information, please visit the SAP Help Portal 110
2/19/2023
Creating ABAP CDS code templates You can create your own templates ...
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.
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).
This is custom documentation. For more information, please visit the SAP Help Portal 111
2/19/2023
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
This is custom documentation. For more information, please visit the SAP Help Portal 112
2/19/2023
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.
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.
Note
This wizard also enables you to ...
This is custom documentation. For more information, please visit the SAP Help Portal 113
2/19/2023
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.
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).
This is custom documentation. For more information, please visit the SAP Help Portal 114
2/19/2023
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 .
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
After insertion, use the Tab to navigate to the placeholders which need to be modi ed.
This is custom documentation. For more information, please visit the SAP Help Portal 115
2/19/2023
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 .
Alternatively, you can also hide the comments and/or annotations by choosing Hide
Comments or Hide Annotations in the vertical ruler of the editor.
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
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
Sample for expanding the Core Data Services folder by the source type
Source Type
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
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
Sample of an ABAP repository tree displaying the source type tree for service definitions in the
Project Explorer
This is custom documentation. For more information, please visit the SAP Help Portal 119
2/19/2023
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 .
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
You can also modify the settings in Window Preferences... General Editors Text
Editors Accessibility to modify the appearance of your IDE.
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.
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
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
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
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
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.
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.
This is custom documentation. For more information, please visit the SAP Help Portal 125
2/19/2023
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.
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
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.
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
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
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
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.
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.
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
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.
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
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.
This is custom documentation. For more information, please visit the SAP Help Portal 131
2/19/2023
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.
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
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.
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
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.
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.
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:
Back-end version(s):
Note
The following features that are highlighted with '*' are ADT-client-speci c and are therefore available for all supported ABAP
systems.
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
Source Type
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
Sample of an ABAP repository tree displaying the source type tree for service definitions in the Project Explorer
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
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
To open the creation wizard, choose New Other... Core Data Services Type from the menu.
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:
Back-end version(s):
Note
The following features that are highlighted with '*' are ADT-client-speci c and are therefore available for all supported ABAP
systems.
To de ne ON conditions, edit the ABAP CDS source code in den relevant data de nition editor.
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:
Back-end version(s):
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:
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.
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:
Back-end version(s):
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
Bufferable
Buffered
Type
Note
If the type is linked, you can navigate to the CDS entity buffer that de nes the respective settings.
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:
Back-end version(s):
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.
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.
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:
Back-end version(s):
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.
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:
Note
The following features that are highlighted with '*' are ADT-client-speci c and are therefore available for all supported ABAP
systems.
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:
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:
Note
The following features that are highlighted with '*' are ADT-client-speci c and are therefore available for all supported ABAP
systems.
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.
CDS Views
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
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.
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),
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
For more information, see Displaying Code Element Information in Source Code Editors
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.
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:
Note
The following features that are highlighted with '*' are ADT-client-speci c and are therefore available for all supported ABAP
systems.
Using Wildcards for Code Completion in the CDS Source Code Editor
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
Note
To view and manage the dynamic cache con gurations, you can use the Manage Database Cache Configuration app.
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
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.
Version 3.4
This is an overview of the most signi cant changes in ABAP CDS development that relate to the following:
Note
The following features that are highlighted with '*' are ADT-client-speci c and are therefore available for all supported ABAP
systems.
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.
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:
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 150