Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

SAP Transaction in Two phase Commit ?

Hi all,

When we make a connection to SAP system from .NET application using .NET connector, we can make calls to transactional BAPI/RFC’s. But is there any way in which we can make SAP transaction take part in MS DTC (Microsoft Distributed Transaction Coordinator) transactions?

We want to implement a two phase commit and hence this question. Please let us know if you are aware of any mechanism using which we can implement a two phase commit.

The call scenario is described below:

TransactionScope

{

1. SQL_StoredProc1();

2. SQL_StoresProc2();

10. SAP_TransactionBAPI();

11. SQLStoredProcn();

12. SQLTransaction_Commit();

13. SAPTransaction_Commit();

}

Exception ()

{

SQLTransaction_Rollback();

SAPTransaction_Rollback();

}

In the above case all the statements have to be executed successfully or they have to be rolled back. Let’s think of the situation where all the statements up to line 13 have been executed successfully, but there was a failure during the commit of SAP, and then we have to rollback the SQL transaction also which is already committed.

This situation can be handled if and only if SAP transaction manager follows XA transaction protocol and it can include itself in MSDTC. So that every transaction manager votes for the commit (it can be called half commit) if the transaction is successful otherwise all the transactions should be rolled back.

Can anybody tell me the way to include SAP transaction manager in MSDTC if it at all possible?

Former Member
Not what you were looking for? View more on this topic or Ask a question