Exercise 6: End Application 

Procedure

Disconnect from the R/3 system, release the storage space and terminate the program:

Private Sub cmdExit_Click()

   If boolLogon = True Then

      sapConnection.Logoff

   End If

   Set FunctionCtrl = Nothing

   Set sapConnection = Nothing

   MsgBox "Programm terminated ! ", 16, "Exit"

   Unload Me

End Sub

 

Check the Result

To call a function module in the R/3 system, you created a simple Visual Basic project of type "Standard EXE". Test the program using appropriate input values.

Example :