# 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.

- Modules: MM
- Type: BAPI
- Function group: MRM_BAPI
- Remote-enabled (RFC): Yes
- S/4HANA status: Used the same way in S/4HANA
- URL: https://nekuhub.com/en/functions/bapi-incominginvoice-create/

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| HEADERDATA | BAPI_INCINV_CREATE_HEADER | Invoice header data | Yes |
| ADDRESSDATA | BAPI_INCINV_CREATE_ADDRESSDATA | Address data (one-time vendor) | - |

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| INVOICEDOCNUMBER | BAPI_INCINV_FLD-INV_DOC_NO | Number of the posted invoice |
| FISCALYEAR | BAPI_INCINV_FLD-FISC_YEAR | Fiscal year |

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| ITEMDATA | BAPI_INCINV_CREATE_ITEM | Invoice item data | Yes |
| ACCOUNTINGDATA | BAPI_INCINV_CREATE_ACCOUNT | Account assignment data | - |
| GLACCOUNTDATA | BAPI_INCINV_CREATE_GL_ACCOUNT | G/L account postings | - |
| MATERIALDATA | BAPI_INCINV_CREATE_MATERIAL | Material account postings | - |
| TAXDATA | BAPI_INCINV_CREATE_TAX | Tax data | - |
| WITHTAXDATA | BAPI_INCINV_CREATE_WITHTAX | Withholding tax data | - |
| RETURN | BAPIRET2 | Return messages | Yes |
| EXTENSIONIN | BAPIPAREX | Customer fields (inbound) | - |

## Call template (ABAP)

```abap
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

RBKP, RSEG

