# Electronic Bank Statement Import and Automatic Posting Interface

> A custom interface program that reads the account movements banks deliver in different formats (MT940, CAMT.053, bank XML or an Excel export) every day, writes them into the SAP electronic bank statement tables, finds the customer, vendor or G/L account from the counterparty IBAN and text rules, and triggers the standard posting step. Unmatched movements land on the postprocessing list.

- Type: Program, Custom development, Interface
- Module: FI
- Estimated effort: M (7–10 working days)
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/programs/electronic-bank-statement-import-and-automatic-posting/


## Why is the standard not enough?

FF_5 imports statements from defined formats such as MT940, but a bank's own XML, web service or Excel export has to be converted first. Standard search strings find patterns in the note to payee, but finding the customer or vendor from the counterparty IBAN, splitting one movement across several invoices or posting bank charges and similar fees to a separate account needs extra rules. The custom program converts all formats in one place, applies a rule table and keeps the standard posting and postprocessing (FEBAN).

### Closest standard alternatives

- FF_5: Imports statements in defined formats; bank-specific formats and IBAN-based matching need extra development.
- FEBAN: Unmatched items are still postprocessed in the standard screen.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| FEBKO | Statement header: house bank, account, statement number and date; duplicate check | Read / write | - | ECC + S/4 |
| FEBEP | Statement items: value date, amount, external and internal transaction code | Write | FEBEP-KUKEY = FEBKO-KUKEY | ECC + S/4 |
| FEBRE | Note to payee lines of the items | Write | FEBRE-KUKEY = FEBEP-KUKEY AND FEBRE-ESNUM = FEBEP-ESNUM | ECC + S/4 |
| FEBCL | Account type, account and clearing selection found by the rule table | Write | FEBCL-KUKEY = FEBEP-KUKEY AND FEBCL-ESNUM = FEBEP-ESNUM | ECC + S/4 |
| T012K | House bank accounts and their G/L account | Read | - | ECC + S/4 |
| TIBAN | From the counterparty IBAN to bank account details | Read | - | ECC + S/4 |
| KNBK | Customer bank accounts: finding the customer from the IBAN | Read | - | ECC + S/4 |
| LFBK | Vendor bank accounts: finding the vendor from the IBAN | Read | - | ECC + S/4 |
| BSID | Customer open items to match against incoming payments | Read | - | ECC + S/4 |

## BAPIs and functions used

- SO_NEW_DOCUMENT_ATT_SEND_API1: Emails the run summary to the accounting team

## Selection screen parameters

| Parameter | Description | Type | Reference field | Required |
|---|---|---|---|---|
| S_HBKID | House bank | Range / multiple | FEBKO-HBKID | No |
| S_HKTID | Account ID | Range / multiple | FEBKO-HKTID | No |
| R_SRC | Source: file folder or bank service | Radio button | - | No |
| P_FILE | File path (for a single file) | Single value | - | No |
| P_POST | Start the posting step after import | Checkbox | - | No |
| P_TEST | Test mode (show without writing to the tables) | Checkbox | - | No |

## Input file columns

| Column | Target field | Required |
|---|---|---|
| Account IBAN | Mapped to the house bank account in T012K; stored in FEBKO as house bank and account ID | Yes |
| Value date | FEBEP-VALUT | Yes |
| Amount (signed) | FEBEP-KWBTR | Yes |
| Currency | Compared with the account currency; the row is rejected if it differs | Yes |
| Bank transaction code | FEBEP-VGEXT | No |
| Description | FEBRE-VWEZW | No |
| Counterparty IBAN | Looked up in TIBAN, KNBK and LFBK to find the customer or vendor | No |
| Counterparty name | Used for name matching when no IBAN is found, and shown in the list | No |

## Result list columns

| Column | Source |
|---|---|
| Statement no. | FEBKO-AZNUM |
| Item | FEBEP-ESNUM |
| Value date | FEBEP-VALUT |
| Amount | FEBEP-KWBTR |
| Counterparty | Calculated: Counterparty name from the file |
| Account found | FEBCL-AGKON |
| Rule applied | Calculated: IBAN, invoice reference, fixed pattern or no match |
| Accounting document | FEBEP-BELNR |
| Status | Calculated: Posted and cleared, posted, left for postprocessing or error |

## How does the program work?

1. A source is defined for each bank account (file folder, SFTP or bank web service), and a reader class converts that bank's format into one common structure.
2. The house bank and account ID are found in T012K and T012; a statement that arrives twice is rejected by checking its number and date in FEBKO.
3. A rule table is applied to each movement in order: the counterparty IBAN is looked up in TIBAN, KNBK and LFBK; if nothing is found, the invoice or reference number in the text is matched against open items in BSID; patterns for bank charges, interest and taxes are routed to fixed G/L accounts.
4. The header is written to FEBKO, the items to FEBEP, the note to payee lines to FEBRE and the clearing information found to FEBCL; each item gets an internal transaction code.
5. If P_POST is set, the standard bank statement posting step is started; matched items are posted and open items cleared, unmatched ones stay in FEBAN for postprocessing.
6. A run summary (movements received, posted and left for postprocessing, with amounts) is listed and sent by email.

## Authorization objects

- F_FEBB_BUK: Authorization to import and process bank statements for the company code
- F_BKPF_BUK: Posting authorization for the bank statement entries

## Frequently asked questions

### Can it connect to the bank's web service directly?

Yes. The reader layer depends on the source; movements can be fetched from a file folder, SFTP or the bank's API. Connection and certificate settings are managed through SAP's standard communication settings.

### What if one receipt pays several invoices?

If the text contains several invoice numbers, all of them are written to FEBCL as clearing selections, and the item is cleared in one posting when the total matches. If it does not match, the item is left for postprocessing.

### Can it be used on S/4HANA?

Yes. The bank statement tables and postprocessing are the same on S/4HANA, and the Fiori bank statement apps show the same data.

---
Let us build this program for your system: https://nekuhub.com/en/request-a-quote/?report=fi-bank-statement-import-posting
