Skip to Content
avatar image
Former Member

Calling a function-module from VB.

I want to call a function-module in SAP from VB.

How do I reference the elements of a structure when the structure is import or export parameter to the function- module. The object used from VB is SAP.Functions.

Can anybody please advice ?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • avatar image
    Former Member
    Jun 03, 2004 at 10:02 AM

    I strongly recommend you to move to .NET before answering your question.

    Suppose that you want to call the function module YOUR_FUNCTION that has an export parameter YOUR_PARAM of type structure, you can reference the field FIELD1 of the structure as follwos:

    Set SAPFunctions = CreateObject("SAP.Functions")

    Set SAPFunctions.Connection = oConnection

    Set oFunc = SAPFunctions.Add("YOUR_FUNCTION ")

    oFunc.Exports("YOUR_PARAM ").Value("FIELD1") = "Hello"

    Please have a look at the Structure object using VB Object Viewer.


    Guangwei Li

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      If you sent it exactly as you typed it, it may be that you misspelled fields as feilds. I don't know if this is related to your problem, but it may be.