Skip to Content
author's profile photo Former Member
Former Member

SAP Login from VB

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.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on May 25, 2005 at 03:38 AM

    Hi,

    Check if this link helps you:

    http://www.tek-tips.com/viewthread.cfm?qid=494927&page=1

    Regards,

    Anjali

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 25, 2005 at 04:22 AM

    hi sunil ,

    u can easily suppress that logon box.

    just u need to ensure that u r supplying correct username,password etc.

    let the code be :

    Set oFunction = CreateObject("SAP.Functions")

    .......

    .......

    Set oConnection = oFunction.Connection

    ......

    .............

    .. oConnection.Logon(0, bSilentLogon)....

    if u supply bSilentLogon = TRUE then it wont pop up.

    For more details check out the link :

    http://www.members.tripod.com/abap4/Source_Code.html

    Hope it helps!

    Regards,

    Ankur

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.