<?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 Aggregation on CDS with Virtual Element in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/aggregation-on-cds-with-virtual-element/m-p/12173640#M1979192</link>
    <description>&lt;P&gt;A simple CDS view with a virtual element is created like below in S4 1809. I'm trying to use this as a basis for a consumption view for a ListReport. &lt;/P&gt;
  &lt;P&gt;I noticed that the Aggregation annotation on the Quantity field does not work with this. ADT comes up with an error "Calculated view not allowed in analytical ... ".&lt;/P&gt;
  &lt;P&gt;Creating the @Aggregation at a higher level consumption CDS gets a similar error. &lt;/P&gt;
  &lt;P&gt;Am I missing the intention of virtual elements? Why are they not allowed in consumption views that allow aggregation?&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;@AbapCatalog.sqlViewName: 'YWSSALESORDITEM'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Sales Order Item'
@OData.publish: true
@VDM.viewType: #BASIC
define view YWS_SalesOrderItem
  as select from vbap
{


  key vbeln                       as SalesOrder,
  key posnr                       as SalesOrderItem,
      @Semantics.unitOfMeasure
      vrkme                       as Unit,
//      @Aggregation.default: #SUM
      @Semantics.quantity.unitOfMeasure: 'Unit'
      kwmeng                      as Quantity,
      matnr                       as Material,
      arktx                       as MaterialDescription,
      @Aggregation.default: #NONE
      @ObjectModel.readOnly: true
      @ObjectModel.virtualElement:true
      @ObjectModel.virtualElementCalculatedBy:    'ABAP:YCL_WS_SALESORD_ITEM_VIRTUAL'
      cast( '' as abap.char(45) ) as Status
}


&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 24 Feb 2020 00:24:22 GMT</pubDate>
    <dc:creator>wilbertsison</dc:creator>
    <dc:date>2020-02-24T00:24:22Z</dc:date>
    <item>
      <title>Aggregation on CDS with Virtual Element</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/aggregation-on-cds-with-virtual-element/m-p/12173640#M1979192</link>
      <description>&lt;P&gt;A simple CDS view with a virtual element is created like below in S4 1809. I'm trying to use this as a basis for a consumption view for a ListReport. &lt;/P&gt;
  &lt;P&gt;I noticed that the Aggregation annotation on the Quantity field does not work with this. ADT comes up with an error "Calculated view not allowed in analytical ... ".&lt;/P&gt;
  &lt;P&gt;Creating the @Aggregation at a higher level consumption CDS gets a similar error. &lt;/P&gt;
  &lt;P&gt;Am I missing the intention of virtual elements? Why are they not allowed in consumption views that allow aggregation?&lt;/P&gt; 
  &lt;PRE&gt;&lt;CODE&gt;@AbapCatalog.sqlViewName: 'YWSSALESORDITEM'
@AbapCatalog.compiler.compareFilter: true
@AbapCatalog.preserveKey: true
@AccessControl.authorizationCheck: #CHECK
@EndUserText.label: 'Sales Order Item'
@OData.publish: true
@VDM.viewType: #BASIC
define view YWS_SalesOrderItem
  as select from vbap
{


  key vbeln                       as SalesOrder,
  key posnr                       as SalesOrderItem,
      @Semantics.unitOfMeasure
      vrkme                       as Unit,
//      @Aggregation.default: #SUM
      @Semantics.quantity.unitOfMeasure: 'Unit'
      kwmeng                      as Quantity,
      matnr                       as Material,
      arktx                       as MaterialDescription,
      @Aggregation.default: #NONE
      @ObjectModel.readOnly: true
      @ObjectModel.virtualElement:true
      @ObjectModel.virtualElementCalculatedBy:    'ABAP:YCL_WS_SALESORD_ITEM_VIRTUAL'
      cast( '' as abap.char(45) ) as Status
}


&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Feb 2020 00:24:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/aggregation-on-cds-with-virtual-element/m-p/12173640#M1979192</guid>
      <dc:creator>wilbertsison</dc:creator>
      <dc:date>2020-02-24T00:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation on CDS with Virtual Element</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/aggregation-on-cds-with-virtual-element/m-p/12173641#M1979193</link>
      <description>&lt;P&gt;It seems that they cannot be used together, check the documentation below:&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.sap.com/viewer/cc0c305d2fab47bd808adcad3ca7ee9d/7.52.5/en-US/4b5e56ec6f28453f81ac370bd91fb06d.html"&gt;https://help.sap.com/viewer/cc0c305d2fab47bd808adcad3ca7ee9d/7.52.5/en-US/4b5e56ec6f28453f81ac370bd91fb06d.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;-Mahesh&lt;/P&gt;</description>
      <pubDate>Mon, 24 Feb 2020 05:51:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/aggregation-on-cds-with-virtual-element/m-p/12173641#M1979193</guid>
      <dc:creator>maheshpalavalli</dc:creator>
      <dc:date>2020-02-24T05:51:04Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation on CDS with Virtual Element</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/aggregation-on-cds-with-virtual-element/m-p/12173642#M1979194</link>
      <description>&lt;P&gt;When it said &lt;EM&gt;"&lt;/EM&gt;&lt;EM&gt;Calculated fields cannot be used together with the grouping or the aggregation function.&lt;/EM&gt;' I kinda understand why that's the case when code tries to apply aggregation on the calculated field. But in the example above, the calculated view is "Status", the Aggregation field is Quantity. It sounds like it cannot be used together at all in the same CDS hierarchy.&lt;/P&gt;&lt;P&gt;That kinda limits the utility of the virtual element in reporting. &lt;/P&gt;</description>
      <pubDate>Wed, 26 Feb 2020 23:20:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/aggregation-on-cds-with-virtual-element/m-p/12173642#M1979194</guid>
      <dc:creator>wilbertsison</dc:creator>
      <dc:date>2020-02-26T23:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation on CDS with Virtual Element</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/aggregation-on-cds-with-virtual-element/m-p/12173643#M1979195</link>
      <description>&lt;SPAN class="mention-scrubbed"&gt;wilbert.sison2&lt;/SPAN&gt;, agree, it could have been done better, I've even debugged and checked it, they are checkcing if the whole cds view is analytical and then they raise error if it has any virtual elements.</description>
      <pubDate>Sat, 29 Feb 2020 14:56:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/aggregation-on-cds-with-virtual-element/m-p/12173643#M1979195</guid>
      <dc:creator>maheshpalavalli</dc:creator>
      <dc:date>2020-02-29T14:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation on CDS with Virtual Element</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/aggregation-on-cds-with-virtual-element/m-p/12173644#M1979196</link>
      <description>&lt;P&gt;Hi Wilbert,&lt;/P&gt;&lt;P&gt;I also worked on similar kind of requirement and get to know that we cant use analytical annotations while using virtual element(even in 1909).&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Abhijeet kankani&lt;/P&gt;</description>
      <pubDate>Tue, 03 Mar 2020 06:27:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/aggregation-on-cds-with-virtual-element/m-p/12173644#M1979196</guid>
      <dc:creator>AbhijeetK</dc:creator>
      <dc:date>2020-03-03T06:27:56Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation on CDS with Virtual Element</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/aggregation-on-cds-with-virtual-element/m-p/12173645#M1979197</link>
      <description>&lt;P&gt;Hi Abhijeet,&lt;/P&gt;&lt;P&gt;What solution you applied then ? I have same requirement where need to ready long text in CDS with aggregation to generate Odata to consume it in Analytical KPI reports&lt;/P&gt;</description>
      <pubDate>Wed, 15 Dec 2021 13:49:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/aggregation-on-cds-with-virtual-element/m-p/12173645#M1979197</guid>
      <dc:creator>former_member781215</dc:creator>
      <dc:date>2021-12-15T13:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation on CDS with Virtual Element</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/aggregation-on-cds-with-virtual-element/m-p/12173646#M1979198</link>
      <description>&lt;P&gt;&lt;SPAN class="mention-scrubbed"&gt;kamakshij&lt;/SPAN&gt; As we cant use both concept together, for our case there was no KPI based on long text so we just created new CDS view for long text and associate it to parent cds view and exposed in parent CDS. So using navigation one can retrieve the long text.&lt;/P&gt;&lt;P&gt;Hope it will help.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Dec 2021 10:31:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/aggregation-on-cds-with-virtual-element/m-p/12173646#M1979198</guid>
      <dc:creator>AbhijeetK</dc:creator>
      <dc:date>2021-12-24T10:31:48Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregation on CDS with Virtual Element</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/aggregation-on-cds-with-virtual-element/m-p/13673455#M2027711</link>
      <description>&lt;P&gt;Were you able to solve this problem somehow? I have a case where a value of a field can be retrieved only using ABAP and I need to use this CDS in KPI. I've checked the solution that suggests associations. The field is displayed in the result CDS but it's empty - class is not called at all.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Apr 2024 13:35:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/aggregation-on-cds-with-virtual-element/m-p/13673455#M2027711</guid>
      <dc:creator>szelbi</dc:creator>
      <dc:date>2024-04-17T13:35:29Z</dc:date>
    </item>
  </channel>
</rss>

