ABAP Keyword Documentation → ABAP - Dictionary → ABAP CDS in ABAP Dictionary → ABAP CDS - Data Definitions → ABAP CDS - Views
ABAP CDS - Table Buffering of CDS Views
For a CDS view in ABAP CDS, the following CDS annotations can be used to specify how table buffering works:
- @AbapCatalog.buffering.status defines whether and how table buffering is allowed.
- @AbapCatalog.buffering.type determines the buffering type.
- @AbapCatalog.buffering.numberOfKeyFields determines the number of key fields covered if generic buffering is used.
Table buffering of CDS views is done for the CDS database view derived from the data definition of the CDS view, and the same prerequisites apply as for classic database views. To meet these prerequisites, a CDS view can only be buffered if the following applies:
- It cannot contain any views
(database views or CDS views) and no CDS table functions as data sources.
- It cannot have any input parameters.
- A client-specific view can use $session.client as the only session variable and must use it directly. This also allows the annotation @ClientHandling.algorithm:#SESSION_VARIABLE to be specified to determine client handling. A cross-client view must not use any session variables.
- Key fields cannot contain null values.
- The required key fields must be listed directly in the SELECT list. Key fields that only occur as arguments of expressions cannot be evaluated.
Only the key fields of the CDS database view are respected in SAP buffering of CDS database views. By default, these are not the key elements of the CDS entity defined using KEY (unless the value true is specified for the view annotation AbapCatalog.preserveKey.
Other versions:
7.31 | 7.40 | 7.54
Note
In client-specific views, the client column must be explicitly included or added to the number in the specification for the annotation @AbapCatalog.buffering.numberOfKeyFields.
Example
Enables full buffering for a CDS view.
@AbapCatalog.Buffering.status: #ACTIVE
@AbapCatalog.Buffering.type: #FULL
define view ...
as select from ...
{ ... }