qRFC and the Use of the RFC Library
Instead of using tRFC, an SAP system application can use qRFC with outbound queue from an SAP system to call RFC functions that are available in a tRFC server program being used by the RFC Library.
Every SAP system application that works with an external qRFC program can use qRFC with outbound queue instead of tRFC, for a LUW serialization. This leads to improved performance in the sending SAP system.
Instead of RfcIndirectCall or RfcIndirectCallEx, a tRFC client program has to use the new call RfcQueueInsert to inform the target SAP system to save the inbound LUW in the defined inbound queue for later processing. When the call RfcQueueInsert has been successfully sent, the qRFC client must then execute RfcConfirmTransID. Otherwise, it will have to repeat the call RfcQueueInsert with the same TID as before.
A qRFC client program must execute the following RFC calls:
For connecting to an SAP system
The RFC Library uses this call to obtain a TID generated by the SAP system.
If an error occurs, the qRFC client program later needs to restore the connection and repeat the call. Otherwise, the qRFC client program can assign this TID to the qRFC data.
The RFC Library groups all the data belonging to an RFC function together with the TID, the queue name, and optionally the queue counter, and sends it using the tRFC protocol (with enhancements for qRFC with inbound queue) to the SAP system.
If an error occurs, the qRFC client program later needs to restore the connection and repeat the call. In this situation, the program needs to use the old TID, and not obtain a new TID using RfcCreateTransID. Otherwise, there is no guarantee that this RFC function will be executed exactly once in the SAP system.
After this call has been successfully executed, the LUW is completely saved in the inbound queue. The qRFC client program can then update its own TID Management (for example, by deleting the TIS entries).
In contrast to tRFC/qRFC between SAP systems, a LUW from a qRFC client program only contains one RFC function.

If the target SAP system does not support qRFC with inbound queue, it processes the inbound LUW immediately, and does not send an error message back to the qRFC client program. If this happens, the qRFC client program works in the same way as a tRFC client program.
Every application in the SAP system can use qRFC with outbound queue instead of tRFC to communicate with an external tRFC server:
§ Minimal changes are required in the ABAP code.
§ No changes are required in the code of the tRFC server.
§ System performance is improved.
Use the new API call RfcQueueInsert instead of RfcIndirectCall or RfcIndirectCallEx in a tRFC client program to write an LUW directly to an inbound queue in an SAP system (available as of RFC Library 4.6A).
· No more waiting for LUW processing to finish when you use RfcQueueInsert
· Once the RfcQueueInsert call has been sent back, you still need to execute RfcConfirmTransId.
Do not forget you register your queue in the QIN Scheduler, so that it can be activated automatically.
Continue by reading the following:
