# FI_DUPLICATE_INVOICE_CHECK — Duplicate Invoice Check for Vendor Invoices

> Checks whether a vendor invoice was already posted, based on fields such as reference number, document date, currency and amount, using the FI duplicate invoice check logic. Developers use it in programs that upload invoices from external systems to stop the same invoice from being posted twice. Pass I_REPRF from the vendor's LFB1-REPRF field; when this flag is empty, no check is made.

- Modules: FI
- Type: Function module
- Function group: FIS0
- Remote-enabled (RFC): No
- S/4HANA status: Used the same way in S/4HANA
- URL: https://nekuhub.com/en/functions/fi-duplicate-invoice-check/

## Importing parameters

| Parameter | Type | Description | Required |
|---|---|---|---|
| I_BUKRS | BKPF-BUKRS | Company code | Yes |
| I_LIFNR | BSEG-LIFNR | Vendor account | Yes |
| I_XBLNR | BKPF-XBLNR | Reference document number | Yes |
| I_BLDAT | BKPF-BLDAT | Document date | Yes |
| I_WAERS | BKPF-WAERS | Currency | Yes |
| I_KOART | BSEG-KOART | Account type | Yes |
| I_SHKZG | BSEG-SHKZG | Debit/credit indicator | Yes |
| I_BSTAT | BKPF-BSTAT | Document status | Yes |
| I_REPRF | LFB1-REPRF | Check double invoices flag | Yes |
| I_XUMSW | BSEG-XUMSW | Sales-related item indicator | Yes |
| I_WRBTR | BSEG-WRBTR | Amount in document currency | - |
| I_BLART | BLART | Document type | - |
| I_BELNR | BSEG-BELNR | Document number | - |
| I_GJAHR | BSEG-GJAHR | Fiscal year | - |
| I_BUZEI | BSEG-BUZEI | Line item number | - |

## Exceptions

- MISSING_DATA: Missing data

## Call template (ABAP)

```abap
CALL FUNCTION 'FI_DUPLICATE_INVOICE_CHECK'
  EXPORTING
    i_bukrs = lv_i_bukrs
    i_lifnr = lv_i_lifnr
    i_xblnr = lv_i_xblnr
    i_bldat = lv_i_bldat
    i_waers = lv_i_waers
    i_koart = lv_i_koart
    i_shkzg = lv_i_shkzg
    i_bstat = lv_i_bstat
    i_reprf = lv_i_reprf
    i_xumsw = lv_i_xumsw
  EXCEPTIONS
    missing_data = 1
    OTHERS = 2.
```

## Related tables

BKPF, BSIP

