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.

2 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) 

Leave a Reply