52:
53: Procedure Create_Category_Sets IS
54:
55: p_category_set mtl_category_sets_b.Category_set_ID%TYPE;
56: p_flexfield FND_FLEX_KEY_API.FLEXFIELD_TYPE;
57: p_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
58: v_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
59: l_segment FND_FLEX_KEY_API.segment_type;
60: p_StatCode_Segment FND_FLEX_KEY_API.segment_type;
53: Procedure Create_Category_Sets IS
54:
55: p_category_set mtl_category_sets_b.Category_set_ID%TYPE;
56: p_flexfield FND_FLEX_KEY_API.FLEXFIELD_TYPE;
57: p_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
58: v_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
59: l_segment FND_FLEX_KEY_API.segment_type;
60: p_StatCode_Segment FND_FLEX_KEY_API.segment_type;
61: l_flex_exists Boolean;
54:
55: p_category_set mtl_category_sets_b.Category_set_ID%TYPE;
56: p_flexfield FND_FLEX_KEY_API.FLEXFIELD_TYPE;
57: p_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
58: v_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
59: l_segment FND_FLEX_KEY_API.segment_type;
60: p_StatCode_Segment FND_FLEX_KEY_API.segment_type;
61: l_flex_exists Boolean;
62: l_structure_exists Boolean;
55: p_category_set mtl_category_sets_b.Category_set_ID%TYPE;
56: p_flexfield FND_FLEX_KEY_API.FLEXFIELD_TYPE;
57: p_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
58: v_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
59: l_segment FND_FLEX_KEY_API.segment_type;
60: p_StatCode_Segment FND_FLEX_KEY_API.segment_type;
61: l_flex_exists Boolean;
62: l_structure_exists Boolean;
63: l_segment_exists Boolean;
56: p_flexfield FND_FLEX_KEY_API.FLEXFIELD_TYPE;
57: p_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
58: v_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
59: l_segment FND_FLEX_KEY_API.segment_type;
60: p_StatCode_Segment FND_FLEX_KEY_API.segment_type;
61: l_flex_exists Boolean;
62: l_structure_exists Boolean;
63: l_segment_exists Boolean;
64: p_StatCode_struct FND_FLEX_KEY_API.STRUCTURE_TYPE;
60: p_StatCode_Segment FND_FLEX_KEY_API.segment_type;
61: l_flex_exists Boolean;
62: l_structure_exists Boolean;
63: l_segment_exists Boolean;
64: p_StatCode_struct FND_FLEX_KEY_API.STRUCTURE_TYPE;
65: msg VARCHAR2(1000);
66: l_category_set_id mtl_category_sets_b.Category_set_ID%TYPE;
67:
68: l_structure_id NUMBER;
71: l_next_val NUMBER;
72:
73: Begin
74:
75: fnd_flex_key_api.set_session_mode('seed_data');
76: l_flex_exists:= FALSE;
77:
78: l_flex_exists:= fnd_flex_key_api.flexfield_exists(appl_short_name => 'INV',flex_code => 'MCAT',flex_title => 'Item Categories');
79:
74:
75: fnd_flex_key_api.set_session_mode('seed_data');
76: l_flex_exists:= FALSE;
77:
78: l_flex_exists:= fnd_flex_key_api.flexfield_exists(appl_short_name => 'INV',flex_code => 'MCAT',flex_title => 'Item Categories');
79:
80: If l_flex_exists Then
81: p_flexfield:= fnd_flex_key_api.find_flexfield(appl_short_name => 'INV',flex_code => 'MCAT');
82:
77:
78: l_flex_exists:= fnd_flex_key_api.flexfield_exists(appl_short_name => 'INV',flex_code => 'MCAT',flex_title => 'Item Categories');
79:
80: If l_flex_exists Then
81: p_flexfield:= fnd_flex_key_api.find_flexfield(appl_short_name => 'INV',flex_code => 'MCAT');
82:
83: BEGIN
84: p_StatCode_struct:= fnd_flex_key_api.find_structure(p_flexfield,'STATISTICAL_CODE');
85: l_structure_exists:=TRUE;
80: If l_flex_exists Then
81: p_flexfield:= fnd_flex_key_api.find_flexfield(appl_short_name => 'INV',flex_code => 'MCAT');
82:
83: BEGIN
84: p_StatCode_struct:= fnd_flex_key_api.find_structure(p_flexfield,'STATISTICAL_CODE');
85: l_structure_exists:=TRUE;
86:
87: EXCEPTION
88: WHEN OTHERS THEN
85: l_structure_exists:=TRUE;
86:
87: EXCEPTION
88: WHEN OTHERS THEN
89: msg := 'ERROR: struct not found' || fnd_flex_key_api.message;
90: l_structure_exists:=FALSE;
91: END;
92:
93: IF NOT l_structure_exists THEN
91: END;
92:
93: IF NOT l_structure_exists THEN
94: BEGIN
95: p_StatCode_struct:=fnd_flex_key_api.new_structure(flexfield => p_flexfield,
96: structure_code => 'STATISTICAL_CODE',
97: structure_title => 'Statistical Code',
98: description => 'Statistical Code',
99: view_name => NULL,
106: shorthand_enabled_flag => 'N',
107: shorthand_prompt => NULL,
108: shorthand_length => NULL );
109:
110: fnd_flex_key_api.add_structure(p_flexfield,p_StatCode_struct);
111:
112:
113: BEGIN
114: -- Coded needed to instantiate the Structure
111:
112:
113: BEGIN
114: -- Coded needed to instantiate the Structure
115: p_statcode_struct:= fnd_flex_key_api.find_structure(p_flexfield,'STATISTICAL_CODE');
116: l_structure_exists:=TRUE;
117:
118: EXCEPTION
119: WHEN OTHERS THEN
116: l_structure_exists:=TRUE;
117:
118: EXCEPTION
119: WHEN OTHERS THEN
120: msg := SUBSTR('ERROR: struct not found' || fnd_flex_key_api.message,1,225);
121: END;
122:
123: EXCEPTION
124: WHEN OTHERS THEN
121: END;
122:
123: EXCEPTION
124: WHEN OTHERS THEN
125: msg := substr('ERROR: ' || fnd_flex_key_api.message,1,225);
126: END;
127:
128: END IF;
129:
129:
130: IF l_structure_exists THEN
131:
132: BEGIN
133: p_StatCode_Segment:= fnd_flex_key_api.find_segment(flexfield=> p_flexfield,structure=> p_StatCode_struct,segment_name=>'Code');
134: l_segment_exists:=TRUE;
135: EXCEPTION
136: WHEN OTHERS THEN
137: msg := substr('ERROR: ' || fnd_flex_key_api.message,1,225);
133: p_StatCode_Segment:= fnd_flex_key_api.find_segment(flexfield=> p_flexfield,structure=> p_StatCode_struct,segment_name=>'Code');
134: l_segment_exists:=TRUE;
135: EXCEPTION
136: WHEN OTHERS THEN
137: msg := substr('ERROR: ' || fnd_flex_key_api.message,1,225);
138: l_segment_exists:=FALSE;
139: END;
140:
141: IF NOT l_segment_exists THEN
139: END;
140:
141: IF NOT l_segment_exists THEN
142: BEGIN
143: p_StatCode_Segment:= fnd_flex_key_api.new_segment(flexfield => p_flexfield,
144: structure => p_StatCode_struct,
145: segment_name => 'Code',
146: description => 'Code',
147: column_name => 'SEGMENT1',
164: additional_where_clause => NULL);
165:
166: EXCEPTION
167: WHEN OTHERS THEN
168: msg := SUBSTR('ERROR: ' || fnd_flex_key_api.message,1,225);
169: END;
170:
171: BEGIN
172: fnd_flex_key_api.add_segment(p_flexfield,p_StatCode_struct,p_StatCode_Segment);
168: msg := SUBSTR('ERROR: ' || fnd_flex_key_api.message,1,225);
169: END;
170:
171: BEGIN
172: fnd_flex_key_api.add_segment(p_flexfield,p_StatCode_struct,p_StatCode_Segment);
173: l_segment_exists:=TRUE;
174: EXCEPTION
175: WHEN OTHERS THEN
176: msg := SUBSTR('ERROR: ' || fnd_flex_key_api.message,1,225);
172: fnd_flex_key_api.add_segment(p_flexfield,p_StatCode_struct,p_StatCode_Segment);
173: l_segment_exists:=TRUE;
174: EXCEPTION
175: WHEN OTHERS THEN
176: msg := SUBSTR('ERROR: ' || fnd_flex_key_api.message,1,225);
177: l_segment_exists:=FALSE;
178: END;
179: END IF;
180:
242: p_category_set_desc IN VARCHAR2 )
243: IS
244:
245: p_category_set mtl_category_sets_b.Category_set_ID%TYPE;
246: p_flexfield FND_FLEX_KEY_API.FLEXFIELD_TYPE;
247: p_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
248: v_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
249: l_segment FND_FLEX_KEY_API.segment_type;
250: p_StatCode_Segment FND_FLEX_KEY_API.segment_type;
243: IS
244:
245: p_category_set mtl_category_sets_b.Category_set_ID%TYPE;
246: p_flexfield FND_FLEX_KEY_API.FLEXFIELD_TYPE;
247: p_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
248: v_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
249: l_segment FND_FLEX_KEY_API.segment_type;
250: p_StatCode_Segment FND_FLEX_KEY_API.segment_type;
251: l_flex_exists Boolean;
244:
245: p_category_set mtl_category_sets_b.Category_set_ID%TYPE;
246: p_flexfield FND_FLEX_KEY_API.FLEXFIELD_TYPE;
247: p_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
248: v_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
249: l_segment FND_FLEX_KEY_API.segment_type;
250: p_StatCode_Segment FND_FLEX_KEY_API.segment_type;
251: l_flex_exists Boolean;
252: l_structure_exists Boolean;
245: p_category_set mtl_category_sets_b.Category_set_ID%TYPE;
246: p_flexfield FND_FLEX_KEY_API.FLEXFIELD_TYPE;
247: p_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
248: v_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
249: l_segment FND_FLEX_KEY_API.segment_type;
250: p_StatCode_Segment FND_FLEX_KEY_API.segment_type;
251: l_flex_exists Boolean;
252: l_structure_exists Boolean;
253: l_segment_exists Boolean;
246: p_flexfield FND_FLEX_KEY_API.FLEXFIELD_TYPE;
247: p_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
248: v_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
249: l_segment FND_FLEX_KEY_API.segment_type;
250: p_StatCode_Segment FND_FLEX_KEY_API.segment_type;
251: l_flex_exists Boolean;
252: l_structure_exists Boolean;
253: l_segment_exists Boolean;
254: p_StatCode_struct FND_FLEX_KEY_API.STRUCTURE_TYPE;
250: p_StatCode_Segment FND_FLEX_KEY_API.segment_type;
251: l_flex_exists Boolean;
252: l_structure_exists Boolean;
253: l_segment_exists Boolean;
254: p_StatCode_struct FND_FLEX_KEY_API.STRUCTURE_TYPE;
255: msg VARCHAR2(1000);
256: l_category_set_id mtl_category_sets_b.Category_set_ID%TYPE;
257:
258: l_structure_id NUMBER;
262: l_count NUMBER;
263:
264: Begin
265:
266: fnd_flex_key_api.set_session_mode('seed_data');
267: l_flex_exists:= FALSE;
268:
269: l_flex_exists:= fnd_flex_key_api.flexfield_exists(appl_short_name => 'INV',flex_code => 'MCAT',flex_title => 'Item Categories');
270:
265:
266: fnd_flex_key_api.set_session_mode('seed_data');
267: l_flex_exists:= FALSE;
268:
269: l_flex_exists:= fnd_flex_key_api.flexfield_exists(appl_short_name => 'INV',flex_code => 'MCAT',flex_title => 'Item Categories');
270:
271: If l_flex_exists Then
272: p_flexfield:= fnd_flex_key_api.find_flexfield(appl_short_name => 'INV',flex_code => 'MCAT');
273:
268:
269: l_flex_exists:= fnd_flex_key_api.flexfield_exists(appl_short_name => 'INV',flex_code => 'MCAT',flex_title => 'Item Categories');
270:
271: If l_flex_exists Then
272: p_flexfield:= fnd_flex_key_api.find_flexfield(appl_short_name => 'INV',flex_code => 'MCAT');
273:
274: BEGIN
275: p_StatCode_struct:= fnd_flex_key_api.find_structure(p_flexfield,p_structure_code);
276: l_structure_exists:=TRUE;
271: If l_flex_exists Then
272: p_flexfield:= fnd_flex_key_api.find_flexfield(appl_short_name => 'INV',flex_code => 'MCAT');
273:
274: BEGIN
275: p_StatCode_struct:= fnd_flex_key_api.find_structure(p_flexfield,p_structure_code);
276: l_structure_exists:=TRUE;
277:
278: EXCEPTION
279: WHEN OTHERS THEN
276: l_structure_exists:=TRUE;
277:
278: EXCEPTION
279: WHEN OTHERS THEN
280: msg := 'ERROR: struct not found' || fnd_flex_key_api.message;
281: l_structure_exists:=FALSE;
282: END;
283:
284: IF NOT l_structure_exists THEN
282: END;
283:
284: IF NOT l_structure_exists THEN
285: BEGIN
286: p_StatCode_struct:=fnd_flex_key_api.new_structure(flexfield => p_flexfield,
287: structure_code => p_structure_code,
288: structure_title => p_structure_desc,
289: description => p_structure_desc,
290: view_name => NULL,
297: shorthand_enabled_flag => 'N',
298: shorthand_prompt => NULL,
299: shorthand_length => NULL );
300:
301: fnd_flex_key_api.add_structure(p_flexfield,p_StatCode_struct);
302:
303:
304: BEGIN
305: -- Code needed to instantiate the Structure
302:
303:
304: BEGIN
305: -- Code needed to instantiate the Structure
306: p_statcode_struct:= fnd_flex_key_api.find_structure(p_flexfield,p_structure_code);
307: l_structure_exists:=TRUE;
308:
309: EXCEPTION
310: WHEN OTHERS THEN
307: l_structure_exists:=TRUE;
308:
309: EXCEPTION
310: WHEN OTHERS THEN
311: msg := SUBSTR('ERROR: struct not found' || fnd_flex_key_api.message,1,225);
312: END;
313:
314: EXCEPTION
315: WHEN OTHERS THEN
312: END;
313:
314: EXCEPTION
315: WHEN OTHERS THEN
316: msg := substr('ERROR: ' || fnd_flex_key_api.message,1,225);
317: END;
318:
319: END IF;
320:
320:
321: IF l_structure_exists THEN
322:
323: BEGIN
324: p_StatCode_Segment:= fnd_flex_key_api.find_segment(flexfield=> p_flexfield,structure=> p_StatCode_struct,segment_name=>'Code');
325: l_segment_exists:=TRUE;
326: EXCEPTION
327: WHEN OTHERS THEN
328: msg := substr('ERROR: ' || fnd_flex_key_api.message,1,225);
324: p_StatCode_Segment:= fnd_flex_key_api.find_segment(flexfield=> p_flexfield,structure=> p_StatCode_struct,segment_name=>'Code');
325: l_segment_exists:=TRUE;
326: EXCEPTION
327: WHEN OTHERS THEN
328: msg := substr('ERROR: ' || fnd_flex_key_api.message,1,225);
329: l_segment_exists:=FALSE;
330: END;
331:
332: IF NOT l_segment_exists THEN
330: END;
331:
332: IF NOT l_segment_exists THEN
333: BEGIN
334: p_StatCode_Segment:= fnd_flex_key_api.new_segment(flexfield => p_flexfield,
335: structure => p_StatCode_struct,
336: segment_name => 'Code',
337: description => 'Code',
338: column_name => 'SEGMENT1',
355: additional_where_clause => NULL);
356:
357: EXCEPTION
358: WHEN OTHERS THEN
359: msg := SUBSTR('ERROR: ' || fnd_flex_key_api.message,1,225);
360: END;
361:
362: BEGIN
363: fnd_flex_key_api.add_segment(p_flexfield,p_StatCode_struct,p_StatCode_Segment);
359: msg := SUBSTR('ERROR: ' || fnd_flex_key_api.message,1,225);
360: END;
361:
362: BEGIN
363: fnd_flex_key_api.add_segment(p_flexfield,p_StatCode_struct,p_StatCode_Segment);
364: l_segment_exists:=TRUE;
365: EXCEPTION
366: WHEN OTHERS THEN
367: msg := SUBSTR('ERROR: ' || fnd_flex_key_api.message,1,225);
363: fnd_flex_key_api.add_segment(p_flexfield,p_StatCode_struct,p_StatCode_Segment);
364: l_segment_exists:=TRUE;
365: EXCEPTION
366: WHEN OTHERS THEN
367: msg := SUBSTR('ERROR: ' || fnd_flex_key_api.message,1,225);
368: l_segment_exists:=FALSE;
369: END;
370: END IF;
371:
650: +===========================================================================*/
651:
652: PROCEDURE MTL_SYSTEM_ITEMS IS
653:
654: p_flexfield FND_FLEX_KEY_API.FLEXFIELD_TYPE;
655:
656: l_structure_id mtl_category_sets_b.structure_id%TYPE;
657: l_category_status VARCHAR2(200);
658: l_category_set mtl_category_sets_b.Category_set_ID%TYPE;
1078:
1079: l_LANGUAGE zx_fc_types_tl.language%type;
1080: l_fc_id zx_fc_codes_b.classification_id%type;
1081: p_category_set mtl_category_sets_vl.Category_set_ID%TYPE;
1082: p_flexfield FND_FLEX_KEY_API.FLEXFIELD_TYPE;
1083: p_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
1084: v_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
1085: v_classification_code zx_fc_codes_b.classification_code%type;
1086: v_classification_name zx_fc_codes_tl.classification_name%type;
1079: l_LANGUAGE zx_fc_types_tl.language%type;
1080: l_fc_id zx_fc_codes_b.classification_id%type;
1081: p_category_set mtl_category_sets_vl.Category_set_ID%TYPE;
1082: p_flexfield FND_FLEX_KEY_API.FLEXFIELD_TYPE;
1083: p_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
1084: v_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
1085: v_classification_code zx_fc_codes_b.classification_code%type;
1086: v_classification_name zx_fc_codes_tl.classification_name%type;
1087: v_effective_from date;
1080: l_fc_id zx_fc_codes_b.classification_id%type;
1081: p_category_set mtl_category_sets_vl.Category_set_ID%TYPE;
1082: p_flexfield FND_FLEX_KEY_API.FLEXFIELD_TYPE;
1083: p_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
1084: v_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
1085: v_classification_code zx_fc_codes_b.classification_code%type;
1086: v_classification_name zx_fc_codes_tl.classification_name%type;
1087: v_effective_from date;
1088: v_effective_to date;
4820: END CREATE_SEEDED_FC_TYPES;
4821:
4822:
4823: PROCEDURE OKL_MIGRATION IS
4824: p_flexfield FND_FLEX_KEY_API.FLEXFIELD_TYPE;
4825: l_structure_id mtl_category_sets_b.structure_id%TYPE;
4826: l_category_status VARCHAR2(200);
4827: l_category_set mtl_category_sets_b.Category_set_ID%TYPE;
4828: l_Inventory_Category_Set mtl_category_sets_vl.Category_set_ID%TYPE;
4841: -- l_errorcode number;
4842: -- l_msg_count number;
4843: -- l_MSG_DATA varchar2(200);
4844: p_category_set mtl_category_sets_b.Category_set_ID%TYPE;
4845: p_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
4846: l_segment FND_FLEX_KEY_API.segment_type;
4847: p_StatCode_Segment FND_FLEX_KEY_API.segment_type;
4848: p_StatCode_Segmentnew FND_FLEX_KEY_API.segment_type;
4849: l_flex_exists Boolean;
4842: -- l_msg_count number;
4843: -- l_MSG_DATA varchar2(200);
4844: p_category_set mtl_category_sets_b.Category_set_ID%TYPE;
4845: p_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
4846: l_segment FND_FLEX_KEY_API.segment_type;
4847: p_StatCode_Segment FND_FLEX_KEY_API.segment_type;
4848: p_StatCode_Segmentnew FND_FLEX_KEY_API.segment_type;
4849: l_flex_exists Boolean;
4850: l_structure_exists Boolean;
4843: -- l_MSG_DATA varchar2(200);
4844: p_category_set mtl_category_sets_b.Category_set_ID%TYPE;
4845: p_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
4846: l_segment FND_FLEX_KEY_API.segment_type;
4847: p_StatCode_Segment FND_FLEX_KEY_API.segment_type;
4848: p_StatCode_Segmentnew FND_FLEX_KEY_API.segment_type;
4849: l_flex_exists Boolean;
4850: l_structure_exists Boolean;
4851: l_segment_exists Boolean;
4844: p_category_set mtl_category_sets_b.Category_set_ID%TYPE;
4845: p_structure_id FND_FLEX_KEY_API.STRUCTURE_TYPE;
4846: l_segment FND_FLEX_KEY_API.segment_type;
4847: p_StatCode_Segment FND_FLEX_KEY_API.segment_type;
4848: p_StatCode_Segmentnew FND_FLEX_KEY_API.segment_type;
4849: l_flex_exists Boolean;
4850: l_structure_exists Boolean;
4851: l_segment_exists Boolean;
4852: p_StatCode_struct FND_FLEX_KEY_API.STRUCTURE_TYPE;
4848: p_StatCode_Segmentnew FND_FLEX_KEY_API.segment_type;
4849: l_flex_exists Boolean;
4850: l_structure_exists Boolean;
4851: l_segment_exists Boolean;
4852: p_StatCode_struct FND_FLEX_KEY_API.STRUCTURE_TYPE;
4853: msg VARCHAR2(1000);
4854: l_category_set_id mtl_category_sets_b.Category_set_ID%TYPE;
4855: -- l_control_level NUMBER;
4856: -- l_row_id VARCHAR2(100);
4917:
4918: -- Disable Lookup Type
4919: -- Change the Flexfield Structure Segment value Set.
4920: BEGIN
4921: fnd_flex_key_api.set_session_mode('seed_data');
4922: l_flex_exists:= FALSE;
4923:
4924: l_flex_exists:= fnd_flex_key_api.flexfield_exists(appl_short_name => 'INV',flex_code => 'MCAT',flex_title => 'Item Categories');
4925:
4920: BEGIN
4921: fnd_flex_key_api.set_session_mode('seed_data');
4922: l_flex_exists:= FALSE;
4923:
4924: l_flex_exists:= fnd_flex_key_api.flexfield_exists(appl_short_name => 'INV',flex_code => 'MCAT',flex_title => 'Item Categories');
4925:
4926: If l_flex_exists Then
4927: p_flexfield:= fnd_flex_key_api.find_flexfield(appl_short_name => 'INV',flex_code => 'MCAT');
4928:
4923:
4924: l_flex_exists:= fnd_flex_key_api.flexfield_exists(appl_short_name => 'INV',flex_code => 'MCAT',flex_title => 'Item Categories');
4925:
4926: If l_flex_exists Then
4927: p_flexfield:= fnd_flex_key_api.find_flexfield(appl_short_name => 'INV',flex_code => 'MCAT');
4928:
4929: BEGIN
4930: p_StatCode_struct:= fnd_flex_key_api.find_structure(p_flexfield,'AR_TAX_PRODUCT_FISCAL_CLASS');
4931: l_structure_exists:=TRUE;
4926: If l_flex_exists Then
4927: p_flexfield:= fnd_flex_key_api.find_flexfield(appl_short_name => 'INV',flex_code => 'MCAT');
4928:
4929: BEGIN
4930: p_StatCode_struct:= fnd_flex_key_api.find_structure(p_flexfield,'AR_TAX_PRODUCT_FISCAL_CLASS');
4931: l_structure_exists:=TRUE;
4932: EXCEPTION
4933: WHEN OTHERS THEN
4934: msg := 'ERROR: struct not found' || fnd_flex_key_api.message;
4930: p_StatCode_struct:= fnd_flex_key_api.find_structure(p_flexfield,'AR_TAX_PRODUCT_FISCAL_CLASS');
4931: l_structure_exists:=TRUE;
4932: EXCEPTION
4933: WHEN OTHERS THEN
4934: msg := 'ERROR: struct not found' || fnd_flex_key_api.message;
4935: l_structure_exists:=FALSE;
4936: END;
4937:
4938: IF l_structure_exists THEN
4937:
4938: IF l_structure_exists THEN
4939: -- find current segment
4940: BEGIN
4941: p_StatCode_Segment:= fnd_flex_key_api.find_segment(flexfield=> p_flexfield,structure=> p_StatCode_struct,segment_name=>'Product Fiscal Classification');
4942: l_segment_exists:=TRUE;
4943: EXCEPTION
4944: WHEN OTHERS THEN
4945: msg := substr('ERROR: ' || fnd_flex_key_api.message,1,225);
4941: p_StatCode_Segment:= fnd_flex_key_api.find_segment(flexfield=> p_flexfield,structure=> p_StatCode_struct,segment_name=>'Product Fiscal Classification');
4942: l_segment_exists:=TRUE;
4943: EXCEPTION
4944: WHEN OTHERS THEN
4945: msg := substr('ERROR: ' || fnd_flex_key_api.message,1,225);
4946: l_segment_exists:=FALSE;
4947: END;
4948:
4949: IF l_segment_exists THEN
4948:
4949: IF l_segment_exists THEN
4950: -- Create new segment wich will replace the definition of current.
4951: BEGIN
4952: p_StatCode_Segment:= fnd_flex_key_api.new_segment(flexfield => p_flexfield,
4953: structure => p_StatCode_struct,
4954: segment_name => 'Product Fiscal Classification',
4955: description => 'Product Fiscal Classification',
4956: column_name => 'SEGMENT1',
4972: additional_where_clause => NULL);
4973:
4974: EXCEPTION
4975: WHEN OTHERS THEN
4976: msg := SUBSTR('ERROR: ' || fnd_flex_key_api.message,1,225);
4977: END;
4978:
4979: BEGIN
4980: -- fnd_flex_key_api.add_segment(p_flexfield,p_StatCode_struct,p_StatCode_Segment);
4976: msg := SUBSTR('ERROR: ' || fnd_flex_key_api.message,1,225);
4977: END;
4978:
4979: BEGIN
4980: -- fnd_flex_key_api.add_segment(p_flexfield,p_StatCode_struct,p_StatCode_Segment);
4981: fnd_flex_key_api.modify_segment(p_flexfield, p_StatCode_struct, p_StatCode_Segment, p_StatCode_Segmentnew);
4982: l_segment_exists:=TRUE;
4983: EXCEPTION
4984: WHEN OTHERS THEN
4977: END;
4978:
4979: BEGIN
4980: -- fnd_flex_key_api.add_segment(p_flexfield,p_StatCode_struct,p_StatCode_Segment);
4981: fnd_flex_key_api.modify_segment(p_flexfield, p_StatCode_struct, p_StatCode_Segment, p_StatCode_Segmentnew);
4982: l_segment_exists:=TRUE;
4983: EXCEPTION
4984: WHEN OTHERS THEN
4985: msg := SUBSTR('ERROR: ' || fnd_flex_key_api.message,1,225);
4981: fnd_flex_key_api.modify_segment(p_flexfield, p_StatCode_struct, p_StatCode_Segment, p_StatCode_Segmentnew);
4982: l_segment_exists:=TRUE;
4983: EXCEPTION
4984: WHEN OTHERS THEN
4985: msg := SUBSTR('ERROR: ' || fnd_flex_key_api.message,1,225);
4986: l_segment_exists:=FALSE;
4987: END;
4988:
4989: END IF; -- Segment