Quantcast
Channel: SCN : All Content - ABAP Development
Viewing all articles
Browse latest Browse all 8332

DELETE records within the loop

$
0
0

Hi Experts,

 

I just read some of the threads in SCN and all have prescribed to avoid DELETE statement inside the loop.

 

See me case below. I have two local tables lt_beleg and lt_rot.

 

LOOP AT lt_beleg into lw_beleg.

DELETE lt_rot where BELNR = lw_beleg-BELNR.

END LOOP.

 

Am deleting records from lt_rot based on the BELNR from lt_beleg. But my lt_rot contains possible records where BELNR = ' '. So I dont have any other option to delete the records within loop, such that i'll will have records with other than BELEG as well as empty BELNR in my lt_rot.

 

I don't understand how it will affect the performance, as am deleting the records with exact condition within the loop.

 

Please help me to clear it, else is there any other way to handle the code.

 

Waiting for your valuable ideas

 

 

BR,

RAM.


Viewing all articles
Browse latest Browse all 8332

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>