CDS View- Client Dependency

light111Client Dependency in CDS Views


The CDS view can be made client dependent/client independent which basically depends on the CDS view data  source. The new annotation @ClientHandling.type should be used instead of the old annotation @ClientDependent.

The annotation @ClientHandling.type value can be:

#INHERITED – If one of the data source is client dependent then the CDS view is client dependent. If all the data sources are client independent then the CDS view is client independent.

#CLIENT_DEPENDENT- If at least one data source is client dependent, then CDS view is client dependent else results in error.

#CLIENT_INDEPENDENT – All the data sources must be client independent , then CDS view is client independent else results in error.


Below is the CDS view with client handling annotation set as – @ClientHandling.type: ##INHERITED . The data source SPFLI is client dependent, so the CDS view is client dependent.

1

The MANDT field added to the SQL view.

2

The data source – SPFLI DB table is client dependent.

3

Preview the CDS view and it brings 27 records from the current client in which it executed. The CDS result list didn’t include the CLIENT field. Go to the SQL console.

4

This SQL query on CDS entity is executed and brings 27 records .

5

In the query it self- ” CLIENT SPECIFIED” can be added which brings records from all the clients but in the result set CLIENT field is not added.

6

If  CLIENT field to be added in the result set then the below part must be added after CLIENT SPECIFIED .

7

Now lets consume this CDS view in ABAP report SQL Query.

8

9

It brings records from current client. In result structure/table  there is no CLIENT field.

10

With CLIENT SPECIFIED the result set includes records from all the clients and result  includes CLIENT field.

11

With CLIENT SPECIFIED and CLIENT field specified, the result set includes records from all the clients and also where condition can be applied on the CLIENT field.

12


If client handling type- #CLIENT_DEPENDENT  then at least one of the data source must be client dependent.

13

If client handling type- #CLIENT_INDEPENDENT  then all the data source(s) must be client independent. But here we have client dependent data source and it leads to activation error.

14


 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s