1] FND_FLEX_EXT.GET_COMBINATION_ID:

This API Finds combination_id for given set of key flexfield segment values. Segment values must be input in segments(1) – segments(n_segments) in the order displayed.

It also creates a new combination if it is valid and the flexfield allows dynamic inserts and the combination does not already exist. It commit the transaction soon after calling this function since if a combination is created it will prevent other users creating similar combinations on any flexfield until a commit is issued.

It performs all checks on values including security and cross-validation. Value security rules will be checked for the current user identified in the FND_GLOBAL package.

Generally pass in SYSDATE for validation date. If validation date is null, this function considers expired values valid and checks all cross-validation rules even if they are outdated.

This function returns TRUE if combination valid or FALSE and sets error message using FND_MESSAGE utility on error or if invalid. If this function returns FALSE, use GET_MESSAGE to get the text of the error message in the language of the database, or GET_ENCODED_MESSAGE to get the error message in a language-independent encoded format.

The Combination_id output may be NULL if combination is invalid.

Example: (Tested in R12.1.3)

2] FND_FLEX_EXT.get_ccid:

This API gets combination id for the specified key flexfield segments.It is identical to get_combination_id() except this function takes segment values in a string concatenated by the segment  delimiter for this flexfield, and returns a positive combination id if valid or 0 on error.

3] FND_FLEX_KEYVAL.VALIDATE_SEGS:

These key flexfields server validations API are a low level interface to key flexfields validation.  They are designed to allow access to all the flexfields functionality, and to allow the user to get only the information they need in return.  Because of their generality, these functions are more difficult to use than those in the FND_FLEX_EXT package.  Oracle strongly suggests using the functions in FND_FLEX_EXT package if at all possible.

This function finds combination from given segment values.  Segments are passed in as a concatenated string in increasing order of segment_number (display order).

Various Operations that can be performed are:

  • ‘FIND_COMBINATION’ – Combination must already exist.
  • ‘CREATE_COMBINATION’ – Combination is created if doesn’t exist.
  • ‘CREATE_COMB_NO_AT’ – same as create_combination but does not use an autonomous transaction.
  • ‘CHECK_COMBINATION’ – Checks if combination valid, doesn’t create.
  • ‘DEFAULT_COMBINATION’ – Returns minimal default combination.
  • ‘CHECK_SEGMENTS’ – Validates segments individually.

If validation date is NULL checks all cross-validation rules. It returns TRUE if combination valid or FALSE and sets error message on server if invalid. Use the default values if you do not want any special functionality.

Example: (Tested in R12.1.3)

Related Posts:

6 Comments

  1. k Chebbi

    If you call apps.fnd_flex_keyval.validate_segs in an anonymous pl/sql block, it works perfectly meaning creates the combination if combo does not exist (the way you coded above). But if you call it inside a Function or Prodedure, then call that function/procedure in an anonymous pl/sql block, it’s returning the below error..

    Error: Program error: Please inform your support representative that:

    FLEXFIELDS SERVER-SIDE VALIDATION package reports error:

    SV2.get_keystruct() exception: ORA-00942: table or view does not exist

    Would you know how to fix this?

    1. Dibyajyoti Koch

      As per a note in MOS, the error ‘FLEXFIELDS SERVER-SIDE VALIDATION package reports error’ results when the profile option ‘Flexfields: Validate on Server’ is set to Yes.

      Set the profile option Flexfields: Validate on Server to No and retest.

      If the problem still occurs, then it might be some GRANT issue of the user with the oracle standard tables. Then you may need to take help from your DBAs.

      Hope it helps.

      Thanks

  2. ff

    Hi,
    How to use this in Multi Ledger Instance? Is there any way to get Name Dynamically?
    —-
    SELECT id_flex_num
    INTO l_structure_num
    FROM apps.fnd_id_flex_structures
    WHERE ID_FLEX_CODE = ‘GL#’
    AND ID_FLEX_STRUCTURE_CODE=;

    Tx

  3. ff

    Hi,
    How to use this in Multi Ledger Instance? Is there any way to get ACCOUNTING_FLEXFIELD Name Dynamically?
    —-
    SELECT id_flex_num
    INTO l_structure_num
    FROM apps.fnd_id_flex_structures
    WHERE ID_FLEX_CODE = ‘GL#’
    AND ID_FLEX_STRUCTURE_CODE= ACCOUNTING_FLEXFIELD;

    Tx

Leave a Reply