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

multiple logically related Database table(s) transaction control

Balu483
Participant
0 Likes
1,453

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
Read only

GK817
Active Contributor
1,261

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
Read only

GK817
Active Contributor
1,262

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

Read only

0 Likes
1,261

hi Gaurav Karkara,

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

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,261

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