Skip to Content

Hello community,

since a long time SAP offers the ActiveX RFC Controls – wrapper around the classic RFC library (LibRFC [ANSI] and LibRFCU [Unicode]).

You can use this ActiveX Controls without SAP GUI for Windows installation very easily.

Copy for ANSI the files:

  • wdobapi.ocx – from directory SAP\FrontEnd\SAPgui
  • wdtaocx.ocx – from directory SAP\FrontEnd\SAPgui
  • wdtfuncs.ocx – from directory SAP\FrontEnd\SAPgui
  • wdtlog.ocx – from directory Common Files\SAP Shared
  • librfc32.dll – from directory system32 on 32-bit and from syswow64 on 64-bit Windows environment
  • convlib.dll – from directory Common Files\SAP Shared with SAP GUI 7.40
  • sapfewut.dllfrom directory Common Files\SAP Shared with SAP GUI 7.40
  • sapfilecache.dllfrom directory Common Files\SAP Shared with SAP GUI 7.40
  • saplgmgr2.dllfrom directory Common Files\SAP Shared with SAP GUI 7.40
  • sapmime.dllfrom directory Common Files\SAP Shared with SAP GUI 7.40

Copy for Unicode the files:

  • wdobapiU.ocx – from directory SAP\FrontEnd\SAPgui
  • wdtaocxU.ocx – from directory SAP\FrontEnd\SAPgui
  • wdtfuncU.ocx – from directory SAP\FrontEnd\SAPgui
  • wdtlogU.ocx – from directory SAP\FrontEnd\SAPgui, with SAP GUI 7.40 from directory SAP\FrontEnd\SAPgui\Unicode
  • librfc32u.dll – from directory system32 on 32-bit and from syswow64 on 64-bit Windows environment
  • icudt34.dll – from directory system32 on 32-bit and from syswow64 on 64-bit Windows environment with SAP GUI 7.30
  • icudt50.dll – from directory system32 on 32-bit and from syswow64 on 64-bit Windows environment with SAP GUI 7.40
  • icuin34.dll – from directory system32 on 32-bit and from syswow64 on 64-bit Windows environment with SAP GUI 7.30
  • icuin50.dll – from directory system32 on 32-bit and from syswow64 on 64-bit Windows environment with SAP GUI 7.40
  • icuuc34.dll – from directory system32 on 32-bit and from syswow64 on 64-bit Windows environment with SAP GUI 7.30
  • icuuc50.dll – from directory system32 on 32-bit and from syswow64 on 64-bit Windows environment with SAP GUI 7.40
  • convlib.dll – from directory SAP\FrontEnd\SAPgui\Unicode Shared with SAP GUI 7.40
  • sapfewut.dllfrom directory SAP\FrontEnd\SAPgui\Unicode Shared with SAP GUI 7.40
  • sapfilecache.dllfrom directory SAP\FrontEnd\SAPgui\Unicode Shared with SAP GUI 7.40
  • saplgmgr2.dllfrom directory SAP\FrontEnd\SAPgui\Unicode Shared with SAP GUI 7.40
  • sapmime.dllfrom directory SAP\FrontEnd\SAPgui\Unicode Shared with SAP GUI 7.40

Also you need the Microsoft VC runtime libraries VC2012, this means VC 11, e.g. from here.

Store this libraries in different sub directories, e.g. ANSI and Unicode, and register the ocx libraries. Now you can use the SAP ActiveX RFC Controls e.g. in VBA or VBScript, without an installed SAP GUI for Windows.

Here a VBScript example:

'-Begin-----------------------------------------------------------------

  '-Directives----------------------------------------------------------
    Option Explicit

  '-Sub Main------------------------------------------------------------
    Sub Main()

      '-Variables-------------------------------------------------------
        Dim SAPFunc, Connection, SAPConnection, PingFunc, retPing
        Dim exceptPing

      '-Get SAP.Functions-----------------------------------------------
        Set SAPFunc = CreateObject("SAP.Functions.Unicode")

        If Not IsObject(SAPFunc) Then
          MsgBox "CreateObject(SAP.Functions.Unicode) failed", _
            vbOkOnly, "Error"
          Exit Sub
        End If

      '-Get SAP.LogonControl connection---------------------------------
        Set Connection = SAPFunc.Connection()

        If Not IsObject(Connection) Then
          MsgBox "SAPFunc.Connection failed", vbOkOnly, "Error"
          Exit Sub
        End If

      '-Set connection parameters---------------------------------------
        Connection.Client = "001"
        Connection.User = "BCUSER"
        Connection.Password = "minisap"
        Connection.Language = "EN"
        Connection.System = "NSP"
        Connection.HostName = "ABAP"
        Connection.SystemNumber = 0

      '-Connect SAP system----------------------------------------------
        SAPConnection = Connection.Logon(0, vbFalse)

      If SAPConnection <> 0 Then

        '-Call ABAP function module RFC_PING----------------------------
          Set PingFunc = SAPFunc.Add("RFC_PING")
          If IsObject(PingFunc) Then
            retPing = PingFunc.Call()
            If retPing = False Then
              exceptPing = PingFunc.Exception()
              MsgBox CStr(exceptPing), vbOkOnly, "Result"
            Else
              MsgBox CStr(retPing), vbOkOnly, "Result"
            End If
          End If

        '-Logoff--------------------------------------------------------
          Connection.Logoff()

      Else
        MsgBox "Connection.Logon failed", vbOkOnly, "Error"
      End If

    End Sub

  '-Main----------------------------------------------------------------
    Main()

'-End-------------------------------------------------------------------

 

Addendum 2017/05/20:

With the SAP GUI for Windows 7.50 offers SAP new ActiveX libraries which bases on SAP NetWeaver RFC Library. Here the necessary files from an x64 Windows installation:

  • wdobapiU.ocx – from directory SAP\FrontEnd\SAPgui\Unicode
  • wdtaocxU.ocx – from directory SAP\FrontEnd\SAPgui\Unicode
  • wdtfuncU.ocx – from directory SAP\FrontEnd\SAPgui\Unicode
  • wdtlogU.ocx – from directory SAP\FrontEnd\SAPgui\Unicode
  • SAPRfcWrapperU.dll – from directory Program Files (x86)\Common Files\SAP Shared
  • sapnwrfc.dll – from c:\Windows\SysWOW64
  • icudt50.dll – from c:\Windows\SysWOW64
  • icuin50.dll – from c:\Windows\SysWOW64
  • icuuc50.dll – from c:\Windows\SysWOW64
  • convlib.dll – from directory SAP\FrontEnd\SAPgui\Unicode
  • sapfewut.dll – from directory SAP\FrontEnd\SAPgui\Unicode
  • sapfilecache.dll – from directory SAP\FrontEnd\SAPgui\Unicode
  • saplgmgr2.dll – from directory SAP\FrontEnd\SAPgui\Unicode
  • sapmime.dll – from directory SAP\FrontEnd\SAPgui\Unicode

Also you need the Microsoft VC runtime libraries VC2013, this means VC 12. Register the ocx libraries and the SAPRfcWrapper.dll library.

 

Enjoy it.

Cheers
Stefan

To report this post you need to login first.

6 Comments

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

    1. Stefan Schnell Post author

      Hello Mason,

      thanks for your reply. I don’t know if someone converted this script to Python. ActiveX interface and Classic RFC Library are deprecated components, so it is not advised to use it now.

      Cheers
      Stefan

      (0) 
  1. Vincent Moretti

    Hello Stefan,
    we have the same solution running on an old Windows2003 server. It’s time to move it to an Windows 2012R2.
    I try to follow your recommendations, but I cannot register dll and ocx files. Do I have to get all the files from a SAPGUI 7.50 for X64 as the server is X64?

    Thank you for your reply.

    Vincent

    (1) 
    1. Stefan Schnell Post author

      Hello Vincent,

      thanks for your reply.

      It is possible to run the described configuration on an x64 system, I do it by myself. All you must do is to open an x86 console window – C:\Windows\SysWOW64\cmd.exe – as administrator, this is very important. Register now the libraries and all should work well.

      Let us know your result.

      Cheers
      Stefan

      (0) 
  2. Paul Gendreau

    Do you recommend adopting SAPRfcWrapperU.dll for my VB.NET application rather than SAP Connector for MS .NET (NCO) ?  I have the implementation of SAP Connector for MS .NET (NCO) working, but am unsure whether I should have chosen to use the 7.50 OCX.   It appears that SAP Connector for MS .NET (NCO) works with just 2 DLL, does not require COM registration, and my application is now independent of any installed SAP GUI version, which I like very much.

    (0) 
    1. Stefan Schnell Post author

      Hello Paul,

      in my opinion is in your case a good solution to use NCo. You name good reasons. I think the OCX libaries are interesting to adopt existing projects or if you work in restrictives environments, where only SAP GUI for Windows is available and the programmer don’t have any chance to use other possibilities.

      Best regards
      Stefan

      (0) 

Leave a Reply