Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

SAP logon pad with NCo and visual studio 2003

Hi All,

I'm struggling to find a way in visual studio 2003 utilising the dot net connector to allow the user to select the SAP system, client user name and password in a similar way that happens when done with activeX controls.

E.g. with ActiveX this sort of code:

Dim sapConn As Object 'Declare connection object

Set sapConn = CreateObject("SAP.Functions") 'Create ActiveX object

If sapConn.Connection.Logon(0, False) <> True Then

The false in the last line prevents a silent logon i.e. a little pop up window is created with the server, client etc. for the user to select and fill in.

I have been trying to use methods like availabledestinations and getdestinationbyname as well as the destinationname property of the saplogon proxy I dropped on my form. In fact I can see all the destinations when I drop down on the destinationname property on the proxy logon object. I though of maybe binding this to a list box but I can't seem to get that to work.

I also tried setting the SAPgui value to 0,1 or 2 on the proxy logon object but this had no effect.

Is there not a simple way of doing this similar to the ActiveX approach?

PS. This is a windows forms project and not a web project.

Thanks,

Grant.

Former Member
Former Member replied

Hi Grant,

Just replace _e with _destEntry. You do not need to use _e.

So, the code should look like-

For Each _destEntry As System.Collections.DictionaryEntry In SapLogonDestination1.AvailableDestinations

Dim _destText As String = _destEntry.Value.ToString

Dim _destKey As String = _destEntry.Key.ToString

Next

Regards.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question