Search This Blog

Friday, June 7, 2013

SQL script to find the values of qualifiers of Key Flex Field

Background: 
Run the following SQL query to find the values of segment qualifiers of any Key Flex Field (KFF)

SQL Query:
SELECT fifs.ID_FLEX_STRUCTURE_CODE,
       fsav.APPLICATION_COLUMN_NAME,
       ffsg.SEGMENT_NAME,
       fsav.SEGMENT_ATTRIBUTE_TYPE,
       fsav.ATTRIBUTE_VALUE
  FROM FND_SEGMENT_ATTRIBUTE_VALUES fsav,
       FND_ID_FLEX_STRUCTURES fifs,
       FND_ID_FLEX_SEGMENTS ffsg
 WHERE     fsav.ID_FLEX_NUM = fifs.ID_FLEX_NUM
       AND ffsg.ID_FLEX_NUM = fifs.ID_FLEX_NUM
       AND ffsg.APPLICATION_COLUMN_NAME = fsav.APPLICATION_COLUMN_NAME
       AND fifs.ID_FLEX_STRUCTURE_CODE = '&Flexfield_Code';

More Info:
  • For each Segment you get 6 different rows. ATTRIBUTE_VALUE describes which qualifier is set for the Segment
  • For GL you can get "Flexfield_Code" using below navigation (Accounting Flexfield)                        GL > Setup > Financials > Flexfields > Key > Segments
  • Again different modules have different navigation & this query works for any KFF given Flexfield_Code for the above query.
Meaning of  SEGMENT_ATTRIBUTE_TYPE values:
 FA_COST_CTR                       => Cost Center Segment
GL_ACCOUNT                         => Natural Account Segment
GL_BALANCING                      => Balancing Segment
GL_INTERCOMPANY               => Intercompany Segment
GL_SECONDARY_TRACKING => Secondary Tracking Segment

No comments:

Post a Comment