<?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 query in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1414959#M199673</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think that it is like this &lt;/P&gt;&lt;P&gt;data : begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;       rsnum type rsnum&lt;/P&gt;&lt;P&gt;       ......&lt;/P&gt;&lt;P&gt;       ......&lt;/P&gt;&lt;P&gt;       end of itab.  &lt;/P&gt;&lt;P&gt;select-options : s_matnr for mara-matnr.&lt;/P&gt;&lt;P&gt;select * from RESB&lt;/P&gt;&lt;P&gt;         into corresponding fields of ITAB&lt;/P&gt;&lt;P&gt;         from matnr = s_matnr&lt;/P&gt;&lt;P&gt;              werks = s_werks&lt;/P&gt;&lt;P&gt;              xloek = s_xloek&lt;/P&gt;&lt;P&gt;              kzear = s_kzear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to create the internal table containing the fields (RSNUM, RSPOS, RSART, MATNR, WERKS, LGORT, KZEAR, XLOEK, XWAOK, SHKZG, BDMNG, and ENMNG).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: mukesh kumar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Jun 2006 10:30:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-06-22T10:30:29Z</dc:date>
    <item>
      <title>select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1414956#M199670</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Friend,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Please give me the code for the below requirement,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read table RESB using index &amp;#145;M&amp;#146; (Matnr, werks, xloek, and KZEAR). Internal table to create should capture fields RSNUM, RSPOS, RSART, MATNR, WERKS, LGORT, KZEAR, XLOEK, XWAOK, SHKZG, BDMNG, and ENMNG).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hard to find , how to use the index and the fields given in paraenthesis (matnr,werks,xloek and kzear) what it means?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jun 2006 10:24:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1414956#M199670</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-22T10:24:43Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1414957#M199671</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi you don't have to mention index in your query system will select the best indexes according to query.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;declare a internal table with the same fields you want to pick and  write.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT rsnum rspos&lt;/P&gt;&lt;P&gt;       rsart matnr&lt;/P&gt;&lt;P&gt;       ....&lt;/P&gt;&lt;P&gt;INTO TABLE itab&lt;/P&gt;&lt;P&gt;WHERE matnr in matr AND&lt;/P&gt;&lt;P&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;&lt;/P&gt;&lt;P&gt;Wasim Ahmed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jun 2006 10:29:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1414957#M199671</guid>
      <dc:creator>dani_mn</dc:creator>
      <dc:date>2006-06-22T10:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1414958#M199672</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;refer...&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;http://help.sap.com/saphelp_47x200/helpdata/en/cf/21eb2d446011d189700000e8322d00/content.htm&amp;lt;/b&amp;gt;You can use %hints for this..&lt;/P&gt;&lt;P&gt;Consider following example..&lt;/P&gt;&lt;P&gt;SELECT * FROM RESB&lt;/P&gt;&lt;P&gt;WHERE MATNR = '200-100' AND WERKS = '1100'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Two indexes are defined on RESB: the primary index with the ID '0' via the fields (MANDT,RSNUM,RSPOS,RSART) and a secondary index with the ID 'M' via (MANDT,MATNR,WERKS,XLOEK,KZEAR,BDTER). This M index can be used for the above statement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A more direct way to access a table via an index is by using a hint and by letting the optimizer decide which index should be selected.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM RESB WHERE MATNR = '200-100' AND WERKS = '1100'%_HINTS ORACLE 'INDEX("&amp;amp;TABLE&amp;amp;")'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After all, the M index should be predefined explicitly. Since the precise naming of the M index is not known, all alternatives are simply listed. The Oracle optimizer ignores the index names which do not exist. In this case, the &amp;amp;TABLE&amp;amp; substitution cannot be used for the index names since these names do not depend on a table alias in the FROM condition:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM RESB WHERE MATNR = '200-100' AND WERKS = '1100'%_HINTS ORACLE 'INDEX("&amp;amp;TABLE&amp;amp;" "RESB~M" "RESB^M")'.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jun 2006 10:29:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1414958#M199672</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-22T10:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: select query</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1414959#M199673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think that it is like this &lt;/P&gt;&lt;P&gt;data : begin of itab occurs 0,&lt;/P&gt;&lt;P&gt;       rsnum type rsnum&lt;/P&gt;&lt;P&gt;       ......&lt;/P&gt;&lt;P&gt;       ......&lt;/P&gt;&lt;P&gt;       end of itab.  &lt;/P&gt;&lt;P&gt;select-options : s_matnr for mara-matnr.&lt;/P&gt;&lt;P&gt;select * from RESB&lt;/P&gt;&lt;P&gt;         into corresponding fields of ITAB&lt;/P&gt;&lt;P&gt;         from matnr = s_matnr&lt;/P&gt;&lt;P&gt;              werks = s_werks&lt;/P&gt;&lt;P&gt;              xloek = s_xloek&lt;/P&gt;&lt;P&gt;              kzear = s_kzear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to create the internal table containing the fields (RSNUM, RSPOS, RSART, MATNR, WERKS, LGORT, KZEAR, XLOEK, XWAOK, SHKZG, BDMNG, and ENMNG).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: mukesh kumar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jun 2006 10:30:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-query/m-p/1414959#M199673</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-22T10:30:29Z</dc:date>
    </item>
  </channel>
</rss>

