βš™οΈSAPTools

BKPF: Accounting Document Header

FI

BKPF is the header table of FI accounting documents. Each row holds the company code, document number, fiscal year, document type, document and posting dates, currency, user and reference of one posted document. The individual lines are stored in BSEG in ECC and in the Universal Journal in S/4HANA.

Primary key

BUKRS + BELNR + GJAHR

plus the client field

Module

FI

Fields in this reference

10

How the BKPF key works

The primary key is MANDT, BUKRS, BELNR and GJAHR. The document number BELNR is only unique within a company code and fiscal year, so always filter on all three fields to identify one document.

BKPF fields

FieldType / data elementLengthDescription
πŸ”‘MANDTCLNT3Client
πŸ”‘BUKRSBUKRS4Company Code
πŸ”‘BELNRBELNR10Document Number
πŸ”‘GJAHRGJAHR4Fiscal Year
BLARTBLART2Document Type
BLDATDATUM8Document Date
BUDATDATUM8Posting Date
WAERSWAERS5Currency Key
USNAMUNAME12User Name
XBLNRXBLNR16Reference Document Number

This is a curated subset of the most commonly used fields, not the complete table definition. A real system contains more fields and can differ by release and customizing, so confirm the definition in transaction SE11 before relying on it.

Example ABAP SELECT for BKPF

" Open SQL applies the client (MANDT) automatically, so it is not part of the WHERE clause.
DATA lv_bukrs TYPE bkpf-bukrs.
DATA lv_belnr TYPE bkpf-belnr.
DATA lv_gjahr TYPE bkpf-gjahr.

SELECT blart, bldat, budat
  FROM bkpf
  WHERE bukrs = @lv_bukrs
    AND belnr = @lv_belnr
    AND gjahr = @lv_gjahr
  INTO TABLE @DATA(lt_bkpf).

Modern Open SQL with host variables (ABAP 7.40 and later). Need a different field list or conditions? Build it in the ABAP SELECT Builder.

BKPF in SAP S/4HANA

In SAP S/4HANA the Universal Journal table ACDOCA is the primary source for line items, while BKPF remains the document header.

Tables related to BKPF

  • BSEG (joined on BUKRS + BELNR + GJAHR): Line items of the document.
  • T001 (joined on BUKRS): Company code master data.

Practical tips for BKPF

  • BUDAT (posting date) determines the posting period, while BLDAT is the date on the original document. Use BUDAT for period-based reports.
  • XBLNR often holds an external reference such as the vendor invoice number, which makes it useful for finding a document.
  • To find the FI document created by a logistics document, use the reference fields AWTYP (reference procedure) and AWKEY (reference key) of BKPF.

BKPF FAQ

Is BELNR unique in BKPF?

No. It is unique only together with the company code (BUKRS) and the fiscal year (GJAHR). The same document number can exist in another company code or year.

Where are the line items of an FI document?

In BSEG, joined on BUKRS, BELNR and GJAHR. In SAP S/4HANA, read the Universal Journal table ACDOCA instead.

Keep exploring