<?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 Modifying internal table. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table/m-p/1430751#M205992</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Friends,&lt;/P&gt;&lt;P&gt;I have an internal table with some line and each line has a material number, quantity etc.....&lt;/P&gt;&lt;P&gt;I need to add quantites based on a condition and add the result to the first line which does not satisfy the condition and delete all the lines which satisfy the condition from the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code is as follows however its giving me a short dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : wa1_input line lone of i_input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_input.&lt;/P&gt;&lt;P&gt;if xvbap-pstyv = 'TAL'&lt;/P&gt;&lt;P&gt;wa1_input-qty = wa1_input-qty + i_input-qty.&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;read table i_input where xvbap-pstyv &amp;lt;&amp;gt; 'TAL'.&lt;/P&gt;&lt;P&gt;i_input-qty = i_input-qty + wa1_input-qty.&lt;/P&gt;&lt;P&gt;modify i_input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help on this will be helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shejal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 01 Jul 2006 18:10:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-07-01T18:10:46Z</dc:date>
    <item>
      <title>Modifying internal table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table/m-p/1430751#M205992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Friends,&lt;/P&gt;&lt;P&gt;I have an internal table with some line and each line has a material number, quantity etc.....&lt;/P&gt;&lt;P&gt;I need to add quantites based on a condition and add the result to the first line which does not satisfy the condition and delete all the lines which satisfy the condition from the internal table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code is as follows however its giving me a short dump.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : wa1_input line lone of i_input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at i_input.&lt;/P&gt;&lt;P&gt;if xvbap-pstyv = 'TAL'&lt;/P&gt;&lt;P&gt;wa1_input-qty = wa1_input-qty + i_input-qty.&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;read table i_input where xvbap-pstyv &amp;lt;&amp;gt; 'TAL'.&lt;/P&gt;&lt;P&gt;i_input-qty = i_input-qty + wa1_input-qty.&lt;/P&gt;&lt;P&gt;modify i_input.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help on this will be helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shejal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Jul 2006 18:10:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table/m-p/1430751#M205992</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-01T18:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying internal table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table/m-p/1430752#M205993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Interesting requirement.  Maybe this will work.  I assume that PSTYV is in the internal tabe I_INPUT?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


DATA : wa1_input like line of i_input. 

clear wa1_input.
loop at i_input where pstyv = 'TAL'.
  wa1_input-qty = wa1_input-qty + i_input-qty.
  delete i_input.
endloop.

read table i_input with key pstyv &amp;lt;&amp;gt; 'TAL'.
if sy-subrc = 0.
  i_input-qty = i_input-qty + wa1_input-qty.
  modify i_input index sy-tabix.
endif.



&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;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Jul 2006 18:16:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table/m-p/1430752#M205993</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-07-01T18:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying internal table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table/m-p/1430753#M205994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is short dump?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Use&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;MODIFY TABLE i_input.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regds&lt;/P&gt;&lt;P&gt;Manohar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Jul 2006 18:17:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table/m-p/1430753#M205994</guid>
      <dc:creator>Manohar2u</dc:creator>
      <dc:date>2006-07-01T18:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying internal table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table/m-p/1430754#M205995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This won't work.  &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;read table i_input with key pstyv &amp;lt;&amp;gt; 'TAL'.
if sy-subrc = 0.
  i_input-qty = i_input-qty + wa1_input-qty.
  modify i_input index sy-tabix.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this instead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

loop at i_input where pstyv &amp;lt;&amp;gt; 'TAL'.
  i_input-qty = i_input-qty + wa1_input-qty.
  modify i_input.
  exit.   " We only want to do this read once
Endloop.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Jul 2006 18:20:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table/m-p/1430754#M205995</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-07-01T18:20:03Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying internal table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table/m-p/1430755#M205996</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rich,&lt;/P&gt;&lt;P&gt;No pstyv is not in the internal table of i_input.&lt;/P&gt;&lt;P&gt;Its in the XVBAP table od user exit MV45AFZZ for SO.&lt;/P&gt;&lt;P&gt;I have looped xvbap and have appended to i_input but the i_input table does not have PSTYV field.&lt;/P&gt;&lt;P&gt;once i get all the rows in my internal table from XVBAP i need to do this calculation ie, regarding quantities.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shejal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Jul 2006 18:21:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table/m-p/1430755#M205996</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-01T18:21:35Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying internal table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table/m-p/1430756#M205997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Then you code does not make much sense.  Why are you checking it while looping at I_INPUT?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

loop at i_input.
if &amp;lt;b&amp;gt;xvbap-pstyv&amp;lt;/b&amp;gt; = 'TAL'
wa1_input-qty = wa1_input-qty + i_input-qty.
endif.
endloop.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Jul 2006 18:24:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table/m-p/1430756#M205997</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2006-07-01T18:24:48Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying internal table.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table/m-p/1430757#M205998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Rich,&lt;/P&gt;&lt;P&gt;I will try to change the code and will let you know if i need any help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Shejal.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Jul 2006 18:27:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-internal-table/m-p/1430757#M205998</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-07-01T18:27:06Z</dc:date>
    </item>
  </channel>
</rss>

