SQL is used to extract the security rules that are defined in the system.
The parameter is Accounting Flex Structure
SELECT
ffvr.flex_value_rule_name,
ffvr.description,
ffvr.error_message,
DECODE(
ffvrl.include_exclude_indicator,
‘I’,
‘Include’,
‘E’,
‘Exclude’,
ffvrl.include_exclude_indicator
) include_exclude_indicator,
ffvrl.flex_value_low,
ffvrl.flex_value_high
FROM
apps.fnd_flex_value_rules_vl ffvr,
apps.fnd_flex_value_rule_lines ffvrl
WHERE
1 = 1
AND
ffvr.flex_value_rule_id = ffvrl.flex_value_rule_id
AND
ffvr.flex_value_set_id IN (
SELECT
fifsgv.flex_value_set_id
FROM
apps.fnd_id_flex_structures_vl fifstv,
apps.fnd_id_flex_segments_vl fifsgv
WHERE
1 = 1
AND
fifstv.id_flex_num = fifsgv.id_flex_num
AND
fifstv.id_flex_code = fifsgv.id_flex_code
AND
fifstv.id_flex_structure_code = ‘XXGL_COA_ACCOUNT_FLEXFIELD’ — Pass the Accounting Flexfied structure
AND
fifstv.id_flex_code = ‘GL#’
AND
fifsgv.segment_name = ‘Account’ — Accounting Segment Name
)
ORDER BY
ffvr.flex_value_rule_name,
ffvrl.include_exclude_indicator DESC,
ffvrl.flex_value_low,
ffvrl.flex_value_high