SAP CDS V1 BUFFERING



Get Example source ABAP code based on a different SAP table
  



ABAP_CDS - Table Buffering of CDS DDIC-Based Views
The following CDS annotations can define table buffering for a CDS view linked with a ABAP_CDS_MNG_VIEW :
@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 associated ABAP_CDS_MNG_VIEW and the same prerequisites apply as for DDIC database views in ABAP Dictionary. To meet these prerequisites, a CDS view can only be buffered if the following applies:
It cannot contain any views
BEGIN_SECTION VERSION 5 OUT (DDIC database views or CDS views)
END_SECTION VERSION 5 OUT and no CDS table functions as data sources.
It cannot have any input parameters.
A client-dependent 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 client-independent 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.
No database tables can be accessed where data aging is enabled.
Only the key fields of the ABAP_CDS_MNG_VIEW are respected in SAP buffering of ABAP_CDS_MNG_VIEWS . Since ABAP_RELEASE 7.90, the key fields of the CDS entity and the ABAP_CDS_MNG_VIEWS are identical by default.



Latest notes:

In client-dependent views, the client column must be explicitly included or added to the number in the specification for the annotation @AbapCatalog.buffering.numberOfKeyFields.
For CDS view entities, table buffering is defined directly for the CDS entity. A client column is not counted as a key field here.
In contrast to table buffering of CDS view entities, where the prerequisites are real restrictions for the view, for DDIC-based views that do not meet the prerequisites buffering is bypassed implicitly by ABAP SQL.
NON_V5_HINTS
ABAP_HINT_END

ABAP_EXAMPLE_VX5
Enables full buffering for a CDS view. @AbapCatalog.sqlViewName: '...'
@AbapCatalog.Buffering.status: #ACTIVE
@AbapCatalog.Buffering.type: #FULL
define view ...
as select from ...
{ ... }
ABAP_EXAMPLE_END