cancel
Showing results for 
Search instead for 
Did you mean: 

RFC BAD VARIANT TYPE .NET

Former Member
0 Kudos

I have a Problem with a Remote Function CALL and .net...

Im using Visual Studio 2010 Professional with OCX Components to connect to SAP and call ABAP Functions.

I have this Problem Only when i try tun run it as a Service. As a Application i have no problems...

Private saplogon As New SAPLogonCtrl.SAPLogonControl

Public sapcon As SAPLogonCtrl.Connection

Private sapfuncctrl As New SAPFunctionsOCX.SAPFunctions

saplogon.ApplicationServer = "CSAPEP20"

saplogon.System = "EP2"

saplogon.Client = "100"

saplogon.User = "RFCUSER"

saplogon.Password = "******"

sapcon = saplogon.NewConnection()

If sapcon.Logon(0, True) = True Then

sapfuncctrl.Connection = sapcon -


> here i got the Error BAD VARIANT TYPE

End If

Please can somone help me??

Thank you!!

Edited by: Zagan Nicu on Jan 3, 2011 12:52 PM

Edited by: Zagan Nicu on Jan 3, 2011 12:53 PM

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Did you every figure this one out? I am in the same spot

Former Member
0 Kudos

Guys, anyone has solution? Looks like whole internet have the same problem..