# BAPI_INCOMINGINVOICE_CANCEL — Reverse Incoming Invoice

> Reverses a posted Logistics Invoice Verification document, as in MR8M, and returns the reversal document number and year. Interfaces use it when a supplier cancels an invoice or an automatically posted invoice was wrong. Pass the invoice number, fiscal year and a reversal reason, 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-cancel/

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| INVOICEDOCNUMBER | BAPI_INCINV_FLD-INV_DOC_NO | Invoice document to reverse | Yes |
| FISCALYEAR | BAPI_INCINV_FLD-FISC_YEAR | Fiscal year | Yes |
| REASONREVERSAL | BAPI_INCINV_FLD-REASON_REV | Reason for reversal | Yes |

## Exporting parameters

| Parameter | Type | Description |
|---|---|---|
| INVOICEDOCNUMBER_REVERSAL | BAPI_INCINV_FLD-INV_DOC_NO | Reversal document number |
| FISCALYEAR_REVERSAL | BAPI_INCINV_FLD-FISC_YEAR | Fiscal year of the reversal document |

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| RETURN | BAPIRET2 | Return messages | Yes |

## Call template (ABAP)

```abap
CALL FUNCTION 'BAPI_INCOMINGINVOICE_CANCEL'
  EXPORTING
    invoicedocnumber = lv_invoicedocnumber
    fiscalyear = lv_fiscalyear
    reasonreversal = lv_reasonreversal
  IMPORTING
    invoicedocnumber_reversal = lv_invoicedocnumber_reversal
    fiscalyear_reversal = lv_fiscalyear_reversal
  TABLES
    return = lt_return.
```

## Related tables

RBKP, RSEG

