Skip to Content

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

whitepaper

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  (http://help.sap.com/saphelp_nwes72/helpdata/en/48/75bec8bc27055ee10000000a42189b/content.htm)):

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

image

Hint:

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.

!https://weblogs.sdn.sap.com/weblogs/images/11352/LDAPRFCTraceinSystem32.png|height=226|alt=image|width=698|src=https://weblogs.sdn.sap.com/weblogs/images/11352/LDAPRFCTraceinSystem32.png|border=0!</body>

To report this post you need to login first.

1 Comment

You must be Logged on to comment or reply to a post.

  1. 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.

    Regards,
    Atul M.

    (0) 

Leave a Reply