<?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: Get double return for join table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-double-return-for-join-table/m-p/7270264#M1529997</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nitesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your suggestion.  &lt;/P&gt;&lt;P&gt;I tried your code and I got the same result which produce double entry.&lt;/P&gt;&lt;P&gt;It looks like the first one is extracted from EKPO and the second one is extracted from ztmm_ccp table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to eliminate the first one record from EKPO? Any other suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 02 Oct 2010 14:29:29 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2010-10-02T14:29:29Z</dc:date>
    <item>
      <title>Get double return for join table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-double-return-for-join-table/m-p/7270262#M1529995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Experts:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT eban~banfn      "PR number
         eban~bnfpo      "PR item
         eban~bsart      "Doc Type
         eban~bednr      "Requistion tracking number
         eban~ebeln
         eban~ebelp
         eban~zzloc      "GEO code
         ztmm_ccp~zzclli "zzclli code
  INTO CORRESPONDING FIELDS OF TABLE gi_pr_extract
  FROM  ( eban
         INNER JOIN ztmm_ccp
                ON  eban~bednr = ztmm_ccp~bednr
               AND  eban~ebeln = ztmm_ccp~ebeln
               AND  eban~ebelp = ztmm_ccp~ebelp )
  WHERE eban~bsart IN s_bsart.  "11 input doc type&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The s_bsart are:&lt;/P&gt;&lt;P&gt;NB&lt;/P&gt;&lt;P&gt;UB&lt;/P&gt;&lt;P&gt;ZNB&lt;/P&gt;&lt;P&gt;ZSC&lt;/P&gt;&lt;P&gt;ZUC&lt;/P&gt;&lt;P&gt;ZVC&lt;/P&gt;&lt;P&gt;ZXC&lt;/P&gt;&lt;P&gt;ZZO&lt;/P&gt;&lt;P&gt;ZZX&lt;/P&gt;&lt;P&gt;ZZY&lt;/P&gt;&lt;P&gt;ZZZ&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From above SQL, I got double returen for each  eban&lt;SUB&gt;banfn  and eban&lt;/SUB&gt;bnfpo&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Row	BANFN	BNFPO	BSART	BEDNR	ZZLOC	ZZCLLI
1 	3100000056	00010	NB			
2 	3100000056	00010	NB			CLLICD DRTP
3 	3100000057	00010	NB			
4 	3100000057	00010	NB			CLLICD DRTP
5 	3100000058	00010	NB			
6 	3100000058	00010	NB			CLLICD DRTP
7 	3100000061	00010	NB			
8 	3100000061	00010	NB			CLLICD DRTP
9 	3100000062	00010	NB			
10 	3100000062	00010	NB			CLLICD DRTP&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Do you know why and how do I get the unique one?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Thomas Zloch on Oct 4, 2010 3:49 PM - &lt;STRONG&gt;please use code tags&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Oct 2010 07:23:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-double-return-for-join-table/m-p/7270262#M1529995</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-02T07:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Get double return for join table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-double-return-for-join-table/m-p/7270263#M1529996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Helen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please check with the below code snippet. Hope it will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT eban~banfn      
          eban~bnfpo     
          eban~bsart      
          eban~bednr     
          eban~ebeln
          eban~ebelp
          eban~zzloc      
          ztmm_ccp~zzclli 
   INTO CORRESPONDING FIELDS OF TABLE gi_pr_extract
   FROM  eban
          INNER JOIN ztmm_ccp
                  ON    ztmm_ccp~bednr = eban~bednr
                AND  ztmm_ccp~ebeln = eban~ebeln
                AND  ztmm_ccp~ebelp = eban~ebelp
   WHERE eban~bsart IN s_bsart.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Nitesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Oct 2010 10:30:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-double-return-for-join-table/m-p/7270263#M1529996</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-02T10:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: Get double return for join table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-double-return-for-join-table/m-p/7270264#M1529997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nitesh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your suggestion.  &lt;/P&gt;&lt;P&gt;I tried your code and I got the same result which produce double entry.&lt;/P&gt;&lt;P&gt;It looks like the first one is extracted from EKPO and the second one is extracted from ztmm_ccp table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to eliminate the first one record from EKPO? Any other suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Oct 2010 14:29:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-double-return-for-join-table/m-p/7270264#M1529997</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-02T14:29:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get double return for join table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-double-return-for-join-table/m-p/7270265#M1529998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the following code just distinct after SELECT&lt;/P&gt;&lt;P&gt;:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; SELECT DISTINCT eban~banfn      
          eban~bnfpo     
          eban~bsart      
          eban~bednr     
          eban~ebeln
          eban~ebelp
          eban~zzloc      
          ztmm_ccp~zzclli 
   INTO CORRESPONDING FIELDS OF TABLE gi_pr_extract
   FROM  eban
          INNER JOIN ztmm_ccp
                  ON    ztmm_ccp~bednr = eban~bednr
                AND  ztmm_ccp~ebeln = eban~ebeln
                AND  ztmm_ccp~ebelp = eban~ebelp
   WHERE eban~bsart IN s_bsart.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With Thanks &lt;/P&gt;&lt;P&gt;Moshiur Rahman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Oct 2010 06:30:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-double-return-for-join-table/m-p/7270265#M1529998</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-04T06:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: Get double return for join table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-double-return-for-join-table/m-p/7270266#M1529999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried your DISTINCT SQL and I got the below result which show the same double entry return because of ZZCLLI not same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Row	BANFN	BNFPO	BSART	BEDNR	EBELN	EBELP	ZZLOC	ZZCLLI&lt;/P&gt;&lt;P&gt;1	3100000056	10	NB			0			&lt;/P&gt;&lt;P&gt;2	3100000056	10	NB			0		CLLICD DRTP	&lt;/P&gt;&lt;P&gt;Any other suggestion?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Oct 2010 13:46:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-double-return-for-join-table/m-p/7270266#M1529999</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-04T13:46:29Z</dc:date>
    </item>
    <item>
      <title>Re: Get double return for join table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-double-return-for-join-table/m-p/7270267#M1530000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Obviously there is a 1:N relationship between EBAN and ZTMM_CCP, actually 1:2 in this case, so the inner join is doing what it is supposed to do, duplicating the field values of the left hand table.&lt;/P&gt;&lt;P&gt;What is the primary key of ZTMM_CCP? &lt;/P&gt;&lt;P&gt;You can try adding WHERE-conditions, e.g. ZTMM_CCP-ZZLOC = space, whatever fits your actual requirement.&lt;/P&gt;&lt;P&gt;Thomas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Oct 2010 13:55:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-double-return-for-join-table/m-p/7270267#M1530000</guid>
      <dc:creator>ThomasZloch</dc:creator>
      <dc:date>2010-10-04T13:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: Get double return for join table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/get-double-return-for-join-table/m-p/7270268#M1530001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for pointing out the 1:N selection.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Helen&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Oct 2010 11:25:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/get-double-return-for-join-table/m-p/7270268#M1530001</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-10-05T11:25:22Z</dc:date>
    </item>
  </channel>
</rss>

