Professional Documents
Culture Documents
SQL Queries To Get Requisition PO and PO Receipt Details
SQL Queries To Get Requisition PO and PO Receipt Details
by users Purchase Orders created for the requisitions (inventory and non inventory
items) Receiving transactions with PO and Requisition information I have given the
queries here as could be useful. All data has been taken for ye ars 2010 and 2011.
You can change it as per your requirement. Purchase Requisition details 01 SELECT
prh.segment1 "Req #", prh.creation_date, prh.created_by, poh.segm ent1 "PO #",
ppx.full_name "Requestor Name", 02 prh.description "Req Description",
prh.authorization_status, prh. note_to_authorizer, prh.type_lookup_code,
prl.line_num, 03 prl.line_type_id, prl.item_description,
prl.unit_meas_lookup_code , prl.unit_price, prl.quantity, prl.quantity_delivered,
04 prl.need_by_date, prl.note_to_agent, prl.currency_code, prl.rate_ type,
prl.rate_date, prl.quantity_cancelled, prl.cancel_date, 05 prl.cancel_reason 06
FROM po_requisition_headers_all prh, 07 po_requisition_lines_all prl, 08
po_req_distributions_all prd, 09 per_people_x ppx, 10 po_headers_all poh, 11
po_distributions_all pda 12 WHERE prh.requisition_header_id =
prl.requisition_header_id 13 AND ppx.person_id = prh.preparer_id 14 AND
prh.type_lookup_code = 'PURCHASE' 15 AND prd.requisition_line_id =
prl.requisition_line_id 16 AND pda.req_distribution_id = prd.distribution_id 17 AND
pda.po_header_id = poh.po_header_id 18 AND TO_CHAR (prh.creation_date, 'YYYY') IN
('2010', '2011') Internal Requisition details 01 SELECT prh.segment1 "Req #",
prh.creation_date, prh.created_by, poh.segm ent1 "PO #", ppx.full_name "Requestor
Name", 02 prh.description "Req Description", prh.authorization_status, prh.
note_to_authorizer, prl.line_num, 03 prl.line_type_id, prl.source_type_code,
prl.item_description, prl .unit_meas_lookup_code, prl.unit_price, prl.quantity,
prl.quantity_delivered, 04 prl.need_by_date, prl.note_to_agent, prl.currency_code,
prl.rate_ type, prl.rate_date, prl.quantity_cancelled, prl.cancel_date, 05
prl.cancel_reason 06 FROM po_requisition_headers_all prh, 07
po_requisition_lines_all prl, 08 po_req_distributions_all prd, 09 per_people_x ppx,
10 po_headers_all poh, 11 po_distributions_all pda 12 WHERE
prh.requisition_header_id = prl.requisition_header_id 13 AND ppx.person_id =
prh.preparer_id 14 AND prh.type_lookup_code = 'INTERNAL' 15 AND
prd.requisition_line_id = prl.requisition_line_id 16 AND pda.req_distribution_id
(+) = prd.distribution_id 17 AND pda.po_header_id = poh.po_header_id (+) 18 AND
TO_CHAR (prh.creation_date, 'YYYY') IN ('2010', '2011') Purchase Order details 001
-- Purchase Orders for non inventory items like service 002 SELECT 003 ph.SEGMENT1
po_num 004 , ph.CREATION_DATE
005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 021 022 023 024 025
026 027 028 029 030 031 032 033 034 035 036 037 038 039 040 041 042 043 044 045 046
047 048 049 050 051 052 053 054 055 056 057 058 059 060 061 062 063 064