cancel
Showing results for 
Search instead for 
Did you mean: 

OCX Import-pararmeter

Former Member
0 Kudos

Hi,

I'm using VB.Net and doing a rfc with OCX. Everything works except the import of a value which is returned from SAP. What I am getting back from SAP is just one number of type I (=Integer). I noticed that in VB I have to use a variable of type object (integer produces an error). The problem is that I always get a 0 even if SAP returns another value (I checked the export-paramater in SAP and this is working correctly).

The code is:

FunkCtrl = CreateObject("SAP.Functions")

FunkCtrl.connection = oConnection

Funktion = FunkCtrl.Add("z_vb_arc_display")

Funktion.Exports("IV_VBELN") = iv_vbeln

Funktion.Call()

Dim x As Object

x = Funktion.Imports("FEHLER")

Can anybody please tell me what is wrong?

Thanks

Jochen

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

using VariantType doesn't change anything.

Its type is '_ComObject'.

Former Member
0 Kudos

Hi,

an additional information:

I just tested it in VBA and there it works, using type Integer.

The difference is also that in VBA if I type a wrong name for the import-parameter this leads to an error, in VB.Net this is not recognized.

Can anybody help me please?

Jochen

Former Member
0 Kudos

Try using Variant instead of Object.

OR ... after the variable gets set, use "Debug.print Typename(xxx)" in the debugger to see what its type actually is.