<?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 Inner join condition problem on item in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-inner-join-condition-problem-on-item/m-p/3573386#M860147</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kevin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will not be possible to get the correct result using JOIN in the select statement in your case.&lt;/P&gt;&lt;P&gt;Instead of JOIN you can use FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Atish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Mar 2008 01:27:48 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-03-17T01:27:48Z</dc:date>
    <item>
      <title>Select Inner join condition problem on item</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-inner-join-condition-problem-on-item/m-p/3573383#M860144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have two tables: Z_table1 and Z_table2:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In Z_table1, there is the document field EBELN and item field EBELP (type as NUMC and the length is 5).  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In table Z_table2, there is the document field EBELN and the item field EBELP (type as CHAR and the length is 3)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If we use the following select by just inner joining based on the PO document level, then it works fine to get records into itab:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select   b~field1
            c~field2
            from Z_table1 as b
            inner join Z_table2 as c
            on b~EBELN = c~EBELN
            into corresponding fields of table itab where ...

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But if we use the following select statement by using inner joinning on both PO document and item level, then it returns nothing into itab:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select   b~field1
            c~field2
            from Z_table1 as b
            inner join Z_table2 as c
            on b~EBELN = c~EBELN and b~EBELP = c~EBELP
            into corresponding fields of table itab where ...

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By checking these above two tables, they do have the common PO document and item number records, e.g., in 1st table, there is PO 1001 and it's item 00001 (length 5 of NUMC) and in 2nd table, there is PO 1001 and it's item 001 (length 3 of CHAR).  But why the 2nd above select by employing the inner join on item condition not working successfully to get data into itab?  Any idea?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and we will give you reward points!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Mar 2008 21:38:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-inner-join-condition-problem-on-item/m-p/3573383#M860144</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-16T21:38:43Z</dc:date>
    </item>
    <item>
      <title>Re: Select Inner join condition problem on item</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-inner-join-condition-problem-on-item/m-p/3573384#M860145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kevin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Its simply because of the mismatch of the data..as data stored in different format (different lengths also).&lt;/P&gt;&lt;P&gt;In your scenario you should have join based on ebeln only and then sort based on ebelp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Atish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 16 Mar 2008 23:32:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-inner-join-condition-problem-on-item/m-p/3573384#M860145</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-16T23:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: Select Inner join condition problem on item</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-inner-join-condition-problem-on-item/m-p/3573385#M860146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Atish,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But in our select statement, we don't want to select EBELN and EBELP that the sort won't work.  Is there a way of we can still use the inner join condition with the item EBELP but need to convert one type to another and then to be employed in the condition?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Would be appreciated if you could give the select statement example on how to do this!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 00:47:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-inner-join-condition-problem-on-item/m-p/3573385#M860146</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T00:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: Select Inner join condition problem on item</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-inner-join-condition-problem-on-item/m-p/3573386#M860147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kevin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It will not be possible to get the correct result using JOIN in the select statement in your case.&lt;/P&gt;&lt;P&gt;Instead of JOIN you can use FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Atish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 01:27:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-inner-join-condition-problem-on-item/m-p/3573386#M860147</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T01:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: Select Inner join condition problem on item</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-inner-join-condition-problem-on-item/m-p/3573387#M860148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Atish Sarda,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you show the sample code on how to use the FOR ALL ENTRIES to get the workaround for the type mismatch in the inner join condition for the item level?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Mar 2008 02:09:26 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-inner-join-condition-problem-on-item/m-p/3573387#M860148</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-03-17T02:09:26Z</dc:date>
    </item>
  </channel>
</rss>

