R12 – How to Get Chart of Accounts Segment Descriptions
Script:
SELECT GCC.CODE_COMBINATION_ID,
GCC.SEGMENT1,
GCC.SEGMENT2,
GCC.SEGMENT3,
GCC.SEGMENT4,
GCC.SEGMENT5,
GCC.SEGMENT6,
GCC.SEGMENT7,
GCC.SEGMENT8,
SUBSTR (
APPS.GL_FLEXFIELDS_PKG.GET_DESCRIPTION_SQL (
GCC.CHART_OF_ACCOUNTS_ID,
1,
GCC.SEGMENT1),
1,
40)
SEGMENT1_DESC,
SUBSTR (
APPS.GL_FLEXFIELDS_PKG.GET_DESCRIPTION_SQL (
GCC.CHART_OF_ACCOUNTS_ID,
2,
GCC.SEGMENT2),
1,
40)
SEGMENT2_DESC,
DECODE (
GCC.SEGMENT3,
NULL, ”,
SUBSTR (
APPS.GL_FLEXFIELDS_PKG.GET_DESCRIPTION_SQL (
GCC.CHART_OF_ACCOUNTS_ID,
3,
GCC.SEGMENT3),
1,
40))
SEGMENT3_DESC,
DECODE (
GCC.SEGMENT4,
NULL, ”,
SUBSTR (
APPS.GL_FLEXFIELDS_PKG.GET_DESCRIPTION_SQL (
GCC.CHART_OF_ACCOUNTS_ID,
4,
GCC.SEGMENT4),
1,
40))
SEGMENT4_DESC,
DECODE (
GCC.SEGMENT5,
NULL, ”,
SUBSTR (
APPS.GL_FLEXFIELDS_PKG.GET_DESCRIPTION_SQL (
GCC.CHART_OF_ACCOUNTS_ID,
5,
GCC.SEGMENT5),
1,
40))
SEGMENT5_DESC,
DECODE (
GCC.SEGMENT6,
NULL, ”,
SUBSTR (
APPS.GL_FLEXFIELDS_PKG.GET_DESCRIPTION_SQL (
GCC.CHART_OF_ACCOUNTS_ID,
6,
GCC.SEGMENT6),
1,
40))
SEGMENT6_DESC,
DECODE (
GCC.SEGMENT7,
NULL, ”,
SUBSTR (
APPS.GL_FLEXFIELDS_PKG.GET_DESCRIPTION_SQL (
GCC.CHART_OF_ACCOUNTS_ID,
7,
GCC.SEGMENT7),
1,
40))
SEGMENT7_DESC,
DECODE (
GCC.SEGMENT9,
NULL, ”,
SUBSTR (
APPS.GL_FLEXFIELDS_PKG.GET_DESCRIPTION_SQL (
GCC.CHART_OF_ACCOUNTS_ID,
8,
GCC.SEGMENT8),
1,
40))
SEGMENT8_DESC,
GCC.CHART_OF_ACCOUNTS_ID CHART_OF_ACCOUNTS_ID,
GCC.ACCOUNT_TYPE
FROM GL_CODE_COMBINATIONS GCC
WHERE CODE_COMIBINATION_ID = :P_ID
Where: P_ID, you can pass Code Combination Id to get description for particular Accounting Combination.
Leave a Reply
Want to join the discussion?Feel free to contribute!