<?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: ABAP Open SQL - aggregate functions in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102637#M1360719</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Open SQL does support aggregate functions. The article in question was talking about open SQL in th econtext of DB2 for z/OS. I don't know if that makes any difference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 03 Sep 2009 13:10:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-09-03T13:10:51Z</dc:date>
    <item>
      <title>ABAP Open SQL - aggregate functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102632#M1360714</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;Does ABAP Open SQL support aggregate functions?  (e.g. SUM, AVG)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you hit F1 on "select", the ABAP Keyword Documentation opens up.  Under "Open SQL" in the documentation is information on "SELECT - aggregate".  So the SAP Keyword Documentation states that aggregate functions are possible in Open SQL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But this guy (who seems amply qualified) says that open SQL in ABAP does not support aggregate functions such as sum:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://it.toolbox.com/blogs/sap-on-db2/abap-open-sql-limitations-31495" target="test_blank"&gt;http://it.toolbox.com/blogs/sap-on-db2/abap-open-sql-limitations-31495&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Who is right?  If ABAP does support aggregate functions, can I have a complete select statement using SUM and GROUP BY as an example?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have written a select statement using SUM and GROUP BY but the resulting internal table is empty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2009 12:49:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102632#M1360714</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-03T12:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Open SQL - aggregate functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102633#M1360715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Aggregate functions can be used&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;see link:[Reading Aggregate Data for Columns|http://help.sap.com/saphelp_nw04/helpdata/EN/fc/eb3990358411d1829f0000e829fbfe/content.htm]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Certain Things are not possible in ABAP open sql such as rollback create Etc. I think these are not AGGREGATE functions&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But i dont why he mentioned&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in open sql you canu2019t use aggregate functions like sum,avg. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Keshu Thekkillam on Sep 3, 2009 6:27 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2009 12:54:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102633#M1360715</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2009-09-03T12:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Open SQL - aggregate functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102634#M1360716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Not sure what the guy wants. Of course Open SQL cannot include all the bells and whistles of each specific native SQL dialects, because Open SQL is designed to serve all database platforms alike, not only DB2, so it can only include common features. Some common features might have been left out for reasons unknown to me though.&lt;/P&gt;&lt;P&gt;Aggregates are certainly included, here is another helpful link.&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/abapdocu_70/en/ABAPSELECT_AGGREGATE.htm" target="test_blank"&gt;http://help.sap.com/abapdocu_70/en/ABAPSELECT_AGGREGATE.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2009 13:04:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102634#M1360716</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2009-09-03T13:04:01Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Open SQL - aggregate functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102635#M1360717</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;Check the program in se38&lt;/P&gt;&lt;P&gt;demo_select_group_by&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try with SUM or AVG instead of MIN or MAX in that code&lt;/P&gt;&lt;P&gt;it works&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Sonal Patel on Sep 3, 2009 6:34 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2009 13:04:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102635#M1360717</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-03T13:04:26Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Open SQL - aggregate functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102636#M1360718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you know if data type currency (CURR) is considered by the aggregate function SUM to be a numeric field?  I'm just not getting any data in my results and I'm pretty confident my syntax is correct:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select zfmusfga&lt;SUB&gt;rfistl zfmusfga&lt;/SUB&gt;rfund zfmusfga&lt;SUB&gt;refdocnr sum( zfmusfga&lt;/SUB&gt;hsl ) zfmusfga~budat&lt;/P&gt;&lt;P&gt;  into (itab-rfistl, itab-rfund, itab-refdocnr, itab-hsl, itab-budat)&lt;/P&gt;&lt;P&gt;  from zfmusfga&lt;/P&gt;&lt;P&gt;  where rfistl = fld_fc and&lt;/P&gt;&lt;P&gt;    racct = '48020900' and&lt;/P&gt;&lt;P&gt;    budat &amp;gt;= p_pdates and&lt;/P&gt;&lt;P&gt;    budat &amp;lt;= p_pdatee&lt;/P&gt;&lt;P&gt;  group by&lt;/P&gt;&lt;P&gt;    zfmusfga&lt;SUB&gt;rfistl zfmusfga&lt;/SUB&gt;rfund zfmusfga&lt;SUB&gt;refdocnr zfmusfga&lt;/SUB&gt;budat.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2009 13:05:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102636#M1360718</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-03T13:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Open SQL - aggregate functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102637#M1360719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Open SQL does support aggregate functions. The article in question was talking about open SQL in th econtext of DB2 for z/OS. I don't know if that makes any difference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2009 13:10:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102637#M1360719</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-03T13:10:51Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Open SQL - aggregate functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102638#M1360720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
data:v_netpr type ekpo-netpr.
select sum( NETPR ) from ekpo into v_netpr where ebeln = '3000000023' .
write v_netpr.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;This works for me&lt;/P&gt;&lt;P&gt;Might be some problems in your where clause&lt;/P&gt;&lt;P&gt;check leading zeros in your value 48020900 and whether the date conditions matches the entries with your table values&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2009 13:14:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102638#M1360720</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2009-09-03T13:14:44Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Open SQL - aggregate functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102639#M1360721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rob,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just out of curiosity(&amp;amp; of course ignorance) does ABAP support column functions in Open SQL?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think it doesn't.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2009 13:22:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102639#M1360721</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-09-03T13:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Open SQL - aggregate functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102640#M1360722</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you mean something like returning the sum of two columns of a row?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2009 13:35:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102640#M1360722</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-03T13:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Open SQL - aggregate functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102641#M1360723</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or concatinating two columns of a row. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2009 13:39:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102641#M1360723</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-09-03T13:39:43Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Open SQL - aggregate functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102642#M1360724</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think you can dum two columns, but you should be able to get a concatenated result by the way you define your work area or internal table (haven't tried it).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 03 Sep 2009 13:49:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102642#M1360724</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-03T13:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Open SQL - aggregate functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102643#M1360725</link>
      <description>&lt;P&gt;this SQL compiles but gives a runtime error:  Can anybody Help: &lt;/P&gt;&lt;P&gt;  select&lt;BR /&gt;      service&lt;BR /&gt;      version&lt;BR /&gt;      status&lt;BR /&gt;      proc_date&lt;BR /&gt;      avg( process_time ) as process_time&lt;BR /&gt;      count(*)            as call_count&lt;BR /&gt;&lt;BR /&gt;    into corresponding fields of table lt_srv_hdrlog_c&lt;BR /&gt;    from zca_serv_hdrlog&lt;BR /&gt;    where     proc_date    eq lv_date&lt;BR /&gt;    group by  service&lt;BR /&gt;              version&lt;BR /&gt;              status&lt;BR /&gt;              proc_date.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The run time error is: &lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The
current ABAP program "xxxxxxxxxxxxxxxxxxxxxxx" had to be&lt;/P&gt;&lt;P&gt; 
terminated because it found a&lt;/P&gt;&lt;P&gt;statement
that could not be executed.&lt;/P&gt;&lt;P&gt;In include
"Lxxxxxxxxxxxxxxxxxxxx", in line 114 of program&lt;/P&gt;&lt;P&gt; 
"SAPLxxxxxxxxxxxxx", the following syntax errors&lt;/P&gt;&lt;P&gt;have
occurred:&lt;/P&gt;&lt;P&gt;Unknown
column name "AVG". until runtime, you cannot specify a field l&lt;/P&gt;&lt;P&gt;













&lt;/P&gt;&lt;P&gt;ist.&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 10:09:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102643#M1360725</guid>
      <dc:creator>a142367</dc:creator>
      <dc:date>2022-07-18T10:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: ABAP Open SQL - aggregate functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102644#M1360726</link>
      <description>&lt;P&gt;i have eventually got this working using new open SQL syntax:  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  select&lt;BR /&gt;       mandt&lt;BR /&gt;     , proc_date&lt;BR /&gt;     , service&lt;BR /&gt;     , version&lt;BR /&gt;     , status&lt;BR /&gt;     , count(*)            as call_count&lt;BR /&gt;     , avg( process_time ) as process_time&lt;BR /&gt;&lt;BR /&gt;    from zca_serv_hdrlog&lt;BR /&gt;    where      proc_date   eq @lv_date&lt;BR /&gt;    group by   mandt&lt;BR /&gt;             , proc_date&lt;BR /&gt;             , service&lt;BR /&gt;             , version&lt;BR /&gt;             , status&lt;BR /&gt;    into table @lt_srv_hdrlog_c.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Jul 2022 08:33:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/abap-open-sql-aggregate-functions/m-p/6102644#M1360726</guid>
      <dc:creator>a142367</dc:creator>
      <dc:date>2022-07-20T08:33:55Z</dc:date>
    </item>
  </channel>
</rss>

