|
SELECT
sha.creation_date,
sha.order_number,
rc.customer_name,
sha.TRANSACTIONAL_CURR_CODE currency_code,
sla.line_number,
msi.segment1 item,
sla.ordered_quantity,
sla.shipped_quantity,
sla.cancelled_quantity,
sla.ship_from_org_id warehouse_id
FROM
mtl_system_items_b msi,
oe_order_lines_all sla,
oe_order_headers_all sha,
ar_customers rc
WHERE
sla.header_id = sha.header_id
and msi.inventory_item_id = sla.inventory_item_id
and rc.customer_id = sha.sold_to_org_id --customer_id
and msi.organization_id = nvl(sla.ship_from_org_id,sla.org_id)
and sla.flow_status_code<>'CLOSED'
and msi.segment1='ITEM' |
|