FI Program Custom development Mass upload

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

Short answer: 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.

Estimated effort
M · 4–7 working days
System
ECC and S/4HANA
Tables
5
Scope
Global
Built by
NeKuDos Teknoloji
Last updated

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.

Who uses it? Accounts receivable and payable teams, and G/L specialists who reconcile bank and clearing accounts.

Closest standard alternatives

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

Tables used

The tables the program reads and updates. ECC and S/4HANA differences are marked separately.

TableRoleAccessSystem
BSIDCustomer Open ItemsCustomer open items to be clearedReadECC + S/4
BSIKVendor Open ItemsVendor open items to be clearedReadECC + S/4
BSISG/L Account Open Items (Secondary Index)G/L open items to be clearedReadECC + S/4
BKPFAccounting Document HeaderHeader of the resulting clearing documentWriteECC + S/4
BSEGAccounting Document SegmentClearing document items and the clearing data on the cleared itemsWriteECC + S/4

S/4HANA notes

  • BSID → I_OperationalAcctgDocItem: In S/4HANA BSID is no longer filled as a separate index table; reads work through a compatibility view of the same name. For new developments the I_OperationalAcctgDocItem CDS view is recommended.
  • BSIK: In S/4HANA BSIK is no longer filled as a separate index table; reads work through a compatibility view. For new developments the I_OperationalAcctgDocItem CDS view is recommended.
  • BSIS → ACDOCA: In S/4HANA BSIS is no longer filled as a separate index table; it is read through a compatibility view of the same name. New developments should use ACDOCA or the related CDS views.

BAPIs and functions used

  • POSTING_INTERFACE_STARTStart Internal Posting Interface. Starts the posting interface session
  • POSTING_INTERFACE_CLEARINGPost with Clearing via Internal Posting Interface. Creates the clearing document for each group
  • POSTING_INTERFACE_ENDEnd Internal Posting Interface. Closes the posting interface session

Selection screen parameters

ParameterDescriptionTypeReference fieldRequiredExample
P_FILEUpload file (XLSX or CSV)Single value—YesC:\temp\denklestirme.xlsx
P_TESTTest mode (check without posting)Checkbox—NoX
P_TOLAllowed difference per group (local currency)Single value—No5,00
P_RESIDLeave a difference outside tolerance as a residual itemCheckbox—No—

Input file columns

The columns of the upload template and the SAP fields they are written to. Columns with an asterisk are mandatory.

#ColumnTarget fieldRequired
1Group keyBy rule Rows with the same key are cleared in one clearing documentYes
2Company codeBKPF-BUKRSYes
3Account type (D/K/S)BSEG-KOARTYes
4AccountBy rule Customer (KUNNR), vendor (LIFNR) or G/L account (HKONT) by account typeYes
5Document numberBSEG-BELNRYes
6Fiscal yearBSEG-GJAHRYes
7Line itemBSEG-BUZEIYes
8Clearing dateBKPF-BUDATYes
9Document typeBKPF-BLARTNo
10Header textBKPF-BKTXTNo

Sample upload file

1Group key *Company code *Account type (D/K/S) *Account *Document number *Fiscal year *Line item *Clearing date *Document typeHeader text
2G0011000D2001501800012044202600111/17/2026ABFactoring offset
3G0011000D2001501400008210202600111/17/2026ABFactoring offset
4G0021000S102150100004512202600211/17/2026SABank clearing account clean-up
A view built with fictional sample data; not real system data.

Result list columns

#ColumnSource
1GroupCalculated Group key from the file
2Company codeBKPF-BUKRS
3Number of itemsCalculated Number of rows in the group
4DifferenceCalculated Signed amount total of the items in the group
5Clearing documentBKPF-BELNR
6StatusCalculated Cleared, test passed or error
7MessageCalculated First error or success message returned by the posting interface

Sample result list

GroupCompany codeNumber of itemsDifferenceClearing documentStatusMessage
G0011000201400008342ClearedDocument 1400008342 posted
G002100012.40ErrorGroup is not balanced; the difference is within tolerance but no difference account is defined
G003100040ErrorItem 1800011987/2026/001 is already cleared
A view built with fictional sample data; not real system data.

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.

Performance notes

Clearing creates one document per group; run files with a few thousand rows in the background. Open item checks read by key fields (company code, document, year, item).

Features

  • Test mode (check without posting)
  • Line-by-line result and error log
  • Download failed lines as a separate file Failed groups can be corrected and uploaded again with the same template.
  • Export to Excel An empty template and the open item list can be downloaded as Excel.
  • Runs as a background job

Authorization objects

  • F_BKPF_BUKPosting authorization by company code
  • F_BKPF_KOAPosting authorization by account type (customer, vendor, G/L)
  • F_BKPF_BLAAuthorization 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.

Related reports

FI Report Custom ALV report

Customer–Vendor Netting Open Items Report

A custom ALV report that puts open receivables and payables side by side for business partners that exist both as a customer and as a vendor, and …

KNA1 · LFA1 · BSID · BSIK

Let us build this program for your system

Briefly describe your system and expectations. We will clarify the scope and come back with an effort and price quote.

Related report: Mass Open Item Clearing Upload from Excel (Customer, Vendor, G/L)