Skip to Content
0
Former Member
Jan 27, 2010 at 10:15 AM

Calling RFC from VB

121 Views

Hi,

I'm trying to call an RFC enabled function module from excel. My code in VB is:

    Set theFunc = sapConn.Add("ZGETREVENUE")

    theFunc.Exports("VBELN") = strSalesOrder
    ResultsOk = theFunc.imports("OK_CODE")
    Set objSalesOrder = theFunc.Tables("TBL_RETURN")

The table TBL_RETURN is coming back fine but the return code OK_CODE is always 0. Can someone point out what I'm doing wrong?

Thanks,

Gill