select distinct null C_FLEXDATA,
fnd_flex_xml_publisher_apis.process_kff_combination_1('c_flexfield', 'SQLGL', 'GL#', GLCC.CHART_OF_ACCOUNTS_ID, NULL, GLCC.CODE_COMBINATION_ID, 'ALL', 'Y', 'VALUE') C_Flexfield,
fnd_flex_xml_publisher_apis.process_kff_combination_1('description', 'SQLGL', 'GL#', GLCC.CHART_OF_ACCOUNTS_ID, NULL, GLCC.CODE_COMBINATION_ID, 'GL_ACCOUNT', 'Y', 'FULL_DESCRIPTION') Description
from gl_consolidation_audit GLCA,
gl_code_combinations GLCC
where GLCA.consolidation_id =
to_number(:P_CONSOLIDATION_ID)
--and &P_FLEXDATA1 = &P_FLEXDATA2
and GLCA.to_period_name = :P_PERIOD_NAME
and GLCC.template_id is NULL
and GLCC.chart_of_accounts_id = to_number(:STRUCT_NUM)
and ( glcc.enabled_flag = 'N'
OR ((sign(glcc.start_date_active - sysdate) = 1)
or (sign(glcc.end_date_active - sysdate) = -1)))
and &WHERE_DR_CR_NOT_ZERO
order by 1 |