Create CCID
Create CCID
Create CCID
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
Fnd_Flex_Ext.get_combination_id
);
DBMS_OUTPUT.PUT_LINE( ' Combination id ' || v_combination_id );
END;