Skip to Content
0
Former Member
Nov 24, 2011 at 11:09 AM

Errors in SAP Connection with VB.NET

136 Views

Hello!

I've got two problems for which I couldn't find an answer.

With my application I can save pdf-documents which are in sap.On my computer everything works fine.

But the problem is, on another one it doesn't work and I get two errors.

The first one is: ActiveX components error at line 75.

Thats this line:

FunctionCtrl = CreateObject("SAP.Functions")

That's the code in Form1.Load

I can ignore that error so that the form will load. After clicking the button my apllication get the function to find the document.

dieFunc = FunctionCtrl.Add("YCP_DIS2LOCPC")

And then the next error, the System.NullReferenceException.

My problem is, that I think I have to use references for my application on the other computer because it hasn't got SAPGUI.

But which have I to use?

For connecting the server I use this in Form1.Load

FunctionCtrl = CreateObject("SAP.Functions")

sapConnection = CreateObject("SAP.LogonControl.1")

sapConnection = FunctionCtrl.Connection

sapConnection.applicationserver = "192.1.111.10" 'P90

sapConnection.systemnumber = "00"

sapConnection.Client = "100"

sapConnection.User = "TEST"

sapConnection.password = "1234"

sapConnection.Language = "D"

The declarations:

Dim FunctionCtrl As Object

Dim sapConnection As Object

Dim dieFunc As Object

But what can i do?

I debugg my program in X86. Maybe i need references :/

Thanks for all ideas!!