# BAPI_BILLINGDOC_CANCEL1 — Cancel Billing Document

> Cancels a customer billing document and creates the cancellation document, like VF11. It is used in correction programs and interfaces that reverse invoices. Run it with TESTRUN first, check RETURN and SUCCESS, and call BAPI_TRANSACTION_COMMIT unless NO_COMMIT handling is in place.

- Modules: SD
- Type: BAPI
- Function group: VBRK
- Remote-enabled (RFC): Yes
- S/4HANA status: Used the same way in S/4HANA
- URL: https://nekuhub.com/en/functions/bapi-billingdoc-cancel1/

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| BILLINGDOCUMENT | BAPIVBRKSUCCESS-BILL_DOC | Billing document number | Yes |
| TESTRUN | BAPIVBRKTESTRUN-TESTRUN | Test run (no update) | - |
| NO_COMMIT | BAPI_NCOMT | Do not commit inside the BAPI | - |
| BILLINGDATE | BF_DATM1EB | Cancellation billing date | - |

## Tables parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| RETURN | BAPIRETURN1 | Return messages | Yes |
| SUCCESS | BAPIVBRKSUCCESS | Successfully processed documents | Yes |

## Call template (ABAP)

```abap
CALL FUNCTION 'BAPI_BILLINGDOC_CANCEL1'
  EXPORTING
    billingdocument = lv_billingdocument
  TABLES
    return = lt_return
    success = lt_success.
```

## Related tables

VBFA, VBRK, VBRP

