<?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/2149312#M453717</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;it is considering the POSNR according to the starting number..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do one thing..take &amp;lt;b&amp;gt;POSNR field data type as N&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thhis will solve ur problem..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Apr 2007 13:47:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-04-18T13:47:29Z</dc:date>
    <item>
      <title>SORTING Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/2149307#M453712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt; I have an internal table as given below. I need to display the O/P by Sorting according to POSNR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Before sorting :_&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; POSNR  MATNR                   FLAG LFIMG         VRKME MAKTX&lt;/P&gt;&lt;P&gt; 120   |000000000000716740|  B        |10               |ST       |Pallet (Euro)         &lt;/P&gt;&lt;P&gt; 40    |000000000000716740|  B         |10               |ST       |Pallet (Euro)          &lt;/P&gt;&lt;P&gt; 50    |000000000000716790|  B         |10               |ST       |Pallet (BPD)           &lt;/P&gt;&lt;P&gt; 130   |000000000000716809| B         |10               |ST       |Pallet (BPD)           &lt;/P&gt;&lt;P&gt; 60    |000000000000716809|  B         |10              |ST        |Pallet (BPD)           &lt;/P&gt;&lt;P&gt; 70    |000000000000716810|  B         |10              |ST        |Container              &lt;/P&gt;&lt;P&gt; 80    |000000000000716812|  B         |10              |ST        |RIC                    &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Am using statement - SORT t_empties BY  POSNR.&lt;/P&gt;&lt;P&gt;After Sorting:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; POSNR          MATNR              FLAG        LFIMG    VRKME     MAKTX&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;120   |000000000000716740        |B              |10           |ST         |Pallet ro)          &lt;/P&gt;&lt;P&gt;130   |000000000000716809        |B              |10           |ST   |Pallet (BPD)           &lt;/P&gt;&lt;P&gt;40    |000000000000716740         |B             |10           |ST   |Pallet (Euro)          &lt;/P&gt;&lt;P&gt;50    |000000000000716790         |B             |10           |ST   |Pallet (BPD)           &lt;/P&gt;&lt;P&gt;60    |000000000000716809         |B             |10           |ST   |Pallet (BPD)           &lt;/P&gt;&lt;P&gt;70    |000000000000716810         |B             |10           |ST   |Container              &lt;/P&gt;&lt;P&gt;80    |000000000000716812         |B              |10           |ST   |RIC                   &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can any one ples let me know why its not getting sorted correctly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Avi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 13:31:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/2149307#M453712</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T13:31:42Z</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/2149308#M453713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;By default it should sort on ascending, may be tru to use ASCENDING key word in SORT statement and see.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 13:35:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/2149308#M453713</guid>
      <dc:creator>alex_m</dc:creator>
      <dc:date>2007-04-18T13:35:04Z</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/2149309#M453714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Keep the POSNR as first field in the internal Table and then it will come correctly&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if useful&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 13:36:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/2149309#M453714</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T13:36:33Z</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/2149310#M453715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How is the field POSNR defined?  It needs to be numeric for the sort to work the way that you want it to.  It looks to me like the sort is treating POSNR as a character field, with the values being left-justified (the 1 in 120 comes before the 4 in 40).  &lt;/P&gt;&lt;P&gt; - April King&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 13:40:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/2149310#M453715</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T13:40:35Z</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/2149311#M453716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;loop at itab into wa_itab.

   CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          input  = wa_itab-posnr.
        IMPORTING
          output = wa_itab-posnr.

modify itab from wa_itab.

endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;SORT ITAB BY POSNR.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 13:43:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/2149311#M453716</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T13:43:56Z</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/2149312#M453717</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;it is considering the POSNR according to the starting number..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;do one thing..take &amp;lt;b&amp;gt;POSNR field data type as N&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thhis will solve ur problem..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 13:47:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/2149312#M453717</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T13:47:29Z</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/2149313#M453718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Alexander,&lt;/P&gt;&lt;P&gt;    I tried with keeping ASCENDING . Its not working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hi Anji,&lt;/P&gt;&lt;P&gt;    Its the FIRST Field of internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hi April King,&lt;/P&gt;&lt;P&gt;    The internal table is defined according to a Structure created&lt;/P&gt;&lt;P&gt;inside the strcuture its defined as:-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;POSNR  Component Type = POSNR, Data Type = NUMC &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Avi....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 14:00:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/2149313#M453718</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T14:00:17Z</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/2149314#M453719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;so have you tried my cide??&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 14:03:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/2149314#M453719</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T14:03:17Z</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/2149315#M453720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There are two things I would suggest trying.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1)  You could define POSNR as TYPE N instead of NUMC.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) When you are moving values to POSNR, fill the leading characters with zeroes.  This will effectively right justify your field and should result in the correct sort order.&lt;/P&gt;&lt;P&gt; - April&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 14:09:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/2149315#M453720</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T14:09:09Z</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/2149316#M453721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Chandra,&lt;/P&gt;&lt;P&gt; Thx a lot solved the issue&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Avi...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Apr 2007 14:21:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorting-internal-table/m-p/2149316#M453721</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-18T14:21:59Z</dc:date>
    </item>
  </channel>
</rss>

