SAP, why doesn't async RFC return control immediate

I am trying to make an asynchronous RFC call to a SAP Function Module.

For testing purposes I am comparing the behaviour of a synchronous call versus an asynchronous call to the same FM. The FM receives an input parameter, waits 3 seconds, and returns an output parameter.

The synchronous call looks like this:

The asynchronous call looks like this:

The synchronous call works as expected, returning control to IS after 3 seconds, delivering the expected result.

The asynchronous call should return control to IS immediately and return no result. However, in actuality, control is not returned until 3 seconds have expired. No result is returned, which is the expected behavior.

My question is: Why doesn’t SAP return control to IS immediately for the asynchronous call?


We have the same problem here.
A webservice receives a XML-document and places it on the trading network.
My model picks up the recognized doctype and everythings works fine.
Only the included SAP-call takes some time in a few cases.

actually the webservice is NOT asynchron!
the service waits until the SAP-call is terminated!?!?

Anyone knows why?

Being transactional does not mean that a call is asynchronous.

RFC calls into SAP are synchronous.
For example, If you make a TRFC call into SAP, and there is a division by zero in the ABAP code, you will get the exception within the IS.
The ‘T’ stands for transactional, not for asynchronous.

If you want to make pure 100 % asynchronous calls into SAP, you should use the webm Broker.
In Peter’s example above, he can post a message to the Broker as the last step of his web service. The web service will return and an IS trigger can be configured to receive the message and send it to SAP.

In other words for a pure 100% store-and-forward asynchronous messages to SAP you can use the webm Broker.

The webm Broker and IT triggers can be used as your “store-and-forward” mechanism.

This is pretty much what outbound R/3 does with TRFC calls: it tries the first time, and if the call fails, it stores it and forwards it, by rexecuting it a set amout of time.