Quantcast
Channel: SCN: Message List - ABAP Connectivity
Viewing all articles
Browse latest Browse all 3125

Re: Call Table SUB_HEADER from BAPI1077 GetDetail via VBA

$
0
0

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.

 

004.jpg

 

Cheers

Stefan


Viewing all articles
Browse latest Browse all 3125

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>