SQL query to get details of Installed Base (IB) record from Sales Order

 Use the below query


SELECT ooha.order_number,
       ottl.name,
       oola.line_number,
       oola.ordered_item,
       ooha.flow_status_code order_status,
       oola.flow_status_code line_status,
       mtl.comms_nl_trackable_flag, --IB Trackable Flag
       mtl.SHIPPABLE_ITEM_FLAG,
       csi.instance_id
  FROM oe_order_headers_all ooha,
       oe_order_lines_all oola,
       oe_transaction_types_tl ottl,
       mtl_system_items_b mtl,
       csi_item_instances csi
 WHERE     1 = 1
       AND ooha.header_id = oola.header_id
       AND ottl.transaction_type_id = ooha.order_type_id
       AND ottl.language = 'US'
       AND mtl.segment1 = oola.ordered_item
       AND mtl.ORGANIZATION_ID = oola.ship_from_org_id
       AND csi.last_oe_order_line_id(+) = oola.line_id
       AND ooha.order_number = '123';

Comments