Skip to Content
0
Former Member
Sep 23, 2008 at 04:10 AM

commit work and process to update DB

53 Views

I am programming a sap batch, in this program, it first select out all data needed to output to a I/F file, and then update these data's status as 'Outputed'.

so. i want to do it with the next logic:

1.select out all data needed to be outputed from table

2. update status

Loop :all records needed to be updated

1) sap lock:

lock table

2) do update

3) Unlock table

End loop

3.output I/F file

4.commit work

is there any problem with above logic? i want to update DB only if updating and I/F output are executed corretly. and sap lock is necessory? commit work is the last step, any problem?

thanks for your answer.