<?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: Data coming in different order from the data base in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-coming-in-different-order-from-the-data-base/m-p/6202926#M1376360</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use SORT statement after yur select query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;lakshman.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Oct 2009 07:18:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-10-14T07:18:04Z</dc:date>
    <item>
      <title>Data coming in different order from the data base</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-coming-in-different-order-from-the-data-base/m-p/6202924#M1376358</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MSEG contains data (se16) in the order 1 , 2, 3&lt;/P&gt;&lt;P&gt;but if i write select query on it is coming as 2  1 5 ...3 like that&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shortly ..data is coming in different order in the select query even thoug it is in sorted order in the data base.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advacne&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Oct 2009 07:12:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-coming-in-different-order-from-the-data-base/m-p/6202924#M1376358</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-14T07:12:44Z</dc:date>
    </item>
    <item>
      <title>Re: Data coming in different order from the data base</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-coming-in-different-order-from-the-data-base/m-p/6202925#M1376359</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Krishna,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generally when a select query is executed, the selection depends on the WHERE condition and the INDEX on the database table. So, we cannot expect the select statement to retreive the values in the same order as we see in se16.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is the reason, we use SORT statement generally, after selecting the values in to an internal table, as per our requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best Regards,&lt;/P&gt;&lt;P&gt;Ram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Oct 2009 07:17:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-coming-in-different-order-from-the-data-base/m-p/6202925#M1376359</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-14T07:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Data coming in different order from the data base</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-coming-in-different-order-from-the-data-base/m-p/6202926#M1376360</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Use SORT statement after yur select query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;lakshman.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Oct 2009 07:18:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-coming-in-different-order-from-the-data-base/m-p/6202926#M1376360</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-14T07:18:04Z</dc:date>
    </item>
    <item>
      <title>Re: Data coming in different order from the data base</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-coming-in-different-order-from-the-data-base/m-p/6202927#M1376361</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try with the addition of &lt;STRONG&gt;ORDER BY PRIMARY KEY&lt;/STRONG&gt; with your SELECT statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;tables: mseg.

data: begin of t_mseg occurs 0.
        include structure mseg.
data: end of t_mseg.

select * into table t_mseg up to 50 rows
from mseg order by primary key.

loop at t_mseg.
  write:/ t_mseg-mblnr, t_mseg-matnr.
endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Oct 2009 07:29:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-coming-in-different-order-from-the-data-base/m-p/6202927#M1376361</guid>
      <dc:creator>former_member222860</dc:creator>
      <dc:date>2009-10-14T07:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Data coming in different order from the data base</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-coming-in-different-order-from-the-data-base/m-p/6202928#M1376362</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 with the addition of ORDER BY PRIMARY KEY with your SELECT statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for eg select from mseg into table &amp;lt;itab&amp;gt; where &amp;lt;condition&amp;gt; order by mblnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rgds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siva&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Oct 2009 07:40:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-coming-in-different-order-from-the-data-base/m-p/6202928#M1376362</guid>
      <dc:creator>sivaprasad_ml</dc:creator>
      <dc:date>2009-10-14T07:40:15Z</dc:date>
    </item>
    <item>
      <title>Re: Data coming in different order from the data base</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-coming-in-different-order-from-the-data-base/m-p/6202929#M1376363</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;For sorting your data,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Use a SORT statement after your select statement&lt;/P&gt;&lt;P&gt;2. Use aORDER BY PRIMARY KEY along with the statement&lt;/P&gt;&lt;P&gt;3. Create a Primary Index/Secondary index in the database table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;harini&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Oct 2009 08:55:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-coming-in-different-order-from-the-data-base/m-p/6202929#M1376363</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-14T08:55:31Z</dc:date>
    </item>
    <item>
      <title>Re: Data coming in different order from the data base</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/data-coming-in-different-order-from-the-data-base/m-p/6202930#M1376364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you All,&lt;/P&gt;&lt;P&gt;For your reply. But i want to know how and why it is coming in different order.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2009 04:35:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/data-coming-in-different-order-from-the-data-base/m-p/6202930#M1376364</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-15T04:35:19Z</dc:date>
    </item>
  </channel>
</rss>

