<?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: Updating flag using itab in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/updating-flag-using-itab/m-p/2027807#M415866</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If you use the SET keyword, then you need to use all the key fields in the where condition, so better to dump all the data into a Internal table, then use below code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT ITAB.
 update ztable
  set flag = 'X'
  where  Keyword1 = Itab-keyword1 and
            Keyword = Itab-keyword2 and
           flag = 'I'.

ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Mar 2007 14:31:17 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-27T14:31:17Z</dc:date>
    <item>
      <title>Updating flag using itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/updating-flag-using-itab/m-p/2027804#M415863</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 need to update flag to X for all flag = I from my ztable. Ztable is a database table with many entries (10000's). I currently have code that implements this functionality but performance is very imp here so I need to fine tune the code, perhaps putting it in itab and modifying the entire table from it should work &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I have so far &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  update ztable
  set flag = 'X'
  where flag = 'I'.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2007 14:23:05 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/updating-flag-using-itab/m-p/2027804#M415863</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-27T14:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Updating flag using itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/updating-flag-using-itab/m-p/2027805#M415864</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 try this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
loop at itab.
 move 'X' to itab-flag.
 modify itab.
endloop.

modify ztable from table itab. 

OR

loop at itab.
  update ztable
  set flag = 'X'
  where kunnr = itab-kunnr
    and vbeln = itab-vbeln.
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;Ferry Lianto&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2007 14:26:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/updating-flag-using-itab/m-p/2027805#M415864</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-27T14:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: Updating flag using itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/updating-flag-using-itab/m-p/2027806#M415865</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;loop at itab where flag = 'l'.&lt;/P&gt;&lt;P&gt;itab-flag = 'X'.&lt;/P&gt;&lt;P&gt;modify itab index sy-tabix.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;modify ztable from table itab.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2007 14:29:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/updating-flag-using-itab/m-p/2027806#M415865</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-27T14:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: Updating flag using itab</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/updating-flag-using-itab/m-p/2027807#M415866</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;If you use the SET keyword, then you need to use all the key fields in the where condition, so better to dump all the data into a Internal table, then use below code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;LOOP AT ITAB.
 update ztable
  set flag = 'X'
  where  Keyword1 = Itab-keyword1 and
            Keyword = Itab-keyword2 and
           flag = 'I'.

ENDLOOP.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Mar 2007 14:31:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/updating-flag-using-itab/m-p/2027807#M415866</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-27T14:31:17Z</dc:date>
    </item>
  </channel>
</rss>

