cancel
Showing results for 
Search instead for 
Did you mean: 

RFC Commit

Former Member
0 Kudos

Hi All,

I am creating a RFC. Inside the RFC,i havent called any BAPI.

I want to Commit the work, so do i need to call BAPI_TRANSACTION_COMMIT outside the RFC or even a COMMIT WORK inside the RFC should work.

Best regards,

Prashant

Accepted Solutions (1)

Accepted Solutions (1)

former_member223537
Active Contributor

Hi,

In my case UPDATE would be the last command in the RFC. So still do i need to explicity call BAPI_TRANSACTION_COMMIT instead of COMMIT WORK.

I did not get the point of rollback. Because in my case, Once the Update is done, the transaction is completed. There is no connecting transaction.

What is the risk involved if i do a commit work inside RFC. This is because, we do not want to have Mulitple calls to SAP from another system. We want to reduce the number of calls from another system to SAP.

Best regards,

Prashant

Message was edited by: Prashant Patil

former_member188685
Active Contributor
0 Kudos

Hi Prshanth,

i still suggest you to use explicit commit.

since this is not normal FM,

Regards

vijay

Former Member
0 Kudos

Hi all,

if you looked at the coding of BAPI_TRANSACTION_COMMIT you'll find a COMMIT WORK statement.

As long as you do not re-login with your RFC-connection this statement is executed in the same context and therefore doesn't make any difference at all.

There's another function COMMIT_WORK that you can also use. I once had problems with the COMMIT WORK AND WAIT variant.

Best wishes,

Florin

Former Member
0 Kudos

Hi again,

1. BAPI_TRANSACTION_COMMIT

is a bapi (rfc enabled)

(which internally uses commit work)

2. but when we write just commit work,

it will get executed in the local server.

3. but when we write, BAPI_TRANSACTION_COMMIT

using DESTINATION,

it will get executed on the REMOTE Server,

and in that server, COMMIT will happen.

4. doing commit in the same server, will do no use.

(bcos data is getting inserted in the REMOTE

server)

regards,

amit m.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi prashant,

1. If u write COMMIT inside the rfc,

then there is no control over rollback.

The whole purpose of rfc and LUW (Logical unit of work)

devised by sap, shall be defeated.

(suppose to COMPLETE THE TRANSACTION,

more than one RFC are required,

then using commit in one rfc,

and if the second rfc gives some error,

then the whole DATA will be INCONSISTENT)

2. Hence,

We should never put commit inside, rfc.

3. Instead, we should EXPLICITLY call

BAPI_TRANSACTION_COMMIT outside the rfc.

regards,

amit m.

former_member188685
Active Contributor
0 Kudos

Hi,

It is better you call it from outside since it is RFC.

explict commit is better.

Regards

vijay

naimesh_patel
Active Contributor
0 Kudos

Hello,

Inside the RFC, after your BAPI, you should put that BAPI_TRANSACTION_COMMIT.

Regards,

Naimesh