ORPC table in SAP Business One (A/P Credit Memo (header))
ORPC is the SAP Business One table that stores the header of every A/P credit memo, the document a vendor issues to reduce what you owe. Its lines are in RPC1, joined on DocEntry, and its object type is 19.
ORPC key fields
| Field | What it holds |
|---|---|
DocEntry | Internal key. Joins to RPC1.DocEntry. |
DocNum | Credit memo number in SAP B1. |
NumAtCard | Vendor reference of the credit note. |
DocDate | Posting date. |
CardCode | Vendor. Joins to OCRD.CardCode. |
CardName | Vendor name. |
DocTotal | Credit total including tax (a positive number). |
VatSum | Tax amount. |
PaidToDate | Amount already applied or refunded. |
DocStatus | O = open, C = closed. |
CANCELED | N = normal, Y = cancelled, C = cancellation document. |
How ORPC relates to other tables
ORPC is the header and RPC1 the lines, joined on DocEntry. When the credit memo is copied from an A/P invoice, each RPC1 line stores BaseType = 18 and BaseEntry = OPCH.DocEntry, which is how you find the credit memos for a given vendor invoice.
Common joins
ORPC T0 INNER JOIN RPC1 T1 ON T0.DocEntry = T1.DocEntry (lines)RPC1 T1 INNER JOIN OPCH T2 ON T1.BaseType = 18 AND T1.BaseEntry = T2.DocEntry (base A/P invoice)ORPC T0 INNER JOIN OCRD T3 ON T0.CardCode = T3.CardCode (vendor)
When you use the ORPC table
ORPC belongs in every net purchases report and in vendor balance checks. It is also where returns and price corrections from vendors show up, so purchasing teams use it to track supplier quality and price disputes.
Example query: net purchases per vendor (invoices minus credit memos)
SQL Server
SELECT X.CardCode, X.CardName, SUM(X.NetAmount) AS NetPurchases FROM ( SELECT T0.CardCode, T0.CardName, T0.DocTotal - T0.VatSum AS NetAmount FROM OPCH T0 WHERE T0.CANCELED = 'N' AND T0.DocDate >= '20260101' UNION ALL SELECT T1.CardCode, T1.CardName, -(T1.DocTotal - T1.VatSum) FROM ORPC T1 WHERE T1.CANCELED = 'N' AND T1.DocDate >= '20260101' ) X GROUP BY X.CardCode, X.CardName ORDER BY NetPurchases DESC
SAP HANA (column names in double quotes)
SELECT X."CardCode", X."CardName", SUM(X."NetAmount") AS "NetPurchases" FROM ( SELECT T0."CardCode", T0."CardName", T0."DocTotal" - T0."VatSum" AS "NetAmount" FROM OPCH T0 WHERE T0."CANCELED" = 'N' AND T0."DocDate" >= '20260101' UNION ALL SELECT T1."CardCode", T1."CardName", -(T1."DocTotal" - T1."VatSum") FROM ORPC T1 WHERE T1."CANCELED" = 'N' AND T1."DocDate" >= '20260101' ) X GROUP BY X."CardCode", X."CardName" ORDER BY "NetPurchases" DESC
Paste either version in Tools → Queries → Query Generator. Need the other dialect for your own query? Use the SQL to HANA converter.
Common pitfall: DocTotal is positive on credit memos
ORPC.DocTotal is stored as a positive amount. Subtract it yourself (as in the UNION ALL above); adding OPCH and ORPC totals directly overstates purchases twice over. See OPCH table (A/P invoice).
Ready-made queries that use ORPC
- Vendor aging report (AP aging): Open A/P invoice balance per vendor in due-date buckets.
Related tables
OPCH (A/P Invoice (header)) · OCRD (Business Partners) · JDT1 (Journal Entry Lines) · 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.
