FROM fnd_application_tl
WHERE application_id = FIF.application_id
AND language = Userenv('LANG'))
APPLICATION,
FIF.id_flex_name,
FIFS.id_flex_structure_code,
(SELECT id_flex_structure_name
FROM fnd_id_flex_structures_tl t
WHERE t.id_flex_code = FIF.id_flex_code
AND t.id_flex_num = FIFS.id_flex_num
AND t.language = Userenv('LANG')) Title,
FIFSE.segment_name,
FIFSE.segment_num,
FIFSE.flex_value_set_id,
val.flex_value,
val.flex_value_meaning,
val.value_description,
val.enabled_flag,
val.start_date_active,
val.end_date_active,
val.compiled_value_attributes,
-- Qualifiers
, Decode(Substr(To_char(val.compiled_value_attributes), 1, 1), 'N', 'No', 'Yes') budgeting_allowed,
Decode(Substr(To_char(val.compiled_value_attributes), 3, 1), 'N', 'No', 'Yes') posting_allowed,
(SELECT acct_type_desc2
FROM gl_acct_typ gat
WHERE gat.acct_type_code = Substr(To_char(val.compiled_value_attributes), 5, 1)) account_type,
Decode(Substr(To_char(val.compiled_value_attributes), 7, 1), 'N', 'No', 'Yes') third_party_control,
Decode(Substr(To_char(val.compiled_value_attributes), 9, 1), 'N', 'No', 'Yes') reconcile
FROM fnd_id_flexs FIF,
fnd_id_flex_structures FIFS,
fnd_id_flex_segments FIFSE,
(SELECT ffv.flex_value,
ffvt.flex_value_meaning,
ffvt.description value_description,
ffv.enabled_flag,
ffv.start_date_active,
ffv.end_date_active,
ffvs.flex_value_set_id,
ffv.compiled_value_attributes,
ffvs.flex_value_set_name
FROM fnd_flex_value_sets ffvs,
fnd_flex_values ffv,
fnd_flex_values_tl ffvt
WHERE ffvs.flex_value_set_id = ffv.flex_value_set_id
AND ffv.flex_value_id = ffvt.flex_value_id
AND ffvt.language = Userenv('LANG')
AND ffv.summary_flag = 'N'
AND ffv.enabled_flag = 'Y') Val
WHERE 1 = 1
AND FIF.application_id = FIFS.application_id
AND FIF.id_flex_code = FIFS.id_flex_code
AND FIFSE.application_id = FIF.application_id
AND FIFSE.id_flex_code = FIF.id_flex_code
AND FIFSE.id_flex_num = FIFS.id_flex_num
AND val.flex_value_set_id = FIFSE.flex_value_set_id
AND FIF.id_flex_code LIKE 'GL#'
AND FIF.id_flex_name LIKE 'Accounting Flexfield'
AND FIFS.id_flex_num = 50268 --structure number(ID_FLEX_NUM) i.e. FND_ID_FLEX_STRUCTURES.ID_FLEX_STRUCTURE_CODE: XX_ACCOUNTING_FLEXFIELD
AND FIFSE.segment_name = 'Account'
AND end_date_active IS NULL;
No comments:
Post a Comment