<?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: Internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1240955#M142124</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;Sort the table by ascending/descending order on the respective columns.. the first row in itab will give the least/largest value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also there is an Func. MAX. But it works on N, I, P types.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MAX(column1) gives maximum of column1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anjali&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Mar 2006 10:14:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-03-31T10:14:50Z</dc:date>
    <item>
      <title>Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1240954#M142123</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; i have a Internal table  with two fields and i need to findout maximum value  of the field value.&lt;/P&gt;&lt;P&gt;how can i do tht&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plese help me&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks &lt;/P&gt;&lt;P&gt;sai&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2006 10:12:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1240954#M142123</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-31T10:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1240955#M142124</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;Sort the table by ascending/descending order on the respective columns.. the first row in itab will give the least/largest value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also there is an Func. MAX. But it works on N, I, P types.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MAX(column1) gives maximum of column1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Anjali&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2006 10:14:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1240955#M142124</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-31T10:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1240956#M142125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sai,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT the table by the field in question and read the first row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT table by Column1 descending.&lt;/P&gt;&lt;P&gt;read table into workarea index 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The value in the workarea will be the maximum one.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : Please mark the helpful answers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2006 10:15:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1240956#M142125</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-31T10:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1240957#M142126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;YOu wqant oto compare the two fields or you want the maximum value in all the records?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think you want the second:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab.&lt;/P&gt;&lt;P&gt;if itab-field &amp;gt; l_max.&lt;/P&gt;&lt;P&gt;l_max = itab-field.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at the end of the loop, you will have the max value in l_max.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2006 10:15:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1240957#M142126</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-31T10:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1240958#M142127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1) sort itab by decending order.&lt;/P&gt;&lt;P&gt;2)read table itab into wa.&lt;/P&gt;&lt;P&gt;3)wa-field1.(max value)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2006 10:15:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1240958#M142127</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-31T10:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1240959#M142128</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; As per your question you want to know the the field name which contain maximum value.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   so you can TRY OUT THIS LIGIC&lt;/P&gt;&lt;P&gt;REPORT ztemp .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; TYPES: BEGIN OF line,&lt;/P&gt;&lt;P&gt;          brand(10) TYPE c,&lt;/P&gt;&lt;P&gt;          rate(3)   TYPE p DECIMALS 2,&lt;/P&gt;&lt;P&gt;          gender(1) TYPE c,&lt;/P&gt;&lt;P&gt;          sno       TYPE i,&lt;/P&gt;&lt;P&gt;          desc(30)  TYPE c,&lt;/P&gt;&lt;P&gt;        END OF line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DATA: it_lines_1 TYPE TABLE OF line&lt;/P&gt;&lt;P&gt;                  WITH KEY brand&lt;/P&gt;&lt;P&gt;                           rate&lt;/P&gt;&lt;P&gt;                           gender,&lt;/P&gt;&lt;P&gt;       wa_lines_1 LIKE LINE OF it_lines_1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DATA: it_lines_2 TYPE TABLE OF line&lt;/P&gt;&lt;P&gt;                  WITH KEY brand&lt;/P&gt;&lt;P&gt;                           rate&lt;/P&gt;&lt;P&gt;                           gender,&lt;/P&gt;&lt;P&gt;       wa_lines_2 LIKE LINE OF it_lines_2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; DATA: gi_counter TYPE i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; START-OF-SELECTION.&lt;/P&gt;&lt;P&gt;   PERFORM fill_it_line_1. " not included; tested with your 4 records&lt;/P&gt;&lt;P&gt;   SORT it_lines_1.&lt;/P&gt;&lt;P&gt;   CLEAR gi_counter.&lt;/P&gt;&lt;P&gt;   LOOP AT it_lines_1 INTO wa_lines_1.&lt;/P&gt;&lt;P&gt;     wa_lines_2 = wa_lines_1.&lt;/P&gt;&lt;P&gt;     ADD 1 TO gi_counter.&lt;/P&gt;&lt;P&gt;     AT END OF gender.&lt;/P&gt;&lt;P&gt;       IF gi_counter &amp;gt; 1.&lt;/P&gt;&lt;P&gt;         APPEND wa_lines_2 TO it_lines_2.&lt;/P&gt;&lt;P&gt;       ENDIF.&lt;/P&gt;&lt;P&gt;       CLEAR gi_counter.&lt;/P&gt;&lt;P&gt;     ENDAT.&lt;/P&gt;&lt;P&gt;   ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i HOPE THIS WILL HELP YOU TO SOLVE YOR PROBLEM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THANKS&lt;/P&gt;&lt;P&gt;MRUTYUNJAYA TRIPATHY&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2006 10:32:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1240959#M142128</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-31T10:32:01Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1240960#M142129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;MAX() on internal tables? Howto?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2006 14:05:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1240960#M142129</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2006-03-31T14:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1240961#M142130</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sai,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you can use MAX keyword as an addition in your SELECT statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For eg:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: CARRID TYPE SFLIGHT-CARRID,&lt;/P&gt;&lt;P&gt;      MINIMUM TYPE P DECIMALS 2,&lt;/P&gt;&lt;P&gt;      MAXIMUM TYPE P DECIMALS 2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT   CARRID MIN( PRICE ) MAX( PRICE )&lt;/P&gt;&lt;P&gt;INTO     (CARRID, MINIMUM, MAXIMUM)&lt;/P&gt;&lt;P&gt;FROM     SFLIGHT&lt;/P&gt;&lt;P&gt;GROUP BY CARRID.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  WRITE: / CARRID, MINIMUM, MAXIMUM.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDSELECT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the output of this code I got is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DL    100.00   100,000.00&lt;/P&gt;&lt;P&gt;LH     14.00   234,560.00&lt;/P&gt;&lt;P&gt;RAJ     0.00       849.00&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so it will select each value of 'DL', 'LH' and raj and compare the various values of each and maximum will be displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I suppose your query is solved.&lt;/P&gt;&lt;P&gt;If so , please close the thread by awarding points to helpful answers.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sylendra.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2006 14:23:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1240961#M142130</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-03-31T14:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1240962#M142131</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorting is a bad idea. Sorting needs O(log(n)&lt;STRONG&gt;n) to O(n&lt;/STRONG&gt;n) cycles to get the tabl sorted. Just went thru it and compare the actiual value with the first one The first one is accessible thur read index 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is only O(n) and the fastest way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Mar 2006 14:42:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table/m-p/1240962#M142131</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2006-03-31T14:42:42Z</dc:date>
    </item>
  </channel>
</rss>

