Quick Guide to Posting of Incoming MM Invoices
This quick guide provides an overview of the basic procedure for parking and posting of incoming invoices as it can be a very complex process from a technical standpoint. A consultation contingent is available on request for OPTIMAL SYSTEMS for advice on the specific application and questions regarding the transfer of further posting information.
The BAPI BAPI_INCOMINGINVOICE_CREATE is used to post incoming MM invoices. After a successful call, BAPI_TRANSACTION_COMMIT must also be called in order to actually save the posted receipt in the database.
The /OSGMBH/D2S_INCOMINV_CREATE module from OPTIMAL SYSTEMS acts as a wrapper around both calls. The interface is almost identical to that of BAPI BAPI_INCOMINGINVOICE_CREATE. Only one additional return parameter 'RC' is added, which indicates the success or failure of the posting with the values '0' or '8'.
The BAPI must be supplied with the invoice header data and 1-n item data.
The header data is transferred in the HEADERDATA parameter. The ITEMDATA table parameter is provided for the items.
How to use it using VBA code:
DIM Param
SET HeaderData = CreateObject("Scripting.Dictionary")
Param = CreateObject("Scripting.Dictionary")
HeaderData("INVOICE_IND") = "X" 'KZ_ Rechng.buchen(n. Gutschrift)
HeaderData("DOC_TYPE") = "RE" 'Belegart
HeaderData("DOC_DATE") = "13.04.2018" 'Re.datum
HeaderData("PSTNG_DATE") = "13.04.2018" 'Buchungsdatum
HeaderData("REF_DOC_NO") = "REF123" 'Referenz / Re.nr. des Lieferanten
HeaderData("COMP_CODE") = "1000" 'Buchungskreis
HeaderData("DIFF_INV") = "0000001000" 'Kreditorennummer
HeaderData("CURRENCY") = "EUR" 'Währung
HeaderData("GROSS_AMOUNT") = "119,00" 'Bruttobetrag
HeaderData("EXCH_RATE") = "1,00" 'Preisnotierter Umrechnungskurs
HeaderData("PMNTTRMS") = "ZB01" 'Zahlungsbed.schlüssel
HeaderData("BLINE_DATE") = "13.04.2018" 'Zahlungsfristenbasisdatum
HeaderData("DSCT_DAYS1") = "14" 'Skontofrist 1
HeaderData("HEADER_TXT") = "Kopftext" 'BKTXT
HeaderData("ITEM_TEXT") = "Positionstext" 'SGTXT
HeaderData("DEL_COSTS") = "0,00" 'ungepl. Bezugsnebenkosten
' Kopfdaten zu Parameterobjekt hinzufügen
Param.Add "HEADERDATA",HeaderData
' Array für Positionsdaten der EK-Rechnung erzeugen
DIM IData(0) ' beginnend mit 0
SET Entry = CreateObject("Scripting.Dictionary")
' Position 1 füllen
Entry("INVOICE_DOC_ITEM") = "000001" 'Belegposition im Rechnungsbeleg
Entry("PO_NUMBER") = "4500017550" 'Bestellnummer
Entry("PO_ITEM") = "00010" 'Bestellpos.
Entry("TAX_CODE") = "VA" 'Steuerkz. (falls leer: aus Best. übernommen)
Entry("ITEM_AMOUNT") = "75,00" 'Betrag (netto)
Entry("QUANTITY") = "1" 'Menge
Entry("PO_UNIT") = "ST" 'Einheit
' Position in Array anhängen
SET IData(0) = Entry
' Positionen zu Parameterobjekt hinzufügen
Param.Add "ITEMDATA",IData
The BAPI returns status messages in the RETURN table parameter. The structure corresponds to that of the FI invoices. The receipt number of the generated invoice is returned via the two parameters INVOICEDOCNUMBER and FISCALYEAR.