# 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 document first, shows all errors in test mode without posting, and lists the document numbers per row at the end.

- Type: Program, Custom development, Mass upload
- Module: FI
- Estimated effort: M (3–5 working days)
- Last updated: 2026-11-17
- URL: https://nekuhub.com/en/programs/mass-gl-journal-entry-upload-from-excel/


## Why is the standard not enough?

FB50 and F-02 enter postings one by one on the screen; accrual or allocation files with hundreds of lines are typed by hand. Pasting from Excel in FB50 is limited to the screen and gives no cross-document check or result list per row. File-based entries that repeat every month at the close need an upload program with a test mode.

### Closest standard alternatives

- FB50: Enters a G/L document manually on one screen; no bulk posting from a file and no result per row.
- F-02: General posting screen; every document is entered separately.

## Tables used

| Table | Role | Access | Join | System |
|---|---|---|---|---|
| BKPF | Accounting document header: company code, document type, dates, reference | Write | - | ECC + S/4 |
| BSEG | Document line items: account, amount, cost center, profit center, assignment | Write | BSEG-BUKRS = BKPF-BUKRS AND BSEG-BELNR = BKPF-BELNR AND BSEG-GJAHR = BKPF-GJAHR | ECC + S/4 |
| SKB1 | Check that the account exists in the company code and is not automatic-only | Read | SKB1-BUKRS = BKPF-BUKRS AND SKB1-SAKNR = BSEG-HKONT | ECC + S/4 |
| CSKS | Validity of the cost center on the posting date | Read | CSKS-KOSTL = BSEG-KOSTL | ECC + S/4 |

## BAPIs and functions used

- BAPI_ACC_DOCUMENT_CHECK: Checks the document without posting (test mode and pre-check)
- BAPI_ACC_DOCUMENT_POST: Posts each document with all its lines
- BAPI_TRANSACTION_COMMIT: Saves successful documents permanently

## 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_ALLOK | Post only if all documents are error-free | Checkbox | - | No |

## Input file columns

| Column | Target field | Required |
|---|---|---|
| Document key | Rows with the same key are collected into one document | Yes |
| Company code | BKPF-BUKRS | Yes |
| Document type | BKPF-BLART | Yes |
| Document date | BKPF-BLDAT | Yes |
| Posting date | BKPF-BUDAT | Yes |
| Currency | BKPF-WAERS | Yes |
| Reference | BKPF-XBLNR | No |
| Header text | BKPF-BKTXT | No |
| G/L account | BSEG-HKONT | Yes |
| Amount | Positive = debit, negative = credit; written to the BAPI amount structure in document currency | Yes |
| Cost center | BSEG-KOSTL | No |
| Profit center | BSEG-PRCTR | No |
| Internal order | BSEG-AUFNR | No |
| Assignment | BSEG-ZUONR | No |
| Item text | BSEG-SGTXT | No |

## Result list columns

| Column | Source |
|---|---|
| Document key | Calculated: Document key from the file |
| Lines | Calculated: Number of file rows in the document |
| Status | Calculated: From the BAPI return messages: posted, checked or error |
| Document number | BKPF-BELNR |
| Fiscal year | BKPF-GJAHR |
| Message | Calculated: First error or success message from the BAPI return table |

## How does the program work?

1. The file is read from the user's PC or, in a background job, from the application server; the first row is skipped as the header and rows with the same document key are collected into one document.
2. Every document is checked: company code and document type must exist, the account must be open in the company code and must not be an automatic-postings-only account (SKB1-XINTB), the cost center must be valid on the posting date (CSKS), and total debits must equal total credits.
3. The document is mapped to the header, G/L line and amount structures and checked with BAPI_ACC_DOCUMENT_CHECK; closed periods and account assignment errors show up here.
4. In test mode only the check runs and all messages are listed.
5. In a real run each document is posted with BAPI_ACC_DOCUMENT_POST followed by BAPI_TRANSACTION_COMMIT. With P_ALLOK, nothing is posted if a single document in the file has an error. The document number and fiscal year are taken from the returned object key to build a result list per row.

## Authorization objects

- F_BKPF_BUK: Accounting document posting authorization by company code
- F_BKPF_BLA: Posting authorization by document type

## Frequently asked questions

### Can accruals be reversed automatically at the start of the next month?

The standard version posts the documents and lists their numbers. By adding a reversal date column, the uploaded documents can be reversed on that date with BAPI_ACC_DOCUMENT_REV_POST; this extension adds 1–2 days to the effort range.

### Can entries with tax be uploaded?

Yes. When a tax code column is added to the template, the tax line is calculated through the BAPI tax structure and added to the document. The tax codes are checked against local regulation during installation.

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

Yes. BAPI_ACC_DOCUMENT_POST is supported on S/4HANA as well and the posting is written to ACDOCA. Where the Fiori journal entry upload app is not used or company-specific checks are needed, this program works with the same template.

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