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

regarding call back in perform statement

Former Member
0 Likes
452

hi all

i am using some custom remote function modules which they have used call transaction in it

now i am using some standard bapis and some custome rfc's

i have to update database when all functions are sucess or else i have to roll back all the updates

how to roll back this custom rfc's updates.

thanks & regards

kiran

1 ACCEPTED SOLUTION
Read only

former_member183804
Active Contributor
0 Likes
424

Hello Kiran,

the invocation of a remote enabled fuba via RFC triggers an implicit commit work. So if the requirement is to update the local db only in case of successful remote computing any change to the db has to occur only after the FuBa returns.

If the requirement is that way that remote and local side should have a transactional behavior (common commit) you face the so called "2 phase commit" problem. To my knowledge there is no perfect solution available for this scenario.

Regards

Klaus

3 REPLIES 3
Read only

venkata_ramisetti
Active Contributor
0 Likes
424

Hi,

YOu can use the follwoing functionmodules.

BAPI_TRANSACTION_COMMIT

BAPI_TRANSACTION_ROLLBACK

Since both are RFC-enabled, you can use for both purposes.

Thanks

Ramakrishna

Read only

Former Member
0 Likes
424

Hi Kiran,

You can code something like this after calling custom remote function module.

...

IF SY-SUBRC = 0.
  COMMIT WORK.
ELSE.
  ROLLBACK WORK.
ENDIF.

...

Hope this will help.

Regards,

Ferry Lianto

Please reward points if helpful.

Read only

former_member183804
Active Contributor
0 Likes
425

Hello Kiran,

the invocation of a remote enabled fuba via RFC triggers an implicit commit work. So if the requirement is to update the local db only in case of successful remote computing any change to the db has to occur only after the FuBa returns.

If the requirement is that way that remote and local side should have a transactional behavior (common commit) you face the so called "2 phase commit" problem. To my knowledge there is no perfect solution available for this scenario.

Regards

Klaus