<?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: multiple table fields in an itab. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-table-fields-in-an-itab/m-p/1758707#M328517</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;u can check some of them here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;goto ur program in SE38&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; in the menu Environment&lt;DEL&gt;-&amp;gt;Examples&lt;/DEL&gt;&amp;gt;Performance examples&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 Dec 2006 12:02:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-12-27T12:02:35Z</dc:date>
    <item>
      <title>multiple table fields in an itab.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-table-fields-in-an-itab/m-p/1758701#M328511</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;i have a query about a report where i have to display fields from 4 different tables in a report output by taking all those fields into a single internal table.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;mara,marc,mard, makt are the tables involved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now the only way to do this is join condition. Am i right or is there a better way of getting the required output without using joins??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;any suggestion is welcome.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Dec 2006 10:45:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-table-fields-in-an-itab/m-p/1758701#M328511</guid>
      <dc:creator>rnb86</dc:creator>
      <dc:date>2006-12-27T10:45:02Z</dc:date>
    </item>
    <item>
      <title>Re: multiple table fields in an itab.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-table-fields-in-an-itab/m-p/1758702#M328512</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Select the data separately into different internal tables. Then loop into the internal tables and finally populate the internal table that will be displayed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: join on MARA &amp;amp; other table will be big performance issue&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Kathirvel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Dec 2006 10:47:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-table-fields-in-an-itab/m-p/1758702#M328512</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-27T10:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: multiple table fields in an itab.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-table-fields-in-an-itab/m-p/1758703#M328513</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;You can use FOR ALL ENTRIES also

1. First select data from MARA table
     select * from MARA into table itab1.

2. if not itab1[] is initial.
       select * from marc into table itab2 for all entries in itab1 where matnr = itab1-matnr.
    endif.

3. similarly for the other 2 tables&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Dec 2006 10:49:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-table-fields-in-an-itab/m-p/1758703#M328513</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-27T10:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: multiple table fields in an itab.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-table-fields-in-an-itab/m-p/1758704#M328514</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;yes create an work area which is combination of 4 tables &amp;amp; create a IT.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write join &amp;amp; fetch the data into IT.&lt;/P&gt;&lt;P&gt;Generate the report using tht IT because if u use more loops its a performance issue&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Dec 2006 10:52:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-table-fields-in-an-itab/m-p/1758704#M328514</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-27T10:52:45Z</dc:date>
    </item>
    <item>
      <title>Re: multiple table fields in an itab.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-table-fields-in-an-itab/m-p/1758705#M328515</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Raghu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;what you have told is correct i.e joining all the 4 tables with material number as a key but there will be a performance issue so better do this way...&lt;/P&gt;&lt;P&gt;select on mara &amp;amp; marc.....then using for all entries go and select on mard &amp;amp; makt tables....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Vikranth Khimavath&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Dec 2006 11:06:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-table-fields-in-an-itab/m-p/1758705#M328515</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-27T11:06:59Z</dc:date>
    </item>
    <item>
      <title>Re: multiple table fields in an itab.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-table-fields-in-an-itab/m-p/1758706#M328516</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi friends,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;first of all, thank you for your time and suggestions for my question. Im trying to get the output. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think this can be done by using for all entries. But i dont have many fields to do that. i only have 5 fields from 4 tables to do the report. For that i need 4 itabs(for all entries method).i will publish the report once i get the output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hey, can anybody send me the performance enhancing techniques in ABAP programming.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanx again :Kathirvel, Chandrasekhar, Kalpanashri, Khimavath.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Dec 2006 11:47:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-table-fields-in-an-itab/m-p/1758706#M328516</guid>
      <dc:creator>rnb86</dc:creator>
      <dc:date>2006-12-27T11:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: multiple table fields in an itab.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-table-fields-in-an-itab/m-p/1758707#M328517</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;u can check some of them here&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;goto ur program in SE38&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; in the menu Environment&lt;DEL&gt;-&amp;gt;Examples&lt;/DEL&gt;&amp;gt;Performance examples&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Dec 2006 12:02:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-table-fields-in-an-itab/m-p/1758707#M328517</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-27T12:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: multiple table fields in an itab.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-table-fields-in-an-itab/m-p/1758708#M328518</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've done some experiments and found that a join (even on multiple tables) usually gives somewhat better performance than using FOR ALL ENTRIES. The best thing for you to do would be to do what I did - write them both ways and see which is better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also look at:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/people/rob.burbank/blog/2006/11/16/performance--what-will-kill-you-and-what-will-leave-you-with-only-a-flesh-wound&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Dec 2006 17:22:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-table-fields-in-an-itab/m-p/1758708#M328518</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-27T17:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: multiple table fields in an itab.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-table-fields-in-an-itab/m-p/1758709#M328519</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rob, &lt;/P&gt;&lt;P&gt;to see which variant is better he needs to test on big enough data amount (close to production, if there is one). I think you agree that some variants which work fine on small data volumes may work bad on a really big data volumes...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would use the simple rule to select between join vs for all entries :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;- join is more DB-optimizer dependent and if wrong path is used - it's going to be a problem, from the other hand if all join conditions are defined well and WHERE is not very complex - it may work faster, besides - it returns just the data you need... so no unnecessary transfers from DB to applicaiton server. More tables you add to join -&amp;gt; more depends on optimizer to choose the right access path.&lt;/P&gt;&lt;P&gt;- for all entries less dependent on DB optimizer as usually you provide key fields in WHERE clause for corresponding table, works fast enough assuming it's written properly (check for empty intenal table before selecting, no duplicates in the internal table,...), BUT it requires more memory on application server especially when you need to select just a couple of fields but your where condition is contains fields which you don't need in your result, OR if your selection is not very restrictive on some tables which can result in big enough internal table... so if the space is an issue - I would select join.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had to replace join with select for all entries in some cases as optimizer selected wrong path (it may be a problem with optimizer and not with join itself,,, but often we need to write code which wors fast now and not after SAP fixed error somewhere in optimizer &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt; ).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Dec 2006 19:32:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-table-fields-in-an-itab/m-p/1758709#M328519</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-28T19:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: multiple table fields in an itab.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-table-fields-in-an-itab/m-p/1758710#M328520</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When in doubt, do it both ways and see which is better. But take buffering into account.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Without seeing the exact requirements, I wouldn't want to say for sure which is better.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Rob Burbank&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Dec 2006 23:18:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-table-fields-in-an-itab/m-p/1758710#M328520</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-12-28T23:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: multiple table fields in an itab.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-table-fields-in-an-itab/m-p/1758711#M328521</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Rob,&lt;/P&gt;&lt;P&gt;   I took the long weekend off and couldnt reply to you on time.Please excuse my delayed response. Anyways, the requirement is not that huge. Im sending you the exact output i need to publish in the report.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;Plant &lt;BR /&gt;         Storage location&lt;BR /&gt;      Material number&lt;BR /&gt;      Description&lt;BR /&gt;         Stock&lt;/P&gt;&lt;P&gt;                                                                                (unrestricted)&lt;/P&gt;&lt;P&gt;MARC        MARD-LGORT       MARA-MATNR       MAKT-MAKTX	  MARD-LABST&lt;/P&gt;&lt;P&gt;-WERKS	&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;			&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------------------------------------------------------------" /&gt;&lt;P&gt;		                 Grand total		         * * * * * *&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The report shud give the existing stock for a material.  The report should have subtotal of the stock for each storage location and Grand total of the stock at the end of the plant.&lt;/P&gt;&lt;P&gt;	   &amp;lt;b&amp;gt;Plant data should start at new page.&lt;/P&gt;&lt;P&gt;	   Input: Selection screen which will allow one to select a range of materials.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jan 2007 04:49:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-table-fields-in-an-itab/m-p/1758711#M328521</guid>
      <dc:creator>rnb86</dc:creator>
      <dc:date>2007-01-02T04:49:28Z</dc:date>
    </item>
    <item>
      <title>Re: multiple table fields in an itab.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-table-fields-in-an-itab/m-p/1758712#M328522</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, it doesn't seem too complicated. What I would do is select all required materials from MARA into an internal table and then use that table with FOR ALL ENTRIES in separate selects against the other tables. I think a JOIN would probably be more efficient from a tuning perspective, but not by much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you must have the most efficient code, code it both ways, execute both multiple times (to avoid buffering effects) and take the best.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Jan 2007 17:27:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/multiple-table-fields-in-an-itab/m-p/1758712#M328522</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-01-02T17:27:56Z</dc:date>
    </item>
  </channel>
</rss>

