<?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 CDS Virtual element - Query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/cds-virtual-element-query/m-p/12467985#M2000716</link>
    <description>&lt;P&gt;I have a CDS view which will be exposed as an Odata service. There is one field in the CDS(FIO/LIO) which has a many to one relationship with the key field(object id). Now, there is no direct DB table(s) to select the details of FIO/LIO field. For one object id, we will get multiple number of FIO/LIO entries from a function module. Initially I planned to use CDS virtual elements, But CDS virtual element cannot be used for this scenario as we cannot add records to a calculated column of virtual element. We can recalculate them or replace their value but we cannot add multiple FIO/LIO against one object id in the virtual element method.&lt;/P&gt;
  &lt;P&gt;I need guidance on how to implement this solution in CDS where we expect multiple entries from FM against a single object id.&lt;/P&gt;</description>
    <pubDate>Mon, 19 Apr 2021 10:39:22 GMT</pubDate>
    <dc:creator>Maloy</dc:creator>
    <dc:date>2021-04-19T10:39:22Z</dc:date>
    <item>
      <title>CDS Virtual element - Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cds-virtual-element-query/m-p/12467985#M2000716</link>
      <description>&lt;P&gt;I have a CDS view which will be exposed as an Odata service. There is one field in the CDS(FIO/LIO) which has a many to one relationship with the key field(object id). Now, there is no direct DB table(s) to select the details of FIO/LIO field. For one object id, we will get multiple number of FIO/LIO entries from a function module. Initially I planned to use CDS virtual elements, But CDS virtual element cannot be used for this scenario as we cannot add records to a calculated column of virtual element. We can recalculate them or replace their value but we cannot add multiple FIO/LIO against one object id in the virtual element method.&lt;/P&gt;
  &lt;P&gt;I need guidance on how to implement this solution in CDS where we expect multiple entries from FM against a single object id.&lt;/P&gt;</description>
      <pubDate>Mon, 19 Apr 2021 10:39:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cds-virtual-element-query/m-p/12467985#M2000716</guid>
      <dc:creator>Maloy</dc:creator>
      <dc:date>2021-04-19T10:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: CDS Virtual element - Query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/cds-virtual-element-query/m-p/12467986#M2000717</link>
      <description>&lt;P&gt;Hi Maloy,&lt;/P&gt;&lt;P&gt;it depends how you want to process / use the data.&lt;/P&gt;&lt;P&gt;If you want to get the relevant FIO/LIO details via the mentioned function module, I would recommend you to make use of CDS Custom Entities. By defining a CDS Custom Entity you have the possibility to reference an implementation exit for the data access.&lt;/P&gt;&lt;P&gt;A great tutorial can be found here:&lt;BR /&gt;&lt;A href="https://developers.sap.com/tutorials/abap-environment-a4c-create-custom-entity.html" target="test_blank"&gt;https://developers.sap.com/tutorials/abap-environment-a4c-create-custom-entity.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;As soon as you have defined your CDS Custom Entity, you are able to associate this entity in a CDS Extension of the corresponding standard CDS View.&lt;/P&gt;&lt;P&gt;Simplified Example:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;extend view &amp;lt;standard_view_to_be_extended&amp;gt; with &amp;lt;extend_name&amp;gt;&lt;BR /&gt;    association [0..*] to &amp;lt;custom_entity&amp;gt; as _toCustomEntity &lt;BR /&gt;        on _toCustomEntity.&amp;lt;key_field&amp;gt; = $projection.&amp;lt;foreign_key_field&amp;gt;&lt;BR /&gt;{&lt;BR /&gt;    _toCustomEntity&lt;BR /&gt;}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Depending on the service on top of the extended CDS View, the association is now available and can be used for further data selection.&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Fabian Fellhauer&lt;/P&gt;</description>
      <pubDate>Tue, 24 Aug 2021 14:50:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/cds-virtual-element-query/m-p/12467986#M2000717</guid>
      <dc:creator>fabianfellhauer</dc:creator>
      <dc:date>2021-08-24T14:50:20Z</dc:date>
    </item>
  </channel>
</rss>

