JDT1 table in SAP Business One (Journal Entry Lines)

JDT1 is the SAP Business One table that stores the debit and credit lines of every journal entry, one row per line. It joins to OJDT on TransId and to the chart of accounts (OACT) on Account.

JDT1 key fields

FieldWhat it holds
TransIdJournal entry key. Joins to OJDT.TransId.
Line_IDLine number inside the entry, starting at 0.
AccountG/L account. Joins to OACT.AcctCode.
ShortNameBusiness partner code on BP lines, the account code on G/L lines.
DebitDebit amount in local currency.
CreditCredit amount in local currency.
FCDebit / FCCreditDebit and credit in the foreign currency of the line.
LineMemoLine remarks.
RefDatePosting date (copied from the header).
ContraActOffset account or business partner.
ProjectProject code. Joins to OPRJ.PrjCode.

How JDT1 relates to other tables

JDT1 is the line table of OJDT: TransId + Line_ID is the unique key. On a line that posts to a customer or vendor, Account is the control account (for example accounts receivable) and ShortName holds the CardCode; on a plain G/L line, ShortName equals Account.

Common joins

  • JDT1 T1 INNER JOIN OJDT T0 ON T1.TransId = T0.TransId (header)
  • JDT1 T1 INNER JOIN OACT T2 ON T1.Account = T2.AcctCode (account name)
  • JDT1 T1 LEFT JOIN OCRD T3 ON T1.ShortName = T3.CardCode (business partner lines)

When you use the JDT1 table

JDT1 answers "what moved in this account": account statements, balances at a date, movements per project or per business partner, and checks before closing a period. Sum Debit - Credit to get a balance.

Example query: balance of one g/l account at a date

SQL Server

SELECT T1.Account, T2.AcctName, SUM(T1.Debit) AS Debit, SUM(T1.Credit) AS Credit,
  SUM(T1.Debit - T1.Credit) AS Balance
FROM JDT1 T1
INNER JOIN OACT T2 ON T1.Account = T2.AcctCode
WHERE T1.Account = '[%0]' AND T1.RefDate <= '[%1]'
GROUP BY T1.Account, T2.AcctName

SAP HANA (column names in double quotes)

SELECT T1."Account", T2."AcctName", SUM(T1."Debit") AS "Debit", SUM(T1."Credit") AS "Credit",
  SUM(T1."Debit" - T1."Credit") AS "Balance"
FROM JDT1 T1
INNER JOIN OACT T2 ON T1."Account" = T2."AcctCode"
WHERE T1."Account" = '[%0]' AND T1."RefDate" <= '[%1]'
GROUP BY T1."Account", T2."AcctName"

Paste either version in Tools → Queries → Query Generator. Need the other dialect for your own query? Use the SQL to HANA converter.

Common pitfall: Account vs. ShortName on customer and vendor lines

Filtering JDT1 on Account = CardCode returns nothing, because BP lines store the control account in Account and the CardCode in ShortName. Filter on ShortName for a customer or vendor statement. See G/L account transactions query.

Ready-made queries that use JDT1

Related tables

OJDT (Journal Entry (header)) · OCRD (Business Partners) · OINV (A/R Invoice (header)) · search all SAP Business One tables

Sources: SAP Business One documentation and SDK (DI API database tables reference), SAP Help Portal.

Ready to get started?

Tell us what you need. You get a clear technical answer, a fixed scope and a price, usually within 24 hours.