<?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>Question Re: Nested CDS view / oData result in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/nested-cds-view-odata-result/qaa-p/660446#M170758</link>
    <description>&lt;P&gt;No, I couldn't solve the problem so far. Still looking for an useful solution. I made some workarounds, but they aren't the way you should do it. (For example getting all results, and filtering them with JS clientside)&lt;BR /&gt;&lt;BR /&gt;I would appreciate any help on this topic too.&lt;/P&gt;</description>
    <pubDate>Fri, 09 Mar 2018 13:49:31 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2018-03-09T13:49:31Z</dc:date>
    <item>
      <title>Nested CDS view / oData result</title>
      <link>https://community.sap.com/t5/technology-q-a/nested-cds-view-odata-result/qaq-p/660443</link>
      <description>&lt;P&gt;I am trying to merge two tables (by &lt;STRONG&gt;ID&lt;/STRONG&gt;) and return the data as a nested json object via &lt;STRONG&gt;oData&lt;/STRONG&gt;, but got no luck so far. Since I couldn't find any useful resources, I am starting to wonder if it's even possible to do.&lt;BR /&gt;I'm using &lt;EM&gt;Eclipse Oxygen&lt;/EM&gt; to code the &lt;EM&gt;CDS-Views,&lt;/EM&gt; and already tried different SQL joins, but they only generate multiple sets of data, instead of one nested object. I attached images with some sample data I made in Exel, so you can understand my problem a bit better.&lt;BR /&gt;&lt;BR /&gt;Example of what I am trying to achieve:&lt;BR /&gt;First Table &lt;EM&gt;(CustomerDetails)&lt;/EM&gt;:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/112510-customerdetails-excel.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Second Table&lt;EM&gt; (CustomerMails)&lt;/EM&gt;:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/112511-customermails-excel.png" /&gt;&lt;/P&gt;
  &lt;P&gt;Expected result &lt;EM&gt;(as JSON)&lt;/EM&gt;:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/112512-json-raw.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;EM&gt;I only added the first 3 entries into the JSON, but you get what I mean.&lt;BR /&gt;&lt;BR /&gt;&lt;/EM&gt;JSON Overview:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/112513-json-overview.png" /&gt;&lt;/P&gt;
  &lt;P&gt;The actual result looks something like this &lt;EM&gt;(same ID multiple times)&lt;/EM&gt;:&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/112514-json-result.png" /&gt;&lt;/P&gt;
  &lt;P&gt;&lt;BR /&gt;Code of my CDS-View &lt;EM&gt;(unrelated to the data above)&lt;/EM&gt;:&lt;BR /&gt;&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;define view ZXZTI_CUSTOMER as select from kna1 as k
left outer join adr6 as a on k.adrnr = a.addrnumber
{
    @Semantics.user.id: true
    key k.kunnr as CustomerNumber,
    @Semantics.name.fullName: true
    k.name1 as CustomerName,
    @Semantics.address.country: true
    k.land1 as CustomerCountry,
    @Semantics.address.zipCode: true
    k.pstlz as CustomerZipcode,
    @Semantics.address.city: true
    k.ort01 as CustomerCity,
    @Semantics.address.street: true
    k.stras as CustomerStreet,
    @Semantics.eMail.address: true
    a.smtp_addr as CustomerEMail
}&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;&lt;EM&gt;Thanks in advance!&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Feb 2018 15:35:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/nested-cds-view-odata-result/qaq-p/660443</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-02-05T15:35:16Z</dc:date>
    </item>
    <item>
      <title>Re: Nested CDS view / oData result</title>
      <link>https://community.sap.com/t5/technology-q-a/nested-cds-view-odata-result/qaa-p/660444#M170756</link>
      <description>&lt;P&gt;may be try using &lt;A href="https://help.sap.com/doc/abapdocu_750_index_htm/7.50/en-US/index.htm?file=abencds_f1_union.htm"&gt;Union&lt;/A&gt; clause&lt;/P&gt;</description>
      <pubDate>Fri, 09 Feb 2018 01:15:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/nested-cds-view-odata-result/qaa-p/660444#M170756</guid>
      <dc:creator>Ankit_Maskara</dc:creator>
      <dc:date>2018-02-09T01:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: Nested CDS view / oData result</title>
      <link>https://community.sap.com/t5/technology-q-a/nested-cds-view-odata-result/qaa-p/660445#M170757</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;
  &lt;P&gt;I too face the exactly the same problem. i am trying to develop CDS view for Profit center lookup. I want all the company details to be attached to single profit center with out all the data get repeated . Did you get any breakthrough on the above problem that you have mentioned?.&lt;/P&gt;
  &lt;P&gt;any help will be highly appriciated&lt;/P&gt;
  &lt;P&gt;Regards&lt;/P&gt;
  &lt;P&gt;Ibrahim.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Mar 2018 05:25:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/nested-cds-view-odata-result/qaa-p/660445#M170757</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-03-02T05:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: Nested CDS view / oData result</title>
      <link>https://community.sap.com/t5/technology-q-a/nested-cds-view-odata-result/qaa-p/660446#M170758</link>
      <description>&lt;P&gt;No, I couldn't solve the problem so far. Still looking for an useful solution. I made some workarounds, but they aren't the way you should do it. (For example getting all results, and filtering them with JS clientside)&lt;BR /&gt;&lt;BR /&gt;I would appreciate any help on this topic too.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 13:49:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/nested-cds-view-odata-result/qaa-p/660446#M170758</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2018-03-09T13:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: Nested CDS view / oData result</title>
      <link>https://community.sap.com/t5/technology-q-a/nested-cds-view-odata-result/qaa-p/13879484#M4885776</link>
      <description>is anyone got the solution for this problem?</description>
      <pubDate>Fri, 27 Sep 2024 02:01:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/nested-cds-view-odata-result/qaa-p/13879484#M4885776</guid>
      <dc:creator>Yella1260</dc:creator>
      <dc:date>2024-09-27T02:01:40Z</dc:date>
    </item>
  </channel>
</rss>

