Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

how can i have best performance?

Former Member
0 Kudos

This is my loop:

LOOP AT appoggio INTO appoggio1.

READ TABLE tb_dfkkzw WITH KEY opbel = appoggio1-opbel INTO tb_dfkkzw BINARY SEARCH.

IF sy-subrc = 0.

DELETE appoggio WHERE opbel = appoggio1-opbel.

ENDIF.

ENDLOOP.

In appoggio there are 650.000 record and for do this loop my job during 80.000 seconds how i can improving performance?

thanks

sorry for my english

1 ACCEPTED SOLUTION

former_member194613
Active Contributor
0 Kudos

There is serious bug => quadratic coding!!!

+ The DELETE searchs linearly and does not use the BINARY SEARCH!

+ add a TRANSPORTING NO FIELDS


LOOP AT appoggio INTO appoggio1.
   idx1 = sy-tabix.
   READ TABLE tb_dfkkzw TRANSPORTING NO FIELDS
             WITH KEY opbel = appoggio1-opbel BINARY SEARCH.

    IF sy-subrc = 0.
      DELETE appoggio index idx1.
    ENDIF.
ENDLOOP.

Siegfried

1 REPLY 1

former_member194613
Active Contributor
0 Kudos

There is serious bug => quadratic coding!!!

+ The DELETE searchs linearly and does not use the BINARY SEARCH!

+ add a TRANSPORTING NO FIELDS


LOOP AT appoggio INTO appoggio1.
   idx1 = sy-tabix.
   READ TABLE tb_dfkkzw TRANSPORTING NO FIELDS
             WITH KEY opbel = appoggio1-opbel BINARY SEARCH.

    IF sy-subrc = 0.
      DELETE appoggio index idx1.
    ENDIF.
ENDLOOP.

Siegfried