<?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/2659322#M613422</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;The error is coming bcoz amount1 is not a field in ur Table zTab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to change the query like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * into table it_tab&lt;/P&gt;&lt;P&gt;from z_tab&lt;/P&gt;&lt;P&gt;for all entries in it_temp&lt;/P&gt;&lt;P&gt;where mode = 'A' or mode = 'B'&lt;/P&gt;&lt;P&gt;and amount2 &amp;gt; amount1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward if Helpful&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Aug 2007 03:30:07 GMT</pubDate>
    <dc:creator>varma_narayana</dc:creator>
    <dc:date>2007-08-16T03:30:07Z</dc:date>
    <item>
      <title>Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2659317#M613417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus, &lt;/P&gt;&lt;P&gt;I need to select all the records from Z_tab to it_tab that meet below conditions:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;mode = a or b &lt;/P&gt;&lt;P&gt;amount1 &amp;lt; amount2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and for this I have written the following code&lt;/P&gt;&lt;P&gt;select * into table it_tab&lt;/P&gt;&lt;P&gt;  from z_tab&lt;/P&gt;&lt;P&gt;  for all entries in it_temp&lt;/P&gt;&lt;P&gt;  where mode = 'A' or mode = 'B'&lt;/P&gt;&lt;P&gt;  and amount1 &amp;lt; amount2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but its showing me an error that field amount2 is unkown, although this field is defined in my z_tab table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;please help me out.&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 16:40:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2659317#M613417</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-15T16:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2659318#M613418</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Hope your Ztab contains amount1 and amount2 fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For that select using &lt;/P&gt;&lt;P&gt;select * into table it_tab&lt;/P&gt;&lt;P&gt;from z_tab&lt;/P&gt;&lt;P&gt;for all entries in it_temp&lt;/P&gt;&lt;P&gt;where mode = 'A' or mode = 'B'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;delete it_itab where amount2 ge amount1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;finally you will have the required values in it_itab.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Baburaj&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2007 16:44:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2659318#M613418</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-15T16:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2659319#M613419</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;  In this select you are trying to compare the two database table fields which is not possible. rather do this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; select * from z_tab into table itab where mode in ('A','B').&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt; delete itab where amont1 &amp;gt; amount2.&lt;/P&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;P&gt;Y are u using the for all entris in it_Temp does this table contains amount2?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if yes&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then use this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * from z_tab for all enteris in it_temp into table itab where mode in ('A','B') and amount1 &amp;lt; it_temp-amount2..&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:48:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2659319#M613419</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-15T16:48: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/2659320#M613420</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You cannot do that in one single select statement. Easiest will be to get all the records (include the columns amount1 and amount2 as well to your itab) just based on mode and then loop at the itab. delete the record if amount1 &amp;lt; amount2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Aug 2007 16:50:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2659320#M613420</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-15T16:50:09Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2659321#M613421</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try amount2 &amp;gt; amount1&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 03:00:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2659321#M613421</guid>
      <dc:creator>kesavadas_thekkillath</dc:creator>
      <dc:date>2007-08-16T03:00:45Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2659322#M613422</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;The error is coming bcoz amount1 is not a field in ur Table zTab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You have to change the query like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * into table it_tab&lt;/P&gt;&lt;P&gt;from z_tab&lt;/P&gt;&lt;P&gt;for all entries in it_temp&lt;/P&gt;&lt;P&gt;where mode = 'A' or mode = 'B'&lt;/P&gt;&lt;P&gt;and amount2 &amp;gt; amount1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward if Helpful&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 03:30:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2659322#M613422</guid>
      <dc:creator>varma_narayana</dc:creator>
      <dc:date>2007-08-16T03:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: Select statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2659323#M613423</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;use tablename.ammount2 it wil remove ur error&lt;/P&gt;&lt;P&gt;use the tablename to wich amnt2 is associated&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2007 03:49:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-statement/m-p/2659323#M613423</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-16T03:49:35Z</dc:date>
    </item>
  </channel>
</rss>

