<?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 with join condition or not? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-join-condition-or-not/m-p/2197271#M469105</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Cany,&lt;/P&gt;&lt;P&gt;           When we use joins some dis adv are there since the readability will not be there...If u feel ok we can use it by for all entries concept.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 08 May 2007 06:07:56 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-08T06:07:56Z</dc:date>
    <item>
      <title>Select with join condition or not?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-join-condition-or-not/m-p/2197265#M469099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you think it would be more efficient to build a select with a join condition for the following query?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Material number where unrestricted quantity &amp;lt;&amp;gt; 0 are retrieved&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT matnr labst INTO CORRESPONDING FIELDS OF TABLE tbl_mard_entry&lt;/P&gt;&lt;P&gt;  FROM mard WHERE werks = p_plant AND lgort IN so_store AND labst &amp;lt;&amp;gt; 0&lt;/P&gt;&lt;P&gt;  AND matnr IN so_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Filtering material type and group&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT matnr INTO CORRESPONDING FIELDS OF TABLE tbl_mara_matnr FROM mara&lt;/P&gt;&lt;P&gt;  FOR ALL ENTRIES IN tbl_mard_entry WHERE matnr = tbl_mard_entry-matnr&lt;/P&gt;&lt;P&gt;  AND mtart IN so_mtype AND matkl IN so_mgrp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2007 03:26:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-join-condition-or-not/m-p/2197265#M469099</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-08T03:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: Select with join condition or not?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-join-condition-or-not/m-p/2197266#M469100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nozome,&lt;/P&gt;&lt;P&gt;                  U can write select ststement to join MARA &amp;amp; MARD. It would be more efficient.&lt;/P&gt;&lt;P&gt;Select A&lt;SUB&gt;matnr B&lt;/SUB&gt;matnr B~labst into corresponding field of table &lt;/P&gt;&lt;P&gt;                                          itab from MARA as A&lt;/P&gt;&lt;P&gt;                                          inner join MARD as B&lt;/P&gt;&lt;P&gt;                                          on A&lt;SUB&gt;matnr = B&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;                                          and werks = p_plant and labst &amp;lt;&amp;gt; 0&lt;/P&gt;&lt;P&gt;                                           where matnr in s_matnr and&lt;/P&gt;&lt;P&gt;                                                     mtart in so_mtype and matkl in so_mgrp&lt;/P&gt;&lt;P&gt;                                                     and lgort in so_store.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Hemant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2007 03:38:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-join-condition-or-not/m-p/2197266#M469100</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-08T03:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Select with join condition or not?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-join-condition-or-not/m-p/2197267#M469101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;using 'For all entry' is always efficient than using join. You can check the execution time of the both form in SE30 transaction. You will see there, that using 'For all entry' take much lesser time than using join.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2007 03:44:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-join-condition-or-not/m-p/2197267#M469101</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-08T03:44:18Z</dc:date>
    </item>
    <item>
      <title>Re: Select with join condition or not?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-join-condition-or-not/m-p/2197268#M469102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think a join would be preferable, eg&lt;/P&gt;&lt;P&gt;SELECT matnr labst INTO CORRESPONDING FIELDS OF TABLE tbl_mard_entry&lt;/P&gt;&lt;P&gt;FROM mara&lt;/P&gt;&lt;P&gt;join mard on mard&lt;SUB&gt;matnr = mara&lt;/SUB&gt;matnr&lt;/P&gt;&lt;P&gt;WHERE mara~matnr in so_matnr&lt;/P&gt;&lt;P&gt;and mard~werks = p_plant &lt;/P&gt;&lt;P&gt;AND mard~lgort IN so_store &lt;/P&gt;&lt;P&gt;AND mard~labst &amp;lt;&amp;gt; 0&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But even if you didn't use a join I think you should reverse the order of the selects and target MARA first as the hitlist will be smaller and then target MARD.&lt;/P&gt;&lt;P&gt;eg,&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Get applicable materials&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;SELECT matnr INTO CORRESPONDING FIELDS OF TABLE tbl_mara_matnr FROM mara&lt;/P&gt;&lt;P&gt;WHERE matnr IN so_matnr&lt;/P&gt;&lt;P&gt;AND mtart IN so_mtype &lt;/P&gt;&lt;P&gt;AND matkl IN so_mgrp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;get MARDs&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;SELECT matnr labst INTO CORRESPONDING FIELDS OF TABLE tbl_mard_entry&lt;/P&gt;&lt;P&gt;FROM mard &lt;/P&gt;&lt;P&gt;FOR ALL ENTRIES IN tbl_mara_matnr&lt;/P&gt;&lt;P&gt;WHERE matnr = tbl_mara_matnr-matnr&lt;/P&gt;&lt;P&gt;and werks = p_plant &lt;/P&gt;&lt;P&gt;AND lgort IN so_store &lt;/P&gt;&lt;P&gt;AND labst &amp;lt;&amp;gt; 0&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2007 03:44:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-join-condition-or-not/m-p/2197268#M469102</guid>
      <dc:creator>former_member186741</dc:creator>
      <dc:date>2007-05-08T03:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: Select with join condition or not?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-join-condition-or-not/m-p/2197269#M469103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Nozome,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can write a join on the two db tables i.e. Mara and Mard. But then 'for all entries' instead of join condition is suggested more as it takes lesser time for execution. So, I suggest you to go in the way you are doing now.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jayant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2007 03:52:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-join-condition-or-not/m-p/2197269#M469103</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-08T03:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: Select with join condition or not?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-join-condition-or-not/m-p/2197270#M469104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Cany,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For all entries is preferable instead of join option.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2007 03:53:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-join-condition-or-not/m-p/2197270#M469104</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-08T03:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: Select with join condition or not?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-join-condition-or-not/m-p/2197271#M469105</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Cany,&lt;/P&gt;&lt;P&gt;           When we use joins some dis adv are there since the readability will not be there...If u feel ok we can use it by for all entries concept.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 May 2007 06:07:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-with-join-condition-or-not/m-p/2197271#M469105</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-08T06:07:56Z</dc:date>
    </item>
  </channel>
</rss>

