Exercise 2: Declarations and Initial Settings 
Prerequisites
The reference to SAP Remote Function Call Control has been set under Project ® References.
Procedure
Declare global objects and variables and define the initial settings for Form_Load() and for the Function Control as follows:
Option Explicit
Public FunctionCtrl As Object 'Function Control (Collective object)
Public sapConnection As Object 'Global connection object
Public dieFunc As Object 'Function Object
Public boolLogon As Boolean 'Logon help variable
Private Sub Form_Load()
'
'Create the collective object
'
Set FunctionCtrl = CreateObject("SAP.Functions")
boolLogon = False
cmdFunction.Enabled = False
cmdSysInfo.Enabled = False
End Sub
How to Continue
Exercise 3: Logon Procedure