OPRQ table in SAP Business One (Purchase Request (header))
OPRQ is the SAP Business One table that stores the header of every purchase request, the internal document a user or employee creates to ask purchasing to buy something. Its object type is 1470000113. The rows are in PRQ1, joined on DocEntry; a row copied to a purchase order has TargetType 22.
OPRQ key fields
| Field | What it holds |
|---|---|
DocEntry | Internal key. Joins to PRQ1.DocEntry. |
DocNum | Request number users see. |
DocDate | Posting date. |
ReqDate | Required date. |
Requester / ReqName | User requesting the goods and their name. |
ReqType | 12 = user, 171 = employee. |
Department | Department. Joins to OUDP. |
Branch | Branch. Joins to OUBR. |
DocStatus | O = open, C = closed. |
CANCELED | Y = cancelled, N = not cancelled, C = cancellation. |
PRQ1.LineVendor | Suggested vendor of the row. Joins to OCRD.CardCode. |
ObjType | Object type, 1470000113 = purchase request. |
How OPRQ relates to other tables
OPRQ is the header and PRQ1 holds the rows, each with LineVendor, PQTReqDate and OpenQty. When a row is copied on, PRQ1.TargetType is 22 (purchase order), 540000006 (purchase quotation), 20 (goods receipt PO) or 18 (A/P invoice).
Common joins
OPRQ T0 INNER JOIN PRQ1 T1 ON T1.DocEntry = T0.DocEntry (rows)PRQ1 T1 LEFT JOIN OPOR T2 ON T2.DocEntry = T1.TrgetEntry AND T1.TargetType = 22 (purchase order)PRQ1 T1 LEFT JOIN OCRD T3 ON T3.CardCode = T1.LineVendor (suggested vendor)
When you use the OPRQ table
Use OPRQ with PRQ1 to list open purchase requests for buyers, to measure the time from request to purchase order, and to report requests per department or requester.
Example query: open purchase request rows with requester and suggested vendor
SQL Server
SELECT T0.DocNum, T0.DocDate, T0.ReqDate, T0.ReqName, T1.ItemCode, T1.Dscription, T1.OpenQty, T1.LineVendor FROM OPRQ T0 INNER JOIN PRQ1 T1 ON T1.DocEntry = T0.DocEntry WHERE T0.DocStatus = 'O' AND T0.CANCELED = 'N' AND T1.OpenQty > 0 ORDER BY T0.ReqDate
SAP HANA (column names in double quotes)
SELECT T0."DocNum", T0."DocDate", T0."ReqDate", T0."ReqName", T1."ItemCode", T1."Dscription", T1."OpenQty", T1."LineVendor" FROM OPRQ T0 INNER JOIN PRQ1 T1 ON T1."DocEntry" = T0."DocEntry" WHERE T0."DocStatus" = 'O' AND T0."CANCELED" = 'N' AND T1."OpenQty" > 0 ORDER BY T0."ReqDate"
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 the requester from UserSign
UserSign is the user who entered the document, which is often a buyer. The person who asked for the goods is in Requester and ReqName, and ReqType tells whether it is a user (12) or an employee (171). See Open purchase orders query.
Ready-made queries that use OPRQ
- Open purchase orders by vendor: Open purchase order lines with quantity still to receive, grouped by vendor.
Questions about the OPRQ table
What is the object type of a purchase request in SAP B1?
1470000113. It is the default of OPRQ.ObjType.
How do I find the purchase order made from a purchase request?
PRQ1.TargetType = 22 and PRQ1.TrgetEntry = OPOR.DocEntry.
Who requested the items on a purchase request?
OPRQ.Requester and ReqName; ReqType 12 = user, 171 = employee.
Related tables
OPOR (Purchase Order (header)) · OCRD (Business Partners) · OITM (Items (item master data)) · 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.
