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: 

Ztable update only if the transaction was not cancelled out.

Former Member
0 Kudos

Hi All,

I have a need to update a ztable based on whether a transaction was completely run or cancelled out.

I have added customer screens into the XK01/XK02 transactions using the BADI VENDOR_ADD_DATA_CS etc...

Now, in these screens i have some data which has to be updated to a Z-Table.

However, When the fields were changed, and then at some point during this process if the transaction was cancelled out, the Z-Table is still getting updated with these changed values. The Update to the Z-Table is written in the PAI of the screen. I will not have this data available at the User-Exit for Save for this transaction because these are custom fields which cannot be added to the Standard structures because of the functional requirement.

I would like this update to Z-table to happen only when the transaction is completed and not cancelled.

How can i make sure that this happens. How can i make sure that the commit to the DB is only made upon the whole transaction being successfully run.

Any advice is highly appreciated.

Thanks in advance.

jr.

1 ACCEPTED SOLUTION

Sm1tje
Active Contributor
0 Kudos

Two options I can think of:

1. Create a PERFORM ON COMMIT, this will only be called if COMMIT WORK was called by standard transaction.

2. Create a function module (update FM) and call this in update task.

2 REPLIES 2

Sm1tje
Active Contributor
0 Kudos

Two options I can think of:

1. Create a PERFORM ON COMMIT, this will only be called if COMMIT WORK was called by standard transaction.

2. Create a function module (update FM) and call this in update task.

Former Member
0 Kudos

Thanks for the Advice Micky.

I tried using the Call Function......IN UPDATE TASK....

And this worked for me.

Thanks again!

Jr.