Sunday, 28 April 2013

RECEIPT FOR THE PURCHASE ORDER AND INVENTORY

SELECT   rsh.receipt_num,
           SUM (rt.quantity) qty,
           rt.transaction_type,
           poh.segment1 po_number,
           mmt.LOCATOR_ID,
           mmt.subinventory_code
    FROM   rcv_transactions rt,
           rcv_shipment_lines rsl,
           rcv_shipment_headers rsh,
           po_headers_all poh,
           mtl_material_transactions mmt
   WHERE       transaction_type = 'DELIVER'
           AND rt.shipment_header_id = rsh.shipment_header_id
           AND rt.shipment_line_id = rsl.shipment_line_id
           AND rsh.shipment_header_id = rsl.shipment_header_id
           AND rsl.item_id = 17099
           AND rt.PO_HEADER_ID = poh.PO_HEADER_ID
           AND mmt.RCV_TRANSACTION_ID = rt.transaction_id
GROUP BY   rsh.receipt_num,
           poh.segment1,
           rt.transaction_type,
           mmt.LOCATOR_ID,
           mmt.subinventory_code

No comments:

Post a Comment