<?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 innerjoin + possiblekeys... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/innerjoin-possiblekeys/m-p/1569420#M257097</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello friends, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have have two tables, lets saay tab1 have 5 fields ( all keys) and tab2 have more then 5 fields and ( 4 keys ). Now both tables have 4 keys same, and I want to select the 5th key from table tab1. Can I make an inner join like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select t1~fild5&lt;/P&gt;&lt;P&gt;from tab1 as t1&lt;/P&gt;&lt;P&gt;inner join tab2 as t2&lt;/P&gt;&lt;P&gt;on  t1&lt;SUB&gt;field1 = t2&lt;/SUB&gt;field1&lt;/P&gt;&lt;P&gt;    t1&lt;SUB&gt;field2 = t2&lt;/SUB&gt;field2&lt;/P&gt;&lt;P&gt;    t1&lt;SUB&gt;field3 = t2&lt;/SUB&gt;field3&lt;/P&gt;&lt;P&gt;    t1&lt;SUB&gt;field4 = t2&lt;/SUB&gt;field4&lt;/P&gt;&lt;P&gt;INTO l_field&lt;/P&gt;&lt;P&gt;where&lt;/P&gt;&lt;P&gt;    t2~filed1 = s_val1&lt;/P&gt;&lt;P&gt;    t2~filed2 = s_val2&lt;/P&gt;&lt;P&gt;    t2~filed3 = s_val3&lt;/P&gt;&lt;P&gt;    t2~filed4 = s_val4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you guys think it will work, ?? would be nice if you please let me know if there is any syntax error too.&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;Malang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 13 Sep 2006 09:24:53 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-09-13T09:24:53Z</dc:date>
    <item>
      <title>innerjoin + possiblekeys...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/innerjoin-possiblekeys/m-p/1569420#M257097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello friends, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have have two tables, lets saay tab1 have 5 fields ( all keys) and tab2 have more then 5 fields and ( 4 keys ). Now both tables have 4 keys same, and I want to select the 5th key from table tab1. Can I make an inner join like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select t1~fild5&lt;/P&gt;&lt;P&gt;from tab1 as t1&lt;/P&gt;&lt;P&gt;inner join tab2 as t2&lt;/P&gt;&lt;P&gt;on  t1&lt;SUB&gt;field1 = t2&lt;/SUB&gt;field1&lt;/P&gt;&lt;P&gt;    t1&lt;SUB&gt;field2 = t2&lt;/SUB&gt;field2&lt;/P&gt;&lt;P&gt;    t1&lt;SUB&gt;field3 = t2&lt;/SUB&gt;field3&lt;/P&gt;&lt;P&gt;    t1&lt;SUB&gt;field4 = t2&lt;/SUB&gt;field4&lt;/P&gt;&lt;P&gt;INTO l_field&lt;/P&gt;&lt;P&gt;where&lt;/P&gt;&lt;P&gt;    t2~filed1 = s_val1&lt;/P&gt;&lt;P&gt;    t2~filed2 = s_val2&lt;/P&gt;&lt;P&gt;    t2~filed3 = s_val3&lt;/P&gt;&lt;P&gt;    t2~filed4 = s_val4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you guys think it will work, ?? would be nice if you please let me know if there is any syntax error too.&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;Malang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 09:24:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/innerjoin-possiblekeys/m-p/1569420#M257097</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T09:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: innerjoin + possiblekeys...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/innerjoin-possiblekeys/m-p/1569421#M257098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;code looks fine , did u get any errors?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 09:27:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/innerjoin-possiblekeys/m-p/1569421#M257098</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T09:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: innerjoin + possiblekeys...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/innerjoin-possiblekeys/m-p/1569422#M257099</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;Your query has no problem. Just change IN clause to SELECT-OPTIONS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select t1~fild5&lt;/P&gt;&lt;P&gt;from tab1 as t1&lt;/P&gt;&lt;P&gt;inner join tab2 as t2&lt;/P&gt;&lt;P&gt;on t1&lt;SUB&gt;field1 = t2&lt;/SUB&gt;field1&lt;/P&gt;&lt;P&gt;t1&lt;SUB&gt;field2 = t2&lt;/SUB&gt;field2&lt;/P&gt;&lt;P&gt;t1&lt;SUB&gt;field3 = t2&lt;/SUB&gt;field3&lt;/P&gt;&lt;P&gt;t1&lt;SUB&gt;field4 = t2&lt;/SUB&gt;field4&lt;/P&gt;&lt;P&gt;INTO l_field&lt;/P&gt;&lt;P&gt;where&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;t2~filed1 IN s_val1&lt;/P&gt;&lt;P&gt;t2~filed2 IN s_val2&lt;/P&gt;&lt;P&gt;t2~filed3 IN s_val3&lt;/P&gt;&lt;P&gt;t2~filed4 IN s_val4.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Vinay&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 09:28:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/innerjoin-possiblekeys/m-p/1569422#M257099</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T09:28:03Z</dc:date>
    </item>
    <item>
      <title>Re: innerjoin + possiblekeys...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/innerjoin-possiblekeys/m-p/1569423#M257100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Chandraskhar, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just want to confirm, is that the correct way to select the 5th field from the tab1 ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have not write code yet, just want to know if it works like this or not ? do you think is there any error ?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 09:29:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/innerjoin-possiblekeys/m-p/1569423#M257100</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T09:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: innerjoin + possiblekeys...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/innerjoin-possiblekeys/m-p/1569424#M257101</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;chk this sample .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT a&lt;SUB&gt;Bill a&lt;/SUB&gt;plant Number b~BillingDate &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INTO TABLE int_table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FROM ( ztable_numplant AS a&lt;/P&gt;&lt;P&gt;INNER JOIN&lt;/P&gt;&lt;P&gt;ztable_numdate AS b&lt;/P&gt;&lt;P&gt;ON a&lt;SUB&gt;billnimber = b&lt;/SUB&gt;billnumber ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;************you change ur code like this ********&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*use single in ur query&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Select &amp;lt;b&amp;gt;single&amp;lt;/b&amp;gt; t1~fild5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; INTO l_field&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;from tab1 as t1&lt;/P&gt;&lt;P&gt;inner join tab2 as t2&lt;/P&gt;&lt;P&gt;on t1&lt;SUB&gt;field1 = t2&lt;/SUB&gt;field1&lt;/P&gt;&lt;P&gt;t1&lt;SUB&gt;field2 = t2&lt;/SUB&gt;field2&lt;/P&gt;&lt;P&gt;t1&lt;SUB&gt;field3 = t2&lt;/SUB&gt;field3&lt;/P&gt;&lt;P&gt;t1&lt;SUB&gt;field4 = t2&lt;/SUB&gt;field4&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where&lt;/P&gt;&lt;P&gt;t2~filed1 = s_val1&lt;/P&gt;&lt;P&gt;t2~filed2 = s_val2&lt;/P&gt;&lt;P&gt;t2~filed3 = s_val3&lt;/P&gt;&lt;P&gt;t2~filed4 = s_val4&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 09:29:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/innerjoin-possiblekeys/m-p/1569424#M257101</guid>
      <dc:creator>anversha_s</dc:creator>
      <dc:date>2006-09-13T09:29:22Z</dc:date>
    </item>
    <item>
      <title>Re: innerjoin + possiblekeys...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/innerjoin-possiblekeys/m-p/1569425#M257102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Syed,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It surely works like that..the only thing in your code which can be a worry is the where condition...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In your where condition you are equating the fields to s_val1 etc. I hope that S_val1 is a parameter and not select-option. If it is select-option better use IN operator and if it is a parameter make sure you enter some data otherwise your select would not return the specified data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 09:32:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/innerjoin-possiblekeys/m-p/1569425#M257102</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T09:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: innerjoin + possiblekeys...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/innerjoin-possiblekeys/m-p/1569426#M257103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Syed&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Depending on the combination from Field 1 to 4, there &lt;/P&gt;&lt;P&gt;can be different entries in TAB1 for Field5. So you &lt;/P&gt;&lt;P&gt;should either use SELECT/ENDSELECT or INTO TABLE &lt;/P&gt;&lt;P&gt;combination for your select to extract Field 5. Also i &lt;/P&gt;&lt;P&gt;assume S_VAL 1 to 4 are either varialbes or parameters. &lt;/P&gt;&lt;P&gt;If these are select-options you need to use IN operator.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   Itz also better if you join the other way TAB2 first &lt;/P&gt;&lt;P&gt;and TAB1 second as TAB1 will have more entries than TAB2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  It should be some thing like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  select t1~fld5 into table it_values
         from table tab2 as t2 
         inner join tab1 as t1 
         on t2~fld1 = t1~fld1
         and t2~fld2 = t1~fld2
         and t2~fld3 = t1~fld3
         and t2~fld4 = t1~fld4
         where t2~fld1 = s_var1
         and   t2~fld2 = s_var2
         and   t2~fld3 = s_var3
         and   t2~fld4 = s_var4.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind Regards&lt;/P&gt;&lt;P&gt;Eswar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 09:35:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/innerjoin-possiblekeys/m-p/1569426#M257103</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T09:35:31Z</dc:date>
    </item>
    <item>
      <title>Re: innerjoin + possiblekeys...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/innerjoin-possiblekeys/m-p/1569427#M257104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi syed,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  Your code works perfetly , as suggestd by others use IN in the where condition&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 09:38:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/innerjoin-possiblekeys/m-p/1569427#M257104</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T09:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: innerjoin + possiblekeys...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/innerjoin-possiblekeys/m-p/1569428#M257105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello  All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks for your suggestions, I will write the code and will test, and will share my results, till then, thanks again &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Sep 2006 09:42:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/innerjoin-possiblekeys/m-p/1569428#M257105</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-09-13T09:42:09Z</dc:date>
    </item>
  </channel>
</rss>

