SAP CDS CLIENT HANDL V1 ABEXA



Get Example source ABAP code based on a different SAP table
  


VX_EXA_ONLY

ABAP_CDS_V1_VIEWS , Client Handling
This example demonstrates how client-dependent ABAP_CDS_V1_VIEWS are handled.

ABAP_SOURCE_CODE
ABAP_EXEC

ABAP_DESCRIPTION
The program accesses the following CDS views:
DDLS DEMO_CDS_SPFLI_CLIENT_0
DDLS DEMO_CDS_SPFLI_CLIENT_1
The view DEMO_CDS_SPFLI_CLIENT_0 is a regular client-dependent ABAP_CDS_V1_VIEW in which the client column is not specified in the SELECT list. The ABAP_CDS_V1_VIEW DEMO_CDS_SPFLI_CLIENT_1 is used to demonstrate the behavior in rare cases where the client column is specified in the SELECT list of a client-dependent CDS view.
RTTI is used to read the components of the associated data types:
The structure of the client-dependent CDS entity without client column in the SELECT list does not have a client column.
The ABAP_CDS_MNG_VIEW of the client-dependent ABAP_CDS_V1_VIEW without client column in the SELECT list has a client column.
Nevertheless, the structure of the client-dependent CDS entity with client column in the SELECT list does not have a client column.
The ABAP_CDS_MNG_VIEW of the client-dependent ABAP_CDS_V1_VIEW with client column in the SELECT list has a client column.
The statement SELECT is used to make the following accesses:
Regular access to a client-dependent CDS entity without client column in the SELECT list. The data from the current client is read. The result set does not have a client column.
Regular access to a ABAP_CDS_MNG_VIEW of the client-dependent CDS entity without client column in the SELECT list. The data from the current client is read. The result set has a client column.
Access to a client-dependent CDS entity without client column in the SELECT list using the obsolete addition CLIENT SPECIFIED. The data of the client specified in the WHERE condition is read. A name myclient must be defined for this. The result set has a client column with this name.
Regular access to a ABAP_CDS_MNG_VIEW of the client-dependent CDS entity with client column in the SELECT list. The data from the current client is read. The result set does not have a client column.
The similar program DEMO_CDS_CLIENT_HANDLING_SV accesses CDS views in which the annotation @ClientHandling.algorithm: #SESSION_VARIABLE is used instead of @ClientHandling.algorithm: #AUTOMATED. The results are shown in exactly the same way as here, however access using the obsolete addition CLIENT SPECIFIED is not possible since the session variable $session.client is evaluated implicitly in the views.



Latest notes:

The accesses to the ABAP_CDS_MNG_VIEWS of ABAP_CDS_V1_VIEWS shown here are for demonstration purposes only. This way of accessing ABAP_CDS_V1_VIEWS is obsolete and only the CDS entities should now be accessed.
ABAP_HINT_END