<?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: Regarding SQL ... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-sql/m-p/1068832#M94185</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok I am working on that and will get back to you once I am sure it is efficient than the posted answer...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Dec 2005 21:02:11 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-12-22T21:02:11Z</dc:date>
    <item>
      <title>Regarding SQL ...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-sql/m-p/1068827#M94180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello ABAP gurus,&lt;/P&gt;&lt;P&gt;Please help me out in solving following doubt.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Fieldname: Tax-code1 (STCD1), Tax-code2( STCD2), Vendor number(LIFNR)&lt;/P&gt;&lt;P&gt;Table name: LFA1.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;I am working on uniqueness for tax code verification for vendors.&lt;/P&gt;&lt;P&gt;Lets say that tax code1 (STCD1) value for a particular vendor is in v_tax1 and tax-code2 (STCD2) value for vendor is in v_tax2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to check tax-code1 value for this vendor number (LIFNR) against tax-code1 values for all the other vendors numbers in table LFA1. &lt;/P&gt;&lt;P&gt;Hence in simple terms I want to see if value of v_tax1 exists for any other vendor's Tax-code1  scanning the whole LFA1 for all the other vendors and comparing with their respective taxcode1s (STCD1).&lt;/P&gt;&lt;P&gt;If an entry exists then raise error.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Same thing I want to do for tax-code2, tax-code3..&lt;/P&gt;&lt;P&gt;Please let me know how do I perform this using SQL ?&lt;/P&gt;&lt;P&gt;Relevant points will be awarded..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Dec 2005 20:39:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-sql/m-p/1068827#M94180</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-22T20:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding SQL ...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-sql/m-p/1068828#M94181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any help will be appreciated...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Dec 2005 20:54:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-sql/m-p/1068828#M94181</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-22T20:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding SQL ...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-sql/m-p/1068829#M94182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;

DATA: BEGIN OF i_lfa1 OCCURS 0,
      lifnr LIKE lfa1-lifnr,
      stcd1 LIKE lfa1-stcd1,
      END OF i_lfa1,

      i_lfa1_dup LIKE i_lfa1 OCCURS 0.


SELECT lifnr stcd1
FROM lfa1
INTO TABLE i_lfa1.

i_lfa1_dup[] = i_lfa1[].

LOOP AT i_lfa1.

  LOOP AT i_lfa1_dup WHERE lifnr NE i_lfa1-lifnr.

    IF i_lfa1_dup-stcd1 = i_lfa1-stcd1.

      WRITE: / 'Duplicate Tax Code ',
               i_lfa1_dup-stcd1,
               ' for vendors ',
               i_lfa1-lifnr,
               ' and ',
               i_lfa1_dup-lifnr.
    ENDIF.

  ENDLOOP.

ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Dec 2005 20:55:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-sql/m-p/1068829#M94182</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-22T20:55:29Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding SQL ...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-sql/m-p/1068830#M94183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But there is a better way than the above mentioned!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Sam&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Dec 2005 20:56:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-sql/m-p/1068830#M94183</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-22T20:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding SQL ...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-sql/m-p/1068831#M94184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please let me know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Dec 2005 20:57:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-sql/m-p/1068831#M94184</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-22T20:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding SQL ...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-sql/m-p/1068832#M94185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok I am working on that and will get back to you once I am sure it is efficient than the posted answer...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Dec 2005 21:02:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-sql/m-p/1068832#M94185</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-22T21:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: Regarding SQL ...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-sql/m-p/1068833#M94186</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;You can perhaps do this using a subquery in the  select stmt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select lifnr stcd1 from lfa1 as a&lt;/P&gt;&lt;P&gt; into table itab&lt;/P&gt;&lt;P&gt;where lifnr in s_lifnr&lt;/P&gt;&lt;P&gt;and exists ( select stcd1 from lfa1 as b&lt;/P&gt;&lt;P&gt;             where b&lt;SUB&gt;lifnr &amp;lt;&amp;gt; a&lt;/SUB&gt;lifnr&lt;/P&gt;&lt;P&gt;             and b&lt;SUB&gt;stcd1 = a&lt;/SUB&gt;stcd1 ).&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;Kalpana&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Kalpana Tyagi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Dec 2005 21:18:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/regarding-sql/m-p/1068833#M94186</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-12-22T21:18:56Z</dc:date>
    </item>
  </channel>
</rss>

