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

ParameterTypeDescriptionRequired
INVOICEDOCNUMBERBAPI_INCINV_FLD-INV_DOC_NOInvoice document to reverseYes
FISCALYEARBAPI_INCINV_FLD-FISC_YEARFiscal yearYes
REASONREVERSALBAPI_INCINV_FLD-REASON_REVReason for reversalYes

Exporting parameters

ParameterTypeDescription
INVOICEDOCNUMBER_REVERSALBAPI_INCINV_FLD-INV_DOC_NOReversal document number
FISCALYEAR_REVERSALBAPI_INCINV_FLD-FISC_YEARFiscal year of the reversal document

Tables parameters

ParameterTypeDescriptionRequired
RETURNBAPIRET2Return messagesYes

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.

Request a custom report