09-05-2014 9:31 AM
Hello,
I have a problem with calling the table SUB_HEADER from the BAPI_BUS1077__GETDETAIL with VBA.
I tried that BAPI with SE37 - everything works well.
However, with VBA I cannot find the table SUB_HEADER (the table REFSUBS can be found).
My VBA-code:
Dim oMat As Object
Set oMat = SAPBAPIControl1.GetSAPObject("BUS1077")
Dim oRangeSubNr As Object
Set oRangeSubNr = SAPBAPIControl1.DimAs(oMat, "GETDETAIL", "SUB_HEADER")
The Error says:
Parameter SUB_HEADER not found
Where is my problem?
I hope, anyone can help me with this problem.
Thanks already in advance!
Carsten
09-08-2014 12:38 PM
Hello Carsten,
I tried the following code, and it works - but it is a little bit different from yours:
Sub Test()
Dim rfcFunction As SAPFunctionsOCX.SAPFunctions
Dim rfcConnection As SAPLogonCtrl.Connection
Dim table As SAPTableFactoryCtrl.table
Dim func As SAPFunctionsOCX.Function
Set rfcFunction = CreateObject("SAP.Functions.Unicode")
If Not IsObject(rfcFunction) Then
Exit Sub
End If
Set rfcConnection = rfcFunction.Connection
rfcConnection.ApplicationServer = "C0T"
rfcConnection.System = "C0T"
rfcConnection.SystemNumber = 65
rfcConnection.User = "YI00159"
rfcConnection.Client = "099"
rfcConnection.Language = "DE"
If Not rfcConnection.Logon(0, False) Then
Exit Sub
End If
Set func = rfcFunction.Add("BAPI_BUS1077_GETDETAIL")
Set table = func.Tables("SUB_HEADER")
Stop
rfcConnection.Logoff
Set rfcLogon = Nothing
Set rfcConnection = Nothing
End Sub
Maybe it is an alternative for you.
Cheers
Stefan
09-11-2014 1:43 PM
Hi Stefan,
can you please help me out,how to call SAP web service in VBA.
Thanks In advance.
Regards
RR Pradhan
09-12-2014 1:36 PM
Hello RR pradhan,
I am not an expert in using web services via VBA.
Maybe this could help you.
Cheers
Stefan
09-16-2014 6:27 AM
Hi Stephan,
Thanks for quick reply.
I have try above link,but I am getting the error.
Can you help me shortout the error.
The error is in below link.
CALL SAP WEB SERVICE FROM MS EXCEL 2010 using VBAunknown
Thanks In advance.
Best Regards
RR Pradhan
09-16-2014 6:25 AM