SELECT oh.order_number,
ol.line_id,
ol.flow_status_code,
ot.name,
mp.organization_code source_org,
mp1.organization_code destination_org,
prh.segment1,
prh.cancel_flag,
prh.closed_code,
prl.cancel_flag,
prl.cancel_reason,
prl.closed_code,
REQUISITION_LINE_ID,
msi.segment1
FROM apps.oe_order_headers_all oh,
apps.oe_order_lines_all ol,
OE_TRANSACTION_TYPES_TL ot,
apps.mtl_parameters mp,
apps.mtl_parameters mp1,
apps.po_requisition_lines_all prl,
apps.po_requisition_headers_all prh,
apps.mtl_system_items_b msi
WHERE oh.header_id = ol.header_id
AND oh.order_type_id = ot.transaction_type_id
AND mp.organization_id = ol.ship_from_org_id
--AND oh.open_flag = 'Y'
AND ot.name = 'INTERNAL ORDER'
AND prh.REQUISITION_HEADER_ID = prl.REQUISITION_HEADER_ID
AND prl.REQUISITION_LINE_ID = ol.SOURCE_DOCUMENT_LINE_ID
AND prl.DESTINATION_ORGANIZATION_ID = mp1.organization_id
AND oh.order_number = '8125998'
--AND ol.flow_status_code <> 'CLOSED'
AND NVL (ol.SHIPPING_QUANTITY, 0) = 0
and ol.inventory_item_id = msi.inventory_item_id
and msi.organization_id = 87;
No comments:
Post a Comment