Skip to Content
author's profile photo Former Member
Former Member

Internal table problem

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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 16, 2006 at 07:10 AM

    Hi,

    Sort the internal table and read the internal table with binary search.

    It may help

    Regards

    Ganesh

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 16, 2006 at 07:12 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 16, 2006 at 07:08 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 16, 2006 at 07:10 AM

    Hello,

    Try to delete the duplicate records which is not required.

    Sort itab by Vbeln matnr.

    Delete adjacent duplicates from itab comparing field names.

    Thanks,

    Krishna

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 16, 2006 at 07:17 AM

    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
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.