Skip to Content
Author's profile photo Andre Fischer

How to start a RFC Registered Server Program as a Windows service

Today I was asked how it is possible to start the program ldap_rfc.exe as a service. This was because I have mentioned this in a


that I have published a while ago in 2005 whithout describing in detail how to do it.

I remembered that there were some obstacles if one tries to find the solution so I decided to try it myself once again. Since this integration is also of interest for other integration scenarios where RFC Registered Server Programs are used I decided to document my findings in this blog.

Registered RFC Server Programs

I would like to start to explain what a registered RFC server program is.

Architecture of a Registered RFC Server Program

An RFC server program can be registered with the SAP gateway and wait for incoming RFC call requests. The server program is able to register itself under a program-ID at an SAP gateway. From the SAP System it can thus be accessed through a TCP IP RFC destintation with activation type ‘T’ Registered Server Program.

The basic “problem” is that a registered RFC server program needs some command line parameters if being started as a windows service or from a command line. When the program is called from the ABAP kernel this is done using the program ID.

 The syntax for starting a Registered RFC Server Program is basically the following:

<rfc_server_program>.exe -a <program-ID> -x sapgw<system_number> -g <hostname of gatewayserver>

On a windows server there are two ways to start a Registered RFC Server Program (either or – not both…):

  • Automatically as a Windows service.

You should start with option 1 when setting up the configuration because any error messages are available in clear text in the command prompt.

Since option1 is not ideal for productive usage you should start a productive Registered RFC Server Program as a Windows server once the setup has been tested.

Please note that you cannot start a registered RFC server program at the same time manually and as a Windows service. The second attempt to register the program would fail it is only possible to register once using the same program-ID at the SAP Gateway.

In the following I would like to describe the example how to start the registered RFC server program ldap_rfc.exe as a Windows Service.    

Step 1: Find out necessary files and command line options to be used on the Windows server

The program ldap_rfc.exe needs some DLL’s so that it can be started on a server where no SAP system is installed.The best way to find out the missing files is to start ldap_rfc.exe including valid command line parameters in a command prompt.The command line syntax is basically (as described in the SAP Online Help  (

ldap_rfc.exe -a ldap_rfc -x sapgw<system_number> -g <hostname of gatewayserver>

The number for sapgw<system_number> can be retrieved from the services file on the SAP ABAP Application Server In our default installation (Instance Number 00) the following parameters were used:

ldap_rfc.exe -a ldap_rfc -x 3300 -g iwdfvm3136

We start a command prompt , change to the directory where ldap_rfc.exe is located and start the command mentioned above.

ldap_rfc.exe -a ldap_rfc -x 3300 -g iwdfvm3136 <br />Could not open the ICU common library.   The following files must be in the path described by   the environment variable “PATH”:   icuuc34.dll, icudt34.dll, icuin34.dll  (nlsui0.c 1386) pid = 4296 

Step 2: Start ldap_rfc.exe as a Windows Service

After copying the files icuuc34.dll, icudt34.dll, icuin34.dll to that directory ldap_rfc.exe can be started.To start the program as a windows service we use srvany.exe and proceed as described in the following article:

Application as a Service “srvany.exe” in Windows Server 2008

In the parameters section you have to specify the command line parameters of ldap_rfc.exe (see above)

a ldap_rfc -x 3300 -g iwdfvm3136

as shown in the following screen shot



In contrast to the article mentioned above I chose the following value for the parameter ImagePath C:Program FilesWindows Resource KitsToolssrvany.exe instead of C:WindowsSystem32srvany.exe since I encountered an error when I tried to start the service even when the file srvany.exe was copied to C:WindowsSystem32. When choosing  the file location where the file has been installed everything worked.

If you activate trace options in SM59 you will find a trace file rfc*.trc  in the directory C:WindowsSystem32 as shown in the follwoing screen shot.


Assigned Tags

      1 Comment
      You must be Logged on to comment or reply to a post.
      Author's profile photo Atul Mohanty
      Atul Mohanty

      Hi Andre,

      Hope you are doing good.

      I was going through the whitepaper document and this blog. Thanks for the detail info here on RFC server program as a windows service.

      We seems have a situation on Option (b) mentioned in the whitepaper. But we need some help on this topic.

      Our requirement is to read users data from a LDAP using a SAP Program.
      So we have done the following steps.
      1. Created C# Program in the windows server and registered the windows service. The Program ID is registered too.
      2. In the C# program, we have a function module . This function module is to be called from SAP ( Created the template function module RFC enabled from SAP).
      3. Created a RFC destination with a Program ID (in point 1),  Gateway Host and Gateway Service. The RFC connection test is OK.

      4. But we have a issue. when we are calling the RFC function module from SAP program, it does not recognize the RFC.

      Is there any step we are missing ? Do we need to register the RFC using some command in the window server ? Please advise.

      Please note, when we are using a existing RFC for a different connector(in the system) it works.

      Could you please guide us on this issue ?

      Thank you.

      Atul M.