<?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 an existing record in a loop in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-an-existing-record-in-a-loop/m-p/2698068#M624661</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 have the following code and i want to modify the record with the correct amount but when I use the move and append it appends another recod to the table instead of modifying.    I triend using modify as well and it still adds in another record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; loop at T_QUANTITY_DATA3[] into LF_DATA3.&lt;/P&gt;&lt;P&gt;    L_TABIX = SY-TABIX.&lt;/P&gt;&lt;P&gt;    read table T_QUANTITY_DATA4[] into lf_data4 with key&lt;/P&gt;&lt;P&gt;           vbeln = LF_DATA3-VBELN&lt;/P&gt;&lt;P&gt;           posnr = LF_DATA3-POSNR.&lt;/P&gt;&lt;P&gt;    T_QUANTITY_DATA5 = T_QUANTITY_DATA3.&lt;/P&gt;&lt;P&gt;    move lf_data4-order_qty to lf_data5-order_qty.&lt;/P&gt;&lt;P&gt;   append lf_data5 to T_QUANTITY_DATA5.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Aug 2007 20:59:13 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-23T20:59:13Z</dc:date>
    <item>
      <title>modifying an existing record in a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-an-existing-record-in-a-loop/m-p/2698068#M624661</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 have the following code and i want to modify the record with the correct amount but when I use the move and append it appends another recod to the table instead of modifying.    I triend using modify as well and it still adds in another record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; loop at T_QUANTITY_DATA3[] into LF_DATA3.&lt;/P&gt;&lt;P&gt;    L_TABIX = SY-TABIX.&lt;/P&gt;&lt;P&gt;    read table T_QUANTITY_DATA4[] into lf_data4 with key&lt;/P&gt;&lt;P&gt;           vbeln = LF_DATA3-VBELN&lt;/P&gt;&lt;P&gt;           posnr = LF_DATA3-POSNR.&lt;/P&gt;&lt;P&gt;    T_QUANTITY_DATA5 = T_QUANTITY_DATA3.&lt;/P&gt;&lt;P&gt;    move lf_data4-order_qty to lf_data5-order_qty.&lt;/P&gt;&lt;P&gt;   append lf_data5 to T_QUANTITY_DATA5.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 20:59:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-an-existing-record-in-a-loop/m-p/2698068#M624661</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-23T20:59:13Z</dc:date>
    </item>
    <item>
      <title>Re: modifying an existing record in a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-an-existing-record-in-a-loop/m-p/2698069#M624662</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your code is incomplete, I don't get what you wanna do.&lt;/P&gt;&lt;P&gt;You have the following internal tables:&lt;/P&gt;&lt;P&gt;T_QUANTITY_DATA3[]&lt;/P&gt;&lt;P&gt;T_QUANTITY_DATA4[]&lt;/P&gt;&lt;P&gt;T_QUANTITY_DATA5[]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your source is T_QUANTITY_DATA3[]. For each record in this table, you read T_QUANTITY_DATA4[].&lt;/P&gt;&lt;P&gt;Next, what do you want to achieve?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: &lt;/P&gt;&lt;P&gt;        Alejandro Bindi&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 21:12:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-an-existing-record-in-a-loop/m-p/2698069#M624662</guid>
      <dc:creator>alejandro_bindi</dc:creator>
      <dc:date>2007-08-23T21:12:19Z</dc:date>
    </item>
    <item>
      <title>Re: modifying an existing record in a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-an-existing-record-in-a-loop/m-p/2698070#M624663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want to take the qty value in lf_data5-order_qty and modify the record in T_QUANTITY_DATA5 where vbeln and posnr are the same&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 21:17:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-an-existing-record-in-a-loop/m-p/2698070#M624663</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-23T21:17:05Z</dc:date>
    </item>
    <item>
      <title>Re: modifying an existing record in a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-an-existing-record-in-a-loop/m-p/2698071#M624664</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;Please post the full code. Also, from whatever I could understand from your code, using MODIFY instead of APPEND will solve your problem.&lt;/P&gt;&lt;P&gt;Use &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
MODIFY T_QUANTITY_DATA5 FROM lf_data5.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward points if the answer is helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Mukul&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 21:19:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-an-existing-record-in-a-loop/m-p/2698071#M624664</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-23T21:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: modifying an existing record in a loop</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-an-existing-record-in-a-loop/m-p/2698072#M624665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Something like this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
loop at T_QUANTITY_DATA3[] into LF_DATA3.
  L_TABIX = SY-TABIX.
  read table T_QUANTITY_DATA4[] into lf_data4 with key
    vbeln = LF_DATA3-VBELN
    posnr = LF_DATA3-POSNR.
**Modifications begin
  read table T_QUANTITY_DATA5[] into lf_data5 with key
    vbeln = LF_DATA3-VBELN
    posnr = LF_DATA3-POSNR.
  lf_data5 = lf_data3.
*  T_QUANTITY_DATA5 = T_QUANTITY_DATA3.
  move lf_data4-order_qty to lf_data5-order_qty.
*  append lf_data5 to T_QUANTITY_DATA5. 
  MODIFY TABLE T_QUANTITY_DATA5 FROM lf_data5.
**Modifications end
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Please reward points if helpful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2007 21:31:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/modifying-an-existing-record-in-a-loop/m-p/2698072#M624665</guid>
      <dc:creator>alejandro_bindi</dc:creator>
      <dc:date>2007-08-23T21:31:02Z</dc:date>
    </item>
  </channel>
</rss>

