on 11-17-2021 5:02 AM
ENDLOOP.
can you suggest how performance can be optimized for the above code.
Hi saisindhusha,
delete the records directly from the database by the internal table as source
DELETE ztsd_wtkt_sl from table gi_wtkt_sl_delete_msp
Greetings
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Define the internal tables as HASHED with unique keys, or SORTED if you don't have unique keys. You'll need to modify your DELETE statement so it works with HASHED tables though.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
LOOP AT gi_wtkt_sl_delete_msp INTO lwa_wtkt_sl_del.
DELETE FROM ztsd_wtkt_sl WHERE zzvbeln EQ lwa_wtkt_sl_del-zzvbeln
AND zzposnr EQ lwa_wtkt_sl_del-zzposnr.
IF sy-subrc EQ 0.
g_no_deleted = g_no_deleted + sy-dbcnt.
DELETE gi_wtkt_sl_delete_fp WHERE zzvbeln EQ lwa_wtkt_sl_del-zzvbeln
AND zzposnr EQ lwa_wtkt_sl_del-zzposnr.
ENDIF.
ENDLOOP.
Organizing the code
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.