cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Extend nested standard CDS-Views

lukasmetzger
Participant
0 Kudos
1,043

Hi everyone,

I would like to dive deeper into the topic of view extensions of standard CDS views. I am familiar with the basic concept and the implementation, and everything is understandable for simple or flat CDS views.

However, there are hardly any standard CDS views that have only one level, but rather multiple ones. The question that arises for me is whether it is always necessary to extend all levels in order to access a field on the "top" level. Or what is the best practice in this case (for example: extend all views? Build a custom view on the interface view and join / associate the desired table/view again? etc.) 

For the sake of comprehension, here a concrete example:

The table VBAK was extended by a custom field, via append. I now want to include the respective field in the CDS view I_SalesOrder. The view I_SalesOrder has three hierarchy levels: I_SalesOrder -> I_SalesDocument -> I_SalesDocumentBasic. The latter selects the table VBAK.

Is it now the correct way to extend all three CDS views in order to be able to access the field in I_SalesOrder? 

Thanks in advance for the help.

Best regards,
Lukas

View Entire Topic
junwu
SAP Champion
SAP Champion

check this association E_SalesDocumentBasic

that's the shortcut for you to add the z field to the top level

basically you will create two z cds, one to extend E_SalesDocumentBasic, second to extend I_SalesOrder