Friday, September 19, 2025

PO Queries

 

/** PO Data**/

select * from PO_HEADERS_ALL order by po_header_id desc;

select * from PO_LINES_ALL;

select * from PO_DISTRIBUTIONS_ALL;

select *
from po_headers_all pha,
     po_lines_all pla,
     po_distributions_all pda
where pha.po_header_id = pla.po_header_id
and pla.po_header_id = pda.po_header_id
and pla.po_line_id = pda.po_line_id;      

select * from PO_LINE_LOCATIONS_ALL;

/**Requisition**/
select * from PO_REQUISITION_HEADERS_ALL;

select * from PO_REQUISITION_LINES_ALL;

select * from PO_REQ_DISTRIBUTIONS_ALL;

/**AP Data**/
select * from ap_suppliers;

select * from ap_supplier_sites_all;
   
select * from ap_supplier_contacts;

select * from PO_RELEASES_ALL;

select * from mtl_parameters where organization_code = 'SS1';

/**Receiving**/
select * from RCV_SHIPMENT_HEADERS where receipt_num = '7426' and ship_to_org_id = 414;

select * from RCV_SHIPMENT_LINES where shipment_header_id = 1953439;

select * from RCV_TRANSACTIONS where shipment_header_id = 1953439;

SELECT *
  FROM rcv_shipment_headers       rsh,
       rcv_shipment_lines         rsl,
       rcv_transactions           rt,
       mtl_material_transactions  mtt
 WHERE     rsh.shipment_header_id = rsl.shipment_header_id
       AND rsl.shipment_header_id = rt.shipment_header_id
       AND rsl.SHIPMENT_LINE_ID = rt.SHIPMENT_LINE_ID
       AND rt.transaction_id = mtt.RCV_TRANSACTION_ID
      -- AND rt.transaction_type = 'DELIVER'
       and rsl.po_header_id in (2053065, 2176946);
 

--Routing:
--a) Direct Delivery - PO received and delivered in single step
--b) Standard Receipt - First PO is received in receiving bay and then delivered to subinventory.
--c) Inspection Required - Here Po is first received ,then inspection is done to check quality of item and then delivered

-- PO item in the receiving bay and then delivering to subinventory via receiving transaction processor (Triggered at receive and delivery)

select * from rcv_shipment_headers;

select * from rcv_shipment_lines;

select * from rcv_transactions; -- PO Delivery Transaction details are captured

select distinct(auto_transact_code) from rcv_transactions_interface;  -- DELIVER

select * from mtl_material_transactions; -- inventory table talks about the On-hand increment when PO is delivered to specific subinventory

No comments:

Post a Comment