Declare
l_application_short_name VARCHAR2 (50);
l_key_flex_code VARCHAR2 (4);
l_structure_number NUMBER;
l_validation_date DATE;
l_combination_id NUMBER;
l_keyval_status BOOLEAN;
l_concat_segments fnd_flex_ext.SegmentArray;
CURSOR cur_syscomb
IS
SELECT segment1
|| '.'
|| segment2
|| '.'
|| segment3
|| '.'
|| segment4
|| '.'
|| segment5
|| '.'
|| segment6
|| '.'
|| segment7
|| '.'
|| segment8 out_combination,
segment1, segment2, segment3, segment4, segment5, segment6, segment7,
segment8
FROM xxgl_code_combinations
WHERE sno=5 and segment1
|| '.'
|| segment2
|| '.'
|| segment3
|| '.'
|| segment4
|| '.'
|| segment5
|| '.'
|| segment6
|| '.'
|| segment7
|| '.'
|| segment8 not IN (
SELECT segment1
|| '.'
|| segment2
|| '.'
|| segment3
|| '.'
|| segment4
|| '.'
|| segment5
|| '.'
|| segment6
|| '.'
|| segment7
|| '.'
|| segment8
FROM gl_code_combinations)
ORDER BY 1;
BEGIN
FND_GLOBAL.apps_initialize (1131,
20434,
101,
0,
-1);
FOR i_cur_outcomb IN cur_syscomb
LOOP
l_application_short_name := 'SQLGL';
l_key_flex_code := 'GL#';
l_structure_number := 50390;
l_validation_date := TO_DATE ('17-MAY-2012', 'DD-MON-YYYY');
--'USA-NY-SAN FRANCISCO-OFFICE1'
l_concat_segments (1) := i_cur_outcomb.segment1;
l_concat_segments (2) := i_cur_outcomb.segment2;
l_concat_segments (3) := i_cur_outcomb.segment3;
l_concat_segments (4) := i_cur_outcomb.segment4;
l_concat_segments (5) := i_cur_outcomb.segment5;
l_concat_segments (6) := i_cur_outcomb.segment6;
l_concat_segments (7) := i_cur_outcomb.segment7;
l_concat_segments (8) := i_cur_outcomb.segment8;
/* l_concat_segments (1) := '11';
l_concat_segments (2) := '111';
l_concat_segments (3) := '511105';
l_concat_segments (4) := '01';
l_concat_segments (5) := '1006';
l_concat_segments (6) := '102';
l_concat_segments (7) := '00000';
l_concat_segments (8) := '0000';*/
/* l_concat_segments (1) := 'USA';
l_concat_segments (2) := 'NY';
l_concat_segments (3) := 'BALA';
l_concat_segments (4) := '1';*/
DBMS_OUTPUT.PUT_LINE ('API Started');
fnd_flex_server1.set_debugging ('6');
DBMS_OUTPUT.PUT_LINE('Delimiter:'
|| fnd_flex_ext.get_delimiter (
l_application_short_name,
l_key_flex_code,
50390
));
IF fnd_flex_ext.get_combination_id (
application_short_name => l_application_short_name,
key_flex_code => l_key_flex_code,
structure_number => 50390,
validation_date => l_validation_date,
n_segments => 8,
segments => l_concat_segments,
combination_id => l_combination_id
)
THEN
DBMS_OUTPUT.PUT_LINE (
'API Combination Created' || l_combination_id
);
ELSE
DBMS_OUTPUT.PUT_LINE (FND_MESSAGE.get);
DBMS_OUTPUT.PUT_LINE (
'API Not Combination Created' || l_combination_id
);
END IF;
END LOOP;
COMMIT;
END ;
No comments :
Post a Comment