<?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: Sorting internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/4778511#M1119625</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've chosen this thread of the duplicates to retain, as it seems to have the most useful answers.  In future, if network response results in duplicate posts, for your own benefit, please edit the duplicates with some text like : "Duplicate post, ignore".  This will ensure you get responses against only one question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank-you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Nov 2008 06:41:02 GMT</pubDate>
    <dc:creator>matt</dc:creator>
    <dc:date>2008-11-04T06:41:02Z</dc:date>
    <item>
      <title>Sorting internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/4778503#M1119617</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 need to sort an internal table based on a field. The field is of datatype character. The actual data in the field is number. For example consider sample data for the field to be 1, 112, 102, 2. When i try to sort this it is sorted as 1, 102, 112, 2. I need it to be sorted properly as 1, 2, 102, 112. Is it because of the datatype? Is there any solution for it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls help. Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 06:15:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/4778503#M1119617</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-04T06:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/4778504#M1119618</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Do not post the same questions multiple times. This will not increase answers for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyways, you can sort internal table by :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SORT &amp;lt;internal_table&amp;gt; BY &amp;lt;fieldname&amp;gt; ASCENDING/DESCENDING.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Saba&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 06:19:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/4778504#M1119618</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-04T06:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/4778505#M1119619</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ramanan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Either use the data type as numeric type or u shud add zeros in front before sorting to give you the proper results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Surinder&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 06:22:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/4778505#M1119619</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-04T06:22:06Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/4778506#M1119620</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I did not post multiple times. It was because nw slowdown. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using the same syntax already. By default it is ascending, so this addition is not needed. The problem is with the data type.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 06:23:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/4778506#M1119620</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-04T06:23:58Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/4778507#M1119621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Ramanan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The sorting will work porpely evenb with char data types.&lt;/P&gt;&lt;P&gt;Simple SORT &amp;lt;itab&amp;gt; by &amp;lt;field&amp;gt; will do .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;P.S: Please do not create multiple threads for same query!&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds,&lt;/P&gt;&lt;P&gt;Sandeep&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 06:24:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/4778507#M1119621</guid>
      <dc:creator>Sandeep_Panghal</dc:creator>
      <dc:date>2008-11-04T06:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/4778508#M1119622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then try changing the datatype of the field to integer or any numeric type. This way you can solve your problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 06:26:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/4778508#M1119622</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-04T06:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/4778509#M1119623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;REPORT  ZSRK_023                                .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TYPES : BEGIN OF TP_FINAL,&lt;/P&gt;&lt;P&gt;        &lt;STRONG&gt;F1(4) TYPE C,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;        F2 TYPE C,&lt;/P&gt;&lt;P&gt;        F3 TYPE I,&lt;/P&gt;&lt;P&gt;        END OF TP_FINAL.&lt;/P&gt;&lt;P&gt;DATA : IT_FINAL TYPE TABLE OF TP_FINAL,&lt;/P&gt;&lt;P&gt;       WA_FINAL TYPE TP_FINAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WA_FINAL-F1 = '1'.&lt;/P&gt;&lt;P&gt;WA_FINAL-F2 = 'A'.&lt;/P&gt;&lt;P&gt;WA_FINAL-F3 = 1.&lt;/P&gt;&lt;P&gt;APPEND WA_FINAL TO IT_FINAL.&lt;/P&gt;&lt;P&gt;CLEAR WA_FINAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WA_FINAL-F1 = '112'.&lt;/P&gt;&lt;P&gt;WA_FINAL-F2 = 'B'.&lt;/P&gt;&lt;P&gt;WA_FINAL-F3 = 2.&lt;/P&gt;&lt;P&gt;APPEND WA_FINAL TO IT_FINAL.&lt;/P&gt;&lt;P&gt;CLEAR WA_FINAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WA_FINAL-F1 = '102'.&lt;/P&gt;&lt;P&gt;WA_FINAL-F2 = 'C'.&lt;/P&gt;&lt;P&gt;WA_FINAL-F3 = 3.&lt;/P&gt;&lt;P&gt;APPEND WA_FINAL TO IT_FINAL.&lt;/P&gt;&lt;P&gt;CLEAR WA_FINAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WA_FINAL-F1 = '2'.&lt;/P&gt;&lt;P&gt;WA_FINAL-F2 = 'D'.&lt;/P&gt;&lt;P&gt;WA_FINAL-F3 = 4.&lt;/P&gt;&lt;P&gt;APPEND WA_FINAL TO IT_FINAL.&lt;/P&gt;&lt;P&gt;CLEAR WA_FINAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT IT_FINAL INTO WA_FINAL.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;EXPORTING&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;      &lt;STRONG&gt;INPUT  = WA_FINAL-F1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;IMPORTING&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;      &lt;STRONG&gt;OUTPUT = WA_FINAL-F1.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  MODIFY IT_FINAL FROM WA_FINAL.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT IT_FINAL BY F1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LOOP AT IT_FINAL INTO WA_FINAL.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;EXPORTING&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;      &lt;STRONG&gt;INPUT  = WA_FINAL-F1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;    &lt;STRONG&gt;IMPORTING&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;      &lt;STRONG&gt;OUTPUT = WA_FINAL-F1.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;WRITE : / WA_FINAL-F1.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ENDLOOP.&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 06:34:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/4778509#M1119623</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-04T06:34:38Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/4778510#M1119624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sreekanth,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the reply. The problem is solved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 06:39:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/4778510#M1119624</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-04T06:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/4778511#M1119625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've chosen this thread of the duplicates to retain, as it seems to have the most useful answers.  In future, if network response results in duplicate posts, for your own benefit, please edit the duplicates with some text like : "Duplicate post, ignore".  This will ensure you get responses against only one question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank-you&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 06:41:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/4778511#M1119625</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2008-11-04T06:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Sorting internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/4778512#M1119626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you change the field type from character to integer or numeric,you will get your objectve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the field to be character type you need to proceed as below&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  Zsort.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF ITAB OCCURS 0,&lt;/P&gt;&lt;P&gt;       var(3) type c ,&lt;/P&gt;&lt;P&gt;       end of itab ,&lt;/P&gt;&lt;P&gt;       wa like line of itab .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa-var = '1'.&lt;/P&gt;&lt;P&gt;append wa to itab .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa-var = '112'.&lt;/P&gt;&lt;P&gt;append wa to itab .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa-var = '102'.&lt;/P&gt;&lt;P&gt;append wa to itab .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;wa-var = '2'.&lt;/P&gt;&lt;P&gt;append wa to itab .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab into wa .&lt;/P&gt;&lt;P&gt;  write : / wa-var .&lt;/P&gt;&lt;P&gt;  endloop .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;at line-selection .&lt;/P&gt;&lt;P&gt; loop at itab into wa .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      input         = wa-var&lt;/P&gt;&lt;P&gt;   IMPORTING&lt;/P&gt;&lt;P&gt;     OUTPUT        = wa-var&lt;/P&gt;&lt;P&gt;            .&lt;/P&gt;&lt;P&gt;  modify itab from wa.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  sort itab by var .&lt;/P&gt;&lt;P&gt;   break-point .&lt;/P&gt;&lt;P&gt;  loop at itab into wa .&lt;/P&gt;&lt;P&gt;  write : / wa-var .&lt;/P&gt;&lt;P&gt;  endloop .&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Nov 2008 07:28:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/4778512#M1119626</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-11-04T07:28:27Z</dc:date>
    </item>
  </channel>
</rss>

