<?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: sorted tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-tables/m-p/2097401#M436828</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Charles,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
sorteditab[] = standard_itab[]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;is correct but will cause a dump if you have duplicate keys in the standard_itab.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
loop at standard_itab into wa.
  insert wa into sorteditab.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;is comparably very slow because for all loops the table line is copied to the work area. And it is syntacticalkly not correct because you must use into table ... when inserting into sorted itabs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do it using field-symbols, optional remember duplicates:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
field-symbols:
  &amp;lt;itab&amp;gt; like standard_itab.
data:
  lt_itab_dup like sorteditab.
loop at standard_itab assigning &amp;lt;itab&amp;gt;.
  insert &amp;lt;itab&amp;gt; into table sorteditab. "Note: must use TABLE otherwise syntax error
  check sy-subrc &amp;lt;&amp;gt; 0. "Record akready exists
  insert &amp;lt;itab&amp;gt; into table lt_itab_dup.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now it won't fail under any circumstances. And you have the duplicate key records in table lt_itab_dup for evaulation purposes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 11 Apr 2007 14:01:41 GMT</pubDate>
    <dc:creator>Clemenss</dc:creator>
    <dc:date>2007-04-11T14:01:41Z</dc:date>
    <item>
      <title>sorted tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-tables/m-p/2097397#M436824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;eg. is this way of doing correct for building sorted table?&lt;/P&gt;&lt;P&gt;will this lose the binary properties for quick access?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
sort standard_itab by a b c.
sorteditab[] = standard_itab[]
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or should it be this way? using insert?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
loop at standard_itab into wa.
  insert wa into sorteditab.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2007 07:35:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-tables/m-p/2097397#M436824</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-11T07:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: sorted tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-tables/m-p/2097398#M436825</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;Actually with insert statement, compiler will take care of the sorting where else using sort command, you explicitly sort the table....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2007 07:37:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-tables/m-p/2097398#M436825</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-11T07:37:40Z</dc:date>
    </item>
    <item>
      <title>Re: sorted tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-tables/m-p/2097399#M436826</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi,&lt;/P&gt;&lt;P&gt;     try this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort standard_itab by &amp;lt;field1&amp;gt;.&lt;/P&gt;&lt;P&gt;loop at standard_itab into wa.&lt;/P&gt;&lt;P&gt;  insert wa into sorteditab.&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;if helpful reward  plz&lt;/P&gt;&lt;P&gt;ravi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2007 07:41:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-tables/m-p/2097399#M436826</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-11T07:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: sorted tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-tables/m-p/2097400#M436827</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The first form is an effective way of doing things. I would suggest going with the first way of moving the body of the internal table to other, there will be no loss ofbinary properties moreover it is more efficient in terms of performance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2007 07:51:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-tables/m-p/2097400#M436827</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-11T07:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: sorted tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-tables/m-p/2097401#M436828</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Charles,&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
sorteditab[] = standard_itab[]&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;is correct but will cause a dump if you have duplicate keys in the standard_itab.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
loop at standard_itab into wa.
  insert wa into sorteditab.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;is comparably very slow because for all loops the table line is copied to the work area. And it is syntacticalkly not correct because you must use into table ... when inserting into sorted itabs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do it using field-symbols, optional remember duplicates:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
field-symbols:
  &amp;lt;itab&amp;gt; like standard_itab.
data:
  lt_itab_dup like sorteditab.
loop at standard_itab assigning &amp;lt;itab&amp;gt;.
  insert &amp;lt;itab&amp;gt; into table sorteditab. "Note: must use TABLE otherwise syntax error
  check sy-subrc &amp;lt;&amp;gt; 0. "Record akready exists
  insert &amp;lt;itab&amp;gt; into table lt_itab_dup.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now it won't fail under any circumstances. And you have the duplicate key records in table lt_itab_dup for evaulation purposes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Apr 2007 14:01:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-tables/m-p/2097401#M436828</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2007-04-11T14:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: sorted tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-tables/m-p/2097402#M436829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I thought according to SAP...using field-symbols would NOT be efficient if the the WA size is small.. it would benefit if size is huge?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2007 03:19:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-tables/m-p/2097402#M436829</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-04-12T03:19:01Z</dc:date>
    </item>
    <item>
      <title>Re: sorted tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-tables/m-p/2097403#M436830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Charles,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;using Field-symbols will not be &amp;lt;b&amp;gt;slower&amp;lt;/b&amp;gt; under any circumstances.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;WA size small means: 1 field or less &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clemens&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Apr 2007 07:39:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sorted-tables/m-p/2097403#M436830</guid>
      <dc:creator>Clemenss</dc:creator>
      <dc:date>2007-04-12T07:39:37Z</dc:date>
    </item>
  </channel>
</rss>

