SELECT GCC.code_combination_id
INTO l_ccid
FROM GL_CODE_COMBINATIONS GCC, GL_SETS_OF_BOOKS GSOB
WHERE GCC.code_combination_id = p_ccid
AND GCC.account_type = 'L'
AND GCC.enabled_flag = 'Y'
AND GCC.detail_posting_allowed_flag = 'Y'
AND GSOB.set_of_books_id = p_sob_id
AND GSOB.chart_of_accounts_id = GCC.chart_of_accounts_id
AND nvl(GCC.end_date_active,sysdate+1) > sysdate;
INTO l_ccid
FROM GL_CODE_COMBINATIONS GCC, GL_SETS_OF_BOOKS GSOB
WHERE GCC.code_combination_id = p_ccid
AND GCC.account_type = 'L'
AND GCC.enabled_flag = 'Y'
AND GCC.detail_posting_allowed_flag = 'Y'
AND GSOB.set_of_books_id = p_sob_id
AND GSOB.chart_of_accounts_id = GCC.chart_of_accounts_id
AND nvl(GCC.end_date_active,sysdate+1) > sysdate;