|
|
|
|
|
|
Excel
|
BAPI_ACC_DOCUMENT_POST Beispiel
|
|
Ease of Use
|
Intermediate
|
Version tested with
|
2012 VBA 7.1
|
Submitted by:
|
DReichl
|
Description:
|
Kann mir jemand ein funktionierendes Beispiel für den Aufruf des BAPIs ich bekomme die Strukturen für den Import nicht geladen
Can anyone help me to get the Right source vor using the BAPI in Excel
|
Discussion:
|
Hallo zusammen,
ich bekomme die Strukturen nicht in den Zugriff, so dass ich die Import-Tabellen füllen kann. Bin für jede Hilfe dankbar. Schön wäre ein Code, der schon im Einsatz ist.
Danke für Eure Hilfe
Hello everybody,
I can't access the structures that I can fill the import tables. I'm grateful for any help. Nice would be a code that is already in use.
Thank you for your help
|
Code:
|
instructions for use
|
Sub PostDocument()
Dim oFUBA As Object
Dim oFUBA2 As Object
Dim ofunctionCtrl As Object
Dim oDOCUMENTHEADER As Object
Dim oCustomerCPD As Object
Dim oContractHeader As Object
Dim oCurrencyAmount As Object
Dim oExtension1 As Object
Dim oReturn As Object
Dim oAccountGl As Object
Dim oOBJ_TYPE As Object
Dim oObj_Key As Object
Dim oObj_Sys As Object
Dim oACCOUNTRECEIVABLE As Object
Dim oACCOUNTPAYABLE As Object
Dim oACCOUNTTAX As Object
Dim oACCOUNTWT As Object
Dim oCONTRACTITEM As Object
Dim oCRITERIA As Object
Dim oExtension2 As Object
Dim oPAYMENTCARD As Object
Dim oREALESTATE As Object
Dim oVALUEFIELD As Object
Dim i, x As Integer
Dim strDataRow As String
Dim DataRow As Variant
Dim Col As Boolean
Dim tblData As Object
Dim tblData2 As Object
Dim tblData3 As Object
Dim oROWFields As Object
Dim Zähler As Long
Col = False
Set ofunctionCtrl = CreateObject("SAP.Functions")
Set oFUBA = ofunctionCtrl.Add("BAPI_ACC_DOCUMENT_POST")
Set oDOCUMENTHEADER = oFUBA.Imports(1)
Set oDOCUMENTHEADER = oFUBA.Imports("BAPIACHE09")
Set oDOCUMENTHEADER = oFUBA.exports(1)
Set oDOCUMENTHEADER = oFUBA.tables("DocumentHeader")
Set oAccountGl = oFUBA.tables(1)
Set oACCOUNTPAYABLE = oFUBA.tables(2)
Set oACCOUNTRECEIVABLE = oFUBA.tables(3)
Set oACCOUNTTAX = oFUBA.tables(4)
Set oACCOUNTWT = oFUBA.tables(5)
Set oCONTRACTITEM = oFUBA.tables(6)
Set oCRITERIA = oFUBA.tables(7)
Set oCurrencyAmount = oFUBA.tables(8)
Set oExtension1 = oFUBA.tables(9)
Set oExtension2 = oFUBA.tables(10)
Set oPAYMENTCARD = oFUBA.tables(11)
Set oREALESTATE = oFUBA.tables(12)
Set oReturn = oFUBA.tables(13)
Set oVALUEFIELD = oFUBA.tables(14)
oAccountGl.Rows.Add
Debug.Print oAccountGl.ColumnCount
Debug.Print oAccountGl.ColumnName(1)
Debug.Print oAccountGl(1, 1)
End Sub
|
How to use:
|
- I want to make an Excel Sheet with the Posting Values and fill the Bapi to post it.
|
Test the code:
|
|
Sample File:
|
No Attachment
|
Approved by Jacob Hilderbrand
|
This entry has been viewed 5 times.
|
|