Exercise 2: Declaration and Initial Settings 

Prerequisites

The reference to SAP BAPI Control has been set under Project ® References.

Procedure

Declare global objects and variables and define the initial settings in procedure Form_Load( ) as follows:

 

Option Explicit

 

Private oBAPICtrl As Object           'BAPI Control

Private oConnection As Objec       'Connection object

Private oPersonalData As Object    'Table object

Dim boolLogon As Boolean           'Logon help variable

Const APPID = "Employee Example Program "

 

Private Sub Form_Load()

 

'Creating BAPI object

   Set oBAPICtrl = CreateObject("SAP.BAPI.1")

'

'Creating Connection object

   Set oConnection = oBAPICtrl.Connection

   cmdList.Enabled = False

   mnuEmployeeList.Enabled = False

   boolLogon = False

End Sub

 

How to Continue

Exercise 3: Logon Procedure