<?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: select SUM( ) in inner join - error in code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-sum-in-inner-join-error-in-code/m-p/2966144#M699887</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can get all records first and then LOOP AT Internal table and use COLLECT statement to sum up required column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will be a better idea than trying to use SUM in SELECT with JOINS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ashish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 23 Oct 2007 14:53:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-23T14:53:35Z</dc:date>
    <item>
      <title>select SUM( ) in inner join - error in code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-sum-in-inner-join-error-in-code/m-p/2966140#M699883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following code is using ABAP OO and I get the following error&lt;/P&gt;&lt;P&gt;E:The addition "FOR ALL ENTRIES" excludes all aggregate functions with&lt;/P&gt;&lt;P&gt;the exception of "COUNT( * )", as the single element of the SELECT&lt;/P&gt;&lt;P&gt;clause.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the Code:&lt;/P&gt;&lt;P&gt;select a&lt;SUB&gt;/bic/ZEDM_ENTP a&lt;/SUB&gt;material a~/bic/zedm_stid&lt;/P&gt;&lt;P&gt;a&lt;SUB&gt;/bic/ZEDM_SDT a&lt;/SUB&gt;/bic/ZEDM_MINH a~/bic/ZEDM_EHD&lt;/P&gt;&lt;P&gt;SUM( b~/bic/ZEDM_QPLN )&lt;/P&gt;&lt;P&gt;c~/bic/ZDEMQTY&lt;/P&gt;&lt;P&gt;from /bic/azdrp_1900 as a inner join /bic/azdrp_0400 as b&lt;/P&gt;&lt;P&gt;on&lt;/P&gt;&lt;P&gt;a&lt;SUB&gt;/bic/ZEDM_ENTP = b&lt;/SUB&gt;/bic/ZEDM_ENTP and&lt;/P&gt;&lt;P&gt;a&lt;SUB&gt;material = b&lt;/SUB&gt;material and&lt;/P&gt;&lt;P&gt;a&lt;SUB&gt;/bic/zedm_stid = b&lt;/SUB&gt;plant and&lt;/P&gt;&lt;P&gt;a&lt;SUB&gt;/bic/ZEDM_SDT = b&lt;/SUB&gt;/bic/zedm_pshp&lt;/P&gt;&lt;P&gt;inner join /bic/azrp_0800 as C&lt;/P&gt;&lt;P&gt;on&lt;/P&gt;&lt;P&gt;a&lt;SUB&gt;material = c&lt;/SUB&gt;material and&lt;/P&gt;&lt;P&gt;a&lt;SUB&gt;/bic/zedm_stid = c&lt;/SUB&gt;/bic/zedm_stid and&lt;/P&gt;&lt;P&gt;a&lt;SUB&gt;/bic/ZEDM_SDT = c&lt;/SUB&gt;/bic/ZEDM_ESDT&lt;/P&gt;&lt;P&gt;into table z_it_inv for all entries in&lt;/P&gt;&lt;P&gt;RESULT_PACKAGE where&lt;/P&gt;&lt;P&gt;a~/bic/ZEDM_ENTP = RESULT_PACKAGE-/bic/ZEDM_ENTP&lt;/P&gt;&lt;P&gt;and a~material = RESULT_PACKAGE-material&lt;/P&gt;&lt;P&gt;and a~/bic/ZEDM_SDT = RESULT_PACKAGE-/BIC/OIZEDM_EDT&lt;/P&gt;&lt;P&gt;and a~/bic/zedm_stid = RESULT_PACKAGE-/BIC/OIZEDM_TOST&lt;/P&gt;&lt;P&gt;group by b&lt;SUB&gt;/bic/ZEDM_ENTP b&lt;/SUB&gt;material b~plant&lt;/P&gt;&lt;P&gt;b~/bic/zedm_pshp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please tell me how to correct this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2007 14:16:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-sum-in-inner-join-error-in-code/m-p/2966140#M699883</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-23T14:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: select SUM( ) in inner join - error in code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-sum-in-inner-join-error-in-code/m-p/2966141#M699884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When you are using for 'all entries' you can not use SUM because it is an aggregate function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2007 14:25:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-sum-in-inner-join-error-in-code/m-p/2966141#M699884</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-23T14:25:09Z</dc:date>
    </item>
    <item>
      <title>Re: select SUM( ) in inner join - error in code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-sum-in-inner-join-error-in-code/m-p/2966142#M699885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Krishna,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a workaround for this? I need to use for all entries and want to do the summation of a particular colum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Deepa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2007 14:50:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-sum-in-inner-join-error-in-code/m-p/2966142#M699885</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-23T14:50:12Z</dc:date>
    </item>
    <item>
      <title>Re: select SUM( ) in inner join - error in code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-sum-in-inner-join-error-in-code/m-p/2966143#M699886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Aggregate functions are not very efficient. Try doing the SUM after the data is selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2007 14:52:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-sum-in-inner-join-error-in-code/m-p/2966143#M699886</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-23T14:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: select SUM( ) in inner join - error in code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-sum-in-inner-join-error-in-code/m-p/2966144#M699887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can get all records first and then LOOP AT Internal table and use COLLECT statement to sum up required column.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will be a better idea than trying to use SUM in SELECT with JOINS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ashish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 23 Oct 2007 14:53:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-sum-in-inner-join-error-in-code/m-p/2966144#M699887</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-23T14:53:35Z</dc:date>
    </item>
  </channel>
</rss>

