<?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: Sort internal table with char components in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-with-char-components/m-p/5269458#M1216566</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To get the expected result..........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; what you have to do is...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'SORT itab BY a DESCENDING b DESCENDING' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because the above statement sort itab by a 's descending order first then if two row contain same valu for a then column b help to take the decision which one come first. if row one has smaller value in B than that of row two.then row one come next to row two.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 17 Mar 2009 13:32:12 GMT</pubDate>
    <dc:creator>sarbajitm</dc:creator>
    <dc:date>2009-03-17T13:32:12Z</dc:date>
    <item>
      <title>Sort internal table with char components</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-with-char-components/m-p/5269455#M1216563</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a question concerning sorting internal tables. I have a table with two components of type char:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A        B &lt;/P&gt;&lt;P&gt;space space&lt;/P&gt;&lt;P&gt;248     BA&lt;/P&gt;&lt;P&gt;273     space&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to sort the table by 'SORT itab BY a b DESCENDING' - the result I expected is ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A        B&lt;/P&gt;&lt;P&gt;273     space&lt;/P&gt;&lt;P&gt;248     BA&lt;/P&gt;&lt;P&gt;space space&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;... but the computed result is ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A        B &lt;/P&gt;&lt;P&gt;space space&lt;/P&gt;&lt;P&gt;248     BA&lt;/P&gt;&lt;P&gt;273     space&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I assume that the computed result is due to the initial char-values (space). How are initial char-values (space) handled by the sort statement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I appreciate any advice!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings &lt;/P&gt;&lt;P&gt;Wolfgang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2009 13:15:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-with-char-components/m-p/5269455#M1216563</guid>
      <dc:creator>wolfgang_brunneder</dc:creator>
      <dc:date>2009-03-17T13:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: Sort internal table with char components</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-with-char-components/m-p/5269456#M1216564</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt; would you please explain your requirement elaborately?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Sarbajit.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2009 13:22:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-with-char-components/m-p/5269456#M1216564</guid>
      <dc:creator>sarbajitm</dc:creator>
      <dc:date>2009-03-17T13:22:23Z</dc:date>
    </item>
    <item>
      <title>Re: Sort internal table with char components</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-with-char-components/m-p/5269457#M1216565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry, I accidently hit the post button before having finished &lt;STRONG&gt;g&lt;/STRONG&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2009 13:24:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-with-char-components/m-p/5269457#M1216565</guid>
      <dc:creator>wolfgang_brunneder</dc:creator>
      <dc:date>2009-03-17T13:24:11Z</dc:date>
    </item>
    <item>
      <title>Re: Sort internal table with char components</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-with-char-components/m-p/5269458#M1216566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To get the expected result..........&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; what you have to do is...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;'SORT itab BY a DESCENDING b DESCENDING' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because the above statement sort itab by a 's descending order first then if two row contain same valu for a then column b help to take the decision which one come first. if row one has smaller value in B than that of row two.then row one come next to row two.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2009 13:32:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-with-char-components/m-p/5269458#M1216566</guid>
      <dc:creator>sarbajitm</dc:creator>
      <dc:date>2009-03-17T13:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Sort internal table with char components</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-with-char-components/m-p/5269459#M1216567</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;Test the Code Bellow it is working as per you requirement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: BEGIN OF it OCCURS 1,
  a(10),
  b(10),
  END OF it.

  it-a = '273'. it-b = ' '. APPEND it.
  it-a = '248'. it-b = 'BA'. APPEND it.
  it-a = ' '. it-b = ' '. APPEND it.

  SORT it by a DESCENDING b DESCENDING.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Faisal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2009 13:33:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-with-char-components/m-p/5269459#M1216567</guid>
      <dc:creator>faisalatsap</dc:creator>
      <dc:date>2009-03-17T13:33:55Z</dc:date>
    </item>
    <item>
      <title>Re: Sort internal table with char components</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-with-char-components/m-p/5269460#M1216568</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you two very much - it works!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Greetings&lt;/P&gt;&lt;P&gt;Wolfgang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2009 13:38:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-with-char-components/m-p/5269460#M1216568</guid>
      <dc:creator>wolfgang_brunneder</dc:creator>
      <dc:date>2009-03-17T13:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: Sort internal table with char components</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-with-char-components/m-p/5269461#M1216569</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dont use coloum having property of charactor.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you sort internal table based on field having charactor then you will get result as per your computed result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;change your field properties from char to n. then you will get you expected answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example if you have internal table with one coloum 'A'.&lt;/P&gt;&lt;P&gt;let us assume value of that coloum is 1,6,12,7,14,7,19&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you sort result will be 1,12,14,6,7,19. so in this case you have to define coloum with numeric property.&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;Peranandam&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Mar 2009 13:43:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-internal-table-with-char-components/m-p/5269461#M1216569</guid>
      <dc:creator>Peranandam</dc:creator>
      <dc:date>2009-03-17T13:43:06Z</dc:date>
    </item>
  </channel>
</rss>

