Application Development and Automation 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: 
Read only

Delete Logic using COMIT

Former Member
0 Likes
501

I will have 1000's of recs in an itab .

many sales orders data and many recs for each sales order.

and i have to delete the corresponding recs from database based on 2 conditions.

1. for each sales order, leave the latest rec and delete all other recs 4m DB

2. am asked 2 perform commit after every 500recs.

how can I use this commit logic.

thanks

kiran

3 REPLIES 3
Read only

Former Member
0 Likes
472

any clues plz

Read only

0 Likes
472

Hi Kiran, do something like this :


data : w_count type i.

loop at itab.
if w_count = 500.
commit.
clear w_count
endif.

endloop.

Hope this helps,

Erwan

Read only

Former Member
0 Likes
472

loop at itab .

at end of itab-vbeln.

continue.

endat.

move itab to itab1.

append itab1.

if sy-tabix mod 500 EQ 0.

delete DBtab from itab1.

commit work and wait.

refresh itab1.

endif.

endloop.

  • for remaining records in itab1 after looping

delete DBtab from itab1.

commit work and wait.

**hope the logic helps. but this is not advisable to do on std tables, do only on Ztables