CDS View Association – Part-2

light111CDS View Association – Part2


 In the earlier post- CDS View Association – Part-1 mostly it tells about cardinality [1..1] . Here let’s see with 1 to Many cardinality.

Below CDS view with data source SCARR and association source SPFLI is basically 1 to Many relationship. Expose the association SPFLI.

1

Make data preview. All records from source are displayed.

2

Select one record and navigate to the association _spfli.

3

It displays all matching records from SPFLI data source (association) with key as – AA

4

Similarly we can select LH and see the association data source details.

5

6


Open the SQL console and here we can see the PATH Expression [ ]  – to access fields from the association.

7


The report SQL on CDS view to access records from:

1-> only from source

2-> Both from source and association

3->only from association

4-> only from association with WHERE condition(s).

891011121314


Below is the CDS with association and ON condition contains multiple JOIN fields with AND condition.

15

make data preview and navigate  to the association .

1617

Data from association.

18


Now will test a multi level association.

Below is the CDS view with association from SCARR to SPFLI. The association _SFLIGHT is exposed.

15

Below is the CDS view with association where the source data is a table SCARR and the association data source is the CDS view. The association data source is exposed.

19

Test the data source of CDS view- ZTEST_CDS_017 . All SCARR records are displayed.

20

From the the association is another view – ZTEST_CDS_016 . Navigate to the association.

21

In the association ZTEST_CDS_016 the select list includes fields from SPFLI and it has association SFLIGHt. 

22

It shows the details of SPFLI and it has exposed association to SFLIGHT. Navigate to the association.

23

Here is SFLIGHT details. So started from SCARR -> Via Association to SPFLI-> Via Association to SFLIGHT.

2425


Below is a cds view where multiple association are linked from the data source.

26

From source to associations are linked. Navigate to the first association.

2728

Navigate to the second association.

2930


Below CDS view is having multiple association with different cardinality.

From Sales order header to Customer is [1..1] and sales order header to sales order items having[0..*] cardinality.

31323334


 

Advertisements

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 )

Google photo

You are commenting using your Google 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