<?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: refreshing the internal table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/refreshing-the-internal-table/m-p/1224547#M137458</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suresh,&lt;/P&gt;&lt;P&gt;thanks for the prompt reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at xvbpak where partner eq '18' or partner = '19'.&lt;/P&gt;&lt;P&gt;move xvbpak to xvbpap.&lt;/P&gt;&lt;P&gt;xvbpap-posnr = xvbpaf-posnr. &lt;/P&gt;&lt;P&gt;append xvbpap.&lt;/P&gt;&lt;P&gt;clear xvbpap.&lt;/P&gt;&lt;P&gt;delete xvbpak index sy-tabix.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As i said in the previous mail, when the next item comes in, there will be no entry in the internal table xvbpak.&lt;/P&gt;&lt;P&gt;the bunch of statements will be executed five times if there are five line items in the sales order. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table entries from xvbpak should be deleted only after processing all items in the internal table xvbpaf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Deno&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Apr 2006 01:40:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-04-18T01:40:46Z</dc:date>
    <item>
      <title>refreshing the internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/refreshing-the-internal-table/m-p/1224545#M137456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am writing a logic in an user-exit for Sales order,&lt;/P&gt;&lt;P&gt;Suppose there are 5 line items in sales order, and for each item the user exit is getting executed.&lt;/P&gt;&lt;P&gt;The user-exit contains the below statements.&lt;/P&gt;&lt;P&gt;Loop at xvbpak where ( partner eq '18' or partner = '19')."this is header internal table.&lt;/P&gt;&lt;P&gt;if sy-subrc eq 0. &lt;/P&gt;&lt;P&gt;move xvbpak to xvbpap.&lt;/P&gt;&lt;P&gt;xvbpap-posnr = xvbpaf-posnr. "passing the current line  item number to xvbpap table..&lt;/P&gt;&lt;P&gt;append xvbpap.&lt;/P&gt;&lt;P&gt;clear xvbpap.&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;This statement would be executed for each item in the sales order to copy header partner into item partners.&lt;/P&gt;&lt;P&gt;Once it completes, i have to delete the entries from header partner internal table xvbpak. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How can i write logic for deleting the entries from xvbpak after processing all items in the sales order.&lt;/P&gt;&lt;P&gt;The internal table xvbpaf contains all items in the sales order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Deno&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Apr 2006 01:19:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/refreshing-the-internal-table/m-p/1224545#M137456</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-18T01:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: refreshing the internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/refreshing-the-internal-table/m-p/1224546#M137457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Deno,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;First off, you need not check the sy-subrc inside a loop as only then you will be inside the loop. You can try the following code to refresh your itab..&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Loop at xvbpak where partner eq '18' or partner = '19'.
move xvbpak to xvbpap.
xvbpap-posnr = xvbpaf-posnr. 
append xvbpap.
clear xvbpap.
delete xvbpak index sy-tabix.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suresh Datti&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Apr 2006 01:24:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/refreshing-the-internal-table/m-p/1224546#M137457</guid>
      <dc:creator>suresh_datti</dc:creator>
      <dc:date>2006-04-18T01:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: refreshing the internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/refreshing-the-internal-table/m-p/1224547#M137458</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Suresh,&lt;/P&gt;&lt;P&gt;thanks for the prompt reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Loop at xvbpak where partner eq '18' or partner = '19'.&lt;/P&gt;&lt;P&gt;move xvbpak to xvbpap.&lt;/P&gt;&lt;P&gt;xvbpap-posnr = xvbpaf-posnr. &lt;/P&gt;&lt;P&gt;append xvbpap.&lt;/P&gt;&lt;P&gt;clear xvbpap.&lt;/P&gt;&lt;P&gt;delete xvbpak index sy-tabix.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As i said in the previous mail, when the next item comes in, there will be no entry in the internal table xvbpak.&lt;/P&gt;&lt;P&gt;the bunch of statements will be executed five times if there are five line items in the sales order. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The table entries from xvbpak should be deleted only after processing all items in the internal table xvbpaf.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Deno&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Apr 2006 01:40:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/refreshing-the-internal-table/m-p/1224547#M137458</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-18T01:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: refreshing the internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/refreshing-the-internal-table/m-p/1224548#M137459</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Loop at xvbpak where 
  partner = '18' or 
  partner = '19'.
  move xvbpak to xvbpap.
  xvbpap-posnr = xvbpaf-posnr. 
  append xvbpap.
  clear xvbpap.
endloop.

delete xvbpak where partner eq '18' or partner = '19'.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Rob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Apr 2006 02:54:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/refreshing-the-internal-table/m-p/1224548#M137459</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-18T02:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: refreshing the internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/refreshing-the-internal-table/m-p/1224549#M137460</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Why not do it the first time through the exit. It wasn't clear from your post whether to delete all entries from xvbpak or only the 18/19 entries. I've assumed all, but you can change the code easily if that's wrong:&lt;/P&gt;&lt;P&gt;if not xvbpak[] is initial.&lt;/P&gt;&lt;P&gt; Loop at xvbpaf.&lt;/P&gt;&lt;P&gt;  Loop at xvbpak where ( partner eq '18' or partner = '19')."this is header internal table.&lt;/P&gt;&lt;P&gt;   move xvbpak to xvbpap.&lt;/P&gt;&lt;P&gt;   xvbpap-posnr = xvbpaf-posnr. "passing the current line item number to xvbpap table..&lt;/P&gt;&lt;P&gt;   append xvbpap.&lt;/P&gt;&lt;P&gt;  endloop.&lt;/P&gt;&lt;P&gt; endloop.&lt;/P&gt;&lt;P&gt; loop at xvbpak.&lt;/P&gt;&lt;P&gt;   delete xvbpak.&lt;/P&gt;&lt;P&gt; endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Apr 2006 03:22:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/refreshing-the-internal-table/m-p/1224549#M137460</guid>
      <dc:creator>former_member186741</dc:creator>
      <dc:date>2006-04-18T03:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: refreshing the internal table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/refreshing-the-internal-table/m-p/1224550#M137461</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;Write your code in USEREXIT_SAVE_DOCUMENT ( include MV45AFZZ). This exit triggers while saving sales document and since it triggering at saving, you have all the tables available in this exit. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, you can write whatever logic you want to write with all the data available and it only triggeres once.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this will help you.&lt;/P&gt;&lt;P&gt;Pal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Apr 2006 04:29:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/refreshing-the-internal-table/m-p/1224550#M137461</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-04-18T04:29:14Z</dc:date>
    </item>
  </channel>
</rss>

