28: attribute8,attribute9,attribute10,attribute11,attribute12,
29: attribute13,attribute14,attribute15
30: FROM WIP_JOB_DTLS_INTERFACE
31: WHERE group_id = p_group_id
32: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
33: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
34: AND wip_entity_id = p_wip_entity_id
35: AND organization_id = p_organization_id
36: AND load_type = WIP_JOB_DETAILS.WIP_RESOURCE
29: attribute13,attribute14,attribute15
30: FROM WIP_JOB_DTLS_INTERFACE
31: WHERE group_id = p_group_id
32: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
33: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
34: AND wip_entity_id = p_wip_entity_id
35: AND organization_id = p_organization_id
36: AND load_type = WIP_JOB_DETAILS.WIP_RESOURCE
37: AND substitution_type = WIP_JOB_DETAILS.WIP_DELETE;
105: group_sequence_id, group_sequence_number, maximum_assigned_units,
106: parent_seq_num, batch_id
107: FROM WIP_JOB_DTLS_INTERFACE
108: WHERE group_id = p_group_id
109: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
110: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
111: AND wip_entity_id = p_wip_entity_id
112: AND organization_id = p_organization_id
113: AND load_type = WIP_JOB_DETAILS.WIP_RESOURCE
106: parent_seq_num, batch_id
107: FROM WIP_JOB_DTLS_INTERFACE
108: WHERE group_id = p_group_id
109: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
110: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
111: AND wip_entity_id = p_wip_entity_id
112: AND organization_id = p_organization_id
113: AND load_type = WIP_JOB_DETAILS.WIP_RESOURCE
114: AND substitution_type = WIP_JOB_DETAILS.WIP_ADD;
373: group_sequence_id, group_sequence_number, maximum_assigned_units,
374: parent_seq_num, batch_id
375: FROM WIP_JOB_DTLS_INTERFACE
376: WHERE group_id = p_group_id
377: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
378: AND process_status in (WIP_CONSTANTS.RUNNING, WIP_CONSTANTS.WARNING)
379: AND wip_entity_id = p_wip_entity_id
380: AND organization_id = p_organization_id
381: AND load_type = WIP_JOB_DETAILS.WIP_RESOURCE
374: parent_seq_num, batch_id
375: FROM WIP_JOB_DTLS_INTERFACE
376: WHERE group_id = p_group_id
377: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
378: AND process_status in (WIP_CONSTANTS.RUNNING, WIP_CONSTANTS.WARNING)
379: AND wip_entity_id = p_wip_entity_id
380: AND organization_id = p_organization_id
381: AND load_type = WIP_JOB_DETAILS.WIP_RESOURCE
382: AND substitution_type = WIP_JOB_DETAILS.WIP_CHANGE
395: and wor.organization_id = p_organization_id
396: and not exists ( select 1
397: FROM WIP_JOB_DTLS_INTERFACE
398: WHERE group_id = p_group_id
399: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
400: AND process_status in (WIP_CONSTANTS.RUNNING, WIP_CONSTANTS.WARNING)
401: AND wip_entity_id = p_wip_entity_id
402: AND organization_id = p_organization_id
403: AND load_type = WIP_JOB_DETAILS.WIP_RESOURCE
396: and not exists ( select 1
397: FROM WIP_JOB_DTLS_INTERFACE
398: WHERE group_id = p_group_id
399: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
400: AND process_status in (WIP_CONSTANTS.RUNNING, WIP_CONSTANTS.WARNING)
401: AND wip_entity_id = p_wip_entity_id
402: AND organization_id = p_organization_id
403: AND load_type = WIP_JOB_DETAILS.WIP_RESOURCE
404: AND operation_seq_num = wor.operation_seq_num
445:
446: --IF (cur_row.substitute_group_num = l_current_sub) THEN Changed for FP of bug#11679430 - 11844798
447: wip_logger.log('WIPJDSTB.Change_Resource - OP : '||cur_row.operation_seq_num||
448: ' Res : '||cur_row.resource_seq_num||' Sub : '||cur_row.substitute_group_num||' Repl : '||cur_row.replacement_group_num||
449: ' St Dt: '|| to_char(cur_row.start_date,WIP_CONSTANTS.DATETIME_FMT) || ' cmp Dt: ' || to_char(cur_row.completion_date,WIP_CONSTANTS.DATETIME_FMT) , l_dummy2);
450:
451: begin
452: select 1
453: into l_replace_res
658: and organization_id = p_organization_id ;
659:
660: /* Fix for Bug#6394857 (FP of 6370245). Removed scheduling method condition in following if and also
661: open cursor when source_code is MSC.
662: if (l_source_code = 'MSC' and l_scheduling_method = WIP_CONSTANTS.ML_MANUAL) then
663: */
664:
665: if (l_source_code = 'MSC') then
666:
681: when others then
682: p_err_msg := 'WIPJDSTB, Change_Resource: ' || SQLERRM;
683: p_err_code := SQLCODE;
684: l_logLevel := fnd_log.g_current_runtime_level;
685: if (l_logLevel <= wip_constants.trace_logging) then
686: wip_logger.log(p_err_msg, l_dummy2);
687: end if;
688:
689: /* 4656331. Close cursor if still open */
720: attribute8,attribute9,attribute10,attribute11,attribute12,
721: attribute13,attribute14,attribute15
722: FROM WIP_JOB_DTLS_INTERFACE
723: WHERE group_id = p_group_id
724: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
725: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
726: AND wip_entity_id = p_wip_entity_id
727: AND organization_id = p_organization_id
728: AND load_type = WIP_JOB_DETAILS.WIP_SUB_RES
721: attribute13,attribute14,attribute15
722: FROM WIP_JOB_DTLS_INTERFACE
723: WHERE group_id = p_group_id
724: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
725: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
726: AND wip_entity_id = p_wip_entity_id
727: AND organization_id = p_organization_id
728: AND load_type = WIP_JOB_DETAILS.WIP_SUB_RES
729: AND substitution_type = WIP_JOB_DETAILS.WIP_DELETE;
786: attribute13,attribute14,attribute15,schedule_seq_num,
787: substitute_group_num,replacement_group_num
788: FROM WIP_JOB_DTLS_INTERFACE
789: WHERE group_id = p_group_id
790: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
791: AND process_status in (WIP_CONSTANTS.RUNNING, WIP_CONSTANTS.WARNING)
792: AND wip_entity_id = p_wip_entity_id
793: AND organization_id = p_organization_id
794: AND load_type = WIP_JOB_DETAILS.WIP_SUB_RES
787: substitute_group_num,replacement_group_num
788: FROM WIP_JOB_DTLS_INTERFACE
789: WHERE group_id = p_group_id
790: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
791: AND process_status in (WIP_CONSTANTS.RUNNING, WIP_CONSTANTS.WARNING)
792: AND wip_entity_id = p_wip_entity_id
793: AND organization_id = p_organization_id
794: AND load_type = WIP_JOB_DETAILS.WIP_SUB_RES
795: AND substitution_type = WIP_JOB_DETAILS.WIP_ADD;
936: attribute13,attribute14,attribute15, schedule_seq_num,
937: substitute_group_num, replacement_group_num
938: FROM WIP_JOB_DTLS_INTERFACE
939: WHERE group_id = p_group_id
940: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
941: AND process_status in (WIP_CONSTANTS.RUNNING, WIP_CONSTANTS.WARNING)
942: AND wip_entity_id = p_wip_entity_id
943: AND organization_id = p_organization_id
944: AND load_type = WIP_JOB_DETAILS.WIP_SUB_RES
937: substitute_group_num, replacement_group_num
938: FROM WIP_JOB_DTLS_INTERFACE
939: WHERE group_id = p_group_id
940: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
941: AND process_status in (WIP_CONSTANTS.RUNNING, WIP_CONSTANTS.WARNING)
942: AND wip_entity_id = p_wip_entity_id
943: AND organization_id = p_organization_id
944: AND load_type = WIP_JOB_DETAILS.WIP_SUB_RES
945: AND substitution_type = WIP_JOB_DETAILS.WIP_CHANGE;
1037: resource_instance_id, start_date, completion_date, batch_id, interface_id,
1038: created_by, creation_date,last_updated_by,last_update_date
1039: FROM WIP_JOB_DTLS_INTERFACE
1040: WHERE group_id = p_group_id
1041: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
1042: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
1043: AND wip_entity_id = p_wip_entity_id
1044: AND organization_id = p_organization_id
1045: AND load_type = WIP_JOB_DETAILS.WIP_RES_INSTANCE
1038: created_by, creation_date,last_updated_by,last_update_date
1039: FROM WIP_JOB_DTLS_INTERFACE
1040: WHERE group_id = p_group_id
1041: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
1042: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
1043: AND wip_entity_id = p_wip_entity_id
1044: AND organization_id = p_organization_id
1045: AND load_type = WIP_JOB_DETAILS.WIP_RES_INSTANCE
1046: AND substitution_type = WIP_JOB_DETAILS.WIP_ADD;
1111: resource_instance_id, start_date, completion_date, batch_id,
1112: created_by, creation_date,last_updated_by,last_update_date
1113: FROM WIP_JOB_DTLS_INTERFACE
1114: WHERE group_id = p_group_id
1115: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
1116: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
1117: AND wip_entity_id = p_wip_entity_id
1118: AND organization_id = p_organization_id
1119: AND load_type = WIP_JOB_DETAILS.WIP_RES_INSTANCE
1112: created_by, creation_date,last_updated_by,last_update_date
1113: FROM WIP_JOB_DTLS_INTERFACE
1114: WHERE group_id = p_group_id
1115: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
1116: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
1117: AND wip_entity_id = p_wip_entity_id
1118: AND organization_id = p_organization_id
1119: AND load_type = WIP_JOB_DETAILS.WIP_RES_INSTANCE
1120: AND substitution_type = WIP_JOB_DETAILS.WIP_CHANGE;
1187: SELECT distinct operation_seq_num, resource_seq_num, resource_serial_number,
1188: resource_instance_id, start_date, completion_date, batch_id
1189: FROM WIP_JOB_DTLS_INTERFACE
1190: WHERE group_id = p_group_id
1191: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
1192: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
1193: AND wip_entity_id = p_wip_entity_id
1194: AND organization_id = p_organization_id
1195: AND load_type = WIP_JOB_DETAILS.WIP_RES_INSTANCE
1188: resource_instance_id, start_date, completion_date, batch_id
1189: FROM WIP_JOB_DTLS_INTERFACE
1190: WHERE group_id = p_group_id
1191: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
1192: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
1193: AND wip_entity_id = p_wip_entity_id
1194: AND organization_id = p_organization_id
1195: AND load_type = WIP_JOB_DETAILS.WIP_RES_INSTANCE
1196: AND substitution_type = p_substitution_type;
1264: attribute8,attribute9,attribute10,attribute11,attribute12,
1265: attribute13,attribute14,attribute15
1266: FROM WIP_JOB_DTLS_INTERFACE
1267: WHERE group_id = p_group_id
1268: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
1269: AND process_status in (WIP_CONSTANTS.RUNNING, WIP_CONSTANTS.WARNING)
1270: AND wip_entity_id = p_wip_entity_id
1271: AND organization_id = p_organization_id
1272: AND load_type = WIP_JOB_DETAILS.WIP_MTL_REQUIREMENT
1265: attribute13,attribute14,attribute15
1266: FROM WIP_JOB_DTLS_INTERFACE
1267: WHERE group_id = p_group_id
1268: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
1269: AND process_status in (WIP_CONSTANTS.RUNNING, WIP_CONSTANTS.WARNING)
1270: AND wip_entity_id = p_wip_entity_id
1271: AND organization_id = p_organization_id
1272: AND load_type = WIP_JOB_DETAILS.WIP_MTL_REQUIREMENT
1273: AND substitution_type = WIP_JOB_DETAILS.WIP_DELETE;
1291:
1292: wip_picking_pvt.cancel_comp_allocations(p_wip_entity_id => p_wip_entity_id,
1293: p_operation_seq_num => cur_row.operation_seq_num,
1294: p_inventory_item_id => cur_row.inventory_item_id_old,
1295: p_wip_entity_type => wip_constants.discrete,
1296: x_return_status => x_return_status,
1297: x_msg_data => x_msg_data);
1298:
1299: if (x_return_status <> fnd_api.g_ret_sts_success) then
1338: attribute8,attribute9,attribute10,attribute11,attribute12,
1339: attribute13,attribute14,attribute15
1340: FROM WIP_JOB_DTLS_INTERFACE
1341: WHERE group_id = p_group_id
1342: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
1343: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
1344: AND wip_entity_id = p_wip_entity_id
1345: AND organization_id = p_organization_id
1346: AND load_type = WIP_JOB_DETAILS.WIP_MTL_REQUIREMENT
1339: attribute13,attribute14,attribute15
1340: FROM WIP_JOB_DTLS_INTERFACE
1341: WHERE group_id = p_group_id
1342: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
1343: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
1344: AND wip_entity_id = p_wip_entity_id
1345: AND organization_id = p_organization_id
1346: AND load_type = WIP_JOB_DETAILS.WIP_MTL_REQUIREMENT
1347: AND substitution_type = WIP_JOB_DETAILS.WIP_ADD;
1484: attribute8,attribute9,attribute10,attribute11,attribute12,
1485: attribute13,attribute14,attribute15
1486: FROM WIP_JOB_DTLS_INTERFACE
1487: WHERE group_id = p_group_id
1488: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
1489: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
1490: AND wip_entity_id = p_wip_entity_id
1491: AND organization_id = p_organization_id
1492: AND load_type = WIP_JOB_DETAILS.WIP_MTL_REQUIREMENT
1485: attribute13,attribute14,attribute15
1486: FROM WIP_JOB_DTLS_INTERFACE
1487: WHERE group_id = p_group_id
1488: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
1489: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
1490: AND wip_entity_id = p_wip_entity_id
1491: AND organization_id = p_organization_id
1492: AND load_type = WIP_JOB_DETAILS.WIP_MTL_REQUIREMENT
1493: AND substitution_type = WIP_JOB_DETAILS.WIP_CHANGE;
1551:
1552: WIP_PICKING_PUB.cancel_comp_allocations(p_wip_entity_id => p_wip_entity_id,
1553: p_operation_seq_num => cur_row.operation_seq_num,
1554: p_inventory_item_id => cur_row.inventory_item_id_old,
1555: p_wip_entity_type => WIP_CONSTANTS.DISCRETE,
1556: x_return_status => x_return_status,
1557: x_msg_data => x_msg_data);
1558:
1559: FND_MESSAGE.set_name('WIP', 'WIP_SUPPLY_CHANGE_WARNING2');
1711: attribute6, attribute7, attribute8, attribute9, attribute10,
1712: attribute11, attribute12, attribute13, attribute14, attribute15
1713: FROM WIP_JOB_DTLS_INTERFACE
1714: WHERE group_id = p_group_id
1715: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
1716: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
1717: AND wip_entity_id = p_wip_entity_id
1718: AND organization_id = p_organization_id
1719: AND load_type = WIP_JOB_DETAILS.WIP_OPERATION
1712: attribute11, attribute12, attribute13, attribute14, attribute15
1713: FROM WIP_JOB_DTLS_INTERFACE
1714: WHERE group_id = p_group_id
1715: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
1716: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
1717: AND wip_entity_id = p_wip_entity_id
1718: AND organization_id = p_organization_id
1719: AND load_type = WIP_JOB_DETAILS.WIP_OPERATION
1720: AND substitution_type = WIP_JOB_DETAILS.WIP_ADD
1769: AND wdj.organization_id = p_organization_id
1770: AND wdj.wip_entity_id = we.wip_entity_id (+)
1771: AND wdj.organization_id = we.organization_id (+)
1772: AND we.group_id = p_group_id
1773: AND we.process_phase = WIP_CONSTANTS.ML_VALIDATION
1774: AND we.process_status in ( WIP_CONSTANTS.RUNNING, WIP_CONSTANTS.WARNING )
1775: AND we.header_id = cur_oper.parent_header_id;
1776:
1777: begin
1770: AND wdj.wip_entity_id = we.wip_entity_id (+)
1771: AND wdj.organization_id = we.organization_id (+)
1772: AND we.group_id = p_group_id
1773: AND we.process_phase = WIP_CONSTANTS.ML_VALIDATION
1774: AND we.process_status in ( WIP_CONSTANTS.RUNNING, WIP_CONSTANTS.WARNING )
1775: AND we.header_id = cur_oper.parent_header_id;
1776:
1777: begin
1778: SELECT min(operation_seq_num)
1788: -- Bug 3484856 - If job is 'Unreleased' or creating a work-order,
1789: -- then quantity_in_queue should be 0 else create the operation with
1790: -- open qty in queue
1791: IF l_first_operation is null then
1792: if l_status_type = WIP_CONSTANTS.UNRELEASED or
1793: ( l_load_type is NOT NULL and
1794: l_load_type in ( WIP_CONSTANTS.CREATE_JOB,
1795: WIP_CONSTANTS.CREATE_NS_JOB,
1796: WIP_CONSTANTS.CREATE_EAM_JOB ) ) then
1790: -- open qty in queue
1791: IF l_first_operation is null then
1792: if l_status_type = WIP_CONSTANTS.UNRELEASED or
1793: ( l_load_type is NOT NULL and
1794: l_load_type in ( WIP_CONSTANTS.CREATE_JOB,
1795: WIP_CONSTANTS.CREATE_NS_JOB,
1796: WIP_CONSTANTS.CREATE_EAM_JOB ) ) then
1797: l_quantity_in_queue := 0;
1798: else
1791: IF l_first_operation is null then
1792: if l_status_type = WIP_CONSTANTS.UNRELEASED or
1793: ( l_load_type is NOT NULL and
1794: l_load_type in ( WIP_CONSTANTS.CREATE_JOB,
1795: WIP_CONSTANTS.CREATE_NS_JOB,
1796: WIP_CONSTANTS.CREATE_EAM_JOB ) ) then
1797: l_quantity_in_queue := 0;
1798: else
1799: l_quantity_in_queue := l_open_quantity;
1792: if l_status_type = WIP_CONSTANTS.UNRELEASED or
1793: ( l_load_type is NOT NULL and
1794: l_load_type in ( WIP_CONSTANTS.CREATE_JOB,
1795: WIP_CONSTANTS.CREATE_NS_JOB,
1796: WIP_CONSTANTS.CREATE_EAM_JOB ) ) then
1797: l_quantity_in_queue := 0;
1798: else
1799: l_quantity_in_queue := l_open_quantity;
1800: end if;
1807: INTO l_cost_method
1808: FROM mtl_parameters
1809: WHERE organization_id = p_organization_id;
1810:
1811: IF l_cost_method = WIP_CONSTANTS.COST_AVG THEN
1812:
1813: BEGIN
1814: SELECT 1
1815: INTO l_op_exists
1831: fnd_message.set_name('WIP','WIP_ADD_OP_INVALID');
1832: wip_jsi_utils.record_current_error(FALSE);
1833:
1834: update wip_job_dtls_interface wjdi
1835: set process_status = wip_constants.error
1836: where group_id = p_group_id
1837: and process_phase = wip_constants.ml_validation
1838: and process_status in (wip_constants.running,
1839: wip_constants.warning)
1833:
1834: update wip_job_dtls_interface wjdi
1835: set process_status = wip_constants.error
1836: where group_id = p_group_id
1837: and process_phase = wip_constants.ml_validation
1838: and process_status in (wip_constants.running,
1839: wip_constants.warning)
1840: and wip_entity_id = p_wip_entity_id
1841: and organization_id = p_organization_id
1834: update wip_job_dtls_interface wjdi
1835: set process_status = wip_constants.error
1836: where group_id = p_group_id
1837: and process_phase = wip_constants.ml_validation
1838: and process_status in (wip_constants.running,
1839: wip_constants.warning)
1840: and wip_entity_id = p_wip_entity_id
1841: and organization_id = p_organization_id
1842: and substitution_type = wip_job_details.wip_add;
1835: set process_status = wip_constants.error
1836: where group_id = p_group_id
1837: and process_phase = wip_constants.ml_validation
1838: and process_status in (wip_constants.running,
1839: wip_constants.warning)
1840: and wip_entity_id = p_wip_entity_id
1841: and organization_id = p_organization_id
1842: and substitution_type = wip_job_details.wip_add;
1843:
1850: /* End Bug 9494799 */
1851:
1852: /* Added Additional validation of mtl. txn in a avg cost org for bug 9822688. */
1853:
1854: IF l_cost_method = WIP_CONSTANTS.COST_AVG THEN
1855:
1856: BEGIN
1857: SELECT 1
1858: INTO l_txn_exists
1873: IF l_txn_exists = 1 THEN
1874: fnd_message.set_name('WIP','WIP_ADD_OP_INVALID');
1875: wip_jsi_utils.record_current_error(FALSE);
1876: update wip_job_dtls_interface wjdi
1877: set process_status = wip_constants.error
1878: where group_id = p_group_id
1879: and process_phase = wip_constants.ml_validation
1880: and process_status in (wip_constants.running,
1881: wip_constants.warning)
1875: wip_jsi_utils.record_current_error(FALSE);
1876: update wip_job_dtls_interface wjdi
1877: set process_status = wip_constants.error
1878: where group_id = p_group_id
1879: and process_phase = wip_constants.ml_validation
1880: and process_status in (wip_constants.running,
1881: wip_constants.warning)
1882: and wip_entity_id = p_wip_entity_id
1883: and organization_id = p_organization_id
1876: update wip_job_dtls_interface wjdi
1877: set process_status = wip_constants.error
1878: where group_id = p_group_id
1879: and process_phase = wip_constants.ml_validation
1880: and process_status in (wip_constants.running,
1881: wip_constants.warning)
1882: and wip_entity_id = p_wip_entity_id
1883: and organization_id = p_organization_id
1884: and substitution_type = wip_job_details.wip_add;
1877: set process_status = wip_constants.error
1878: where group_id = p_group_id
1879: and process_phase = wip_constants.ml_validation
1880: and process_status in (wip_constants.running,
1881: wip_constants.warning)
1882: and wip_entity_id = p_wip_entity_id
1883: and organization_id = p_organization_id
1884: and substitution_type = wip_job_details.wip_add;
1885:
2233: WJDI.attribute11, WJDI.attribute12, WJDI.attribute13, WJDI.attribute14, WJDI.attribute15,
2234: WO.standard_operation_id curr_standard_operation_id
2235: FROM WIP_JOB_DTLS_INTERFACE WJDI, WIP_OPERATIONS WO
2236: WHERE group_id = p_group_id
2237: AND WJDI.process_phase = WIP_CONSTANTS.ML_VALIDATION
2238: AND WJDI.process_status IN (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
2239: AND WJDI.wip_entity_id = p_wip_entity_id
2240: AND WJDI.organization_id = p_organization_id
2241: AND WJDI.load_type = WIP_JOB_DETAILS.WIP_OPERATION
2234: WO.standard_operation_id curr_standard_operation_id
2235: FROM WIP_JOB_DTLS_INTERFACE WJDI, WIP_OPERATIONS WO
2236: WHERE group_id = p_group_id
2237: AND WJDI.process_phase = WIP_CONSTANTS.ML_VALIDATION
2238: AND WJDI.process_status IN (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
2239: AND WJDI.wip_entity_id = p_wip_entity_id
2240: AND WJDI.organization_id = p_organization_id
2241: AND WJDI.load_type = WIP_JOB_DETAILS.WIP_OPERATION
2242: AND WJDI.substitution_type = WIP_JOB_DETAILS.WIP_CHANGE
2418: cursor c_invalid_rows is
2419: select wjdi.interface_id
2420: from wip_job_dtls_interface wjdi
2421: where wjdi.group_id = p_group_id
2422: and wjdi.process_phase = wip_constants.ml_validation
2423: and wjdi.process_status in (wip_constants.running,
2424: wip_constants.warning)
2425: and wjdi.load_type = wip_job_details.wip_operation
2426: and wjdi.substitution_type in (wip_job_details.wip_add, wip_job_details.wip_change)
2419: select wjdi.interface_id
2420: from wip_job_dtls_interface wjdi
2421: where wjdi.group_id = p_group_id
2422: and wjdi.process_phase = wip_constants.ml_validation
2423: and wjdi.process_status in (wip_constants.running,
2424: wip_constants.warning)
2425: and wjdi.load_type = wip_job_details.wip_operation
2426: and wjdi.substitution_type in (wip_job_details.wip_add, wip_job_details.wip_change)
2427: and wjdi.wip_entity_id = p_wip_entity_id
2420: from wip_job_dtls_interface wjdi
2421: where wjdi.group_id = p_group_id
2422: and wjdi.process_phase = wip_constants.ml_validation
2423: and wjdi.process_status in (wip_constants.running,
2424: wip_constants.warning)
2425: and wjdi.load_type = wip_job_details.wip_operation
2426: and wjdi.substitution_type in (wip_job_details.wip_add, wip_job_details.wip_change)
2427: and wjdi.wip_entity_id = p_wip_entity_id
2428: and wjdi.organization_id = p_organization_id
2475: end loop;
2476:
2477: if(l_error_exists) then
2478: update wip_job_dtls_interface wjdi
2479: set process_status = wip_constants.error
2480: where wjdi.group_id = p_group_id
2481: and wjdi.process_phase = wip_constants.ml_validation
2482: and wjdi.process_status in (wip_constants.running,
2483: wip_constants.warning)
2477: if(l_error_exists) then
2478: update wip_job_dtls_interface wjdi
2479: set process_status = wip_constants.error
2480: where wjdi.group_id = p_group_id
2481: and wjdi.process_phase = wip_constants.ml_validation
2482: and wjdi.process_status in (wip_constants.running,
2483: wip_constants.warning)
2484: and wjdi.load_type = wip_job_details.wip_operation
2485: and wjdi.substitution_type in (wip_job_details.wip_add, wip_job_details.wip_change)
2478: update wip_job_dtls_interface wjdi
2479: set process_status = wip_constants.error
2480: where wjdi.group_id = p_group_id
2481: and wjdi.process_phase = wip_constants.ml_validation
2482: and wjdi.process_status in (wip_constants.running,
2483: wip_constants.warning)
2484: and wjdi.load_type = wip_job_details.wip_operation
2485: and wjdi.substitution_type in (wip_job_details.wip_add, wip_job_details.wip_change)
2486: and wjdi.wip_entity_id = p_wip_entity_id
2479: set process_status = wip_constants.error
2480: where wjdi.group_id = p_group_id
2481: and wjdi.process_phase = wip_constants.ml_validation
2482: and wjdi.process_status in (wip_constants.running,
2483: wip_constants.warning)
2484: and wjdi.load_type = wip_job_details.wip_operation
2485: and wjdi.substitution_type in (wip_job_details.wip_add, wip_job_details.wip_change)
2486: and wjdi.wip_entity_id = p_wip_entity_id
2487: and wjdi.organization_id = p_organization_id
2554: p_organization_id number) IS
2555: SELECT operation_seq_num, resource_seq_num
2556: FROM WIP_JOB_DTLS_INTERFACE
2557: WHERE group_id = p_group_id
2558: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
2559: AND process_status in (WIP_CONSTANTS.RUNNING, WIP_CONSTANTS.WARNING)
2560: AND wip_entity_id = p_wip_entity_id
2561: AND organization_id = p_organization_id
2562: AND load_type in (WIP_JOB_DETAILS.WIP_RES_USAGE,
2555: SELECT operation_seq_num, resource_seq_num
2556: FROM WIP_JOB_DTLS_INTERFACE
2557: WHERE group_id = p_group_id
2558: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
2559: AND process_status in (WIP_CONSTANTS.RUNNING, WIP_CONSTANTS.WARNING)
2560: AND wip_entity_id = p_wip_entity_id
2561: AND organization_id = p_organization_id
2562: AND load_type in (WIP_JOB_DETAILS.WIP_RES_USAGE,
2563: WIP_JOB_DETAILS.WIP_RES_INSTANCE_USAGE)
2601: AND operation_seq_num = p_operation_seq_num
2602: AND resource_seq_num = p_resource_seq_num
2603: AND load_type in (WIP_JOB_DETAILS.WIP_RES_USAGE,
2604: WIP_JOB_DETAILS.WIP_RES_INSTANCE_USAGE)
2605: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING);
2606:
2607: x_statement varchar2(2000);
2608: l_resource_id number;
2609:
2801: attribute13,attribute14,attribute15,schedule_seq_num,
2802: substitute_group_num,replacement_group_num,batch_id
2803: FROM WIP_JOB_DTLS_INTERFACE
2804: WHERE group_id = p_group_id
2805: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
2806: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
2807: AND wip_entity_id = p_wip_entity_id
2808: AND organization_id = p_organization_id
2809: AND load_type = WIP_JOB_DETAILS.WIP_OP_LINK
2802: substitute_group_num,replacement_group_num,batch_id
2803: FROM WIP_JOB_DTLS_INTERFACE
2804: WHERE group_id = p_group_id
2805: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
2806: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
2807: AND wip_entity_id = p_wip_entity_id
2808: AND organization_id = p_organization_id
2809: AND load_type = WIP_JOB_DETAILS.WIP_OP_LINK
2810: AND substitution_type = WIP_JOB_DETAILS.WIP_ADD;
2900: attribute13,attribute14,attribute15,schedule_seq_num,
2901: substitute_group_num,replacement_group_num,batch_id
2902: FROM WIP_JOB_DTLS_INTERFACE
2903: WHERE group_id = p_group_id
2904: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
2905: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
2906: AND wip_entity_id = p_wip_entity_id
2907: AND organization_id = p_organization_id
2908: AND load_type = WIP_JOB_DETAILS.WIP_OP_LINK
2901: substitute_group_num,replacement_group_num,batch_id
2902: FROM WIP_JOB_DTLS_INTERFACE
2903: WHERE group_id = p_group_id
2904: AND process_phase = WIP_CONSTANTS.ML_VALIDATION
2905: AND process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
2906: AND wip_entity_id = p_wip_entity_id
2907: AND organization_id = p_organization_id
2908: AND load_type = WIP_JOB_DETAILS.WIP_OP_LINK
2909: AND substitution_type = WIP_JOB_DETAILS.WIP_DELETE;
2948: wip_job_schedule_interface wjsi,
2949: wip_entities we
2950: WHERE wjdi.group_id = p_group_id
2951: AND wjsi.group_id = p_group_id
2952: AND wjdi.process_phase = WIP_CONSTANTS.ML_VALIDATION
2953: AND wjdi.process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
2954: AND wjdi.wip_entity_id = p_wip_entity_id
2955: AND wjdi.organization_id = p_organization_id
2956: AND wjdi.load_type = WIP_JOB_DETAILS.WIP_SERIAL
2949: wip_entities we
2950: WHERE wjdi.group_id = p_group_id
2951: AND wjsi.group_id = p_group_id
2952: AND wjdi.process_phase = WIP_CONSTANTS.ML_VALIDATION
2953: AND wjdi.process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
2954: AND wjdi.wip_entity_id = p_wip_entity_id
2955: AND wjdi.organization_id = p_organization_id
2956: AND wjdi.load_type = WIP_JOB_DETAILS.WIP_SERIAL
2957: AND wjdi.substitution_type = WIP_JOB_DETAILS.WIP_ADD
3009: wip_job_schedule_interface wjsi,
3010: wip_entities we
3011: WHERE wjdi.group_id = p_group_id
3012: AND wjsi.group_id = p_group_id
3013: AND wjdi.process_phase = WIP_CONSTANTS.ML_VALIDATION
3014: AND wjdi.process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
3015: AND wjdi.wip_entity_id = p_wip_entity_id
3016: AND wjdi.organization_id = p_organization_id
3017: AND wjdi.load_type = WIP_JOB_DETAILS.WIP_SERIAL
3010: wip_entities we
3011: WHERE wjdi.group_id = p_group_id
3012: AND wjsi.group_id = p_group_id
3013: AND wjdi.process_phase = WIP_CONSTANTS.ML_VALIDATION
3014: AND wjdi.process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
3015: AND wjdi.wip_entity_id = p_wip_entity_id
3016: AND wjdi.organization_id = p_organization_id
3017: AND wjdi.load_type = WIP_JOB_DETAILS.WIP_SERIAL
3018: AND wjdi.substitution_type = WIP_JOB_DETAILS.WIP_CHANGE
3082: wip_job_schedule_interface wjsi,
3083: wip_entities we
3084: WHERE wjdi.group_id = p_group_id
3085: AND wjsi.group_id = p_group_id
3086: AND wjdi.process_phase = WIP_CONSTANTS.ML_VALIDATION
3087: AND wjdi.process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
3088: AND wjdi.wip_entity_id = p_wip_entity_id
3089: AND wjdi.organization_id = p_organization_id
3090: AND wjdi.load_type = WIP_JOB_DETAILS.WIP_SERIAL
3083: wip_entities we
3084: WHERE wjdi.group_id = p_group_id
3085: AND wjsi.group_id = p_group_id
3086: AND wjdi.process_phase = WIP_CONSTANTS.ML_VALIDATION
3087: AND wjdi.process_status in (WIP_CONSTANTS.RUNNING,WIP_CONSTANTS.WARNING)
3088: AND wjdi.wip_entity_id = p_wip_entity_id
3089: AND wjdi.organization_id = p_organization_id
3090: AND wjdi.load_type = WIP_JOB_DETAILS.WIP_SERIAL
3091: AND wjdi.substitution_type = WIP_JOB_DETAILS.WIP_DELETE
3151: into l_load_type
3152: from wip_job_schedule_interface
3153: where rowid = p_rowid;
3154:
3155: if(l_defaultSN = wip_constants.yes and
3156: l_load_type in ( wip_constants.create_job,wip_constants.create_ns_job)) /*Bug 13004022 - Added wip_constants.create_ns_job for auto association of serial numbers for non standard job also */
3157: then
3158: --get the number of serial numbers defaulted and the start quantity of the job
3159:
3152: from wip_job_schedule_interface
3153: where rowid = p_rowid;
3154:
3155: if(l_defaultSN = wip_constants.yes and
3156: l_load_type in ( wip_constants.create_job,wip_constants.create_ns_job)) /*Bug 13004022 - Added wip_constants.create_ns_job for auto association of serial numbers for non standard job also */
3157: then
3158: --get the number of serial numbers defaulted and the start quantity of the job
3159:
3160: SELECT count(*)