‎2007 Mar 27 3:23 PM
Hi Guys
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
This is what I have so far
update ztable
set flag = 'X'
where flag = 'I'.
‎2007 Mar 27 3:31 PM
Hi,
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
LOOP AT ITAB.
update ztable
set flag = 'X'
where Keyword1 = Itab-keyword1 and
Keyword = Itab-keyword2 and
flag = 'I'.
ENDLOOP.Regards
Sudheer
‎2007 Mar 27 3:26 PM
Hi,
Please try this.
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.
Regards,
Ferry Lianto
‎2007 Mar 27 3:29 PM
loop at itab where flag = 'l'.
itab-flag = 'X'.
modify itab index sy-tabix.
endloop.
modify ztable from table itab.
‎2007 Mar 27 3:31 PM
Hi,
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
LOOP AT ITAB.
update ztable
set flag = 'X'
where Keyword1 = Itab-keyword1 and
Keyword = Itab-keyword2 and
flag = 'I'.
ENDLOOP.Regards
Sudheer