SELECT DISTINCT a.business_unit , e.oprclass , a.order_no FROM ps_cp_opt_hdr a , PS_ORD_SCHEDULE b , ps_ord_line c , ps_bus_unit_tbl_fs d , ps_sec_bu_cls e , ps_sf_prdnid_headr f WHERE a.mfg_process_flg = 'T' AND a.business_unit = b.business_unit AND b.business_unit = c.business_unit AND c.business_unit = d.business_unit AND d.business_unit = e.business_unit AND f.business_unit = a.business_unit_in AND a.business_unit_in = b.ship_from_bu AND b.ship_from_bu = c.ship_from_bu AND a.order_no = b.order_no AND b.order_no = c.order_no AND a.order_int_line_no = b.order_int_line_no AND b.order_int_line_no = c.order_int_line_no AND a.production_id = f.production_id AND a.production_id <> ' ' AND b.demand_sent = 'Y' AND a.cp_mode = 'S' AND c.ord_line_status = 'O' AND b.lot_alloc_flg = 'N' AND f.prod_status = '50'
|