<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Cannot access nested CDS view using path expressions in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-access-nested-cds-view-using-path-expressions/m-p/11495227#M1932459</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;thank you, I was really stuck on this &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/74/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;. I was not aware of the difference between CDS name and the ABAP dictionary name. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Marek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Dec 2015 09:21:20 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2015-12-31T09:21:20Z</dc:date>
    <item>
      <title>Cannot access nested CDS view using path expressions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-access-nested-cds-view-using-path-expressions/m-p/11495225#M1932457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm trying to leverage the functionality of path expressions in a following scenario:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have a simple [0..*] association of an entity &lt;STRONG&gt;business transaction header &lt;/STRONG&gt;with another entity &lt;STRONG&gt;business partner&lt;/STRONG&gt;. The ABAP CDS View for a business transaction could look something like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;@AbapCatalog.sqlViewName: 'BTRAN'&lt;/P&gt;
&lt;P&gt;define view btran_ddl as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select from crmd_orderadm_h as btrn_header&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; association [1..*] to bt_bp as partners on $projection.guid = partners.header_guid&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; key btrn_header.guid as guid,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; btrn_header.object_id as h_object_id,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ... // further fields from &lt;SPAN style="color: rgba(0, 0, 0, 0); font-family: helvetica, arial; font-size: 12px;"&gt;crmd_orderadm_h&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; partners // publishing association for use in other CDS views&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The target data source BT_BP is another CDS view containing data on business partner. In the last line of SELECT list, the association PARTNERS is stated to be accessible by other CDS views which build on top of BTRAN.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now let's say I want to create another view CONTRACT. A contract is a special case of a business transaction with a specific transaction type. In this view I'd like to access the association PARTNERS to display information on different business partners:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;@AbapCatalog.sqlViewName: 'CONTRACT'&lt;/P&gt;
&lt;P&gt;define view contract_ddl as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select from btran&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; key btran.guid as guid,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ... // further fields&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; partners.name as partner_name,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // accessing PARTNERS&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; partners.function as partner_function&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // accessing PARTNERS&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;where btran.object_type = 'BUS2000113'&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The syntax check on this view returns the error message: Component PARTNERS does not exist or is not active&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I missing something?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Marek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Dec 2015 12:59:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-access-nested-cds-view-using-path-expressions/m-p/11495225#M1932457</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-12-30T12:59:16Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot access nested CDS view using path expressions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-access-nested-cds-view-using-path-expressions/m-p/11495226#M1932458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Marek,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your second view does a SELECT from BTRAN which is not a CDS view but only a technical vehicel (sqlViewName) which does not have associations.&lt;/P&gt;&lt;P&gt;You should always use the name used by "create view", in your case &lt;STRONG&gt;btran_ddl&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So better change the second view to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-weight: inherit; font-style: inherit; font-size: 9pt !important; font-family: helvetica, arial; color: black; background-color: inherit; background-position: initial;"&gt;define view contract_ddl as&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: black; font-family: helvetica, arial; font-size: 9pt; font-style: inherit; font-weight: inherit;"&gt;select from &lt;STRONG&gt;btran_ddl&lt;/STRONG&gt; ... &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also when doing a SELECT in ABAP the recommendation is to use the real view name and not the sqlViewName.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards, &lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Dec 2015 13:14:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-access-nested-cds-view-using-path-expressions/m-p/11495226#M1932458</guid>
      <dc:creator>thomasgauweiler</dc:creator>
      <dc:date>2015-12-30T13:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: Cannot access nested CDS view using path expressions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-access-nested-cds-view-using-path-expressions/m-p/11495227#M1932459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thomas,&lt;/P&gt;&lt;P&gt;thank you, I was really stuck on this &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/74/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;. I was not aware of the difference between CDS name and the ABAP dictionary name. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Marek&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Dec 2015 09:21:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cannot-access-nested-cds-view-using-path-expressions/m-p/11495227#M1932459</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-12-31T09:21:20Z</dc:date>
    </item>
  </channel>
</rss>

