<?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: Join in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/join/m-p/2985979#M705094</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the below link :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.erpgenie.com/abap/code/abap47.htm" target="test_blank"&gt;http://www.erpgenie.com/abap/code/abap47.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above link will close to your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do not use join more than 3 tables ( if you use more than 3 tables then you get bad performance ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Seshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 29 Oct 2007 19:45:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-29T19:45:24Z</dc:date>
    <item>
      <title>Join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join/m-p/2985971#M705086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How to join EKKO, EKPO, EKKN, EKBE based on EBELN(PO number) &amp;amp; EBELP (PO line item number).&lt;/P&gt;&lt;P&gt;e.g I want PO number from ekko and po line item from ekpo and some other fileds from these tables...&lt;/P&gt;&lt;P&gt;thanks,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2007 16:11:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join/m-p/2985971#M705086</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-29T16:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: Join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join/m-p/2985972#M705087</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; 1. Select * from EKKO into table it_ekko.&lt;/P&gt;&lt;P&gt; 2. Select * from ekpo into table it_ekpo for all entries in it_ekko where ebeln = it_ekko.&lt;/P&gt;&lt;P&gt; 3. Select * from ekkn into table it_ekkn for all entries in it_ekpo where ebeln = it_ekpo-ebeln and ebelp = it_ekpo-ebelp.&lt;/P&gt;&lt;P&gt; 4. Select * from ekbe into table it_ekbe for all entries in it_ekpo where ebeln = it_ekpo-ebeln and ebelp = it_ekpo-ebelp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Reward points for helpful answers&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Satish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2007 16:36:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join/m-p/2985972#M705087</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-29T16:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: Join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join/m-p/2985973#M705088</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 go for Different selects on all these tables using FOR ALL ENTRIES..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Below is an example code.. you can write select stmnts in that way..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

DATA: BEGIN OF it_ekko OCCURS 0,
        ebeln TYPE ekko-ebeln,
      END OF it_ekko.

DATA: BEGIN OF it_ekpo OCCURS 0,
        ebeln TYPE ekpo-ebeln,
        ebelp TYPE ekpo-ebelp,
      END OF it_ekpo.

DATA: BEGIN OF it_ekkn OCCURS 0,
        ebeln TYPE ekkn-ebeln,
        ebelp TYPE ekkn-ebelp,
        zekkn TYPE ekkn-zekkn,
      END OF it_ekkn.

DATA: BEGIN OF it_ekbe OCCURS 0,
        ebeln TYPE ekbe-ebeln,
        ebelp TYPE ekbe-ebelp,
        zekkn TYPE ekbe-zekkn,
        vgabe TYPE ekbe-vgabe,
        gjahr TYPE ekbe-gjahr,
        belnr TYPE ekbe-belnr,
        buzei TYPE ekbe-buzei,
      END OF it_ekbe.


PARAMETERS: p_ebeln TYPE ekko-ebeln.

SELECT ebeln
  FROM ekko
  INTO TABLE it_ekko
 WHERE ebeln = p_ebeln. " This parameter can be on selection screen

IF NOT it_ekko[] IS INITIAL.

  SELECT ebeln
         ebelp
    FROM ekpo
    INTO TABLE it_ekpo
     FOR ALL ENTRIES IN it_ekko
   WHERE ebeln = it_ekko-ebeln.

  IF NOT it_ekpo IS INITIAL.

    SELECT ebeln
           ebelp
           zekkn
      FROM ekkn
      INTO TABLE it_ekkn
       FOR ALL ENTRIES IN it_ekpo
     WHERE ebeln = it_ekpo-ebeln
       AND ebelp = it_ekpo-ebelp.
  ENDIF.
ENDIF.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;Do not forget to reward if it helps you. ;)&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Sreekanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2007 16:45:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join/m-p/2985973#M705088</guid>
      <dc:creator>sreekanthgo</dc:creator>
      <dc:date>2007-10-29T16:45:18Z</dc:date>
    </item>
    <item>
      <title>Re: Join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join/m-p/2985974#M705089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
SELECT ekko~ebeln ekpo~ebelp INTO CORRESPONDING FIELDS OF 
TABLE itab FROM EKKO  INNER JOIN EKPO ON 
ekko~ebeln = ekpo~ebeln   "Continue same with other tables as well
WHERE ekko~ebeln IN s_ebeln.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2007 16:46:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join/m-p/2985974#M705089</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-29T16:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: Join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join/m-p/2985975#M705090</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;select m&lt;SUB&gt;ebeln m&lt;/SUB&gt;procstat m&lt;SUB&gt;rlwrt m&lt;/SUB&gt;frgke m~bukrs&lt;/P&gt;&lt;P&gt;       c&lt;SUB&gt;ebelp c&lt;/SUB&gt;txz01 c&lt;SUB&gt;knttp c&lt;/SUB&gt;netwr&lt;/P&gt;&lt;P&gt;       c1&lt;SUB&gt;nplnr c1&lt;/SUB&gt;kostl c1&lt;SUB&gt;anln1 c1&lt;/SUB&gt;sakto c1&lt;SUB&gt;prctr c1&lt;/SUB&gt;aufnr c1&lt;SUB&gt;projn c1&lt;/SUB&gt;imkey c1&lt;SUB&gt;PS_PSP_PNR c1&lt;/SUB&gt;ZEKKN&lt;/P&gt;&lt;P&gt;       c2&lt;SUB&gt;belnr c2&lt;/SUB&gt;budat c2&lt;SUB&gt;wrbtr c2&lt;/SUB&gt;vgabe c2~gjahr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       from  ekko as m inner join ekpo as c on&lt;/P&gt;&lt;P&gt;       c&lt;SUB&gt;ebeln = m&lt;/SUB&gt;ebeln&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       inner join ekkn as c1 on&lt;/P&gt;&lt;P&gt;       c1&lt;SUB&gt;ebeln = m&lt;/SUB&gt;ebeln and&lt;/P&gt;&lt;P&gt;       c1&lt;SUB&gt;ebelp = c&lt;/SUB&gt;ebelp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       inner join ekbe as c2 on&lt;/P&gt;&lt;P&gt;       c2&lt;SUB&gt;ebeln = m&lt;/SUB&gt;ebeln and&lt;/P&gt;&lt;P&gt;       c2&lt;SUB&gt;ebelp = c&lt;/SUB&gt;ebelp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       into corresponding fields of table it_outtab &lt;/P&gt;&lt;P&gt;where ebeln in s_ebeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This querey is displaying only first line item, whats wrong in it????&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2007 17:19:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join/m-p/2985975#M705090</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-29T17:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: Join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join/m-p/2985976#M705091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Khan following code is working fine in my system....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
select m~ebeln m~procstat m~rlwrt m~frgke m~bukrs
c~ebelp c~txz01 c~knttp c~netwr
c1~nplnr c1~kostl c1~anln1 c1~sakto c1~prctr c1~aufnr c1~projn c1~imkey c1~PS_PSP_PNR c1~ZEKKN
c2~belnr c2~budat c2~wrbtr c2~vgabe c2~gjahr INTO CORRESPONDING FIELDS OF
TABLE it_outtab  from ekko as m inner join ekpo as c on
c~ebeln = m~ebeln

inner join ekkn as c1 on
c1~ebeln = m~ebeln and
c1~ebelp = c~ebelp

inner join ekbe as c2 on
c2~ebeln = m~ebeln and
c2~ebelp = c~ebelp
where ebeln in s_ebeln.
&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;        Perez C&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Perez C&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2007 17:27:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join/m-p/2985976#M705091</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-29T17:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: Join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join/m-p/2985977#M705092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If we have multiplie line items in EKPO table but EKBE only has one line item, then based on this query, should it display only one line item with this join.&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, 29 Oct 2007 17:55:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join/m-p/2985977#M705092</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-29T17:55:47Z</dc:date>
    </item>
    <item>
      <title>Re: Join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join/m-p/2985978#M705093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;e.g i have 10 line items for ekpo table, but in ekbe table, we have only one line item. then based on above mentioned JOIN condition, how many columns will be displayed. In my current situation, it'sonly displaying one column. I need to dispaly all 10 line items.&lt;/P&gt;&lt;P&gt;The order of my join tables are as follows.&lt;/P&gt;&lt;P&gt;EKKO, EKPO, EKKN, EKBE and the join cond is:&lt;/P&gt;&lt;P&gt;select m&lt;SUB&gt;ebeln m&lt;/SUB&gt;procstat m&lt;SUB&gt;rlwrt m&lt;/SUB&gt;frgke m~bukrs&lt;/P&gt;&lt;P&gt;c&lt;SUB&gt;ebelp c&lt;/SUB&gt;txz01 c&lt;SUB&gt;knttp c&lt;/SUB&gt;netwr&lt;/P&gt;&lt;P&gt;c1&lt;SUB&gt;nplnr c1&lt;/SUB&gt;kostl c1&lt;SUB&gt;anln1 c1&lt;/SUB&gt;sakto c1&lt;SUB&gt;prctr c1&lt;/SUB&gt;aufnr c1&lt;SUB&gt;projn c1&lt;/SUB&gt;imkey c1&lt;SUB&gt;PS_PSP_PNR c1&lt;/SUB&gt;ZEKKN&lt;/P&gt;&lt;P&gt;c2&lt;SUB&gt;belnr c2&lt;/SUB&gt;budat c2&lt;SUB&gt;wrbtr c2&lt;/SUB&gt;vgabe c2~gjahr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from ekko as m inner join ekpo as c on&lt;/P&gt;&lt;P&gt;c&lt;SUB&gt;ebeln = m&lt;/SUB&gt;ebeln&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;inner join ekkn as c1 on&lt;/P&gt;&lt;P&gt;c1&lt;SUB&gt;ebeln = m&lt;/SUB&gt;ebeln and&lt;/P&gt;&lt;P&gt;c1&lt;SUB&gt;ebelp = c&lt;/SUB&gt;ebelp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;inner join ekbe as c2 on&lt;/P&gt;&lt;P&gt;c2&lt;SUB&gt;ebeln = m&lt;/SUB&gt;ebeln and&lt;/P&gt;&lt;P&gt;c2&lt;SUB&gt;ebelp = c&lt;/SUB&gt;ebelp&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;into corresponding fields of table it_outtab &lt;/P&gt;&lt;P&gt;where ebeln in s_ebeln.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pls help....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2007 19:34:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join/m-p/2985978#M705093</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-29T19:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: Join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join/m-p/2985979#M705094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the below link :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.erpgenie.com/abap/code/abap47.htm" target="test_blank"&gt;http://www.erpgenie.com/abap/code/abap47.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above link will close to your requirement.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do not use join more than 3 tables ( if you use more than 3 tables then you get bad performance ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Seshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Oct 2007 19:45:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join/m-p/2985979#M705094</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-29T19:45:24Z</dc:date>
    </item>
  </channel>
</rss>

