Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP CDS Association Cardinality of Filter Expressions

Former Member
0 Kudos

Dear Community Members,

In the View shown below, i access two fields of another CDS-View (Zcustom_Assoc). In Zcustom_Assoc there is the association bookings, which i use with a filter on field custtype. If i dont add the cardinality 1:0 in the Filter, there is a warning. The where clause, which is commented out, is an alternative for filtering with field custtype. If i remove the filter and use the where-clause , i get the same result set. In the where-clause i cannot remove the cardinality, cause i am accessing an 1:N Association. This is explained inside the help pages of sap: We do not know if the condition applies to one or all values in the 1:N to association. I also understand this, but what i dont understand is, why i need to set the cardinality in the where-clause, but not in the Filter ?

@AbapCatalog.sqlViewName: 'ztest' 
define view Ztestview as select from Zcustom_Assoc
{   
  Zcustom_Assoc.id, 
  Zcustom_Assoc.name,
  Zcustom_Assoc.bookings[inner where custtype = 'B'].bookid  
} //where Zcustom_Assoc.bookings[1:inner].custtype = 'B'
0 REPLIES 0