FI Program Custom development Interface

Journal Interface from External Systems with Account Mapping

Short answer: A general-purpose interface that converts transactions from non-SAP systems such as a hotel management system, insurance, payroll or a front-office accounting package into SAP G/L accounts, cost centers, customers and vendors through mapping tables, checks them, posts them as accounting documents and emails errors to the owners.

Estimated effort
L · 10–15 working days
System
ECC and S/4HANA
Tables
8
Scope
Global
Built by
NeKuDos Teknoloji
Last updated

Why is the standard not enough?

FB50 and FB01 enter postings by hand; LSMW or standard accounting APIs can create documents from a file. But maintenance screens that translate the source system's own account codes, departments and partner codes to their SAP equivalents, pre-posting checks on period, balance and validity, error tracking per source system and reprocessing do not come ready. A separate upload is written for each new source and errors cannot be followed up.

Who uses it? General ledger, integration and IT teams, accounting owners of group companies.

Closest standard alternatives

  • FB50 G/L Account Posting (Single Screen). Enters G/L postings by hand; no mapping or bulk checks.
  • LSMW Legacy System Migration Workbench. Can create documents from a file; offers no mapping maintenance per source, error notification or reprocessing.

Tables used

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

TableRoleAccessSystem
SKB1G/L Account Master (Company Code)Whether the G/L account is open for posting in the company codeReadECC + S/4
CSKSCost Center Master RecordCost center validityReadECC + S/4
KNB1Customer Master (Company Code)Company code data of the mapped customerReadECC + S/4
LFB1Vendor Master (Company Code)Company code data of the mapped vendorReadECC + S/4
BKPFAccounting Document HeaderCreated accounting documents; duplicate reference checkRead / writeECC + S/4
BSEGAccounting Document SegmentDocument items (written through the BAPI)WriteECC + S/4
BALHDRApplication Log HeaderInterface run logWriteECC + S/4
T001Company CodesCompany code currency and chart of accountsReadECC + S/4

BAPIs and functions used

  • FI_PERIOD_CHECKCheck Whether Posting Period Is Open. Checks that the posting period is open
  • BAPI_ACC_DOCUMENT_CHECKAccounting: Check Document. Checks the document without posting
  • BAPI_ACC_DOCUMENT_POSTAccounting: Post Document. Posts the accounting document
  • BAPI_TRANSACTION_COMMITCommit a BAPI transaction. Saves successful documents
  • SO_DOCUMENT_SEND_API1SAPoffice: Send Document with Attachments. Emails the error summary

Selection screen parameters

ParameterDescriptionTypeReference fieldRequiredExample
P_SRCSource system codeSingle value—YesOTEL
P_BUKRSCompany codeSingle valueBKPF-BUKRSYes2000
P_FILEFile (if not read from the interface table)Single value—No/interface/otel/2026-11-28.csv
S_BUDATPosting dateRange / multipleBKPF-BUDATNo—
P_REPRReprocess failed and mapping-pending recordsCheckbox—No—
P_TESTTest modeCheckbox—NoX

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
1Source document numberBy rule Voucher number in the source system; written to the SAP reference fieldYes
2Document dateBKPF-BLDATYes
3External account codeBy rule Converted to an SAP G/L account with the mapping tableYes
4External departmentBy rule Converted to a cost center with the mapping tableNo
5External partner codeBy rule Converted to a customer or vendor with the mapping tableNo
6Debit/creditBSEG-SHKZGYes
7AmountBSEG-WRBTRYes
8CurrencyBKPF-WAERSYes
9TextBSEG-SGTXTNo

Sample upload file

1Source document number *Document date *External account code *External departmentExternal partner codeDebit/credit *Amount *Currency *Text
2OT-20261128-0128.11.20264010FB-ODAH184,500TRYRoom revenue
3OT-20261128-0128.11.20261200ACN-0071S184,500TRYTravel agent receivable
4OT-20261128-0228.11.20266150MUTFAKS12,400TRYKitchen supplies
A view built with fictional sample data; not real system data.

Result list columns

#ColumnSource
1Source document numberCalculated Voucher number in the source system
2G/L accountBSEG-HKONT
3Cost centerBSEG-KOSTL
4AmountBSEG-WRBTR
5Accounting documentBKPF-BELNR
6StatusCalculated Posted, mapping pending, duplicate or error
7MessageCalculated Check or BAPI return message

Sample result list

Source document numberG/L accountCost centerAmountAccounting documentStatusMessage
OT-20261128-01600100184,500100008812Posted
OT-20261128-0277015012,400Mapping pendingNo cost center mapping for department MUTFAK
OT-20261127-0560010096,300DuplicateReference already posted with 100008790
A view built with fictional sample data; not real system data.

How does the program work?

  1. A source code is defined for each source system (for example hotel, payroll, insurance): file format or interface, document type, posting date rule and error recipients.
  2. Mapping tables are maintained per source code: external account → SAP G/L account (SKB1), external department → cost center or profit center (CSKS), external partner code → customer or vendor (KNB1, LFB1). A record without a mapping stays in status ‘mapping pending’.
  3. Pre-posting checks: is the period open (FI_PERIOD_CHECK), is the account open for posting, is the cost center valid (CSKS-DATBI), does the document balance; then BAPI_ACC_DOCUMENT_CHECK runs.
  4. Records that pass are posted with BAPI_ACC_DOCUMENT_POST; the source system’s document number is written to the reference field (XBLNR) and posting the same reference twice is blocked.
  5. The result of each run is written to the application log (BALHDR) and the interface table. Failed and mapping-pending records are sent as a summary to the recipients defined per source code with SO_DOCUMENT_SEND_API1.
  6. The monitor lists records by source, date and status; after mapping is completed the selected records are processed again. In S/4HANA the same logic can also be fed through the released journal entry API.

Performance notes

Load the mapping tables for the source code into memory once. For large files group by the source document number and commit every 500 documents; use the daily summary option to condense lines.

Features

  • Test mode (check without posting)
  • Line-by-line result and error log
  • ALV list (sort, filter, subtotals)
  • Send the result by email A summary of failed and mapping-pending records goes to the source system owners.
  • Runs as a background job Runs as a scheduled job per source.
  • Download failed lines as a separate file

Authorization objects

  • F_BKPF_BUKPosting authorization for the company code
  • F_BKPF_BLAPosting authorization with the interface document type
  • F_BKPF_KOAPosting authorization by account type

Frequently asked questions

If the source system calculates VAT, how are tax lines handled?

If the source sends amounts with tax, the tax code is taken from the mapping table and the BAPI calculates the tax line in SAP, or uses the source tax amount after checking it. The approach is chosen per source system during installation.

Does adding a new source system require code changes?

If the file format fits one of the existing templates, only the source code and mapping tables are maintained. For a different format or a direct interface a new class is added to the reading layer.

Related reports

FI Program Custom Mass upload

Mass G/L Journal Entry Upload from Excel

A custom program that posts multi-line G/L documents (accruals, reclassifications, allocation entries) in bulk from Excel or CSV rows. It checks every …

BKPF · BSEG · SKB1 · CSKS

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: Journal Interface from External Systems with Account Mapping