Skip to content

Instantly share code, notes, and snippets.

@arbo-hacker
Last active October 12, 2016 17:09
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save arbo-hacker/0cdd8f9fe947d01493486cdae6773463 to your computer and use it in GitHub Desktop.
Obtener desde EBS (GL) los segmentos que están siendo usados para las cuentas contables en Oracle Retail
SELECT st.id_flex_structure_code "Chart of Account Code",
sg.id_flex_num "Chart of Account Num",
sg.segment_name "Segment Name",
sg.application_column_name "Column Name",
sg.flex_value_set_id "Value Set Id",
sg1.application_column_name "Parent Column Name"
FROM apps.fnd_id_flex_structures st
INNER JOIN
apps.fnd_id_flex_segments sg
ON st.application_id = sg.application_id
AND st.id_flex_code = sg.id_flex_code
AND st.id_flex_num = sg.id_flex_num
INNER JOIN
apps.fnd_flex_value_sets vs
ON sg.flex_value_set_id = vs.flex_value_set_id
LEFT OUTER JOIN
apps.fnd_id_flex_segments sg1
ON vs.parent_flex_value_set_id = sg1.flex_value_set_id
AND sg.id_flex_num = sg1.id_flex_num
AND sg.application_id = sg1.application_id
AND sg.id_flex_code = sg1.id_flex_code
WHERE st.application_id = &org_unit_id -- org_unit_id
AND st.id_flex_code = 'GL#'
AND st.enabled_flag = 'Y'
ORDER BY 1, 2, 3;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment