Monday, 13 June 2016

GL Chart of Accounts Complete Query - Oracle EBS R12

http://generalledger-gl.blogspot.com/2016/06/gl-chart-of-accounts-complete-query.html

GL Chart of Accounts Complete Query

select *  from  gl_ledgers
select  gl_flexfields_pkg.get_coa_name  (50308)  from   dual
--SELECT *  FROM  FND_ID_FLEXS FF WHERE FF.ID_FLEX_NAME  = 'Accounting Flexfield'

--FLEX Structure

SELECT fs.Id_Flex_Code,FS.ID_FLEX_NUM , FS.ID_FLEX_STRUCTURE_CODE
,FS.CROSS_SEGMENT_VALIDATION_FLAG ,
 FS.ID_FLEX_STRUCTURE_NAME
 FROM FND_ID_FLEX_STRUCTURES_VL FS WHERE FS.ID_FLEX_CODE = 'GL#'
 --SEGMENTS

SELECT SGMNT.ID_FLEX_CODE , SGMNT.ID_FLEX_NUM , SGMNT.APPLICATION_COLUMN_NAME , SGMNT.SEGMENT_NAME ,
SGMNT.SEGMENT_NUM , SGMNT.FLEX_VALUE_SET_ID
 FROM  FND_ID_FLEX_SEGMENTS_VL SGMNT 
 WHERE SGMNT.ID_FLEX_CODE =  'GL#' 
AND  SGMNT.ID_FLEX_NUM = 503

--FLEXFIELD qUALIFIERS

SELECT ffqUAL.Id_Flex_Code , ffqUAL.Id_Flex_Num , ffqUAL.Application_Column_Name , ffqUAL.Segment_Attribute_Type,
ffqUAL.Attribute_Value
FROM FND_SEGMENT_ATTRIBUTE_VALUES ffqUAL   WHERE ID_FLEX_CODE =  'GL#'  AND ID_FLEX_NUM = 50308
AND ffqUAL.Attribute_Value = 'Y'

--Value Sets

SELECT  SGMNT.SEGMENT_NAME ,
SGMNT.SEGMENT_NUM  , vs.flex_value_set_id , vs.flex_value_set_name  
,vs.description
 FROM  FND_ID_FLEX_SEGMENTS_VL SGMNT , FND_FLEX_VALUE_SETS vs
 WHERE SGMNT.ID_FLEX_CODE =  'GL#' 
AND  SGMNT.ID_FLEX_NUM = 503
and    SGMNT.Flex_Value_Set_Id = vs.flex_value_set_id


-- Value Set Values

SELECT   vsvls.flex_value , vsvls.description ,vsvls.ENABLED_FLAG , vsvls.SUMMARY_FLAG , 
vsvls.COMPILED_VALUE_ATTRIBUTES
 FROM  FND_ID_FLEX_SEGMENTS_VL SGMNT , FND_FLEX_VALUES_VL  vsvls
 WHERE SGMNT.ID_FLEX_CODE =  'GL#' 
AND  SGMNT.ID_FLEX_NUM = 503
and  SGMNT.FLEX_VALUE_SET_ID = vsvls.flex_value_set_id
and  SGMNT.SEGMENT_NUM = 4

2 comments: