<?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 from multiple tables without join statement in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-multiple-tables-without-join-statement/m-p/10393767#M1841963</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the valuable information I did not want to use join 'cause I didn't wanted to write down 10x JOIN in the code. But probably I explained myself wrongly, what I really wanted is what Stefan Seeburger posts. But thank you anyway, It's a useful information for the future.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 18 Jun 2014 11:42:14 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2014-06-18T11:42:14Z</dc:date>
    <item>
      <title>Select from multiple tables without join statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-multiple-tables-without-join-statement/m-p/10393760#M1841956</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Gurus,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I would like to make a select from a multiple tables to check if there is any reference to my data. I would like to do it with some elegancy, but I don't know how. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is in abap sql possible to do it only with the select statement?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or I was also think about a solution that I should fill some data structure with all of the tables which I want to select from and then just loop that data structure and do the select seperately from all of the tables. I just need to check if it founds some results, so no need to store it. If this solution would be fine what data structure should I use?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or can tell me what would be the best for this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code for select from one table, which I want to make for multiple tables:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
&lt;P&gt;&lt;SPAN class="L0S52"&gt;SELECT &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;SINGLE &lt;/SPAN&gt;id_kniznice &lt;SPAN class="L0S52"&gt;FROM &lt;/SPAN&gt;zbr_t_autori &lt;SPAN class="L0S52"&gt;INTO &lt;/SPAN&gt;wa_id&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;WHERE &lt;/SPAN&gt;id_kniznice &lt;SPAN class="L0S52"&gt;EQ &lt;/SPAN&gt;ls_extract&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;zview&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;id_kniznice&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;IF &lt;/SPAN&gt;sy&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;dbcnt &amp;gt; &lt;SPAN class="L0S32"&gt;0&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;MESSAGE &lt;/SPAN&gt;i000&lt;SPAN class="L0S55"&gt;(&lt;/SPAN&gt;zbr_msgc_lib&lt;SPAN class="L0S55"&gt;)&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ls_extract&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;flags&lt;SPAN class="L0S70"&gt;-&lt;/SPAN&gt;vim_mark &lt;SPAN class="L0S55"&gt;= &lt;/SPAN&gt;&lt;SPAN class="L0S33"&gt;'*'&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="L0S52"&gt;MODIFY &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;extract &lt;/SPAN&gt;&lt;SPAN class="L0S52"&gt;FROM &lt;/SPAN&gt;ls_extract&lt;SPAN class="L0S55"&gt;.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="L0S52"&gt;ENDIF&lt;/SPAN&gt;&lt;SPAN class="L0S55"&gt;.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for any posts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Robert&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 09:46:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-multiple-tables-without-join-statement/m-p/10393760#M1841956</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-06-18T09:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Select from multiple tables without join statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-multiple-tables-without-join-statement/m-p/10393761#M1841957</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Have you tried using FOR ALL ENTRIES. You can fetch the next table records based on success of previous table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;DN.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 10:02:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-multiple-tables-without-join-statement/m-p/10393761#M1841957</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-06-18T10:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: Select from multiple tables without join statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-multiple-tables-without-join-statement/m-p/10393762#M1841958</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>Wed, 18 Jun 2014 10:05:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-multiple-tables-without-join-statement/m-p/10393762#M1841958</guid>
      <dc:creator>A-J-S</dc:creator>
      <dc:date>2014-06-18T10:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: Select from multiple tables without join statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-multiple-tables-without-join-statement/m-p/10393763#M1841959</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>Wed, 18 Jun 2014 10:36:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-multiple-tables-without-join-statement/m-p/10393763#M1841959</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-06-18T10:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: Select from multiple tables without join statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-multiple-tables-without-join-statement/m-p/10393764#M1841960</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>Wed, 18 Jun 2014 10:59:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-multiple-tables-without-join-statement/m-p/10393764#M1841960</guid>
      <dc:creator>arthur_alvesteixeira</dc:creator>
      <dc:date>2014-06-18T10:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Select from multiple tables without join statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-multiple-tables-without-join-statement/m-p/10393765#M1841961</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;And there we go again...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read this topic:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A __default_attr="1174072" __jive_macro_name="thread" class="jive_macro_thread jive_macro" data-orig-content="For All Entries is NOT better than INNER JOIN in most cases" href="https://community.sap.com/" modifiedtitle="true" title="For All Entries is NOT better than INNER JOIN in most cases"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And this one:&lt;/P&gt;&lt;P&gt;&lt;A __default_attr="3370614" __jive_macro_name="thread" class="jive_macro_thread jive_macro" data-orig-content="inner join vs for all entries" href="https://community.sap.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also that one:&lt;/P&gt;&lt;P&gt;&lt;A __default_attr="13134098" __jive_macro_name="message" class="jive_macro_message jive_macro" data-orig-content="Re: LOOP AT vs INNER JOIN" href="https://community.sap.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JOINs are really better than for all entries in most cases. Problem is people tend to ignore basic things like using pks or indexes while making them.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 11:26:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-multiple-tables-without-join-statement/m-p/10393765#M1841961</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-06-18T11:26:38Z</dc:date>
    </item>
    <item>
      <title>Re: Select from multiple tables without join statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-multiple-tables-without-join-statement/m-p/10393766#M1841962</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you want a dynamic selection, look with F1 at this syntax : SELECT count(*) FROM &lt;A class="blue" href="http://help.sap.com/abapdocu_731/en/abapfrom_clause.htm#%21ABAP_ALTERNATIVE_3@3@"&gt;&lt;SPAN class="qtext"&gt;(dbtab_syntax)&lt;/SPAN&gt;&lt;/A&gt; WHERE &lt;SPAN class="h1"&gt;&lt;A href="http://help.sap.com/abapdocu_731/en/abenwhere_logexp_dynamic.htm"&gt;(cond_syntax)&lt;/A&gt;&lt;/SPAN&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Raymond&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 11:36:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-multiple-tables-without-join-statement/m-p/10393766#M1841962</guid>
      <dc:creator>RaymondGiuseppi</dc:creator>
      <dc:date>2014-06-18T11:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Select from multiple tables without join statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-multiple-tables-without-join-statement/m-p/10393767#M1841963</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for the valuable information I did not want to use join 'cause I didn't wanted to write down 10x JOIN in the code. But probably I explained myself wrongly, what I really wanted is what Stefan Seeburger posts. But thank you anyway, It's a useful information for the future.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 11:42:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-multiple-tables-without-join-statement/m-p/10393767#M1841963</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-06-18T11:42:14Z</dc:date>
    </item>
    <item>
      <title>Re: Select from multiple tables without join statement</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-multiple-tables-without-join-statement/m-p/10393768#M1841964</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank to you all of you. The solution was that dynamic selection with &lt;A class="jive-link-external-small" href="http://help.sap.com/abapdocu_731/en/abapfrom_clause.htm#%21ABAP_ALTERNATIVE_3@3@" style="font-size: 12px; color: #3778c7; background: #ffffff;"&gt;&lt;SPAN class="qtext" style="font-weight: inherit; font-style: inherit; font-family: inherit; background: transparent;"&gt;(dbtab_syntax)&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 18 Jun 2014 11:43:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/select-from-multiple-tables-without-join-statement/m-p/10393768#M1841964</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-06-18T11:43:37Z</dc:date>
    </item>
  </channel>
</rss>

