Skip to Content
0
Former Member
May 25, 2005 at 01:46 AM

SAP Login from VB

568 Views

Hi All,

We are trying to cnnect to SAP from a VB application and invoke some BAPIs there. Everything is working fine, I am able to log into SAP and run BAPIs as well. The only issue is When I log on to SAP from VB Code, it pops up a box asking Titled "SAP Logon at 00" asking Client, User, Password, Language with "OK", "Cancel", "System", Password" button. My requirement is not to have this Pop up box, My VB code should silently log into SAP and if there is any error while login show that. Here is my VB code...

All the Logon Parameters, I am currently hardcoding during my testing testing.

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

With SAPBAPIControl1.Connection

.ApplicationServer = "AppServer Name"

.System = "System Number"

.User = "My User ID"

.Password = "My Password"

.client = "Client ID"

.language = "EN"

'Check if the connection was succesfully established

If Not .Logon(Me.hWnd, False) Then

MsgBox "Connection failed"

Exit Sub

Else

MsgBox "Connect successfull"

End If

End With

If somebody has already worked on this, Kindly let me know how to block this pop up box so that I login to SAP seemlessly.

Thanks in Advance.