SELECT A.PROCESS_INSTANCE , A.BUSINESS_UNIT , A.RTV_ID , C.RTV_LN_NBR , %Round(SUM(%DecMult(B.MERCHANDISE_AMT, -1)), D.DECIMAL_POSITIONS) FROM PS_RTV_HDR A , PS_RTV_LN_DISTRIB B , PS_RTV_LN C , PS_CURR_TXN_EFF_VW D WHERE A.BUSINESS_UNIT = C.BUSINESS_UNIT AND A.RTV_ID = C.RTV_ID AND C.RETURN_ACTION IN ('C','R','E') AND C.RTV_LN_STATUS <> 'X' AND C.BUSINESS_UNIT = B.BUSINESS_UNIT AND C.RTV_ID = B.RTV_ID AND C.RTV_LN_NBR = B.RTV_LN_NBR AND C.CURRENCY_CD = D.TXN_CURRENCY_CD GROUP BY A.PROCESS_INSTANCE, A.BUSINESS_UNIT, A.RTV_ID, C.RTV_LN_NBR, D.DECIMAL_POSITIONS
|