ABAP Keyword Documentation → ABAP − Reference → Processing External Data → ABAP Database Access → ABAP-Managed Database Objects → Access to ABAP-Managed Database Objects
ABAP SQL Access to ABAP-Managed Database Objects
ABAP SQL includes a set of ABAP SQL statements for use in ABAP programs. The database is accessed using the ABAP SQL interface of the database interface, which transforms the ABAP SQL statements into platform-specific SQL.
ABAP SQL can be used to access ABAP-managed database objects as follows:
- Reads and writes on database tables and classic database views defined in ABAP Dictionary. Writes on database views are only possible with restrictions.
- Reads on the database objects of CDS views, CDS table functions, and CDS hierarchies. When a CDS table function is accessed, the associated AMDP table function is called internally and its result is provided as the results set of the ABAP SQL statement.
The most important ABAP SQL features are as follows:
- ABAP SQL is to a great extent platform-independent
- ABAP SQL is based on the data types defined in ABAP Dictionary and any enhancements made to them:
- ABAP SQL respects the order of fields defined in ABAP Dictionary, since this can differ from the order in the database.
- ABAP SQL checks the compatibility of host variables with the associated dictionary types or database types.
- ABAP SQL enables conversions to be made between ABAP types and platform-specific data types in accordance with uniform ABAP-specific rules.
- ABAP SQL has its own handler for null values.
- ABAP SQL supports the following ABAP Dictionary and ABAP CDS functions:
- Evaluating CDS access control
- Enhancement categories are respected
- ABAP SQL uses the name of a CDS entity to access the entity and respects all relevant attributes. Access to CDS database views is obsolete and forbidden in strict mode from Release 7.50.
- Implicit client handling is applied in accordance with how client dependency is defined using the relevant annotations in the DDL source code.
- The CDS roles mapped to the CDS entity are evaluated.
- The key fields defined in the CDS entity are respected.
- Actual parameters can be associated with the input parameters of a CDS entity in uniform syntax.
- SQL path expressions can be specified for CDS associations.
- When ABAP SQL is used to access a CDS hierarchy, the additional hierarchy columns can also be read.
- All session variables are set correctly
on all platforms when ABAP SQL is used to access a CDS view. More specifically, the addition
USING CLIENT
modifies the session variable client.
- When ABAP SQL is used to access a CDS table function, the access is transformed to the associated AMDP table function.
- Database objects specified statically in ABAP SQL are recorded in the where-used list in ABAP tools. Each time an ABAP-managed database object is modified it is advisable to record it in the where-used list. In this way, any consequences of modifying the object can be checked.
- ABAP SQL enables dynamic tokens to be specified that are evaluated at runtime of an ABAP program.
- DDL statements are not included in the scope of ABAP SQL. The respective ABAP-managed database objects cannot be modified in ABAP SQL and no other database objects can be created or modified.
- ABAP SQL does not support secondary connections or service connections.
- ABAP SQL respects the dependency rules defined for a database.
- ABAP SQL respects data aging by default.
Other versions:
7.31 | 7.40 | 7.54
Note
Some of the semantic attributes defined in ABAP Dictionary or ABAP CDS, such as foreign key relationships or reference fields, are ignored in ABAP SQL and are respected only by classic Dynpros, Web Dynpros, and some other frameworks. This applies in particular to the evaluation of framework-specific annotations in ABAP CDS as well.