<?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: Modifying internal table in loop. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table-in-loop/m-p/5966788#M1338575</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;P&gt;try this way..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_index = sy-tabix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read itab2 with key commanfield1 = irab1-commaon field.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;move corresponding itab2 to itab1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read itab3with key commanfield1 = irab1-commaon field.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;move corresponding itab3 to itab1.&lt;/P&gt;&lt;P&gt;endif&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read itab4 with key commanfield1 = irab1-commaon field.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;move corresponding itab4 to itab1.&lt;/P&gt;&lt;P&gt;endif&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read itab5 with key commanfield1 = irab1-commaon field.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;move corresponding itab5 to itab1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modify itab1 index w_index.&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;Prabhudas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 04 Aug 2009 18:22:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-08-04T18:22:35Z</dc:date>
    <item>
      <title>Modifying internal table in loop.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table-in-loop/m-p/5966787#M1338574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guis,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have data in five internal table each internal tale contains one field. I have to move all these fields into one final internal table.&lt;/P&gt;&lt;P&gt;How to do this please any body suggest.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 18:17:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table-in-loop/m-p/5966787#M1338574</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T18:17:45Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying internal table in loop.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table-in-loop/m-p/5966788#M1338575</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;P&gt;try this way..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;w_index = sy-tabix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read itab2 with key commanfield1 = irab1-commaon field.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;move corresponding itab2 to itab1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read itab3with key commanfield1 = irab1-commaon field.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;move corresponding itab3 to itab1.&lt;/P&gt;&lt;P&gt;endif&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read itab4 with key commanfield1 = irab1-commaon field.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;move corresponding itab4 to itab1.&lt;/P&gt;&lt;P&gt;endif&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;read itab5 with key commanfield1 = irab1-commaon field.&lt;/P&gt;&lt;P&gt;if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;move corresponding itab5 to itab1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Modify itab1 index w_index.&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;Prabhudas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 18:22:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table-in-loop/m-p/5966788#M1338575</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T18:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying internal table in loop.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table-in-loop/m-p/5966789#M1338576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Before creating 5 internal tables, make sure that each table has some relation with some other table.&lt;/P&gt;&lt;P&gt;If you have only 1 field in the table how will you relate with other tables.&lt;/P&gt;&lt;P&gt;Internal tables will perform better when it works same like Data base table. i.e. Relational schema.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prathap&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Aug 2009 18:23:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table-in-loop/m-p/5966789#M1338576</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-04T18:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying internal table in loop.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table-in-loop/m-p/5966790#M1338577</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 all the 5 internal tables are of same type then you can use the following statements for appending all the internal tables to the final internal table. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;append lines of itab1 to ifinal.&lt;/P&gt;&lt;P&gt;append lines of itab2 to ifinal.&lt;/P&gt;&lt;P&gt;append lines of itab3 to ifinal.&lt;/P&gt;&lt;P&gt;append lines of itab4 to ifinal.&lt;/P&gt;&lt;P&gt;append lines of itab5 to ifinal.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Swetha&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2009 08:22:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table-in-loop/m-p/5966790#M1338577</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-05T08:22:22Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying internal table in loop.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table-in-loop/m-p/5966791#M1338578</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;As per your question, you can  use Move statement for moving all the fileds to the Final Interanl Table.&lt;/P&gt;&lt;P&gt;Hope this will work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the sample code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MOVE itab1 TO itab2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or the equivalent statement&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab2 = itab1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Likewise you can move it to the Final Table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Dhanalakshmi L&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2009 10:03:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table-in-loop/m-p/5966791#M1338578</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-05T10:03:18Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying internal table in loop.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table-in-loop/m-p/5966792#M1338579</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;You say there is just one field in each of your 5 internal tables. Looks like there is no relation between them. This might cause a performance issue. So I would suggest you to relook into the portion of code where you are populating data into 5 different internal tables. May be, you could do so alternatively that might improve the performance. As for your requirement, you can use MOVE statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;move itab1-field1 to itab_final-field1.&lt;/P&gt;&lt;P&gt;move itab2-field1 to itab_final-field2.&lt;/P&gt;&lt;P&gt;move itab3-field1 to itab_final-field3.&lt;/P&gt;&lt;P&gt;move itab4-field1 to itab_final-field4.&lt;/P&gt;&lt;P&gt;move itab5-field1 to itab_final-field5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;itab_final-field1 = itab1-field1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And then append the data to the internal table.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2009 10:15:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table-in-loop/m-p/5966792#M1338579</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-05T10:15:55Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying internal table in loop.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table-in-loop/m-p/5966793#M1338580</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;Before getting table in 5 different internal table get some field which relate to other table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;then loop through the table and Read the  link field in the other table &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check the return value if its 0 then move the value to that table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;example&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at itab1.&lt;/P&gt;&lt;P&gt;read table itab2 with key f1 = itab2-f1.&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;itab1-f1 = itab2-f1.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;modify itab1.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;like that you have to move all those field into the single internal table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;John Victor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2009 13:46:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table-in-loop/m-p/5966793#M1338580</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-05T13:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying internal table in loop.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table-in-loop/m-p/5966794#M1338581</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 code mite help you ......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN __default_attr="red" __jive_macro_name="color"&gt;&lt;UL&gt;&lt;UL&gt;&lt;UL&gt;&lt;LI level="3" type="ul"&gt;there is a 2,500 character limit for individual posts. Please only post the relevant portions of code ***&lt;/LI&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/UL&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ramakrishna.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Rob Burbank on Aug 5, 2009 10:54 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2009 14:52:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table-in-loop/m-p/5966794#M1338581</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-05T14:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying internal table in loop.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table-in-loop/m-p/5966795#M1338582</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 code mite help you ......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Internal table 1:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of tt_vbak,&lt;/P&gt;&lt;P&gt;         vbeln type vbeln_va, "SALES ORDER NO&lt;/P&gt;&lt;P&gt;         audat type audat, "DOCUMENT DATE&lt;/P&gt;&lt;P&gt;       end of tt_vbak.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Internal table 2:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of tt_vbap,&lt;/P&gt;&lt;P&gt;         vbeln type vbeln_va, "SALES ORDER NO&lt;/P&gt;&lt;P&gt;         posnr type posnr_va, "SALES DOCU ITEM&lt;/P&gt;&lt;P&gt;      end of tt_vbap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Internal table 3:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of tt_vbuk,&lt;/P&gt;&lt;P&gt;         vbeln type vbeln_va,&lt;/P&gt;&lt;P&gt;         gbstk type gbstk, "OVERALL PROCESSING STATUS OF DOCU&lt;/P&gt;&lt;P&gt;end of tt_vbuk.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Clubing all the internal table 1,2,3 into Final Table .&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;types: begin of tt_final,&lt;/P&gt;&lt;P&gt;        audat  type  audat , "SOLD TO PARTY&lt;/P&gt;&lt;P&gt;         vbeln type vbeln_va, "SALES ORDER NO&lt;/P&gt;&lt;P&gt;         posnr type posnr_va, "SALES DOCU ITEM&lt;/P&gt;&lt;P&gt;         gbstk  type gbstk, "DISTRIBUTION CHANNE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    end of tt_final.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; INTERNAL TABLE DECLARATION FOR TT_VBAK,TT_VBAP,TT_FINAL TABLE&lt;/P&gt;&lt;P&gt;*&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data:itab_vbak type standard table of tt_vbak ,&lt;/P&gt;&lt;P&gt;     itab_vbap type standard table of tt_vbap ,&lt;/P&gt;&lt;P&gt;     itab_vbuk type standard table of tt_vbuk ,&lt;/P&gt;&lt;P&gt;     itab_final type standard table of tt_final.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*&amp;amp; WORK AREA DECLARATION FOR TT_VBAK,TT_VBAP,TT_FINAL TABLE&lt;/P&gt;&lt;P&gt;*&amp;amp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;amp;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: wa_vbak type tt_vbak,&lt;/P&gt;&lt;P&gt;      wa_vbap type tt_vbap,&lt;/P&gt;&lt;P&gt;      wa_final type tt_final.&lt;/P&gt;&lt;P&gt;orm select_vbak .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;We Are Selecting Fields From Internal Table 1.&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;select vbeln&lt;/P&gt;&lt;P&gt;         audat&lt;/P&gt;&lt;P&gt;       from vbak into table itab_vbak&lt;/P&gt;&lt;P&gt;        where vkorg = p_vkorg and vtweg = p_vtweg&lt;/P&gt;&lt;P&gt;         &lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;We Are Selecting Fields From Internal Table 2.&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if not itab_vbak[] is initial.&lt;/P&gt;&lt;P&gt;    select vbeln&lt;/P&gt;&lt;P&gt;           posnr&lt;/P&gt;&lt;P&gt;           from vbap into table itab_vbap&lt;/P&gt;&lt;P&gt;           for all entries in itab_vbak&lt;/P&gt;&lt;P&gt;           where vbeln = itab_vbak-vbeln .&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;We Are Selecting Fields From Internal Table3.&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if not itab_vbak[] is initial.&lt;/P&gt;&lt;P&gt;    select vbeln gbstk from vbuk into table itab_vbuk&lt;/P&gt;&lt;P&gt;       for all entries in itab_vbak&lt;/P&gt;&lt;P&gt;           where vbeln = itab_vbak-vbeln and gbstk ne 'C'.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;  if not itab_vbuk[] is initial.&lt;/P&gt;&lt;P&gt;    select vbeln&lt;/P&gt;&lt;P&gt;           posnr&lt;/P&gt;&lt;P&gt;           from vbap into table itab_vbap&lt;/P&gt;&lt;P&gt;           for all entries in itab_vbuk&lt;/P&gt;&lt;P&gt;           where vbeln = itab_vbuk-vbeln .&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Inserting All Internaltable Fields into Final Table.&lt;/STRONG&gt;&lt;/U&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  if not itab_vbap[] is initial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    loop at itab_vbap into wa_vbap.&lt;/P&gt;&lt;P&gt;      wa_final-vbeln = wa_vbap-vbeln.&lt;/P&gt;&lt;P&gt;      wa_final-posnr = wa_vbap-posnr.&lt;/P&gt;&lt;P&gt;      &lt;/P&gt;&lt;P&gt;   read table itab_vbak into wa_vbak with key vbeln =&lt;/P&gt;&lt;P&gt;                                              wa_vbap-vbeln.&lt;/P&gt;&lt;P&gt;      if sy-subrc = 0.&lt;/P&gt;&lt;P&gt;        wa_final-audat = wa_vbak-audat.&lt;/P&gt;&lt;P&gt;        &lt;/P&gt;&lt;P&gt;     append wa_final to itab_final.&lt;/P&gt;&lt;P&gt;        clear wa_vbak.&lt;/P&gt;&lt;P&gt;        clear wa_vbap.&lt;/P&gt;&lt;P&gt;        clear wa_final.&lt;/P&gt;&lt;P&gt;      endif.&lt;/P&gt;&lt;P&gt;    endloop.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ramakrishna.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 05 Aug 2009 15:01:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table-in-loop/m-p/5966795#M1338582</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-08-05T15:01:20Z</dc:date>
    </item>
  </channel>
</rss>

