The ABAP Core Data Services (ABAP CDS) are the implementation of the general CDS concept for AS ABAP. ABAP CDS makes it possible to define semantic data models on the central database of the application server. On AS ABAP, these models can be defined independently of the database system. The entities of these models provide enhanced access functions when compared with existing database tables and views defined in ABAP Dictionary, making it possible to optimize Open SQL-based applications. You can find more information on ABAP CDS from help documentation.
As ABAP CDS supports many advanced features like Union , Association , expression etc, it will be apt if there is an easy way to preview the result of CDS views defined using these features. This is supported by Data Preview in AiE which contains most of feature as SE 16 and other cool features as well. Detailed information about Data Preview can be found here .
In NW AS ABAP 740 SP08 with ADT 2.31 , the support to visualize the association on ABAP CDS is implemented. .
In order to showcase the Data Preview feature, we use the DDL source example about the usage of associations mentioned in the keyword documentation.
Here two associations are defined. The initial data source in each case is the first database table snwd_so_inv_head after FROM.
- buyer stands for a join between snwd_so_inv_head and the target data source snwd_bpa.
- invoice_items stands for a join between snwd_so_inv_head and the target data source snwd_so_inv_item.
Open Data Preview
One can open Data Preview by right click inside the ABAP CDS source editor and choose open with-> Data preview option
or right click on the ABAP CDS from the project explorer and choose Open Data Preview. Even, Data preview can be opened by executing the ABAP CDS View ( Pressing F8 ).
Data Preview Editor
After selecting the option “Open Data Preview” , it will open an editor as shown below .
The breadcrumb at the top of the data preview is used to display the cds view name. If CDS view contains any association and mentioned in the projection list, those associations will be displayed by clicking arrow on the left of the cds view name.
Since sales_order_invoice_header contains an association “invoice_items” and included in the projection list, it will be displayed on clicking the arrow as shown below.
The same can be visualized by selecting the row in the table and right click and chose “Follow Associations” .
The list gives information about the association name , target and cardinality . Here the association name is invoice_items , target is snwd_so_inv_item and the cardinality is [ 1.. * ] which is defined in ABAP CDS view.
Follow Association for given Item
In order to follow the association for a given item , select the desired row from the table and choose the association to navigate to the target view/table for the selected item.The breadcrumb will display the complete path of navigation from the source after selecting the association from the list.One can go back to any level in the path by simply selecting the corresponding node in the bread crumb and follow different path or perform the same for different item in the table.