<?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: highest record in internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/highest-record-in-internal-table/m-p/1647265#M287839</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sort the table in decending order.&lt;/P&gt;&lt;P&gt;after that just read the itab 1st row(index1)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 20 Nov 2006 06:28:01 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-11-20T06:28:01Z</dc:date>
    <item>
      <title>highest record in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/highest-record-in-internal-table/m-p/1647264#M287838</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;I have one query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose in my internal table itab having field f1 having multiple record. Now i wanted to get the highest value for this field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then i will process other logic based on this highest entry(f1). Could anybody tell me how to do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sample logic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;to count no of entries.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;describe table itab lines sy-tfill.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;now i have to select the highest value in field f1.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to write the logic here??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Nov 2006 06:26:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/highest-record-in-internal-table/m-p/1647264#M287838</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-20T06:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: highest record in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/highest-record-in-internal-table/m-p/1647265#M287839</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;sort the table in decending order.&lt;/P&gt;&lt;P&gt;after that just read the itab 1st row(index1)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Nov 2006 06:28:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/highest-record-in-internal-table/m-p/1647265#M287839</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-20T06:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: highest record in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/highest-record-in-internal-table/m-p/1647266#M287840</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;&lt;/P&gt;&lt;P&gt;Sort the internal table decsending on field f1 and read the first record. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;SORT ITAB DESCENDING BY F1.&lt;/P&gt;&lt;P&gt;READ TABLE itab index 1.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Nov 2006 06:28:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/highest-record-in-internal-table/m-p/1647266#M287840</guid>
      <dc:creator>dani_mn</dc:creator>
      <dc:date>2006-11-20T06:28:22Z</dc:date>
    </item>
    <item>
      <title>Re: highest record in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/highest-record-in-internal-table/m-p/1647267#M287841</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sort itab by f1 descending.&lt;/P&gt;&lt;P&gt;read table itab index 1.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Nov 2006 06:29:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/highest-record-in-internal-table/m-p/1647267#M287841</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-20T06:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: highest record in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/highest-record-in-internal-table/m-p/1647268#M287842</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi salil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. In internal table suppose u have two fields&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    f1&lt;/P&gt;&lt;P&gt;    xyz&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. There are multiple records of f1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. &lt;/P&gt;&lt;P&gt;    a) First sort using SORT ITAB by F1 xyz DESCENDING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   b) loop at itab.&lt;/P&gt;&lt;P&gt;      ON CHANGE OF F1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   *--- ur code here,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     endloop.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. In this way u will get the HIGHEST entry, for each F1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&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;amit m.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Nov 2006 06:30:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/highest-record-in-internal-table/m-p/1647268#M287842</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-20T06:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: highest record in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/highest-record-in-internal-table/m-p/1647269#M287843</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;f1 has multiple records and you want the highest value of the record then sort the table in descending order and read the first value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;field1 has multiple values for field2.&lt;/P&gt;&lt;P&gt;sort tab by field1 field2 descending.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at itab.
  v_tabix = sy-tabix.
  at new field1.
    read table itab index v_tabix.
    " this will be the value highest value of field2 for field1
  endat.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope this helps&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Richa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Nov 2006 08:24:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/highest-record-in-internal-table/m-p/1647269#M287843</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-20T08:24:19Z</dc:date>
    </item>
    <item>
      <title>Re: highest record in internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/highest-record-in-internal-table/m-p/1647270#M287844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Salil,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To find out highest value of any field in an internal table, first sort that internal table by that field(say f1 in ur case) by DESCENDING.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then the first record will be your required highest value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Logic will be,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;sort itab by f1 descending.&amp;lt;/b&amp;gt; " sorting the itab entries in descending order&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;read table itab index 1.&amp;lt;/b&amp;gt; " first record is the your required highest value record&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will clear your query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Ramesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 Nov 2006 08:39:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/highest-record-in-internal-table/m-p/1647270#M287844</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-11-20T08:39:43Z</dc:date>
    </item>
  </channel>
</rss>

