GL Trial Balance Report running throws error - APP-FND-00804: Program error: Invalid arguments to the flexfield routines

Error 

APP-FND-00804: Program error: Invalid arguments to the flexfield routines. Please inform your support representative that:
Routine FDFGST unable to find flexfield qualifier 10 <number>. The flexfield routines have been called incorrectly.
Make sure the flexfield qualifiers specified match those defined in the Register Key Flexfield form.

Root Cause of Error

The Segment Numbering in GL Accounting Flexfield Structure (Chart of Accounts) is not consequetive. Each of the segment lines might have been numbered such as 10, 20, 30, 40 and so on.

Oracle Applications requires the segment lines to be in consequentive numbers such as 1, 2, 3 and so on. This is also documented in Oracle Applications Flexfield Guide.

How to Reproduce the Error?

1. Go to General Ledger Responsibility > Reports > Run

2. Select a report by name 'Trial Balance' > parameters > select 'Pagebreak Segment' parameter

3. Error appears

Solution

1. Navigate to General Ledger Responsibility > Setup > Financials > Flexfield > Key > Segments

2. Query flexfield with title 'Accounting Flexfield' associated with 'General Ledger' application

3. Go to the Acconting Structure for your Primary Ledger

4. Uncheck the checkbox 'Freeze Flexfield Definition' > Go to next page by hitting Segments button

5. Now update the values on each of the lines to 1,2,3 and so on. Save it and close the form.

6. Now check the checkbox 'Freeze Flexfield' definition > Hit the Compile Button

7. Rerun the Trial Balance report and issue will be gone

Environment

Oracle E Business Suite R12.1.3+

Oracle Linux OS

GL Journal Posting Program Errors - Unopened repor...
Error while creating Legal Entity - ORA-29273: HTT...