<?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: Alternative for double inner join in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/alternative-for-double-inner-join/m-p/6997440#M1494720</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 used table  t001w in join, While using buffer table in join operation it will not read data from buffer,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Read data from table t001w&lt;/P&gt;&lt;P&gt;2) apply join on table marc and maex and also put where condition with werks because marc table having primary key with fields matnr and werks so put both in where condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
   select single * from t001w client specified
     where mandt = sy-mandt
          and werks =  T_VBDPL-WERKS.

  SELECT SINGLE ALNUM  INTO P_ITAB-ALNUM_AL 
     FROM MARC  JOIN MAEX ON MAEX~MATNR = MARC~MATNR
     WHERE MARC~MATNR = P_VBPLP-MATNR
         AND MARC~WERKS = T_VBDPL-WERKS
         AND MAEX~ALAND =  T001W~LAND1
         AND MAEX~GEGRU = 'DE'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 31 May 2010 06:07:00 GMT</pubDate>
    <dc:creator>ravi_lanjewar</dc:creator>
    <dc:date>2010-05-31T06:07:00Z</dc:date>
    <item>
      <title>Alternative for double inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alternative-for-double-inner-join/m-p/6997432#M1494712</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SELECT SINGLE ALNUM INTO P_ITAB-ALNUM_AL FROM  MAEX&lt;/P&gt;&lt;P&gt;         JOIN MARC ON MARC&lt;SUB&gt;MATNR = MAEX&lt;/SUB&gt;MATNR&lt;/P&gt;&lt;P&gt;         JOIN T001W ON T001W&lt;SUB&gt;WERKS = MARC&lt;/SUB&gt;WERKS&lt;/P&gt;&lt;P&gt;             WHERE  MAEX~MATNR  = P_VBPLP-MATNR&lt;/P&gt;&lt;P&gt;             AND    MARC~WERKS  = T_VBDPL-WERKS&lt;/P&gt;&lt;P&gt;             AND    MAEX&lt;SUB&gt;ALAND  = T001W&lt;/SUB&gt;LAND1&lt;/P&gt;&lt;P&gt;             AND    MAEX~GEGRU  = 'DE'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can anyone suggest the best way to modify the above statement to improve the performence.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Khasimsa&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 May 2010 08:43:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alternative-for-double-inner-join/m-p/6997432#M1494712</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-26T08:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for double inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alternative-for-double-inner-join/m-p/6997433#M1494713</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;a Join with several tables is no problem by itself, so why do you want to improve it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The SELECT SINGLE is weird, in a Join you will hardly know whether only one record can fulfill the condition, i.e.&lt;/P&gt;&lt;P&gt;UP TO 1 ROWS would be clearer. But why is only one value needed?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is the join inside a LOOP?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 May 2010 09:23:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alternative-for-double-inner-join/m-p/6997433#M1494713</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-26T09:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for double inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alternative-for-double-inner-join/m-p/6997434#M1494714</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes this join is insde a loop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 May 2010 10:12:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alternative-for-double-inner-join/m-p/6997434#M1494714</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-26T10:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for double inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alternative-for-double-inner-join/m-p/6997435#M1494715</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; yes this join is insde a loop.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;within loop avoid select statement.&lt;/P&gt;&lt;P&gt;use read statement for this issue ,and within loop you are getting one values so check for a rfc or fm for the same.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at lt_maex.&lt;/P&gt;&lt;P&gt;read table lt_t001w where matnr = lt_maex-matnr.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 May 2010 10:20:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alternative-for-double-inner-join/m-p/6997435#M1494715</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-26T10:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for double inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alternative-for-double-inner-join/m-p/6997436#M1494716</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Shaik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;           Dont use the select query within the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          Performance wise it is not recommended.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead you select the above join query in an internal table i.e.,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT &lt;STRONG&gt;a  b   c,  d  INTO P_ITAB&lt;/STRONG&gt; FROM MAEX&lt;/P&gt;&lt;P&gt;JOIN MARC ON MARC&lt;SUB&gt;MATNR = MAEX&lt;/SUB&gt;MATNR&lt;/P&gt;&lt;P&gt;JOIN T001W ON T001W&lt;SUB&gt;WERKS = MARC&lt;/SUB&gt;WERKS&lt;/P&gt;&lt;P&gt;WHERE MAEX~MATNR = P_VBPLP-MATNR&lt;/P&gt;&lt;P&gt;AND MARC~WERKS = T_VBDPL-WERKS&lt;/P&gt;&lt;P&gt;AND MAEX&lt;SUB&gt;ALAND = T001W&lt;/SUB&gt;LAND1&lt;/P&gt;&lt;P&gt;AND MAEX~GEGRU = 'DE'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read p_itab with key a&lt;/P&gt;&lt;P&gt;&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;This will improve your performance as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Md Ziauddin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 May 2010 10:27:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alternative-for-double-inner-join/m-p/6997436#M1494716</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-26T10:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for double inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alternative-for-double-inner-join/m-p/6997437#M1494717</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;T001W is a buffered table. The buffer can not be used with the join. Remove the T001W from the join and read it from the buffer separately.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For the remaining tables in the join take a trace.&lt;/P&gt;&lt;P&gt;Check for index support and identical SELECTS.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hermann&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 May 2010 11:32:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alternative-for-double-inner-join/m-p/6997437#M1494717</guid>
      <dc:creator>HermannGahm</dc:creator>
      <dc:date>2010-05-26T11:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for double inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alternative-for-double-inner-join/m-p/6997438#M1494718</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;many close misses &lt;SPAN __jive_emoticon_name="sad"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the SEKECT is inside a LOOP you should not use a READ in a LOOP, usually the correct coding is a FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The buffered table ... hmm, as long as we do not see the full coding, the buffered table T001W is not the first in the join, maybe it is even to leave it in the join. However, I have some doubts that it is necessary, the coding lloks weird: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AND MAEX&lt;SUB&gt;ALAND = T001W&lt;/SUB&gt;LAND1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The country LAND1 is not checked on T001W. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Better copy more coding which shows where the values from WHERE condition come from.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this working coding (tested correct coding) or still in development ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 May 2010 13:15:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alternative-for-double-inner-join/m-p/6997438#M1494718</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-26T13:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for double inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alternative-for-double-inner-join/m-p/6997439#M1494719</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Besides the good point to avoid selects in loops, this may be a little bit better join order:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;SELECT SINGLE ALNUM 
  INTO P_ITAB-ALNUM_AL 
  FROM MARC
  JOIN T001W ON T001W~WERKS = MARC~WERKS
  JOIN MAEX ON MAEX~MATNR = MARC~MATNR
           AND MAEX~ALAND = T001W~LAND1
 WHERE MARC~MATNR = P_VBPLP-MATNR
   AND MARC~WERKS = T_VBDPL-WERKS
   AND MAEX~GEGRU = 'DE'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 May 2010 14:56:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alternative-for-double-inner-join/m-p/6997439#M1494719</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-05-26T14:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for double inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alternative-for-double-inner-join/m-p/6997440#M1494720</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 used table  t001w in join, While using buffer table in join operation it will not read data from buffer,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) Read data from table t001w&lt;/P&gt;&lt;P&gt;2) apply join on table marc and maex and also put where condition with werks because marc table having primary key with fields matnr and werks so put both in where condition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
   select single * from t001w client specified
     where mandt = sy-mandt
          and werks =  T_VBDPL-WERKS.

  SELECT SINGLE ALNUM  INTO P_ITAB-ALNUM_AL 
     FROM MARC  JOIN MAEX ON MAEX~MATNR = MARC~MATNR
     WHERE MARC~MATNR = P_VBPLP-MATNR
         AND MARC~WERKS = T_VBDPL-WERKS
         AND MAEX~ALAND =  T001W~LAND1
         AND MAEX~GEGRU = 'DE'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 May 2010 06:07:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alternative-for-double-inner-join/m-p/6997440#M1494720</guid>
      <dc:creator>ravi_lanjewar</dc:creator>
      <dc:date>2010-05-31T06:07:00Z</dc:date>
    </item>
    <item>
      <title>Re: Alternative for double inner join</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/alternative-for-double-inner-join/m-p/6997441#M1494721</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This message was moderated.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Nov 2010 16:18:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/alternative-for-double-inner-join/m-p/6997441#M1494721</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2010-11-25T16:18:38Z</dc:date>
    </item>
  </channel>
</rss>

