<?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: Inner join in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2651880#M611332</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as i know there will not be any performance issue here. We can use the &amp;lt;b&amp;gt;DATABASE VIEW&amp;lt;/b&amp;gt; to retrive the data from more then one table (If table are related wiht the &amp;lt;b&amp;gt;FK&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;    Here the one issue is u have to create the VIEW it means it is new object while transporting (To Quality or Production) u have to transport one object extra that is ur VIEW.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward If helpfull.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anees Jawad.&lt;/P&gt;&lt;P&gt;9886358645&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        anees jawad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Aug 2007 07:34:43 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-23T07:34:43Z</dc:date>
    <item>
      <title>Inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2651874#M611326</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi to all,&lt;/P&gt;&lt;P&gt;i have to display data from 3 tables according to select-option, im using inner join for the same.Is my going in right way. Is thr any other method to do the same. I have used inner join but not able to display the data. Please check my code and pt out my mistakes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks &amp;amp; Regards&lt;/P&gt;&lt;P&gt;Amit&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;my code : &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT  zpmr_sample_prog.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES : ekko,&lt;/P&gt;&lt;P&gt;         ekpo,&lt;/P&gt;&lt;P&gt;         eket.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN: BEGIN OF BLOCK b1.&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS:  s_p_doc FOR ekko-ebeln ,&lt;/P&gt;&lt;P&gt;                 s_c_code FOR ekko-bukrs ,&lt;/P&gt;&lt;P&gt;                 s_m_no FOR ekpo-matnr,&lt;/P&gt;&lt;P&gt;                 s_d_type FOR ekko-bsart.&lt;/P&gt;&lt;P&gt;SELECTION-SCREEN: END OF BLOCK b1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:   BEGIN OF wa,&lt;/P&gt;&lt;P&gt;        pur_doc TYPE ekko-ebeln,&lt;/P&gt;&lt;P&gt;        pur_item TYPE ekpo-ebelp,&lt;/P&gt;&lt;P&gt;        doctype TYPE ekko-bsart,&lt;/P&gt;&lt;P&gt;        mat_no TYPE ekpo-matnr,&lt;/P&gt;&lt;P&gt;        sch_qty TYPE eket-menge,&lt;/P&gt;&lt;P&gt;        plant TYPE ekpo-werks,&lt;/P&gt;&lt;P&gt;        co_code TYPE ekko-bukrs,&lt;/P&gt;&lt;P&gt;        END OF wa.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: itab LIKE STANDARD TABLE OF wa WITH HEADER LINE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT  a&lt;SUB&gt;ebeln b&lt;/SUB&gt;ebelp a&lt;SUB&gt;bsart b&lt;/SUB&gt;matnr c&lt;SUB&gt;menge b&lt;/SUB&gt;werks INTO CORRESPONDING FIELDS OF TABLE itab&lt;/P&gt;&lt;P&gt;   FROM ekko AS a&lt;/P&gt;&lt;P&gt;  INNER JOIN ekpo AS b ON a&lt;SUB&gt;ebeln = b&lt;/SUB&gt;ebeln INNER JOIN eket AS c ON a&lt;SUB&gt;ebeln = c&lt;/SUB&gt;ebeln WHERE a~ebeln IN s_p_doc AND&lt;/P&gt;&lt;P&gt;  a&lt;SUB&gt;bukrs IN s_c_code  AND a&lt;/SUB&gt;bsart IN s_d_type AND b~matnr = s_m_no.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab.&lt;/P&gt;&lt;P&gt;  WRITE : itab-pur_doc, / itab-pur_item, itab-doctype, itab-mat_no, itab-sch_qty,  itab-plant.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 06:23:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2651874#M611326</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-23T06:23:38Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2651875#M611327</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Stop using INNER JOIN, is always a performance problem after.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use :  select ..  into table ... &lt;/P&gt;&lt;P&gt;check not it_tab1[] is initial.&lt;/P&gt;&lt;P&gt;select .. into table .. from .. for all entries in it_tab1 .. &lt;/P&gt;&lt;P&gt;check not it_tab2[] is initial.&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use inner join only between header and item for example : VBAK VBAP, VBRK VBRP ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Fred&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 06:27:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2651875#M611327</guid>
      <dc:creator>FredericGirod</dc:creator>
      <dc:date>2007-08-23T06:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2651876#M611328</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi amit solanki ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think all 3 table what u have mention  is in relationship, If yes directly u can create the &amp;lt;b&amp;gt;DATABASE VIEW&amp;lt;/b&amp;gt; with required fields and use that view in ur program to retrive the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example ur view name is ZDB_VIEW.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select * or fields from ZZDB_VIEW.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;Business logic&lt;/P&gt;&lt;P&gt;else.&lt;/P&gt;&lt;P&gt;Business logic&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 07:00:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2651876#M611328</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-23T07:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2651877#M611329</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;      Don't  use inner join its performance wise really bad so better to use &lt;/P&gt;&lt;P&gt;for all entries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first select data from ekko then check if its initial or not then select the data from&lt;/P&gt;&lt;P&gt;ekpo using for all entries and then from eket.&lt;/P&gt;&lt;P&gt;then lastly &lt;/P&gt;&lt;P&gt;loop at it_ekko.&lt;/P&gt;&lt;P&gt;read ekpo and read eket&lt;/P&gt;&lt;P&gt;and append it into on final internal table and then display it.&lt;/P&gt;&lt;P&gt;endloop&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;prashant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 07:03:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2651877#M611329</guid>
      <dc:creator>former_member386202</dc:creator>
      <dc:date>2007-08-23T07:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2651878#M611330</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi jawad,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i think using views will be a performance issue. moreover my mentor told me that we dont use views in business logic anymore. watz ur views in this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Amit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 07:14:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2651878#M611330</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-23T07:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2651879#M611331</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;&lt;/P&gt;&lt;P&gt;U can use inner join upto two table. If u use morethan two tables in inner join performance of the program will be degraded. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In any case don't use INTO CORRESPONDING FIELDS OF, because it will effect the performance instead u can define the table according to the selecting fields and using directly INTO TABLE.&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;SANKAR&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 07:22:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2651879#M611331</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-23T07:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2651880#M611332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Amit,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As far as i know there will not be any performance issue here. We can use the &amp;lt;b&amp;gt;DATABASE VIEW&amp;lt;/b&amp;gt; to retrive the data from more then one table (If table are related wiht the &amp;lt;b&amp;gt;FK&amp;lt;/b&amp;gt;.&lt;/P&gt;&lt;P&gt;    Here the one issue is u have to create the VIEW it means it is new object while transporting (To Quality or Production) u have to transport one object extra that is ur VIEW.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward If helpfull.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anees Jawad.&lt;/P&gt;&lt;P&gt;9886358645&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        anees jawad&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 07:34:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2651880#M611332</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-23T07:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2651881#M611333</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;In your code, so many fields in where conditions used are no-key fields are bukrs,bsart,matnr, etc...........&lt;/P&gt;&lt;P&gt;you can use the following code to avoid joins by using the for all entres concept.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TABLES : ekko,&lt;/P&gt;&lt;P&gt;ekpo,&lt;/P&gt;&lt;P&gt;eket.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: BEGIN OF itab OCCURS 0,&lt;/P&gt;&lt;P&gt;      pur_doc TYPE ekko-ebeln,&lt;/P&gt;&lt;P&gt;      pur_item TYPE ekpo-ebelp,&lt;/P&gt;&lt;P&gt;      doctype TYPE ekko-bsart,&lt;/P&gt;&lt;P&gt;      mat_no TYPE ekpo-matnr,&lt;/P&gt;&lt;P&gt;      sch_qty TYPE eket-menge,&lt;/P&gt;&lt;P&gt;      plant TYPE ekpo-werks,&lt;/P&gt;&lt;P&gt;      co_code TYPE ekko-bukrs,&lt;/P&gt;&lt;P&gt;END OF itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT-OPTIONS : s_p_doc FOR ekko-ebeln,&lt;/P&gt;&lt;P&gt;                 s_c_code FOR ekko-bukrs,&lt;/P&gt;&lt;P&gt;                 s_d_type FOR ekko-bsart,&lt;/P&gt;&lt;P&gt;                 s_m_no FOR ekpo-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF tbl_ekko OCCURS 0,&lt;/P&gt;&lt;P&gt;        pur_doc TYPE ekko-ebeln,&lt;/P&gt;&lt;P&gt;        co_code TYPE ekko-bukrs,&lt;/P&gt;&lt;P&gt;        doctype TYPE ekko-bsart,&lt;/P&gt;&lt;P&gt;       END OF tbl_ekko.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF tbl_ekpo OCCURS 0,&lt;/P&gt;&lt;P&gt;        pur_doc TYPE ekko-ebeln,&lt;/P&gt;&lt;P&gt;        pur_item TYPE ekpo-ebelp,&lt;/P&gt;&lt;P&gt;        mat_no TYPE ekpo-matnr,&lt;/P&gt;&lt;P&gt;        plant TYPE ekpo-werks,&lt;/P&gt;&lt;P&gt;       END OF tbl_ekpo.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : BEGIN OF tbl_eket OCCURS 0,&lt;/P&gt;&lt;P&gt;        pur_doc TYPE ekko-ebeln,&lt;/P&gt;&lt;P&gt;        pur_item TYPE ekpo-ebelp,&lt;/P&gt;&lt;P&gt;        sch_qty TYPE eket-menge,&lt;/P&gt;&lt;P&gt;       END OF tbl_eket.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT ebeln bukrs bsart&lt;/P&gt;&lt;P&gt;  INTO TABLE tbl_ekko&lt;/P&gt;&lt;P&gt;  FROM ekko&lt;/P&gt;&lt;P&gt; WHERE ebeln IN s_p_doc AND&lt;/P&gt;&lt;P&gt;       bukrs IN s_c_code AND&lt;/P&gt;&lt;P&gt;       bsart IN s_d_type.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;  SORT tbl_ekko BY pur_doc.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF NOT tbl_ekko[] IS INITIAL.&lt;/P&gt;&lt;P&gt;  SELECT ebeln ebelp matnr werks&lt;/P&gt;&lt;P&gt;    INTO TABLE tbl_ekpo&lt;/P&gt;&lt;P&gt;    FROM ekpo&lt;/P&gt;&lt;P&gt;     FOR ALL ENTRIES IN tbl_ekko&lt;/P&gt;&lt;P&gt;   WHERE ebeln EQ tbl_ekko-pur_doc AND&lt;/P&gt;&lt;P&gt;         matnr IN s_m_no.&lt;/P&gt;&lt;P&gt;  IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    SORT tbl_ekpo BY pur_doc pur_item.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF NOT tbl_ekpo[] IS INITIAL.&lt;/P&gt;&lt;P&gt;  SELECT ebeln ebelp menge&lt;/P&gt;&lt;P&gt;    INTO TABLE tbl_eket&lt;/P&gt;&lt;P&gt;    FROM ekpo&lt;/P&gt;&lt;P&gt;     FOR ALL ENTRIES IN tbl_ekpo&lt;/P&gt;&lt;P&gt;   WHERE ebeln EQ tbl_ekpo-pur_doc AND&lt;/P&gt;&lt;P&gt;         ebelp EQ tbl_ekpo-pur_item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    SORT tbl_eket BY pur_doc pur_item.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT tbl_ekko.&lt;/P&gt;&lt;P&gt;  itab-pur_doc = tbl_ekko-pur_doc.&lt;/P&gt;&lt;P&gt;  itab-doctype = tbl_ekko-doctype.&lt;/P&gt;&lt;P&gt;  itab-co_code = tbl_ekko-co_code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR tbl_ekpo.&lt;/P&gt;&lt;P&gt;  READ TABLE tbl_ekpo WITH KEY pur_doc = tbl_ekko-pur_doc&lt;/P&gt;&lt;P&gt;                                    BINARY SEARCH.&lt;/P&gt;&lt;P&gt;  IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;    itab-pur_item = tbl_ekpo-pur_item.&lt;/P&gt;&lt;P&gt;    itab-mat_no  = tbl_ekpo-mat_no .&lt;/P&gt;&lt;P&gt;    itab-plant = tbl_ekpo-plant.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CLEAR tbl_eket.&lt;/P&gt;&lt;P&gt;    READ TABLE tbl_eket WITH KEY pur_doc = tbl_ekpo-pur_doc&lt;/P&gt;&lt;P&gt;                                 pur_item = tbl_ekpo-pur_item&lt;/P&gt;&lt;P&gt;                                      BINARY SEARCH.&lt;/P&gt;&lt;P&gt;    IF sy-subrc = 0.&lt;/P&gt;&lt;P&gt;      itab-sch_qty  = tbl_eket-sch_qty  .&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  APPEND itab.&lt;/P&gt;&lt;P&gt;  CLEAR : tbl_ekko, itab.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT itab.&lt;/P&gt;&lt;P&gt;WRITE : itab-pur_doc, / itab-pur_item, itab-doctype, itab-mat_no, itab-sch_qty, itab-plant.&lt;/P&gt;&lt;P&gt;ENDLOOP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*******************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Let me know if you have doubts.&lt;/P&gt;&lt;P&gt;Points if useful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vijay.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 08:03:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2651881#M611333</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-23T08:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: Inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2651882#M611334</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 join has two problems:&lt;/P&gt;&lt;P&gt;1. in your definition of internal table where the data should be saved you have changed the name of the fields (instead of EBELN -&amp;gt; PUR_DOC); thats why you should change also the name of the fields in the select statement. This was the main reason not to get any data&lt;/P&gt;&lt;P&gt;2. in your join definition you should join EKPO with EKET by using EBELN and EBELP fields (this is the primary key for EKET table ...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your join should look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT 
a~ebeln as pur_doc
b~ebelp as pur_item
a~bsart as doctype
b~matnr as mat_no
c~menge as sch_qty
b~werks as plant
INTO CORRESPONDING FIELDS OF TABLE itab
FROM ekko AS a INNER JOIN ekpo AS b ON a~ebeln = b~ebeln 
	       INNER JOIN eket AS c ON b~ebeln = c~ebeln and
                                       b~ebelp = c~ebelp
WHERE a~ebeln IN s_p_doc AND
      a~bukrs IN s_c_code AND 
      a~bsart IN s_d_type AND 
      b~matnr = s_m_no.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Related to the other comments and answers posted to your question:&lt;/P&gt;&lt;P&gt;- joining table is not a bad performance solution at all. I have programs with joins between 10 or 15 tables (ALL by PRIMARY KEY !!!) and they are performing really fast. This is because the select is done by the database from the back directly and this database is optimized for this kind of tasks.&lt;/P&gt;&lt;P&gt;- if you are using FOR ALL ENTRIES ... you should take a lot of care to that the internal table content referred should not have to many lines, other wise your performance can go down.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Valentin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 08:20:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/inner-join/m-p/2651882#M611334</guid>
      <dc:creator>valentin_catalin2</dc:creator>
      <dc:date>2007-08-23T08:20:37Z</dc:date>
    </item>
  </channel>
</rss>

