SELECT DISTINCT A.BUSINESS_UNIT , A.JOURNAL_ID , A.JOURNAL_DATE , A.UNPOST_SEQ FROM PS_KK_BUDGET_HDR A , PS_KK_BUDGET_LN B , PS_BU_LED_GRP_TBL C , PS_KK_SOURCE_HDR E , PS_KK_SOURCE_LN F , PS_KK_ACTIVITY_LOG G WHERE A.BUSINESS_UNIT = B.BUSINESS_UNIT AND A.JOURNAL_ID = B.JOURNAL_ID AND A.JOURNAL_DATE = B.JOURNAL_DATE AND A.UNPOST_SEQ = B.UNPOST_SEQ AND B.EE_PROC_STATUS = 'N' AND A.BUSINESS_UNIT = C.BUSINESS_UNIT AND A.LEDGER_GROUP = C.LEDGER_GROUP AND A.BD_HDR_STATUS IN ('P', 'U') AND E.BUSINESS_UNIT = A.BUSINESS_UNIT AND E.JOURNAL_ID = A.JOURNAL_ID AND E.JOURNAL_DATE = A.JOURNAL_DATE AND E.UNPOST_SEQ = A.UNPOST_SEQ AND E.KK_TRAN_ID = F.KK_TRAN_ID AND E.KK_TRAN_DT = F.KK_TRAN_DT AND F.JOURNAL_LINE = B.JOURNAL_LINE AND F.KK_TRAN_ID = G.KK_TRAN_ID AND F.KK_TRAN_DT = G.KK_TRAN_DT AND F.KK_TRAN_LN = G.KK_TRAN_LN AND G.SEQNBR = 0 AND G.REFERENCED_BUDGET = 'N' AND G.BALANCING_LINE = 'N' AND G.ENTRY_EVENT <> ' ' AND EXISTS ( SELECT 'X' FROM PS_BUL_CNTL_BUD D WHERE C.BUSINESS_UNIT = D.BUSINESS_UNIT AND C.ASSOCIATED_LED_GRP = D.LEDGER_GROUP AND D.KK_LEDGER_GROUP = A.LEDGER_GROUP AND D.EE_GL_BUD IN ('O', 'R'))
|