SAP CDS DATA SOURCE MATRIX



Get Example source ABAP code based on a different SAP table
  



ABAP_CDS - Data Source Matrix
The following tables show all possible data sources of all available CDS entities:
Direct data sources defined after FROM.
Association targets of CDS associations.
Association targets of CDS compositions .
Content:
ITOC

Data Sources After FROM
The following table lists all available CDS entities and which data sources they accept after FROM, both directly and joined via a join.
ABAP_NOTE ABAP_CDS_V2_VIEWS and ABAP_CDS_V1_VIEWS can define a join between two data sources. The data sources that can be specified directly after FROM and by means of a join are the same. There is no difference. lbr CDS entity/FROMCDS view entity CDS transactional interface CDS table functionCDS hierarchy CDS DDIC-based viewDDIC database table DDIC database view DDIC external view
lbr CDS view entity x- x x xx--
lbr CDS transactional query xx--x---
lbr CDS transactional interface x---x---
lbr CDS analytical projection viewx---x---
lbr CDS hierarchyx--- x---
lbr CDS DDIC-based viewx-x x xxxx
CDS table functions, CDS custom entities, and CDS abstract entities do not specify any data source. They do not have a FROM clause.
CDS custom entities and CDS abstract entities cannot be used as data source of another CDS entity.
CDS projection views can generally not be used as data source of another CDS entity. There is only one exception: A projection view of type transactional query can have a projection view of type transactional interface as data source.
CDS projection views can have ABAP_CDS_V2_VIEWS or ABAP_CDS_V1_VIEWS as data source. This applies to all provider contracts. There are some special rules for certain provider contracts:
For CDS transactional interfaces and CDS transactional queries, the data source must be part of a RAP business object. This means it must either be a CDS root entity itself, or be part of a CDS composition tree which includes a root node.
For projection views of provider contract ANALYTICAL_QUERY, the data source must be an analytical cube view or an analytical dimension view.

Association Targets of CDS Associations
The following table lists all CDS entities that can define CDS associations and shows which other entities they accept as association target.
ABAP_NOTE The table is only about defining associations and not about exposing associations. lbr CDS entity/association targetCDS view entity CDS projection view CDS table functionCDS hierarchy CDS custom entity CDS abstract entity CDS DDIC-based viewDDIC database table DDIC database view DDIC external view
lbr CDS view entity x xxxxxxx--
lbr CDS transactional query x xxxxxxx--
lbr CDS custom entityx-xxxxxxx-
lbr CDS abstract entityx-xxxxxxx-
lbr CDS DDIC-based viewx-xxxxxxxx
In CDS table functions and CDS hierarchies, associations cannot be specified. Therefore, they are not listed here.
A CDS entity can define itself as association target. Self-associations are generally supported. They are mainly relevant for CDS hierarchies.
CDS projection views with provider contract ANALYTICAL_QUERY and TRANSACTIONAL_INTERFACE cannot define associations. This table applies only to CDS projection views of type TRANSACTIONAL_QUERY and to projection views without provider contract (not recommended).

Association Targets of CDS Compositions
The following table lists all CDS entities that can define CDS compositions and shows with which entity they can be connected via a parent-child relationship by means of CDS compositions. lbr CDS entity/composition of or to-parent associationCDS view entity ,CDS custom entity CDS abstract entity CDS DDIC-based view
lbr CDS view entity xxxx
lbr CDS custom entity xxxx
lbr CDS abstract entity xxxx
lbr CDS DDIC-based view xxxx
CDS hierarchies and CDS table functions cannot define CDS composition relations.
CDS projection views can expose and redirect compositions. The association target of a redirected composition must be another CDS projection view. However, a CDS projection view cannot define any new composition.