51: ,p_name in VARCHAR2
52: ,p_description in VARCHAR2
53: ,p_allocation_mode_id in number
54: ) IS
55: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
56: BEGIN
57:
58: /* check p_action */
59: IF p_action NOT IN ('INSERT', 'UPDATE', 'LOCK', 'DELETE') THEN
57:
58: /* check p_action */
59: IF p_action NOT IN ('INSERT', 'UPDATE', 'LOCK', 'DELETE') THEN
60: -- unknown exception
61: RAISE fnd_api.g_exc_unexpected_error;
62: END IF;
63:
64: /* check existence */
65: IF p_action IN ('DELETE','LOCK','UPDATE') THEN
65: IF p_action IN ('DELETE','LOCK','UPDATE') THEN
66: IF check_existence(p_rule_id) THEN
67: fnd_message.set_name('WMS', 'WMS_RULE_NOT_FOUND');
68: fnd_msg_pub.ADD;
69: RAISE fnd_api.g_exc_error;
70: END IF;
71: END IF;
72:
73: /* more input validation update and insert */
79: IF p_enabled_flag NOT IN ('Y', 'N') THEN
80: fnd_message.set_name('WMS', 'WMS_INVALID_ENABLED_FLAG');
81: fnd_message.set_token('FLAG',p_enabled_flag);
82: fnd_msg_pub.ADD;
83: RAISE fnd_api.g_exc_error;
84: END IF;
85:
86: /* validate user_defined_flag */
87: IF p_user_defined_flag NOT IN ('Y', 'N') THEN
87: IF p_user_defined_flag NOT IN ('Y', 'N') THEN
88: fnd_message.set_name('WMS', 'WMS_INVALID_USER_DEFINED_FLAG');
89: fnd_message.set_token('FLAG',p_user_defined_flag);
90: fnd_msg_pub.ADD;
91: RAISE fnd_api.g_exc_error;
92: END IF;
93:
94: /*commented out on 12/6/99 by jcearley, since type code can be > 2*/
95: /* validate type code */
95: /* validate type code */
96: -- IF p_type_code NOT IN (1,2) THEN
97: -- fnd_message.set_name('WMS','WMS_INVALID_PP_TYPE_CODE');
98: -- fnd_msg_pub.ADD;
99: -- RAISE fnd_api.g_exc_error;
100: -- END IF;
101:
102: /* validate qty parameter id */
103: -- IF wms_parameter_form_pkg(p_qty_function_parameter_id) THEN
102: /* validate qty parameter id */
103: -- IF wms_parameter_form_pkg(p_qty_function_parameter_id) THEN
104: -- fnd_message.set_name('WMS','WMS_INVALID_QTY_PARAMETER');
105: -- fnd_msg_pub.ADD;
106: -- RAISE fnd_api.g_exc_error;
107: -- END IF;
108: END IF;
109:
110: /* check that if the rule is in use in a strategy */
112: -- IF p_action = 'DELETE' THEN
113: -- IF wms_strategy_form_pkg.rule_in_used(rule_id) THEN
114: -- fnd_message.set_name('WMS','WMS_RULE_IN_USE');
115: -- fnd_msg_pub.ADD;
116: -- RAISE fnd_api.g_exc_error;
117: -- END IF;
118: -- END IF;
119: x_return_status := l_return_status;
120:
118: -- END IF;
119: x_return_status := l_return_status;
120:
121: EXCEPTION
122: WHEN fnd_api.g_exc_error THEN
123: x_return_status := fnd_api.g_ret_sts_error;
124:
125: WHEN fnd_api.g_exc_unexpected_error THEN
126: x_return_status := fnd_api.g_ret_sts_unexp_error;
119: x_return_status := l_return_status;
120:
121: EXCEPTION
122: WHEN fnd_api.g_exc_error THEN
123: x_return_status := fnd_api.g_ret_sts_error;
124:
125: WHEN fnd_api.g_exc_unexpected_error THEN
126: x_return_status := fnd_api.g_ret_sts_unexp_error;
127:
121: EXCEPTION
122: WHEN fnd_api.g_exc_error THEN
123: x_return_status := fnd_api.g_ret_sts_error;
124:
125: WHEN fnd_api.g_exc_unexpected_error THEN
126: x_return_status := fnd_api.g_ret_sts_unexp_error;
127:
128: WHEN OTHERS THEN
129: x_return_status := fnd_api.g_ret_sts_unexp_error;
122: WHEN fnd_api.g_exc_error THEN
123: x_return_status := fnd_api.g_ret_sts_error;
124:
125: WHEN fnd_api.g_exc_unexpected_error THEN
126: x_return_status := fnd_api.g_ret_sts_unexp_error;
127:
128: WHEN OTHERS THEN
129: x_return_status := fnd_api.g_ret_sts_unexp_error;
130:
125: WHEN fnd_api.g_exc_unexpected_error THEN
126: x_return_status := fnd_api.g_ret_sts_unexp_error;
127:
128: WHEN OTHERS THEN
129: x_return_status := fnd_api.g_ret_sts_unexp_error;
130:
131: END validate_input;
132:
133: procedure insert_rule
162: ,p_name in VARCHAR2
163: ,p_description in VARCHAR2
164: ,p_type_header_id in NUMBER
165: ,p_rule_weight in NUMBER
166: ,p_init_msg_list in varchar2 DEFAULT fnd_api.g_false
167: ,p_validation_level in number DEFAULT fnd_api.g_valid_level_full
168: ,p_allocation_mode_id in number
169: ) IS
170: -- API standard variables
163: ,p_description in VARCHAR2
164: ,p_type_header_id in NUMBER
165: ,p_rule_weight in NUMBER
166: ,p_init_msg_list in varchar2 DEFAULT fnd_api.g_false
167: ,p_validation_level in number DEFAULT fnd_api.g_valid_level_full
168: ,p_allocation_mode_id in number
169: ) IS
170: -- API standard variables
171: l_api_version constant number := 1.0;
169: ) IS
170: -- API standard variables
171: l_api_version constant number := 1.0;
172: l_api_name constant varchar2(30) := 'Insert_Rule';
173: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
174: l_row_id VARCHAR2(20);
175: l_date DATE;
176: l_user_id NUMBER;
177: l_login_id NUMBER;
179: l_rule_id NUMBER;
180: begin
181:
182: -- Standard call to check for call compatibility
183: if not fnd_api.compatible_api_call( l_api_version
184: ,p_api_version
185: ,l_api_name
186: ,g_pkg_name ) then
187: raise fnd_api.g_exc_unexpected_error;
183: if not fnd_api.compatible_api_call( l_api_version
184: ,p_api_version
185: ,l_api_name
186: ,g_pkg_name ) then
187: raise fnd_api.g_exc_unexpected_error;
188: end if;
189:
190: -- Initialize message list if p_init_msg_list is set to TRUE
191: if fnd_api.to_boolean( p_init_msg_list ) then
187: raise fnd_api.g_exc_unexpected_error;
188: end if;
189:
190: -- Initialize message list if p_init_msg_list is set to TRUE
191: if fnd_api.to_boolean( p_init_msg_list ) then
192: fnd_msg_pub.initialize;
193: end if;
194:
195: SELECT wms_rules_s.NEXTVAL INTO l_rule_id FROM dual;
224: ,p_description => p_description
225: ,p_allocation_mode_id => p_allocation_mode_id
226: );
227:
228: if x_return_status = fnd_api.g_ret_sts_unexp_error then
229: raise fnd_api.g_exc_unexpected_error;
230: elsif x_return_status = fnd_api.g_ret_sts_error then
231: raise fnd_api.g_exc_error;
232: end if;
225: ,p_allocation_mode_id => p_allocation_mode_id
226: );
227:
228: if x_return_status = fnd_api.g_ret_sts_unexp_error then
229: raise fnd_api.g_exc_unexpected_error;
230: elsif x_return_status = fnd_api.g_ret_sts_error then
231: raise fnd_api.g_exc_error;
232: end if;
233:
226: );
227:
228: if x_return_status = fnd_api.g_ret_sts_unexp_error then
229: raise fnd_api.g_exc_unexpected_error;
230: elsif x_return_status = fnd_api.g_ret_sts_error then
231: raise fnd_api.g_exc_error;
232: end if;
233:
234: /* get who column information */
227:
228: if x_return_status = fnd_api.g_ret_sts_unexp_error then
229: raise fnd_api.g_exc_unexpected_error;
230: elsif x_return_status = fnd_api.g_ret_sts_error then
231: raise fnd_api.g_exc_error;
232: end if;
233:
234: /* get who column information */
235: SELECT Sysdate INTO l_date FROM dual;
278: x_return_status := l_return_status;
279: x_rule_id := l_rule_id;
280:
281: EXCEPTION
282: when fnd_api.g_exc_error then
283: x_return_status := fnd_api.g_ret_sts_error;
284: fnd_msg_pub.count_and_get( p_count => x_msg_count
285: ,p_data => x_msg_data );
286:
279: x_rule_id := l_rule_id;
280:
281: EXCEPTION
282: when fnd_api.g_exc_error then
283: x_return_status := fnd_api.g_ret_sts_error;
284: fnd_msg_pub.count_and_get( p_count => x_msg_count
285: ,p_data => x_msg_data );
286:
287: when fnd_api.g_exc_unexpected_error then
283: x_return_status := fnd_api.g_ret_sts_error;
284: fnd_msg_pub.count_and_get( p_count => x_msg_count
285: ,p_data => x_msg_data );
286:
287: when fnd_api.g_exc_unexpected_error then
288: x_return_status := fnd_api.g_ret_sts_unexp_error;
289: fnd_msg_pub.count_and_get( p_count => x_msg_count
290: ,p_data => x_msg_data );
291:
284: fnd_msg_pub.count_and_get( p_count => x_msg_count
285: ,p_data => x_msg_data );
286:
287: when fnd_api.g_exc_unexpected_error then
288: x_return_status := fnd_api.g_ret_sts_unexp_error;
289: fnd_msg_pub.count_and_get( p_count => x_msg_count
290: ,p_data => x_msg_data );
291:
292: when others then
289: fnd_msg_pub.count_and_get( p_count => x_msg_count
290: ,p_data => x_msg_data );
291:
292: when others then
293: x_return_status := fnd_api.g_ret_sts_unexp_error;
294: if fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) then
295: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
296: end if;
297: fnd_msg_pub.count_and_get( p_count => x_msg_count
330: p_description in VARCHAR2,
331: p_type_header_id in NUMBER,
332: p_rule_weight in NUMBER,
333: p_api_version in NUMBER,
334: p_init_msg_list in varchar2 DEFAULT fnd_api.g_false,
335: p_validation_level in number DEFAULT fnd_api.g_valid_level_full
336: ,p_allocation_mode_id in number
337: ) is
338: -- API standard variables
331: p_type_header_id in NUMBER,
332: p_rule_weight in NUMBER,
333: p_api_version in NUMBER,
334: p_init_msg_list in varchar2 DEFAULT fnd_api.g_false,
335: p_validation_level in number DEFAULT fnd_api.g_valid_level_full
336: ,p_allocation_mode_id in number
337: ) is
338: -- API standard variables
339: l_api_version constant number := 1.0;
337: ) is
338: -- API standard variables
339: l_api_version constant number := 1.0;
340: l_api_name constant varchar2(30) := 'Lock_Rule';
341: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
342: begin
343: -- Standard call to check for call compatibility
344: if not fnd_api.compatible_api_call( l_api_version
345: ,p_api_version
340: l_api_name constant varchar2(30) := 'Lock_Rule';
341: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
342: begin
343: -- Standard call to check for call compatibility
344: if not fnd_api.compatible_api_call( l_api_version
345: ,p_api_version
346: ,l_api_name
347: ,g_pkg_name ) then
348: raise fnd_api.g_exc_unexpected_error;
344: if not fnd_api.compatible_api_call( l_api_version
345: ,p_api_version
346: ,l_api_name
347: ,g_pkg_name ) then
348: raise fnd_api.g_exc_unexpected_error;
349: end if;
350:
351: -- Initialize message list if p_init_msg_list is set to TRUE
352: if fnd_api.to_boolean( p_init_msg_list ) then
348: raise fnd_api.g_exc_unexpected_error;
349: end if;
350:
351: -- Initialize message list if p_init_msg_list is set to TRUE
352: if fnd_api.to_boolean( p_init_msg_list ) then
353: fnd_msg_pub.initialize;
354: end if;
355:
356: validate_input
383: ,p_description => p_description
384: ,p_allocation_mode_id => p_allocation_mode_id
385: );
386:
387: if x_return_status = fnd_api.g_ret_sts_unexp_error then
388: raise fnd_api.g_exc_unexpected_error;
389: elsif x_return_status = fnd_api.g_ret_sts_error then
390: raise fnd_api.g_exc_error;
391: end if;
384: ,p_allocation_mode_id => p_allocation_mode_id
385: );
386:
387: if x_return_status = fnd_api.g_ret_sts_unexp_error then
388: raise fnd_api.g_exc_unexpected_error;
389: elsif x_return_status = fnd_api.g_ret_sts_error then
390: raise fnd_api.g_exc_error;
391: end if;
392:
385: );
386:
387: if x_return_status = fnd_api.g_ret_sts_unexp_error then
388: raise fnd_api.g_exc_unexpected_error;
389: elsif x_return_status = fnd_api.g_ret_sts_error then
390: raise fnd_api.g_exc_error;
391: end if;
392:
393: wms_rules_pkg.lock_row
386:
387: if x_return_status = fnd_api.g_ret_sts_unexp_error then
388: raise fnd_api.g_exc_unexpected_error;
389: elsif x_return_status = fnd_api.g_ret_sts_error then
390: raise fnd_api.g_exc_error;
391: end if;
392:
393: wms_rules_pkg.lock_row
394: (
427: EXCEPTION
428: WHEN no_data_found THEN
429: fnd_message.set_name('WMS','WMS_RULE_NOT_FOUND');
430: fnd_msg_pub.ADD;
431: x_return_status := fnd_api.g_ret_sts_unexp_error;
432:
433: WHEN OTHERS THEN
434: x_return_status := fnd_api.g_ret_sts_unexp_error;
435: if fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) then
430: fnd_msg_pub.ADD;
431: x_return_status := fnd_api.g_ret_sts_unexp_error;
432:
433: WHEN OTHERS THEN
434: x_return_status := fnd_api.g_ret_sts_unexp_error;
435: if fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) then
436: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
437: end if;
438: fnd_msg_pub.count_and_get( p_count => x_msg_count
474: p_rule_weight in NUMBER,
475: p_last_update_date in DATE,
476: p_last_updated_by in NUMBER,
477: p_last_update_login in NUMBER,
478: p_init_msg_list in varchar2 DEFAULT fnd_api.g_false,
479: p_validation_level in number DEFAULT fnd_api.g_valid_level_full
480: ,p_allocation_mode_id in number
481: ) is
482: -- API standard variables
475: p_last_update_date in DATE,
476: p_last_updated_by in NUMBER,
477: p_last_update_login in NUMBER,
478: p_init_msg_list in varchar2 DEFAULT fnd_api.g_false,
479: p_validation_level in number DEFAULT fnd_api.g_valid_level_full
480: ,p_allocation_mode_id in number
481: ) is
482: -- API standard variables
483: l_api_version constant number := 1.0;
481: ) is
482: -- API standard variables
483: l_api_version constant number := 1.0;
484: l_api_name constant varchar2(30) := 'Update_Rule';
485: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
486: l_row_id VARCHAR2(20);
487: l_date DATE;
488: l_user_id NUMBER;
489: l_login_id NUMBER;
489: l_login_id NUMBER;
490: l_found BOOLEAN;
491: begin
492: -- Standard call to check for call compatibility
493: if not fnd_api.compatible_api_call( l_api_version
494: ,p_api_version
495: ,l_api_name
496: ,g_pkg_name ) then
497: raise fnd_api.g_exc_unexpected_error;
493: if not fnd_api.compatible_api_call( l_api_version
494: ,p_api_version
495: ,l_api_name
496: ,g_pkg_name ) then
497: raise fnd_api.g_exc_unexpected_error;
498: end if;
499:
500: -- Initialize message list if p_init_msg_list is set to TRUE
501: if fnd_api.to_boolean( p_init_msg_list ) then
497: raise fnd_api.g_exc_unexpected_error;
498: end if;
499:
500: -- Initialize message list if p_init_msg_list is set to TRUE
501: if fnd_api.to_boolean( p_init_msg_list ) then
502: fnd_msg_pub.initialize;
503: end if;
504:
505: validate_input
532: ,p_description => p_description
533: ,p_allocation_mode_id => p_allocation_mode_id
534: );
535:
536: if x_return_status = fnd_api.g_ret_sts_unexp_error then
537: raise fnd_api.g_exc_unexpected_error;
538: elsif x_return_status = fnd_api.g_ret_sts_error then
539: raise fnd_api.g_exc_error;
540: end if;
533: ,p_allocation_mode_id => p_allocation_mode_id
534: );
535:
536: if x_return_status = fnd_api.g_ret_sts_unexp_error then
537: raise fnd_api.g_exc_unexpected_error;
538: elsif x_return_status = fnd_api.g_ret_sts_error then
539: raise fnd_api.g_exc_error;
540: end if;
541:
534: );
535:
536: if x_return_status = fnd_api.g_ret_sts_unexp_error then
537: raise fnd_api.g_exc_unexpected_error;
538: elsif x_return_status = fnd_api.g_ret_sts_error then
539: raise fnd_api.g_exc_error;
540: end if;
541:
542: /* get who column information */
535:
536: if x_return_status = fnd_api.g_ret_sts_unexp_error then
537: raise fnd_api.g_exc_unexpected_error;
538: elsif x_return_status = fnd_api.g_ret_sts_error then
539: raise fnd_api.g_exc_error;
540: end if;
541:
542: /* get who column information */
543: SELECT Sysdate INTO l_date FROM dual;
582:
583: x_return_status := l_return_status;
584:
585: EXCEPTION
586: when fnd_api.g_exc_error then
587: x_return_status := fnd_api.g_ret_sts_error;
588: fnd_msg_pub.count_and_get( p_count => x_msg_count
589: ,p_data => x_msg_data );
590:
583: x_return_status := l_return_status;
584:
585: EXCEPTION
586: when fnd_api.g_exc_error then
587: x_return_status := fnd_api.g_ret_sts_error;
588: fnd_msg_pub.count_and_get( p_count => x_msg_count
589: ,p_data => x_msg_data );
590:
591: when fnd_api.g_exc_unexpected_error then
587: x_return_status := fnd_api.g_ret_sts_error;
588: fnd_msg_pub.count_and_get( p_count => x_msg_count
589: ,p_data => x_msg_data );
590:
591: when fnd_api.g_exc_unexpected_error then
592: x_return_status := fnd_api.g_ret_sts_unexp_error;
593: fnd_msg_pub.count_and_get( p_count => x_msg_count
594: ,p_data => x_msg_data );
595:
588: fnd_msg_pub.count_and_get( p_count => x_msg_count
589: ,p_data => x_msg_data );
590:
591: when fnd_api.g_exc_unexpected_error then
592: x_return_status := fnd_api.g_ret_sts_unexp_error;
593: fnd_msg_pub.count_and_get( p_count => x_msg_count
594: ,p_data => x_msg_data );
595:
596: when others then
593: fnd_msg_pub.count_and_get( p_count => x_msg_count
594: ,p_data => x_msg_data );
595:
596: when others then
597: x_return_status := fnd_api.g_ret_sts_unexp_error;
598: if fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) then
599: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
600: end if;
601: fnd_msg_pub.count_and_get( p_count => x_msg_count
609: x_msg_data out NOCOPY VARCHAR2,
610: x_found out NOCOPY BOOLEAN,
611: p_rule_id IN NUMBER,
612: p_api_version in NUMBER,
613: p_init_msg_list in varchar2 DEFAULT fnd_api.g_false,
614: p_validation_level in number DEFAULT fnd_api.g_valid_level_full
615: ) IS
616: -- API standard variables
617: l_api_version constant number := 1.0;
610: x_found out NOCOPY BOOLEAN,
611: p_rule_id IN NUMBER,
612: p_api_version in NUMBER,
613: p_init_msg_list in varchar2 DEFAULT fnd_api.g_false,
614: p_validation_level in number DEFAULT fnd_api.g_valid_level_full
615: ) IS
616: -- API standard variables
617: l_api_version constant number := 1.0;
618: l_api_name constant varchar2(30) := 'Find_Rule';
624:
625: l_dummy VARCHAR2(1);
626: BEGIN
627: -- Standard call to check for call compatibility
628: if not fnd_api.compatible_api_call( l_api_version
629: ,p_api_version
630: ,l_api_name
631: ,g_pkg_name ) then
632: raise fnd_api.g_exc_unexpected_error;
628: if not fnd_api.compatible_api_call( l_api_version
629: ,p_api_version
630: ,l_api_name
631: ,g_pkg_name ) then
632: raise fnd_api.g_exc_unexpected_error;
633: end if;
634:
635: -- Initialize message list if p_init_msg_list is set to TRUE
636: if fnd_api.to_boolean( p_init_msg_list ) then
632: raise fnd_api.g_exc_unexpected_error;
633: end if;
634:
635: -- Initialize message list if p_init_msg_list is set to TRUE
636: if fnd_api.to_boolean( p_init_msg_list ) then
637: fnd_msg_pub.initialize;
638: end if;
639:
640: OPEN l_cur;
647: END IF;
648: CLOSE l_cur;
649:
650: EXCEPTION
651: when fnd_api.g_exc_error then
652: x_return_status := fnd_api.g_ret_sts_error;
653: fnd_msg_pub.count_and_get( p_count => x_msg_count
654: ,p_data => x_msg_data );
655:
648: CLOSE l_cur;
649:
650: EXCEPTION
651: when fnd_api.g_exc_error then
652: x_return_status := fnd_api.g_ret_sts_error;
653: fnd_msg_pub.count_and_get( p_count => x_msg_count
654: ,p_data => x_msg_data );
655:
656: when fnd_api.g_exc_unexpected_error then
652: x_return_status := fnd_api.g_ret_sts_error;
653: fnd_msg_pub.count_and_get( p_count => x_msg_count
654: ,p_data => x_msg_data );
655:
656: when fnd_api.g_exc_unexpected_error then
657: x_return_status := fnd_api.g_ret_sts_unexp_error;
658: fnd_msg_pub.count_and_get( p_count => x_msg_count
659: ,p_data => x_msg_data );
660:
653: fnd_msg_pub.count_and_get( p_count => x_msg_count
654: ,p_data => x_msg_data );
655:
656: when fnd_api.g_exc_unexpected_error then
657: x_return_status := fnd_api.g_ret_sts_unexp_error;
658: fnd_msg_pub.count_and_get( p_count => x_msg_count
659: ,p_data => x_msg_data );
660:
661: when others then
658: fnd_msg_pub.count_and_get( p_count => x_msg_count
659: ,p_data => x_msg_data );
660:
661: when others then
662: x_return_status := fnd_api.g_ret_sts_unexp_error;
663: if fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) then
664: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
665: end if;
666: fnd_msg_pub.count_and_get( p_count => x_msg_count
673: x_msg_count out NOCOPY NUMBER,
674: x_msg_data out NOCOPY VARCHAR2,
675: p_rule_id IN NUMBER,
676: p_api_version in NUMBER,
677: p_init_msg_list in varchar2 DEFAULT fnd_api.g_false,
678: p_validation_level in number DEFAULT fnd_api.g_valid_level_full
679: ) is
680: -- API standard variables
681: l_api_version constant number := 1.0;
674: x_msg_data out NOCOPY VARCHAR2,
675: p_rule_id IN NUMBER,
676: p_api_version in NUMBER,
677: p_init_msg_list in varchar2 DEFAULT fnd_api.g_false,
678: p_validation_level in number DEFAULT fnd_api.g_valid_level_full
679: ) is
680: -- API standard variables
681: l_api_version constant number := 1.0;
682: l_api_name constant varchar2(30) := 'Delete_Rule';
679: ) is
680: -- API standard variables
681: l_api_version constant number := 1.0;
682: l_api_name constant varchar2(30) := 'Delete_Rule';
683: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
684: BEGIN
685:
686: -- Standard call to check for call compatibility
687: if not fnd_api.compatible_api_call( l_api_version
683: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
684: BEGIN
685:
686: -- Standard call to check for call compatibility
687: if not fnd_api.compatible_api_call( l_api_version
688: ,p_api_version
689: ,l_api_name
690: ,g_pkg_name ) then
691: raise fnd_api.g_exc_unexpected_error;
687: if not fnd_api.compatible_api_call( l_api_version
688: ,p_api_version
689: ,l_api_name
690: ,g_pkg_name ) then
691: raise fnd_api.g_exc_unexpected_error;
692: end if;
693:
694: -- Initialize message list if p_init_msg_list is set to TRUE
695: if fnd_api.to_boolean( p_init_msg_list ) then
691: raise fnd_api.g_exc_unexpected_error;
692: end if;
693:
694: -- Initialize message list if p_init_msg_list is set to TRUE
695: if fnd_api.to_boolean( p_init_msg_list ) then
696: fnd_msg_pub.initialize;
697: end if;
698:
699: SAVEPOINT delete_rule_sa;
702: (
703: x_return_status => l_return_status
704: ,p_action => 'DELETE'
705: ,p_rule_id => p_rule_id
706: ,p_organization_id => fnd_api.g_miss_num
707: ,p_type_code => fnd_api.g_miss_num
708: ,p_qty_function_parameter_id => fnd_api.g_miss_num
709: ,p_enabled_flag => fnd_api.g_miss_char
710: ,p_user_defined_flag => fnd_api.g_miss_char
703: x_return_status => l_return_status
704: ,p_action => 'DELETE'
705: ,p_rule_id => p_rule_id
706: ,p_organization_id => fnd_api.g_miss_num
707: ,p_type_code => fnd_api.g_miss_num
708: ,p_qty_function_parameter_id => fnd_api.g_miss_num
709: ,p_enabled_flag => fnd_api.g_miss_char
710: ,p_user_defined_flag => fnd_api.g_miss_char
711: ,p_attribute_category => fnd_api.g_miss_char
704: ,p_action => 'DELETE'
705: ,p_rule_id => p_rule_id
706: ,p_organization_id => fnd_api.g_miss_num
707: ,p_type_code => fnd_api.g_miss_num
708: ,p_qty_function_parameter_id => fnd_api.g_miss_num
709: ,p_enabled_flag => fnd_api.g_miss_char
710: ,p_user_defined_flag => fnd_api.g_miss_char
711: ,p_attribute_category => fnd_api.g_miss_char
712: ,p_attribute1 => fnd_api.g_miss_char
705: ,p_rule_id => p_rule_id
706: ,p_organization_id => fnd_api.g_miss_num
707: ,p_type_code => fnd_api.g_miss_num
708: ,p_qty_function_parameter_id => fnd_api.g_miss_num
709: ,p_enabled_flag => fnd_api.g_miss_char
710: ,p_user_defined_flag => fnd_api.g_miss_char
711: ,p_attribute_category => fnd_api.g_miss_char
712: ,p_attribute1 => fnd_api.g_miss_char
713: ,p_attribute2 => fnd_api.g_miss_char
706: ,p_organization_id => fnd_api.g_miss_num
707: ,p_type_code => fnd_api.g_miss_num
708: ,p_qty_function_parameter_id => fnd_api.g_miss_num
709: ,p_enabled_flag => fnd_api.g_miss_char
710: ,p_user_defined_flag => fnd_api.g_miss_char
711: ,p_attribute_category => fnd_api.g_miss_char
712: ,p_attribute1 => fnd_api.g_miss_char
713: ,p_attribute2 => fnd_api.g_miss_char
714: ,p_attribute3 => fnd_api.g_miss_char
707: ,p_type_code => fnd_api.g_miss_num
708: ,p_qty_function_parameter_id => fnd_api.g_miss_num
709: ,p_enabled_flag => fnd_api.g_miss_char
710: ,p_user_defined_flag => fnd_api.g_miss_char
711: ,p_attribute_category => fnd_api.g_miss_char
712: ,p_attribute1 => fnd_api.g_miss_char
713: ,p_attribute2 => fnd_api.g_miss_char
714: ,p_attribute3 => fnd_api.g_miss_char
715: ,p_attribute4 => fnd_api.g_miss_char
708: ,p_qty_function_parameter_id => fnd_api.g_miss_num
709: ,p_enabled_flag => fnd_api.g_miss_char
710: ,p_user_defined_flag => fnd_api.g_miss_char
711: ,p_attribute_category => fnd_api.g_miss_char
712: ,p_attribute1 => fnd_api.g_miss_char
713: ,p_attribute2 => fnd_api.g_miss_char
714: ,p_attribute3 => fnd_api.g_miss_char
715: ,p_attribute4 => fnd_api.g_miss_char
716: ,p_attribute5 => fnd_api.g_miss_char
709: ,p_enabled_flag => fnd_api.g_miss_char
710: ,p_user_defined_flag => fnd_api.g_miss_char
711: ,p_attribute_category => fnd_api.g_miss_char
712: ,p_attribute1 => fnd_api.g_miss_char
713: ,p_attribute2 => fnd_api.g_miss_char
714: ,p_attribute3 => fnd_api.g_miss_char
715: ,p_attribute4 => fnd_api.g_miss_char
716: ,p_attribute5 => fnd_api.g_miss_char
717: ,p_attribute6 => fnd_api.g_miss_char
710: ,p_user_defined_flag => fnd_api.g_miss_char
711: ,p_attribute_category => fnd_api.g_miss_char
712: ,p_attribute1 => fnd_api.g_miss_char
713: ,p_attribute2 => fnd_api.g_miss_char
714: ,p_attribute3 => fnd_api.g_miss_char
715: ,p_attribute4 => fnd_api.g_miss_char
716: ,p_attribute5 => fnd_api.g_miss_char
717: ,p_attribute6 => fnd_api.g_miss_char
718: ,p_attribute7 => fnd_api.g_miss_char
711: ,p_attribute_category => fnd_api.g_miss_char
712: ,p_attribute1 => fnd_api.g_miss_char
713: ,p_attribute2 => fnd_api.g_miss_char
714: ,p_attribute3 => fnd_api.g_miss_char
715: ,p_attribute4 => fnd_api.g_miss_char
716: ,p_attribute5 => fnd_api.g_miss_char
717: ,p_attribute6 => fnd_api.g_miss_char
718: ,p_attribute7 => fnd_api.g_miss_char
719: ,p_attribute8 => fnd_api.g_miss_char
712: ,p_attribute1 => fnd_api.g_miss_char
713: ,p_attribute2 => fnd_api.g_miss_char
714: ,p_attribute3 => fnd_api.g_miss_char
715: ,p_attribute4 => fnd_api.g_miss_char
716: ,p_attribute5 => fnd_api.g_miss_char
717: ,p_attribute6 => fnd_api.g_miss_char
718: ,p_attribute7 => fnd_api.g_miss_char
719: ,p_attribute8 => fnd_api.g_miss_char
720: ,p_attribute9 => fnd_api.g_miss_char
713: ,p_attribute2 => fnd_api.g_miss_char
714: ,p_attribute3 => fnd_api.g_miss_char
715: ,p_attribute4 => fnd_api.g_miss_char
716: ,p_attribute5 => fnd_api.g_miss_char
717: ,p_attribute6 => fnd_api.g_miss_char
718: ,p_attribute7 => fnd_api.g_miss_char
719: ,p_attribute8 => fnd_api.g_miss_char
720: ,p_attribute9 => fnd_api.g_miss_char
721: ,p_attribute10 => fnd_api.g_miss_char
714: ,p_attribute3 => fnd_api.g_miss_char
715: ,p_attribute4 => fnd_api.g_miss_char
716: ,p_attribute5 => fnd_api.g_miss_char
717: ,p_attribute6 => fnd_api.g_miss_char
718: ,p_attribute7 => fnd_api.g_miss_char
719: ,p_attribute8 => fnd_api.g_miss_char
720: ,p_attribute9 => fnd_api.g_miss_char
721: ,p_attribute10 => fnd_api.g_miss_char
722: ,p_attribute11 => fnd_api.g_miss_char
715: ,p_attribute4 => fnd_api.g_miss_char
716: ,p_attribute5 => fnd_api.g_miss_char
717: ,p_attribute6 => fnd_api.g_miss_char
718: ,p_attribute7 => fnd_api.g_miss_char
719: ,p_attribute8 => fnd_api.g_miss_char
720: ,p_attribute9 => fnd_api.g_miss_char
721: ,p_attribute10 => fnd_api.g_miss_char
722: ,p_attribute11 => fnd_api.g_miss_char
723: ,p_attribute12 => fnd_api.g_miss_char
716: ,p_attribute5 => fnd_api.g_miss_char
717: ,p_attribute6 => fnd_api.g_miss_char
718: ,p_attribute7 => fnd_api.g_miss_char
719: ,p_attribute8 => fnd_api.g_miss_char
720: ,p_attribute9 => fnd_api.g_miss_char
721: ,p_attribute10 => fnd_api.g_miss_char
722: ,p_attribute11 => fnd_api.g_miss_char
723: ,p_attribute12 => fnd_api.g_miss_char
724: ,p_attribute13 => fnd_api.g_miss_char
717: ,p_attribute6 => fnd_api.g_miss_char
718: ,p_attribute7 => fnd_api.g_miss_char
719: ,p_attribute8 => fnd_api.g_miss_char
720: ,p_attribute9 => fnd_api.g_miss_char
721: ,p_attribute10 => fnd_api.g_miss_char
722: ,p_attribute11 => fnd_api.g_miss_char
723: ,p_attribute12 => fnd_api.g_miss_char
724: ,p_attribute13 => fnd_api.g_miss_char
725: ,p_attribute14 => fnd_api.g_miss_char
718: ,p_attribute7 => fnd_api.g_miss_char
719: ,p_attribute8 => fnd_api.g_miss_char
720: ,p_attribute9 => fnd_api.g_miss_char
721: ,p_attribute10 => fnd_api.g_miss_char
722: ,p_attribute11 => fnd_api.g_miss_char
723: ,p_attribute12 => fnd_api.g_miss_char
724: ,p_attribute13 => fnd_api.g_miss_char
725: ,p_attribute14 => fnd_api.g_miss_char
726: ,p_attribute15 => fnd_api.g_miss_char
719: ,p_attribute8 => fnd_api.g_miss_char
720: ,p_attribute9 => fnd_api.g_miss_char
721: ,p_attribute10 => fnd_api.g_miss_char
722: ,p_attribute11 => fnd_api.g_miss_char
723: ,p_attribute12 => fnd_api.g_miss_char
724: ,p_attribute13 => fnd_api.g_miss_char
725: ,p_attribute14 => fnd_api.g_miss_char
726: ,p_attribute15 => fnd_api.g_miss_char
727: ,p_name => fnd_api.g_miss_char
720: ,p_attribute9 => fnd_api.g_miss_char
721: ,p_attribute10 => fnd_api.g_miss_char
722: ,p_attribute11 => fnd_api.g_miss_char
723: ,p_attribute12 => fnd_api.g_miss_char
724: ,p_attribute13 => fnd_api.g_miss_char
725: ,p_attribute14 => fnd_api.g_miss_char
726: ,p_attribute15 => fnd_api.g_miss_char
727: ,p_name => fnd_api.g_miss_char
728: ,p_description => fnd_api.g_miss_char
721: ,p_attribute10 => fnd_api.g_miss_char
722: ,p_attribute11 => fnd_api.g_miss_char
723: ,p_attribute12 => fnd_api.g_miss_char
724: ,p_attribute13 => fnd_api.g_miss_char
725: ,p_attribute14 => fnd_api.g_miss_char
726: ,p_attribute15 => fnd_api.g_miss_char
727: ,p_name => fnd_api.g_miss_char
728: ,p_description => fnd_api.g_miss_char
729: ,p_allocation_mode_id => fnd_api.g_miss_num
722: ,p_attribute11 => fnd_api.g_miss_char
723: ,p_attribute12 => fnd_api.g_miss_char
724: ,p_attribute13 => fnd_api.g_miss_char
725: ,p_attribute14 => fnd_api.g_miss_char
726: ,p_attribute15 => fnd_api.g_miss_char
727: ,p_name => fnd_api.g_miss_char
728: ,p_description => fnd_api.g_miss_char
729: ,p_allocation_mode_id => fnd_api.g_miss_num
730: );
723: ,p_attribute12 => fnd_api.g_miss_char
724: ,p_attribute13 => fnd_api.g_miss_char
725: ,p_attribute14 => fnd_api.g_miss_char
726: ,p_attribute15 => fnd_api.g_miss_char
727: ,p_name => fnd_api.g_miss_char
728: ,p_description => fnd_api.g_miss_char
729: ,p_allocation_mode_id => fnd_api.g_miss_num
730: );
731:
724: ,p_attribute13 => fnd_api.g_miss_char
725: ,p_attribute14 => fnd_api.g_miss_char
726: ,p_attribute15 => fnd_api.g_miss_char
727: ,p_name => fnd_api.g_miss_char
728: ,p_description => fnd_api.g_miss_char
729: ,p_allocation_mode_id => fnd_api.g_miss_num
730: );
731:
732: if x_return_status = fnd_api.g_ret_sts_unexp_error then
725: ,p_attribute14 => fnd_api.g_miss_char
726: ,p_attribute15 => fnd_api.g_miss_char
727: ,p_name => fnd_api.g_miss_char
728: ,p_description => fnd_api.g_miss_char
729: ,p_allocation_mode_id => fnd_api.g_miss_num
730: );
731:
732: if x_return_status = fnd_api.g_ret_sts_unexp_error then
733: raise fnd_api.g_exc_unexpected_error;
728: ,p_description => fnd_api.g_miss_char
729: ,p_allocation_mode_id => fnd_api.g_miss_num
730: );
731:
732: if x_return_status = fnd_api.g_ret_sts_unexp_error then
733: raise fnd_api.g_exc_unexpected_error;
734: elsif x_return_status = fnd_api.g_ret_sts_error then
735: raise fnd_api.g_exc_error;
736: end if;
729: ,p_allocation_mode_id => fnd_api.g_miss_num
730: );
731:
732: if x_return_status = fnd_api.g_ret_sts_unexp_error then
733: raise fnd_api.g_exc_unexpected_error;
734: elsif x_return_status = fnd_api.g_ret_sts_error then
735: raise fnd_api.g_exc_error;
736: end if;
737:
730: );
731:
732: if x_return_status = fnd_api.g_ret_sts_unexp_error then
733: raise fnd_api.g_exc_unexpected_error;
734: elsif x_return_status = fnd_api.g_ret_sts_error then
735: raise fnd_api.g_exc_error;
736: end if;
737:
738: /* special treatment */
731:
732: if x_return_status = fnd_api.g_ret_sts_unexp_error then
733: raise fnd_api.g_exc_unexpected_error;
734: elsif x_return_status = fnd_api.g_ret_sts_error then
735: raise fnd_api.g_exc_error;
736: end if;
737:
738: /* special treatment */
739: /* we want to delete all restrictions and sort criteria records that tie to */
744:
745: x_return_status := l_return_status;
746:
747: EXCEPTION
748: when fnd_api.g_exc_error THEN
749: ROLLBACK TO delete_rule_sa;
750: x_return_status := fnd_api.g_ret_sts_error;
751: fnd_msg_pub.count_and_get( p_count => x_msg_count
752: ,p_data => x_msg_data );
746:
747: EXCEPTION
748: when fnd_api.g_exc_error THEN
749: ROLLBACK TO delete_rule_sa;
750: x_return_status := fnd_api.g_ret_sts_error;
751: fnd_msg_pub.count_and_get( p_count => x_msg_count
752: ,p_data => x_msg_data );
753:
754: when fnd_api.g_exc_unexpected_error then
750: x_return_status := fnd_api.g_ret_sts_error;
751: fnd_msg_pub.count_and_get( p_count => x_msg_count
752: ,p_data => x_msg_data );
753:
754: when fnd_api.g_exc_unexpected_error then
755: ROLLBACK TO delete_rule_sa;
756: x_return_status := fnd_api.g_ret_sts_unexp_error;
757: fnd_msg_pub.count_and_get( p_count => x_msg_count
758: ,p_data => x_msg_data );
752: ,p_data => x_msg_data );
753:
754: when fnd_api.g_exc_unexpected_error then
755: ROLLBACK TO delete_rule_sa;
756: x_return_status := fnd_api.g_ret_sts_unexp_error;
757: fnd_msg_pub.count_and_get( p_count => x_msg_count
758: ,p_data => x_msg_data );
759:
760: WHEN OTHERS THEN
758: ,p_data => x_msg_data );
759:
760: WHEN OTHERS THEN
761: ROLLBACK TO delete_rule_sa;
762: x_return_status := fnd_api.g_ret_sts_unexp_error;
763: if fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) then
764: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
765: end if;
766: fnd_msg_pub.count_and_get( p_count => x_msg_count
781: ,p_new_type_code IN NUMBER
782: ,p_copy_restriction_flag IN VARCHAR2
783: ,p_copy_sort_criteria_flag IN VARCHAR2
784: ,p_api_version in NUMBER
785: ,p_init_msg_list in varchar2 DEFAULT fnd_api.g_false
786: ,p_validation_level in number DEFAULT fnd_api.g_valid_level_full
787: ) IS
788:
789: l_api_version constant number := 1.0;
782: ,p_copy_restriction_flag IN VARCHAR2
783: ,p_copy_sort_criteria_flag IN VARCHAR2
784: ,p_api_version in NUMBER
785: ,p_init_msg_list in varchar2 DEFAULT fnd_api.g_false
786: ,p_validation_level in number DEFAULT fnd_api.g_valid_level_full
787: ) IS
788:
789: l_api_version constant number := 1.0;
790: l_api_name constant varchar2(30) := 'Copy_Rule';
787: ) IS
788:
789: l_api_version constant number := 1.0;
790: l_api_name constant varchar2(30) := 'Copy_Rule';
791: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
792: l_rowid VARCHAR2(2000);
793:
794: l_consistency_id NUMBER;
795: l_date DATE;
925: l_rule_id NUMBER;
926: BEGIN
927:
928: -- Standard call to check for call compatibility
929: if not fnd_api.compatible_api_call( l_api_version
930: ,p_api_version
931: ,l_api_name
932: ,g_pkg_name ) then
933: raise fnd_api.g_exc_unexpected_error;
929: if not fnd_api.compatible_api_call( l_api_version
930: ,p_api_version
931: ,l_api_name
932: ,g_pkg_name ) then
933: raise fnd_api.g_exc_unexpected_error;
934: end if;
935:
936: -- Initialize message list if p_init_msg_list is set to TRUE
937: if fnd_api.to_boolean( p_init_msg_list ) then
933: raise fnd_api.g_exc_unexpected_error;
934: end if;
935:
936: -- Initialize message list if p_init_msg_list is set to TRUE
937: if fnd_api.to_boolean( p_init_msg_list ) then
938: fnd_msg_pub.initialize;
939: end if;
940:
941: SAVEPOINT copy_rule_sp;
945: FETCH l_orig_rule_cur INTO l_rule_rec;
946: IF l_orig_rule_cur%NOTFOUND THEN
947: fnd_message.set_name('WMS','WMS_RULE_NOT_FOUND');
948: fnd_msg_pub.ADD;
949: RAISE fnd_api.g_exc_error;
950: END IF;
951:
952: /* no validation is done here */
953: /* should be added later */
990: ,p_name => l_rule_rec.name
991: ,p_description => l_rule_rec.description
992: ,p_type_header_id => l_rule_rec.type_hdr_id
993: ,p_rule_weight => l_rule_rec.rule_weight
994: ,p_init_msg_list => fnd_api.g_false
995: ,p_validation_level => fnd_api.g_valid_level_full
996: ,p_allocation_mode_id => l_rule_rec.allocation_mode_id
997: );
998: /* changed the x_return_status to l_return_status below as part of bug1678742 */
991: ,p_description => l_rule_rec.description
992: ,p_type_header_id => l_rule_rec.type_hdr_id
993: ,p_rule_weight => l_rule_rec.rule_weight
994: ,p_init_msg_list => fnd_api.g_false
995: ,p_validation_level => fnd_api.g_valid_level_full
996: ,p_allocation_mode_id => l_rule_rec.allocation_mode_id
997: );
998: /* changed the x_return_status to l_return_status below as part of bug1678742 */
999:
996: ,p_allocation_mode_id => l_rule_rec.allocation_mode_id
997: );
998: /* changed the x_return_status to l_return_status below as part of bug1678742 */
999:
1000: if l_return_status = fnd_api.g_ret_sts_unexp_error then
1001: raise fnd_api.g_exc_unexpected_error;
1002: elsif l_return_status = fnd_api.g_ret_sts_error then
1003: raise fnd_api.g_exc_error;
1004: end if;
997: );
998: /* changed the x_return_status to l_return_status below as part of bug1678742 */
999:
1000: if l_return_status = fnd_api.g_ret_sts_unexp_error then
1001: raise fnd_api.g_exc_unexpected_error;
1002: elsif l_return_status = fnd_api.g_ret_sts_error then
1003: raise fnd_api.g_exc_error;
1004: end if;
1005:
998: /* changed the x_return_status to l_return_status below as part of bug1678742 */
999:
1000: if l_return_status = fnd_api.g_ret_sts_unexp_error then
1001: raise fnd_api.g_exc_unexpected_error;
1002: elsif l_return_status = fnd_api.g_ret_sts_error then
1003: raise fnd_api.g_exc_error;
1004: end if;
1005:
1006: CLOSE l_orig_rule_cur;
999:
1000: if l_return_status = fnd_api.g_ret_sts_unexp_error then
1001: raise fnd_api.g_exc_unexpected_error;
1002: elsif l_return_status = fnd_api.g_ret_sts_error then
1003: raise fnd_api.g_exc_error;
1004: end if;
1005:
1006: CLOSE l_orig_rule_cur;
1007:
1015: l_restriction_rec.rule_id := l_rule_id;
1016: wms_restriction_form_pkg.insert_restriction
1017: (
1018: p_api_version => 1.0
1019: ,p_init_msg_list => fnd_api.g_false
1020: ,p_validation_level => fnd_api.g_valid_level_full
1021: ,x_return_status => l_return_status
1022: ,x_msg_count => x_msg_count
1023: ,x_msg_data => x_msg_data
1016: wms_restriction_form_pkg.insert_restriction
1017: (
1018: p_api_version => 1.0
1019: ,p_init_msg_list => fnd_api.g_false
1020: ,p_validation_level => fnd_api.g_valid_level_full
1021: ,x_return_status => l_return_status
1022: ,x_msg_count => x_msg_count
1023: ,x_msg_data => x_msg_data
1024: ,p_rowid => l_rowid
1053: ,p_attribute14 => l_restriction_rec.attribute14
1054: ,p_attribute15 => l_restriction_rec.attribute15
1055: );
1056: /* changed the x_return_status to l_return_status below as part of bug1678742 */
1057: if l_return_status = fnd_api.g_ret_sts_unexp_error then
1058: raise fnd_api.g_exc_unexpected_error;
1059: elsif l_return_status = fnd_api.g_ret_sts_error then
1060: raise fnd_api.g_exc_error;
1061: end if;
1054: ,p_attribute15 => l_restriction_rec.attribute15
1055: );
1056: /* changed the x_return_status to l_return_status below as part of bug1678742 */
1057: if l_return_status = fnd_api.g_ret_sts_unexp_error then
1058: raise fnd_api.g_exc_unexpected_error;
1059: elsif l_return_status = fnd_api.g_ret_sts_error then
1060: raise fnd_api.g_exc_error;
1061: end if;
1062: END LOOP;
1055: );
1056: /* changed the x_return_status to l_return_status below as part of bug1678742 */
1057: if l_return_status = fnd_api.g_ret_sts_unexp_error then
1058: raise fnd_api.g_exc_unexpected_error;
1059: elsif l_return_status = fnd_api.g_ret_sts_error then
1060: raise fnd_api.g_exc_error;
1061: end if;
1062: END LOOP;
1063: CLOSE l_orig_restriction_cur;
1056: /* changed the x_return_status to l_return_status below as part of bug1678742 */
1057: if l_return_status = fnd_api.g_ret_sts_unexp_error then
1058: raise fnd_api.g_exc_unexpected_error;
1059: elsif l_return_status = fnd_api.g_ret_sts_error then
1060: raise fnd_api.g_exc_error;
1061: end if;
1062: END LOOP;
1063: CLOSE l_orig_restriction_cur;
1064: END IF;
1073: l_sort_rec.rule_id := l_rule_id;
1074: wms_sort_criteria_form_pkg.insert_sort_criteria
1075: (
1076: p_api_version => 1.0
1077: ,p_init_msg_list => fnd_api.g_false
1078: ,p_validation_level => fnd_api.g_valid_level_full
1079: ,x_return_status => l_return_status
1080: ,x_msg_count => x_msg_count
1081: ,x_msg_data => x_msg_data
1074: wms_sort_criteria_form_pkg.insert_sort_criteria
1075: (
1076: p_api_version => 1.0
1077: ,p_init_msg_list => fnd_api.g_false
1078: ,p_validation_level => fnd_api.g_valid_level_full
1079: ,x_return_status => l_return_status
1080: ,x_msg_count => x_msg_count
1081: ,x_msg_data => x_msg_data
1082: ,p_rowid => l_rowid
1101: ,p_attribute14 => l_sort_rec.attribute14
1102: ,p_attribute15 => l_sort_rec.attribute15
1103: );
1104: /* changed the x_return_status to l_return_status below as part of bug1678742 */
1105: if l_return_status = fnd_api.g_ret_sts_unexp_error then
1106: raise fnd_api.g_exc_unexpected_error;
1107: elsif l_return_status = fnd_api.g_ret_sts_error then
1108: raise fnd_api.g_exc_error;
1109: end if;
1102: ,p_attribute15 => l_sort_rec.attribute15
1103: );
1104: /* changed the x_return_status to l_return_status below as part of bug1678742 */
1105: if l_return_status = fnd_api.g_ret_sts_unexp_error then
1106: raise fnd_api.g_exc_unexpected_error;
1107: elsif l_return_status = fnd_api.g_ret_sts_error then
1108: raise fnd_api.g_exc_error;
1109: end if;
1110: END LOOP;
1103: );
1104: /* changed the x_return_status to l_return_status below as part of bug1678742 */
1105: if l_return_status = fnd_api.g_ret_sts_unexp_error then
1106: raise fnd_api.g_exc_unexpected_error;
1107: elsif l_return_status = fnd_api.g_ret_sts_error then
1108: raise fnd_api.g_exc_error;
1109: end if;
1110: END LOOP;
1111: CLOSE l_orig_sort_cur;
1104: /* changed the x_return_status to l_return_status below as part of bug1678742 */
1105: if l_return_status = fnd_api.g_ret_sts_unexp_error then
1106: raise fnd_api.g_exc_unexpected_error;
1107: elsif l_return_status = fnd_api.g_ret_sts_error then
1108: raise fnd_api.g_exc_error;
1109: end if;
1110: END LOOP;
1111: CLOSE l_orig_sort_cur;
1112: END IF;
1158: x_new_rule_id := l_rule_id;
1159: x_return_status := l_return_status;
1160:
1161: EXCEPTION
1162: when fnd_api.g_exc_error THEN
1163: ROLLBACK TO copy_rule_sp;
1164: IF l_orig_rule_cur%ISOPEN THEN
1165: CLOSE l_orig_rule_cur;
1166: END IF;
1174: IF l_orig_consistency_cur%ISOPEN THEN
1175: CLOSE l_orig_consistency_cur;
1176: END IF;
1177:
1178: x_return_status := fnd_api.g_ret_sts_error;
1179: fnd_msg_pub.count_and_get( p_count => x_msg_count
1180: ,p_data => x_msg_data );
1181:
1182: when fnd_api.g_exc_unexpected_error then
1178: x_return_status := fnd_api.g_ret_sts_error;
1179: fnd_msg_pub.count_and_get( p_count => x_msg_count
1180: ,p_data => x_msg_data );
1181:
1182: when fnd_api.g_exc_unexpected_error then
1183: ROLLBACK TO copy_rule_sp;
1184: IF l_orig_rule_cur%ISOPEN THEN
1185: CLOSE l_orig_rule_cur;
1186: END IF;
1194: IF l_orig_consistency_cur%ISOPEN THEN
1195: CLOSE l_orig_consistency_cur;
1196: END IF;
1197:
1198: x_return_status := fnd_api.g_ret_sts_unexp_error;
1199: fnd_msg_pub.count_and_get( p_count => x_msg_count
1200: ,p_data => x_msg_data );
1201:
1202: when others then
1214: IF l_orig_consistency_cur%ISOPEN THEN
1215: CLOSE l_orig_consistency_cur;
1216: END IF;
1217:
1218: x_return_status := fnd_api.g_ret_sts_unexp_error;
1219: if fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) then
1220: fnd_msg_pub.add_exc_msg(g_pkg_name, l_api_name);
1221: end if;
1222:
1239: EXCEPTION
1240: WHEN NO_DATA_FOUND THEN
1241: l_exist := 0;
1242: WHEN OTHERS THEN
1243: RAISE fnd_api.g_exc_unexpected_error;
1244: END;
1245:
1246: IF l_exist = 1 THEN
1247: RETURN TRUE;