on 06-02-2004 2:22 PM
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 ?
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.
Regards,
Guangwei Li
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Guangweli,
Thanks for the reply and its working but i am facing a small problem in the same after calling the function if I test the same through sap its working fine but from vb if i send the same values i am getting an error message which they worte in the bapi code.
Let me know where the problem is.
Thanks
cmkiran
I got the solution for problem, but i forgot to give the points to the question. Tell me how to add the points to the question so that i can add them.
I need teh solution for sending the values to the structures frm vb 6.0
I used the code as shown below
function.tables("tables_name").feilds("feildname").value =00000
but this is giving some error please update me
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.