<?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 multiple lines from a Internal Table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-multiple-lines-from-a-internal-table/m-p/6343792#M1397897</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;READ statement will pick the first entry encountered in the internal table as per the match criteria&lt;/P&gt;&lt;P&gt;Since, you are having  N entries associated with a particular one ,READ statement wont work correctly in this case.&lt;/P&gt;&lt;P&gt;So, youhave to use NESTED LOOP any wayz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lakshman.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 29 Oct 2009 14:16:49 GMT</pubDate>
    <dc:creator>former_member209217</dc:creator>
    <dc:date>2009-10-29T14:16:49Z</dc:date>
    <item>
      <title>Read multiple lines from a Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-multiple-lines-from-a-internal-table/m-p/6343791#M1397896</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;Is it possible to read multiple lines from an internal table using READ Table syntax.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Read statement suggest to select only one row.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement is  that I am looping around an internal table it1. Inside the loop I am looping once again over another table it2 since it2 can contain n entries for a particular value in it1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is thereway to avoid this nested looping.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sudharshan N A&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2009 14:13:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-multiple-lines-from-a-internal-table/m-p/6343791#M1397896</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-29T14:13:34Z</dc:date>
    </item>
    <item>
      <title>Re: Read multiple lines from a Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-multiple-lines-from-a-internal-table/m-p/6343792#M1397897</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;READ statement will pick the first entry encountered in the internal table as per the match criteria&lt;/P&gt;&lt;P&gt;Since, you are having  N entries associated with a particular one ,READ statement wont work correctly in this case.&lt;/P&gt;&lt;P&gt;So, youhave to use NESTED LOOP any wayz.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lakshman.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2009 14:16:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-multiple-lines-from-a-internal-table/m-p/6343792#M1397897</guid>
      <dc:creator>former_member209217</dc:creator>
      <dc:date>2009-10-29T14:16:49Z</dc:date>
    </item>
    <item>
      <title>Re: Read multiple lines from a Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-multiple-lines-from-a-internal-table/m-p/6343793#M1397898</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;Read statement would read only a single line at a time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why dont you use a key value to read from your internal table within the loop... instead of nested looping if it is possible&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Harini&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2009 14:20:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-multiple-lines-from-a-internal-table/m-p/6343793#M1397898</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-29T14:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: Read multiple lines from a Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-multiple-lines-from-a-internal-table/m-p/6343794#M1397899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Sudharsan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In some cases it may be impossible to do away with Nested Loops. In these cases, you need to reduce the ABAP processing time efficiently using parallel processing technique:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA: LV_INDX TYPE I.

SORT IT1 BY F1. "Here F1 is the common field

SORT IT2 BY F1.

LOOP AT IT1.

* Get the table index from which to loop
  READ TABLE IT2 TRANSPORTING NO FIELDS
  WITH KEY F1 = IT1-F1 BINARY SEARACH.
  IF SY-SUBRC = 0.
    LV_INDX = SY-TABIX.

    LOOP AT IT2 FROM LV_INDX.
      IF IT2-F1 NE IT1-F1. "If the value of F1 changes exit the loop
        EXIT.
      ENDIF.
      " Do your processing for IT2 here
    ENDLOOP.
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;May be other SDNers have some better responses.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Suhas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2009 14:36:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-multiple-lines-from-a-internal-table/m-p/6343794#M1397899</guid>
      <dc:creator>SuhaSaha</dc:creator>
      <dc:date>2009-10-29T14:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: Read multiple lines from a Internal Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/read-multiple-lines-from-a-internal-table/m-p/6343795#M1397900</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;It does seem possible to read multiple lines in a internal table using the READ statement with consecutive index. Have a look Rob's reply in this thread &lt;SPAN __jive_macro_name="message" id="8214440"&gt;&lt;/SPAN&gt; though not sure how much performace effective it is compared to nested loops. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Vikranth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2009 14:45:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/read-multiple-lines-from-a-internal-table/m-p/6343795#M1397900</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-10-29T14:45:15Z</dc:date>
    </item>
  </channel>
</rss>

