<?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: Comparing fields in where condition from same ztable in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-fields-in-where-condition-from-same-ztable/m-p/2263328#M490881</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it is not fetching the value than debug the codecheck the value coningin the ztable,i dont think there is any mistake in your qurey.&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;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 May 2007 09:09:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-15T09:09:54Z</dc:date>
    <item>
      <title>Comparing fields in where condition from same ztable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-fields-in-where-condition-from-same-ztable/m-p/2263323#M490876</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 two fields (gr_date and gm_date) in ztable.&lt;/P&gt;&lt;P&gt;i have to compare the records(i.e gm_date &amp;gt; gr_date) in one select where condition and take that in internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT * FROM ztable&lt;/P&gt;&lt;P&gt;           INTO TABLE it_mtolog_gm&lt;/P&gt;&lt;P&gt;           WHERE werks       = p_werks&lt;/P&gt;&lt;P&gt;                AND &amp;lt;b&amp;gt;gm_qty &amp;lt; ztable-gr_qty&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is it possible? Bcoz when i tried this it was not fetching any value.&lt;/P&gt;&lt;P&gt;Or please give any other suggestion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2007 08:29:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-fields-in-where-condition-from-same-ztable/m-p/2263323#M490876</guid>
      <dc:creator>rahulnavandar</dc:creator>
      <dc:date>2007-05-15T08:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing fields in where condition from same ztable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-fields-in-where-condition-from-same-ztable/m-p/2263324#M490877</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;SELECT * FROM ztable&lt;/P&gt;&lt;P&gt;INTO TABLE it_mtolog_gm&lt;/P&gt;&lt;P&gt;WHERE werks = p_werks&lt;/P&gt;&lt;P&gt;AND gm_qty &amp;lt;  ( Select ztable-gr_qty from ZTABLE into l_qty where werks = p_werks).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Prashant&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2007 08:35:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-fields-in-where-condition-from-same-ztable/m-p/2263324#M490877</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-15T08:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing fields in where condition from same ztable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-fields-in-where-condition-from-same-ztable/m-p/2263325#M490878</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try this..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT * FROM ztable
INTO TABLE it_mtolog_gm
WHERE werks = p_werks.

delete it_mtolog_gm  where gm_qty LE gr_qty.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Chandrasekhar Jagarlamudi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2007 08:35:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-fields-in-where-condition-from-same-ztable/m-p/2263325#M490878</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-15T08:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing fields in where condition from same ztable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-fields-in-where-condition-from-same-ztable/m-p/2263326#M490879</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It would be better to select the entries in a table based on the WERKS condition alone, and then loop at the table to delete entries where gm_qty &amp;gt; gr_qty.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT * FROM ztable
INTO TABLE it_mtolog_gm
WHERE werks = p_werks. 

LOOP AT it_mtolog_gm.
CHECK it_mtolog_gm-gm_qty &amp;lt; it_mtolog_gm-gr_qty.
DELETE it_mtolog_gm.
CONTINUE.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Using select alone, you might first need to populate an itab with all the values in the DB, and then use FOR ALL ENTRIES to select again from the same table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sudha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2007 08:43:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-fields-in-where-condition-from-same-ztable/m-p/2263326#M490879</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-15T08:43:04Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing fields in where condition from same ztable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-fields-in-where-condition-from-same-ztable/m-p/2263327#M490880</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI rahul...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You don;t need to write the table name in the wherecondition if you are comparing the values from a single table... just write the fieldname....&lt;/P&gt;&lt;P&gt;I think that will do...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jayant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2007 09:00:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-fields-in-where-condition-from-same-ztable/m-p/2263327#M490880</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-15T09:00:40Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing fields in where condition from same ztable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-fields-in-where-condition-from-same-ztable/m-p/2263328#M490881</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if it is not fetching the value than debug the codecheck the value coningin the ztable,i dont think there is any mistake in your qurey.&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;mrutyun^&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2007 09:09:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-fields-in-where-condition-from-same-ztable/m-p/2263328#M490881</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-15T09:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing fields in where condition from same ztable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-fields-in-where-condition-from-same-ztable/m-p/2263329#M490882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;TRY WITH THIS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT * FROM ztable&lt;/P&gt;&lt;P&gt;INTO TABLE it_mtolog_gm&lt;/P&gt;&lt;P&gt;WHERE werks = p_werks&lt;/P&gt;&lt;P&gt;AND gm_qty &amp;lt; ztable&amp;lt;b&amp;gt;~&amp;lt;/b&amp;gt;gr_qty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REGARDS&lt;/P&gt;&lt;P&gt;SHIBA DUTTA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2007 09:17:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-fields-in-where-condition-from-same-ztable/m-p/2263329#M490882</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-15T09:17:18Z</dc:date>
    </item>
    <item>
      <title>Re: Comparing fields in where condition from same ztable</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-fields-in-where-condition-from-same-ztable/m-p/2263330#M490883</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 this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;select &amp;lt;fld_list&amp;gt; from ztable as a inner join ztable as b on a~key fiedl= b~key_field
where a~werks = p_werks and a~gm_qty &amp;lt; b~gr_qty.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will surely work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Jogdand M B&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2007 09:28:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/comparing-fields-in-where-condition-from-same-ztable/m-p/2263330#M490883</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-15T09:28:44Z</dc:date>
    </item>
  </channel>
</rss>

