0% found this document useful (0 votes)
82 views2 pages

Create CCID

The document discusses using an Oracle API called Fnd_Flex_Ext.get_combination_id to check if a combination of code segment values exists and return the existing combination ID, or create a new combination ID if it does not exist. This avoids needing to do duplicate checks. An example is provided showing how to call the API, passing in the required parameters like the segment values in an array, to get the combination ID returned in an out parameter.

Uploaded by

Seppo Mikkonen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
82 views2 pages

Create CCID

The document discusses using an Oracle API called Fnd_Flex_Ext.get_combination_id to check if a combination of code segment values exists and return the existing combination ID, or create a new combination ID if it does not exist. This avoids needing to do duplicate checks. An example is provided showing how to call the API, passing in the required parameters like the segment values in an array, to get the combination ID returned in an out parameter.

Uploaded by

Seppo Mikkonen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

below the script which utilize API to generate CCID's from concatenated segment

values

cc_valid :=
fnd_flex_keyval.validate_segs ('CREATE_COMBINATION',
'SQLGL',
'GL#',
101, -- accounting structure id
sg_compound, -- concatenated segment values
like '101.00000.203.11'
'V',
TO_CHAR (SYSDATE),
'ALL',
NULL,
NULL,
NULL,
NULL,
FALSE,
FALSE,
fnd_global.resp_appl_id (),
fnd_global.resp_id (),
fnd_global.user_id ()
);

IF (cc_valid = FALSE)
THEN
errmsg := 'Error' || fnd_flex_keyval.error_message;
RESULT := errmsg;
ELSE
RESULT := fnd_flex_keyval.combination_id;
END IF;

fnd_file.put_line (fnd_file.log,
'Result: ' || TO_CHAR (RESULT)
);

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Think you can look at using the below API which would check for the existence of
the combination. if exists it would return the Code combination id else it would
create the code combination id. This would help you to avoid any duplicate check
etc.

SET SERVEROUTPUT ON

DECLARE

v_combination_id NUMBER;
vSegmentArray Fnd_Flex_Ext.segmentarray;

BEGIN

-- Assuming for a 6 segment COA


vSegmentArray(1) := < Value for Segment1>;
vSegmentArray(2) := < Value for Segment2>;
vSegmentArray(3) := < Value for Segment3>;
vSegmentArray(4) := < Value for Segment4>;
vSegmentArray(5) := < Value for Segment5>;
vSegmentArray(6) := < Value for Segment6>;

Fnd_Flex_Ext.get_combination_id

(application_short_name => 'SQLGL'


key_flex_code I => ''GL#'' ,

structure_number => <Your Chart of Account id>,


validation_date => SYSDATE,
n_segments => < number of segment used in your
COA>, -- should be 6 as we have assigned 6 segment
segments => vSegmentArray ,
combination_id => v_combination_id ,
-- out variable providing Code combination id, if success would be positive value
data_set => -1

);
DBMS_OUTPUT.PUT_LINE( ' Combination id ' || v_combination_id );

END;

Hope the above helps.

You might also like