MM
BAPI
RFC
Used the same way in S/4HANA
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.
- Function group
- MRM_BAPI
- Remote-enabled (RFC)
- Yes
- Type
- BAPI
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)
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_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
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.