SELECT b.business_unit , b.req_id ,b.line_nbr ,b.sched_nbr ,b.distrib_line_num ,b.amt_open FROM ps_req_ln_distrib b , ps_req_line_ship c , ps_req_line e , PS_REQ_HDR d WHERE b.business_unit = c.business_unit AND b.req_id = c.req_id AND b.line_nbr = c.line_nbr AND b.sched_nbr = c.sched_nbr AND e.business_unit = b.business_unit AND e.req_id = b.req_id AND e.line_nbr = b.line_nbr AND D.BUSINESS_UNIT = C.BUSINESS_UNIT AND D.REQ_ID = C.REQ_ID AND D.REQ_STATUS IN ('A','PA') AND c.curr_status <> 'X' AND e.curr_status <> 'X' AND B.DISTRIB_LN_STATUS <> 'X' AND (c.DISTRIB_MTHD_FLG = 'A' OR e.AMT_ONLY_FLG = 'Y' ) AND b.amt_open > 0
|