DBA Data[Home] [Help]

APPS.WIP_MTLPROC_PRIV dependencies on WIP_CONSTANTS

Line 68: if (l_logLevel <= wip_constants.trace_logging) then

64: if(fnd_api.to_boolean(p_initMsgList)) then
65: fnd_msg_pub.initialize;
66: end if;
67:
68: if (l_logLevel <= wip_constants.trace_logging) then
69: l_params(1).paramName := 'p_txnTmpID';
70: l_params(1).paramValue := p_txnTmpID;
71: wip_logger.entryPoint(p_procName => 'wip_mtlProc_priv.processTemp',
72: p_params => l_params,

Line 145: l_issueRec.wipSupplyType := wip_constants.op_pull;

141: --in 11.5.9 forms don't always insert wip supply type. from 11.5.10 on, all forms and interfaces should
142: --for now, use ids to default supplytype if not populated:
143: if(l_issueRec.wipSupplyType is null) then
144: if(l_issueRec.movTxnID is not null) then
145: l_issueRec.wipSupplyType := wip_constants.op_pull;
146: elsif(l_issueRec.cplTxnID is not null) then
147: l_issueRec.wipSupplyType := wip_constants.assy_pull;
148: else
149: l_issueRec.wipSupplyType := wip_constants.push;

Line 147: l_issueRec.wipSupplyType := wip_constants.assy_pull;

143: if(l_issueRec.wipSupplyType is null) then
144: if(l_issueRec.movTxnID is not null) then
145: l_issueRec.wipSupplyType := wip_constants.op_pull;
146: elsif(l_issueRec.cplTxnID is not null) then
147: l_issueRec.wipSupplyType := wip_constants.assy_pull;
148: else
149: l_issueRec.wipSupplyType := wip_constants.push;
150: end if;
151: end if;

Line 149: l_issueRec.wipSupplyType := wip_constants.push;

145: l_issueRec.wipSupplyType := wip_constants.op_pull;
146: elsif(l_issueRec.cplTxnID is not null) then
147: l_issueRec.wipSupplyType := wip_constants.assy_pull;
148: else
149: l_issueRec.wipSupplyType := wip_constants.push;
150: end if;
151: end if;
152:
153: if(l_issueRec.wipEntityType in (wip_constants.discrete,

Line 153: if(l_issueRec.wipEntityType in (wip_constants.discrete,

149: l_issueRec.wipSupplyType := wip_constants.push;
150: end if;
151: end if;
152:
153: if(l_issueRec.wipEntityType in (wip_constants.discrete,
154: wip_constants.lotbased,
155: wip_constants.eam)) then
156: /* commented out to prevent stuck transactions in MMTT
157: select status_type

Line 154: wip_constants.lotbased,

150: end if;
151: end if;
152:
153: if(l_issueRec.wipEntityType in (wip_constants.discrete,
154: wip_constants.lotbased,
155: wip_constants.eam)) then
156: /* commented out to prevent stuck transactions in MMTT
157: select status_type
158: into l_jobStatus

Line 155: wip_constants.eam)) then

151: end if;
152:
153: if(l_issueRec.wipEntityType in (wip_constants.discrete,
154: wip_constants.lotbased,
155: wip_constants.eam)) then
156: /* commented out to prevent stuck transactions in MMTT
157: select status_type
158: into l_jobStatus
159: from wip_discrete_jobs

Line 162: if (l_logLevel <= wip_constants.full_logging) then

158: into l_jobStatus
159: from wip_discrete_jobs
160: where wip_entity_id = l_issueRec.wipEntityID;
161:
162: if (l_logLevel <= wip_constants.full_logging) then
163: wip_logger.log('selected job status:' || l_jobStatus, l_returnStatus);
164: end if;
165:
166: if(l_jobStatus not in (wip_constants.released, wip_constants.comp_chrg)) then

Line 166: if(l_jobStatus not in (wip_constants.released, wip_constants.comp_chrg)) then

162: if (l_logLevel <= wip_constants.full_logging) then
163: wip_logger.log('selected job status:' || l_jobStatus, l_returnStatus);
164: end if;
165:
166: if(l_jobStatus not in (wip_constants.released, wip_constants.comp_chrg)) then
167: begin
168: select meaning
169: into l_JobStatus
170: from mfg_lookups

Line 195: if(l_issueRec.wipEntityType = wip_constants.eam) then

191:
192: -------------------
193: --eam issue code
194: -------------------
195: if(l_issueRec.wipEntityType = wip_constants.eam) then
196: --if error occurs, processRebuildable should put an err msg on the stack
197: if (l_logLevel <= wip_constants.full_logging) then
198: wip_logger.log('about to call EAM processor ', l_returnStatus);
199: end if;

Line 197: if (l_logLevel <= wip_constants.full_logging) then

193: --eam issue code
194: -------------------
195: if(l_issueRec.wipEntityType = wip_constants.eam) then
196: --if error occurs, processRebuildable should put an err msg on the stack
197: if (l_logLevel <= wip_constants.full_logging) then
198: wip_logger.log('about to call EAM processor ', l_returnStatus);
199: end if;
200: wip_eamMtlProc_priv.processCompTxn(p_compRec => l_issueRec,
201: x_returnStatus => x_returnStatus);

Line 208: elsif(l_issueRec.wipEntityType = wip_constants.repetitive) then

204: raise fnd_api.g_exc_unexpected_error;
205: end if;
206: end if;
207:
208: elsif(l_issueRec.wipEntityType = wip_constants.repetitive) then
209: --may be multiple schedule transactions per single issue
210: processRepetitive(p_issueRec => l_issueRec,
211: x_returnStatus => x_returnStatus);
212:

Line 238: if (l_logLevel <= wip_constants.trace_logging) then

234: raise fnd_api.g_exc_unexpected_error;
235: end if;
236: end if;
237:
238: if (l_logLevel <= wip_constants.trace_logging) then
239: wip_logger.exitPoint(p_procName => 'wip_mtlProc_priv.processTemp',
240: p_procReturnStatus => x_returnStatus,
241: p_msg => 'Transaction Succeeded',
242: x_returnStatus => l_returnStatus); --discard logging return status

Line 252: if (l_logLevel <= wip_constants.trace_logging) then

248: --processing error. return status and error msg should have already been set.
249: when no_data_found then
250: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
251: rollback to wipmtlpb_SP1;
252: if (l_logLevel <= wip_constants.trace_logging) then
253: wip_logger.exitPoint(p_procName => 'wip_mtlProc_priv.processTemp',
254: p_procReturnStatus => x_returnStatus,
255: p_msg => 'no data found exception. tmpID:' || p_txnTmpID,
256: x_returnStatus => l_returnStatus); --discard logging return status

Line 271: if (l_logLevel <= wip_constants.trace_logging) then

267:
268: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
269:
270: writeError(p_txnTmpID); --update the MMTT line to error for wip failures
271: if (l_logLevel <= wip_constants.trace_logging) then
272: wip_logger.exitPoint(p_procName => 'wip_mtlProc_priv.processTemp',
273: p_procReturnStatus => x_returnStatus,
274: p_msg => l_errMsg,
275: x_returnStatus => l_returnStatus); --discard logging return status

Line 287: if (l_logLevel <= wip_constants.trace_logging) then

283: fnd_msg_pub.add_exc_msg(p_pkg_name => 'wip_mtlProc_priv',
284: p_procedure_name => 'processTemp',
285: p_error_text => SQLERRM);
286: writeError(p_txnTmpID);
287: if (l_logLevel <= wip_constants.trace_logging) then
288: wip_logger.exitPoint(p_procName => 'wip_mtlProc_priv.processTemp',
289: p_procReturnStatus => x_returnStatus,
290: p_msg => 'item' || l_issueRec.itemID || ' unexpected error: ' || SQLERRM,
291: x_returnStatus => l_returnStatus); --discard logging return status

Line 376: if (l_logLevel <= wip_constants.full_logging) then

372: l_newIssuedQty NUMBER;
373: l_logLevel NUMBER := fnd_log.g_current_runtime_level;
374: l_dept_id NUMBER := null; /* Bugfix 5401362 */
375: begin
376: if (l_logLevel <= wip_constants.full_logging) then
377: wip_logger.log('processTxn: p_issueQty: ' || p_issueQty, l_returnStatus);
378: end if;
379: --just logs the issue record. moved to a helper just to keep procedure small
380:

Line 381: if (l_logLevel <= wip_constants.trace_logging) then

377: wip_logger.log('processTxn: p_issueQty: ' || p_issueQty, l_returnStatus);
378: end if;
379: --just logs the issue record. moved to a helper just to keep procedure small
380:
381: if (l_logLevel <= wip_constants.trace_logging) then
382: fillIssueParamTbl(p_issueRec => p_issueRec,
383: x_params => l_params);
384: l_paramCount := l_params.count;
385: l_params(l_paramCount + 1).paramName := 'p_issueQty';

Line 411: if (l_logLevel <= wip_constants.full_logging) then

407: when no_data_found then
408: l_doUpdate := false;
409: end;
410: if(l_doUpdate) then
411: if (l_logLevel <= wip_constants.full_logging) then
412: wip_logger.log('do update is true', l_returnStatus);
413: end if;
414: --below, quantity_allocated must be >= 0. At the same time, it must never increase via a return, negative issue.
415: --only the component picking process should increase the quantity_allocated column

Line 460: if (l_logLevel <= wip_constants.full_logging) then

456: end if;
457: end if;
458:
459: if(not l_doUpdate) then --create the requirement since we could not find an existing one
460: if (l_logLevel <= wip_constants.full_logging) then
461: wip_logger.log('about to do insert', l_returnStatus);
462: end if;
463:
464: /* Bugfix 5401362. Default department_id when null */

Line 542: nvl(p_issueRec.wipSupplyType, wip_constants.push),

538: p_issueRec.txnDate,
539: 0, --required_quantity
540: nvl(p_issueQty, p_issueRec.primaryQty),
541: 0, --quantity_per_assembly 15
542: nvl(p_issueRec.wipSupplyType, wip_constants.push),
543: wip_constants.yes,
544: fnd_global.conc_request_id,
545: fnd_global.prog_appl_id,
546: fnd_global.conc_program_id, --20

Line 543: wip_constants.yes,

539: 0, --required_quantity
540: nvl(p_issueQty, p_issueRec.primaryQty),
541: 0, --quantity_per_assembly 15
542: nvl(p_issueRec.wipSupplyType, wip_constants.push),
543: wip_constants.yes,
544: fnd_global.conc_request_id,
545: fnd_global.prog_appl_id,
546: fnd_global.conc_program_id, --20
547: sysdate,

Line 577: if (l_logLevel <= wip_constants.full_logging) then

573: FROM MTL_SYSTEM_ITEMS
574: WHERE ORGANIZATION_ID = p_issueRec.orgID
575: AND INVENTORY_ITEM_ID = p_issueRec.itemID;
576:
577: if (l_logLevel <= wip_constants.full_logging) then
578: wip_logger.log('inserted ' || SQL %ROWCOUNT, l_returnStatus);
579: end if;
580: end if;
581:

Line 584: if (l_logLevel <= wip_constants.trace_logging) then

580: end if;
581:
582: x_returnStatus := fnd_api.g_ret_sts_success;
583:
584: if (l_logLevel <= wip_constants.trace_logging) then
585: wip_logger.exitPoint(p_procName => 'wip_mtlProc_priv.processTxn',
586: p_procReturnStatus => x_returnStatus,
587: p_msg => 'procedure success',
588: x_returnStatus => l_returnStatus); --discard logging return status

Line 593: if (l_logLevel <= wip_constants.trace_logging) then

589: end if;
590: exception
591: when fnd_api.g_exc_unexpected_error then
592: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
593: if (l_logLevel <= wip_constants.trace_logging) then
594: wip_logger.exitPoint(p_procName => 'wip_mtlProc_priv.processTxn',
595: p_procReturnStatus => x_returnStatus,
596: p_msg => l_errMsg,
597: x_returnStatus => l_returnStatus); --discard logging return status

Line 602: when wip_constants.records_locked then

598: end if;
599: fnd_message.set_name('WIP', 'OPERATION_PROCESSING_ERROR');
600: fnd_msg_pub.add;
601: --need to add a message to the stack and count it
602: when wip_constants.records_locked then
603: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
604: if (l_logLevel <= wip_constants.trace_logging) then
605: wip_logger.exitPoint(p_procName => 'wip_mtlProc_priv.processTxn',
606: p_procReturnStatus => x_returnStatus,

Line 604: if (l_logLevel <= wip_constants.trace_logging) then

600: fnd_msg_pub.add;
601: --need to add a message to the stack and count it
602: when wip_constants.records_locked then
603: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
604: if (l_logLevel <= wip_constants.trace_logging) then
605: wip_logger.exitPoint(p_procName => 'wip_mtlProc_priv.processTxn',
606: p_procReturnStatus => x_returnStatus,
607: p_msg => 'records locked',
608: x_returnStatus => l_returnStatus);

Line 617: if (l_logLevel <= wip_constants.trace_logging) then

613: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
614: fnd_msg_pub.add_exc_msg(p_pkg_name => 'wip_mtlProc_priv',
615: p_procedure_name => 'processTxn',
616: p_error_text => SQLERRM);
617: if (l_logLevel <= wip_constants.trace_logging) then
618: wip_logger.exitPoint(p_procName => 'wip_mtlProc_priv.processTxn',
619: p_procReturnStatus => x_returnStatus,
620: p_msg => 'unexpected error: ' || SQLERRM,
621: x_returnStatus => l_returnStatus); --discard logging return status

Line 646: if(p_issueRec.wipSupplyType = wip_constants.push) then

642: x_qtyTbl := l_qtyTbl ;
643: --return status is set to success at the last line of the procedure.
644: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
645:
646: if(p_issueRec.wipSupplyType = wip_constants.push) then
647: /* Fix for bug 5373061: Added date_released condition */
648: if(p_issueRec.txnActionID in (wip_constants.isscomp_action, wip_constants.issnegc_action)) then
649: select wro.repetitive_schedule_id,
650: wro.required_quantity - wro.quantity_issued

Line 648: if(p_issueRec.txnActionID in (wip_constants.isscomp_action, wip_constants.issnegc_action)) then

644: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
645:
646: if(p_issueRec.wipSupplyType = wip_constants.push) then
647: /* Fix for bug 5373061: Added date_released condition */
648: if(p_issueRec.txnActionID in (wip_constants.isscomp_action, wip_constants.issnegc_action)) then
649: select wro.repetitive_schedule_id,
650: wro.required_quantity - wro.quantity_issued
651: bulk collect into x_schedTbl, x_qtyTbl
652: from wip_requirement_operations wro,

Line 693: if(p_issueRec.txnActionID in (wip_constants.isscomp_action, wip_constants.issnegc_action)) then

689: where organization_id = p_issueRec.orgID ;
690:
691: -- bug 5491202 end changes
692:
693: if(p_issueRec.txnActionID in (wip_constants.isscomp_action, wip_constants.issnegc_action)) then
694: select wro.repetitive_schedule_id,
695: -- bug 5491202 changed the next line to include component yield
696: -- wro.quantity_per_assembly * wmta.primary_quantity
697: round( wro.quantity_per_assembly * wmta.primary_quantity

Line 699: wip_constants.inv_max_precision)

695: -- bug 5491202 changed the next line to include component yield
696: -- wro.quantity_per_assembly * wmta.primary_quantity
697: round( wro.quantity_per_assembly * wmta.primary_quantity
698: / decode(l_include_yield,2,1,nvl(wro.component_yield_factor,1)),
699: wip_constants.inv_max_precision)
700: bulk collect into x_schedTbl, x_qtyTbl
701: from wip_repetitive_schedules wrs,
702: wip_requirement_operations wro,
703: wip_move_txn_allocations wmta

Line 721: wip_constants.inv_max_precision)

717: -- bug 5491202 changed the next line to include component yield
718: -- wro.quantity_per_assembly * wmta.primary_quantity schedQty
719: round( wro.quantity_per_assembly * wmta.primary_quantity
720: / decode(l_include_yield,2,1,nvl(wro.component_yield_factor,1)),
721: wip_constants.inv_max_precision)
722: bulk collect into x_schedTbl, x_qtyTbl
723: from wip_repetitive_schedules wrs,
724: wip_requirement_operations wro,
725: wip_move_txn_allocations wmta

Line 745: and transaction_action_id in (wip_constants.cplassy_action, wip_constants.retassy_action);

741: select count(*)
742: into l_mmttCount
743: from mtl_material_transactions_temp
744: where completion_transaction_id = p_issueRec.cplTxnID
745: and transaction_action_id in (wip_constants.cplassy_action, wip_constants.retassy_action);
746:
747: if(l_mmttCount > 0) then
748: if(p_issueRec.txnActionID in (wip_constants.isscomp_action, wip_constants.issnegc_action)) then
749: select wro.repetitive_schedule_id,

Line 748: if(p_issueRec.txnActionID in (wip_constants.isscomp_action, wip_constants.issnegc_action)) then

744: where completion_transaction_id = p_issueRec.cplTxnID
745: and transaction_action_id in (wip_constants.cplassy_action, wip_constants.retassy_action);
746:
747: if(l_mmttCount > 0) then
748: if(p_issueRec.txnActionID in (wip_constants.isscomp_action, wip_constants.issnegc_action)) then
749: select wro.repetitive_schedule_id,
750: wro.quantity_per_assembly * sum(mmta.primary_quantity) schedQty
751: bulk collect into x_schedTbl, x_qtyTbl
752: from wip_repetitive_schedules wrs,

Line 758: and mmtt.transaction_action_id in (wip_constants.cplassy_action, wip_constants.retassy_action)

754: mtl_material_txn_allocations mmta,
755: mtl_material_transactions_temp mmtt --the MMTT row(s) are the assy rows
756: where mmta.transaction_id = mmtt.material_allocation_temp_id
757: and mmtt.completion_transaction_id = p_issueRec.cplTxnID
758: and mmtt.transaction_action_id in (wip_constants.cplassy_action, wip_constants.retassy_action)
759: and wro.wip_entity_id = p_issueRec.wipEntityID
760: and wro.repetitive_schedule_id = mmta.repetitive_schedule_id
761: and wro.repetitive_schedule_id = wrs.repetitive_schedule_id
762: and wro.inventory_item_id = p_issueRec.itemID

Line 786: and mmtt.transaction_action_id in (wip_constants.cplassy_action, wip_constants.retassy_action)

782: wip_mtl_allocations_temp wmat,
783: mtl_material_transactions_temp mmtt --the MMTT row(s) are the assy rows
784: where wmat.transaction_temp_id = mmtt.transaction_temp_id
785: and mmtt.completion_transaction_id = p_issueRec.cplTxnID
786: and mmtt.transaction_action_id in (wip_constants.cplassy_action, wip_constants.retassy_action)
787: and wro.wip_entity_id = p_issueRec.wipEntityID
788: and wro.repetitive_schedule_id = wmat.repetitive_schedule_id
789: and wro.repetitive_schedule_id = wrs.repetitive_schedule_id
790: and wro.inventory_item_id = p_issueRec.itemID

Line 810: and mmtt.transaction_action_id in (wip_constants.cplassy_action, wip_constants.retassy_action)

806: mtl_material_txn_allocations mmta,
807: mtl_material_transactions_temp mmtt
808: where mmta.transaction_id = mmtt.material_allocation_temp_id
809: and mmtt.completion_transaction_id = p_issueRec.cplTxnID
810: and mmtt.transaction_action_id in (wip_constants.cplassy_action, wip_constants.retassy_action)
811: and wro.wip_entity_id = p_issueRec.wipEntityID
812: and wro.repetitive_schedule_id = mmta.repetitive_schedule_id
813: and wro.repetitive_schedule_id = wrs.repetitive_schedule_id
814: and wro.inventory_item_id = p_issueRec.itemID

Line 837: and mmtt.transaction_action_id in (wip_constants.cplassy_action, wip_constants.retassy_action)

833: wip_mtl_allocations_temp wmat,
834: mtl_material_transactions_temp mmtt --the MMTT row(s) are the assy rows
835: where wmat.transaction_temp_id = mmtt.transaction_temp_id
836: and mmtt.completion_transaction_id = p_issueRec.cplTxnID
837: and mmtt.transaction_action_id in (wip_constants.cplassy_action, wip_constants.retassy_action)
838: and wro.wip_entity_id = p_issueRec.wipEntityID
839: and wro.repetitive_schedule_id = wmat.repetitive_schedule_id
840: and wro.repetitive_schedule_id = wrs.repetitive_schedule_id
841: and wro.inventory_item_id = p_issueRec.itemID

Line 855: if(p_issueRec.txnActionID in (wip_constants.isscomp_action, wip_constants.issnegc_action)) then

851: --This case occurs when the assembly is processed online and the components background. This
852: --can happen through the desktop form since there are 2 profiles, one governing assy txn mode
853: --and the other governing component txn mode if the assy mode is online...
854: else --l_mmttCount == 0 => assy row is in MMT
855: if(p_issueRec.txnActionID in (wip_constants.isscomp_action, wip_constants.issnegc_action)) then
856: select wro.repetitive_schedule_id,
857: wro.quantity_per_assembly * sum(mmta.primary_quantity) schedQty
858: bulk collect into x_schedTbl, x_qtyTbl
859: from wip_repetitive_schedules wrs,

Line 865: and mmt.transaction_action_id in (wip_constants.cplassy_action, wip_constants.retassy_action)

861: mtl_material_txn_allocations mmta,
862: mtl_material_transactions mmt
863: where mmta.transaction_id = mmt.transaction_id
864: and mmt.completion_transaction_id = p_issueRec.cplTxnID
865: and mmt.transaction_action_id in (wip_constants.cplassy_action, wip_constants.retassy_action)
866: and wro.wip_entity_id = p_issueRec.wipEntityID
867: and wro.repetitive_schedule_id = mmta.repetitive_schedule_id
868: and wro.repetitive_schedule_id = wrs.repetitive_schedule_id
869: and wro.inventory_item_id = p_issueRec.itemID

Line 887: and mmt.transaction_action_id in (wip_constants.cplassy_action, wip_constants.retassy_action)

883: mtl_material_txn_allocations mmta,
884: mtl_material_transactions mmt
885: where mmta.transaction_id = mmt.transaction_id
886: and mmt.completion_transaction_id = p_issueRec.cplTxnID
887: and mmt.transaction_action_id in (wip_constants.cplassy_action, wip_constants.retassy_action)
888: and wro.wip_entity_id = p_issueRec.wipEntityID
889: and wro.repetitive_schedule_id = mmta.repetitive_schedule_id
890: and wro.repetitive_schedule_id = wrs.repetitive_schedule_id
891: and wro.inventory_item_id = p_issueRec.itemID

Line 928: if (l_logLevel <= wip_constants.trace_logging) then

924: l_mmta_txnQtyTbl num_tbl_t := num_tbl_t();
925: l_mmtaRowCount NUMBER := 0;
926:
927: begin
928: if (l_logLevel <= wip_constants.trace_logging) then
929: fillIssueParamTbl(p_issueRec => p_issueRec,
930: x_params => l_params);
931: wip_logger.entryPoint(p_procName => 'wip_mtlProc_priv.processRepetitive',
932: p_params => l_params,

Line 939: if (l_logLevel <= wip_constants.full_logging) then

935: raise fnd_api.g_exc_unexpected_error;
936: end if;
937: end if;
938:
939: if (l_logLevel <= wip_constants.full_logging) then
940: wip_logger.log('remaining qty:' || l_remQty, l_returnStatus);
941: end if;
942:
943: populateRepScheds(p_issueRec => p_issueRec,

Line 973: if (l_logLevel <= wip_constants.full_logging) then

969:
970: -- Fix for Bug#5374443 : Round l_qtyTbl(i) to 6 decimals as corresponding MMTT qty is rounded to 6 decimal precision.
971: l_qtyTbl(i) := round(l_qtyTbl(i),6);
972:
973: if (l_logLevel <= wip_constants.full_logging) then
974: wip_logger.log('start loop', l_returnStatus);
975: wip_logger.log(' sched_id:' || l_schedTbl(i), l_returnStatus);
976: wip_logger.log(' sched_qty:' || l_qtyTbl(i), l_returnStatus);
977: end if;

Line 979: if(round(l_qtyTbl(i), wip_constants.inv_max_precision) = 0) then

975: wip_logger.log(' sched_id:' || l_schedTbl(i), l_returnStatus);
976: wip_logger.log(' sched_qty:' || l_qtyTbl(i), l_returnStatus);
977: end if;
978:
979: if(round(l_qtyTbl(i), wip_constants.inv_max_precision) = 0) then
980: goto END_OF_LOOP;
981: end if;
982: if(l_remQty > abs(l_qtyTbl(i))) then
983: l_remQty := l_remQty - abs(l_qtyTbl(i));

Line 989: if (l_logLevel <= wip_constants.full_logging) then

985: else
986: l_issueQty := l_remQty * sign(p_issueRec.primaryQty);
987: l_remQty := 0;
988: end if;
989: if (l_logLevel <= wip_constants.full_logging) then
990: wip_logger.log(' l_remQty:' || l_remQty, l_returnStatus);
991: wip_logger.log(' l_issQty:' || l_issueQty, l_returnStatus);
992: wip_logger.log(' sign(priQty):' || sign(p_issueRec.primaryQty), l_returnStatus);
993: end if;

Line 1003: l_mmta_txnQtyTbl(l_mmtaRowCount) := round(-1 * (l_issueQty/p_issueRec.primaryQty) * p_issueRec.txnQty, wip_constants.inv_max_precision);

999: end if;
1000: l_mmtaRowCount := l_mmtaRowCount + 1;
1001: l_mmta_schedIdTbl(l_mmtaRowCount) := l_schedTbl(i);
1002: l_mmta_priQtyTbl(l_mmtaRowCount) := -1 * l_issueQty; --make qty relative to inv for quantities
1003: l_mmta_txnQtyTbl(l_mmtaRowCount) := round(-1 * (l_issueQty/p_issueRec.primaryQty) * p_issueRec.txnQty, wip_constants.inv_max_precision);
1004:
1005: if (l_logLevel <= wip_constants.full_logging) then
1006: wip_logger.log('inserted sched:' || l_schedTbl(i) || '; qty:' || l_mmta_priQtyTbl(l_mmtaRowCount), l_returnStatus);
1007: end if;

Line 1005: if (l_logLevel <= wip_constants.full_logging) then

1001: l_mmta_schedIdTbl(l_mmtaRowCount) := l_schedTbl(i);
1002: l_mmta_priQtyTbl(l_mmtaRowCount) := -1 * l_issueQty; --make qty relative to inv for quantities
1003: l_mmta_txnQtyTbl(l_mmtaRowCount) := round(-1 * (l_issueQty/p_issueRec.primaryQty) * p_issueRec.txnQty, wip_constants.inv_max_precision);
1004:
1005: if (l_logLevel <= wip_constants.full_logging) then
1006: wip_logger.log('inserted sched:' || l_schedTbl(i) || '; qty:' || l_mmta_priQtyTbl(l_mmtaRowCount), l_returnStatus);
1007: end if;
1008:
1009: processTxn(p_issueRec => p_issueRec,

Line 1021: if (l_logLevel <= wip_constants.full_logging) then

1017: end if;
1018: <>
1019: null;
1020: end loop;
1021: if (l_logLevel <= wip_constants.full_logging) then
1022: wip_logger.log('remQty:' || l_remQty, l_returnStatus);
1023: end if;
1024:
1025: if(l_remQty > 0) then --should only happen for push txns

Line 1033: and wrs.status_type in (WIP_CONSTANTS.RELEASED, WIP_CONSTANTS.COMP_CHRG)

1029: into l_excessQtySchedID
1030: from wip_repetitive_schedules wrs
1031: where wrs.wip_entity_id = p_issueRec.wipEntityID
1032: and wrs.line_id = p_issueRec.repLineID
1033: and wrs.status_type in (WIP_CONSTANTS.RELEASED, WIP_CONSTANTS.COMP_CHRG)
1034: and wrs.date_released < p_issueRec.txnDate
1035: and first_unit_start_date = (select min(first_unit_start_date)
1036: from wip_repetitive_schedules
1037: where wip_entity_id = p_issueRec.wipEntityID

Line 1039: and status_type in (WIP_CONSTANTS.RELEASED, WIP_CONSTANTS.COMP_CHRG)

1035: and first_unit_start_date = (select min(first_unit_start_date)
1036: from wip_repetitive_schedules
1037: where wip_entity_id = p_issueRec.wipEntityID
1038: and line_id = p_issueRec.repLineID
1039: and status_type in (WIP_CONSTANTS.RELEASED, WIP_CONSTANTS.COMP_CHRG)
1040: and date_released < p_issueRec.txnDate)
1041:
1042: order by wrs.first_unit_start_date;
1043: end if;

Line 1058: l_mmta_txnQtyTbl(l_mmtaRowCount) := nvl(l_mmta_txnQtyTbl(l_mmtaRowCount),0) + round(-1 * (l_issueQty/p_issueRec.primaryQty) * p_issueRec.txnQty, wip_constants.inv_max_precision);

1054:
1055: /* Fix for bug 5729726: Add excess quantity to the existing allocation quantity, if any, instead of over-writing the
1056: existing allocation quantity with the excess quantity. This will prevent incorrect allocation and MMT-MMTA Mismatch */
1057: l_mmta_priQtyTbl(l_mmtaRowCount) := nvl(l_mmta_priQtyTbl(l_mmtaRowCount),0) - l_issueQty;--make qty relative to inventory
1058: l_mmta_txnQtyTbl(l_mmtaRowCount) := nvl(l_mmta_txnQtyTbl(l_mmtaRowCount),0) + round(-1 * (l_issueQty/p_issueRec.primaryQty) * p_issueRec.txnQty, wip_constants.inv_max_precision);
1059:
1060: -- l_mmta_priQtyTbl(l_mmtaRowCount) := -1 * l_issueQty;--make qty relative to inventory
1061: -- l_mmta_txnQtyTbl(l_mmtaRowCount) := round(-1 * (l_issueQty/p_issueRec.primaryQty) * p_issueRec.txnQty, wip_constants.inv_max_precision);
1062: /*End of fix 5729726:*/

Line 1061: -- l_mmta_txnQtyTbl(l_mmtaRowCount) := round(-1 * (l_issueQty/p_issueRec.primaryQty) * p_issueRec.txnQty, wip_constants.inv_max_precision);

1057: l_mmta_priQtyTbl(l_mmtaRowCount) := nvl(l_mmta_priQtyTbl(l_mmtaRowCount),0) - l_issueQty;--make qty relative to inventory
1058: l_mmta_txnQtyTbl(l_mmtaRowCount) := nvl(l_mmta_txnQtyTbl(l_mmtaRowCount),0) + round(-1 * (l_issueQty/p_issueRec.primaryQty) * p_issueRec.txnQty, wip_constants.inv_max_precision);
1059:
1060: -- l_mmta_priQtyTbl(l_mmtaRowCount) := -1 * l_issueQty;--make qty relative to inventory
1061: -- l_mmta_txnQtyTbl(l_mmtaRowCount) := round(-1 * (l_issueQty/p_issueRec.primaryQty) * p_issueRec.txnQty, wip_constants.inv_max_precision);
1062: /*End of fix 5729726:*/
1063:
1064: processTxn(p_issueRec => p_issueRec,
1065: p_issueQty => l_issueQty,

Line 1074: if (l_logLevel <= wip_constants.full_logging) then

1070: raise fnd_api.g_exc_unexpected_error;
1071: end if;
1072: end if;
1073:
1074: if (l_logLevel <= wip_constants.full_logging) then
1075: wip_logger.log('rowcount ' || l_mmtaRowCount || ' rows.', l_returnStatus);
1076: end if;
1077:
1078: --now trim unused rows

Line 1118: if (l_logLevel <= wip_constants.full_logging) then

1114: l_mmta_priQtyTbl(i),
1115: l_mmta_txnQtyTbl(i),
1116: p_issueRec.txnDate);
1117:
1118: if (l_logLevel <= wip_constants.full_logging) then
1119: wip_logger.log(SQL%ROWCOUNT || ' row inserted into MMTA', l_returnStatus);
1120: wip_logger.log('txn id' || p_issueRec.mtlTxnID, l_returnStatus);
1121: end if;
1122:

Line 1123: if (l_logLevel <= wip_constants.trace_logging) then

1119: wip_logger.log(SQL%ROWCOUNT || ' row inserted into MMTA', l_returnStatus);
1120: wip_logger.log('txn id' || p_issueRec.mtlTxnID, l_returnStatus);
1121: end if;
1122:
1123: if (l_logLevel <= wip_constants.trace_logging) then
1124: wip_logger.exitPoint(p_procName => 'wip_mtlProc_priv.processRepetitive',
1125: p_procReturnStatus => x_returnStatus,
1126: p_msg => 'procedure success.',
1127: x_returnStatus => l_returnStatus); --discard logging return status

Line 1132: if (l_logLevel <= wip_constants.trace_logging) then

1128: end if;
1129: exception
1130: when fnd_api.g_exc_unexpected_error then
1131: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
1132: if (l_logLevel <= wip_constants.trace_logging) then
1133: wip_logger.exitPoint(p_procName => 'wip_mtlProc_priv.processRepetitive',
1134: p_procReturnStatus => x_returnStatus,
1135: p_msg => l_errMsg,
1136: x_returnStatus => l_returnStatus); --discard logging return status

Line 1143: if (l_logLevel <= wip_constants.trace_logging) then

1139: x_returnStatus := fnd_api.g_ret_sts_unexp_error;
1140: fnd_msg_pub.add_exc_msg(p_pkg_name => 'wip_mtlProc_priv',
1141: p_procedure_name => 'processRepetitive',
1142: p_error_text => SQLERRM);
1143: if (l_logLevel <= wip_constants.trace_logging) then
1144: wip_logger.exitPoint(p_procName => 'wip_mtlProc_priv.processRepetitive',
1145: p_procReturnStatus => x_returnStatus,
1146: p_msg => 'unexpected error: ' || SQLERRM,
1147: x_returnStatus => l_returnStatus); --discard logging return status

Line 1162: if (l_logLevel <= wip_constants.full_logging) then

1158: wip_utilities.get_message_stack(p_delete_stack => fnd_api.g_false,
1159: p_msg => l_errExpl);
1160: fnd_message.set_name('WIP', 'MTL_PROC_FAIL');
1161: l_errCode := fnd_message.get;
1162: if (l_logLevel <= wip_constants.full_logging) then
1163: wip_logger.log('writeError: tempID is ' || p_txnTmpID, l_returnStatus);
1164: wip_logger.log('writeError: errCode is ' ||l_errCode, l_returnStatus);
1165: wip_logger.log('writeError: errExpl is ' ||l_errExpl, l_returnStatus);
1166: end if;

Line 1188: IF (l_log_level <= wip_constants.trace_logging) THEN

1184: l_return_status VARCHAR(1);
1185: l_params wip_logger.param_tbl_t;
1186: BEGIN
1187: l_process_phase := '1';
1188: IF (l_log_level <= wip_constants.trace_logging) THEN
1189: l_params(1).paramName := 'p_mtl_header_id';
1190: l_params(1).paramValue := p_mtl_header_id;
1191: wip_logger.entryPoint(p_procName => 'wip_mtlProc_priv.processOATxn',
1192: p_params => l_params,

Line 1212: p_txnMode => WIP_CONSTANTS.ONLINE,

1208: l_process_phase := '3';
1209: wip_mtlTempProc_priv.processTemp
1210: (p_initMsgList => fnd_api.g_true,
1211: p_txnHdrID => p_mtl_header_id,
1212: p_txnMode => WIP_CONSTANTS.ONLINE,
1213: x_returnStatus => x_returnStatus,
1214: x_errorMsg => l_error_msg);
1215:
1216: IF(x_returnStatus <> fnd_api.g_ret_sts_success) THEN

Line 1226: IF (l_log_level <= wip_constants.trace_logging) THEN

1222: l_process_phase := '4';
1223: x_returnStatus := fnd_api.g_ret_sts_success;
1224:
1225: -- write to the log file
1226: IF (l_log_level <= wip_constants.trace_logging) THEN
1227: wip_logger.exitPoint(p_procName => 'wip_mtlProc_priv.processOATxn',
1228: p_procReturnStatus => x_returnStatus,
1229: p_msg => 'procedure complete',
1230: x_returnStatus => l_return_status);

Line 1239: IF (l_log_level <= wip_constants.trace_logging) THEN

1235: WHEN fnd_api.g_exc_unexpected_error THEN
1236: ROLLBACK TO SAVEPOINT s_oa_txn_proc;
1237: x_returnStatus := fnd_api.g_ret_sts_error;
1238:
1239: IF (l_log_level <= wip_constants.trace_logging) THEN
1240: wip_logger.exitPoint(p_procName => 'wip_mtlProc_priv.processOATxn',
1241: p_procReturnStatus => x_returnStatus,
1242: p_msg => 'wip_cplProc_priv.processOATxn failed : '
1243: || l_process_phase,

Line 1258: IF (l_log_level <= wip_constants.trace_logging) THEN

1254: fnd_message.set_name('FND', 'FND_GENERIC_MESSAGE');
1255: fnd_message.set_token('MESSAGE', l_error_msg);
1256: fnd_msg_pub.add;
1257:
1258: IF (l_log_level <= wip_constants.trace_logging) THEN
1259: wip_logger.exitPoint(p_procName => 'wip_cplProc_priv.processOATxn',
1260: p_procReturnStatus => x_returnStatus,
1261: p_msg => l_error_msg || ' : ' || l_process_phase,
1262: x_returnStatus => l_return_status);