cancel
Showing results for 
Search instead for 
Did you mean: 

Logon SAP in Silent Mode

Former Member
0 Kudos

I am trying to connect to SAP in silent mode with the following syntax

in VB.Net

oConnection = oFunction.Connection

oConnection.Client = "900"

oConnection.Language = "EN"

oConnection.TraceLevel = 6

oConnection.User = mUserId

oConnection.Password = mPassword

oConnection.System = mSystem

oConnection.ApplicationServer = mApplicationServer

oConnection.Logon(0, true)

However, the function return false, i.e. failed to connect.

But if I connect using oConnection.Logon(0, false), the logon dialog box with all information pre-set pop up, and when I pressed OK, the session is logged on.

I noticed that many developers met the same problem before, and I wonder if this is owing to the library that installed on my machine. As I have tried the javascript example provided in this SDN, but still got failed in logging on to SAP in silent mode.

Could someone please help?

Thanks a lot!

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

VB.Net is not the final language that I would like to use. Just to have some common language to discuss with, I used VB.Net as an example.

I cannot find the caption ocx installed on my machine, but I found another one with similar name

"wdtlogU.ocx", but I cannot register this one also.

Thanks.

Former Member
0 Kudos

The return code is oConnection.IsConnected is 8.

CountZero
Explorer
0 Kudos

Hi,

The wdtlogU.ocx is the unicode version (I believe). I will have another look at my end for any more information to help you.

One resort might be to reinstall your SAPGUI (do a full install) and see if that makes a difference, it should register the ocxs correctly for you.

Thanx

Nath

Former Member
0 Kudos

I found the wdtlog.ocx resided in program files\common files\sap shared and it is already registered.

FYI, the version of SAP frontend I am using is 7.1

Thanks.

CountZero
Explorer
0 Kudos

Hi,

I am using 6.40 (it also worked with 6.20). I have not tried 7, I'm afraid.

Nath

CountZero
Explorer
0 Kudos

Hi,

I have just tried your example code on my machine and everthing works fine here.

I just added the following bits

Dim oFunction As Object
Dim oConnection As Object
oFunction = CreateObject("SAP.Functions")

Then add the end of your example I used the following


        If oConnection.logon(0, True) = False Then
            MsgBox(oConnection.IsConnected)
            Exit Sub
        Else
            MsgBox("Connected")
        End If

However if you have tried using javascript with no success then check that the following OCX is registered

wdtlog.OCX (it should be in your SAPGUI directory)

run the following from a command prompt

regsvr32 (path and name to wdtlog.ocx)

eg.

regsvr32 "c:\program files\sap\frontend\sapgui\wdtlog.ocx"

You might also have an issue were it is registered more than once on your machine and that is a big hunt through the registry. However we have found that using late binding (as above) seems to work.

One other point though if you are using .NET to access SAP why not use the .NET connector?

Almost forgot you could test the return code as well to see if that pinpoints an error.

In the above example the return code will be in a message box if the connection fails.

Here is a list of the ones available

1 - Connected

2 - User clicked cancel on the log on box

4 - Connection parameter missing

8 - Connection error occured

Only number 4 seems to be the most helpful.

Nath

Message was edited by:

Nathan Jones