<?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 statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2657207#M612783</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey rajeev,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   What is ur requirment do you want to select the records from a data base table or you already have a internal table with data and out of that you want to select the records with this condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) if from db table . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select * from table into itab where mode in ('x','y') and matnr in ('123','234')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) from internal table&lt;/P&gt;&lt;P&gt;   loop at itab where mode in ('x','y') and matnr in ('123' ,'234').&lt;/P&gt;&lt;P&gt;  jtab  = itab.&lt;/P&gt;&lt;P&gt;append jtab.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after this jtab will contain all the required entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; or &lt;/P&gt;&lt;P&gt; jtab[] = itab[].&lt;/P&gt;&lt;P&gt; delete jtab where not in ('x','y') and matnr not in ('123',234')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Aug 2007 16:03:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-15T16:03:36Z</dc:date>
    <item>
      <title>Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2657202#M612778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all, &lt;/P&gt;&lt;P&gt;I have a condition where I need to select all the record from it_tab that meet all the below conditions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mode = X or Y &lt;/P&gt;&lt;P&gt;matnr = 123 or 234&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;can you just tell me how to execute this condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Rajeev Gupta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2007 15:37:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2657202#M612778</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-15T15:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2657203#M612779</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;Select * from &amp;lt;table&amp;gt; into itab where mode in ( 'X','Y' )&lt;/P&gt;&lt;P&gt;                                              and matnr in ('123','234').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2007 15:41:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2657203#M612779</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-15T15:41:46Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2657204#M612780</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Mahesh&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do I need to first read that table from which i need to select records or I can diresctly select the records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Rajeev Gupta&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2007 15:43:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2657204#M612780</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-15T15:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2657205#M612781</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want to query a database table based on some criteria i.e. mode in X or Y Matnr in 123 or 234, first you should know whether these can be hardocded or do you have them in an internal table or variables. In your example you have given they are hardcoded therefore mode and matnr values are hardcoded in the query.&lt;/P&gt;&lt;P&gt;If you want them to be dynamic create some internal table or range where in you have the values available and use that internal table in your selection criteria.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select * from MARA for all entries in itab where MATNR = itab-matnr.&lt;/P&gt;&lt;P&gt;or create a range and use it&lt;/P&gt;&lt;P&gt;Select * from MARA MATNR in matnr_range.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Kriss&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2007 15:50:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2657205#M612781</guid>
      <dc:creator>former_member192429</dc:creator>
      <dc:date>2007-08-15T15:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2657206#M612782</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rajeev,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use the below select statement before the loop:&lt;/P&gt;&lt;P&gt;Select * from (respective table) into it_itab where mode in ( 'X','Y' )&lt;/P&gt;&lt;P&gt;and matnr in ('123','234').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to display the data, then simple use the write statement within a loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;Please reward if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Srinivasa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2007 15:51:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2657206#M612782</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-15T15:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2657207#M612783</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey rajeev,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   What is ur requirment do you want to select the records from a data base table or you already have a internal table with data and out of that you want to select the records with this condition&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) if from db table . &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  select * from table into itab where mode in ('x','y') and matnr in ('123','234')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) from internal table&lt;/P&gt;&lt;P&gt;   loop at itab where mode in ('x','y') and matnr in ('123' ,'234').&lt;/P&gt;&lt;P&gt;  jtab  = itab.&lt;/P&gt;&lt;P&gt;append jtab.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;after this jtab will contain all the required entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; or &lt;/P&gt;&lt;P&gt; jtab[] = itab[].&lt;/P&gt;&lt;P&gt; delete jtab where not in ('x','y') and matnr not in ('123',234')&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Mahesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2007 16:03:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2657207#M612783</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-15T16:03:36Z</dc:date>
    </item>
  </channel>
</rss>

