Hi,
I'm using VB.net and doing a RFC in SAP over OCX. Everything works except the import of a number returned by SAP. I also tested it in VBA and there it works.
In VB.net I always get back a an Object of value 0, if I try to put it in a variable of type Integer an error occurs: "Cast from type '_ComObject to type 'Integer' is not valid." In VBA I just get an Integer with the number returned by SAP.
I use following coding:
...
FunkCtrl = CreateObject("SAP.Functions")
FunkCtrl.connection = oConnection
Funktion = FunkCtrl.Add("z_vb_arc_display")
Funktion.Exports("SAP_OBJECT") = "VBRK"
Funktion.Exports("IV_VBELN") = "90005555"
Funktion.Call()
Dim x As Object
x = Funktion.Imports("FEHLER")
...

Can anybody tell what I have to change?

Thanks
Jochen