<?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 tables w/o using  join command in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables-w-o-using-join-command/m-p/3204395#M763887</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the addition FOR ALL ENTRIES with SELECT. For EG:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*p_matnr is the parameter given in the selection screen&lt;/P&gt;&lt;P&gt;SELECT matnr bdmeng fktxt FROM mara INTO TABLE it_mara where matnr = p_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Note the where condition where we specify the table name.&lt;/P&gt;&lt;P&gt;SELECT matnr maktx FROM marc FOR ALL ENTRIES IN it_mara INTO TABLE it_marc where matnr = it_mara-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Joining the 2 tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at it_mara into wa_mara.&lt;/P&gt;&lt;P&gt;Read table it_marc into wa_mara with key matnr = wa_mara-matnr.&lt;/P&gt;&lt;P&gt;wa_joined_table-matnr = wa_mara-matnr.&lt;/P&gt;&lt;P&gt;wa_joined_table-matnr = wa_mara-bdmeng.&lt;/P&gt;&lt;P&gt;wa_joined_table-matnr = wa_mara-fktxt.&lt;/P&gt;&lt;P&gt;wa_joined_table-maktx = wa_marc-maktx.&lt;/P&gt;&lt;P&gt;APPEND wa_joined_table to it_joined_table.&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;Note: I do not know if there are the fields in BDMENG FKTXT in the table MARA it is only and example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please do not forget to award points if this is helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 13 Dec 2007 17:36:00 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-12-13T17:36:00Z</dc:date>
    <item>
      <title>join tables w/o using  join command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables-w-o-using-join-command/m-p/3204393#M763885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how can we  join two or more tables w/o  using join as join generates an performance issues.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2007 17:22:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables-w-o-using-join-command/m-p/3204393#M763885</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-13T17:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: join tables w/o using  join command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables-w-o-using-join-command/m-p/3204394#M763886</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Better to use the View which is containing all those tables....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To avoid join, you need to make them as a separate quries and you can use the FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of it_mara occurs 0,&lt;/P&gt;&lt;P&gt;      matnr type matnr,&lt;/P&gt;&lt;P&gt;      mtart type mtart,&lt;/P&gt;&lt;P&gt;      end  of it_mara.&lt;/P&gt;&lt;P&gt;      &lt;/P&gt;&lt;P&gt;select matnr mtart&lt;/P&gt;&lt;P&gt;       into table it_mara&lt;/P&gt;&lt;P&gt;       from  mara&lt;/P&gt;&lt;P&gt;       where mtart in so_mtart.&lt;/P&gt;&lt;P&gt;       &lt;/P&gt;&lt;P&gt;if it_mara[] is not initial.&lt;/P&gt;&lt;P&gt;SELECT aufnr&lt;/P&gt;&lt;P&gt;       posnr&lt;/P&gt;&lt;P&gt;       etenr&lt;/P&gt;&lt;P&gt;       werks&lt;/P&gt;&lt;P&gt;       matnr&lt;/P&gt;&lt;P&gt;       j_3asize&lt;/P&gt;&lt;P&gt;       j_4krcat&lt;/P&gt;&lt;P&gt;       vdatu&lt;/P&gt;&lt;P&gt;       menge&lt;/P&gt;&lt;P&gt;       j_3aresm&lt;/P&gt;&lt;P&gt;       INTO TABLE t_j3abdsi&lt;/P&gt;&lt;P&gt;       FROM j_3abdsi &lt;/P&gt;&lt;P&gt;       for all entries in it_mara&lt;/P&gt;&lt;P&gt;       WHERE a~matnr IN it_mara-matnr AND&lt;/P&gt;&lt;P&gt;               a~werks IN so_werks AND&lt;/P&gt;&lt;P&gt;               a~vdatu IN so_vdatu.&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;But sometimes For allentries also slower compared to join... so it depends&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if more than 2 tables are there&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the best way to avoid complex joins,is to create a view which should accomodate all the required fields from all the tables and try to access the view.&lt;/P&gt;&lt;P&gt;initially it may take some time create the view but as far as performance is concern(when you have bulk records) this way'll work fine.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2007 17:27:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables-w-o-using-join-command/m-p/3204394#M763886</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-13T17:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: join tables w/o using  join command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables-w-o-using-join-command/m-p/3204395#M763887</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can use the addition FOR ALL ENTRIES with SELECT. For EG:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*p_matnr is the parameter given in the selection screen&lt;/P&gt;&lt;P&gt;SELECT matnr bdmeng fktxt FROM mara INTO TABLE it_mara where matnr = p_matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Note the where condition where we specify the table name.&lt;/P&gt;&lt;P&gt;SELECT matnr maktx FROM marc FOR ALL ENTRIES IN it_mara INTO TABLE it_marc where matnr = it_mara-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Joining the 2 tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at it_mara into wa_mara.&lt;/P&gt;&lt;P&gt;Read table it_marc into wa_mara with key matnr = wa_mara-matnr.&lt;/P&gt;&lt;P&gt;wa_joined_table-matnr = wa_mara-matnr.&lt;/P&gt;&lt;P&gt;wa_joined_table-matnr = wa_mara-bdmeng.&lt;/P&gt;&lt;P&gt;wa_joined_table-matnr = wa_mara-fktxt.&lt;/P&gt;&lt;P&gt;wa_joined_table-maktx = wa_marc-maktx.&lt;/P&gt;&lt;P&gt;APPEND wa_joined_table to it_joined_table.&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;Note: I do not know if there are the fields in BDMENG FKTXT in the table MARA it is only and example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please do not forget to award points if this is helpful.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2007 17:36:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables-w-o-using-join-command/m-p/3204395#M763887</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-13T17:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: join tables w/o using  join command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables-w-o-using-join-command/m-p/3204396#M763888</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A common misconception. Joins are generally faster than FOR ALL ENTRIES.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2007 17:43:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables-w-o-using-join-command/m-p/3204396#M763888</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-13T17:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: join tables w/o using  join command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables-w-o-using-join-command/m-p/3204397#M763889</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Aditya,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With out using join u can use select qurey to join tables. But you have to crate individual internal tables for differnt tables and one final table which contains all the fields of both the tables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if there are 2 table declare 2 internal tables for each and one it_final internal table consits of all the fileds which are there in both internal table and write select quey for both the tables and get the data in two internal tables and then move this data from internal tables to it_final. After getting all the data in it_final pirint the values taking loop at it_final and endoop. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hope this helps u...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if useful&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;sunil kariam.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2007 17:46:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables-w-o-using-join-command/m-p/3204397#M763889</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-13T17:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: join tables w/o using  join command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables-w-o-using-join-command/m-p/3204398#M763890</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I beg to differ here ROB, joins are only good for upto 3 tables, but after that you will have to use SELECT using FOR ALL ENTRIES if you dont want to lose time&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2007 17:48:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables-w-o-using-join-command/m-p/3204398#M763890</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-13T17:48:41Z</dc:date>
    </item>
    <item>
      <title>Re: join tables w/o using  join command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables-w-o-using-join-command/m-p/3204399#M763891</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Nope - see:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;a href="/people/rob.burbank/blog/2007/03/19/joins-vs-for-all-entries--which-performs-better"&amp;gt;JOINS vs. FOR ALL ENTRIES - Which Performs Better?&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2007 17:54:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables-w-o-using-join-command/m-p/3204399#M763891</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-13T17:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: join tables w/o using  join command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables-w-o-using-join-command/m-p/3204400#M763892</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I saw this blog few months before.. I coudn't really come to a conclusion...that its right&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2007 20:09:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables-w-o-using-join-command/m-p/3204400#M763892</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2007-12-13T20:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: join tables w/o using  join command</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables-w-o-using-join-command/m-p/3204401#M763893</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You just have to run the sample program.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also see:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;a href="http://blogs.ittoolbox.com/sap/db2/archives/for-all-entries-vs-db2-join-8912"&amp;gt;FOR ALL ENTRIES vs DB2 JOIN&amp;lt;/a&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Dec 2007 20:23:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/join-tables-w-o-using-join-command/m-p/3204401#M763893</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-12-13T20:23:59Z</dc:date>
    </item>
  </channel>
</rss>

