RFC Dialog Interactions
In an RFM called using RFC, both the variants sRFC and aRFC can execute dialog interactions using SAP GUI or call screens. This is not possible with the variants bgRFC, tRFC, and qRFC. It is technically possible for pRFC but not recommended.
Dialog interfactions executed by sRFC and aRFC require the RFC client to be executed in the foreground in a dialog work process and that the user defined in the destination has dialog authorization. RFM does not open a SAP GUI window on the RFC server; instead it does the following:
- sRFC uses the current SAP GUI window of the caller, which means that the current screen is replaced temporarily by the screen of the remotely called function. Entering /ntcode commands in the command field of the standard toolbar closes the remote connection and the calling program continues its processing after the RFC. The behavior on the server side is then no longer defined.
- aRFC opens a new external session in the RFC client and displays the remotely executed application in a new SAP GUI window there. Entering /ntcode commands in the command field of the standard toolbar executes the transaction "tcode" in this session.
The screen data is passed back by the RFC interface to the calling system. Statements for classic list
output, such as
WRITE, which are executed when a function module is called
remotely, write to the list buffer of the RFC server. The statement
LEAVE TO LIST-PROCESSING
can be used to display the lists during a screen sequence displayed in a SAP GUI window of the caller. List outputs made in programs called from RFM are also displayed in a SAP GUI window of the caller.
In both cases, entering /otcode commands in the command field of the standard toolbar opens another external session on the RFC server and an additional external session for displaying a SAP GUI window on the client side. This happens when the transaction "tcode" is executed.
If RFMs are called externally by dialog interactions, you must make sure that only dialog windows (that is, SAP GUI windows without a standard toolbar) are displayed, and that no commands can therefore be entered in the command field.