<?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 second largest amount from a table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-second-largest-amount-from-a-table/m-p/1718495#M313860</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, I think you may need to get all of the data, then sort the amount column in descending order, then read line two of the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 Nov 2006 19:16:55 GMT</pubDate>
    <dc:creator>RichHeilman</dc:creator>
    <dc:date>2006-11-07T19:16:55Z</dc:date>
    <item>
      <title>select second largest amount from a table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-second-largest-amount-from-a-table/m-p/1718494#M313859</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;I want select second largest amount from a table . How i have to write a query for that?&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;Priya&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2006 19:12:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-second-largest-amount-from-a-table/m-p/1718494#M313859</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-07T19:12:57Z</dc:date>
    </item>
    <item>
      <title>Re: select second largest amount from a table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-second-largest-amount-from-a-table/m-p/1718495#M313860</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, I think you may need to get all of the data, then sort the amount column in descending order, then read line two of the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2006 19:16:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-second-largest-amount-from-a-table/m-p/1718495#M313860</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-11-07T19:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: select second largest amount from a table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-second-largest-amount-from-a-table/m-p/1718496#M313861</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT * from table
  into itab.
sort itab descending by field1.
read table itab index 2.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You'll have to check the syntax. I didn't.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Rob Burbank&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2006 19:16:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-second-largest-amount-from-a-table/m-p/1718496#M313861</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-07T19:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: select second largest amount from a table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-second-largest-amount-from-a-table/m-p/1718497#M313862</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You must write some extra logic for this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of i_tbl occurs 0,&lt;/P&gt;&lt;P&gt;        netwr like vbap-netwr,&lt;/P&gt;&lt;P&gt;      end of i_tbl.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select netwr up to 2 rows from vbap into table i_tbl&lt;/P&gt;&lt;P&gt;   order by netwr descending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table i_tbl index 2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2006 19:18:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-second-largest-amount-from-a-table/m-p/1718497#M313862</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-07T19:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: select second largest amount from a table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-second-largest-amount-from-a-table/m-p/1718498#M313863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John, I like that better.   With the " up to 2 rows ".  Nice.  &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2006 19:22:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-second-largest-amount-from-a-table/m-p/1718498#M313863</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-11-07T19:22:11Z</dc:date>
    </item>
    <item>
      <title>Re: select second largest amount from a table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-second-largest-amount-from-a-table/m-p/1718499#M313864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John - I like yours better.&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, 07 Nov 2006 19:22:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-second-largest-amount-from-a-table/m-p/1718499#M313864</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-07T19:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: select second largest amount from a table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-second-largest-amount-from-a-table/m-p/1718500#M313865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, gentlemen.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Nov 2006 19:29:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-second-largest-amount-from-a-table/m-p/1718500#M313865</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-07T19:29:37Z</dc:date>
    </item>
  </channel>
</rss>

