46: else
47: rec_mgav.ATP_GROUP_ID := INVWATP.GetAtpGroupId;
48: if rec_mgav.ATP_GROUP_ID is null then
49: -- cannot proceed with null atp group id
50: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
51: ret_code := -2;
52: end if;
53: end if;
54:
87: AND p.organization_id = x_organization_id;
88: exception
89: when NO_DATA_FOUND then
90: --No Atp Rule specified
91: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
92: ret_code := -3;
93: when OTHERS then
94: --System Error
95: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
91: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
92: ret_code := -3;
93: when OTHERS then
94: --System Error
95: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
96: ret_code := -1;
97: end;
98: end if;
99: exception
98: end if;
99: exception
100: when NO_DATA_FOUND then
101: --Item not found
102: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
103: ret_code := -4;
104: when OTHERS then
105: --System Error
106: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
102: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
103: ret_code := -4;
104: when OTHERS then
105: --System Error
106: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
107: ret_code := -1;
108: end;
109: end if;
110: --dbms_output.put_line ('Atp Rule id : ' || to_char (rec_mgav.ATP_RULE_ID) );
115: --uom code, takes it from mtl_system_items
116: if x_uom_code is not null then
117: rec_mgav.uom_code := x_uom_code;
118: else
119: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
120: ret_code := -5;
121: /****
122: begin
123: select primary_uom_code
126: where
127: inventory_item_id = x_inventory_item_id and
128: organization_id = x_organization_id;
129: if rec_mgav.uom_code is null then
130: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
131: ret_code := -5;
132: end if;
133: exception
134: when NO_DATA_FOUND then
132: end if;
133: exception
134: when NO_DATA_FOUND then
135: --No UOM code
136: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
137: ret_code := -5;
138: when OTHERS then
139: --System Error
140: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
136: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
137: ret_code := -5;
138: when OTHERS then
139: --System Error
140: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
141: ret_code := -1;
142: end;
143: ***/
144: end if;
157: AND MTL.CALENDAR_CODE is not null
158: AND MTL.CALENDAR_EXCEPTION_SET_ID is not null
159: AND MTL.ORGANIZATION_ID = x_organization_id;
160: if rec_mgav.atp_calendar_organization_id is null then
161: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
162: ret_code := -6;
163: end if;
164: exception
165: when NO_DATA_FOUND then
163: end if;
164: exception
165: when NO_DATA_FOUND then
166: --No Calendar organization
167: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
168: ret_code := -6;
169: when OTHERS then
170: --System Error
171: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
167: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
168: ret_code := -6;
169: when OTHERS then
170: --System Error
171: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
172: ret_code := -1;
173: end;
174:
175: --dbms_output.put_line ('Calendar org id: ' ||
222: ;
223: exception
224: when OTHERS then
225: -- unable to insert
226: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
227: ret_code := -7;
228: end;
229: end if; -- ret_code=0
230:
366: null;
367: elsif retval = 1 then
368: -- timeout
369: --dbms_output.put_line ('Timed out');
370: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
371: elsif retval = 2 then
372: -- no manager
373: --dbms_output.put_line ('No manager');
374: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
370: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
371: elsif retval = 2 then
372: -- no manager
373: --dbms_output.put_line ('No manager');
374: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
375: elsif retval = 3 then
376: -- other
377: --dbms_output.put_line ('Other Error');
378: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
374: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
375: elsif retval = 3 then
376: -- other
377: --dbms_output.put_line ('Other Error');
378: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
379: end if;
380:
381: --dbms_output.put_line ('**************************************');
382: --dbms_output.put_line ('Outcome: ' || mgr_outcome );
420: x_AtpGrpId := INVWATP.GetAtpGroupId;
421:
422: if x_AtpGrpId is null then
423: --Null Atp Group id
424: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
425: ret_code := -2;
426: else
427: begin
428: select
460: n_column2 = x_n_column2;
461: exception
462: when OTHERS then
463: --System Error
464: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
465: ret_code := -1;
466: end;
467: end if;
468:
487: x_AtpGrpId := INVWATP.GetAtpGroupId;
488:
489: if x_AtpGrpId is null then
490: -- null atp group id
491: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
492: ret_code := -2;
493: else
494: begin
495: delete from mtl_group_atps_view
497: atp_group_id = x_AtpGrpId;
498: exception
499: when OTHERS then
500: -- system error
501: fnd_message.set_name ( 'EC', 'ICX_INV_WATP_FAILED');
502: ret_code := -1;
503: end;
504: end if;
505: