<?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 select maximum in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-maximum/m-p/6889117#M1479780</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT PSPNR&lt;/P&gt;&lt;P&gt; REVISION&lt;/P&gt;&lt;P&gt; DU&lt;/P&gt;&lt;P&gt; BOM_NO&lt;/P&gt;&lt;P&gt; ITEM_NO &lt;/P&gt;&lt;P&gt;UNIT &lt;/P&gt;&lt;P&gt;MATNR&lt;/P&gt;&lt;P&gt; FROM ZMED_GMSDATA INTO TABLE IT_GMS&lt;/P&gt;&lt;P&gt; FOR ALL ENTRIES IN IT_FINAL WHERE pspnr = it_final-pspnr AND DU = IT_FINAL-ZZDU.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here i want to select maximum of DU please help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 May 2010 14:57:34 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-05-06T14:57:34Z</dc:date>
    <item>
      <title>select maximum</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-maximum/m-p/6889117#M1479780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT PSPNR&lt;/P&gt;&lt;P&gt; REVISION&lt;/P&gt;&lt;P&gt; DU&lt;/P&gt;&lt;P&gt; BOM_NO&lt;/P&gt;&lt;P&gt; ITEM_NO &lt;/P&gt;&lt;P&gt;UNIT &lt;/P&gt;&lt;P&gt;MATNR&lt;/P&gt;&lt;P&gt; FROM ZMED_GMSDATA INTO TABLE IT_GMS&lt;/P&gt;&lt;P&gt; FOR ALL ENTRIES IN IT_FINAL WHERE pspnr = it_final-pspnr AND DU = IT_FINAL-ZZDU.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here i want to select maximum of DU please help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 May 2010 14:57:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-maximum/m-p/6889117#M1479780</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-06T14:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: select maximum</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-maximum/m-p/6889118#M1479781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi rajashiva  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use this code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT PSPNR
REVISION

 MAX( DU )

BOM_NO
ITEM_NO
UNIT
MATNR
FROM ZMED_GMSDATA INTO TABLE IT_GMS
FOR ALL ENTRIES IN IT_FINAL WHERE pspnr = it_final-pspnr AND DU = IT_FINAL-ZZDU
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;Marco&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 May 2010 15:09:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-maximum/m-p/6889118#M1479781</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-06T15:09:04Z</dc:date>
    </item>
    <item>
      <title>Re: select maximum</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-maximum/m-p/6889119#M1479782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't understand.  You want the maximum DU, but you have the clause &lt;EM&gt;DU = IT_FINAL-ZZDU&lt;/EM&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You want maximum DU in wich group of data?  Or you want to use maximum DU in IT_FINAL for each IT_FINAL-POSNR?  If this is the case you shoud delete previously records on IT_FINAL wich DU are not the maximum for each POSNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But please, clarify your request.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 May 2010 15:16:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-maximum/m-p/6889119#M1479782</guid>
      <dc:creator>gastn_jareo</dc:creator>
      <dc:date>2010-05-06T15:16:04Z</dc:date>
    </item>
    <item>
      <title>Re: select maximum</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-maximum/m-p/6889120#M1479783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Marco,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Unfortunately you cannot use any aggregate functions with FAE except COUNT (*). SAP says:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;If the addition FOR ALL ENTRIES is used in front of WHERE, or if cluster or pool tables are listed after FROM, no other aggregate expressions apart from COUNT( * ) can be used&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;@OP: You have to sort your internal table with DU as descending &amp;amp; then DELETE ADJACENT DUPLICATES. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PS: While using FAE always remember to select all the key fields .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 May 2010 15:20:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-maximum/m-p/6889120#M1479783</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2010-05-06T15:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: select maximum</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-maximum/m-p/6889121#M1479784</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to select only one record, and that record is the one that has the maximum value of DU then you should sort IT_FINAL by DU descending (as Suhas said) and then select data with this clause:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;FROM ZMED_GMSDATA
     UP TO 1 ROWS
     INTO TABLE IT_GMS&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Furthermore, as it will give you only one record you can use a structure instead an internal table to store the result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 May 2010 15:38:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-maximum/m-p/6889121#M1479784</guid>
      <dc:creator>gastn_jareo</dc:creator>
      <dc:date>2010-05-06T15:38:58Z</dc:date>
    </item>
  </channel>
</rss>

