<?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: read internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/4573355#M1079124</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;If u want to read line of an internal table uniquely , u need to have unique key combination .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can do like this .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can create a counter on the 1st internal table at the every change of common field value , so that u can read using the common field and counter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex: &lt;/P&gt;&lt;P&gt;sort it2 by &amp;lt;commonfield&amp;gt;.&lt;/P&gt;&lt;P&gt;loop at it2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v = v + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table it2 with key &amp;lt;commonfield&amp;gt; = &amp;lt;commnfield&amp;gt; counter = v.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;at end of &amp;lt;commonfield&amp;gt;.&lt;/P&gt;&lt;P&gt;clear v.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;&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;2nd way : &lt;/P&gt;&lt;P&gt;I dont know wht u want to do after reading , how ever if u want all records with common fields u can loop with respect to common field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it1 where commonfield = it2-commonfield.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;write ur logic wht ever u want to&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps in solving ur problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ramesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 22 Sep 2008 10:16:36 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-09-22T10:16:36Z</dc:date>
    <item>
      <title>read internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/4573350#M1079119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi expertz,&lt;/P&gt;&lt;P&gt;i have 2 tables with different structures and 1 field in common&lt;/P&gt;&lt;P&gt;iam reading entries in one table using the common field..but the problem is... this field is not unique so im always reading the same entry..but  wanted  to read  next entry..how can i overcome this problem..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 10:06:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/4573350#M1079119</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-22T10:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: read internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/4573351#M1079120</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;Please use &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP at First Internal table into Workarea1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read Table Second Internal table into work area2 where Workarea2-field = workarea1-field.&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&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;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;jana&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 10:08:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/4573351#M1079120</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-22T10:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: read internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/4573352#M1079121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;this is how i used...but branch is not key ..so it always reading the same &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT gt_output.&lt;/P&gt;&lt;P&gt; READ TABLE gt_zfitab_payments&lt;/P&gt;&lt;P&gt;    ASSIGNING &amp;lt;fs_payments&amp;gt; WITH KEY zbranch = gv_storeno&lt;/P&gt;&lt;P&gt;    BINARY SEARCH .&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reg&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 10:11:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/4573352#M1079121</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-22T10:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: read internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/4573353#M1079122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt; So whenever you read the record check its values with existing records in the table by comparing some fields which you have considered as unique keys while declaring the table and only if the record is different then only use the record or else go for next records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Sudharshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 10:15:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/4573353#M1079122</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-22T10:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: read internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/4573354#M1079123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT gt_output.

LOOP AT gt_zfitab_payments
ASSIGNING &amp;lt;fs_payments&amp;gt; 
WHERE zbranch = gv_storeno.

endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 10:16:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/4573354#M1079123</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-22T10:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: read internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/4573355#M1079124</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;If u want to read line of an internal table uniquely , u need to have unique key combination .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can do like this .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;U can create a counter on the 1st internal table at the every change of common field value , so that u can read using the common field and counter.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex: &lt;/P&gt;&lt;P&gt;sort it2 by &amp;lt;commonfield&amp;gt;.&lt;/P&gt;&lt;P&gt;loop at it2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;v = v + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read table it2 with key &amp;lt;commonfield&amp;gt; = &amp;lt;commnfield&amp;gt; counter = v.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;at end of &amp;lt;commonfield&amp;gt;.&lt;/P&gt;&lt;P&gt;clear v.&lt;/P&gt;&lt;P&gt;endat.&lt;/P&gt;&lt;P&gt;&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;2nd way : &lt;/P&gt;&lt;P&gt;I dont know wht u want to do after reading , how ever if u want all records with common fields u can loop with respect to common field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ex: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at it1 where commonfield = it2-commonfield.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;write ur logic wht ever u want to&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps in solving ur problem.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ramesh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 10:16:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/4573355#M1079124</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-22T10:16:36Z</dc:date>
    </item>
    <item>
      <title>Re: read internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/4573356#M1079125</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;If you are talking about Database Tables, try to use 'Inner join' or 'For all entries'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you are talking about internal tables, try to 'SORT' it and use 'DELETE ADJACENT DUPLICATES'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regard,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;R.Nagarajan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 10:16:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/4573356#M1079125</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-22T10:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: read internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/4573357#M1079126</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;In that case you need to use nested loop. But use it like this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT gt_output.&lt;/P&gt;&lt;P&gt;  LOOP AT gt_zfitab_payments WHERE zbranch = gv_storeno.&lt;/P&gt;&lt;P&gt;    -&lt;/P&gt;&lt;HR originaltext="-------" /&gt;&lt;P&gt;    -&lt;/P&gt;&lt;HR originaltext="-------" /&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Venkat&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 10:17:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/4573357#M1079126</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-22T10:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: read internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/4573358#M1079127</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;sort before loop based on branch field.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sort gt_output by zbranch.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT gt_output.&lt;/P&gt;&lt;P&gt;READ TABLE gt_zfitab_payments&lt;/P&gt;&lt;P&gt;ASSIGNING &amp;lt;fs_payments&amp;gt; WITH KEY zbranch = gt_output-branch BINARY SEARCH .&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope helps.&lt;/P&gt;&lt;P&gt;If not can you provide test data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Salini.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 22 Sep 2008 10:24:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-internal-table/m-p/4573358#M1079127</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-09-22T10:24:42Z</dc:date>
    </item>
  </channel>
</rss>

