Skip to content
SAP Reference

FBL5N

Report S/4HANA status: Active

Customer Line Item Display

What the badges mean
S/4HANA status: Active
Active and unchanged in S/4HANA.
S/4HANA status: Deprecated
Still readable today, but no longer SAP's strategic path — plan around it.
S/4HANA status: Replaced
Replaced by a new persistence in S/4HANA; the classic name may still answer reads (see read mechanism).
S/4HANA status: Migrating to IBP
Planning scope is moving from APO toward IBP.
S/4HANA status: Active (StRM) · Replaced (EWM)
Path-dependent: active with SAP Stock Room Management, replaced where EWM is the warehouse path.
S/4HANA status: Replaced · Compat View
Compatibility view: the classic table name is redirected to a view over the new persistence — see how the physical model moved.
S/4HANA status: Active · Proxy View
Proxy view: reads route through NSDM proxy/CDS views — see how the physical model moved.
master
Data class: what the table holds — master data, transaction documents, org structure, config, or texts (one row per language — see the quirks guide).
In field listings, K marks a primary-key field, and linked type codes in the Type column jump to the matching quirks-guide section.

Boilerplate SQL

Databricks SQL

Starting point for querying the tables behind this transaction. Set your Unity Catalog location and filter values below — they’re substituted into the SQL and the copy button.

Query parameters

7 parameters not filled: <catalog>, <schema>, <MANDT>, <BUKRS>, <KUNNR>, <DATE_FROM>, <DATE_TO>

-- ============================================================
-- T-Code : FBL5N Customer Line Item Display
-- Purpose: Display customer open + cleared line items with due-date and dunning enrichment
-- Grain  : One row per customer line item (BSID open / BSAD cleared — unioned)
-- Tables : BSID, BSAD, KNA1, T001, T003T
-- Notes  : BSID (open) + BSAD (cleared) are alternative secondary indices — never joined, always unioned. UNION ALL to reproduce 'All items'.
-- ============================================================
SELECT
  'OPEN'   AS "Status",
  -- Keys
  i.MANDT  AS "Client",
  i.BUKRS  AS "Company Code",
  i.KUNNR  AS "Customer",
  i.GJAHR  AS "Fiscal Year",
  i.BELNR  AS "Document Number",
  i.BUZEI  AS "Line Item",

  -- Descriptive text
  c.NAME1  AS "Customer Name",
  cc.BUTXT AS "Company Code Name",
  dt.LTEXT AS "Document Type Description",

  -- Amounts + Currency (paired)
  i.DMBTR  AS "Amount in Local Currency",
  i.WRBTR  AS "Amount in Document Currency",
  i.WAERS  AS "Currency",

  -- Dates
  i.BUDAT  AS "Posting Date",
  i.BLDAT  AS "Document Date",
  i.ZFBDT  AS "Baseline Payment Date",
  i.AUGDT  AS "Clearing Date",

  -- Status / indicators
  i.BLART  AS "Document Type",
  i.SHKZG  AS "Debit/Credit Indicator",
  i.UMSKS  AS "Special G/L Transaction Type",
  i.UMSKZ  AS "Special G/L Indicator",
  i.AUGBL  AS "Clearing Document",
  i.ZTERM  AS "Payment Terms",
  i.ZLSPR  AS "Payment Block",
  i.MABER  AS "Dunning Area",
  i.MANST  AS "Dunning Level",

  -- Assignment
  i.ZUONR  AS "Assignment",
  i.XBLNR  AS "Reference Number"
FROM <catalog>.<schema>.bsid i
LEFT JOIN <catalog>.<schema>.kna1 c
  ON  c.MANDT = i.MANDT
  AND c.KUNNR = i.KUNNR
LEFT JOIN <catalog>.<schema>.t001 cc
  ON  cc.MANDT = i.MANDT
  AND cc.BUKRS = i.BUKRS
LEFT JOIN t003t dt
  ON  dt.MANDT = i.MANDT
  AND dt.BLART = i.BLART
  AND dt.SPRAS = 'E'
WHERE i.MANDT = '<MANDT>'
  AND i.BUKRS = '<BUKRS>'
  AND i.KUNNR = '<KUNNR>'

UNION ALL

SELECT
  'CLEARED' AS "Status",
  cl.MANDT, cl.BUKRS, cl.KUNNR, cl.GJAHR, cl.BELNR, cl.BUZEI,
  c.NAME1, cc.BUTXT, dt.LTEXT,
  cl.DMBTR, cl.WRBTR, cl.WAERS,
  cl.BUDAT, cl.BLDAT, cl.ZFBDT, cl.AUGDT,
  cl.BLART, cl.SHKZG, cl.UMSKS, cl.UMSKZ, cl.AUGBL, cl.ZTERM, cl.ZLSPR, cl.MABER, cl.MANST,
  cl.ZUONR, cl.XBLNR
FROM <catalog>.<schema>.bsad cl
LEFT JOIN <catalog>.<schema>.kna1 c
  ON  c.MANDT = cl.MANDT
  AND c.KUNNR = cl.KUNNR
LEFT JOIN <catalog>.<schema>.t001 cc
  ON  cc.MANDT = cl.MANDT
  AND cc.BUKRS = cl.BUKRS
LEFT JOIN t003t dt
  ON  dt.MANDT = cl.MANDT
  AND dt.BLART = cl.BLART
  AND dt.SPRAS = 'E'
WHERE cl.MANDT = '<MANDT>'
  AND cl.BUKRS = '<BUKRS>'
  AND cl.KUNNR = '<KUNNR>'
  AND cl.AUGDT BETWEEN '<DATE_FROM>' AND '<DATE_TO>'

ORDER BY "Customer", "Posting Date" DESC, "Document Number";

Tables Used by This Transaction

More Financial Accounting t-codes