OJDT table in SAP Business One (Journal Entry (header))

OJDT is the SAP Business One table that stores the header of every journal entry, whether entered by hand or created automatically by an invoice, payment or stock document. Its debit and credit lines are in JDT1, joined on TransId.

OJDT key fields

FieldWhat it holds
TransIdJournal entry key. Joins to JDT1.TransId.
RefDatePosting date.
DueDateDue date.
TaxDateDocument date.
TransTypeSource document type: 13 = A/R invoice, 18 = A/P invoice, 24 = incoming payment, 30 = manual entry…
BaseRefNumber of the source document.
MemoRemarks of the entry.
Ref1 / Ref2Reference fields.
LocTotalTotal of the entry in local currency.
UserSignUser who created it. Joins to OUSR.USERID.

How OJDT relates to other tables

OJDT is the header and JDT1 holds one row per debit or credit line, joined on TransId. Every posting document creates exactly one journal entry, so TransType and BaseRef lead you back to the invoice, payment or goods receipt that produced it.

Common joins

  • OJDT T0 INNER JOIN JDT1 T1 ON T0.TransId = T1.TransId (lines)
  • JDT1 T1 INNER JOIN OACT T2 ON T1.Account = T2.AcctCode (G/L account)
  • OJDT T0 LEFT JOIN OUSR T3 ON T0.UserSign = T3.USERID (user)

When you use the OJDT table

Use OJDT and JDT1 for G/L account movements, audit trails, reconciliations and checks of what a document posted. Filter on RefDate for period reports, and on TransType when you want only manual entries (30) or only one document type.

Example query: manual journal entries in a period

SQL Server

SELECT T0.TransId, T0.RefDate, T0.Memo, T0.LocTotal, T1.USER_CODE
FROM OJDT T0
LEFT JOIN OUSR T1 ON T0.UserSign = T1.USERID
WHERE T0.TransType = '30' AND T0.RefDate >= '20260101'
ORDER BY T0.RefDate, T0.TransId

SAP HANA (column names in double quotes)

SELECT T0."TransId", T0."RefDate", T0."Memo", T0."LocTotal", T1."USER_CODE"
FROM OJDT T0
LEFT JOIN OUSR T1 ON T0."UserSign" = T1."USERID"
WHERE T0."TransType" = '30' AND T0."RefDate" >= '20260101'
ORDER BY T0."RefDate", T0."TransId"

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

Common pitfall: RefDate, TaxDate and DueDate are different

The G/L and trial balance use the posting date, RefDate. Filtering on TaxDate (document date) gives totals that do not match the financial reports when the two dates differ. See G/L account transactions query.

Ready-made queries that use OJDT

Related tables

JDT1 (Journal Entry Lines) · OINV (A/R Invoice (header)) · OPCH (A/P 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.