OCTG table in SAP Business One (Payment Terms)
OCTG is the SAP Business One payment terms table: one row per payment term, with its code, start point, additional months and days, number of installments, credit limit and cash discount. Business partners and documents store GroupNum, which joins to OCTG.GroupNum, so OCTG explains how the due date of an invoice is calculated.
OCTG key fields
| Field | What it holds |
|---|---|
GroupNum | Payment terms number, the key. OCRD.GroupNum and OINV.GroupNum point to it. |
PymntGroup | Payment terms code (the name users pick). |
PayDuMonth | Start from: E = month end, H = half month, Y = month start, N = selected date. |
ExtraMonth | Number of additional months. |
ExtraDays | Number of additional days. |
BslineDate | Due date based on: P = posting date, S = system date, T = document date, C = closing date. |
InstNum | Number of installments. |
TolDays | Number of tolerance days. |
CredLimit | Maximum credit. |
VolumDscnt | Total discount %. |
ListNum | Price list. Joins to OPLN.ListNum. |
DiscCode | Cash discount code (OCDC). |
Active | Y = active, N = inactive. |
How OCTG relates to other tables
OCTG is master data. OCRD.GroupNum gives the default payment terms of the business partner and the document header (for example OINV.GroupNum) holds the terms used on that document. When InstNum is above one, the installments of the invoice are stored in INV6.
Common joins
OCRD T0 LEFT JOIN OCTG T1 ON T1.GroupNum = T0.GroupNum (default terms of the business partner)OINV T2 INNER JOIN OCTG T1 ON T1.GroupNum = T2.GroupNum (terms used on the invoice)OINV T2 INNER JOIN INV6 T3 ON T3.DocEntry = T2.DocEntry (installments created from the terms)
When you use the OCTG table
Use OCTG to list payment terms with their months and days, to compare the terms on invoices with the default terms of the customer, and to calculate due dates in code that posts documents.
Example query: payment terms with the number of customers using each
SQL Server
SELECT T1.GroupNum, T1.PymntGroup, T1.PayDuMonth, T1.ExtraMonth, T1.ExtraDays, T1.InstNum, COUNT(T0.CardCode) AS BusinessPartners FROM OCTG T1 LEFT JOIN OCRD T0 ON T0.GroupNum = T1.GroupNum GROUP BY T1.GroupNum, T1.PymntGroup, T1.PayDuMonth, T1.ExtraMonth, T1.ExtraDays, T1.InstNum ORDER BY T1.GroupNum
SAP HANA (column names in double quotes)
SELECT T1."GroupNum", T1."PymntGroup", T1."PayDuMonth", T1."ExtraMonth", T1."ExtraDays", T1."InstNum", COUNT(T0."CardCode") AS "BusinessPartners" FROM OCTG T1 LEFT JOIN OCRD T0 ON T0."GroupNum" = T1."GroupNum" GROUP BY T1."GroupNum", T1."PymntGroup", T1."PayDuMonth", T1."ExtraMonth", T1."ExtraDays", T1."InstNum" ORDER BY T1."GroupNum"
Paste either version in Tools → Queries → Query Generator. Need the other dialect for your own query? Use the SQL to HANA converter.
Common pitfall: Reading only ExtraDays
A term named "45 days" can be stored as 1 additional month plus 15 days, and PayDuMonth can move the start to the month end first. Code that adds only ExtraDays to the posting date gets the wrong due date. Apply the start point, then ExtraMonth, then ExtraDays, from the base date set in BslineDate. See Overdue invoices query.
Ready-made queries that use OCTG
- Overdue customer invoices: Open invoices past their due date, with days overdue and the customer phone number.
- Customer aging report (AR aging): Open invoice balance per customer in 0–30, 31–60, 61–90 and 90+ day buckets by due date.
Questions about the OCTG table
How do I get the payment terms name of a customer?
Join OCRD.GroupNum to OCTG.GroupNum and read OCTG.PymntGroup.
What does PayDuMonth mean in OCTG?
The start point of the due date: E = month end, H = half month, Y = month start, N = the selected date.
Where are the installments of an invoice stored?
OCTG.InstNum sets how many; the installments of each A/R invoice are rows in INV6.
Related tables
OCRD (Business Partners) · OINV (A/R Invoice (header)) · INV6 (A/R Invoice (installments)) · 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.
