SELECT O.ROLEUSER , W.BUSINESS_UNIT , P.PLOG_ID , P.VENDOR_ID , V.VENDOR_NAME_SHORT , P.CREATION_DT , SUM(D.SP_BILL_AMOUNT_BSE) , D.CURRENCY_CD_BASE FROM PS_SPF_WORDERREC W , PS_SPA_PLOG_HDR P , PS_SPA_PLOG_DTL D , PS_VENDOR V , PS_SET_CNTRL_GROUP S , PS_ROLEXLATOPR O WHERE W.BUSINESS_UNIT = P.BUSINESS_UNIT AND P.PLOG_ID =D.PLOG_ID AND W.WORK_ORDER_ID = D.WORK_ORDER_ID AND P.PLOG_STATUS IN ('OPN', 'SUB') AND V.VENDOR_ID = W.VENDOR_ID AND W.BUSINESS_UNIT = S.SETCNTRLVALUE AND S.REC_GROUP_ID = 'FS_38' AND S.SETID = V.SETID AND (O.ROLEUSER IN ( SELECT C.OPRID FROM PS_SPA_PL_APR_XREF A , PS_EOAW_STEPINST B , PS_EOAW_USERINST C WHERE A.EOAWDEFN_ID = B.EOAWDEFN_ID AND A.EOAWPRCS_ID = B.EOAWPRCS_ID AND A.EOAWTHREAD_ID = B.EOAWTHREAD_ID AND B.EOAWSTEP_INSTANCE = C.EOAWSTEP_INSTANCE AND A.BUSINESS_UNIT = P.BUSINESS_UNIT AND A.PLOG_ID = P.PLOG_ID)) GROUP BY O.ROLEUSER , W.BUSINESS_UNIT , P.PLOG_ID , P.VENDOR_ID , V.VENDOR_NAME_SHORT ,P.CREATION_DT , D.CURRENCY_CD_BASE
|