<?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: link two inner table by index in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/link-two-inner-table-by-index/m-p/11298495#M1917471</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is the fastest method.... please notice the following points&lt;/P&gt;&lt;P&gt;1. both tables are sorted on the same key, so the sequence of availability of "field" is same for both tables.&lt;/P&gt;&lt;P&gt;2.The read with index is faster&lt;/P&gt;&lt;P&gt;3.upon success it is incrementing the index value by 1, hence the previous entries are not at all scanned in the next iteration.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Oct 2015 19:53:52 GMT</pubDate>
    <dc:creator>former_member210541</dc:creator>
    <dc:date>2015-10-15T19:53:52Z</dc:date>
    <item>
      <title>link two inner table by index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/link-two-inner-table-by-index/m-p/11298488#M1917464</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi guys&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; now I miss one problem , I hope to&amp;nbsp;&amp;nbsp; two&amp;nbsp; link&amp;nbsp; two inner table&amp;nbsp; more fast.&amp;nbsp; both of the tables have millions recoreds.&lt;/P&gt;&lt;P&gt;I have been read some code.but I dont know&amp;nbsp; WHY?&lt;/P&gt;&lt;P&gt; Can you explain ?&amp;nbsp; HELP ME !&amp;nbsp; thank you.&lt;/P&gt;&lt;P class="Default" style="text-align: justify;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.5pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Default" style="text-align: justify;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.5pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Default" style="text-align: justify;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.5pt;"&gt;SORT gt_tab01 BY field. &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Default" style="text-align: justify;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.5pt;"&gt;SORT gt_tab02 BY field.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Default" style="text-align: justify;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.5pt;"&gt;l_index = 1. &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Default" style="text-align: justify;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.5pt;"&gt;LOOP AT gt_tab01 INTO gs_tab01. &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Default" style="text-align: justify;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.5pt;"&gt;READ TABLE gt_tab02&amp;nbsp; INTO gs_tab02 INDEX l_index. &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Default" style="text-align: justify;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.5pt;"&gt;CHECK sy-subrc = 0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Default" style="text-align: justify;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.5pt;"&gt;IF gs_tab02-field = gs_tab01-field.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Default" style="text-align: justify;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.5pt;"&gt; l_index&amp;nbsp; = l_index + 1. &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Default" style="text-align: justify;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.5pt;"&gt;ENDIF. &lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Default" style="text-align: justify;"&gt;&lt;SPAN lang="EN-US" style="font-size: 10.5pt;"&gt;ENDLOOP. &lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2015 12:18:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/link-two-inner-table-by-index/m-p/11298488#M1917464</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-10-15T12:18:22Z</dc:date>
    </item>
    <item>
      <title>Re: link two inner table by index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/link-two-inner-table-by-index/m-p/11298489#M1917465</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you explain what you are trying to achieve ? Because this code doesn't really do much except for using your memory.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2015 14:08:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/link-two-inner-table-by-index/m-p/11298489#M1917465</guid>
      <dc:creator>PeterJonker</dc:creator>
      <dc:date>2015-10-15T14:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: link two inner table by index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/link-two-inner-table-by-index/m-p/11298490#M1917466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Wei Liang,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why would you want to link 2 itabs by the index? This is prone to errors...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Don't you have a common unique ID field in both itabs to link them?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For performance improvements, use a hashed or sorted table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;----&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regarding the code sample you provided, my initial idea about the WHY question, is that&lt;/P&gt;&lt;P&gt;(1) L_INDEX is keeping a count how many times the value in GS_TAB02-FIELD equals the value in GS_TAB01-FIELD.&lt;/P&gt;&lt;P&gt;(2) On the other hand, you might interpret this differently: the variable L_INDEX keeps track which index number in GT_TAB02 is missing a value in field GT_TAB02-FIELD, but is present in table GT_TAB01-FIELD.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But theoretically, this has some limitations/design features: the number of identical values in GT_TAB01-FIELD must be equal or larger then the number of identical values in GT_TAB02-FIELD &lt;STRONG&gt;and&lt;/STRONG&gt; each value in GT_TAB01-FIELD must be present in GT_TAB02-FIELD. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't know the exact purpose of the programmer when he/she 'designed' this piece of code, but I would never do this using an index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Zhou&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2015 14:21:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/link-two-inner-table-by-index/m-p/11298490#M1917466</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-10-15T14:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: link two inner table by index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/link-two-inner-table-by-index/m-p/11298491#M1917467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;THANKS FOR YOU ATTENTION.&lt;/P&gt;&lt;P&gt; THIS CODE FROM&amp;nbsp; BOOK ABOUT ABAP. &lt;/P&gt;&lt;P&gt;&amp;nbsp; This code is for linking two inner table which have &lt;SPAN style="color: #333333; font-size: 12px;"&gt;millions recoreds.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2015 14:21:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/link-two-inner-table-by-index/m-p/11298491#M1917467</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-10-15T14:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: link two inner table by index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/link-two-inner-table-by-index/m-p/11298492#M1917468</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;there is no faster method than this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is this code working for you? normaly you read table entries by there key fields, not by index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Stefan Seeburger&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2015 14:23:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/link-two-inner-table-by-index/m-p/11298492#M1917468</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-10-15T14:23:54Z</dc:date>
    </item>
    <item>
      <title>Re: link two inner table by index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/link-two-inner-table-by-index/m-p/11298493#M1917469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Try,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="Default" style="font-size: 12px; color: #333333; text-align: justify; background: #ffffff;"&gt;&lt;SPAN lang="EN-US" style="font-weight: inherit; font-style: inherit; font-size: 10.5pt; font-family: inherit; background: transparent;"&gt;LOOP AT gt_tab01 INTO gs_tab01.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Default" style="font-size: 12px; color: #333333; text-align: justify; background: #ffffff;"&gt;&lt;SPAN lang="EN-US" style="font-weight: inherit; font-style: inherit; font-size: 10.5pt; font-family: inherit; background: transparent;"&gt;READ TABLE gt_tab02&amp;nbsp;&amp;nbsp; with key&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #333333; font-size: 14px; text-align: justify;"&gt;gs_tab02-field&amp;nbsp; = &lt;/SPAN&gt; &lt;SPAN style="color: #333333; font-size: 14px; text-align: justify;"&gt; gs_tab01-field&amp;nbsp;&amp;nbsp; Transporting no fields&lt;/SPAN&gt; .&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Default" style="font-size: 12px; color: #333333; text-align: justify; background: #ffffff;"&gt;&lt;SPAN lang="EN-US" style="font-weight: inherit; font-style: inherit; font-size: 10.5pt; font-family: inherit; background: transparent;"&gt;CHECK sy-subrc = 0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Default" style="font-size: 12px; color: #333333; text-align: justify; background: #ffffff;"&gt;&lt;SPAN lang="EN-US" style="font-weight: inherit; font-style: inherit; font-size: 10.5pt; font-family: inherit; background: transparent;"&gt;l_index&amp;nbsp; = l_index + 1.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Default" style="font-size: 12px; color: #333333; text-align: justify; background: #ffffff;"&gt;&lt;SPAN lang="EN-US" style="font-weight: inherit; font-style: inherit; font-size: 10.5pt; font-family: inherit; background: transparent;"&gt;ENDLOOP.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Default" style="font-size: 12px; color: #333333; text-align: justify; background: #ffffff;"&gt;&lt;SPAN lang="EN-US" style="font-weight: inherit; font-style: inherit; font-size: 10.5pt; font-family: inherit; background: transparent;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Default" style="font-size: 12px; color: #333333; text-align: justify; background: #ffffff;"&gt;&lt;SPAN lang="EN-US" style="font-weight: inherit; font-style: inherit; font-size: 10.5pt; font-family: inherit; background: transparent;"&gt;Hope you are checking the content of internal table, then above code will be helpful.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Default" style="font-size: 12px; color: #333333; text-align: justify; background: #ffffff;"&gt;&lt;SPAN lang="EN-US" style="font-weight: inherit; font-style: inherit; font-size: 10.5pt; font-family: inherit; background: transparent;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Default" style="font-size: 12px; color: #333333; text-align: justify; background: #ffffff;"&gt;&lt;SPAN lang="EN-US" style="font-weight: inherit; font-style: inherit; font-size: 10.5pt; font-family: inherit; background: transparent;"&gt;Regards,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="Default" style="font-size: 12px; color: #333333; text-align: justify; background: #ffffff;"&gt;&lt;SPAN lang="EN-US" style="font-weight: inherit; font-style: inherit; font-size: 10.5pt; font-family: inherit; background: transparent;"&gt;Venkat.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2015 16:07:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/link-two-inner-table-by-index/m-p/11298493#M1917469</guid>
      <dc:creator>VenkatRamesh_V</dc:creator>
      <dc:date>2015-10-15T16:07:42Z</dc:date>
    </item>
    <item>
      <title>Re: link two inner table by index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/link-two-inner-table-by-index/m-p/11298494#M1917470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your code will be much slower because it use key access without binary search. Index access is the fastest as&lt;STRONG&gt; &lt;/STRONG&gt;Stefan&lt;SPAN class="j-post-author"&gt;&lt;STRONG&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="-1" data-externalid="" data-presence="null" data-userid="854200" data-username="stefanseeburger" href="https://answers.sap.com/people/stefanseeburger"&gt; &lt;/A&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;said earlier.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2015 19:23:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/link-two-inner-table-by-index/m-p/11298494#M1917470</guid>
      <dc:creator>former_member210008</dc:creator>
      <dc:date>2015-10-15T19:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: link two inner table by index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/link-two-inner-table-by-index/m-p/11298495#M1917471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is the fastest method.... please notice the following points&lt;/P&gt;&lt;P&gt;1. both tables are sorted on the same key, so the sequence of availability of "field" is same for both tables.&lt;/P&gt;&lt;P&gt;2.The read with index is faster&lt;/P&gt;&lt;P&gt;3.upon success it is incrementing the index value by 1, hence the previous entries are not at all scanned in the next iteration.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2015 19:53:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/link-two-inner-table-by-index/m-p/11298495#M1917471</guid>
      <dc:creator>former_member210541</dc:creator>
      <dc:date>2015-10-15T19:53:52Z</dc:date>
    </item>
    <item>
      <title>Re: link two inner table by index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/link-two-inner-table-by-index/m-p/11298496#M1917472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for you answer.&lt;/P&gt;&lt;P&gt;This code is aimed at improve the efficiency of table joins in when inner table have too much record.&lt;/P&gt;&lt;P&gt;&amp;nbsp; There are two ways to improve efficiency of table joins in.&lt;/P&gt;&lt;P&gt;&amp;nbsp; 1.using index (sort two table and&amp;nbsp; use one variable&amp;nbsp; to link two table&amp;nbsp; ,this is my problem,I dont know which way is better.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; 2.using index (sort one table ,this way is what you say). &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2015 05:12:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/link-two-inner-table-by-index/m-p/11298496#M1917472</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-10-16T05:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: link two inner table by index</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/link-two-inner-table-by-index/m-p/11298497#M1917473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;THANKS&amp;nbsp; a lot ,This way I have been used. It is a good way.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 16 Oct 2015 05:13:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/link-two-inner-table-by-index/m-p/11298497#M1917473</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-10-16T05:13:36Z</dc:date>
    </item>
  </channel>
</rss>

