11: -- Bug 14725305 added for dropship project po
12: -- This will just create a new locator for dynamic locator setup.
13: FUNCTION getloc(x_locid OUT NOCOPY NUMBER, p_org_id NUMBER, p_locctrl NUMBER, p_segmentarray fnd_flex_ext.segmentarray) return BOOLEAN is
14: l_nseg NUMBER;
15: l_seglist fnd_flex_key_api.segment_list;
16: l_fftype fnd_flex_key_api.flexfield_type;
17: l_ffstru fnd_flex_key_api.structure_type;
18: l_segment_type fnd_flex_key_api.segment_type;
19: l_locator VARCHAR2(32000);
12: -- This will just create a new locator for dynamic locator setup.
13: FUNCTION getloc(x_locid OUT NOCOPY NUMBER, p_org_id NUMBER, p_locctrl NUMBER, p_segmentarray fnd_flex_ext.segmentarray) return BOOLEAN is
14: l_nseg NUMBER;
15: l_seglist fnd_flex_key_api.segment_list;
16: l_fftype fnd_flex_key_api.flexfield_type;
17: l_ffstru fnd_flex_key_api.structure_type;
18: l_segment_type fnd_flex_key_api.segment_type;
19: l_locator VARCHAR2(32000);
20: l_error_exp VARCHAR2(250);
13: FUNCTION getloc(x_locid OUT NOCOPY NUMBER, p_org_id NUMBER, p_locctrl NUMBER, p_segmentarray fnd_flex_ext.segmentarray) return BOOLEAN is
14: l_nseg NUMBER;
15: l_seglist fnd_flex_key_api.segment_list;
16: l_fftype fnd_flex_key_api.flexfield_type;
17: l_ffstru fnd_flex_key_api.structure_type;
18: l_segment_type fnd_flex_key_api.segment_type;
19: l_locator VARCHAR2(32000);
20: l_error_exp VARCHAR2(250);
21: l_structure_list fnd_flex_key_api.structure_list;
14: l_nseg NUMBER;
15: l_seglist fnd_flex_key_api.segment_list;
16: l_fftype fnd_flex_key_api.flexfield_type;
17: l_ffstru fnd_flex_key_api.structure_type;
18: l_segment_type fnd_flex_key_api.segment_type;
19: l_locator VARCHAR2(32000);
20: l_error_exp VARCHAR2(250);
21: l_structure_list fnd_flex_key_api.structure_list;
22: l_nstru NUMBER;
17: l_ffstru fnd_flex_key_api.structure_type;
18: l_segment_type fnd_flex_key_api.segment_type;
19: l_locator VARCHAR2(32000);
20: l_error_exp VARCHAR2(250);
21: l_structure_list fnd_flex_key_api.structure_list;
22: l_nstru NUMBER;
23: l_index NUMBER;
24: l_locid NUMBER;
25: l_delim VARCHAR2(1);
29: -- Local array to hold the data for getting the cancatenated segment.
30: l_segmentarray fnd_flex_ext.segmentarray;
31: BEGIN
32:
33: fnd_flex_key_api.set_session_mode('seed_data');
34:
35: -- find flex field type
36: l_fftype := fnd_flex_key_api.find_flexfield('INV', 'MTLL');
37:
32:
33: fnd_flex_key_api.set_session_mode('seed_data');
34:
35: -- find flex field type
36: l_fftype := fnd_flex_key_api.find_flexfield('INV', 'MTLL');
37:
38: -- find flex structure type
39: l_ffstru := fnd_flex_key_api.find_structure(l_fftype, 101);
40: -- find segment list for the key flex field
35: -- find flex field type
36: l_fftype := fnd_flex_key_api.find_flexfield('INV', 'MTLL');
37:
38: -- find flex structure type
39: l_ffstru := fnd_flex_key_api.find_structure(l_fftype, 101);
40: -- find segment list for the key flex field
41: fnd_flex_key_api.get_segments(l_fftype, l_ffstru, TRUE, l_nseg, l_seglist);
42:
43: -- find segment delimiter
37:
38: -- find flex structure type
39: l_ffstru := fnd_flex_key_api.find_structure(l_fftype, 101);
40: -- find segment list for the key flex field
41: fnd_flex_key_api.get_segments(l_fftype, l_ffstru, TRUE, l_nseg, l_seglist);
42:
43: -- find segment delimiter
44: l_delim := l_ffstru.segment_separator;
45:
51: -- fetch the corresponding columns from segments array
52: --
53: FOR l_loop IN 1..l_nseg LOOP
54:
55: l_segment_type := fnd_flex_key_api.find_segment(l_fftype, l_ffstru, l_seglist(l_loop));
56: -- Bug Fix#4747090
57: --l_segmentarray contains data in the order flexfield is defined. Used in creating cancatenated segments for validation.
58: l_segmentarray(l_loop) := p_segmentarray(To_number(Substr(l_segment_type.column_name, 8)));
59: END LOOP;
87: if l_val then
88: x_locid := fnd_flex_keyval.combination_id;
89: else
90: x_locid := NULL;
91: l_error_exp := substr(fnd_flex_key_api.message(),1,240);
92: IF (g_asn_debug = 'Y') THEN
93: asn_debug.put_line('Error in getloc : ' || l_error_exp);
94: asn_debug.put_line('Error in getloc : error_segment :' || FND_FLEX_KEYVAL.error_segment);
95: asn_debug.put_line('Error in getloc : error_message :' || FND_FLEX_KEYVAL.error_message);
102: EXCEPTION
103:
104: WHEN OTHERS THEN
105:
106: l_error_exp := substr(fnd_flex_key_api.message(),1,240);
107: IF (g_asn_debug = 'Y') THEN
108: asn_debug.put_line('Error in getloc : ' || l_error_exp);
109: asn_debug.put_line('Error:'||substr(sqlerrm,1,250));
110: END IF;