Remote Function Calls Using SAPGUI 
Starting with R/3 Release 3.0C, 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:
You can call the function
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.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.
