ABAP for Cloud Development
AS ABAP Release 914, ©Copyright 2024 SAP SE. All rights reserved.
ABAP - Keyword Documentation → ABAP Core Data Services (ABAP CDS) → ABAP CDS - Data Definitions → ABAP CDS - DDL for Data Definitions → ABAP CDS - CDS Entities →
ABAP CDS - External Entities
A CDS external entity is defined in the DDL source code of a CDS data definition in the ABAP development tools for Eclipse using the statement DEFINE EXTERNAL ENTITY
. A CDS external entity is a persistent entity that can be used to access data from external database systems within the AS ABAP. The external systems can be other SAP HANA or non-SAP HANA database systems. The properties of the connection between an external entity and the external system are configured using a logical external schema. The connection is managed using SAP HANA Smart Data Access. Currently, only dynamic external entities are available.
A CDS external entity includes the following:
- The CDS entity
- A CDS external entity is declared as a CDS entity
external_entity
using the statementDEFINE EXTERNAL ENTITY
. As a global data type, the CDS entity represents a structured type with the elements of the CDS external entity as components and can be used as follows: - In ABAP, the CDS entity can be used as a data type and in ABAP SQL read statements. The addition
PROVIDED BY
for specifying a logical external schema at runtime is mandatory for dynamic external entities. - Dynamic external entities cannot be used as data source for other CDS entities.
- A CDS external entity cannot be used as a data type for definitions of dictionary objects.
- A CDS external entity is located in the namespace of all global types of an AS ABAP.
- A CDS logical external schema that maps the external entity to a specific physical external system or database, and to a specific database schema in such a remote system. A logical external schema is represented by a transportable repository object and it must be configured for the connection to work. For more details, see the topic ABAP CDS - CDS Logical External Schema.
Currently, only dynamic external entities are available. A dynamic external entity does not specify a logical external schema in its data definition, but uses the addition PROVIDED AT RUNTIME
instead. The logical external schema for a dynamic external entity must be specified as a part of the ABAP SQL SELECT
statement when the external entity is accessed, using a PROVIDED BY
clause. Dynamic external entities can only be accessed by ABAP SQL; they cannot be used as a data source for other CDS entities.
When accessing client-dependent external entities, an implicit filtering to the ID contained in the SAP HANA session variable CDS_CLIENT
is applied. The value of the ID is defined in the logical external schema.
Table buffering with a CDS entity buffer is currently not supported for external entities.
Hints
- Releasing CDS external entities or logical external schemas as a released API is not supported.
- Extending a CDS external entity using a CDS entity extension is currently not supported.