Thursday 26 December 2013

Direct Items added to Work Orders

  SELECT DISTINCT
         we.wip_entity_name wo_num
       , we.creation_date
       , wedi.creation_date item_added_date
       , wedi.uom
       , wedi.required_quantity qty
       , wedi.unit_price prc
       , wedi.auto_request_material auto_req
       , wedi.suggested_vendor_name supplier
       , wedi.suggested_vendor_id
       , prha.segment1 req
       , wedi.description
    FROM wip_eam_direct_items wedi
       , wip.wip_entities we
       , wip.wip_discrete_jobs wdj
       , po.po_requisition_headers_all prha
       , po.po_requisition_lines_all prla
   WHERE we.wip_entity_id = wdj.wip_entity_id
     AND we.wip_entity_id = wedi.wip_entity_id
     AND wedi.wip_entity_id = prla.wip_entity_id(+)
     AND NVL (prla.requisition_header_id, 0) = NVL (prha.requisition_header_id, 0)
     AND wedi.creation_date > '25-JUL-2013'
ORDER BY wedi.creation_date DESC;

No comments:

Post a Comment