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
| Field | What it holds |
|---|---|
TransId | Journal entry key. Joins to OJDT.TransId. |
Line_ID | Line number inside the entry, starting at 0. |
Account | G/L account. Joins to OACT.AcctCode. |
ShortName | Business partner code on BP lines, the account code on G/L lines. |
Debit | Debit amount in local currency. |
Credit | Credit amount in local currency. |
FCDebit / FCCredit | Debit and credit in the foreign currency of the line. |
LineMemo | Line remarks. |
RefDate | Posting date (copied from the header). |
ContraAct | Offset account or business partner. |
Project | Project 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
- G/L account transactions: Journal lines for one G/L account in a period, with debit, credit and reference.
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.
