p_segment1 IN VARCHAR2
, p_segment2 IN VARCHAR2
, p_segment3 IN VARCHAR2
, p_segment4 IN VARCHAR2
, p_segment5 IN VARCHAR2
, p_def_code_comb_id OUT NUMBER
, p_message OUT VARCHAR2
)
AS
l_application_short_name VARCHAR2 (240);
l_key_flex_code VARCHAR2 (240);
l_structure_num NUMBER;
l_validation_date DATE;
n_segments NUMBER;
segments apps.fnd_flex_ext.segmentarray;
l_combination_id NUMBER;
l_data_set NUMBER;
l_return BOOLEAN;
l_message VARCHAR2 (1000);
BEGIN
l_application_short_name := 'SQLGL';
l_key_flex_code := 'GL#';
SELECT id_flex_num
INTO l_structure_num
FROM apps.fnd_id_flex_structures
WHERE id_flex_code = 'GL#'
AND id_flex_structure_code = 'SPWX_CHART_OF_ACCOUNTS';
l_validation_date := SYSDATE;
n_segments := 6;
segments (1) := p_segment1;
segments (2) := p_segment2;
segments (3) := p_segment3;
segments (4) := p_segment4;
segments (5) := p_segment5;
segments (6) := '000';
l_data_set := NULL;
l_return :=
fnd_flex_ext.get_combination_id
(application_short_name => l_application_short_name
, key_flex_code => l_key_flex_code
, structure_number => l_structure_num
, validation_date => l_validation_date
, n_segments => n_segments
, segments => segments
, combination_id => l_combination_id
, data_set => l_data_set
);
l_message := fnd_flex_ext.GET_MESSAGE;
IF l_return
THEN
debug_msg ('l_Return = TRUE');
debug_msg ( 'COMBINATION_ID = ' || l_combination_id);
p_def_code_comb_id := l_combination_id;
p_message := NULL;
ELSE
debug_msg ( 'Error: ' || l_message);
p_def_code_comb_id := NULL;
p_message := l_message;
END IF;
EXCEPTION WHEN OTHERS THEN
debug_msg ( 'Error: ' || SQLERRM);
p_def_code_comb_id := NULL;
l_message := l_message||'-'||SQLERRM;
END get_costing_segments;
No comments:
Post a Comment