select
	a1.LOOKUP_CODE
  , a1.meaning "Lookup Value Meaning"
  , a1.description "Lookup Value Description"
  , a2.lookup_type
  , a2.meaning "Lookup Type Meaning"
  , a2.description "Lookup Type Description"
from
	FND_LOOKUP_VALUES_VL a1
  , fnd_lookup_types_VL  a2
where
	1                            =1
	and upper(a1.lookup_type) like upper('MT COMPONENT LIST')
	and a1.lookup_type           =a2.lookup_type
	and a1.ENABLED_FLAG          = 'Y'
;

-- Descriptive FlexField (DFF) Creation and Query to extract
--Query to fetch DFF Entity name
SELECT
	APPLICATION_TABLE_NAME
  , CONTEXT_COLUMN_NAME
  , TITLE
  , DESCRIPTION
FROM
	fnd_descriptive_flexs_vl
where
	1=1
	-- AND application_table_name='PO_HEADERS_ALL'
;

--Query to fetch all the enabled DFF attributes for a specific entity (ex : PO_HEADERS_ALL)
SELECT
	ffv.descriptive_flexfield_name "DFF Name"
  , ffv.application_table_name "Table Name"
  , ffv.title "Title"
  , ap.application_name "Application"
  , ffc.descriptive_flex_context_code "Context Code"
  , ffc.descriptive_flex_context_name "Context Name"
  , ffc.description "Context Desc"
  , ffc.enabled_flag "Context Enable Flag"
  , att.column_seq_num "Segment Number"
  , att.form_left_prompt "Segment Name"
  , att.application_column_name "Column"
  , fvs.flex_value_set_name "Value Set"
  , att.display_flag "Displayed"
  , att.enabled_flag "Enabled"
  , att.required_flag "Required"
FROM
	fnd_descriptive_flexs_vl    ffv
  , fnd_descr_flex_contexts_vl  ffc
  , fnd_descr_flex_col_usage_vl att
  , fnd_flex_value_sets         fvs
  , fnd_application_vl          ap
WHERE
	ffv.descriptive_flexfield_name        = att.descriptive_flexfield_name
	AND ap.application_id                 =ffv.application_id
	AND ffv.descriptive_flexfield_name    = ffc.descriptive_flexfield_name
	AND ffv.application_id                = ffc.application_id
	AND ffc.descriptive_flex_context_code =att.descriptive_flex_context_code
	AND fvs.flex_value_set_id             =att.flex_value_set_id
	-- AND upper(ffv.descriptive_flexfield_name) = upper('INV_GENERIC_DISPOSITIONS')
	AND upper(ffv.application_table_name) in ('INV_MATERIAL_TXNS','INV_GENERIC_DISPOSITIONS')