<?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: max aggregate functions in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/max-aggregate-functions/m-p/2572748#M587611</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;select max( ERDAT ) &lt;/P&gt;&lt;P&gt;into maxfeild&lt;/P&gt;&lt;P&gt;from vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;shiba dutta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 25 Jul 2007 04:06:16 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-07-25T04:06:16Z</dc:date>
    <item>
      <title>max aggregate functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/max-aggregate-functions/m-p/2572744#M587607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;in VBAK table i need latest date entered i.e max date value, field is ERDAT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can anybody write syntax for this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select max( ERDAT ) &lt;/P&gt;&lt;P&gt;from vbak &lt;/P&gt;&lt;P&gt;into maxfeild&lt;/P&gt;&lt;P&gt;group by ERDAT.&lt;/P&gt;&lt;P&gt;endselect.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think it is wrong can anybody write correct syntax.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 03:47:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/max-aggregate-functions/m-p/2572744#M587607</guid>
      <dc:creator>sudhakar196</dc:creator>
      <dc:date>2007-07-25T03:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: max aggregate functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/max-aggregate-functions/m-p/2572745#M587608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try using this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF NOT it_ekpo[] IS INITIAL.&lt;/P&gt;&lt;P&gt;  SELECT ebeln&lt;/P&gt;&lt;P&gt;         ebelp&lt;/P&gt;&lt;P&gt;         etenr&lt;/P&gt;&lt;P&gt;         eindt&lt;/P&gt;&lt;P&gt;         menge&lt;/P&gt;&lt;P&gt;         wemng&lt;/P&gt;&lt;P&gt;    FROM eket &lt;/P&gt;&lt;P&gt;    INTO TABLE it_eket&lt;/P&gt;&lt;P&gt;    FOR ALL ENTRIES IN it_ekpo&lt;/P&gt;&lt;P&gt;    WHERE ebeln EQ it_ekpo-ebeln&lt;/P&gt;&lt;P&gt;    AND   ebelp EQ it_ekpo-ebelp.&lt;/P&gt;&lt;P&gt;  IF sy-subrc EQ 0.&lt;/P&gt;&lt;P&gt;    SORT it_eket BY ebeln ASCENDING&lt;/P&gt;&lt;P&gt;                    ebelp ASCENDING&lt;/P&gt;&lt;P&gt;                    eindt DESCENDING.&lt;/P&gt;&lt;P&gt;    DELETE ADJACENT DUPLICATES FROM it_eket COMPARING ebeln&lt;/P&gt;&lt;P&gt;                                                      ebelp.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check the below link :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive_macro jive_macro_thread" href="https://community.sap.com/" __jive_macro_name="thread" modifiedtitle="true" __default_attr="431424"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Seshu&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Seshu Maramreddy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 03:51:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/max-aggregate-functions/m-p/2572745#M587608</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-25T03:51:48Z</dc:date>
    </item>
    <item>
      <title>Re: max aggregate functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/max-aggregate-functions/m-p/2572746#M587609</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sudhakar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this syntax&lt;/P&gt;&lt;P&gt;select max( ERDAT )&lt;/P&gt;&lt;P&gt;from vbak&lt;/P&gt;&lt;P&gt;into maxfeild.&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;*group by ERDAT.&lt;/P&gt;&lt;P&gt;*endselect.&lt;/P&gt;&lt;P&gt;&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) If you specify aggregate functions together with one or more database fields in a SELECT clause, all database fields not used in one of the aggregate functions must be listed in the GROUP-BY clause . Here, the result of the selection is a table.&lt;/P&gt;&lt;P&gt;2) If only aggregate functions occur in the SELECT clause, the result of the selection is a single record. Here, the SELECT command is not followed later by an ENDSELECT . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 03:59:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/max-aggregate-functions/m-p/2572746#M587609</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-25T03:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: max aggregate functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/max-aggregate-functions/m-p/2572747#M587610</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is the correct one&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data maxfield type vbak-erdat .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select max( ERDAT )&lt;/P&gt;&lt;P&gt;from vbak&lt;/P&gt;&lt;P&gt;into maxfield.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reawrd if useful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 04:06:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/max-aggregate-functions/m-p/2572747#M587610</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-25T04:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: max aggregate functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/max-aggregate-functions/m-p/2572748#M587611</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;select max( ERDAT ) &lt;/P&gt;&lt;P&gt;into maxfeild&lt;/P&gt;&lt;P&gt;from vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;shiba dutta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 04:06:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/max-aggregate-functions/m-p/2572748#M587611</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-25T04:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: max aggregate functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/max-aggregate-functions/m-p/2572749#M587612</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if u only want the max date entered.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single max ( field ) into &amp;lt;table&amp;gt; from &amp;lt;database&amp;gt; up to 1 rows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if there is chances of so many entries for the maximum date.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select kunnr max ( field ) into &amp;lt;table&amp;gt; from &amp;lt;database&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if usefull&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 04:48:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/max-aggregate-functions/m-p/2572749#M587612</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2007-07-25T04:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: max aggregate functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/max-aggregate-functions/m-p/2572750#M587613</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;or u can use this too..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single date from vbak into &amp;lt;itab&amp;gt;  order by date descending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but using order by is a bit worst than using max.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try using max for performance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 25 Jul 2007 04:49:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/max-aggregate-functions/m-p/2572750#M587613</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2007-07-25T04:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: max aggregate functions</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/max-aggregate-functions/m-p/2572751#M587614</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hey,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as  Seshu Maramreddy said, thats the best way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First u should fill the itab, then sort it and after&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Jul 2010 20:17:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/max-aggregate-functions/m-p/2572751#M587614</guid>
      <dc:creator>macristina_briceo</dc:creator>
      <dc:date>2010-07-09T20:17:51Z</dc:date>
    </item>
  </channel>
</rss>

