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

HOW to rollback transaction?

Former Member
0 Likes
2,301

expert:

two transaction is CALL TRANSACTION tcode1 and CALL TRANSACTION tcode2 perform in turn.

if Call transaction tcode2 occurs error ,CALL TRANSACTION tcode1 will be rollback.how to do it.

thanks in advance.

fgq.

expert:

two transaction is CALL TRANSACTION tcode1 and CALL TRANSACTION tcode2 perform in turn.

if Call transaction tcode2 occurs error ,CALL TRANSACTION tcode1 will be rollback.how to do it.

thanks in advance.

fgq.

12 REPLIES 12
Read only

Former Member
0 Likes
1,703

Can you bit elaborate the term Rollback?

Read only

0 Likes
1,703

tcode1 is reversed

Read only

0 Likes
1,703

Not sure but you can try with Submit <your report name> if your tcode2 contains error.

Read only

Former Member
0 Likes
1,703

Hello There.

While calling the transaction from program we use SUBMIT statement.

I hope you also have used that statement.

If this statement is removed after calling of the transaction, there is no updating and automatic rollback is performed.

If this is the case then that's good.

If not then you can give feedback.

Good Luck & Regards.

Harsh Dave

Read only

0 Likes
1,703

my program don't submit report,I will perform two tcodes: 'mb1b'. Material move type is '541' and '309'.

Read only

0 Likes
1,703

try somthing like:

call transaction tcode2.

if fails.

submit <current reportname>.

endif.

Read only

0 Likes
1,703

at first tcode1 is performed ,then tcode2 is performed.

Read only

0 Likes
1,703

Hello There.

I suppose you will have to use, (SAY)

loop at _____

If ____ sucess.

COMMIT WORK.

else.

ROLLBACK WORK.

endif.

endloop.

COMMIT WORK statement updates the database.

If there is no COMMIT WORK, the transaction is terminated in case of error ROLLBACK WORK serves the purpose.

If that solves its fine and if not give feedback.

Good Luck & Regards.

Harsh Dave

Read only

Former Member
0 Likes
1,703

you can use this for example:

call tarnsaction tcode1.

if sy-subrc = 0.

call transaction tcode2.

if sy-subrc = 0.

commit work.

else.

rollback.

endif.

endif.

Hope this will solve the problem.

Read only

0 Likes
1,703

to perfom commit work and rollback work has no effect to call transaction....

but thank very much.

fgq

Read only

Former Member
0 Likes
1,703

try posting reversal 542 if tcode 2 fails... i think you cant rollback work in tcode1 if you fail in tcode 2. because it is already commited work and separate transaction. hope it helps

Read only

0 Likes
1,703

Your answer is good. But i want rollback like database.