What Are Flexfields
Flexfields are Oracle EBS’s mechanism for extending standard tables with customer-specific data without modifying the base schema. Key Flexfields (KFFs) build structured codes like the Accounting Flexfield (chart of accounts), while Descriptive Flexfields (DFFs) add custom attributes to existing entities. Every EBS developer needs to understand how to query and populate flexfield data correctly.
Descriptive Flexfields
DFFs store values in generic ATTRIBUTE columns (ATTRIBUTE1 through ATTRIBUTE15, or more) on the base table. The meaning of each ATTRIBUTE column is defined in the flexfield registration, not in the database schema. To understand what ATTRIBUTE5 means on the PO_HEADERS_ALL table, you must check the DFF setup:
-- Find DFF column meanings for PO Headers
SELECT fdfcu.end_user_column_name AS field_label,
fdfcu.application_column_name AS db_column,
fdfcu.column_seq_num
FROM fnd_descr_flex_col_usage_vl fdfcu
JOIN fnd_descriptive_flexs fdf
ON fdfcu.descriptive_flexfield_name = fdf.descriptive_flexfield_name
AND fdfcu.application_id = fdf.application_id
WHERE fdf.application_table_name = 'PO_HEADERS_ALL'
AND fdfcu.enabled_flag = 'Y'
ORDER BY fdfcu.column_seq_num;
Key Flexfields
KFFs build structured codes from multiple segments. The most common is the Accounting Flexfield which combines Company, Department, Account, and other segments into a single code combination. KFF values are stored in a combinations table (like GL_CODE_COMBINATIONS) and referenced by a CCID (Code Combination ID) in transaction tables:
-- Decode an accounting code combination
SELECT gcc.segment1 AS company,
gcc.segment2 AS department,
gcc.segment3 AS account,
gcc.segment4 AS sub_account,
gcc.concatenated_segments
FROM gl_code_combinations_kfv gcc
WHERE gcc.code_combination_id = :p_ccid;
Querying Flexfields in Reports
When building APEX reports against EBS data, decode flexfield values using the registered value sets rather than displaying raw ATTRIBUTE column values. Join to FND_FLEX_VALUES_VL for value set descriptions. For the accounting flexfield, use the _KFV (Key Flexfield View) suffixed views which pre-join segments with their descriptions.
Populating DFFs Through APIs
When calling EBS APIs, pass DFF values using the ATTRIBUTE columns in the record type. Never insert directly into ATTRIBUTE columns without going through the API, as the API validates against the registered value sets and enforces required and dependent segment rules that direct DML would bypass.