SELECT
MS.MAPPING_SET_CODE MAPPING_SET_CODE
, DECODE(MS.FLEXFIELD_ASSIGN_MODE_CODE, 'S', 'SEGMENT', 'V', 'VALUE SET', 'A', 'FLEXFIELD', 'NA') MAPPING_SET_TYPE
, MS.VALUE_SET_NAME MS_VALUE_SET_NAME
, MS.FLEXFIELD_SEGMENT_NAME MS_FF_SEGMENT_NAME
, MS.FLEX_VALUE_SET_NAME MS_FLEX_VALUE_SET_NAME
, MSV.INPUT_VALUE_CONSTANT INPUT_VALUE
, MSV.INPUT_VALUE_TYPE_CODE INPUT_VALUE_TYPE_CODE
, MSV.VALUE_CONSTANT OUTPUT_VALUE
, DECODE(GCC.SEGMENT1, NULL, NULL, GCC.SEGMENT1 || '.' || SEGMENT2
|| '.' || SEGMENT3 || '.' || SEGMENT4 || '.' || SEGMENT5 || '.' ||
SEGMENT6 || '.' || SEGMENT7) GL_CODE_COMBINATION
, GCC.SEGMENT1
, GCC.SEGMENT2
, GCC.SEGMENT3
, GCC.SEGMENT4
, GCC.SEGMENT5
, GCC.SEGMENT6
, GCC.SEGMENT7
, MSV.EFFECTIVE_DATE_FROM EFFECTIVE_DATE_FROM
, MSV.EFFECTIVE_DATE_TO EFFECTIVE_DATE_TO
, MSV.ENABLED_FLAG ENABLED_FLAG
, MSV.CREATION_DATE CREATION_DATE
, MSV.MAPPING_SET_VALUE_ID MAPPING_SET_VALUE_ID
, CREATEUSER.USER_NAME CREATED_BY
, MSV.LAST_UPDATE_DATE
, UPDATEUSER.USER_NAME LAST_UPDATED_BY
FROM
APPS.XLA_MAPPING_SETS_FVL MS
, XLA.XLA_MAPPING_SET_VALUES MSV
, APPLSYS.FND_USER CREATEUSER
, APPLSYS.FND_USER UPDATEUSER
, GL.GL_CODE_COMBINATIONS GCC
WHERE
MS.MAPPING_SET_CODE = MSV.MAPPING_SET_CODE
AND MSV.CREATED_BY = CREATEUSER.USER_ID
AND MSV.LAST_UPDATED_BY = UPDATEUSER.USER_ID
AND MSV.VALUE_CODE_COMBINATION_ID = GCC.CODE_COMBINATION_ID(+)
AND MSV.ENABLED_FLAG = 'Y'