2019 Sep 18 4:27 PM
Hello,
I am trying to create a basic CDS view with association, but ended with up with two issues. Could you please point me in right direction.
Issue 1: When i use parameter in the below example, the "Follow Association" options doesn't work but if i comment the parameter it does work.
Issue 2: When I specify the cardinality [0..*] or [1..*] I am getting an warning message “Association _salesitem can influence the cardinality of the resulting set” in the path expression. In this case i am not accessing any fields in the path expression.
SAP_ABA - Release 740 and SP-Level 0017
@AbapCatalog.sqlViewName: 'zsnv_cds_case'
define view ZSN_CDS_CASE
with parameters Salesorder : vbeln
as select from vbak
association [1..*] to vbap as _salesitem on
$projection.vbeln = _salesitem.vbeln
{
vbak.vbeln,
case ( vbak.vbtyp )
when 'C' then 'Order'
when 'G' then 'Contract'
else 'Other'
end as OrderType,
vbak.kunnr,
case
when _salesitem.netpr <= 100 then 'Small Order'
else 'Consider Big order'
end as OrderRange,
_salesitem
}
where vbak.vbeln = $parameters.Salesorder
Thank you in advance
2019 Sep 18 5:11 PM
Hi,
you are facing this issue because you are using the association in SELECT statement. i couldn't really understand what exactly do you mean by 'Follow Association'. But i am sure all your questions could be answered by this blog:
https://blogs.sap.com/2018/08/20/cardinality-of-association-in-cds-view/
Regards
GK
2019 Sep 19 3:11 PM
Thanks for pointing me to the link, i have gone through it but there isn't any information regarding the warning message in the association. (Warning message: “Association _XXXXXX can influence the cardinality of the resulting set”)
Regarding issue 1: In the output we can navigate to the associated table/view using "Follow Association", in my case it is giving me an error message when i use "Parameters" in the DDL source otherwise it is working.
