In SAP CDS (Core Data Services), when you create a CDS view in ABAP, two different names are involved: the CDS view name (the logical name in the ABAP layer) and the @AbapCatalog.sqlViewName (the technical name of the corresponding SQL view in the database).
The CDS view name is the ABAP-level name used within the ABAP environment. It’s the name you use to reference the CDS view in ABAP programs, in other CDS views, or in tools like ADT (Eclipse). It represents the semantic model and is part of the ABAP repository.
On the other hand, @AbapCatalog.sqlViewName defines the technical name of the SQL view that gets created in the underlying database when you activate the CDS view. This SQL view acts as a bridge between the ABAP dictionary and the actual database. The SQL view is stored in the database and can be accessed using standard SQL statements if needed.
In simple terms:
The CDS view name = used in the ABAP layer (semantic name for CDS).
The
sqlViewName= used in the database layer (technical name for DB view).
For example:
@AbapCatalog.sqlViewName: ‘ZEMP_SQL’
@EndUserText.label: ‘Employee CDS View’
define view ZCDS_Employee as select from zemployee {
key emp_id,
emp_name,
emp_dept
}
Here, ZCDS_Employee is the CDS view name (used in ABAP), while ZEMP_SQL is the SQL view name (created in the database).
Key Differences Summary
| Aspect | @AbapCatalog.sqlViewName | CDS View Name |
|---|---|---|
| Layer | Database layer | ABAP layer |
| Purpose | Technical representation of CDS view in DB | Logical/semantic name in ABAP |
| Naming rule | Max 16 characters | Up to 30 characters |
| Created in | Database | ABAP Dictionary |
| Usage | Used in SQL tools or DB access | Used in ABAP programs or other CDS views |
| Example | ZEMP_SQL | ZCDS_Employee |