MM BAPI RFC Used the same way in S/4HANA

BAPI_INCOMINGINVOICE_CREATE Post Incoming Invoice

Posts a vendor invoice in Logistics Invoice Verification, as in MIRO, with PO-related items and optional G/L account, material and tax lines. Invoice scanning solutions and EDI or e-invoice interfaces use it to post supplier invoices automatically. Reference the purchase order item in ITEMDATA, make the gross amount match the items and taxes, check RETURN and call BAPI_TRANSACTION_COMMIT.

Function group
MRM_BAPI
Remote-enabled (RFC)
Yes
Type
BAPI

Importing parameters

ParameterTypeDescriptionRequired
HEADERDATABAPI_INCINV_CREATE_HEADERInvoice header dataYes
ADDRESSDATABAPI_INCINV_CREATE_ADDRESSDATAAddress data (one-time vendor)—

Exporting parameters

ParameterTypeDescription
INVOICEDOCNUMBERBAPI_INCINV_FLD-INV_DOC_NONumber of the posted invoice
FISCALYEARBAPI_INCINV_FLD-FISC_YEARFiscal year

Tables parameters

ParameterTypeDescriptionRequired
ITEMDATABAPI_INCINV_CREATE_ITEMInvoice item dataYes
ACCOUNTINGDATABAPI_INCINV_CREATE_ACCOUNTAccount assignment data—
GLACCOUNTDATABAPI_INCINV_CREATE_GL_ACCOUNTG/L account postings—
MATERIALDATABAPI_INCINV_CREATE_MATERIALMaterial account postings—
TAXDATABAPI_INCINV_CREATE_TAXTax data—
WITHTAXDATABAPI_INCINV_CREATE_WITHTAXWithholding tax data—
RETURNBAPIRET2Return messagesYes
EXTENSIONINBAPIPAREXCustomer fields (inbound)—

Call template (ABAP)

A skeleton generated from the interface. It lists mandatory importing parameters, exporting parameters and tables; declare the variables with suitable types in your own program.

CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'
  EXPORTING
    headerdata = lv_headerdata
  IMPORTING
    invoicedocnumber = lv_invoicedocnumber
    fiscalyear = lv_fiscalyear
  TABLES
    itemdata = lt_itemdata
    accountingdata = lt_accountingdata
    glaccountdata = lt_glaccountdata
    materialdata = lt_materialdata
    taxdata = lt_taxdata
    withtaxdata = lt_withtaxdata
    return = lt_return
    extensionin = lt_extensionin.

Related tables

Can't find the report you need?

We also build anything that is not in the catalog. Describe it briefly and we will suggest the right solution.

Request a custom report