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: 

multiple logically related Database table(s) transaction control

Balu483
Participant
0 Kudos
357

hi all,

there is a transaction which involves HEADER+Multiple Line Items

when user press save button how to perform a transaction that it should create records in corresponding DB tables

at the end either the complete transaction could successful or fail but not partial.

how can we achieve such case with ACID Database properties

i had searched many SCN posts but still i didn't get the correct one.

so can any one please share a blog or document on it

thanks in advance.

1 ACCEPTED SOLUTION

GK817
Active Contributor
165

Hi Bala,

You can keep your INSERT/MODIFY statements in different function modules. You can keep calling these function modules in UPDATE task and then call COMMIT WORK once all validations are passed. Data will be updated at one point only.

Or

You can keep using INSERT/MODIFY statements and use COMMIT WORK / ROLLBACK WORK based on the validation results.

Regards

GK

3 REPLIES 3

GK817
Active Contributor
166

Hi Bala,

You can keep your INSERT/MODIFY statements in different function modules. You can keep calling these function modules in UPDATE task and then call COMMIT WORK once all validations are passed. Data will be updated at one point only.

Or

You can keep using INSERT/MODIFY statements and use COMMIT WORK / ROLLBACK WORK based on the validation results.

Regards

GK

0 Kudos
165

hi Gaurav Karkara,

thanks for your reply. among this two options which one is preferable for industry best standard practices.

Sandra_Rossi
Active Contributor
0 Kudos
165

You know what ACID is, but you didn't find the ABAP statements COMMIT WORK and ROLLBACK WORK?