Exercise 1: Program Framework and Declarations 

Procedure

  1. Start MS EXCEL.
  2. Choose Tools ® Macro ® Visual Basic Editor.
    An editor for Visual Basic for Applications is started. By default, a project named Book1 has been created.
  3. Enter the name GetCustomer for the project.
  4. Define a program framework and declare the required objects and variables as follows:

Sub GetCustomer()

'

'Declare the objects and variables

'

Dim functionCtrl As Object             'Function Control (Collective object)

Dim sapConnection As Object         'Connection object

Dim theFunc As Object                 'Function object

 

'

'Create a function object

'

Set functionCtrl = CreateObject("SAP.Functions")

 

Connect to R/3

 

Call Function Module

 

Display R/3 Data

 

Terminate Programm

 

 

End Sub

How to Continue

Exercise 2: Connect to R/3