# Mass Open Item Clearing Upload from Excel (Customer, Vendor, G/L)

> A custom program that clears open items grouped in an Excel file on customer, vendor or G/L accounts in bulk. Each group becomes one clearing document; small differences within tolerance go to a difference account, and everything can be checked in test mode without posting.

- Type: Program, Custom development, Mass upload
- Module: FI
- Estimated effort: M (4–7 working days)
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/programs/mass-open-item-clearing-upload-from-excel/


## Why is the standard not enough?

F-32, F-44 and F-03 clear one account at a time on screen. F.13 automatic clearing only closes items that match exactly on configured common fields (assignment, reference); it does not take an external matching list from a reconciliation exercise or a bank. In factoring, netting or clearing-account clean-ups, hundreds of items are cleared by hand.

### Closest standard alternatives

- F-32: Clears one customer account on screen; no bulk processing from a file.
- F.13: Automatically clears items that match exactly on common fields; does not take an external matching list.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| BSID | Customer open items to be cleared | Read | - | ECC + S/4 |
| BSIK | Vendor open items to be cleared | Read | - | ECC + S/4 |
| BSIS | G/L open items to be cleared | Read | - | ECC + S/4 |
| BKPF | Header of the resulting clearing document | Write | - | ECC + S/4 |
| BSEG | Clearing document items and the clearing data on the cleared items | Write | - | ECC + S/4 |

## BAPIs and functions used

- POSTING_INTERFACE_START: Starts the posting interface session
- POSTING_INTERFACE_CLEARING: Creates the clearing document for each group
- POSTING_INTERFACE_END: Closes the posting interface session

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| P_FILE | Upload file (XLSX or CSV) | Single value | - | Yes |
| P_TEST | Test mode (check without posting) | Checkbox | - | No |
| P_TOL | Allowed difference per group (local currency) | Single value | - | No |
| P_RESID | Leave a difference outside tolerance as a residual item | Checkbox | - | No |

## Input file columns

| Column | Target field | Required |
|---|---|---|
| Group key | Rows with the same key are cleared in one clearing document | Yes |
| Company code | BKPF-BUKRS | Yes |
| Account type (D/K/S) | BSEG-KOART | Yes |
| Account | Customer (KUNNR), vendor (LIFNR) or G/L account (HKONT) by account type | Yes |
| Document number | BSEG-BELNR | Yes |
| Fiscal year | BSEG-GJAHR | Yes |
| Line item | BSEG-BUZEI | Yes |
| Clearing date | BKPF-BUDAT | Yes |
| Document type | BKPF-BLART | No |
| Header text | BKPF-BKTXT | No |

## Result list columns

| Column | Source |
|---|---|
| Group | Calculated: Group key from the file |
| Company code | BKPF-BUKRS |
| Number of items | Calculated: Number of rows in the group |
| Difference | Calculated: Signed amount total of the items in the group |
| Clearing document | BKPF-BELNR |
| Status | Calculated: Cleared, test passed or error |
| Message | Calculated: First error or success message returned by the posting interface |

## How does the program work?

1. The file is read; rows with the same group key are collected into one clearing transaction.
2. Each row's item is looked up in BSID, BSIK or BSIS by account type: the item must still be open and company code and account must match.
3. The group balance is calculated; if the difference is within the P_TOL tolerance, a line to the difference account is added, otherwise the group fails (or, if selected, the remainder is left as a residual item).
4. A session is opened with POSTING_INTERFACE_START, each group is cleared with POSTING_INTERFACE_CLEARING and the session is closed with POSTING_INTERFACE_END. Test mode only lists the checks and calculated differences.
5. The result shows each group's clearing document (BKPF) or error message; failed groups can be downloaded as a separate file.

## Authorization objects

- F_BKPF_BUK: Posting authorization by company code
- F_BKPF_KOA: Posting authorization by account type (customer, vendor, G/L)
- F_BKPF_BLA: Authorization for the clearing document type

## Frequently asked questions

### Can items in different currencies be cleared in the same group?

Items with the same document currency are cleared in one group. For different currencies, a clearing currency rule is defined during installation; the exchange difference is posted to the standard exchange difference accounts.

### Can customer and vendor items be closed in the same group?

Yes. When the customer is also a vendor, both account types can be in the same group for netting. The group is then closed with one clearing document.

### How is a wrong clearing undone?

The clearing is reset with the standard FBRA and the document is reversed if needed. Because the program logs every document it creates, the documents to undo are easy to find.

---
Let us build this program for your system: https://nekuhub.com/en/request-a-quote/?report=fi-open-item-clearing-upload
