<?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 question in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-question/m-p/4248704#M1014103</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Because GT_ITAB is protected in some way - perhaps an importing parameter to a method, for example.  The rest of the program makes no sense, lv_cust never has a value assigned, so I'm not surprised that the 2nd sort "doesn't seem to be working", though you don't specify what you mean by "doesn't seem to be working".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 31 Jul 2008 07:28:06 GMT</pubDate>
    <dc:creator>matt</dc:creator>
    <dc:date>2008-07-31T07:28:06Z</dc:date>
    <item>
      <title>SORT question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-question/m-p/4248702#M1014101</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 the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*SORT GT_ITAB BY name1 ASCENDING.
BREAK-POINT.
LOOP AT gt_itab INTO wa.
*  READ TABLE gt_itab INDEX sy-index INTO lv_wa TRANSPORTING name1.
  lv_wa = wa-name1.
  IF lv_cust &amp;lt;&amp;gt; lv_wa.
    APPEND lv_cust TO lv_new_itab.
    lv_cust = lv_wa.
  ENDIF.
ENDLOOP.

SORT lv_new_itab BY name1 ASCENDING.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why is it so that if I uncomment the 1st line the program check isn't successful - giving me the following message: "&lt;STRONG&gt;You may only read from table "GT_ITAB" . reading. reading. reading. reading. reading.&lt;/STRONG&gt;"&lt;/P&gt;&lt;P&gt;but if I leave it like this (commented) the check goes ok ? Since the last SORT is being accepted it seems that you can't touch on the data after a SORT ? The 2nd sort, nevertheless, doesn't seem to be working anyway.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What's happening ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Avraham&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2008 07:25:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-question/m-p/4248702#M1014101</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-31T07:25:49Z</dc:date>
    </item>
    <item>
      <title>Re: SORT question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-question/m-p/4248703#M1014102</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;Try this.&lt;/P&gt;&lt;P&gt;Use sy-tabix instead of sy-index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For syntax of READ, check&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb35f8358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw70/helpdata/en/fc/eb35f8358411d1829f0000e829fbfe/content.htm&lt;/A&gt;&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;Anirban&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2008 07:27:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-question/m-p/4248703#M1014102</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-31T07:27:51Z</dc:date>
    </item>
    <item>
      <title>Re: SORT question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-question/m-p/4248704#M1014103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Because GT_ITAB is protected in some way - perhaps an importing parameter to a method, for example.  The rest of the program makes no sense, lv_cust never has a value assigned, so I'm not surprised that the 2nd sort "doesn't seem to be working", though you don't specify what you mean by "doesn't seem to be working".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matt&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2008 07:28:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-question/m-p/4248704#M1014103</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2008-07-31T07:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: SORT question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-question/m-p/4248705#M1014104</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;SY-INDEX doesnt work for Internal table loops, but only for conditional loops. Try using SY-TABIX for the INDEX in your READ statement&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2008 07:29:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-question/m-p/4248705#M1014104</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-31T07:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: SORT question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-question/m-p/4248706#M1014105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The READ statement is commented, guys, sorry, I should have taken it off the excerpt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Matthew, maybe you have a point - because indeed my table is an imported parameter - this piece of code is within a Form.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2008 07:31:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-question/m-p/4248706#M1014105</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-31T07:31:28Z</dc:date>
    </item>
    <item>
      <title>Re: SORT question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-question/m-p/4248707#M1014106</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For those of you wittering on about sy-index - please READ THE QUESTION.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2008 07:31:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-question/m-p/4248707#M1014106</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2008-07-31T07:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: SORT question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-question/m-p/4248708#M1014107</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2008 07:32:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-question/m-p/4248708#M1014107</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-31T07:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: SORT question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-question/m-p/4248709#M1014108</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Matt, lv_cust does have a value assigned, it is defined under the Global definitions in the Form. It starts with ''. The debugging shows (and actually the form preview) the values are being assigned.&lt;/P&gt;&lt;P&gt;I have to delve into your hint about "protected in some way".&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2008 07:36:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-question/m-p/4248709#M1014108</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-31T07:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: SORT question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-question/m-p/4248710#M1014109</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK.  Sometimes it's difficult to get the balance between posting too much code, and posting too little!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note, that it may not just be the form.  If the form is called from a function module that's called from a method that has the table as an importing parameter, you'll get the same problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2008 07:39:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-question/m-p/4248710#M1014109</guid>
      <dc:creator>matt</dc:creator>
      <dc:date>2008-07-31T07:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: SORT question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-question/m-p/4248711#M1014110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need to check "Pass by Value" in Form Interface Parameter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2008 07:42:08 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-question/m-p/4248711#M1014110</guid>
      <dc:creator>Shafiq_Rehman1</dc:creator>
      <dc:date>2008-07-31T07:42:08Z</dc:date>
    </item>
    <item>
      <title>Re: SORT question</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/sort-question/m-p/4248712#M1014111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Shafiq, good catch.&lt;/P&gt;&lt;P&gt;The check doesn't complain now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 31 Jul 2008 08:00:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/sort-question/m-p/4248712#M1014111</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-07-31T08:00:43Z</dc:date>
    </item>
  </channel>
</rss>

