ABAP CDS on HANA-16

cds Navigating to association in Data Preview

 

 

 

The post describes how to display the content of the association in the data preview of the CDS view.

Create a CDS view on the table SCARR & add all columns in the selection marking the key field.

1

Data preview & all records appear perfectly.

2


Now create a new CDS view on the table SPFLI table with association on the previous cds view Ztest_Scarr with cardinality 0..1. In the selection list no fields of the association is added explicitly but the entries alias _Scarr of the view Ztest_Scarr is added.

3

Data preview. So all the seelcted fields of SPFLI appear in the preview. Now to see the association, select a line and from the header arrow you can navigate to the association.

4

It displays the result from the association view.

5

Another way to navigate to the associated view is to right click on the record and from the options Follow Association can enable to view the association data in  the preview.

6

Choose the association.

7

Here is the data preview

8


Now lets create a new CDS view on the table SFLIGHT with selected fields and marking the key fields.

9

Data Preview.

10


Now lets use the view Ztest_Sflight in the already created view Ztest_Spfli as an association with cardinality as [0..*]. No fields selected from the association Ztest_Sflight but the association alias name it self added in the selection so that it can be used in some other view to added fields from the association using path expression.

11

Do a data preview. Select one line and right click , chose Follow Association.

12

Here we have two association one with cardinality [0..1] for Ztest_Scarr and second with cardinality [0..*] for Ztest_Sflight. Choose the _Sflight association.

13

All the matching records with key carrid- AA & connid- 0017 displayed in the data preview from the association Ztest_Sflight.

14


 

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s