Friday, 14 June 2013

GL Code Combination Id & Description

1) 
select
gcc.segment1||'.'||gcc.segment2||'.'||gcc.segment3
 ACCOUNT,
A1.DESCRIPTION||'-'||A2.DESCRIPTION ||'-'|| A3.DESCRIPTION  DECS
from
fnd_flex_values_vl A1,
fnd_flex_values_vl A2,
fnd_flex_values_vl A3,
gl_code_combinations gcc
WHERE
a1.flex_value=gcc.segment1 
And a1.FLEX_VALUE_SET_ID in ( select FLEX_VALUE_SET_ID
                            from fnd_id_flex_segments
                           WHERE application_id = 101 AND id_flex_code = 'GL#' and enabled_flag = 'Y' 
                           and application_column_name='SEGMENT1' )
and a2.flex_value=gcc.segment2
And a2.FLEX_VALUE_SET_ID in ( select FLEX_VALUE_SET_ID
                            from fnd_id_flex_segments
                           WHERE application_id = 101 AND id_flex_code = 'GL#' and enabled_flag = 'Y' 
                           and application_column_name='SEGMENT2' )
and a3.flex_value=gcc.segment3
And a3.FLEX_VALUE_SET_ID in ( select FLEX_VALUE_SET_ID
                            from fnd_id_flex_segments
                           WHERE application_id = 101 AND id_flex_code = 'GL#' and enabled_flag = 'Y' 
                           and application_column_name='SEGMENT3' )


2)  ---Only in R12----
select gcc.CONCATENATED_SEGMENTS,
GL_FLEXFIELDS_PKG.get_concat_description( gcc.chart_of_accounts_id, gcc.code_combination_id) acc_description
FROM gl_code_combinations_kfv gcc

No comments:

Post a Comment