<?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: Reading internal tables in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845088#M666474</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;fetch the data from VBAK and VBAP into ITAB1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take the VBAK-KNUMV and VBAP-POSNR and pass to &lt;/P&gt;&lt;P&gt;KONV-KNUMV and KONV-KPOSN and fetch the data from KONV&lt;/P&gt;&lt;P&gt;and separate the data based on the required KSCHL field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 28 Sep 2007 07:43:39 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-09-28T07:43:39Z</dc:date>
    <item>
      <title>Reading internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845086#M666472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 2 internal tables i_sddoc, i_konv. In one internal table (i_sddoc) I have 10 rows with identical knumw and posnr.&lt;/P&gt;&lt;P&gt;I need to get the lines from the other internal table (i_konv), when 2 fields are the same (knumw and posnr). In i_konv there are multiply records with the same knumw and kposn.&lt;/P&gt;&lt;P&gt;I'm not allowed to use embedded loops because the table have a size category 4 with thousands of items. So have can I select the lines from i_konv?&lt;/P&gt;&lt;P&gt;If you have further question to be able to answer me, please let me know.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 07:40:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845086#M666472</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T07:40:03Z</dc:date>
    </item>
    <item>
      <title>Re: Reading internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845087#M666473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Use this for ref...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at  i_sddoc.&lt;/P&gt;&lt;P&gt;read table i_konv with key  posnr =  i_sddoc-posnr&lt;/P&gt;&lt;P&gt;                                       knumv =  i_sddoc-knumv.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;do ur procvessing&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;reward if helpful,&lt;/P&gt;&lt;P&gt;Karthik&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 07:43:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845087#M666473</guid>
      <dc:creator>former_member189629</dc:creator>
      <dc:date>2007-09-28T07:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: Reading internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845088#M666474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;fetch the data from VBAK and VBAP into ITAB1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take the VBAK-KNUMV and VBAP-POSNR and pass to &lt;/P&gt;&lt;P&gt;KONV-KNUMV and KONV-KPOSN and fetch the data from KONV&lt;/P&gt;&lt;P&gt;and separate the data based on the required KSCHL field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 07:43:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845088#M666474</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T07:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: Reading internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845089#M666475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Refer the below code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT i_konv&lt;/P&gt;&lt;P&gt;     BY knumw&lt;/P&gt;&lt;P&gt;        posnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT i_sddoc &lt;/P&gt;&lt;P&gt;     INTO wa_sddoc.&lt;/P&gt;&lt;P&gt;loop at i_konv&lt;/P&gt;&lt;P&gt;     into wa_konv.&lt;/P&gt;&lt;P&gt;     where knumw = wa_sddoc-knumw&lt;/P&gt;&lt;P&gt;     AND   posnr = wa_sddoc-posnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE i_konv&lt;/P&gt;&lt;P&gt;     INTO  wa_konv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND wa_konv TO it_output.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check this code&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mukesh Kumar&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        mukesh kumar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 07:45:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845089#M666475</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T07:45:24Z</dc:date>
    </item>
    <item>
      <title>Re: Reading internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845090#M666476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is not good, because it only get 1 row from i_konv when it founds the same kunmw and posnr. I would need all.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 07:46:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845090#M666476</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T07:46:31Z</dc:date>
    </item>
    <item>
      <title>Re: Reading internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845091#M666477</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you mean to say like the header values are in i_sddoc and line item value are in i_konv&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 07:47:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845091#M666477</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T07:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: Reading internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845092#M666478</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Anji,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kschl is not obligatory in this case, so what should I do in this case?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 07:48:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845092#M666478</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T07:48:58Z</dc:date>
    </item>
    <item>
      <title>Re: Reading internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845093#M666479</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;white,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in that case, you will have to use a nested loop on konv where posnr &amp;amp; knumv =  i_sddoc posnr &amp;amp; knumv. I mean&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_sddoc.&lt;/P&gt;&lt;P&gt;loop at i_konv where key posnr = i_sddoc-posnr&lt;/P&gt;&lt;P&gt;and knumv = i_sddoc-knumv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;&lt;P&gt;do ur procvessing&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 07:49:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845093#M666479</guid>
      <dc:creator>former_member189629</dc:creator>
      <dc:date>2007-09-28T07:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: Reading internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845094#M666480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Karthik it would be okay, but if I have a very large internal table then it would run for a very long time, so that's why I don't want to use embedded loops.&lt;/P&gt;&lt;P&gt;have you got any other idea?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 07:51:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845094#M666480</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T07:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Reading internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845095#M666481</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello varalakshmi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes it's similar. Because I have knumv and posnr in i_sddoc, and I have to find all the lines in the other table i_konv which fits to it. The key between my 2 internal table is knumw and posnr, but I have more than 1 records in konv with the same knumv and posnr.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 07:54:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845095#M666481</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T07:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: Reading internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845096#M666482</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi White Stripes,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Without embedded loop i do not think your requirement is possibel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For better performance you can use INDEX in your inner loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT i_konv&lt;/P&gt;&lt;P&gt;BY knumw&lt;/P&gt;&lt;P&gt;posnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT i_sddoc &lt;/P&gt;&lt;P&gt;INTO wa_sddoc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE i_konv&lt;/P&gt;&lt;P&gt;INTO wa_konv&lt;/P&gt;&lt;P&gt;with key knumw = wa_sddoc-knumw&lt;/P&gt;&lt;P&gt;AND posnr = wa_sddoc-posnr&lt;/P&gt;&lt;P&gt;BINARY SEARCH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;z_tabix = sy-tabix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_konv&lt;/P&gt;&lt;P&gt;into wa_konv &lt;/P&gt;&lt;P&gt;from z_index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND wa_konv TO it_output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 07:56:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845096#M666482</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T07:56:20Z</dc:date>
    </item>
    <item>
      <title>Re: Reading internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845097#M666483</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am sorry but have to be a bit harsh, so many answers not one which is useful!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The last one is on the right track but still wrong:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SORT i_konv BY knumw posnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;LOOP AT i_sddoc INTO wa_sddoc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;READ TABLE i_konv INTO wa_konv&lt;/P&gt;&lt;P&gt;with key knumw = wa_sddoc-knumw&lt;/P&gt;&lt;P&gt;AND posnr = wa_sddoc-posnr&lt;/P&gt;&lt;P&gt;BINARY SEARCH.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;z_tabix = sy-tabix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the loop from index is the trick for several hits !!!&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;loop at i_konv into wa_konv from z_index.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;the exit is missing, then it will still loop half of the table !!!!!&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  IF NOT ( wa_konv-knumw = wa_sddoc-knumw&lt;/P&gt;&lt;P&gt;              AND wa_konv-posnr = wa_sddoc-posnr ).&lt;/P&gt;&lt;P&gt;    EXIT.&lt;/P&gt;&lt;P&gt;  ENDIIF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;there is a loop why another read ???&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;READ TABLE i_konv INTO wa_konv&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;APPEND wa_konv TO it_output.&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDLOOP. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For more information please read my recent blog:&lt;/P&gt;&lt;P&gt;/people/siegfried.boes/blog/2007/09/12/runtimes-of-reads-and-loops-on-internal-tables&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; allowed to use embedded loops because the table have a size category 4 &lt;/P&gt;&lt;P&gt;internal table don't have size categories, if you have a lot of data, more than &lt;/P&gt;&lt;P&gt;you can put into memory, then you must process in packages.&lt;/P&gt;&lt;P&gt;But then you must take care, that both packages contain the lines which belong together.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Siegfried&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 08:08:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845097#M666483</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T08:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: Reading internal tables</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845098#M666484</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The solution is the following. I have to sort all two tables according to knumv and posnr. Then I have to make a loop at konv, then read the table sddoc with key knumv and kposn. So Without sorting the 2 table it doesn't give right results.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Sep 2007 08:51:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/reading-internal-tables/m-p/2845098#M666484</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-09-28T08:51:13Z</dc:date>
    </item>
  </channel>
</rss>

