VPM2 table in SAP Business One (Outgoing Payments (invoices paid))
VPM2 is the SAP Business One table that lists the documents an outgoing payment pays: one row per A/P invoice, credit memo or journal entry line, with the amount in SumApplied. VPM2.DocNum is the key of the payment (OVPM.DocEntry), VPM2.DocEntry is the key of the paid document and InvType is its object type.
What is the VPM2 table in SAP B1?
VPM2 is the SAP Business One table that links outgoing payments to the vendor documents they pay. Each row is one paid A/P invoice, credit memo or journal entry with the amount applied (SumApplied). VPM2.DocNum joins to OVPM.DocEntry, the payment header; VPM2.DocEntry is the key of the paid document and InvType says which kind it is.
Where is the VPM2 table in SAP B1?
In SAP Business One 10.0, VPM2 is the "Outgoing Payments - Invoices" table with 71 columns. You see its data in Banking → Outgoing Payments → Payments to Vendors (header table OVPM).
| Table | VPM2 Outgoing Payments - Invoices (child of OVPM) |
|---|---|
| Object type (ObjType) | 46 (oVendorPayments), the object type of OVPM |
| Menu path | Banking → Outgoing Payments → Payments to Vendors |
| DI API object | Payments |
| Service Layer entity | VendorPayments (request builder) |
| Columns | 71 in SAP B1 10.0 (SDK database tables reference) |
VPM2 key fields
| Field | SAP type | What it holds |
|---|---|---|
DocNum | Int(11) | Key of the payment. Joins to OVPM.DocEntry (not to OVPM.DocNum). |
InvoiceId | Int(11) | Row number inside the payment. |
DocEntry | Int(11) | Key of the paid document, for example OPCH.DocEntry. |
InvType | nVarChar(20) | Object type of the paid document, stored as text: 18 = A/P invoice, 19 = A/P credit memo, 30 = journal entry. |
SumApplied | Num(19,6) | Amount applied to the document, in local currency. |
AppliedFC / AppliedSys | Num(19,6) | Amount applied in foreign currency / in system currency. |
DcntSum | Num(19,6) | Cash discount amount taken on the row. |
InstId | Int(6) | Installment number of the paid document. |
DocRate | Num(19,6) | Exchange rate of the row. |
WtAppld | Num(19,6) | Withholding tax applied on the row. |
OcrCode | nVarChar(8) | Distribution rule (cost center). |
Types as listed in the SAP Business One 10.0 SDK database tables reference: nVarChar(n) is text of up to n characters, Num(19,6) a decimal with 6 places. Column names are the same on SQL Server and SAP HANA.
How VPM2 relates to other tables
VPM2 is a child table of OVPM and has the same columns as RCT2. One payment can pay many vendor documents and one A/P invoice can be paid in several payments. InvType tells you which table DocEntry belongs to: 18 is OPCH, 19 is ORPC and 30 is a journal entry. A payment on account, made without choosing a document, adds no VPM2 row.
Common joins
VPM2 T1 INNER JOIN OVPM T0 ON T0.DocEntry = T1.DocNum (payment header)VPM2 T1 INNER JOIN OPCH T2 ON T2.DocEntry = T1.DocEntry AND T1.InvType = '18' (A/P invoices paid)VPM2 T1 INNER JOIN ORPC T3 ON T3.DocEntry = T1.DocEntry AND T1.InvType = '19' (A/P credit memos used)
When you use the VPM2 table
Use VPM2 to show which vendor invoices a payment covered, to print remittance advice details, to measure days to pay per vendor, and to check that payment run results match the invoices selected.
Example query: a/p invoices with the payments applied to them
SQL Server
SELECT T2.DocNum AS InvoiceNum, T2.CardCode, T2.NumAtCard, T2.DocTotal, T0.DocNum AS PaymentNum, T0.DocDate AS PaymentDate, T1.SumApplied FROM OVPM T0 INNER JOIN VPM2 T1 ON T1.DocNum = T0.DocEntry INNER JOIN OPCH T2 ON T2.DocEntry = T1.DocEntry AND T1.InvType = '18' WHERE T0.Canceled = 'N' ORDER BY T2.DocNum, T0.DocDate
SAP HANA (column names in double quotes)
SELECT T2."DocNum" AS "InvoiceNum", T2."CardCode", T2."NumAtCard", T2."DocTotal", T0."DocNum" AS "PaymentNum", T0."DocDate" AS "PaymentDate", T1."SumApplied" FROM OVPM T0 INNER JOIN VPM2 T1 ON T1."DocNum" = T0."DocEntry" INNER JOIN OPCH T2 ON T2."DocEntry" = T1."DocEntry" AND T1."InvType" = '18' WHERE T0."Canceled" = 'N' ORDER BY T2."DocNum", T0."DocDate"
Paste either version in Tools → Queries → Query Generator. Need the other dialect for your own query? Use the SQL to HANA converter.
Common pitfall: VPM2.DocNum is the payment key, not the payment number
As in RCT2, the names are swapped: VPM2.DocNum holds OVPM.DocEntry and VPM2.DocEntry holds the key of the paid document. Join VPM2.DocNum = OVPM.DocEntry, and always filter InvType ('18' for A/P invoices) before joining OPCH, because an A/P invoice and an A/P credit memo can share the same DocEntry number. See OVPM table (outgoing payments).
Ready-made queries that use VPM2
- Outgoing payments by date: Vendor payments made in a period, split into cash, transfer, check and card.
- Vendor aging report (AP aging): Open A/P invoice balance per vendor in due-date buckets.
Building something on VPM2?
Reading VPM2 (Outgoing Payments (invoices paid)) in a query is the easy part. We build Crystal Reports and Power BI dashboards for SAP Business One on SQL Server and HANA, and you own the files. Or hire a remote SAP Business One developer for the whole job, fixed price per phase.
Questions about the VPM2 table
What is the VPM2 table in SAP B1?
VPM2 is the SAP Business One table that links outgoing payments to the vendor documents they pay. Each row is one paid A/P invoice, credit memo or journal entry with the amount applied (SumApplied). VPM2.DocNum joins to OVPM.DocEntry, the payment header; VPM2.DocEntry is the key of the paid document and InvType says which kind it is.
How do I join VPM2 to OVPM in SAP B1?
VPM2.DocNum = OVPM.DocEntry. VPM2.DocNum holds the internal key of the payment, not the payment number users see.
How do I find which A/P invoices an outgoing payment paid?
Read VPM2 for the payment (VPM2.DocNum = OVPM.DocEntry) and join OPCH on OPCH.DocEntry = VPM2.DocEntry with VPM2.InvType = '18'. SumApplied is the amount paid per invoice.
What does InvType mean in VPM2?
It is the object type of the paid document, stored as text: 18 = A/P invoice, 19 = A/P credit memo and 30 = journal entry. Compare it with quotes in SQL.
What is the difference between VPM2 and RCT2?
They have the same columns. RCT2 belongs to incoming payments (ORCT) and VPM2 to outgoing payments (OVPM).
Related tables
OVPM (Outgoing Payments (header)) · OPCH (A/P Invoice (header)) · ORPC (A/P Credit Memo (header)) · RCT2 (Incoming Payments (invoices paid)) · search all SAP Business One tables
Sources: SAP Business One documentation and SDK (DI API database tables reference), SAP Help Portal; SDK 10.0 table page for VPM2.
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.
