<?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: Select statment problem in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statment-problem/m-p/10413236#M1843714</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This table not has the month as key and index. (In my SAP version)&lt;/P&gt;&lt;P&gt;The date available in the key is the year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you &lt;SPAN style="text-decoration: underline;"&gt;realy&lt;/SPAN&gt; need to select this table using month, create a index (ask if possible to basis team and explain the reason). In your index you can use these fields:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BUKRS&lt;BR /&gt;GJAHR&lt;BR /&gt;BUDAT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Jun 2014 16:50:13 GMT</pubDate>
    <dc:creator>arthur_alvesteixeira</dc:creator>
    <dc:date>2014-06-30T16:50:13Z</dc:date>
    <item>
      <title>Select statment problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statment-problem/m-p/10413235#M1843713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Experts, Data is selected from VBKPF table based on previous month posting date range.Here data not coming as primary key sorted, It is very urgent to know why its not coming as primary key sorted, i checked indexes but not found. SELECT * FROM vbkpf INTO TABLE it_vbkpf&amp;nbsp; WHERE budat IN s_budat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jun 2014 16:32:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statment-problem/m-p/10413235#M1843713</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-06-30T16:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Select statment problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statment-problem/m-p/10413236#M1843714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This table not has the month as key and index. (In my SAP version)&lt;/P&gt;&lt;P&gt;The date available in the key is the year.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you &lt;SPAN style="text-decoration: underline;"&gt;realy&lt;/SPAN&gt; need to select this table using month, create a index (ask if possible to basis team and explain the reason). In your index you can use these fields:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BUKRS&lt;BR /&gt;GJAHR&lt;BR /&gt;BUDAT&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jun 2014 16:50:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statment-problem/m-p/10413236#M1843714</guid>
      <dc:creator>arthur_alvesteixeira</dc:creator>
      <dc:date>2014-06-30T16:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: Select statment problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statment-problem/m-p/10413237#M1843715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Teixeira, Data is required as sorting form of primery keys ( Mandt ausbk bukrs belnr gjahr), it will automaticaly come because we selected from data base table(VBKPF) but here not coming automatically, that is the problem.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2014 10:00:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statment-problem/m-p/10413237#M1843715</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-07-01T10:00:53Z</dc:date>
    </item>
    <item>
      <title>Re: Select statment problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statment-problem/m-p/10413238#M1843716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prasad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there's a way to get from selection the fields sorted regarding your specific requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Declare a internal table using this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt; &lt;SPAN style="color: #333333; font-size: 12px;"&gt;it_vbkpf&lt;/SPAN&gt; &lt;STRONG&gt;TYPE SORTED TABLE OF&lt;/STRONG&gt; &lt;SPAN style="color: #333333; font-size: 12px;"&gt;vbkpf&lt;/SPAN&gt; &lt;STRONG&gt;WITH UNIQUE KEY&lt;/STRONG&gt; feld1 field2.&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;&lt;STRONG&gt;DATA&lt;/STRONG&gt; &lt;SPAN style="color: #333333; font-size: 12px;"&gt;it_vbkpf&lt;/SPAN&gt; &lt;STRONG&gt;TYPE SORTED TABLE OF&lt;/STRONG&gt; &lt;SPAN style="color: #333333; font-size: 12px;"&gt;vbkpf&lt;/SPAN&gt; &lt;STRONG&gt;WITH NON-UNIQUE KEY&lt;/STRONG&gt; feld1 field2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After this apply your selection into table it_vbkpf&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2014 12:01:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statment-problem/m-p/10413238#M1843716</guid>
      <dc:creator>arthur_alvesteixeira</dc:creator>
      <dc:date>2014-07-01T12:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: Select statment problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statment-problem/m-p/10413239#M1843717</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Teixeira,&lt;/P&gt;&lt;P&gt;Thanks for you reply,&lt;/P&gt;&lt;P&gt; I know that one, They want reason why data coming as with out sorting of primary key fields.&lt;/P&gt;&lt;P&gt;Normally if we select data from database it will come primary key based sorted data,&lt;/P&gt;&lt;P&gt;In my case why its not&amp;nbsp; coming like that....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2014 12:20:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statment-problem/m-p/10413239#M1843717</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-07-01T12:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: Select statment problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statment-problem/m-p/10413240#M1843718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Prasad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you pass primary key field as where clause then you will get sorted order which is exist in DB sequence order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you pass non primary key as where clause then you wont get the exact primary key order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In his case you can sort the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vadamalai A.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2014 12:26:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statment-problem/m-p/10413240#M1843718</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-07-01T12:26:39Z</dc:date>
    </item>
    <item>
      <title>Re: Select statment problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statment-problem/m-p/10413241#M1843719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Prasad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i always use key or index to select table, but i made a test code using your example (only budat in where condition and internal table TYPE TABLE OF) and works fine for me, the key fields are sorted after selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;tables &lt;/SPAN&gt;vbkpf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52" style="font-size: 10pt;"&gt;select-options &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;s_budat &lt;/SPAN&gt;&lt;SPAN class="L0S52" style="font-size: 10pt;"&gt;for &lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;vbkpf-budat.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;data &lt;/SPAN&gt;ti_vbkpf &lt;SPAN class="L0S52"&gt;type &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;table &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;of &lt;/SPAN&gt;vbkpf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="L0S52"&gt;select &lt;/SPAN&gt;* &lt;SPAN class="L0S52"&gt;from &lt;/SPAN&gt;vbkpf&amp;nbsp; &lt;SPAN class="L0S52"&gt;into &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;table &lt;/SPAN&gt;ti_vbkpf &lt;SPAN class="L0S52"&gt;where &lt;/SPAN&gt;budat &lt;SPAN class="L0S52"&gt;in &lt;/SPAN&gt;s_budat.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check the complete index fields values (sorted) and budat not:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/jiveimages/488115" width="450" /&gt;&lt;/P&gt;&lt;P&gt;Please, let me know if using this template you have the key fields sorted.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2014 12:35:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statment-problem/m-p/10413241#M1843719</guid>
      <dc:creator>arthur_alvesteixeira</dc:creator>
      <dc:date>2014-07-01T12:35:15Z</dc:date>
    </item>
    <item>
      <title>Re: Select statment problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statment-problem/m-p/10413242#M1843720</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Prasad,&lt;/P&gt;&lt;P&gt;My take is you are not guaranteed an ordered set of results.&lt;/P&gt;&lt;P&gt;Just add an "ORDER BY ..."&amp;nbsp; to your select statement to assure order.&lt;/P&gt;&lt;P&gt;(See the SELECT help for details)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;...Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2014 13:05:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statment-problem/m-p/10413242#M1843720</guid>
      <dc:creator>mike_mcinerney</dc:creator>
      <dc:date>2014-07-01T13:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: Select statment problem</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statment-problem/m-p/10413243#M1843721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the fact that this are key fields dont mean they are sorted, isnt it? It just means they are unique. I guess that the sorting of lines in the table VBKPF is exactly what you get in your internal table after your selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;did you check this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Stefan Seeburger&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2014 15:12:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statment-problem/m-p/10413243#M1843721</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-07-01T15:12:23Z</dc:date>
    </item>
  </channel>
</rss>

