18: WHERE group_id = p_group_id
19: AND process_status = WIP_CONSTANTS.ERROR
20: AND wip_entity_id = p_wip_entity_id
21: AND organization_id = p_organization_id
22: AND load_type = WIP_JOB_DETAILS.WIP_RES_INSTANCE
23: AND substitution_type= p_substitution_type
24: AND operation_seq_num= p_operation_seq_num
25: AND resource_seq_num = p_resource_seq_num;
26:
49: and wjdi.process_status in (wip_constants.running,
50: wip_constants.warning)
51: and wjdi.wip_entity_id = p_wip_entity_id
52: and wjdi.organization_id = p_organization_id
53: and wjdi.load_type = wip_job_details.wip_res_instance
54: and wjdi.substitution_type = p_substitution_type
55: and wjdi.operation_seq_num = p_operation_seq_num
56: and wjdi.resource_seq_num = p_resource_seq_num /* fix for bug4238691 */
57: and wjdi.substitution_type in
54: and wjdi.substitution_type = p_substitution_type
55: and wjdi.operation_seq_num = p_operation_seq_num
56: and wjdi.resource_seq_num = p_resource_seq_num /* fix for bug4238691 */
57: and wjdi.substitution_type in
58: (wip_job_details.wip_add, wip_job_details.wip_change)
59: and (wjdi.start_date > wjdi.completion_date
60: or exists
61: (select 1
62: from wip_operation_resources wor
80: for l_inv_row in c_invalid_rows loop
81: l_error_exists := true;
82: fnd_message.set_name('WIP', 'WIP_JDI_RI_INVALID_DATES');
83: fnd_message.set_token('INTERFACE', to_char(l_inv_row.interface_id));
84: if(wip_job_details.std_alone = 1) then
85: wip_interface_err_Utils.add_error(p_interface_id => l_inv_row.interface_id,
86: p_text => substr(fnd_message.get,1,500),
87: p_error_type => wip_jdi_utils.msg_error);
88: else
100: and wjdi.process_status in (wip_constants.running,
101: wip_constants.warning)
102: and wjdi.wip_entity_id = p_wip_entity_id
103: and wjdi.organization_id = p_organization_id
104: and wjdi.load_type = wip_job_details.wip_res_instance
105: and wjdi.substitution_type = p_substitution_type
106: and wjdi.operation_seq_num = p_operation_seq_num
107: and wjdi.substitution_type in
108: (wip_job_details.wip_add, wip_job_details.wip_change)
104: and wjdi.load_type = wip_job_details.wip_res_instance
105: and wjdi.substitution_type = p_substitution_type
106: and wjdi.operation_seq_num = p_operation_seq_num
107: and wjdi.substitution_type in
108: (wip_job_details.wip_add, wip_job_details.wip_change)
109: and (wjdi.start_date > wjdi.completion_date
110: or exists
111: (select 1
112: from wip_operation_resources wor
147: and wjdi.process_status in (wip_constants.running,
148: wip_constants.warning)
149: and wjdi.wip_entity_id = p_wip_entity_id
150: and wjdi.organization_id = p_organization_id
151: and wjdi.load_type = wip_job_details.wip_res_instance
152: and wjdi.substitution_type = p_substitution_type
153: and wjdi.operation_seq_num = p_operation_seq_num
154: and wjdi.resource_seq_num = p_resource_seq_num
155: and wjdi.resource_instance_id = p_resource_instance_id
153: and wjdi.operation_seq_num = p_operation_seq_num
154: and wjdi.resource_seq_num = p_resource_seq_num
155: and wjdi.resource_instance_id = p_resource_instance_id
156: and ( wjdi.resource_seq_num is null
157: or (wjdi.substitution_type <> wip_job_details.wip_delete
158: and wjdi.resource_instance_id is null)
159: or (wjdi.substitution_type = wip_job_details.wip_add
160: and wjdi.resource_serial_number is null
161: and p_resource_type = 1 ));
155: and wjdi.resource_instance_id = p_resource_instance_id
156: and ( wjdi.resource_seq_num is null
157: or (wjdi.substitution_type <> wip_job_details.wip_delete
158: and wjdi.resource_instance_id is null)
159: or (wjdi.substitution_type = wip_job_details.wip_add
160: and wjdi.resource_serial_number is null
161: and p_resource_type = 1 ));
162:
163: l_error_exists boolean := false;
166: for l_inv_row in c_invalid_rows loop
167: l_error_exists := true;
168: fnd_message.set_name('WIP', 'WIP_JDI_RES_INST_INFO_MISSING');
169: fnd_message.set_token('INTERFACE', to_char(l_inv_row.interface_id));
170: if(wip_job_details.std_alone = 1) then
171: wip_interface_err_Utils.add_error(p_interface_id => l_inv_row.interface_id,
172: p_text => substr(fnd_message.get,1,500),
173: p_error_type => wip_jdi_utils.msg_error);
174: else
186: and wjdi.process_status in (wip_constants.running,
187: wip_constants.warning)
188: and wjdi.wip_entity_id = p_wip_entity_id
189: and wjdi.organization_id = p_organization_id
190: and wjdi.load_type = wip_job_details.wip_res_instance
191: and wjdi.substitution_type = p_substitution_type
192: and wjdi.operation_seq_num = p_operation_seq_num
193: and ( wjdi.resource_seq_num is null
194: or (wjdi.substitution_type <> wip_job_details.wip_delete
190: and wjdi.load_type = wip_job_details.wip_res_instance
191: and wjdi.substitution_type = p_substitution_type
192: and wjdi.operation_seq_num = p_operation_seq_num
193: and ( wjdi.resource_seq_num is null
194: or (wjdi.substitution_type <> wip_job_details.wip_delete
195: and wjdi.resource_instance_id is null)
196: or (wjdi.substitution_type = wip_job_details.wip_add
197: and wjdi.resource_serial_number is null
198: and p_resource_type = 1 ));
192: and wjdi.operation_seq_num = p_operation_seq_num
193: and ( wjdi.resource_seq_num is null
194: or (wjdi.substitution_type <> wip_job_details.wip_delete
195: and wjdi.resource_instance_id is null)
196: or (wjdi.substitution_type = wip_job_details.wip_add
197: and wjdi.resource_serial_number is null
198: and p_resource_type = 1 ));
199: end if;
200: end resinst_info_exist;
216: and wjdi.process_status in (wip_constants.running,
217: wip_constants.warning)
218: and wjdi.wip_entity_id = p_wip_entity_id
219: and wjdi.organization_id = p_organization_id
220: and wjdi.load_type = wip_job_details.wip_res_instance
221: and wjdi.substitution_type = p_substitution_type
222: and wjdi.operation_seq_num = p_operation_seq_num
223: and wjdi.resource_seq_num = p_resource_seq_num
224: and wjdi.resource_instance_id = p_resource_instance_id
251: for l_inv_row in c_invalid_rows(l_dept_id, l_resource_id) loop
252: l_error_exists := true;
253: fnd_message.set_name('WIP', 'WIP_JDI_INVALID_RES_INST_ID');
254: fnd_message.set_token('INTERFACE', to_char(l_inv_row.interface_id));
255: if(wip_job_details.std_alone = 1) then
256: wip_interface_err_Utils.add_error(p_interface_id => l_inv_row.interface_id,
257: p_text => substr(fnd_message.get,1,500),
258: p_error_type => wip_jdi_utils.msg_error);
259: else
270: and wjdi.process_status in (wip_constants.running,
271: wip_constants.warning)
272: and wjdi.wip_entity_id = p_wip_entity_id
273: and wjdi.organization_id = p_organization_id
274: and wjdi.load_type in (wip_job_details.wip_res_instance, wjdi.load_type)
275: and wjdi.substitution_type = p_substitution_type
276: and wjdi.operation_seq_num = p_operation_seq_num
277: and wjdi.resource_seq_num = p_resource_seq_num
278: and wjdi.resource_instance_id = p_resource_instance_id
303: and wjdi.process_status in (wip_constants.running,
304: wip_constants.warning)
305: and wjdi.wip_entity_id = p_wip_entity_id
306: and wjdi.organization_id = p_organization_id
307: and wjdi.load_type = wip_job_details.wip_res_instance
308: and wjdi.substitution_type = p_substitution_type
309: and wjdi.operation_seq_num = p_operation_seq_num
310: and wjdi.resource_seq_num = p_resource_seq_num
311: and wjdi.resource_instance_id = p_resource_instance_id
351: for l_inv_row in c_invalid_rows(l_dept_id, l_resource_id) loop
352: l_error_exists := true;
353: fnd_message.set_name('WIP', 'WIP_JDI_INVALID_INST_SERIAL');
354: fnd_message.set_token('INTERFACE', to_char(l_inv_row.interface_id));
355: if(wip_job_details.std_alone = 1) then
356: wip_interface_err_Utils.add_error(p_interface_id => l_inv_row.interface_id,
357: p_text => substr(fnd_message.get,1,500),
358: p_error_type => wip_jdi_utils.msg_error);
359: else
371: and wjdi.process_status in (wip_constants.running,
372: wip_constants.warning)
373: and wjdi.wip_entity_id = p_wip_entity_id
374: and wjdi.organization_id = p_organization_id
375: and wjdi.load_type in (wip_job_details.wip_res_instance, wjdi.load_type)
376: and wjdi.substitution_type = p_substitution_type
377: and wjdi.operation_seq_num = p_operation_seq_num
378: and wjdi.resource_seq_num = p_resource_seq_num
379: and wjdi.resource_instance_id = p_resource_instance_id
421: and wjdi.process_status in (wip_constants.running,
422: wip_constants.warning)
423: and wjdi.wip_entity_id = p_wip_entity_id
424: and wjdi.organization_id = p_organization_id
425: and wjdi.load_type = wip_job_details.wip_res_instance
426: and wjdi.substitution_type = wip_job_details.wip_add
427: and wjdi.operation_seq_num = p_operation_seq_num
428: and wjdi.resource_seq_num = p_resource_seq_num
429: and p_count <> p_assigned_units;
422: wip_constants.warning)
423: and wjdi.wip_entity_id = p_wip_entity_id
424: and wjdi.organization_id = p_organization_id
425: and wjdi.load_type = wip_job_details.wip_res_instance
426: and wjdi.substitution_type = wip_job_details.wip_add
427: and wjdi.operation_seq_num = p_operation_seq_num
428: and wjdi.resource_seq_num = p_resource_seq_num
429: and p_count <> p_assigned_units;
430:
505: from wip_job_dtls_interface
506: where group_id = p_group_id
507: and wip_entity_id = p_wip_entity_id
508: and organization_id = p_organization_id
509: and load_type = wip_job_details.wip_res_instance
510: and substitution_type = wip_job_details.wip_add
511: and operation_seq_num = p_operation_seq_num
512: and resource_seq_num = p_resource_seq_num;
513: Exception when no_data_found then
506: where group_id = p_group_id
507: and wip_entity_id = p_wip_entity_id
508: and organization_id = p_organization_id
509: and load_type = wip_job_details.wip_res_instance
510: and substitution_type = wip_job_details.wip_add
511: and operation_seq_num = p_operation_seq_num
512: and resource_seq_num = p_resource_seq_num;
513: Exception when no_data_found then
514: l_add_count := 0;
520: from wip_job_dtls_interface
521: where group_id = p_group_id
522: and wip_entity_id = p_wip_entity_id
523: and organization_id = p_organization_id
524: and load_type = wip_job_details.wip_res_instance
525: and substitution_type = wip_job_details.wip_delete
526: and operation_seq_num = p_operation_seq_num
527: and resource_seq_num = p_resource_seq_num;
528: Exception when no_data_found then
521: where group_id = p_group_id
522: and wip_entity_id = p_wip_entity_id
523: and organization_id = p_organization_id
524: and load_type = wip_job_details.wip_res_instance
525: and substitution_type = wip_job_details.wip_delete
526: and operation_seq_num = p_operation_seq_num
527: and resource_seq_num = p_resource_seq_num;
528: Exception when no_data_found then
529: l_del_count := 0;
541:
542: for l_inv_row in c_invalid_rows(l_count, l_assigned_units) loop
543: l_error_exists := true;
544: fnd_message.set_name('WIP', 'WIP_ASSIGNED_UNITS_ERROR');
545: if(wip_job_details.std_alone = 1) then
546: wip_interface_err_Utils.add_error(p_interface_id => l_inv_row.interface_id,
547: p_text => to_char(l_inv_row.interface_id)
548: || ':' || substr(fnd_message.get,1,500),
549: p_error_type => wip_jdi_utils.msg_error);
562: and wjdi.process_status in (wip_constants.running,
563: wip_constants.warning)
564: and wjdi.wip_entity_id = p_wip_entity_id
565: and wjdi.organization_id = p_organization_id
566: and wjdi.load_type = wip_job_details.wip_res_instance
567: and wjdi.substitution_type = wip_job_details.wip_add
568: and wjdi.operation_seq_num = p_operation_seq_num
569: and wjdi.resource_seq_num = p_resource_seq_num
570: and l_count <> l_assigned_units;
563: wip_constants.warning)
564: and wjdi.wip_entity_id = p_wip_entity_id
565: and wjdi.organization_id = p_organization_id
566: and wjdi.load_type = wip_job_details.wip_res_instance
567: and wjdi.substitution_type = wip_job_details.wip_add
568: and wjdi.operation_seq_num = p_operation_seq_num
569: and wjdi.resource_seq_num = p_resource_seq_num
570: and l_count <> l_assigned_units;
571: end if;
604: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
605: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
606: AND wip_entity_id = p_wip_entity_id
607: AND organization_id = p_organization_id
608: AND load_type = WIP_JOB_DETAILS.WIP_RES_INSTANCE
609: AND substitution_type = p_substitution_type;
610:
611: l_resource_type number;
612: l_return_status varchar2(100);
758: and wjdi.process_status in (wip_constants.running,
759: wip_constants.warning)
760: and wjdi.wip_entity_id = p_wip_entity_id
761: and wjdi.organization_id = p_organization_id
762: and wjdi.load_type = wip_job_details.wip_res_instance
763: and wjdi.substitution_type = p_substitution_type
764: and wjdi.operation_seq_num = p_operation_seq_num
765: and wjdi.resource_seq_num = p_resource_seq_num
766: and wjdi.resource_instance_id= p_instance_id
779: for l_inv_row in c_invalid_rows loop
780: l_error_exists := true;
781: fnd_message.set_name('WIP', 'WIP_JDI_RES_INST_NOT_IN_JOB');
782: fnd_message.set_token('INTERFACE', to_char(l_inv_row.interface_id));
783: if(wip_job_details.std_alone = 1) then
784: wip_interface_err_Utils.add_error(p_interface_id => l_inv_row.interface_id,
785: p_text => substr(fnd_message.get,1,500),
786: p_error_type => wip_jdi_utils.msg_error);
787: else
799: and process_status in (wip_constants.running,
800: wip_constants.warning)
801: and wip_entity_id = p_wip_entity_id
802: and organization_id = p_organization_id
803: and wjdi.load_type in (wip_job_details.wip_res_instance)
804: and wjdi.substitution_type = p_substitution_type
805: and wjdi.operation_seq_num = p_operation_seq_num
806: and wjdi.resource_seq_num = p_resource_seq_num
807: and wjdi.resource_instance_id= p_instance_id
850: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
851: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
852: AND wip_entity_id = p_wip_entity_id
853: AND organization_id = p_organization_id
854: AND load_type = WIP_JOB_DETAILS.WIP_RES_INSTANCE
855: AND substitution_type = p_substitution_type;
856:
857: l_resource_type number;
858:
981: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
982: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
983: AND wip_entity_id = p_wip_entity_id
984: AND organization_id = p_organization_id
985: AND load_type = WIP_JOB_DETAILS.WIP_RES_INSTANCE
986: AND substitution_type = p_substitution_type;
987:
988: BEGIN
989: