Hi all
Pls find the following code,it the internal table has 100000 records,the problem is read the internal table it's get minimum 20 minits to end the loop.
pls help me
Thanks
kanishka
read table it_itab1 into wa_itab1 with key vgbel =
wa_itab-vbeln matnr = wa_itab-matnr.
if sy-subrc = 0 .
wa_itab-vgbel1 = wa_itab1-vbeln.
modify it_itab from wa_itab transporting vgbel1 where vbeln =
wa_itab-vbeln and matnr = wa_itab-matnr .
wa_itab-posnr1 = wa_itab1-posnr.
modify it_itab from wa_itab transporting posnr1 where vbeln =
wa_itab-vbeln and matnr = wa_itab-matnr .
wa_itab-matnr1 = wa_itab1-matnr.
modify it_itab from wa_itab transporting matnr1 where vbeln =
wa_itab-vbeln and matnr = wa_itab-matnr .
wa_itab-arktx = wa_itab1-arktx.
modify it_itab from wa_itab transporting arktx where vbeln =
wa_itab-vbeln and matnr = wa_itab-matnr .
wa_itab-fkimg = wa_itab1-fkimg.
modify it_itab from wa_itab transporting fkimg where vbeln =
wa_itab-vbeln and matnr = wa_itab-matnr .
endloop.
Hi,
Use binary search to have a good performance.
Eg: Read table int_fligh with key airln = LF binary search.
Feel free to revert Back.
--Ragu
it_itab1 declare it as a sorted internal table with key vgbel and also use field-symbols intead of modify statement.If the it_itab1 is standard internal table transfer it into sorted internal table with key vgbel using insert lines of statement.
Hi,
If you are going to modify the same table again with the same condition,you can do it at astrtech.
sort it_itab1 by vgbel matnr.
read table it_itab1 into wa_itab1 with key vgbel =
wa_itab-vbeln matnr = wa_itab-matnr by binary search.
if sy-subrc = 0 .
wa_itab-vgbel1 = wa_itab1-vbeln.
wa_itab-posnr1 = wa_itab1-posnr.
wa_itab-matnr1 = wa_itab1-matnr.
wa_itab-arktx = wa_itab1-arktx.
wa_itab-fkimg = wa_itab1-fkimg.
modify it_itab from wa_itab transporting vgbel1 posnr1 matnr1 arktx fkimg where vbeln =
wa_itab-vbeln and matnr = wa_itab-matnr .
endif.
Kindly reward points by clicking the star on the left of reply,if it helps.
Add a comment