<?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: Aggregate functions usage in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/aggregate-functions-usage/m-p/7030193#M1499250</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot. The MAX rate is coming perfectly fine. But, the MIN rate is giving problem, because several lines of the NET RATE are 0.  Please help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 May 2010 06:07:40 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-05-27T06:07:40Z</dc:date>
    <item>
      <title>Aggregate functions usage</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/aggregate-functions-usage/m-p/7030191#M1499248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ! In my ALV report, added a custom net rate column. Now, I want to find out the minimum, maximum and average values from that custom nat rate colum. How that can be acheived.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 May 2010 05:10:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/aggregate-functions-usage/m-p/7030191#M1499248</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-27T05:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate functions usage</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/aggregate-functions-usage/m-p/7030192#M1499249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Goen ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Say suppose your IT_FINAL is the final Internal Table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if your Final table getting data from Single table , you can use Aggregate function directly. Please refer the below link for the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[http://www.thespot4sap.com/articles/SAPABAPPerformanceTuning_AggregateFunctions.asp]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if not from single table. Go by the below method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use SORT statement for finding the Minimum and Maximum Net rate.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SORT IT_FINAL BY NET_RATE.

READ TABLE IT_FINAL INDEX 1.
if sy-subrc is initial.
"IT_FINAL-NET_RATE will be the Minimum one
Endif.

SORT IT_FINAL BY NET_RATE DESCENDING.

READ TABLE IT_FINAL INDEX 1.
if sy-subrc is initial.
"IT_FINAL-NET_RATE will be the Maximum one
Endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for getting average value , You need to sum all the entries NET RATE and then Divide by Number of entries of table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 May 2010 05:25:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/aggregate-functions-usage/m-p/7030192#M1499249</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-27T05:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate functions usage</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/aggregate-functions-usage/m-p/7030193#M1499250</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot. The MAX rate is coming perfectly fine. But, the MIN rate is giving problem, because several lines of the NET RATE are 0.  Please help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 May 2010 06:07:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/aggregate-functions-usage/m-p/7030193#M1499250</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-27T06:07:40Z</dc:date>
    </item>
    <item>
      <title>Re: Aggregate functions usage</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/aggregate-functions-usage/m-p/7030194#M1499251</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Goen ,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
"Declare one more ITAB IT_FINAL_TMP with same structure of IT_FINAL.

"Copy the data to new ITAB for data manipulations
IT_FINAL_TMP[] = IT_FINAL[].

" Delete the entries which  are having net rate as Zero
delete ITAB IT_FINAL_TMP where NET_RATE is initial. " Write appropriate Where condition

"Use IT_FINAL_TMP for finding the MIN Value

SORT IT_FINAL_TMP BY NET_RATE.
 
READ TABLE IT_FINAL_TMP INDEX 1.
if sy-subrc is initial.
"IT_FINAL_TMP-NET_RATE will be the Minimum one
Endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Prasath Arivazhagan on May 27, 2010 8:48 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 May 2010 06:47:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/aggregate-functions-usage/m-p/7030194#M1499251</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-27T06:47:07Z</dc:date>
    </item>
  </channel>
</rss>

