Check the approval status of purchase order
SELECT poh.segment1 "PO NUM",
poh.authorization_status "STATUS",
pla.line_num "SEQ NUM",
plla.line_location_id,
d.po_distribution_id,
poh.type_lookup_code "TYPE"
FROM po.po_headers_all poh,
po.po_lines_all pla,
po.po_line_locations_all plla,
po.po_distributions_all d
WHERE poh.po_header_id = pla.po_header_id
AND plla.po_line_id = pla.po_Line_id
AND plla.line_location_id = d.line_location_id
AND NVL (poh.closed_code, 'OPEN') NOT IN ('CLOSED', 'FINALLY CLOSED')
AND poh.closed_date IS NULL
View Purchase order after specific date with status.
SELECT ph.segment1 "PO NUM",
pv.vendor_name "SUPPLIER NAME",
pv.VENDOR_TYPE_LOOKUP_CODE "SUPPLIER TYPE",
msi.segment1 "ITEM CODE",
pl.item_description "ITEM DESCRIPTION",
TO_CHAR (TRUNC (ph.CREATION_DATE)) "CREATION DATE",
zxd.input_tax_classification_code "TAX CODE",
ph.currency_code "CURRENCY",
ppx.full_name "BUYER NAME",
ph.type_lookup_code "PO TYPE",
pl.line_num "LINE NUM",
plt.order_type_lookup_code "LINE TYPE",
plc.displayed_field "PO STATUS"
FROM po_headers_all ph,
po_lines_all pl,
po_distributions_all pda,
po_vendors pv,
po_vendor_sites_all pvs,
po_distributions_all pd,
po_req_distributions_all prd,
po_requisition_lines_all prl,
po_requisition_headers_all prh,
hr_operating_units hou,
per_people_x ppx,
mtl_system_items_b msi,
po_line_types_b plt,
org_organization_definitions ood,
per_people_x ppx1,
po_lookup_codes plc,
ZX_LINES_DET_FACTORS zxd
WHERE 1 = 1
AND ph.vendor_id = pv.vendor_id
AND PH.ORG_ID = 84
AND ph.po_header_id = pl.po_header_id
AND ph.vendor_site_id = pvs.vendor_site_id
AND ph.po_header_id = pd.po_header_id
AND pl.po_line_id = pd.po_line_id
AND pd.req_distribution_id = prd.distribution_id(+)
AND prd.requisition_line_id = prl.requisition_line_id(+)
AND prl.requisition_header_id = prh.requisition_header_id(+)
AND hou.organization_id = ph.org_id
AND ph.agent_id = ppx.person_id
AND pda.po_header_id = ph.po_header_id
AND pda.po_line_id = pl.po_line_id
AND pl.line_type_id = plt.line_type_id
AND ood.organization_id = pda.destination_organization_id
AND ppx1.person_id(+) = prh.preparer_id
AND pda.destination_organization_id = msi.organization_id(+)
AND msi.inventory_item_id = NVL (pl.item_id, msi.inventory_item_id)
AND plc.lookup_type = 'DOCUMENT STATE'
AND plc.lookup_code = ph.closed_code
AND ph.creation_date > '&FROM_DATE'
AND zxd.trx_id = ph.po_header_id