Remote Function Calls Using SAPGUI

It is possible for an RFC client program to call ABAP function modules which are using ‘Dynpros’ or SAP graphics. This allows you to include normal SAP screens into your programs. Consequently, it is possible to call complete SAP transactions from external programs.

To use this functionality, a SAPGUI front end server (version 3.0C or later) must be installed on the external system where the RFC client program is running.

There are three methods to activate this new functionality:

...

       1.      Use RfcOpen

You can call the function RfcOpen with the special mode RFC_MODE_VERSION_3 and then set the field use_sapgui to a non-zero value in the structure RFC_CONNOPT_VERSION_3.

       2.      Use the saprfc.ini file

You can define an entry in the saprfc.ini file which includes all necessary connection parameters and the RFC-specific parameter USE_SAPGUI (=1) in the saprfc.ini file. An RFC client program can then issue the RfcOpen call with the mode RFC_MODE_PARAMETER and a destination pointed to the defined entry. See The SAPRFC.INI File for more details.

       3.      Use SYSTEM_ATTACH_GUI

You can call the function module RFC_ATTACH_GUI (without any parameter) within the ABAP funtion module you want to use before using any SAPGUI functionality.

This method can be used without modifying the C code of the RFC client program.

·         This feature is available on all supported UNIX platforms (Motif).

·         On Windows NT or Windows 95, it is only available with the 32-bit RFC library together with a 32-bit SAPGUI. In particular, this functionality is not supported for the 16-bit RFC library or for 16-bit SAPGUI (Windows 3.x, as well as the 16-bit subsystems of Windows NT and Windows 95).

·         Under Windows NT and Windows 95 the SAPGUI program and its DLLs and auxiliary programs can be installed anywhere. However, you must have started SAPGUI once before it can be started automatically by RFC, because the SAPGUI must register itself in the Windows registry.

·         On SAP-based UNIX systems, the SAPGUI program must be installed on the default ‘SAP path’ /usr/sap/<system name>/SYS/exe/run.