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: 

Is it possible to commit/rollback 2 transactional RFCs together?

Marcel_Wahl
Advisor
Advisor
0 Kudos

Hi Experts,

This is a standard SOA issue but i did not get it resolved now.

Would be kind if anyone could assist.

We have an ABAP main program creating an object a via module RFC_A

called as "CALL FUNCTION 'RFC_A' destination lv_source_sys_a"

and afterwards we need to call a second creation of some accounting data

as module "RFC_B". (also called via destination b )

If the second one fails, the 1st one should be rolled back as well.

I can call a BAPI_ROLLBACK in the destination systems via RFC but not sure if this helps.

( And requesting the permissions will take a long time )

Does anyone know how the database sessions are handled in the destination systems

while an RFC call ?

Are they already closed or discarded if i dont call a commit in there?

Please assist.

Thanks in advance

Marcel

2 REPLIES 2

hymavathi_oruganti
Active Contributor
0 Kudos

what i would suggest is, do not use commit work till the end of 2nd RFC.

After the second RFC is successfull then use ,

Commit work.

else. Roll back.

Also, its better to use QRFC.

TRFC does not guarantee the sequence of updation the destination.

So, better to assign 'RFCA' and 'RFCB' to the same queue like below.

data: i_queue_qname like TRFCQOUT-QNAME.

CALL FUNCTION 'TRFC_SET_QUEUE_NAME'

EXPORTING

qname = i_queue_name

  • NOSEND = ' '

  • TRFC_IF_SYSFAIL = ' '

  • CALL_EVENT = ' '

EXCEPTIONS

invalid_queue_name = 1

OTHERS = 2

CALL FUNCTION 'RFC A' IN BACKGROUND TASK.

EXPORTING

QUEUE_NAME = I_QUEUE_NAME.

.............

CALL FUNCTION 'RFC B' IN BACKGROUND TASK.

EXPORTING

QUEUE_NAME = I_QUEUE_NAME.

.............

With QRFC , the LUWs are posted in the order they are sent. The 2nd LUW will not be posted until 1st LUW is successfull.

Marcel_Wahl
Advisor
Advisor
0 Kudos

Thanks fot he 1st reply. But may be i missed a detail:

I do not need help to organize local multi-threading.

The target systems are completly different systems/installations.

The question is: How can i commit the changes of RFC_A(different system) after RFC_B is done?

Thanks in advance