<?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 Internal table reading in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-reading/m-p/4371612#M1040216</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;&lt;/P&gt;&lt;P&gt;I have one internal table, I need to loop the table and READ the same table with in the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My requirement is like this:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the internal table KUNNR VKORG and VTWEG, if three fields values are same for more then one record, i need to append  those records into  another internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could any one help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gourisankar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 18 Aug 2008 13:27:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-08-18T13:27:13Z</dc:date>
    <item>
      <title>Internal table reading</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-reading/m-p/4371612#M1040216</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;&lt;/P&gt;&lt;P&gt;I have one internal table, I need to loop the table and READ the same table with in the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My requirement is like this:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the internal table KUNNR VKORG and VTWEG, if three fields values are same for more then one record, i need to append  those records into  another internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could any one help me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Gourisankar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Aug 2008 13:27:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-reading/m-p/4371612#M1040216</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-18T13:27:13Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table reading</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-reading/m-p/4371613#M1040217</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sankar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; 1)    Sort the Internal table by KUNNR,VKORG and VTWEG&lt;/P&gt;&lt;P&gt;2)     Loop the table and comparing the current value with previous value, If the values matches then move the record into another internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Aug 2008 13:32:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-reading/m-p/4371613#M1040217</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-18T13:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table reading</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-reading/m-p/4371614#M1040218</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi try this.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
itab1 = itab2.

Loop at itab1 into ls_itab1.
lv_tabix = sy-tabix.
loop at itab2 into ls_itab2.
if sy-tabix &amp;gt; lv_tabix.
if ls_itab1 eq ls_itab2.
Append ls_itab1 into itab3.
endif.
endif.
endloop.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Bhupal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Aug 2008 13:35:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-reading/m-p/4371614#M1040218</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-18T13:35:10Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table reading</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-reading/m-p/4371615#M1040219</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;try this way-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Sort itab1 by  kunnr vkorg vtweg.
Loop at itab1 into wa1.
  Read table itab1 into wa2 with keys kunnr = wa1-kunnr
                                                      vkorg = wa1-vkorg
                                                      vtweg = wa1-vtweg.


If sy-subrc = 0.
  Append wa2 to itab2.
endif.

Endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sujit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Aug 2008 13:37:53 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-reading/m-p/4371615#M1040219</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-18T13:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table reading</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-reading/m-p/4371616#M1040220</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gourisankar,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try to use an additional structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;tab1 (KUNNR VKORG and VTWEG)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:&lt;/P&gt;&lt;P&gt;tab2 like standard table tab2,&lt;/P&gt;&lt;P&gt;struc1 like line of tab1,&lt;/P&gt;&lt;P&gt;struc2 like line of tab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sort table tab1 ascending by KUNNR VKORG VTWEG.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at tab1 into struc1.&lt;/P&gt;&lt;P&gt; at first.&lt;/P&gt;&lt;P&gt;  move struc1 to struc2.&lt;/P&gt;&lt;P&gt;  continue. "Next data   &lt;/P&gt;&lt;P&gt; endat.&lt;/P&gt;&lt;P&gt; if struc1 = struc2.&lt;/P&gt;&lt;P&gt;  insert struc2 into table tab2.&lt;/P&gt;&lt;P&gt; else.&lt;/P&gt;&lt;P&gt;  move struc1 to struc2.&lt;/P&gt;&lt;P&gt; endif.&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;Something like that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;kind regards Philip&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Aug 2008 13:38:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-reading/m-p/4371616#M1040220</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-18T13:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table reading</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-reading/m-p/4371617#M1040221</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data: l_index1 type sy-tabix,&lt;/P&gt;&lt;P&gt;        l_index2 type sy-tabix,&lt;/P&gt;&lt;P&gt;        l_wa_kna1 type wa_kan1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;*sort i&lt;/U&gt;kna1.*_&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;clear wa_kna1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_kna1 into wa_kna1.&lt;/P&gt;&lt;P&gt;  move sy-tabix to l_index1.&lt;/P&gt;&lt;P&gt;  if l_index eq 1.&lt;/P&gt;&lt;P&gt;    move wa_kna1 to l_wa_kna1.&lt;/P&gt;&lt;P&gt;  else.&lt;/P&gt;&lt;P&gt;    compare your 3 key fields which should be equal with the current work area with l_wa_kna1.&lt;/P&gt;&lt;P&gt;    if satisfied.&lt;/P&gt;&lt;P&gt;      move ur rec to new itab.&lt;/P&gt;&lt;P&gt;    else.&lt;/P&gt;&lt;P&gt;      clear l_wa_kan1.&lt;/P&gt;&lt;P&gt;      move wa_kna1 to l_wa_kna1.&lt;/P&gt;&lt;P&gt;    endif.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endloop.&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;thanks&lt;/P&gt;&lt;P&gt;kiran&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Aug 2008 13:42:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-reading/m-p/4371617#M1040221</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-18T13:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: Internal table reading</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-reading/m-p/4371618#M1040222</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;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Loop at itab1 into wa_tab1.
  Read table itab1 into wa_tab2 with key kunnr = wa_tab1-kunnr
                                                          vkorg  = wa_tab1-vkorg
                                                          vtweg  = wa_tab1-vtweg
                                                          field4 NE  wa_tab1-field4 .
 
 
If sy-subrc = 0.
  Append wa_tab2 to itab2.
endif.
 
Endloop.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Important:    &lt;STRONG&gt;Here field4 should be a unique key in ur internal table&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Aug 2008 13:54:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/internal-table-reading/m-p/4371618#M1040222</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-08-18T13:54:01Z</dc:date>
    </item>
  </channel>
</rss>

