DBA Data[Home] [Help]

APPS.MSC_ATP_SUBST dependencies on MSC_SCH_WB

Line 58: msc_sch_wb.atp_debug('qty_from_children(' ||l_parent||'): ' ||

54: least(l_qty, l_PO_qty);
55: END IF;
56: --bug3467631
57: IF PG_DEBUG in ('Y', 'C') THEN
58: msc_sch_wb.atp_debug('qty_from_children(' ||l_parent||'): ' ||
59: p_org_avail_info.quantity_from_children(l_parent));
60: msc_sch_wb.atp_debug('rnding_leftover(' ||j||'): ' ||
61: p_org_avail_info.rnding_leftover(j));
62: END IF;

Line 60: msc_sch_wb.atp_debug('rnding_leftover(' ||j||'): ' ||

56: --bug3467631
57: IF PG_DEBUG in ('Y', 'C') THEN
58: msc_sch_wb.atp_debug('qty_from_children(' ||l_parent||'): ' ||
59: p_org_avail_info.quantity_from_children(l_parent));
60: msc_sch_wb.atp_debug('rnding_leftover(' ||j||'): ' ||
61: p_org_avail_info.rnding_leftover(j));
62: END IF;
63: j := l_parent;
64: end loop;

Line 77: msc_sch_wb.atp_debug('req_dmd_qty1: ' || p_qty);

73: l_qty number;
74: l_parent number;
75: BEGIN
76: IF p_org_idx = 1 THEN
77: msc_sch_wb.atp_debug('req_dmd_qty1: ' || p_qty);
78: return p_qty;
79: END IF;
80:
81: l_parent := p_org_avail_info.parent_org_idx(p_org_idx);

Line 87: msc_sch_wb.atp_debug('req_dmd_qty0: ' || l_qty);

83: IF nvl(p_org_avail_info.rounding_flag(l_parent), 2) = 1 THEN
84: l_qty := CEIL(l_qty);
85: END IF;
86:
87: msc_sch_wb.atp_debug('req_dmd_qty0: ' || l_qty);
88: l_qty := l_qty * p_org_avail_info.conversion_rate(p_org_idx);
89: l_qty := l_qty - nvl(p_org_avail_info.rnding_leftover(p_org_idx),0);
90:
91: msc_sch_wb.atp_debug('rnding_leftover('||p_org_idx||'): ' || nvl(p_org_avail_info.rnding_leftover(p_org_idx),0));

Line 91: msc_sch_wb.atp_debug('rnding_leftover('||p_org_idx||'): ' || nvl(p_org_avail_info.rnding_leftover(p_org_idx),0));

87: msc_sch_wb.atp_debug('req_dmd_qty0: ' || l_qty);
88: l_qty := l_qty * p_org_avail_info.conversion_rate(p_org_idx);
89: l_qty := l_qty - nvl(p_org_avail_info.rnding_leftover(p_org_idx),0);
90:
91: msc_sch_wb.atp_debug('rnding_leftover('||p_org_idx||'): ' || nvl(p_org_avail_info.rnding_leftover(p_org_idx),0));
92: msc_sch_wb.atp_debug('req_dmd_qty: ' || l_qty);
93: return l_qty;
94: END org_req_dmd_qty;
95:

Line 92: msc_sch_wb.atp_debug('req_dmd_qty: ' || l_qty);

88: l_qty := l_qty * p_org_avail_info.conversion_rate(p_org_idx);
89: l_qty := l_qty - nvl(p_org_avail_info.rnding_leftover(p_org_idx),0);
90:
91: msc_sch_wb.atp_debug('rnding_leftover('||p_org_idx||'): ' || nvl(p_org_avail_info.rnding_leftover(p_org_idx),0));
92: msc_sch_wb.atp_debug('req_dmd_qty: ' || l_qty);
93: return l_qty;
94: END org_req_dmd_qty;
95:
96: PROCEDURE Extend_Org_Avail_Info_Rec (

Line 212: msc_sch_wb.atp_debug('Prep_Common_Pegging_Rec: ' || 'Atf_Date ' || org_avail_info.Atf_Date(p_org_idx));

208: x_pegging_rec.aggregate_time_fence_date:= org_avail_info.Atf_Date(p_org_idx);
209: --populating atf date in pegging as records are deleted from alloc table
210: --based on atf date also.
211: IF PG_DEBUG in ('Y', 'C') THEN
212: msc_sch_wb.atp_debug('Prep_Common_Pegging_Rec: ' || 'Atf_Date ' || org_avail_info.Atf_Date(p_org_idx));
213: msc_sch_wb.atp_debug('Prep_Common_Pegging_Rec: ' || 'inventory_item_id ' || x_pegging_rec.inventory_item_id);
214: msc_sch_wb.atp_debug('Prep_Common_Pegging_Rec: ' || 'inventory_item_name ' || x_pegging_rec.inventory_item_name);
215: END IF;
216: --bug3467631 end

Line 213: msc_sch_wb.atp_debug('Prep_Common_Pegging_Rec: ' || 'inventory_item_id ' || x_pegging_rec.inventory_item_id);

209: --populating atf date in pegging as records are deleted from alloc table
210: --based on atf date also.
211: IF PG_DEBUG in ('Y', 'C') THEN
212: msc_sch_wb.atp_debug('Prep_Common_Pegging_Rec: ' || 'Atf_Date ' || org_avail_info.Atf_Date(p_org_idx));
213: msc_sch_wb.atp_debug('Prep_Common_Pegging_Rec: ' || 'inventory_item_id ' || x_pegging_rec.inventory_item_id);
214: msc_sch_wb.atp_debug('Prep_Common_Pegging_Rec: ' || 'inventory_item_name ' || x_pegging_rec.inventory_item_name);
215: END IF;
216: --bug3467631 end
217: END Prep_Common_Pegging_Rec;

Line 214: msc_sch_wb.atp_debug('Prep_Common_Pegging_Rec: ' || 'inventory_item_name ' || x_pegging_rec.inventory_item_name);

210: --based on atf date also.
211: IF PG_DEBUG in ('Y', 'C') THEN
212: msc_sch_wb.atp_debug('Prep_Common_Pegging_Rec: ' || 'Atf_Date ' || org_avail_info.Atf_Date(p_org_idx));
213: msc_sch_wb.atp_debug('Prep_Common_Pegging_Rec: ' || 'inventory_item_id ' || x_pegging_rec.inventory_item_id);
214: msc_sch_wb.atp_debug('Prep_Common_Pegging_Rec: ' || 'inventory_item_name ' || x_pegging_rec.inventory_item_name);
215: END IF;
216: --bug3467631 end
217: END Prep_Common_Pegging_Rec;
218:

Line 230: msc_sch_wb.atp_debug('Prep_Demand_Pegging_Rec');

226: p_item_idx In NUMBER
227: ) IS
228: BEGIN
229: IF PG_DEBUG in ('Y', 'C') THEN
230: msc_sch_wb.atp_debug('Prep_Demand_Pegging_Rec');
231: END IF;
232:
233: Prep_Common_pegging_rec(x_pegging_rec,
234: p_atp_record,

Line 254: msc_sch_wb.atp_debug('Prep_Demand_Pegging_Rec: ' || 'inventory_item_name ' || org_avail_info.family_item_name(p_org_idx));

250: THEN
251: x_pegging_rec.inventory_item_id:= org_avail_info.family_sr_id(p_org_idx);
252: x_pegging_rec.inventory_item_name := org_avail_info.family_item_name(p_org_idx);
253: IF PG_DEBUG in ('Y', 'C') THEN
254: msc_sch_wb.atp_debug('Prep_Demand_Pegging_Rec: ' || 'inventory_item_name ' || org_avail_info.family_item_name(p_org_idx));
255: msc_sch_wb.atp_debug('Prep_Demand_Pegging_Rec: ' || 'x_pegging_rec.inventory_item_id ' || org_avail_info.family_sr_id(p_org_idx));
256: END IF;
257: END IF;
258: --bug3467631

Line 255: msc_sch_wb.atp_debug('Prep_Demand_Pegging_Rec: ' || 'x_pegging_rec.inventory_item_id ' || org_avail_info.family_sr_id(p_org_idx));

251: x_pegging_rec.inventory_item_id:= org_avail_info.family_sr_id(p_org_idx);
252: x_pegging_rec.inventory_item_name := org_avail_info.family_item_name(p_org_idx);
253: IF PG_DEBUG in ('Y', 'C') THEN
254: msc_sch_wb.atp_debug('Prep_Demand_Pegging_Rec: ' || 'inventory_item_name ' || org_avail_info.family_item_name(p_org_idx));
255: msc_sch_wb.atp_debug('Prep_Demand_Pegging_Rec: ' || 'x_pegging_rec.inventory_item_id ' || org_avail_info.family_sr_id(p_org_idx));
256: END IF;
257: END IF;
258: --bug3467631
259: x_pegging_rec.pegging_id := org_avail_info.demand_pegging_id(p_org_idx);

Line 286: msc_sch_wb.atp_debug('Prep_Demand_Pegging_Rec: ' || 'pegging_id ' || x_pegging_rec.pegging_id);

282:
283: x_pegging_rec.pegging_type := ORG_DEMAND_PEG_TYP;
284:
285: IF PG_DEBUG in ('Y', 'C') THEN
286: msc_sch_wb.atp_debug('Prep_Demand_Pegging_Rec: ' || 'pegging_id ' || x_pegging_rec.pegging_id);
287: msc_sch_wb.atp_debug('Prep_Demand_Pegging_Rec: ' || 'parent_pegging_id ' || x_pegging_rec.parent_pegging_id);
288: msc_sch_wb.atp_debug('Prep_Demand_Pegging_Rec: ' || 'end_pegging_id ' || x_pegging_rec.end_pegging_id);
289: END IF;
290:

Line 287: msc_sch_wb.atp_debug('Prep_Demand_Pegging_Rec: ' || 'parent_pegging_id ' || x_pegging_rec.parent_pegging_id);

283: x_pegging_rec.pegging_type := ORG_DEMAND_PEG_TYP;
284:
285: IF PG_DEBUG in ('Y', 'C') THEN
286: msc_sch_wb.atp_debug('Prep_Demand_Pegging_Rec: ' || 'pegging_id ' || x_pegging_rec.pegging_id);
287: msc_sch_wb.atp_debug('Prep_Demand_Pegging_Rec: ' || 'parent_pegging_id ' || x_pegging_rec.parent_pegging_id);
288: msc_sch_wb.atp_debug('Prep_Demand_Pegging_Rec: ' || 'end_pegging_id ' || x_pegging_rec.end_pegging_id);
289: END IF;
290:
291: END Prep_Demand_Pegging_Rec;

Line 288: msc_sch_wb.atp_debug('Prep_Demand_Pegging_Rec: ' || 'end_pegging_id ' || x_pegging_rec.end_pegging_id);

284:
285: IF PG_DEBUG in ('Y', 'C') THEN
286: msc_sch_wb.atp_debug('Prep_Demand_Pegging_Rec: ' || 'pegging_id ' || x_pegging_rec.pegging_id);
287: msc_sch_wb.atp_debug('Prep_Demand_Pegging_Rec: ' || 'parent_pegging_id ' || x_pegging_rec.parent_pegging_id);
288: msc_sch_wb.atp_debug('Prep_Demand_Pegging_Rec: ' || 'end_pegging_id ' || x_pegging_rec.end_pegging_id);
289: END IF;
290:
291: END Prep_Demand_Pegging_Rec;
292:

Line 319: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec');

315: ) IS
316: l_parent_idx NUMBER;
317: BEGIN
318: IF PG_DEBUG in ('Y', 'C') THEN
319: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec');
320: END IF;
321:
322: l_parent_idx := org_avail_info.parent_org_idx(p_org_idx);
323:

Line 332: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'parent_idx ' || l_parent_idx);

328: item_availability_info,
329: p_item_idx);
330:
331: IF PG_DEBUG in ('Y', 'C') THEN
332: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'parent_idx ' || l_parent_idx);
333: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'p_org_idx ' || p_org_idx);
334: END IF;
335:
336: -- time_phased_atp changes begin

Line 333: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'p_org_idx ' || p_org_idx);

329: p_item_idx);
330:
331: IF PG_DEBUG in ('Y', 'C') THEN
332: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'parent_idx ' || l_parent_idx);
333: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'p_org_idx ' || p_org_idx);
334: END IF;
335:
336: -- time_phased_atp changes begin
337: --bug3467631 start

Line 413: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'required_quantity: ' || x_pegging_rec.required_quantity);

409: END IF;
410: x_pegging_rec.required_date := org_avail_info.requested_ship_date(p_org_idx);
411:
412: IF PG_DEBUG in ('Y', 'C') THEN
413: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'required_quantity: ' || x_pegging_rec.required_quantity);
414: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'required_date: ' || x_pegging_rec.required_date);
415: END IF;
416:
417: x_pegging_rec.pegging_type := 6;

Line 414: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'required_date: ' || x_pegging_rec.required_date);

410: x_pegging_rec.required_date := org_avail_info.requested_ship_date(p_org_idx);
411:
412: IF PG_DEBUG in ('Y', 'C') THEN
413: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'required_quantity: ' || x_pegging_rec.required_quantity);
414: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'required_date: ' || x_pegging_rec.required_date);
415: END IF;
416:
417: x_pegging_rec.pegging_type := 6;
418: -- Bug 3826234

Line 425: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'pegging_id ' || x_pegging_rec.pegging_id);

421: x_pegging_rec.intransit_cal_code := org_avail_info.intransit_cal_code(p_org_idx);
422: x_pegging_rec.manufacturing_cal_code := org_avail_info.manufacturing_cal_code(p_org_idx);
423:
424: IF PG_DEBUG in ('Y', 'C') THEN
425: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'pegging_id ' || x_pegging_rec.pegging_id);
426: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'parent_pegging_id ' || x_pegging_rec.parent_pegging_id);
427: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'end_pegging_id ' || x_pegging_rec.end_pegging_id);
428: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'shipping_cal_code ' || x_pegging_rec.shipping_cal_code);
429: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'receiving_cal_code ' || x_pegging_rec.receiving_cal_code);

Line 426: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'parent_pegging_id ' || x_pegging_rec.parent_pegging_id);

422: x_pegging_rec.manufacturing_cal_code := org_avail_info.manufacturing_cal_code(p_org_idx);
423:
424: IF PG_DEBUG in ('Y', 'C') THEN
425: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'pegging_id ' || x_pegging_rec.pegging_id);
426: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'parent_pegging_id ' || x_pegging_rec.parent_pegging_id);
427: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'end_pegging_id ' || x_pegging_rec.end_pegging_id);
428: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'shipping_cal_code ' || x_pegging_rec.shipping_cal_code);
429: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'receiving_cal_code ' || x_pegging_rec.receiving_cal_code);
430: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'intransit_cal_code ' || x_pegging_rec.intransit_cal_code);

Line 427: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'end_pegging_id ' || x_pegging_rec.end_pegging_id);

423:
424: IF PG_DEBUG in ('Y', 'C') THEN
425: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'pegging_id ' || x_pegging_rec.pegging_id);
426: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'parent_pegging_id ' || x_pegging_rec.parent_pegging_id);
427: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'end_pegging_id ' || x_pegging_rec.end_pegging_id);
428: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'shipping_cal_code ' || x_pegging_rec.shipping_cal_code);
429: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'receiving_cal_code ' || x_pegging_rec.receiving_cal_code);
430: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'intransit_cal_code ' || x_pegging_rec.intransit_cal_code);
431: END IF;

Line 428: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'shipping_cal_code ' || x_pegging_rec.shipping_cal_code);

424: IF PG_DEBUG in ('Y', 'C') THEN
425: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'pegging_id ' || x_pegging_rec.pegging_id);
426: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'parent_pegging_id ' || x_pegging_rec.parent_pegging_id);
427: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'end_pegging_id ' || x_pegging_rec.end_pegging_id);
428: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'shipping_cal_code ' || x_pegging_rec.shipping_cal_code);
429: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'receiving_cal_code ' || x_pegging_rec.receiving_cal_code);
430: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'intransit_cal_code ' || x_pegging_rec.intransit_cal_code);
431: END IF;
432:

Line 429: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'receiving_cal_code ' || x_pegging_rec.receiving_cal_code);

425: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'pegging_id ' || x_pegging_rec.pegging_id);
426: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'parent_pegging_id ' || x_pegging_rec.parent_pegging_id);
427: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'end_pegging_id ' || x_pegging_rec.end_pegging_id);
428: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'shipping_cal_code ' || x_pegging_rec.shipping_cal_code);
429: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'receiving_cal_code ' || x_pegging_rec.receiving_cal_code);
430: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'intransit_cal_code ' || x_pegging_rec.intransit_cal_code);
431: END IF;
432:
433: END Prep_PO_Pegging_Rec;

Line 430: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'intransit_cal_code ' || x_pegging_rec.intransit_cal_code);

426: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'parent_pegging_id ' || x_pegging_rec.parent_pegging_id);
427: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'end_pegging_id ' || x_pegging_rec.end_pegging_id);
428: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'shipping_cal_code ' || x_pegging_rec.shipping_cal_code);
429: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'receiving_cal_code ' || x_pegging_rec.receiving_cal_code);
430: msc_sch_wb.atp_debug('Prep_PO_Pegging_Rec: ' || 'intransit_cal_code ' || x_pegging_rec.intransit_cal_code);
431: END IF;
432:
433: END Prep_PO_Pegging_Rec;
434:

Line 447: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec');

443: ) IS
444: l_parent_idx NUMBER;
445: BEGIN
446: IF PG_DEBUG in ('Y', 'C') THEN
447: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec');
448: END IF;
449:
450: l_parent_idx := org_avail_info.parent_org_idx(p_org_idx);
451:

Line 453: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'parent_idx ' || l_parent_idx);

449:
450: l_parent_idx := org_avail_info.parent_org_idx(p_org_idx);
451:
452: IF PG_DEBUG in ('Y', 'C') THEN
453: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'parent_idx ' || l_parent_idx);
454: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'p_org_idx ' || p_org_idx);
455: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'item_availability_info.sr_inventory_item_id(p_item_idx) ' || item_availability_info.sr_inventory_item_id(p_item_idx));
456: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'item_availability_info.family_sr_id(p_item_idx) ' || item_availability_info.family_sr_id(p_item_idx));
457: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'org_avail_info.requested_ship_date(p_org_idx) ' || org_avail_info.requested_ship_date(p_org_idx));

Line 454: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'p_org_idx ' || p_org_idx);

450: l_parent_idx := org_avail_info.parent_org_idx(p_org_idx);
451:
452: IF PG_DEBUG in ('Y', 'C') THEN
453: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'parent_idx ' || l_parent_idx);
454: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'p_org_idx ' || p_org_idx);
455: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'item_availability_info.sr_inventory_item_id(p_item_idx) ' || item_availability_info.sr_inventory_item_id(p_item_idx));
456: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'item_availability_info.family_sr_id(p_item_idx) ' || item_availability_info.family_sr_id(p_item_idx));
457: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'org_avail_info.requested_ship_date(p_org_idx) ' || org_avail_info.requested_ship_date(p_org_idx));
458: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'item_availability_info.atf_date(p_item_idx) ' || item_availability_info.atf_date(p_item_idx));

Line 455: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'item_availability_info.sr_inventory_item_id(p_item_idx) ' || item_availability_info.sr_inventory_item_id(p_item_idx));

451:
452: IF PG_DEBUG in ('Y', 'C') THEN
453: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'parent_idx ' || l_parent_idx);
454: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'p_org_idx ' || p_org_idx);
455: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'item_availability_info.sr_inventory_item_id(p_item_idx) ' || item_availability_info.sr_inventory_item_id(p_item_idx));
456: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'item_availability_info.family_sr_id(p_item_idx) ' || item_availability_info.family_sr_id(p_item_idx));
457: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'org_avail_info.requested_ship_date(p_org_idx) ' || org_avail_info.requested_ship_date(p_org_idx));
458: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'item_availability_info.atf_date(p_item_idx) ' || item_availability_info.atf_date(p_item_idx));
459: END IF;

Line 456: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'item_availability_info.family_sr_id(p_item_idx) ' || item_availability_info.family_sr_id(p_item_idx));

452: IF PG_DEBUG in ('Y', 'C') THEN
453: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'parent_idx ' || l_parent_idx);
454: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'p_org_idx ' || p_org_idx);
455: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'item_availability_info.sr_inventory_item_id(p_item_idx) ' || item_availability_info.sr_inventory_item_id(p_item_idx));
456: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'item_availability_info.family_sr_id(p_item_idx) ' || item_availability_info.family_sr_id(p_item_idx));
457: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'org_avail_info.requested_ship_date(p_org_idx) ' || org_avail_info.requested_ship_date(p_org_idx));
458: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'item_availability_info.atf_date(p_item_idx) ' || item_availability_info.atf_date(p_item_idx));
459: END IF;
460:

Line 457: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'org_avail_info.requested_ship_date(p_org_idx) ' || org_avail_info.requested_ship_date(p_org_idx));

453: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'parent_idx ' || l_parent_idx);
454: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'p_org_idx ' || p_org_idx);
455: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'item_availability_info.sr_inventory_item_id(p_item_idx) ' || item_availability_info.sr_inventory_item_id(p_item_idx));
456: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'item_availability_info.family_sr_id(p_item_idx) ' || item_availability_info.family_sr_id(p_item_idx));
457: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'org_avail_info.requested_ship_date(p_org_idx) ' || org_avail_info.requested_ship_date(p_org_idx));
458: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'item_availability_info.atf_date(p_item_idx) ' || item_availability_info.atf_date(p_item_idx));
459: END IF;
460:
461: Prep_Common_pegging_rec(x_pegging_rec,

Line 458: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'item_availability_info.atf_date(p_item_idx) ' || item_availability_info.atf_date(p_item_idx));

454: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'p_org_idx ' || p_org_idx);
455: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'item_availability_info.sr_inventory_item_id(p_item_idx) ' || item_availability_info.sr_inventory_item_id(p_item_idx));
456: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'item_availability_info.family_sr_id(p_item_idx) ' || item_availability_info.family_sr_id(p_item_idx));
457: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'org_avail_info.requested_ship_date(p_org_idx) ' || org_avail_info.requested_ship_date(p_org_idx));
458: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'item_availability_info.atf_date(p_item_idx) ' || item_availability_info.atf_date(p_item_idx));
459: END IF;
460:
461: Prep_Common_pegging_rec(x_pegging_rec,
462: p_atp_record,

Line 498: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'x_pegging_rec.inventory_item_id ' || x_pegging_rec.inventory_item_id);

494: --bug3467631 end
495: -- time_phased_atp changes end
496:
497: IF PG_DEBUG in ('Y', 'C') THEN
498: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'x_pegging_rec.inventory_item_id ' || x_pegging_rec.inventory_item_id);
499: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'x_pegging_rec.inventory_item_name ' || x_pegging_rec.inventory_item_name);
500: END IF;
501:
502: x_pegging_rec.parent_pegging_id:= org_avail_info.demand_pegging_id(p_org_idx);

Line 499: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'x_pegging_rec.inventory_item_name ' || x_pegging_rec.inventory_item_name);

495: -- time_phased_atp changes end
496:
497: IF PG_DEBUG in ('Y', 'C') THEN
498: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'x_pegging_rec.inventory_item_id ' || x_pegging_rec.inventory_item_id);
499: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'x_pegging_rec.inventory_item_name ' || x_pegging_rec.inventory_item_name);
500: END IF;
501:
502: x_pegging_rec.parent_pegging_id:= org_avail_info.demand_pegging_id(p_org_idx);
503: x_pegging_rec.pegging_id := org_avail_info.supply_pegging_id(p_org_idx);

Line 556: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'required_quantity ' || x_pegging_rec.required_quantity);

552: x_pegging_rec.intransit_cal_code := org_avail_info.intransit_cal_code(p_org_idx);
553: x_pegging_rec.manufacturing_cal_code := org_avail_info.manufacturing_cal_code(p_org_idx);
554:
555: IF PG_DEBUG in ('Y', 'C') THEN
556: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'required_quantity ' || x_pegging_rec.required_quantity);
557: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'required_date ' || x_pegging_rec.required_date);
558: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'infinite_time_fence ' || x_pegging_rec.infinite_time_fence);
559: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'pegging_id ' || x_pegging_rec.pegging_id);
560: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'parent_pegging_id ' || x_pegging_rec.parent_pegging_id);

Line 557: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'required_date ' || x_pegging_rec.required_date);

553: x_pegging_rec.manufacturing_cal_code := org_avail_info.manufacturing_cal_code(p_org_idx);
554:
555: IF PG_DEBUG in ('Y', 'C') THEN
556: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'required_quantity ' || x_pegging_rec.required_quantity);
557: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'required_date ' || x_pegging_rec.required_date);
558: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'infinite_time_fence ' || x_pegging_rec.infinite_time_fence);
559: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'pegging_id ' || x_pegging_rec.pegging_id);
560: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'parent_pegging_id ' || x_pegging_rec.parent_pegging_id);
561: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'end_pegging_id ' || x_pegging_rec.end_pegging_id);

Line 558: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'infinite_time_fence ' || x_pegging_rec.infinite_time_fence);

554:
555: IF PG_DEBUG in ('Y', 'C') THEN
556: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'required_quantity ' || x_pegging_rec.required_quantity);
557: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'required_date ' || x_pegging_rec.required_date);
558: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'infinite_time_fence ' || x_pegging_rec.infinite_time_fence);
559: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'pegging_id ' || x_pegging_rec.pegging_id);
560: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'parent_pegging_id ' || x_pegging_rec.parent_pegging_id);
561: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'end_pegging_id ' || x_pegging_rec.end_pegging_id);
562: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'shipping_cal_code ' || x_pegging_rec.shipping_cal_code);

Line 559: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'pegging_id ' || x_pegging_rec.pegging_id);

555: IF PG_DEBUG in ('Y', 'C') THEN
556: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'required_quantity ' || x_pegging_rec.required_quantity);
557: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'required_date ' || x_pegging_rec.required_date);
558: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'infinite_time_fence ' || x_pegging_rec.infinite_time_fence);
559: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'pegging_id ' || x_pegging_rec.pegging_id);
560: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'parent_pegging_id ' || x_pegging_rec.parent_pegging_id);
561: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'end_pegging_id ' || x_pegging_rec.end_pegging_id);
562: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'shipping_cal_code ' || x_pegging_rec.shipping_cal_code);
563: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'receiving_cal_code ' || x_pegging_rec.receiving_cal_code);

Line 560: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'parent_pegging_id ' || x_pegging_rec.parent_pegging_id);

556: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'required_quantity ' || x_pegging_rec.required_quantity);
557: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'required_date ' || x_pegging_rec.required_date);
558: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'infinite_time_fence ' || x_pegging_rec.infinite_time_fence);
559: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'pegging_id ' || x_pegging_rec.pegging_id);
560: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'parent_pegging_id ' || x_pegging_rec.parent_pegging_id);
561: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'end_pegging_id ' || x_pegging_rec.end_pegging_id);
562: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'shipping_cal_code ' || x_pegging_rec.shipping_cal_code);
563: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'receiving_cal_code ' || x_pegging_rec.receiving_cal_code);
564: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'intransit_cal_code ' || x_pegging_rec.intransit_cal_code);

Line 561: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'end_pegging_id ' || x_pegging_rec.end_pegging_id);

557: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'required_date ' || x_pegging_rec.required_date);
558: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'infinite_time_fence ' || x_pegging_rec.infinite_time_fence);
559: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'pegging_id ' || x_pegging_rec.pegging_id);
560: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'parent_pegging_id ' || x_pegging_rec.parent_pegging_id);
561: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'end_pegging_id ' || x_pegging_rec.end_pegging_id);
562: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'shipping_cal_code ' || x_pegging_rec.shipping_cal_code);
563: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'receiving_cal_code ' || x_pegging_rec.receiving_cal_code);
564: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'intransit_cal_code ' || x_pegging_rec.intransit_cal_code);
565: END IF;

Line 562: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'shipping_cal_code ' || x_pegging_rec.shipping_cal_code);

558: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'infinite_time_fence ' || x_pegging_rec.infinite_time_fence);
559: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'pegging_id ' || x_pegging_rec.pegging_id);
560: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'parent_pegging_id ' || x_pegging_rec.parent_pegging_id);
561: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'end_pegging_id ' || x_pegging_rec.end_pegging_id);
562: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'shipping_cal_code ' || x_pegging_rec.shipping_cal_code);
563: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'receiving_cal_code ' || x_pegging_rec.receiving_cal_code);
564: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'intransit_cal_code ' || x_pegging_rec.intransit_cal_code);
565: END IF;
566:

Line 563: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'receiving_cal_code ' || x_pegging_rec.receiving_cal_code);

559: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'pegging_id ' || x_pegging_rec.pegging_id);
560: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'parent_pegging_id ' || x_pegging_rec.parent_pegging_id);
561: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'end_pegging_id ' || x_pegging_rec.end_pegging_id);
562: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'shipping_cal_code ' || x_pegging_rec.shipping_cal_code);
563: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'receiving_cal_code ' || x_pegging_rec.receiving_cal_code);
564: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'intransit_cal_code ' || x_pegging_rec.intransit_cal_code);
565: END IF;
566:
567: x_pegging_rec.pegging_type := ORG_SUPPLY_PEG_TYP;

Line 564: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'intransit_cal_code ' || x_pegging_rec.intransit_cal_code);

560: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'parent_pegging_id ' || x_pegging_rec.parent_pegging_id);
561: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'end_pegging_id ' || x_pegging_rec.end_pegging_id);
562: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'shipping_cal_code ' || x_pegging_rec.shipping_cal_code);
563: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'receiving_cal_code ' || x_pegging_rec.receiving_cal_code);
564: msc_sch_wb.atp_debug('Prep_Supply_Pegging_Rec: ' || 'intransit_cal_code ' || x_pegging_rec.intransit_cal_code);
565: END IF;
566:
567: x_pegging_rec.pegging_type := ORG_SUPPLY_PEG_TYP;
568:

Line 750: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Point 2');

746:
747: */
748:
749: IF PG_DEBUG in ('Y', 'C') THEN
750: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Point 2');
751: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || '**** Begin Check_ATP_Subst ***');
752: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || '********** INPUT DATA: p_atp_record **********');
753: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Inventory_Item_Id:' || to_char(p_atp_record.Inventory_Item_Id) );
754: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id:' || to_char(p_atp_record.request_item_id) );

Line 751: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || '**** Begin Check_ATP_Subst ***');

747: */
748:
749: IF PG_DEBUG in ('Y', 'C') THEN
750: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Point 2');
751: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || '**** Begin Check_ATP_Subst ***');
752: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || '********** INPUT DATA: p_atp_record **********');
753: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Inventory_Item_Id:' || to_char(p_atp_record.Inventory_Item_Id) );
754: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id:' || to_char(p_atp_record.request_item_id) );
755: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'organization_id:' || to_char(p_atp_record.organization_id) );

Line 752: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || '********** INPUT DATA: p_atp_record **********');

748:
749: IF PG_DEBUG in ('Y', 'C') THEN
750: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Point 2');
751: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || '**** Begin Check_ATP_Subst ***');
752: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || '********** INPUT DATA: p_atp_record **********');
753: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Inventory_Item_Id:' || to_char(p_atp_record.Inventory_Item_Id) );
754: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id:' || to_char(p_atp_record.request_item_id) );
755: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'organization_id:' || to_char(p_atp_record.organization_id) );
756: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Quantity_Ordered:' || to_char(p_atp_record.Quantity_Ordered) );

Line 753: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Inventory_Item_Id:' || to_char(p_atp_record.Inventory_Item_Id) );

749: IF PG_DEBUG in ('Y', 'C') THEN
750: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Point 2');
751: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || '**** Begin Check_ATP_Subst ***');
752: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || '********** INPUT DATA: p_atp_record **********');
753: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Inventory_Item_Id:' || to_char(p_atp_record.Inventory_Item_Id) );
754: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id:' || to_char(p_atp_record.request_item_id) );
755: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'organization_id:' || to_char(p_atp_record.organization_id) );
756: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Quantity_Ordered:' || to_char(p_atp_record.Quantity_Ordered) );
757: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Quantity_UOM:' || p_atp_record.Quantity_UOM );

Line 754: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id:' || to_char(p_atp_record.request_item_id) );

750: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Point 2');
751: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || '**** Begin Check_ATP_Subst ***');
752: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || '********** INPUT DATA: p_atp_record **********');
753: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Inventory_Item_Id:' || to_char(p_atp_record.Inventory_Item_Id) );
754: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id:' || to_char(p_atp_record.request_item_id) );
755: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'organization_id:' || to_char(p_atp_record.organization_id) );
756: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Quantity_Ordered:' || to_char(p_atp_record.Quantity_Ordered) );
757: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Quantity_UOM:' || p_atp_record.Quantity_UOM );
758: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Ship_Date:' || to_char(p_atp_record.Requested_Ship_Date) );

Line 755: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'organization_id:' || to_char(p_atp_record.organization_id) );

751: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || '**** Begin Check_ATP_Subst ***');
752: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || '********** INPUT DATA: p_atp_record **********');
753: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Inventory_Item_Id:' || to_char(p_atp_record.Inventory_Item_Id) );
754: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id:' || to_char(p_atp_record.request_item_id) );
755: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'organization_id:' || to_char(p_atp_record.organization_id) );
756: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Quantity_Ordered:' || to_char(p_atp_record.Quantity_Ordered) );
757: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Quantity_UOM:' || p_atp_record.Quantity_UOM );
758: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Ship_Date:' || to_char(p_atp_record.Requested_Ship_Date) );
759: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Arrival_Date:' || to_char(p_atp_record.Requested_Arrival_Date) );

Line 756: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Quantity_Ordered:' || to_char(p_atp_record.Quantity_Ordered) );

752: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || '********** INPUT DATA: p_atp_record **********');
753: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Inventory_Item_Id:' || to_char(p_atp_record.Inventory_Item_Id) );
754: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id:' || to_char(p_atp_record.request_item_id) );
755: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'organization_id:' || to_char(p_atp_record.organization_id) );
756: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Quantity_Ordered:' || to_char(p_atp_record.Quantity_Ordered) );
757: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Quantity_UOM:' || p_atp_record.Quantity_UOM );
758: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Ship_Date:' || to_char(p_atp_record.Requested_Ship_Date) );
759: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Arrival_Date:' || to_char(p_atp_record.Requested_Arrival_Date) );
760: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Latest_Acceptable_Date:' || to_char(p_atp_record.Latest_Acceptable_Date) );

Line 757: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Quantity_UOM:' || p_atp_record.Quantity_UOM );

753: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Inventory_Item_Id:' || to_char(p_atp_record.Inventory_Item_Id) );
754: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id:' || to_char(p_atp_record.request_item_id) );
755: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'organization_id:' || to_char(p_atp_record.organization_id) );
756: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Quantity_Ordered:' || to_char(p_atp_record.Quantity_Ordered) );
757: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Quantity_UOM:' || p_atp_record.Quantity_UOM );
758: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Ship_Date:' || to_char(p_atp_record.Requested_Ship_Date) );
759: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Arrival_Date:' || to_char(p_atp_record.Requested_Arrival_Date) );
760: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Latest_Acceptable_Date:' || to_char(p_atp_record.Latest_Acceptable_Date) );
761: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Delivery_Lead_Time:' || to_char(p_atp_record.Delivery_Lead_Time) );

Line 758: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Ship_Date:' || to_char(p_atp_record.Requested_Ship_Date) );

754: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id:' || to_char(p_atp_record.request_item_id) );
755: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'organization_id:' || to_char(p_atp_record.organization_id) );
756: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Quantity_Ordered:' || to_char(p_atp_record.Quantity_Ordered) );
757: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Quantity_UOM:' || p_atp_record.Quantity_UOM );
758: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Ship_Date:' || to_char(p_atp_record.Requested_Ship_Date) );
759: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Arrival_Date:' || to_char(p_atp_record.Requested_Arrival_Date) );
760: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Latest_Acceptable_Date:' || to_char(p_atp_record.Latest_Acceptable_Date) );
761: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Delivery_Lead_Time:' || to_char(p_atp_record.Delivery_Lead_Time) );
762: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Freight_Carrier:' || p_atp_record.Freight_Carrier );

Line 759: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Arrival_Date:' || to_char(p_atp_record.Requested_Arrival_Date) );

755: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'organization_id:' || to_char(p_atp_record.organization_id) );
756: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Quantity_Ordered:' || to_char(p_atp_record.Quantity_Ordered) );
757: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Quantity_UOM:' || p_atp_record.Quantity_UOM );
758: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Ship_Date:' || to_char(p_atp_record.Requested_Ship_Date) );
759: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Arrival_Date:' || to_char(p_atp_record.Requested_Arrival_Date) );
760: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Latest_Acceptable_Date:' || to_char(p_atp_record.Latest_Acceptable_Date) );
761: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Delivery_Lead_Time:' || to_char(p_atp_record.Delivery_Lead_Time) );
762: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Freight_Carrier:' || p_atp_record.Freight_Carrier );
763: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Ship_Method:' || p_atp_record.Ship_Method );

Line 760: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Latest_Acceptable_Date:' || to_char(p_atp_record.Latest_Acceptable_Date) );

756: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Quantity_Ordered:' || to_char(p_atp_record.Quantity_Ordered) );
757: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Quantity_UOM:' || p_atp_record.Quantity_UOM );
758: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Ship_Date:' || to_char(p_atp_record.Requested_Ship_Date) );
759: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Arrival_Date:' || to_char(p_atp_record.Requested_Arrival_Date) );
760: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Latest_Acceptable_Date:' || to_char(p_atp_record.Latest_Acceptable_Date) );
761: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Delivery_Lead_Time:' || to_char(p_atp_record.Delivery_Lead_Time) );
762: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Freight_Carrier:' || p_atp_record.Freight_Carrier );
763: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Ship_Method:' || p_atp_record.Ship_Method );
764: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Demand_Class:' || p_atp_record.Demand_Class );

Line 761: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Delivery_Lead_Time:' || to_char(p_atp_record.Delivery_Lead_Time) );

757: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Quantity_UOM:' || p_atp_record.Quantity_UOM );
758: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Ship_Date:' || to_char(p_atp_record.Requested_Ship_Date) );
759: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Arrival_Date:' || to_char(p_atp_record.Requested_Arrival_Date) );
760: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Latest_Acceptable_Date:' || to_char(p_atp_record.Latest_Acceptable_Date) );
761: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Delivery_Lead_Time:' || to_char(p_atp_record.Delivery_Lead_Time) );
762: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Freight_Carrier:' || p_atp_record.Freight_Carrier );
763: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Ship_Method:' || p_atp_record.Ship_Method );
764: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Demand_Class:' || p_atp_record.Demand_Class );
765: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Override_Flag:' || p_atp_record.Override_Flag );

Line 762: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Freight_Carrier:' || p_atp_record.Freight_Carrier );

758: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Ship_Date:' || to_char(p_atp_record.Requested_Ship_Date) );
759: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Arrival_Date:' || to_char(p_atp_record.Requested_Arrival_Date) );
760: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Latest_Acceptable_Date:' || to_char(p_atp_record.Latest_Acceptable_Date) );
761: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Delivery_Lead_Time:' || to_char(p_atp_record.Delivery_Lead_Time) );
762: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Freight_Carrier:' || p_atp_record.Freight_Carrier );
763: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Ship_Method:' || p_atp_record.Ship_Method );
764: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Demand_Class:' || p_atp_record.Demand_Class );
765: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Override_Flag:' || p_atp_record.Override_Flag );
766: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Action:' || to_char(p_atp_record.Action) );

Line 763: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Ship_Method:' || p_atp_record.Ship_Method );

759: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Arrival_Date:' || to_char(p_atp_record.Requested_Arrival_Date) );
760: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Latest_Acceptable_Date:' || to_char(p_atp_record.Latest_Acceptable_Date) );
761: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Delivery_Lead_Time:' || to_char(p_atp_record.Delivery_Lead_Time) );
762: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Freight_Carrier:' || p_atp_record.Freight_Carrier );
763: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Ship_Method:' || p_atp_record.Ship_Method );
764: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Demand_Class:' || p_atp_record.Demand_Class );
765: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Override_Flag:' || p_atp_record.Override_Flag );
766: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Action:' || to_char(p_atp_record.Action) );
767: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Ship_Date:' || to_char(p_atp_record.Ship_Date) );

Line 764: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Demand_Class:' || p_atp_record.Demand_Class );

760: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Latest_Acceptable_Date:' || to_char(p_atp_record.Latest_Acceptable_Date) );
761: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Delivery_Lead_Time:' || to_char(p_atp_record.Delivery_Lead_Time) );
762: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Freight_Carrier:' || p_atp_record.Freight_Carrier );
763: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Ship_Method:' || p_atp_record.Ship_Method );
764: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Demand_Class:' || p_atp_record.Demand_Class );
765: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Override_Flag:' || p_atp_record.Override_Flag );
766: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Action:' || to_char(p_atp_record.Action) );
767: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Ship_Date:' || to_char(p_atp_record.Ship_Date) );
768: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Available_Quantity:' || to_char(p_atp_record.Available_Quantity) );

Line 765: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Override_Flag:' || p_atp_record.Override_Flag );

761: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Delivery_Lead_Time:' || to_char(p_atp_record.Delivery_Lead_Time) );
762: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Freight_Carrier:' || p_atp_record.Freight_Carrier );
763: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Ship_Method:' || p_atp_record.Ship_Method );
764: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Demand_Class:' || p_atp_record.Demand_Class );
765: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Override_Flag:' || p_atp_record.Override_Flag );
766: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Action:' || to_char(p_atp_record.Action) );
767: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Ship_Date:' || to_char(p_atp_record.Ship_Date) );
768: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Available_Quantity:' || to_char(p_atp_record.Available_Quantity) );
769: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Date_Quantity:' || to_char(p_atp_record.Requested_Date_Quantity) );

Line 766: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Action:' || to_char(p_atp_record.Action) );

762: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Freight_Carrier:' || p_atp_record.Freight_Carrier );
763: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Ship_Method:' || p_atp_record.Ship_Method );
764: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Demand_Class:' || p_atp_record.Demand_Class );
765: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Override_Flag:' || p_atp_record.Override_Flag );
766: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Action:' || to_char(p_atp_record.Action) );
767: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Ship_Date:' || to_char(p_atp_record.Ship_Date) );
768: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Available_Quantity:' || to_char(p_atp_record.Available_Quantity) );
769: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Date_Quantity:' || to_char(p_atp_record.Requested_Date_Quantity) );
770: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'supplier_id:' || to_char(p_atp_record.supplier_id) );

Line 767: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Ship_Date:' || to_char(p_atp_record.Ship_Date) );

763: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Ship_Method:' || p_atp_record.Ship_Method );
764: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Demand_Class:' || p_atp_record.Demand_Class );
765: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Override_Flag:' || p_atp_record.Override_Flag );
766: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Action:' || to_char(p_atp_record.Action) );
767: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Ship_Date:' || to_char(p_atp_record.Ship_Date) );
768: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Available_Quantity:' || to_char(p_atp_record.Available_Quantity) );
769: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Date_Quantity:' || to_char(p_atp_record.Requested_Date_Quantity) );
770: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'supplier_id:' || to_char(p_atp_record.supplier_id) );
771: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'supplier_site_id:' || to_char(p_atp_record.supplier_site_id) );

Line 768: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Available_Quantity:' || to_char(p_atp_record.Available_Quantity) );

764: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Demand_Class:' || p_atp_record.Demand_Class );
765: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Override_Flag:' || p_atp_record.Override_Flag );
766: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Action:' || to_char(p_atp_record.Action) );
767: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Ship_Date:' || to_char(p_atp_record.Ship_Date) );
768: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Available_Quantity:' || to_char(p_atp_record.Available_Quantity) );
769: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Date_Quantity:' || to_char(p_atp_record.Requested_Date_Quantity) );
770: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'supplier_id:' || to_char(p_atp_record.supplier_id) );
771: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'supplier_site_id:' || to_char(p_atp_record.supplier_site_id) );
772: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Insert_Flag:' || to_char(p_atp_record.Insert_Flag) );

Line 769: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Date_Quantity:' || to_char(p_atp_record.Requested_Date_Quantity) );

765: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Override_Flag:' || p_atp_record.Override_Flag );
766: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Action:' || to_char(p_atp_record.Action) );
767: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Ship_Date:' || to_char(p_atp_record.Ship_Date) );
768: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Available_Quantity:' || to_char(p_atp_record.Available_Quantity) );
769: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Date_Quantity:' || to_char(p_atp_record.Requested_Date_Quantity) );
770: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'supplier_id:' || to_char(p_atp_record.supplier_id) );
771: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'supplier_site_id:' || to_char(p_atp_record.supplier_site_id) );
772: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Insert_Flag:' || to_char(p_atp_record.Insert_Flag) );
773: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Error_Code:' || to_char(p_atp_record.Error_Code) );

Line 770: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'supplier_id:' || to_char(p_atp_record.supplier_id) );

766: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Action:' || to_char(p_atp_record.Action) );
767: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Ship_Date:' || to_char(p_atp_record.Ship_Date) );
768: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Available_Quantity:' || to_char(p_atp_record.Available_Quantity) );
769: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Date_Quantity:' || to_char(p_atp_record.Requested_Date_Quantity) );
770: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'supplier_id:' || to_char(p_atp_record.supplier_id) );
771: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'supplier_site_id:' || to_char(p_atp_record.supplier_site_id) );
772: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Insert_Flag:' || to_char(p_atp_record.Insert_Flag) );
773: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Error_Code:' || to_char(p_atp_record.Error_Code) );
774: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Order_Number:' || to_char(p_atp_record.Order_Number) );

Line 771: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'supplier_site_id:' || to_char(p_atp_record.supplier_site_id) );

767: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Ship_Date:' || to_char(p_atp_record.Ship_Date) );
768: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Available_Quantity:' || to_char(p_atp_record.Available_Quantity) );
769: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Date_Quantity:' || to_char(p_atp_record.Requested_Date_Quantity) );
770: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'supplier_id:' || to_char(p_atp_record.supplier_id) );
771: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'supplier_site_id:' || to_char(p_atp_record.supplier_site_id) );
772: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Insert_Flag:' || to_char(p_atp_record.Insert_Flag) );
773: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Error_Code:' || to_char(p_atp_record.Error_Code) );
774: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Order_Number:' || to_char(p_atp_record.Order_Number) );
775: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'P_scenario_id := ' || p_scenario_id);

Line 772: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Insert_Flag:' || to_char(p_atp_record.Insert_Flag) );

768: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Available_Quantity:' || to_char(p_atp_record.Available_Quantity) );
769: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Date_Quantity:' || to_char(p_atp_record.Requested_Date_Quantity) );
770: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'supplier_id:' || to_char(p_atp_record.supplier_id) );
771: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'supplier_site_id:' || to_char(p_atp_record.supplier_site_id) );
772: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Insert_Flag:' || to_char(p_atp_record.Insert_Flag) );
773: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Error_Code:' || to_char(p_atp_record.Error_Code) );
774: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Order_Number:' || to_char(p_atp_record.Order_Number) );
775: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'P_scenario_id := ' || p_scenario_id);
776: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'G_DIAGNOSTIC_ATP ' || MSC_ATP_PVT.G_DIAGNOSTIC_ATP);

Line 773: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Error_Code:' || to_char(p_atp_record.Error_Code) );

769: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Requested_Date_Quantity:' || to_char(p_atp_record.Requested_Date_Quantity) );
770: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'supplier_id:' || to_char(p_atp_record.supplier_id) );
771: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'supplier_site_id:' || to_char(p_atp_record.supplier_site_id) );
772: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Insert_Flag:' || to_char(p_atp_record.Insert_Flag) );
773: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Error_Code:' || to_char(p_atp_record.Error_Code) );
774: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Order_Number:' || to_char(p_atp_record.Order_Number) );
775: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'P_scenario_id := ' || p_scenario_id);
776: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'G_DIAGNOSTIC_ATP ' || MSC_ATP_PVT.G_DIAGNOSTIC_ATP);
777: -- Bug 3826234

Line 774: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Order_Number:' || to_char(p_atp_record.Order_Number) );

770: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'supplier_id:' || to_char(p_atp_record.supplier_id) );
771: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'supplier_site_id:' || to_char(p_atp_record.supplier_site_id) );
772: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Insert_Flag:' || to_char(p_atp_record.Insert_Flag) );
773: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Error_Code:' || to_char(p_atp_record.Error_Code) );
774: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Order_Number:' || to_char(p_atp_record.Order_Number) );
775: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'P_scenario_id := ' || p_scenario_id);
776: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'G_DIAGNOSTIC_ATP ' || MSC_ATP_PVT.G_DIAGNOSTIC_ATP);
777: -- Bug 3826234
778: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'shipping_cal_code ' || p_atp_record.shipping_cal_code);

Line 775: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'P_scenario_id := ' || p_scenario_id);

771: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'supplier_site_id:' || to_char(p_atp_record.supplier_site_id) );
772: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Insert_Flag:' || to_char(p_atp_record.Insert_Flag) );
773: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Error_Code:' || to_char(p_atp_record.Error_Code) );
774: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Order_Number:' || to_char(p_atp_record.Order_Number) );
775: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'P_scenario_id := ' || p_scenario_id);
776: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'G_DIAGNOSTIC_ATP ' || MSC_ATP_PVT.G_DIAGNOSTIC_ATP);
777: -- Bug 3826234
778: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'shipping_cal_code ' || p_atp_record.shipping_cal_code);
779: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'manufacturing_cal_code ' || p_atp_record.manufacturing_cal_code);

Line 776: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'G_DIAGNOSTIC_ATP ' || MSC_ATP_PVT.G_DIAGNOSTIC_ATP);

772: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Insert_Flag:' || to_char(p_atp_record.Insert_Flag) );
773: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Error_Code:' || to_char(p_atp_record.Error_Code) );
774: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Order_Number:' || to_char(p_atp_record.Order_Number) );
775: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'P_scenario_id := ' || p_scenario_id);
776: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'G_DIAGNOSTIC_ATP ' || MSC_ATP_PVT.G_DIAGNOSTIC_ATP);
777: -- Bug 3826234
778: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'shipping_cal_code ' || p_atp_record.shipping_cal_code);
779: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'manufacturing_cal_code ' || p_atp_record.manufacturing_cal_code);
780: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'receiving_cal_code ' || p_atp_record.receiving_cal_code);

Line 778: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'shipping_cal_code ' || p_atp_record.shipping_cal_code);

774: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Order_Number:' || to_char(p_atp_record.Order_Number) );
775: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'P_scenario_id := ' || p_scenario_id);
776: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'G_DIAGNOSTIC_ATP ' || MSC_ATP_PVT.G_DIAGNOSTIC_ATP);
777: -- Bug 3826234
778: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'shipping_cal_code ' || p_atp_record.shipping_cal_code);
779: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'manufacturing_cal_code ' || p_atp_record.manufacturing_cal_code);
780: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'receiving_cal_code ' || p_atp_record.receiving_cal_code);
781: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'intransit_cal_code ' || p_atp_record.intransit_cal_code);
782: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'to_organization_id ' || p_atp_record.to_organization_id);

Line 779: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'manufacturing_cal_code ' || p_atp_record.manufacturing_cal_code);

775: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'P_scenario_id := ' || p_scenario_id);
776: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'G_DIAGNOSTIC_ATP ' || MSC_ATP_PVT.G_DIAGNOSTIC_ATP);
777: -- Bug 3826234
778: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'shipping_cal_code ' || p_atp_record.shipping_cal_code);
779: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'manufacturing_cal_code ' || p_atp_record.manufacturing_cal_code);
780: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'receiving_cal_code ' || p_atp_record.receiving_cal_code);
781: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'intransit_cal_code ' || p_atp_record.intransit_cal_code);
782: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'to_organization_id ' || p_atp_record.to_organization_id);
783: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'MSC_ATP_PVT.G_ALLOCATED_ATP ' || MSC_ATP_PVT.G_ALLOCATED_ATP);

Line 780: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'receiving_cal_code ' || p_atp_record.receiving_cal_code);

776: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'G_DIAGNOSTIC_ATP ' || MSC_ATP_PVT.G_DIAGNOSTIC_ATP);
777: -- Bug 3826234
778: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'shipping_cal_code ' || p_atp_record.shipping_cal_code);
779: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'manufacturing_cal_code ' || p_atp_record.manufacturing_cal_code);
780: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'receiving_cal_code ' || p_atp_record.receiving_cal_code);
781: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'intransit_cal_code ' || p_atp_record.intransit_cal_code);
782: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'to_organization_id ' || p_atp_record.to_organization_id);
783: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'MSC_ATP_PVT.G_ALLOCATED_ATP ' || MSC_ATP_PVT.G_ALLOCATED_ATP);
784: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'MSC_ATP_PVT.G_PLAN_INFO_REC.plan_type ' || MSC_ATP_PVT.G_PLAN_INFO_REC.plan_type);

Line 781: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'intransit_cal_code ' || p_atp_record.intransit_cal_code);

777: -- Bug 3826234
778: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'shipping_cal_code ' || p_atp_record.shipping_cal_code);
779: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'manufacturing_cal_code ' || p_atp_record.manufacturing_cal_code);
780: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'receiving_cal_code ' || p_atp_record.receiving_cal_code);
781: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'intransit_cal_code ' || p_atp_record.intransit_cal_code);
782: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'to_organization_id ' || p_atp_record.to_organization_id);
783: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'MSC_ATP_PVT.G_ALLOCATED_ATP ' || MSC_ATP_PVT.G_ALLOCATED_ATP);
784: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'MSC_ATP_PVT.G_PLAN_INFO_REC.plan_type ' || MSC_ATP_PVT.G_PLAN_INFO_REC.plan_type);
785: END IF;

Line 782: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'to_organization_id ' || p_atp_record.to_organization_id);

778: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'shipping_cal_code ' || p_atp_record.shipping_cal_code);
779: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'manufacturing_cal_code ' || p_atp_record.manufacturing_cal_code);
780: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'receiving_cal_code ' || p_atp_record.receiving_cal_code);
781: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'intransit_cal_code ' || p_atp_record.intransit_cal_code);
782: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'to_organization_id ' || p_atp_record.to_organization_id);
783: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'MSC_ATP_PVT.G_ALLOCATED_ATP ' || MSC_ATP_PVT.G_ALLOCATED_ATP);
784: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'MSC_ATP_PVT.G_PLAN_INFO_REC.plan_type ' || MSC_ATP_PVT.G_PLAN_INFO_REC.plan_type);
785: END IF;
786: --- first we set the Request Item's sr_inv_id to a global variable

Line 783: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'MSC_ATP_PVT.G_ALLOCATED_ATP ' || MSC_ATP_PVT.G_ALLOCATED_ATP);

779: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'manufacturing_cal_code ' || p_atp_record.manufacturing_cal_code);
780: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'receiving_cal_code ' || p_atp_record.receiving_cal_code);
781: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'intransit_cal_code ' || p_atp_record.intransit_cal_code);
782: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'to_organization_id ' || p_atp_record.to_organization_id);
783: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'MSC_ATP_PVT.G_ALLOCATED_ATP ' || MSC_ATP_PVT.G_ALLOCATED_ATP);
784: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'MSC_ATP_PVT.G_PLAN_INFO_REC.plan_type ' || MSC_ATP_PVT.G_PLAN_INFO_REC.plan_type);
785: END IF;
786: --- first we set the Request Item's sr_inv_id to a global variable
787: --bug3467631 In PF cases request_item_id has member_id

Line 784: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'MSC_ATP_PVT.G_PLAN_INFO_REC.plan_type ' || MSC_ATP_PVT.G_PLAN_INFO_REC.plan_type);

780: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'receiving_cal_code ' || p_atp_record.receiving_cal_code);
781: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'intransit_cal_code ' || p_atp_record.intransit_cal_code);
782: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'to_organization_id ' || p_atp_record.to_organization_id);
783: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'MSC_ATP_PVT.G_ALLOCATED_ATP ' || MSC_ATP_PVT.G_ALLOCATED_ATP);
784: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'MSC_ATP_PVT.G_PLAN_INFO_REC.plan_type ' || MSC_ATP_PVT.G_PLAN_INFO_REC.plan_type);
785: END IF;
786: --- first we set the Request Item's sr_inv_id to a global variable
787: --bug3467631 In PF cases request_item_id has member_id
788: --MSC_ATP_SUBST.G_REQ_ITEM_SR_INV_ID := p_atp_record.inventory_item_id;

Line 795: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Sr Item ID : ' || item_availability_info.sr_inventory_item_id(i) ||

791: item_availability_info := p_item_substitute_rec;
792:
793: IF PG_DEBUG in ('Y', 'C') THEN
794: FOR i in 1..item_availability_info.inventory_item_id.count LOOP
795: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Sr Item ID : ' || item_availability_info.sr_inventory_item_id(i) ||
796: ', item name : ' || item_availability_info.item_name(i) ||
797: ', atp_flag := ' || item_availability_info.atp_flag(i) ||
798: ', atp_comp_flag := ' || item_availability_info.atp_comp_flag(i) ||
799: ', create supply flag := ' || item_availability_info.create_supply_flag(i));

Line 806: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'substitution_type := ' || l_substitution_type);

802: l_requested_ship_date := p_requested_ship_date;
803:
804: l_substitution_type := p_atp_record.substitution_type;
805: IF PG_DEBUG in ('Y', 'C') THEN
806: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'substitution_type := ' || l_substitution_type);
807: END IF;
808:
809: l_org_item_detail_flag := NVL(p_atp_record.req_item_detail_flag, 2);
810: l_substitution_type := ALL_OR_NOTHING;

Line 816: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_inventory_item_id := ' || l_inventory_item_id);

812:
813: l_item_count := item_availability_info.inventory_item_id.count;
814: l_inventory_item_id := item_availability_info.inventory_item_id(l_item_count);
815: IF PG_DEBUG in ('Y', 'C') THEN
816: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_inventory_item_id := ' || l_inventory_item_id);
817: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_count := ' || l_item_count);
818: END IF;
819: IF item_availability_info.inventory_item_id.count > 0 THEN
820: l_highest_rev_item_id := NVL(item_availability_info.highest_revision_item_id(1),

Line 817: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_count := ' || l_item_count);

813: l_item_count := item_availability_info.inventory_item_id.count;
814: l_inventory_item_id := item_availability_info.inventory_item_id(l_item_count);
815: IF PG_DEBUG in ('Y', 'C') THEN
816: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_inventory_item_id := ' || l_inventory_item_id);
817: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_count := ' || l_item_count);
818: END IF;
819: IF item_availability_info.inventory_item_id.count > 0 THEN
820: l_highest_rev_item_id := NVL(item_availability_info.highest_revision_item_id(1),
821: item_availability_info.inventory_item_id(l_item_count));

Line 841: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sys_date_top_org := ' ||l_sys_date_top_org);

837: l_sys_date_top_org := NVL(MSC_ATP_FUNC.prev_work_day(p_atp_record.organization_id,
838: p_atp_record.instance_id,
839: sysdate), sysdate);
840: IF PG_DEBUG in ('Y', 'C') THEN
841: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sys_date_top_org := ' ||l_sys_date_top_org);
842: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_substitution_type := ' || NVL(l_substitution_type, -1));
843: END IF;
844:
845: --- now check how do we need to process the request

Line 842: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_substitution_type := ' || NVL(l_substitution_type, -1));

838: p_atp_record.instance_id,
839: sysdate), sysdate);
840: IF PG_DEBUG in ('Y', 'C') THEN
841: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sys_date_top_org := ' ||l_sys_date_top_org);
842: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_substitution_type := ' || NVL(l_substitution_type, -1));
843: END IF;
844:
845: --- now check how do we need to process the request
846: IF NVL(l_substitution_type, 4) = 3 THEN

Line 849: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'look at item attribute');

845: --- now check how do we need to process the request
846: IF NVL(l_substitution_type, 4) = 3 THEN
847: --- we look at item attribute to see what kind of substitution do we need to do
848: IF PG_DEBUG in ('Y', 'C') THEN
849: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'look at item attribute');
850: END IF;
851: If item_availability_info.inventory_item_id.count > 1 THEN
852: -- substitutes exist
853: l_substitution_type := item_availability_info.partial_fulfillment_flag(1);

Line 860: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Not doing substitution');

856: l_substitution_type := ALL_OR_NOTHING;
857: END IF;
858: ELSIF NVL(l_substitution_type, 4) = NO_SUBSTITUTION THEN
859: IF PG_DEBUG in ('Y', 'C') THEN
860: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Not doing substitution');
861: END IF;
862: -- in this case also we process it as 'All or nothing'
863: l_substitution_type := ALL_OR_NOTHING;
864: END IF;

Line 871: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand := ' || l_net_demand);

867: -- 2754446
868: l_orig_net_dmd := l_net_demand;
869:
870: IF PG_DEBUG in ('Y', 'C') THEN
871: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand := ' || l_net_demand);
872: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_substitution_type := ' || NVL(l_substitution_type,-1));
873: END IF;
874: --- this is done for testing
875: l_substitution_type := ALL_OR_NOTHING;

Line 872: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_substitution_type := ' || NVL(l_substitution_type,-1));

868: l_orig_net_dmd := l_net_demand;
869:
870: IF PG_DEBUG in ('Y', 'C') THEN
871: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand := ' || l_net_demand);
872: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_substitution_type := ' || NVL(l_substitution_type,-1));
873: END IF;
874: --- this is done for testing
875: l_substitution_type := ALL_OR_NOTHING;
876: IF PG_DEBUG in ('Y', 'C') THEN

Line 877: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sysdate_top_org := ' || l_sys_date_top_org);

873: END IF;
874: --- this is done for testing
875: l_substitution_type := ALL_OR_NOTHING;
876: IF PG_DEBUG in ('Y', 'C') THEN
877: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sysdate_top_org := ' || l_sys_date_top_org);
878: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_substitution_type := ' || NVL(l_substitution_type,-1));
879: END IF;
880: IF l_substitution_type = ALL_OR_NOTHING THEN
881:

Line 878: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_substitution_type := ' || NVL(l_substitution_type,-1));

874: --- this is done for testing
875: l_substitution_type := ALL_OR_NOTHING;
876: IF PG_DEBUG in ('Y', 'C') THEN
877: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sysdate_top_org := ' || l_sys_date_top_org);
878: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_substitution_type := ' || NVL(l_substitution_type,-1));
879: END IF;
880: IF l_substitution_type = ALL_OR_NOTHING THEN
881:
882: --- first check on-hand/scheduled receipt by request date

Line 887: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Processing item := ' || item_availability_info.inventory_item_id(l_item_cntr) || ' '

883: --WHILE l_item_cntr <= item_availability_info.inventory_item_id.count AND
884: -- l_net_demand > 0 LOOP --- item loop
885: FOR l_item_cntr in reverse 1..item_availability_info.inventory_item_id.count LOOP
886: IF PG_DEBUG in ('Y', 'C') THEN
887: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Processing item := ' || item_availability_info.inventory_item_id(l_item_cntr) || ' '
888: || item_availability_info.item_name(l_item_cntr));
889: END IF;
890:
891: IF l_net_demand <= 0 THEN

Line 913: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_period_begin_idx := ' || l_period_begin_idx);

909: l_period_begin_idx := l_all_atp_period.level.count + 1;
910: l_sd_begin_idx := l_all_atp_supply_demand.level.count + 1;
911: END IF;
912: IF PG_DEBUG in ('Y', 'C') THEN
913: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_period_begin_idx := ' || l_period_begin_idx);
914: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sd_begin_idx := ' || l_sd_begin_idx);
915: END IF;
916:
917: item_availability_info.period_detail_begin_idx(l_item_cntr) := l_period_begin_idx;

Line 914: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sd_begin_idx := ' || l_sd_begin_idx);

910: l_sd_begin_idx := l_all_atp_supply_demand.level.count + 1;
911: END IF;
912: IF PG_DEBUG in ('Y', 'C') THEN
913: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_period_begin_idx := ' || l_period_begin_idx);
914: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sd_begin_idx := ' || l_sd_begin_idx);
915: END IF;
916:
917: item_availability_info.period_detail_begin_idx(l_item_cntr) := l_period_begin_idx;
918: item_availability_info.sd_detail_begin_idx(l_item_cntr) := l_sd_begin_idx;

Line 935: msc_sch_wb.atp_debug('Top org uom: ' || p_atp_record.quantity_uom);

931:
932: -- dsting 2754446
933: org_availability_info.primary_uom(1) := p_atp_record.quantity_uom;
934: IF PG_DEBUG in ('Y', 'C') THEN
935: msc_sch_wb.atp_debug('Top org uom: ' || p_atp_record.quantity_uom);
936: END IF;
937:
938:
939: --- loop through all orgs in supply chain to find item's availability in each org by request

Line 944: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand : = ' || l_net_demand);

940: --- date
941:
942: WHILE l_parent_org_cntr <= org_availability_info.organization_id.count and l_net_demand > 0 LOOP
943: IF PG_DEBUG in ('Y', 'C') THEN
944: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand : = ' || l_net_demand);
945: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'org count := ' || org_availability_info.organization_id.count);
946: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_parent_org_cntr := ' || l_parent_org_cntr);
947: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_process org cntr := ' || l_process_org_cntr);
948: END IF;

Line 945: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'org count := ' || org_availability_info.organization_id.count);

941:
942: WHILE l_parent_org_cntr <= org_availability_info.organization_id.count and l_net_demand > 0 LOOP
943: IF PG_DEBUG in ('Y', 'C') THEN
944: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand : = ' || l_net_demand);
945: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'org count := ' || org_availability_info.organization_id.count);
946: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_parent_org_cntr := ' || l_parent_org_cntr);
947: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_process org cntr := ' || l_process_org_cntr);
948: END IF;
949: --- get plan_id in for each item org combo

Line 946: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_parent_org_cntr := ' || l_parent_org_cntr);

942: WHILE l_parent_org_cntr <= org_availability_info.organization_id.count and l_net_demand > 0 LOOP
943: IF PG_DEBUG in ('Y', 'C') THEN
944: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand : = ' || l_net_demand);
945: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'org count := ' || org_availability_info.organization_id.count);
946: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_parent_org_cntr := ' || l_parent_org_cntr);
947: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_process org cntr := ' || l_process_org_cntr);
948: END IF;
949: --- get plan_id in for each item org combo
950: IF l_item_cntr = l_item_count and l_process_org_cntr = 1 THEN

Line 947: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_process org cntr := ' || l_process_org_cntr);

943: IF PG_DEBUG in ('Y', 'C') THEN
944: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand : = ' || l_net_demand);
945: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'org count := ' || org_availability_info.organization_id.count);
946: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_parent_org_cntr := ' || l_parent_org_cntr);
947: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_process org cntr := ' || l_process_org_cntr);
948: END IF;
949: --- get plan_id in for each item org combo
950: IF l_item_cntr = l_item_count and l_process_org_cntr = 1 THEN
951: l_plan_id := p_plan_id;

Line 999: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'plan_name: ' || l_plan_info_rec.plan_name || ' process org: ' || l_process_org_cntr);

995: END IF;
996:
997: -- dsting diagnostic atp
998: IF PG_DEBUG in ('Y', 'C') THEN
999: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'plan_name: ' || l_plan_info_rec.plan_name || ' process org: ' || l_process_org_cntr);
1000: END IF;
1001: org_availability_info.plan_name(l_process_org_cntr) := l_plan_info_rec.plan_name;
1002:
1003: END IF;

Line 1005: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_plan_id := ' || l_plan_id);

1001: org_availability_info.plan_name(l_process_org_cntr) := l_plan_info_rec.plan_name;
1002:
1003: END IF;
1004: IF PG_DEBUG in ('Y', 'C') THEN
1005: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_plan_id := ' || l_plan_id);
1006: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_assign_set_id := ' || l_assign_set_id);
1007: END IF;
1008: --- get org code for pegging purpose
1009: -- store this info for top org

Line 1006: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_assign_set_id := ' || l_assign_set_id);

1002:
1003: END IF;
1004: IF PG_DEBUG in ('Y', 'C') THEN
1005: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_plan_id := ' || l_plan_id);
1006: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_assign_set_id := ' || l_assign_set_id);
1007: END IF;
1008: --- get org code for pegging purpose
1009: -- store this info for top org
1010: -- we will use this info for CTP

Line 1021: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_org_code := ' || l_org_code);

1017:
1018: l_org_code := MSC_ATP_FUNC.get_org_code(p_atp_record.instance_id,
1019: org_availability_info.organization_id(l_process_org_cntr));
1020: IF PG_DEBUG in ('Y', 'C') THEN
1021: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_org_code := ' || l_org_code);
1022: END IF;
1023: IF l_process_org_cntr = 1 THEN
1024: l_top_tier_org_code := l_org_code;
1025: IF PG_DEBUG in ('Y', 'C') THEN

Line 1026: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_top_tier_org_code := ' || l_top_tier_org_code);

1022: END IF;
1023: IF l_process_org_cntr = 1 THEN
1024: l_top_tier_org_code := l_org_code;
1025: IF PG_DEBUG in ('Y', 'C') THEN
1026: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_top_tier_org_code := ' || l_top_tier_org_code);
1027: END IF;
1028: END IF;
1029: org_availability_info.org_code(l_process_org_cntr) := l_org_code;
1030:

Line 1050: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Error occured in procedure Get_Family_Item_Info');

1046: l_return_status
1047: );
1048: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1049: IF PG_DEBUG in ('Y', 'C') THEN
1050: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Error occured in procedure Get_Family_Item_Info');
1051: END IF;
1052: RAISE FND_API.G_EXC_ERROR;
1053: END IF;
1054: ELSE -- DRP plan re-set variables.

Line 1062: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');

1058: item_availability_info.sr_inventory_item_id(l_item_cntr);
1059: org_availability_info.family_dest_id(l_process_org_cntr) :=
1060: item_availability_info.inventory_item_id(l_item_cntr);
1061: IF PG_DEBUG in ('Y', 'C') THEN
1062: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');
1063: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'PF and Allocated ATP not supported for DRP Plans');
1064: msc_sch_wb.atp_debug('Re-Set Family sr ITEM ID : ' || org_availability_info.family_sr_id(l_process_org_cntr));
1065: msc_sch_wb.atp_debug('Re-Set Family ITEM ID: ' || org_availability_info.family_dest_id(l_process_org_cntr));
1066: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');

Line 1063: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'PF and Allocated ATP not supported for DRP Plans');

1059: org_availability_info.family_dest_id(l_process_org_cntr) :=
1060: item_availability_info.inventory_item_id(l_item_cntr);
1061: IF PG_DEBUG in ('Y', 'C') THEN
1062: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');
1063: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'PF and Allocated ATP not supported for DRP Plans');
1064: msc_sch_wb.atp_debug('Re-Set Family sr ITEM ID : ' || org_availability_info.family_sr_id(l_process_org_cntr));
1065: msc_sch_wb.atp_debug('Re-Set Family ITEM ID: ' || org_availability_info.family_dest_id(l_process_org_cntr));
1066: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');
1067: END IF;

Line 1064: msc_sch_wb.atp_debug('Re-Set Family sr ITEM ID : ' || org_availability_info.family_sr_id(l_process_org_cntr));

1060: item_availability_info.inventory_item_id(l_item_cntr);
1061: IF PG_DEBUG in ('Y', 'C') THEN
1062: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');
1063: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'PF and Allocated ATP not supported for DRP Plans');
1064: msc_sch_wb.atp_debug('Re-Set Family sr ITEM ID : ' || org_availability_info.family_sr_id(l_process_org_cntr));
1065: msc_sch_wb.atp_debug('Re-Set Family ITEM ID: ' || org_availability_info.family_dest_id(l_process_org_cntr));
1066: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');
1067: END IF;
1068: END IF;

Line 1065: msc_sch_wb.atp_debug('Re-Set Family ITEM ID: ' || org_availability_info.family_dest_id(l_process_org_cntr));

1061: IF PG_DEBUG in ('Y', 'C') THEN
1062: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');
1063: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'PF and Allocated ATP not supported for DRP Plans');
1064: msc_sch_wb.atp_debug('Re-Set Family sr ITEM ID : ' || org_availability_info.family_sr_id(l_process_org_cntr));
1065: msc_sch_wb.atp_debug('Re-Set Family ITEM ID: ' || org_availability_info.family_dest_id(l_process_org_cntr));
1066: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');
1067: END IF;
1068: END IF;
1069: -- End ATP4drp

Line 1066: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');

1062: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');
1063: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'PF and Allocated ATP not supported for DRP Plans');
1064: msc_sch_wb.atp_debug('Re-Set Family sr ITEM ID : ' || org_availability_info.family_sr_id(l_process_org_cntr));
1065: msc_sch_wb.atp_debug('Re-Set Family ITEM ID: ' || org_availability_info.family_dest_id(l_process_org_cntr));
1066: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');
1067: END IF;
1068: END IF;
1069: -- End ATP4drp
1070:

Line 1098: msc_sch_wb.atp_debug('process org: ' || org_availability_info.organization_id(l_process_org_cntr));

1094: org_req_dmd_qty(l_net_demand, org_availability_info, l_process_org_cntr);
1095: -- org_availability_info.demand_quantity(l_process_org_cntr) := l_net_demand;
1096:
1097: IF PG_DEBUG in ('Y', 'C') THEN
1098: msc_sch_wb.atp_debug('process org: ' || org_availability_info.organization_id(l_process_org_cntr));
1099: msc_sch_wb.atp_debug('UOM process org: ' || org_availability_info.primary_uom(l_process_org_cntr));
1100: msc_sch_wb.atp_debug('conversion rate: ' || org_availability_info.conversion_rate(l_process_org_cntr));
1101: msc_sch_wb.atp_debug('demand_quantity ' || l_org_code || ' ' || org_availability_info.demand_quantity(l_process_org_cntr));
1102: END IF;

Line 1099: msc_sch_wb.atp_debug('UOM process org: ' || org_availability_info.primary_uom(l_process_org_cntr));

1095: -- org_availability_info.demand_quantity(l_process_org_cntr) := l_net_demand;
1096:
1097: IF PG_DEBUG in ('Y', 'C') THEN
1098: msc_sch_wb.atp_debug('process org: ' || org_availability_info.organization_id(l_process_org_cntr));
1099: msc_sch_wb.atp_debug('UOM process org: ' || org_availability_info.primary_uom(l_process_org_cntr));
1100: msc_sch_wb.atp_debug('conversion rate: ' || org_availability_info.conversion_rate(l_process_org_cntr));
1101: msc_sch_wb.atp_debug('demand_quantity ' || l_org_code || ' ' || org_availability_info.demand_quantity(l_process_org_cntr));
1102: END IF;
1103: --- get item attributes

Line 1100: msc_sch_wb.atp_debug('conversion rate: ' || org_availability_info.conversion_rate(l_process_org_cntr));

1096:
1097: IF PG_DEBUG in ('Y', 'C') THEN
1098: msc_sch_wb.atp_debug('process org: ' || org_availability_info.organization_id(l_process_org_cntr));
1099: msc_sch_wb.atp_debug('UOM process org: ' || org_availability_info.primary_uom(l_process_org_cntr));
1100: msc_sch_wb.atp_debug('conversion rate: ' || org_availability_info.conversion_rate(l_process_org_cntr));
1101: msc_sch_wb.atp_debug('demand_quantity ' || l_org_code || ' ' || org_availability_info.demand_quantity(l_process_org_cntr));
1102: END IF;
1103: --- get item attributes
1104: IF l_process_org_cntr = 1 and l_item_cntr = l_item_count THEN

Line 1101: msc_sch_wb.atp_debug('demand_quantity ' || l_org_code || ' ' || org_availability_info.demand_quantity(l_process_org_cntr));

1097: IF PG_DEBUG in ('Y', 'C') THEN
1098: msc_sch_wb.atp_debug('process org: ' || org_availability_info.organization_id(l_process_org_cntr));
1099: msc_sch_wb.atp_debug('UOM process org: ' || org_availability_info.primary_uom(l_process_org_cntr));
1100: msc_sch_wb.atp_debug('conversion rate: ' || org_availability_info.conversion_rate(l_process_org_cntr));
1101: msc_sch_wb.atp_debug('demand_quantity ' || l_org_code || ' ' || org_availability_info.demand_quantity(l_process_org_cntr));
1102: END IF;
1103: --- get item attributes
1104: IF l_process_org_cntr = 1 and l_item_cntr = l_item_count THEN
1105: IF PG_DEBUG in ('Y', 'C') THEN

Line 1106: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'No Need to get item attributes');

1102: END IF;
1103: --- get item attributes
1104: IF l_process_org_cntr = 1 and l_item_cntr = l_item_count THEN
1105: IF PG_DEBUG in ('Y', 'C') THEN
1106: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'No Need to get item attributes');
1107: END IF;
1108: --we have already got values for requested item in top org
1109: org_availability_info.atp_flag(l_process_org_cntr) := item_availability_info.atp_flag(l_item_cntr);
1110: org_availability_info.atp_comp_flag(l_process_org_cntr) := item_availability_info.atp_comp_flag(l_item_cntr);

Line 1168: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_substitution_window := ' || l_substitution_window);

1164: END IF;
1165: l_create_supply_flag := l_item_attribute_rec.create_supply_flag;
1166: END IF;
1167: IF PG_DEBUG in ('Y', 'C') THEN
1168: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_substitution_window := ' || l_substitution_window);
1169: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_create_supply_flag := '||l_create_supply_flag);
1170: END IF;
1171:
1172: IF l_process_org_cntr = 1 and l_item_cntr <> l_item_count THEN

Line 1169: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_create_supply_flag := '||l_create_supply_flag);

1165: l_create_supply_flag := l_item_attribute_rec.create_supply_flag;
1166: END IF;
1167: IF PG_DEBUG in ('Y', 'C') THEN
1168: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_substitution_window := ' || l_substitution_window);
1169: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_create_supply_flag := '||l_create_supply_flag);
1170: END IF;
1171:
1172: IF l_process_org_cntr = 1 and l_item_cntr <> l_item_count THEN
1173: item_availability_info.atp_flag(l_item_cntr) := l_item_attribute_rec.atp_flag;

Line 1195: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'G_HYBRID_ALLOC_ATP is Y');

1191:
1192: -- ALLOC ATP CHANGES, 12973673
1193: IF (MSC_ATP_PVT.G_INV_CTP = 4 and MSC_ATP_PVT.G_HYBRID_ALLOC_ATP = 'Y') THEN
1194: IF PG_DEBUG in ('Y', 'C') THEN
1195: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'G_HYBRID_ALLOC_ATP is Y');
1196: END IF;
1197:
1198: MSC_ATP_PVT.G_ALLOCATED_ATP := MSC_ATP_FUNC.check_alloc_exists(p_atp_record.instance_id,
1199: -1, --PLAN_ID

Line 1205: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'MSC_ATP_PVT.G_ALLOCATED_ATP = '||MSC_ATP_PVT.G_ALLOCATED_ATP);

1201: org_availability_info.organization_id(l_process_org_cntr),
1202: nvl(l_requested_ship_date,trunc(sysdate)));
1203:
1204: IF PG_DEBUG in ('Y', 'C') THEN
1205: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'MSC_ATP_PVT.G_ALLOCATED_ATP = '||MSC_ATP_PVT.G_ALLOCATED_ATP);
1206: END IF;
1207: END IF;
1208:
1209: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') THEN

Line 1227: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Error occured in procedure Set_Alloc_Rule_Variables');

1223: l_return_status
1224: );
1225: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1226: IF PG_DEBUG in ('Y', 'C') THEN
1227: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Error occured in procedure Set_Alloc_Rule_Variables');
1228: END IF;
1229: RAISE FND_API.G_EXC_ERROR;
1230: END IF;
1231:

Line 1253: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_requested_ship_date = '||l_requested_ship_date);

1249: ELSE
1250: l_item_to_use := item_availability_info.inventory_item_id(l_item_cntr);
1251: END IF;
1252: IF PG_DEBUG in ('Y', 'C') THEN
1253: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_requested_ship_date = '||l_requested_ship_date);
1254: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Item to be used = '||l_item_to_use);
1255: END IF;
1256: /* New allocation logic for time_phased_atp changes end */
1257:

Line 1254: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Item to be used = '||l_item_to_use);

1250: l_item_to_use := item_availability_info.inventory_item_id(l_item_cntr);
1251: END IF;
1252: IF PG_DEBUG in ('Y', 'C') THEN
1253: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_requested_ship_date = '||l_requested_ship_date);
1254: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Item to be used = '||l_item_to_use);
1255: END IF;
1256: /* New allocation logic for time_phased_atp changes end */
1257:
1258: --- get the demand class

Line 1269: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'after getting the dummy demand class');

1265: l_requested_ship_date,
1266: NULL, -- level_id
1267: p_atp_record.demand_class);
1268: IF PG_DEBUG in ('Y', 'C') THEN
1269: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'after getting the dummy demand class');
1270: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'demand_class = '|| l_demand_class);
1271: END IF;
1272:
1273: org_availability_info.demand_class(l_process_org_cntr) := l_demand_class;

Line 1270: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'demand_class = '|| l_demand_class);

1266: NULL, -- level_id
1267: p_atp_record.demand_class);
1268: IF PG_DEBUG in ('Y', 'C') THEN
1269: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'after getting the dummy demand class');
1270: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'demand_class = '|| l_demand_class);
1271: END IF;
1272:
1273: org_availability_info.demand_class(l_process_org_cntr) := l_demand_class;
1274: org_availability_info.allocation_rule(l_process_org_cntr) := MSC_ATP_PVT.G_ALLOCATION_RULE_NAME;

Line 1285: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_flag := ' || l_atp_flag);

1281: --Do material check
1282: l_atp_flag := org_availability_info.atp_flag(l_process_org_cntr);
1283: l_atp_comp_flag := org_availability_info.atp_comp_flag(l_process_org_cntr);
1284: IF PG_DEBUG in ('Y', 'C') THEN
1285: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_flag := ' || l_atp_flag);
1286: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_comp_flag := ' || l_atp_comp_flag);
1287: END IF;
1288: IF l_atp_flag = 'N' and l_atp_comp_flag = 'N' THEN
1289: IF l_process_org_cntr = 1

Line 1286: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_comp_flag := ' || l_atp_comp_flag);

1282: l_atp_flag := org_availability_info.atp_flag(l_process_org_cntr);
1283: l_atp_comp_flag := org_availability_info.atp_comp_flag(l_process_org_cntr);
1284: IF PG_DEBUG in ('Y', 'C') THEN
1285: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_flag := ' || l_atp_flag);
1286: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_comp_flag := ' || l_atp_comp_flag);
1287: END IF;
1288: IF l_atp_flag = 'N' and l_atp_comp_flag = 'N' THEN
1289: IF l_process_org_cntr = 1
1290: and org_availability_info.requested_ship_date(l_process_org_cntr) < l_sys_date_top_org THEN

Line 1304: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Item is not atpable');

1300: END IF;
1301: org_availability_info.request_date_quantity(l_process_org_cntr) := l_requested_date_quantity;
1302:
1303: IF PG_DEBUG in ('Y', 'C') THEN
1304: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Item is not atpable');
1305: END IF;
1306: ELSE
1307: l_get_mat_in_rec.rounding_control_flag := org_availability_info.rounding_flag(l_process_org_cntr);
1308: l_get_mat_in_rec.dest_inv_item_id := item_availability_info.inventory_item_id(l_item_cntr);

Line 1365: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atf_date := ' || l_mat_atp_info_rec.atf_date);

1361: l_time_phased_atp := 'N';
1362: END IF;
1363:
1364: IF PG_DEBUG in ('Y', 'C') THEN
1365: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atf_date := ' || l_mat_atp_info_rec.atf_date);
1366: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_time_phased_atp := ' || l_time_phased_atp);
1367: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atf_date_qty := ' || l_atf_date_qty);
1368: END IF;
1369: --bug3467631 end

Line 1366: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_time_phased_atp := ' || l_time_phased_atp);

1362: END IF;
1363:
1364: IF PG_DEBUG in ('Y', 'C') THEN
1365: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atf_date := ' || l_mat_atp_info_rec.atf_date);
1366: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_time_phased_atp := ' || l_time_phased_atp);
1367: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atf_date_qty := ' || l_atf_date_qty);
1368: END IF;
1369: --bug3467631 end
1370: -- time_phased_atp changes end

Line 1367: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atf_date_qty := ' || l_atf_date_qty);

1363:
1364: IF PG_DEBUG in ('Y', 'C') THEN
1365: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atf_date := ' || l_mat_atp_info_rec.atf_date);
1366: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_time_phased_atp := ' || l_time_phased_atp);
1367: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atf_date_qty := ' || l_atf_date_qty);
1368: END IF;
1369: --bug3467631 end
1370: -- time_phased_atp changes end
1371:

Line 1393: msc_sch_wb.atp_debug('rounding_flag: ' || org_availability_info.rounding_flag(l_process_org_cntr));

1389: END IF;
1390:
1391: -- dsting diagnostic atp
1392: IF PG_DEBUG in ('Y', 'C') THEN
1393: msc_sch_wb.atp_debug('rounding_flag: ' || org_availability_info.rounding_flag(l_process_org_cntr));
1394: msc_sch_wb.atp_debug('parent index: ' || l_parent_index);
1395: msc_sch_wb.atp_debug('process org cntr: ' || l_process_org_cntr);
1396: msc_sch_wb.atp_debug('parent conversion rate: ' || org_availability_info.conversion_rate(l_parent_index));
1397: msc_sch_wb.atp_debug('process org conversion rate: ' || org_availability_info.conversion_rate(l_process_org_cntr));

Line 1394: msc_sch_wb.atp_debug('parent index: ' || l_parent_index);

1390:
1391: -- dsting diagnostic atp
1392: IF PG_DEBUG in ('Y', 'C') THEN
1393: msc_sch_wb.atp_debug('rounding_flag: ' || org_availability_info.rounding_flag(l_process_org_cntr));
1394: msc_sch_wb.atp_debug('parent index: ' || l_parent_index);
1395: msc_sch_wb.atp_debug('process org cntr: ' || l_process_org_cntr);
1396: msc_sch_wb.atp_debug('parent conversion rate: ' || org_availability_info.conversion_rate(l_parent_index));
1397: msc_sch_wb.atp_debug('process org conversion rate: ' || org_availability_info.conversion_rate(l_process_org_cntr));
1398: msc_sch_wb.atp_debug('l_requested_date_quantity: ' || l_requested_date_quantity);

Line 1395: msc_sch_wb.atp_debug('process org cntr: ' || l_process_org_cntr);

1391: -- dsting diagnostic atp
1392: IF PG_DEBUG in ('Y', 'C') THEN
1393: msc_sch_wb.atp_debug('rounding_flag: ' || org_availability_info.rounding_flag(l_process_org_cntr));
1394: msc_sch_wb.atp_debug('parent index: ' || l_parent_index);
1395: msc_sch_wb.atp_debug('process org cntr: ' || l_process_org_cntr);
1396: msc_sch_wb.atp_debug('parent conversion rate: ' || org_availability_info.conversion_rate(l_parent_index));
1397: msc_sch_wb.atp_debug('process org conversion rate: ' || org_availability_info.conversion_rate(l_process_org_cntr));
1398: msc_sch_wb.atp_debug('l_requested_date_quantity: ' || l_requested_date_quantity);
1399: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'after get_material_atp_info');

Line 1396: msc_sch_wb.atp_debug('parent conversion rate: ' || org_availability_info.conversion_rate(l_parent_index));

1392: IF PG_DEBUG in ('Y', 'C') THEN
1393: msc_sch_wb.atp_debug('rounding_flag: ' || org_availability_info.rounding_flag(l_process_org_cntr));
1394: msc_sch_wb.atp_debug('parent index: ' || l_parent_index);
1395: msc_sch_wb.atp_debug('process org cntr: ' || l_process_org_cntr);
1396: msc_sch_wb.atp_debug('parent conversion rate: ' || org_availability_info.conversion_rate(l_parent_index));
1397: msc_sch_wb.atp_debug('process org conversion rate: ' || org_availability_info.conversion_rate(l_process_org_cntr));
1398: msc_sch_wb.atp_debug('l_requested_date_quantity: ' || l_requested_date_quantity);
1399: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'after get_material_atp_info');
1400: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'infinite_time_fenc_date ' || l_get_mat_out_rec.infinite_time_fence_date ||

Line 1397: msc_sch_wb.atp_debug('process org conversion rate: ' || org_availability_info.conversion_rate(l_process_org_cntr));

1393: msc_sch_wb.atp_debug('rounding_flag: ' || org_availability_info.rounding_flag(l_process_org_cntr));
1394: msc_sch_wb.atp_debug('parent index: ' || l_parent_index);
1395: msc_sch_wb.atp_debug('process org cntr: ' || l_process_org_cntr);
1396: msc_sch_wb.atp_debug('parent conversion rate: ' || org_availability_info.conversion_rate(l_parent_index));
1397: msc_sch_wb.atp_debug('process org conversion rate: ' || org_availability_info.conversion_rate(l_process_org_cntr));
1398: msc_sch_wb.atp_debug('l_requested_date_quantity: ' || l_requested_date_quantity);
1399: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'after get_material_atp_info');
1400: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'infinite_time_fenc_date ' || l_get_mat_out_rec.infinite_time_fence_date ||
1401: ' atp_rule_name ' || l_get_mat_out_rec.atp_rule_name);

Line 1398: msc_sch_wb.atp_debug('l_requested_date_quantity: ' || l_requested_date_quantity);

1394: msc_sch_wb.atp_debug('parent index: ' || l_parent_index);
1395: msc_sch_wb.atp_debug('process org cntr: ' || l_process_org_cntr);
1396: msc_sch_wb.atp_debug('parent conversion rate: ' || org_availability_info.conversion_rate(l_parent_index));
1397: msc_sch_wb.atp_debug('process org conversion rate: ' || org_availability_info.conversion_rate(l_process_org_cntr));
1398: msc_sch_wb.atp_debug('l_requested_date_quantity: ' || l_requested_date_quantity);
1399: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'after get_material_atp_info');
1400: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'infinite_time_fenc_date ' || l_get_mat_out_rec.infinite_time_fence_date ||
1401: ' atp_rule_name ' || l_get_mat_out_rec.atp_rule_name);
1402: END IF;

Line 1399: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'after get_material_atp_info');

1395: msc_sch_wb.atp_debug('process org cntr: ' || l_process_org_cntr);
1396: msc_sch_wb.atp_debug('parent conversion rate: ' || org_availability_info.conversion_rate(l_parent_index));
1397: msc_sch_wb.atp_debug('process org conversion rate: ' || org_availability_info.conversion_rate(l_process_org_cntr));
1398: msc_sch_wb.atp_debug('l_requested_date_quantity: ' || l_requested_date_quantity);
1399: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'after get_material_atp_info');
1400: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'infinite_time_fenc_date ' || l_get_mat_out_rec.infinite_time_fence_date ||
1401: ' atp_rule_name ' || l_get_mat_out_rec.atp_rule_name);
1402: END IF;
1403: org_availability_info.infinite_time_fence(l_process_org_cntr) := l_get_mat_out_rec.infinite_time_fence_date;

Line 1400: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'infinite_time_fenc_date ' || l_get_mat_out_rec.infinite_time_fence_date ||

1396: msc_sch_wb.atp_debug('parent conversion rate: ' || org_availability_info.conversion_rate(l_parent_index));
1397: msc_sch_wb.atp_debug('process org conversion rate: ' || org_availability_info.conversion_rate(l_process_org_cntr));
1398: msc_sch_wb.atp_debug('l_requested_date_quantity: ' || l_requested_date_quantity);
1399: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'after get_material_atp_info');
1400: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'infinite_time_fenc_date ' || l_get_mat_out_rec.infinite_time_fence_date ||
1401: ' atp_rule_name ' || l_get_mat_out_rec.atp_rule_name);
1402: END IF;
1403: org_availability_info.infinite_time_fence(l_process_org_cntr) := l_get_mat_out_rec.infinite_time_fence_date;
1404: org_availability_info.atp_rule_name(l_process_org_cntr) := l_get_mat_out_rec.atp_rule_name;

Line 1417: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_requested_date_quantity := ' || l_requested_date_quantity);

1413: org_availability_info.request_date_quantity(l_process_org_cntr) := 0;
1414: l_requested_date_quantity := 0;
1415: END IF; -- IF l_atp_flag = 'Y'
1416: IF PG_DEBUG in ('Y', 'C') THEN
1417: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_requested_date_quantity := ' || l_requested_date_quantity);
1418: END IF;
1419:
1420: ---add material demand
1421:

Line 1439: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.inventory_item_id := ' || l_atp_insert_rec.inventory_item_id);

1435: l_atp_insert_rec.atf_date := org_availability_info.atf_date(l_process_org_cntr);
1436: l_atp_insert_rec.atf_date_quantity := org_availability_info.atf_date_quantity(l_process_org_cntr);
1437: l_atp_insert_rec.requested_date_quantity := org_availability_info.request_date_quantity(l_process_org_cntr);
1438: IF PG_DEBUG in ('Y', 'C') THEN
1439: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.inventory_item_id := ' || l_atp_insert_rec.inventory_item_id);
1440: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.request_item_id := ' || l_atp_insert_rec.request_item_id);
1441: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.atf_date := ' || l_atp_insert_rec.atf_date);
1442: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.atf_date_quantity := ' || l_atp_insert_rec.atf_date_quantity);
1443: END IF;

Line 1440: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.request_item_id := ' || l_atp_insert_rec.request_item_id);

1436: l_atp_insert_rec.atf_date_quantity := org_availability_info.atf_date_quantity(l_process_org_cntr);
1437: l_atp_insert_rec.requested_date_quantity := org_availability_info.request_date_quantity(l_process_org_cntr);
1438: IF PG_DEBUG in ('Y', 'C') THEN
1439: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.inventory_item_id := ' || l_atp_insert_rec.inventory_item_id);
1440: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.request_item_id := ' || l_atp_insert_rec.request_item_id);
1441: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.atf_date := ' || l_atp_insert_rec.atf_date);
1442: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.atf_date_quantity := ' || l_atp_insert_rec.atf_date_quantity);
1443: END IF;
1444: --bug3467631 end

Line 1441: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.atf_date := ' || l_atp_insert_rec.atf_date);

1437: l_atp_insert_rec.requested_date_quantity := org_availability_info.request_date_quantity(l_process_org_cntr);
1438: IF PG_DEBUG in ('Y', 'C') THEN
1439: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.inventory_item_id := ' || l_atp_insert_rec.inventory_item_id);
1440: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.request_item_id := ' || l_atp_insert_rec.request_item_id);
1441: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.atf_date := ' || l_atp_insert_rec.atf_date);
1442: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.atf_date_quantity := ' || l_atp_insert_rec.atf_date_quantity);
1443: END IF;
1444: --bug3467631 end
1445: ELSE

Line 1442: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.atf_date_quantity := ' || l_atp_insert_rec.atf_date_quantity);

1438: IF PG_DEBUG in ('Y', 'C') THEN
1439: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.inventory_item_id := ' || l_atp_insert_rec.inventory_item_id);
1440: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.request_item_id := ' || l_atp_insert_rec.request_item_id);
1441: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.atf_date := ' || l_atp_insert_rec.atf_date);
1442: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.atf_date_quantity := ' || l_atp_insert_rec.atf_date_quantity);
1443: END IF;
1444: --bug3467631 end
1445: ELSE
1446: l_atp_insert_rec.request_item_id := item_availability_info.inventory_item_id(l_item_cntr);

Line 1492: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Alloc ATP, top org,We put demand for := ' ||

1488: l_atp_insert_rec.quantity_ordered := least(greatest(0, l_requested_date_quantity),
1489: l_net_demand);
1490:
1491: IF PG_DEBUG in ('Y', 'C') THEN
1492: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Alloc ATP, top org,We put demand for := ' ||
1493: l_atp_insert_rec.quantity_ordered);
1494: END IF;
1495: ELSE
1496:

Line 1516: msc_sch_wb.atp_debug('place full dmd: ' || l_net_demand);

1512:
1513: -- dsting diag_atp
1514: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP THEN
1515: IF PG_DEBUG in ('Y', 'C') THEN
1516: msc_sch_wb.atp_debug('place full dmd: ' || l_net_demand);
1517: END IF;
1518: -- dsting 2754446
1519: -- l_atp_insert_rec.quantity_ordered := l_net_demand;
1520: l_atp_insert_rec.quantity_ordered := org_availability_info.demand_quantity(l_process_org_cntr);

Line 1523: msc_sch_wb.atp_debug('place partial dmd: ' || l_atp_insert_rec.quantity_ordered);

1519: -- l_atp_insert_rec.quantity_ordered := l_net_demand;
1520: l_atp_insert_rec.quantity_ordered := org_availability_info.demand_quantity(l_process_org_cntr);
1521: ELSE
1522: IF PG_DEBUG in ('Y', 'C') THEN
1523: msc_sch_wb.atp_debug('place partial dmd: ' || l_atp_insert_rec.quantity_ordered);
1524: END IF;
1525: -- dsting 2754446 rounding error?
1526: l_atp_insert_rec.quantity_ordered :=
1527: least(greatest(0, l_requested_date_quantity),

Line 1557: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_demand_id := ' || l_demand_id);

1553: l_demand_id);
1554: -- time_phased_atp changes end
1555:
1556: IF PG_DEBUG in ('Y', 'C') THEN
1557: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_demand_id := ' || l_demand_id);
1558: END IF;
1559: -- store demand id in org_avail_info table as we would need to update the demand
1560: -- in lower orgs if we dont have enough quantity in the org
1561: org_availability_info.demand_id(l_process_org_cntr) := l_demand_id;

Line 1576: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'demand pegging id := ' || l_pegging_id);

1572: INTO l_pegging_id
1573: FROM dual;
1574:
1575: IF PG_DEBUG in ('Y', 'C') THEN
1576: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'demand pegging id := ' || l_pegging_id);
1577: END IF;
1578: org_availability_info.demand_pegging_id(l_process_org_cntr) := l_pegging_id;
1579:
1580: --- supply pegging id

Line 1606: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'net demand ' || l_net_demand || ' requested qty ' || l_requested_date_quantity);

1602: l_return_status);
1603: ---Now do stealing
1604:
1605: IF PG_DEBUG in ('Y', 'C') THEN
1606: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'net demand ' || l_net_demand || ' requested qty ' || l_requested_date_quantity);
1607: END IF;
1608:
1609: -- 2754446
1610: -- l_net_demand := GREATEST(l_net_demand - greatest(0, l_requested_date_quantity), 0);

Line 1616: msc_sch_wb.atp_debug('orig_net_dmd: ' || l_orig_net_dmd);

1612: l_net_demand := greatest(0,
1613: l_orig_net_dmd - nvl(org_availability_info.rnding_leftover(1), 0));
1614:
1615: IF PG_DEBUG in ('Y', 'C') THEN
1616: msc_sch_wb.atp_debug('orig_net_dmd: ' || l_orig_net_dmd);
1617: msc_sch_wb.atp_debug('rnding_leftover(1): ' || org_availability_info.rnding_leftover(1));
1618: msc_sch_wb.atp_debug('req_date_qty: ' || greatest(nvl(org_availability_info.request_date_quantity(1), 0),0));
1619: msc_sch_wb.atp_debug('steal_qty: ' || org_availability_info.steal_qty(1));
1620: msc_sch_wb.atp_debug('net_dmd: ' || l_net_demand);

Line 1617: msc_sch_wb.atp_debug('rnding_leftover(1): ' || org_availability_info.rnding_leftover(1));

1613: l_orig_net_dmd - nvl(org_availability_info.rnding_leftover(1), 0));
1614:
1615: IF PG_DEBUG in ('Y', 'C') THEN
1616: msc_sch_wb.atp_debug('orig_net_dmd: ' || l_orig_net_dmd);
1617: msc_sch_wb.atp_debug('rnding_leftover(1): ' || org_availability_info.rnding_leftover(1));
1618: msc_sch_wb.atp_debug('req_date_qty: ' || greatest(nvl(org_availability_info.request_date_quantity(1), 0),0));
1619: msc_sch_wb.atp_debug('steal_qty: ' || org_availability_info.steal_qty(1));
1620: msc_sch_wb.atp_debug('net_dmd: ' || l_net_demand);
1621: END IF;

Line 1618: msc_sch_wb.atp_debug('req_date_qty: ' || greatest(nvl(org_availability_info.request_date_quantity(1), 0),0));

1614:
1615: IF PG_DEBUG in ('Y', 'C') THEN
1616: msc_sch_wb.atp_debug('orig_net_dmd: ' || l_orig_net_dmd);
1617: msc_sch_wb.atp_debug('rnding_leftover(1): ' || org_availability_info.rnding_leftover(1));
1618: msc_sch_wb.atp_debug('req_date_qty: ' || greatest(nvl(org_availability_info.request_date_quantity(1), 0),0));
1619: msc_sch_wb.atp_debug('steal_qty: ' || org_availability_info.steal_qty(1));
1620: msc_sch_wb.atp_debug('net_dmd: ' || l_net_demand);
1621: END IF;
1622:

Line 1619: msc_sch_wb.atp_debug('steal_qty: ' || org_availability_info.steal_qty(1));

1615: IF PG_DEBUG in ('Y', 'C') THEN
1616: msc_sch_wb.atp_debug('orig_net_dmd: ' || l_orig_net_dmd);
1617: msc_sch_wb.atp_debug('rnding_leftover(1): ' || org_availability_info.rnding_leftover(1));
1618: msc_sch_wb.atp_debug('req_date_qty: ' || greatest(nvl(org_availability_info.request_date_quantity(1), 0),0));
1619: msc_sch_wb.atp_debug('steal_qty: ' || org_availability_info.steal_qty(1));
1620: msc_sch_wb.atp_debug('net_dmd: ' || l_net_demand);
1621: END IF;
1622:
1623: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND (l_atp_flag in ('Y', 'C')) and l_net_demand > 0 THEN

Line 1620: msc_sch_wb.atp_debug('net_dmd: ' || l_net_demand);

1616: msc_sch_wb.atp_debug('orig_net_dmd: ' || l_orig_net_dmd);
1617: msc_sch_wb.atp_debug('rnding_leftover(1): ' || org_availability_info.rnding_leftover(1));
1618: msc_sch_wb.atp_debug('req_date_qty: ' || greatest(nvl(org_availability_info.request_date_quantity(1), 0),0));
1619: msc_sch_wb.atp_debug('steal_qty: ' || org_availability_info.steal_qty(1));
1620: msc_sch_wb.atp_debug('net_dmd: ' || l_net_demand);
1621: END IF;
1622:
1623: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND (l_atp_flag in ('Y', 'C')) and l_net_demand > 0 THEN
1624:

Line 1626: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'we are in the setup for stealing');

1622:
1623: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND (l_atp_flag in ('Y', 'C')) and l_net_demand > 0 THEN
1624:
1625: IF PG_DEBUG in ('Y', 'C') THEN
1626: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'we are in the setup for stealing');
1627: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand := ' || l_net_demand);
1628: END IF;
1629: g_atp_record.error_code := MSC_ATP_PVT.ALLSUCCESS;
1630:

Line 1627: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand := ' || l_net_demand);

1623: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND (l_atp_flag in ('Y', 'C')) and l_net_demand > 0 THEN
1624:
1625: IF PG_DEBUG in ('Y', 'C') THEN
1626: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'we are in the setup for stealing');
1627: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand := ' || l_net_demand);
1628: END IF;
1629: g_atp_record.error_code := MSC_ATP_PVT.ALLSUCCESS;
1630:
1631: -- time_phased_atp

Line 1688: msc_sch_wb.atp_debug('l_post_stealing_dmd: ' || g_atp_record.quantity_ordered);

1684: l_post_stealing_dmd := g_atp_record.quantity_ordered; --bug3467631 change done
1685: -- so that l_post_stealing_dmd is not passed null which completes the fix of 2754446
1686:
1687: IF PG_DEBUG in ('Y', 'C') THEN --bug3467631
1688: msc_sch_wb.atp_debug('l_post_stealing_dmd: ' || g_atp_record.quantity_ordered);
1689: END IF;
1690:
1691: MSC_AATP_PVT.Stealing(
1692: g_atp_record,

Line 1726: msc_sch_wb.atp_debug('l_stealing_qty: ' || l_stealing_qty);

1722: -- greatest(l_net_demand, 0);
1723: -- l_net_demand := l_net_demand - l_stealing_qty;
1724:
1725: IF PG_DEBUG in ('Y', 'C') THEN
1726: msc_sch_wb.atp_debug('l_stealing_qty: ' || l_stealing_qty);
1727: msc_sch_wb.atp_debug('l_net_demand: ' || l_net_demand);
1728: msc_sch_wb.atp_debug('l_post_stealing_dmd: ' || l_post_stealing_dmd);
1729: msc_sch_wb.atp_debug('Qty till now got: ' || org_availability_info.rnding_leftover(l_process_org_cntr)); --bug3467631
1730: END IF;

Line 1727: msc_sch_wb.atp_debug('l_net_demand: ' || l_net_demand);

1723: -- l_net_demand := l_net_demand - l_stealing_qty;
1724:
1725: IF PG_DEBUG in ('Y', 'C') THEN
1726: msc_sch_wb.atp_debug('l_stealing_qty: ' || l_stealing_qty);
1727: msc_sch_wb.atp_debug('l_net_demand: ' || l_net_demand);
1728: msc_sch_wb.atp_debug('l_post_stealing_dmd: ' || l_post_stealing_dmd);
1729: msc_sch_wb.atp_debug('Qty till now got: ' || org_availability_info.rnding_leftover(l_process_org_cntr)); --bug3467631
1730: END IF;
1731:

Line 1728: msc_sch_wb.atp_debug('l_post_stealing_dmd: ' || l_post_stealing_dmd);

1724:
1725: IF PG_DEBUG in ('Y', 'C') THEN
1726: msc_sch_wb.atp_debug('l_stealing_qty: ' || l_stealing_qty);
1727: msc_sch_wb.atp_debug('l_net_demand: ' || l_net_demand);
1728: msc_sch_wb.atp_debug('l_post_stealing_dmd: ' || l_post_stealing_dmd);
1729: msc_sch_wb.atp_debug('Qty till now got: ' || org_availability_info.rnding_leftover(l_process_org_cntr)); --bug3467631
1730: END IF;
1731:
1732: org_availability_info.steal_qty(l_process_org_cntr) := l_stealing_qty;

Line 1729: msc_sch_wb.atp_debug('Qty till now got: ' || org_availability_info.rnding_leftover(l_process_org_cntr)); --bug3467631

1725: IF PG_DEBUG in ('Y', 'C') THEN
1726: msc_sch_wb.atp_debug('l_stealing_qty: ' || l_stealing_qty);
1727: msc_sch_wb.atp_debug('l_net_demand: ' || l_net_demand);
1728: msc_sch_wb.atp_debug('l_post_stealing_dmd: ' || l_post_stealing_dmd);
1729: msc_sch_wb.atp_debug('Qty till now got: ' || org_availability_info.rnding_leftover(l_process_org_cntr)); --bug3467631
1730: END IF;
1731:
1732: org_availability_info.steal_qty(l_process_org_cntr) := l_stealing_qty;
1733:

Line 1748: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'After Stealing :'||

1744: l_post_stealing_dmd;
1745: -- l_net_demand;
1746:
1747: IF PG_DEBUG in ('Y', 'C') THEN
1748: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'After Stealing :'||
1749: to_char(l_net_demand));
1750: END IF;
1751:
1752: -- dsting diag_atp

Line 1757: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Top Org, update demand');

1753: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP <> DIAGNOSTIC_ATP THEN
1754: --- now we update the demand
1755: IF l_process_org_cntr =1 THEN
1756: IF PG_DEBUG in ('Y', 'C') THEN
1757: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Top Org, update demand');
1758: END IF;
1759: --- for top org we always create order for the quantity ordered
1760: MSC_ATP_SUBST.UPDATE_DEMAND(org_availability_info.demand_id(l_process_org_cntr),
1761: org_availability_info.plan_id(l_process_org_cntr),

Line 1779: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Error occured in procedure Increment_Bucketed_Demands_Qty');

1775: l_return_status
1776: );
1777: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1778: IF PG_DEBUG in ('Y', 'C') THEN
1779: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Error occured in procedure Increment_Bucketed_Demands_Qty');
1780: END IF;
1781: RAISE FND_API.G_EXC_ERROR;
1782: END IF;
1783: /* Reset l_atf_date_qty to 0*/ --bug3467631

Line 1789: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'second or later org, update demand as there is some stolen qty');

1785: END IF;
1786: -- time_phased_atp changes end
1787: ELSIF l_stealing_qty > 0 THEN
1788: IF PG_DEBUG in ('Y', 'C') THEN
1789: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'second or later org, update demand as there is some stolen qty');
1790: END IF;
1791: --- org in second or later tear. Create demand for quantity available (req date qty+steal qty)
1792: MSC_ATP_SUBST.UPDATE_DEMAND(org_availability_info.demand_id(l_process_org_cntr),
1793: org_availability_info.plan_id(l_process_org_cntr),

Line 1814: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Error occured in procedure Increment_Bucketed_Demands_Qty');

1810: l_return_status
1811: );
1812: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1813: IF PG_DEBUG in ('Y', 'C') THEN
1814: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Error occured in procedure Increment_Bucketed_Demands_Qty');
1815: END IF;
1816: RAISE FND_API.G_EXC_ERROR;
1817: END IF;
1818: /* Reset l_atf_date_qty to 0*/ --bug3467631

Line 1829: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_process_org_cntr := ' || l_process_org_cntr);

1825: END IF; -- IF l_atp_flag = 'N' and l_atp_comp_flag = 'N' THEN
1826:
1827: --l_net_demand := GREATEST(l_net_demand - greatest(0, l_requested_date_quantity), 0);
1828: IF PG_DEBUG in ('Y', 'C') THEN
1829: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_process_org_cntr := ' || l_process_org_cntr);
1830: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_parent_org counter 1 := ' || l_parent_org_cntr);
1831: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'org count := ' || org_availability_info.organization_id.count);
1832: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_requested_ship_date := ' || l_requested_ship_date);
1833: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sys_date_top_org := ' || l_sys_date_top_org);

Line 1830: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_parent_org counter 1 := ' || l_parent_org_cntr);

1826:
1827: --l_net_demand := GREATEST(l_net_demand - greatest(0, l_requested_date_quantity), 0);
1828: IF PG_DEBUG in ('Y', 'C') THEN
1829: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_process_org_cntr := ' || l_process_org_cntr);
1830: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_parent_org counter 1 := ' || l_parent_org_cntr);
1831: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'org count := ' || org_availability_info.organization_id.count);
1832: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_requested_ship_date := ' || l_requested_ship_date);
1833: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sys_date_top_org := ' || l_sys_date_top_org);
1834: END IF;

Line 1831: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'org count := ' || org_availability_info.organization_id.count);

1827: --l_net_demand := GREATEST(l_net_demand - greatest(0, l_requested_date_quantity), 0);
1828: IF PG_DEBUG in ('Y', 'C') THEN
1829: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_process_org_cntr := ' || l_process_org_cntr);
1830: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_parent_org counter 1 := ' || l_parent_org_cntr);
1831: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'org count := ' || org_availability_info.organization_id.count);
1832: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_requested_ship_date := ' || l_requested_ship_date);
1833: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sys_date_top_org := ' || l_sys_date_top_org);
1834: END IF;
1835: IF l_net_demand > 0 and l_process_org_cntr >= org_availability_info.organization_id.count

Line 1832: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_requested_ship_date := ' || l_requested_ship_date);

1828: IF PG_DEBUG in ('Y', 'C') THEN
1829: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_process_org_cntr := ' || l_process_org_cntr);
1830: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_parent_org counter 1 := ' || l_parent_org_cntr);
1831: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'org count := ' || org_availability_info.organization_id.count);
1832: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_requested_ship_date := ' || l_requested_ship_date);
1833: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sys_date_top_org := ' || l_sys_date_top_org);
1834: END IF;
1835: IF l_net_demand > 0 and l_process_org_cntr >= org_availability_info.organization_id.count
1836: and l_requested_ship_date >= l_sys_date_top_org THEN

Line 1833: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sys_date_top_org := ' || l_sys_date_top_org);

1829: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_process_org_cntr := ' || l_process_org_cntr);
1830: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_parent_org counter 1 := ' || l_parent_org_cntr);
1831: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'org count := ' || org_availability_info.organization_id.count);
1832: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_requested_ship_date := ' || l_requested_ship_date);
1833: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sys_date_top_org := ' || l_sys_date_top_org);
1834: END IF;
1835: IF l_net_demand > 0 and l_process_org_cntr >= org_availability_info.organization_id.count
1836: and l_requested_ship_date >= l_sys_date_top_org THEN
1837:

Line 1846: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_parent_org_cntr := ' || l_parent_org_cntr);

1842: -- l_sources found = 1 iff there is a good transfer source found that doesn't violate constraints
1843: -- l_transfer_found = 1 if there is any transfer source
1844: l_transfer_found := 0;
1845: IF PG_DEBUG in ('Y', 'C') THEN
1846: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_parent_org_cntr := ' || l_parent_org_cntr);
1847: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_process_org_cntr := ' || l_process_org_cntr);
1848: END IF;
1849: WHILE l_sources_found = 0 AND l_parent_org_cntr <= org_availability_info.organization_id.count LOOP
1850: IF PG_DEBUG in ('Y', 'C') THEN

Line 1847: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_process_org_cntr := ' || l_process_org_cntr);

1843: -- l_transfer_found = 1 if there is any transfer source
1844: l_transfer_found := 0;
1845: IF PG_DEBUG in ('Y', 'C') THEN
1846: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_parent_org_cntr := ' || l_parent_org_cntr);
1847: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_process_org_cntr := ' || l_process_org_cntr);
1848: END IF;
1849: WHILE l_sources_found = 0 AND l_parent_org_cntr <= org_availability_info.organization_id.count LOOP
1850: IF PG_DEBUG in ('Y', 'C') THEN
1851: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Look for sources for org :' || ORG_AVAILABILITY_INFO.organization_id(l_parent_org_cntr));

Line 1851: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Look for sources for org :' || ORG_AVAILABILITY_INFO.organization_id(l_parent_org_cntr));

1847: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_process_org_cntr := ' || l_process_org_cntr);
1848: END IF;
1849: WHILE l_sources_found = 0 AND l_parent_org_cntr <= org_availability_info.organization_id.count LOOP
1850: IF PG_DEBUG in ('Y', 'C') THEN
1851: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Look for sources for org :' || ORG_AVAILABILITY_INFO.organization_id(l_parent_org_cntr));
1852: END IF;
1853: IF org_availability_info.atp_comp_flag(l_parent_org_cntr) in ('Y', 'C') THEN
1854: --s_cto_rearch
1855: l_item_sourcing_info_rec := l_null_item_sourcing_info_rec;

Line 1882: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'constraint type: MATERIAL_CONSTRAINT');

1878: ELSE
1879: l_sources := l_null_sources;
1880: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP THEN
1881: IF PG_DEBUG in ('Y', 'C') THEN
1882: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'constraint type: MATERIAL_CONSTRAINT');
1883: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'make_buy_code: ' || l_make_buy_cd);
1884: END IF;
1885: org_availability_info.constraint_type(l_parent_org_cntr) := MATERIAL_CONSTRAINT;
1886: END IF;

Line 1883: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'make_buy_code: ' || l_make_buy_cd);

1879: l_sources := l_null_sources;
1880: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP THEN
1881: IF PG_DEBUG in ('Y', 'C') THEN
1882: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'constraint type: MATERIAL_CONSTRAINT');
1883: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'make_buy_code: ' || l_make_buy_cd);
1884: END IF;
1885: org_availability_info.constraint_type(l_parent_org_cntr) := MATERIAL_CONSTRAINT;
1886: END IF;
1887: END IF;

Line 1892: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'No sources Found for this org');

1888: IF l_return_status <> FND_API.G_RET_STS_SUCCESS OR
1889: l_sources.source_type.count = 0
1890: THEN
1891: IF PG_DEBUG in ('Y', 'C') THEN
1892: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'No sources Found for this org');
1893: END IF;
1894:
1895: ELSE
1896: IF PG_DEBUG in ('Y', 'C') THEN

Line 1897: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Sources Found, process them');

1893: END IF;
1894:
1895: ELSE
1896: IF PG_DEBUG in ('Y', 'C') THEN
1897: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Sources Found, process them');
1898: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || ' source count := ' || l_sources.organization_id.count);
1899: END IF;
1900:
1901: FOR i in 1..l_sources.organization_id.count LOOP

Line 1898: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || ' source count := ' || l_sources.organization_id.count);

1894:
1895: ELSE
1896: IF PG_DEBUG in ('Y', 'C') THEN
1897: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Sources Found, process them');
1898: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || ' source count := ' || l_sources.organization_id.count);
1899: END IF;
1900:
1901: FOR i in 1..l_sources.organization_id.count LOOP
1902:

Line 1912: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_delivery_lead_time := ' || l_delivery_lead_time);

1908: l_delivery_lead_time := l_sources.lead_time(i);
1909: l_ship_method := l_sources.ship_method(i);
1910:
1911: IF PG_DEBUG in ('Y', 'C') THEN
1912: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_delivery_lead_time := ' || l_delivery_lead_time);
1913: END IF;
1914:
1915: --bug3467631 making necessary changes for ship_rec_cal
1916: /* ship_rec_cal changes begin */

Line 1918: msc_sch_wb.atp_debug('**************** Calendar Codes ******************************');

1914:
1915: --bug3467631 making necessary changes for ship_rec_cal
1916: /* ship_rec_cal changes begin */
1917: IF PG_DEBUG in ('Y', 'C') THEN
1918: msc_sch_wb.atp_debug('**************** Calendar Codes ******************************');
1919: msc_sch_wb.atp_debug('* ___________________Input_____________________');
1920: msc_sch_wb.atp_debug('* ');
1921: msc_sch_wb.atp_debug('* Source Type : '|| l_sources.source_type(i) );
1922: msc_sch_wb.atp_debug('* Instance ID : '|| p_atp_record.instance_id );

Line 1919: msc_sch_wb.atp_debug('* ___________________Input_____________________');

1915: --bug3467631 making necessary changes for ship_rec_cal
1916: /* ship_rec_cal changes begin */
1917: IF PG_DEBUG in ('Y', 'C') THEN
1918: msc_sch_wb.atp_debug('**************** Calendar Codes ******************************');
1919: msc_sch_wb.atp_debug('* ___________________Input_____________________');
1920: msc_sch_wb.atp_debug('* ');
1921: msc_sch_wb.atp_debug('* Source Type : '|| l_sources.source_type(i) );
1922: msc_sch_wb.atp_debug('* Instance ID : '|| p_atp_record.instance_id );
1923: msc_sch_wb.atp_debug('* Source Instance ID : '|| l_sources.instance_id(i) );

Line 1920: msc_sch_wb.atp_debug('* ');

1916: /* ship_rec_cal changes begin */
1917: IF PG_DEBUG in ('Y', 'C') THEN
1918: msc_sch_wb.atp_debug('**************** Calendar Codes ******************************');
1919: msc_sch_wb.atp_debug('* ___________________Input_____________________');
1920: msc_sch_wb.atp_debug('* ');
1921: msc_sch_wb.atp_debug('* Source Type : '|| l_sources.source_type(i) );
1922: msc_sch_wb.atp_debug('* Instance ID : '|| p_atp_record.instance_id );
1923: msc_sch_wb.atp_debug('* Source Instance ID : '|| l_sources.instance_id(i) );
1924: msc_sch_wb.atp_debug('* Source Org ID : '|| l_sources.organization_id(i) );

Line 1921: msc_sch_wb.atp_debug('* Source Type : '|| l_sources.source_type(i) );

1917: IF PG_DEBUG in ('Y', 'C') THEN
1918: msc_sch_wb.atp_debug('**************** Calendar Codes ******************************');
1919: msc_sch_wb.atp_debug('* ___________________Input_____________________');
1920: msc_sch_wb.atp_debug('* ');
1921: msc_sch_wb.atp_debug('* Source Type : '|| l_sources.source_type(i) );
1922: msc_sch_wb.atp_debug('* Instance ID : '|| p_atp_record.instance_id );
1923: msc_sch_wb.atp_debug('* Source Instance ID : '|| l_sources.instance_id(i) );
1924: msc_sch_wb.atp_debug('* Source Org ID : '|| l_sources.organization_id(i) );
1925: msc_sch_wb.atp_debug('* Receiving Org ID : '|| org_availability_info.organization_id(l_parent_org_cntr) );

Line 1922: msc_sch_wb.atp_debug('* Instance ID : '|| p_atp_record.instance_id );

1918: msc_sch_wb.atp_debug('**************** Calendar Codes ******************************');
1919: msc_sch_wb.atp_debug('* ___________________Input_____________________');
1920: msc_sch_wb.atp_debug('* ');
1921: msc_sch_wb.atp_debug('* Source Type : '|| l_sources.source_type(i) );
1922: msc_sch_wb.atp_debug('* Instance ID : '|| p_atp_record.instance_id );
1923: msc_sch_wb.atp_debug('* Source Instance ID : '|| l_sources.instance_id(i) );
1924: msc_sch_wb.atp_debug('* Source Org ID : '|| l_sources.organization_id(i) );
1925: msc_sch_wb.atp_debug('* Receiving Org ID : '|| org_availability_info.organization_id(l_parent_org_cntr) );
1926: msc_sch_wb.atp_debug('* Ship Method : '|| l_sources.Ship_Method(i) );

Line 1923: msc_sch_wb.atp_debug('* Source Instance ID : '|| l_sources.instance_id(i) );

1919: msc_sch_wb.atp_debug('* ___________________Input_____________________');
1920: msc_sch_wb.atp_debug('* ');
1921: msc_sch_wb.atp_debug('* Source Type : '|| l_sources.source_type(i) );
1922: msc_sch_wb.atp_debug('* Instance ID : '|| p_atp_record.instance_id );
1923: msc_sch_wb.atp_debug('* Source Instance ID : '|| l_sources.instance_id(i) );
1924: msc_sch_wb.atp_debug('* Source Org ID : '|| l_sources.organization_id(i) );
1925: msc_sch_wb.atp_debug('* Receiving Org ID : '|| org_availability_info.organization_id(l_parent_org_cntr) );
1926: msc_sch_wb.atp_debug('* Ship Method : '|| l_sources.Ship_Method(i) );
1927: END IF;

Line 1924: msc_sch_wb.atp_debug('* Source Org ID : '|| l_sources.organization_id(i) );

1920: msc_sch_wb.atp_debug('* ');
1921: msc_sch_wb.atp_debug('* Source Type : '|| l_sources.source_type(i) );
1922: msc_sch_wb.atp_debug('* Instance ID : '|| p_atp_record.instance_id );
1923: msc_sch_wb.atp_debug('* Source Instance ID : '|| l_sources.instance_id(i) );
1924: msc_sch_wb.atp_debug('* Source Org ID : '|| l_sources.organization_id(i) );
1925: msc_sch_wb.atp_debug('* Receiving Org ID : '|| org_availability_info.organization_id(l_parent_org_cntr) );
1926: msc_sch_wb.atp_debug('* Ship Method : '|| l_sources.Ship_Method(i) );
1927: END IF;
1928:

Line 1925: msc_sch_wb.atp_debug('* Receiving Org ID : '|| org_availability_info.organization_id(l_parent_org_cntr) );

1921: msc_sch_wb.atp_debug('* Source Type : '|| l_sources.source_type(i) );
1922: msc_sch_wb.atp_debug('* Instance ID : '|| p_atp_record.instance_id );
1923: msc_sch_wb.atp_debug('* Source Instance ID : '|| l_sources.instance_id(i) );
1924: msc_sch_wb.atp_debug('* Source Org ID : '|| l_sources.organization_id(i) );
1925: msc_sch_wb.atp_debug('* Receiving Org ID : '|| org_availability_info.organization_id(l_parent_org_cntr) );
1926: msc_sch_wb.atp_debug('* Ship Method : '|| l_sources.Ship_Method(i) );
1927: END IF;
1928:
1929: IF l_sources.source_type(i) = MSC_ATP_PVT.TRANSFER THEN

Line 1926: msc_sch_wb.atp_debug('* Ship Method : '|| l_sources.Ship_Method(i) );

1922: msc_sch_wb.atp_debug('* Instance ID : '|| p_atp_record.instance_id );
1923: msc_sch_wb.atp_debug('* Source Instance ID : '|| l_sources.instance_id(i) );
1924: msc_sch_wb.atp_debug('* Source Org ID : '|| l_sources.organization_id(i) );
1925: msc_sch_wb.atp_debug('* Receiving Org ID : '|| org_availability_info.organization_id(l_parent_org_cntr) );
1926: msc_sch_wb.atp_debug('* Ship Method : '|| l_sources.Ship_Method(i) );
1927: END IF;
1928:
1929: IF l_sources.source_type(i) = MSC_ATP_PVT.TRANSFER THEN
1930: -- receiving party is org

Line 1985: msc_sch_wb.atp_debug(' ');

1981: null,
1982: MSC_CALENDAR.OMC);
1983: END IF;
1984: IF PG_DEBUG in ('Y', 'C') THEN
1985: msc_sch_wb.atp_debug(' ');
1986: msc_sch_wb.atp_debug('* ___________________Output____________________');
1987: msc_sch_wb.atp_debug('* ');
1988: msc_sch_wb.atp_debug('* Receiving calendar code : ' || l_receiving_cal_code);
1989: msc_sch_wb.atp_debug('* Intransit calendar code : ' || l_intransit_cal_code);

Line 1986: msc_sch_wb.atp_debug('* ___________________Output____________________');

1982: MSC_CALENDAR.OMC);
1983: END IF;
1984: IF PG_DEBUG in ('Y', 'C') THEN
1985: msc_sch_wb.atp_debug(' ');
1986: msc_sch_wb.atp_debug('* ___________________Output____________________');
1987: msc_sch_wb.atp_debug('* ');
1988: msc_sch_wb.atp_debug('* Receiving calendar code : ' || l_receiving_cal_code);
1989: msc_sch_wb.atp_debug('* Intransit calendar code : ' || l_intransit_cal_code);
1990: msc_sch_wb.atp_debug('* Shipping calendar code : ' || l_shipping_cal_code);

Line 1987: msc_sch_wb.atp_debug('* ');

1983: END IF;
1984: IF PG_DEBUG in ('Y', 'C') THEN
1985: msc_sch_wb.atp_debug(' ');
1986: msc_sch_wb.atp_debug('* ___________________Output____________________');
1987: msc_sch_wb.atp_debug('* ');
1988: msc_sch_wb.atp_debug('* Receiving calendar code : ' || l_receiving_cal_code);
1989: msc_sch_wb.atp_debug('* Intransit calendar code : ' || l_intransit_cal_code);
1990: msc_sch_wb.atp_debug('* Shipping calendar code : ' || l_shipping_cal_code);
1991: msc_sch_wb.atp_debug('* Manufacturing calendar code : ' || l_manufacturing_cal_code);

Line 1988: msc_sch_wb.atp_debug('* Receiving calendar code : ' || l_receiving_cal_code);

1984: IF PG_DEBUG in ('Y', 'C') THEN
1985: msc_sch_wb.atp_debug(' ');
1986: msc_sch_wb.atp_debug('* ___________________Output____________________');
1987: msc_sch_wb.atp_debug('* ');
1988: msc_sch_wb.atp_debug('* Receiving calendar code : ' || l_receiving_cal_code);
1989: msc_sch_wb.atp_debug('* Intransit calendar code : ' || l_intransit_cal_code);
1990: msc_sch_wb.atp_debug('* Shipping calendar code : ' || l_shipping_cal_code);
1991: msc_sch_wb.atp_debug('* Manufacturing calendar code : ' || l_manufacturing_cal_code);
1992: msc_sch_wb.atp_debug('**************************************************************');

Line 1989: msc_sch_wb.atp_debug('* Intransit calendar code : ' || l_intransit_cal_code);

1985: msc_sch_wb.atp_debug(' ');
1986: msc_sch_wb.atp_debug('* ___________________Output____________________');
1987: msc_sch_wb.atp_debug('* ');
1988: msc_sch_wb.atp_debug('* Receiving calendar code : ' || l_receiving_cal_code);
1989: msc_sch_wb.atp_debug('* Intransit calendar code : ' || l_intransit_cal_code);
1990: msc_sch_wb.atp_debug('* Shipping calendar code : ' || l_shipping_cal_code);
1991: msc_sch_wb.atp_debug('* Manufacturing calendar code : ' || l_manufacturing_cal_code);
1992: msc_sch_wb.atp_debug('**************************************************************');
1993: END IF;

Line 1990: msc_sch_wb.atp_debug('* Shipping calendar code : ' || l_shipping_cal_code);

1986: msc_sch_wb.atp_debug('* ___________________Output____________________');
1987: msc_sch_wb.atp_debug('* ');
1988: msc_sch_wb.atp_debug('* Receiving calendar code : ' || l_receiving_cal_code);
1989: msc_sch_wb.atp_debug('* Intransit calendar code : ' || l_intransit_cal_code);
1990: msc_sch_wb.atp_debug('* Shipping calendar code : ' || l_shipping_cal_code);
1991: msc_sch_wb.atp_debug('* Manufacturing calendar code : ' || l_manufacturing_cal_code);
1992: msc_sch_wb.atp_debug('**************************************************************');
1993: END IF;
1994:

Line 1991: msc_sch_wb.atp_debug('* Manufacturing calendar code : ' || l_manufacturing_cal_code);

1987: msc_sch_wb.atp_debug('* ');
1988: msc_sch_wb.atp_debug('* Receiving calendar code : ' || l_receiving_cal_code);
1989: msc_sch_wb.atp_debug('* Intransit calendar code : ' || l_intransit_cal_code);
1990: msc_sch_wb.atp_debug('* Shipping calendar code : ' || l_shipping_cal_code);
1991: msc_sch_wb.atp_debug('* Manufacturing calendar code : ' || l_manufacturing_cal_code);
1992: msc_sch_wb.atp_debug('**************************************************************');
1993: END IF;
1994:
1995: /* planned order due date as per OMC-D */

Line 1992: msc_sch_wb.atp_debug('**************************************************************');

1988: msc_sch_wb.atp_debug('* Receiving calendar code : ' || l_receiving_cal_code);
1989: msc_sch_wb.atp_debug('* Intransit calendar code : ' || l_intransit_cal_code);
1990: msc_sch_wb.atp_debug('* Shipping calendar code : ' || l_shipping_cal_code);
1991: msc_sch_wb.atp_debug('* Manufacturing calendar code : ' || l_manufacturing_cal_code);
1992: msc_sch_wb.atp_debug('**************************************************************');
1993: END IF;
1994:
1995: /* planned order due date as per OMC-D */
1996: l_planned_order_date := MSC_CALENDAR.PREV_WORK_DAY(

Line 2001: msc_sch_wb.atp_debug('* Planned Order Due Date as per OMC-D: ' || l_planned_order_date);

1997: l_dest_mfg_cal_code,
1998: p_atp_record.instance_id,
1999: l_requested_ship_date);
2000: IF PG_DEBUG in ('Y', 'C') THEN
2001: msc_sch_wb.atp_debug('* Planned Order Due Date as per OMC-D: ' || l_planned_order_date);
2002: msc_sch_wb.atp_debug('* post_pro_lt: ' || org_availability_info.post_pro_lt(l_parent_org_cntr));
2003: END IF;
2004: -- ship_rec_cal changes end
2005:

Line 2002: msc_sch_wb.atp_debug('* post_pro_lt: ' || org_availability_info.post_pro_lt(l_parent_org_cntr));

1998: p_atp_record.instance_id,
1999: l_requested_ship_date);
2000: IF PG_DEBUG in ('Y', 'C') THEN
2001: msc_sch_wb.atp_debug('* Planned Order Due Date as per OMC-D: ' || l_planned_order_date);
2002: msc_sch_wb.atp_debug('* post_pro_lt: ' || org_availability_info.post_pro_lt(l_parent_org_cntr));
2003: END IF;
2004: -- ship_rec_cal changes end
2005:
2006: --- first we do a PTF check. Get start Date for PTF check

Line 2038: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_start_date : '||l_start_date);

2034: org modeled as supplier which might come in future*/
2035: l_new_dock_date := l_start_date;
2036:
2037: IF PG_DEBUG in ('Y', 'C') THEN
2038: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_start_date : '||l_start_date);
2039: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Date after validating on ORC : '||l_new_dock_date);
2040: END IF;
2041:
2042: -- l_start_date := MSC_CALENDAR.DATE_OFFSET ( -- Bug 3241766: l_start_date should have dock date

Line 2039: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Date after validating on ORC : '||l_new_dock_date);

2035: l_new_dock_date := l_start_date;
2036:
2037: IF PG_DEBUG in ('Y', 'C') THEN
2038: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_start_date : '||l_start_date);
2039: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Date after validating on ORC : '||l_new_dock_date);
2040: END IF;
2041:
2042: -- l_start_date := MSC_CALENDAR.DATE_OFFSET ( -- Bug 3241766: l_start_date should have dock date
2043: l_atp_rec.requested_ship_date := MSC_CALENDAR.DATE_OFFSET (

Line 2050: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Date after subtracting DLT using VIC : '||l_atp_rec.requested_ship_date);

2046: l_start_date,
2047: -1 * NVL(l_sources.lead_time(i), 0), -1);
2048:
2049: IF PG_DEBUG in ('Y', 'C') THEN
2050: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Date after subtracting DLT using VIC : '||l_atp_rec.requested_ship_date);
2051: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sources.lead_time(i) : '||l_sources.lead_time(i));
2052: END IF;
2053:
2054: l_atp_rec.requested_ship_date := MSC_CALENDAR.PREV_WORK_DAY(

Line 2051: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sources.lead_time(i) : '||l_sources.lead_time(i));

2047: -1 * NVL(l_sources.lead_time(i), 0), -1);
2048:
2049: IF PG_DEBUG in ('Y', 'C') THEN
2050: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Date after subtracting DLT using VIC : '||l_atp_rec.requested_ship_date);
2051: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sources.lead_time(i) : '||l_sources.lead_time(i));
2052: END IF;
2053:
2054: l_atp_rec.requested_ship_date := MSC_CALENDAR.PREV_WORK_DAY(
2055: l_shipping_cal_code,

Line 2066: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Date after validating on OSC : '||l_atp_rec.requested_ship_date);

2062: l_start_date := l_new_ship_date; -- Bug 3578083 -- Setting the variable that is compared with PTF date
2063: -- This should be source org's ship date.
2064:
2065: IF PG_DEBUG in ('Y', 'C') THEN
2066: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Date after validating on OSC : '||l_atp_rec.requested_ship_date);
2067: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'pre_pro_lt : '||org_availability_info.pre_pro_lt(l_parent_org_cntr));
2068: END IF;
2069:
2070: -- Add pre-PLT offset also: Bug 3241766

Line 2067: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'pre_pro_lt : '||org_availability_info.pre_pro_lt(l_parent_org_cntr));

2063: -- This should be source org's ship date.
2064:
2065: IF PG_DEBUG in ('Y', 'C') THEN
2066: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Date after validating on OSC : '||l_atp_rec.requested_ship_date);
2067: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'pre_pro_lt : '||org_availability_info.pre_pro_lt(l_parent_org_cntr));
2068: END IF;
2069:
2070: -- Add pre-PLT offset also: Bug 3241766
2071: l_order_date := MSC_CALENDAR.DATE_OFFSET (

Line 2112: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Error occured while getting PTF : ' || sqlerrm);

2108:
2109: EXCEPTION
2110: WHEN OTHERS THEN
2111: IF PG_DEBUG in ('Y', 'C') THEN
2112: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Error occured while getting PTF : ' || sqlerrm);
2113: END IF;
2114: --l_ptf_date := l_sysdate; -- Bug 3578083
2115: END;
2116: IF PG_DEBUG in ('Y', 'C') THEN

Line 2117: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_ptf_date := ' || l_ptf_date);

2113: END IF;
2114: --l_ptf_date := l_sysdate; -- Bug 3578083
2115: END;
2116: IF PG_DEBUG in ('Y', 'C') THEN
2117: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_ptf_date := ' || l_ptf_date);
2118: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_order_date := ' || l_order_date);
2119: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_start_date := ' || l_start_date);
2120: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_ptf_enabled := ' || l_ptf_enabled);
2121: END IF;

Line 2118: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_order_date := ' || l_order_date);

2114: --l_ptf_date := l_sysdate; -- Bug 3578083
2115: END;
2116: IF PG_DEBUG in ('Y', 'C') THEN
2117: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_ptf_date := ' || l_ptf_date);
2118: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_order_date := ' || l_order_date);
2119: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_start_date := ' || l_start_date);
2120: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_ptf_enabled := ' || l_ptf_enabled);
2121: END IF;
2122:

Line 2119: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_start_date := ' || l_start_date);

2115: END;
2116: IF PG_DEBUG in ('Y', 'C') THEN
2117: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_ptf_date := ' || l_ptf_date);
2118: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_order_date := ' || l_order_date);
2119: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_start_date := ' || l_start_date);
2120: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_ptf_enabled := ' || l_ptf_enabled);
2121: END IF;
2122:
2123: -- calculate the ship date if we pass the ptf check

Line 2120: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_ptf_enabled := ' || l_ptf_enabled);

2116: IF PG_DEBUG in ('Y', 'C') THEN
2117: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_ptf_date := ' || l_ptf_date);
2118: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_order_date := ' || l_order_date);
2119: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_start_date := ' || l_start_date);
2120: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_ptf_enabled := ' || l_ptf_enabled);
2121: END IF;
2122:
2123: -- calculate the ship date if we pass the ptf check
2124: -- or we're doing diagnostic atp

Line 2128: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Passed the PTF test');

2124: -- or we're doing diagnostic atp
2125: /* ship_rec_cal: not required as ship date is already calulated
2126: IF l_start_date >= l_ptf_date THEN
2127: IF PG_DEBUG in ('Y', 'C') THEN
2128: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Passed the PTF test');
2129: END IF;
2130: /* ship_rec_cal
2131: l_req_ship_date := MSC_CALENDAR.prev_work_day(l_sources.organization_id(i),
2132: p_atp_record.instance_id,

Line 2141: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_req_ship_date := ' || l_req_ship_date);

2137: p_atp_record.instance_id,
2138: l_start_date);
2139:
2140: IF PG_DEBUG in ('Y', 'C') THEN
2141: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_req_ship_date := ' || l_req_ship_date);
2142: END IF;
2143: END IF;
2144: */
2145:

Line 2183: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'PO Pegging id := ' || l_pegging_id);

2179: SELECT msc_full_pegging_s.nextval
2180: INTO l_pegging_id
2181: FROM dual;
2182: IF PG_DEBUG in ('Y', 'C') THEN
2183: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'PO Pegging id := ' || l_pegging_id);
2184: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Src Organization_id := ' || l_sources.organization_id(i));
2185: END IF;
2186: org_availability_info.PO_pegging_id(l_count) := l_pegging_id;
2187: ELSIF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP THEN

Line 2184: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Src Organization_id := ' || l_sources.organization_id(i));

2180: INTO l_pegging_id
2181: FROM dual;
2182: IF PG_DEBUG in ('Y', 'C') THEN
2183: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'PO Pegging id := ' || l_pegging_id);
2184: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Src Organization_id := ' || l_sources.organization_id(i));
2185: END IF;
2186: org_availability_info.PO_pegging_id(l_count) := l_pegging_id;
2187: ELSIF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP THEN
2188: l_transfer_found := 1;

Line 2289: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_ptf_due_date ' || l_ptf_due_date);

2285: -- ship_rec_cal changes end
2286: END IF;
2287: -- bug3578083 - Constraint message should be added only if constraint actually exists
2288: IF PG_DEBUG in ('Y', 'C') THEN
2289: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_ptf_due_date ' || l_ptf_due_date);
2290: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_lt_due_date ' || l_lt_due_date);
2291: END IF;
2292: IF l_lt_due_date > l_requested_ship_date OR
2293: l_ptf_due_date > l_requested_ship_date THEN

Line 2290: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_lt_due_date ' || l_lt_due_date);

2286: END IF;
2287: -- bug3578083 - Constraint message should be added only if constraint actually exists
2288: IF PG_DEBUG in ('Y', 'C') THEN
2289: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_ptf_due_date ' || l_ptf_due_date);
2290: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_lt_due_date ' || l_lt_due_date);
2291: END IF;
2292: IF l_lt_due_date > l_requested_ship_date OR
2293: l_ptf_due_date > l_requested_ship_date THEN
2294: -- bug3578083 - PTF constraint should be added only if plan is PTF enabled

Line 2297: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'diagnostic atp: TRANSIT_LT_CONSTRAINT');

2293: l_ptf_due_date > l_requested_ship_date THEN
2294: -- bug3578083 - PTF constraint should be added only if plan is PTF enabled
2295: IF l_ptf_enabled=2 OR l_lt_due_date > l_ptf_due_date THEN
2296: IF PG_DEBUG in ('Y', 'C') THEN
2297: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'diagnostic atp: TRANSIT_LT_CONSTRAINT');
2298: END IF;
2299: l_pegging_rec.constraint_type := TRANSIT_LT_CONSTRAINT;
2300: l_pegging_rec.constraint_date := l_lt_due_date;
2301: ELSE

Line 2303: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'diagnostic atp: PTF_CONSTRAINT');

2299: l_pegging_rec.constraint_type := TRANSIT_LT_CONSTRAINT;
2300: l_pegging_rec.constraint_date := l_lt_due_date;
2301: ELSE
2302: IF PG_DEBUG in ('Y', 'C') THEN
2303: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'diagnostic atp: PTF_CONSTRAINT');
2304: END IF;
2305: l_pegging_rec.constraint_type := PTF_CONSTRAINT;
2306: l_pegging_rec.constraint_date := l_ptf_due_date;
2307: END IF;

Line 2311: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Constraint due date: ' || l_pegging_rec.constraint_date);

2307: END IF;
2308: END IF;
2309:
2310: IF PG_DEBUG in ('Y', 'C') THEN
2311: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Constraint due date: ' || l_pegging_rec.constraint_date);
2312: END IF;
2313:
2314: l_pegging_rec.parent_pegging_id:=
2315: org_availability_info.demand_pegging_id(l_parent_org_cntr);

Line 2320: msc_sch_wb.atp_debug('lt or ptf constraint end_pegging_id: ' || org_availability_info.demand_pegging_id(1));

2316: l_pegging_rec.end_pegging_id := org_availability_info.demand_pegging_id(1);
2317:
2318: -- dsting diag_atp
2319: IF PG_DEBUG in ('Y', 'C') THEN
2320: msc_sch_wb.atp_debug('lt or ptf constraint end_pegging_id: ' || org_availability_info.demand_pegging_id(1));
2321: END IF;
2322:
2323: MSC_ATP_PVT.G_demand_pegging_id := org_availability_info.demand_pegging_id(1);
2324: l_pegging_rec.organization_id :=

Line 2364: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Fail the PTF test, dont add org to list of org to be visited');

2360: MSC_ATP_DB_UTILS.Add_Pegging(l_pegging_rec, l_pegging_id);
2361: ELSE
2362: --- we fail the PTF date test
2363: IF PG_DEBUG in ('Y', 'C') THEN
2364: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Fail the PTF test, dont add org to list of org to be visited');
2365: END IF;
2366: END IF;
2367:
2368: END IF; -- IF l_sources.source_type = 'TRANSFER' THEN

Line 2370: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_parent_org_cntr := ' || l_parent_org_cntr);

2366: END IF;
2367:
2368: END IF; -- IF l_sources.source_type = 'TRANSFER' THEN
2369: IF PG_DEBUG in ('Y', 'C') THEN
2370: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_parent_org_cntr := ' || l_parent_org_cntr);
2371: END IF;
2372: END LOOP;
2373: END IF;
2374:

Line 2376: msc_sch_wb.atp_debug('highest rev: ' || l_highest_rev_item_id);

2372: END LOOP;
2373: END IF;
2374:
2375: IF PG_DEBUG in ('Y', 'C') THEN
2376: msc_sch_wb.atp_debug('highest rev: ' || l_highest_rev_item_id);
2377: msc_sch_wb.atp_debug('l_sources_found: ' || l_sources_found);
2378: msc_sch_wb.atp_debug('l_transfer_found: ' || l_transfer_found);
2379: msc_sch_wb.atp_debug('G_CREATE_SUPPLY: ' || MSC_ATP_SUBST.G_CREATE_SUPPLY_FLAG);
2380: msc_sch_wb.atp_debug('item create_supply: ' || item_availability_info.create_supply_flag(l_item_count));

Line 2377: msc_sch_wb.atp_debug('l_sources_found: ' || l_sources_found);

2373: END IF;
2374:
2375: IF PG_DEBUG in ('Y', 'C') THEN
2376: msc_sch_wb.atp_debug('highest rev: ' || l_highest_rev_item_id);
2377: msc_sch_wb.atp_debug('l_sources_found: ' || l_sources_found);
2378: msc_sch_wb.atp_debug('l_transfer_found: ' || l_transfer_found);
2379: msc_sch_wb.atp_debug('G_CREATE_SUPPLY: ' || MSC_ATP_SUBST.G_CREATE_SUPPLY_FLAG);
2380: msc_sch_wb.atp_debug('item create_supply: ' || item_availability_info.create_supply_flag(l_item_count));
2381: msc_sch_wb.atp_debug('org: ' || org_availability_info.org_code(l_parent_org_cntr));

Line 2378: msc_sch_wb.atp_debug('l_transfer_found: ' || l_transfer_found);

2374:
2375: IF PG_DEBUG in ('Y', 'C') THEN
2376: msc_sch_wb.atp_debug('highest rev: ' || l_highest_rev_item_id);
2377: msc_sch_wb.atp_debug('l_sources_found: ' || l_sources_found);
2378: msc_sch_wb.atp_debug('l_transfer_found: ' || l_transfer_found);
2379: msc_sch_wb.atp_debug('G_CREATE_SUPPLY: ' || MSC_ATP_SUBST.G_CREATE_SUPPLY_FLAG);
2380: msc_sch_wb.atp_debug('item create_supply: ' || item_availability_info.create_supply_flag(l_item_count));
2381: msc_sch_wb.atp_debug('org: ' || org_availability_info.org_code(l_parent_org_cntr));
2382: END IF;

Line 2379: msc_sch_wb.atp_debug('G_CREATE_SUPPLY: ' || MSC_ATP_SUBST.G_CREATE_SUPPLY_FLAG);

2375: IF PG_DEBUG in ('Y', 'C') THEN
2376: msc_sch_wb.atp_debug('highest rev: ' || l_highest_rev_item_id);
2377: msc_sch_wb.atp_debug('l_sources_found: ' || l_sources_found);
2378: msc_sch_wb.atp_debug('l_transfer_found: ' || l_transfer_found);
2379: msc_sch_wb.atp_debug('G_CREATE_SUPPLY: ' || MSC_ATP_SUBST.G_CREATE_SUPPLY_FLAG);
2380: msc_sch_wb.atp_debug('item create_supply: ' || item_availability_info.create_supply_flag(l_item_count));
2381: msc_sch_wb.atp_debug('org: ' || org_availability_info.org_code(l_parent_org_cntr));
2382: END IF;
2383:

Line 2380: msc_sch_wb.atp_debug('item create_supply: ' || item_availability_info.create_supply_flag(l_item_count));

2376: msc_sch_wb.atp_debug('highest rev: ' || l_highest_rev_item_id);
2377: msc_sch_wb.atp_debug('l_sources_found: ' || l_sources_found);
2378: msc_sch_wb.atp_debug('l_transfer_found: ' || l_transfer_found);
2379: msc_sch_wb.atp_debug('G_CREATE_SUPPLY: ' || MSC_ATP_SUBST.G_CREATE_SUPPLY_FLAG);
2380: msc_sch_wb.atp_debug('item create_supply: ' || item_availability_info.create_supply_flag(l_item_count));
2381: msc_sch_wb.atp_debug('org: ' || org_availability_info.org_code(l_parent_org_cntr));
2382: END IF;
2383:
2384: -- if this is diagnostic atp, and there are no transfer sources, and we cannot create

Line 2381: msc_sch_wb.atp_debug('org: ' || org_availability_info.org_code(l_parent_org_cntr));

2377: msc_sch_wb.atp_debug('l_sources_found: ' || l_sources_found);
2378: msc_sch_wb.atp_debug('l_transfer_found: ' || l_transfer_found);
2379: msc_sch_wb.atp_debug('G_CREATE_SUPPLY: ' || MSC_ATP_SUBST.G_CREATE_SUPPLY_FLAG);
2380: msc_sch_wb.atp_debug('item create_supply: ' || item_availability_info.create_supply_flag(l_item_count));
2381: msc_sch_wb.atp_debug('org: ' || org_availability_info.org_code(l_parent_org_cntr));
2382: END IF;
2383:
2384: -- if this is diagnostic atp, and there are no transfer sources, and we cannot create
2385: -- a supply on the demanded item then flag it as a material constraint.

Line 2412: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Done with ATP check, now add pegging, planned orders');

2408:
2409: --- AT this point we should have complete picture as to what is the demand availability in each org
2410: --- So we create planned orders and peggings in each org
2411: IF PG_DEBUG in ('Y', 'C') THEN
2412: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Done with ATP check, now add pegging, planned orders');
2413: msc_sch_wb.atp_debug('reset Subst last PO pegging: ');
2414: END IF;
2415:
2416: MSC_ATP_SUBST.G_TOP_LAST_PO_PEGGING := null;

Line 2413: msc_sch_wb.atp_debug('reset Subst last PO pegging: ');

2409: --- AT this point we should have complete picture as to what is the demand availability in each org
2410: --- So we create planned orders and peggings in each org
2411: IF PG_DEBUG in ('Y', 'C') THEN
2412: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Done with ATP check, now add pegging, planned orders');
2413: msc_sch_wb.atp_debug('reset Subst last PO pegging: ');
2414: END IF;
2415:
2416: MSC_ATP_SUBST.G_TOP_LAST_PO_PEGGING := null;
2417: MSC_ATP_SUBST.G_TOP_LAST_PO_QTY := 0;

Line 2437: msc_sch_wb.atp_debug('l_addt_qty: ' || l_addt_qty);

2433: IF nvl(org_availability_info.rounding_flag(l_parent_index), 2) = 1 THEN
2434: l_addt_qty := FLOOR(ROUND(l_addt_qty, 10));
2435: END IF;
2436:
2437: msc_sch_wb.atp_debug('l_addt_qty: ' || l_addt_qty);
2438:
2439: org_availability_info.quantity_from_children(l_parent_index) :=
2440: NVL(org_availability_info.quantity_from_children(l_parent_index), 0) +
2441: l_addt_qty;

Line 2443: msc_sch_wb.atp_debug('qty from children('||l_parent_index||'): ' ||

2439: org_availability_info.quantity_from_children(l_parent_index) :=
2440: NVL(org_availability_info.quantity_from_children(l_parent_index), 0) +
2441: l_addt_qty;
2442:
2443: msc_sch_wb.atp_debug('qty from children('||l_parent_index||'): ' ||
2444: org_availability_info.quantity_from_children(l_parent_index));
2445: END LOOP;
2446: -- END IF;
2447: */

Line 2451: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Process orgination := ' || org_availability_info.organization_id(j));

2447: */
2448:
2449: FOR j in reverse 1..org_availability_info.organization_id.count LOOP
2450: IF PG_DEBUG in ('Y', 'C') THEN
2451: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Process orgination := ' || org_availability_info.organization_id(j));
2452: END IF;
2453: -- dsting 2754446
2454: l_parent_index := nvl(org_availability_info.parent_org_idx(j), 1);
2455:

Line 2457: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_parent_index := ' || l_parent_index);

2453: -- dsting 2754446
2454: l_parent_index := nvl(org_availability_info.parent_org_idx(j), 1);
2455:
2456: IF PG_DEBUG in ('Y', 'C') THEN
2457: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_parent_index := ' || l_parent_index);
2458: END IF;
2459:
2460: IF (org_availability_info.atp_flag(j) = 'N' AND org_availability_info.atp_comp_flag(j) = 'N') THEN
2461:

Line 2464: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Item is Non Atpable');

2460: IF (org_availability_info.atp_flag(j) = 'N' AND org_availability_info.atp_comp_flag(j) = 'N') THEN
2461:
2462: --- NON-ATPABLE ITEM item is non atpable then we add planned order in parent org
2463: IF PG_DEBUG in ('Y', 'C') THEN
2464: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Item is Non Atpable');
2465: END IF;
2466:
2467: -- dsting 2754446 req_date_qty and qty_from_chld should already be rounded to correct values
2468: -- for creating a PO in the top org's uom. so convert the uom, and round to remove float precision errs

Line 2485: msc_sch_wb.atp_debug('rounding_flag: ' || org_availability_info.rounding_flag(j));

2481: / org_availability_info.conversion_rate(j);
2482: END IF;
2483:
2484: IF PG_DEBUG in ('Y', 'C') THEN
2485: msc_sch_wb.atp_debug('rounding_flag: ' || org_availability_info.rounding_flag(j));
2486: msc_sch_wb.atp_debug('l_available_quantity: ' || l_available_quantity);
2487: msc_sch_wb.atp_debug('l_avail_qty_top_uom: ' || l_avail_qty_top_uom);
2488: END IF;
2489:

Line 2486: msc_sch_wb.atp_debug('l_available_quantity: ' || l_available_quantity);

2482: END IF;
2483:
2484: IF PG_DEBUG in ('Y', 'C') THEN
2485: msc_sch_wb.atp_debug('rounding_flag: ' || org_availability_info.rounding_flag(j));
2486: msc_sch_wb.atp_debug('l_available_quantity: ' || l_available_quantity);
2487: msc_sch_wb.atp_debug('l_avail_qty_top_uom: ' || l_avail_qty_top_uom);
2488: END IF;
2489:
2490: IF j = 1 THEN

Line 2487: msc_sch_wb.atp_debug('l_avail_qty_top_uom: ' || l_avail_qty_top_uom);

2483:
2484: IF PG_DEBUG in ('Y', 'C') THEN
2485: msc_sch_wb.atp_debug('rounding_flag: ' || org_availability_info.rounding_flag(j));
2486: msc_sch_wb.atp_debug('l_available_quantity: ' || l_available_quantity);
2487: msc_sch_wb.atp_debug('l_avail_qty_top_uom: ' || l_avail_qty_top_uom);
2488: END IF;
2489:
2490: IF j = 1 THEN
2491: --- bug 2344501: set the error only if it is a top org

Line 2554: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');

2550: -- Asssign the output to local variables.
2551: l_transaction_id := l_supply_rec.transaction_id;
2552: l_return_status := l_supply_rec.return_status;
2553: IF PG_DEBUG in ('Y', 'C') THEN
2554: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');
2555: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'DRP Plan Add Planned Inbound');
2556: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Id l_transaction_id: ' || l_transaction_id);
2557: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Type l_supply_rec.supply_type: '
2558: || l_supply_rec.supply_type);

Line 2555: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'DRP Plan Add Planned Inbound');

2551: l_transaction_id := l_supply_rec.transaction_id;
2552: l_return_status := l_supply_rec.return_status;
2553: IF PG_DEBUG in ('Y', 'C') THEN
2554: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');
2555: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'DRP Plan Add Planned Inbound');
2556: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Id l_transaction_id: ' || l_transaction_id);
2557: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Type l_supply_rec.supply_type: '
2558: || l_supply_rec.supply_type);
2559: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Return Status l_return_status: ' || l_return_status);

Line 2556: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Id l_transaction_id: ' || l_transaction_id);

2552: l_return_status := l_supply_rec.return_status;
2553: IF PG_DEBUG in ('Y', 'C') THEN
2554: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');
2555: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'DRP Plan Add Planned Inbound');
2556: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Id l_transaction_id: ' || l_transaction_id);
2557: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Type l_supply_rec.supply_type: '
2558: || l_supply_rec.supply_type);
2559: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Return Status l_return_status: ' || l_return_status);
2560: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');

Line 2557: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Type l_supply_rec.supply_type: '

2553: IF PG_DEBUG in ('Y', 'C') THEN
2554: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');
2555: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'DRP Plan Add Planned Inbound');
2556: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Id l_transaction_id: ' || l_transaction_id);
2557: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Type l_supply_rec.supply_type: '
2558: || l_supply_rec.supply_type);
2559: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Return Status l_return_status: ' || l_return_status);
2560: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');
2561: END IF;

Line 2559: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Return Status l_return_status: ' || l_return_status);

2555: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'DRP Plan Add Planned Inbound');
2556: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Id l_transaction_id: ' || l_transaction_id);
2557: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Type l_supply_rec.supply_type: '
2558: || l_supply_rec.supply_type);
2559: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Return Status l_return_status: ' || l_return_status);
2560: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');
2561: END IF;
2562:
2563: ELSE -- Create Planned Order otherwise.

Line 2560: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');

2556: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Id l_transaction_id: ' || l_transaction_id);
2557: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Type l_supply_rec.supply_type: '
2558: || l_supply_rec.supply_type);
2559: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Return Status l_return_status: ' || l_return_status);
2560: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');
2561: END IF;
2562:
2563: ELSE -- Create Planned Order otherwise.
2564: IF PG_DEBUG in ('Y', 'C') THEN

Line 2565: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add planned order');

2561: END IF;
2562:
2563: ELSE -- Create Planned Order otherwise.
2564: IF PG_DEBUG in ('Y', 'C') THEN
2565: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add planned order');
2566: END IF;
2567:
2568: MSC_ATP_DB_UTILS.Add_Planned_Order (
2569: p_atp_record.instance_id,

Line 2610: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add pegging for PO');

2606: -- END IF;
2607:
2608: --- now add PO pegging
2609: IF PG_DEBUG in ('Y', 'C') THEN
2610: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add pegging for PO');
2611: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_parent_index := ' || l_parent_index);
2612: END IF;
2613:
2614: Prep_PO_Pegging_Rec(l_pegging_rec,

Line 2611: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_parent_index := ' || l_parent_index);

2607:
2608: --- now add PO pegging
2609: IF PG_DEBUG in ('Y', 'C') THEN
2610: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add pegging for PO');
2611: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_parent_index := ' || l_parent_index);
2612: END IF;
2613:
2614: Prep_PO_Pegging_Rec(l_pegging_rec,
2615: p_atp_record,

Line 2632: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Current org := ' || org_availability_info.organization_id(j));

2628: ELSIF NVL(org_availability_info.demand_id(j), -1) > 0 THEN
2629: ---Above condition will filter out al the orgs that we did not visit but added to org_availability_info
2630: -- then we remove the demand provided its not in the top org
2631: IF PG_DEBUG in ('Y', 'C') THEN
2632: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Current org := ' || org_availability_info.organization_id(j));
2633: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'demand id in this org := ' || org_availability_info.demand_id(j));
2634: END IF;
2635:
2636: -- dsting 2754446

Line 2633: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'demand id in this org := ' || org_availability_info.demand_id(j));

2629: ---Above condition will filter out al the orgs that we did not visit but added to org_availability_info
2630: -- then we remove the demand provided its not in the top org
2631: IF PG_DEBUG in ('Y', 'C') THEN
2632: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Current org := ' || org_availability_info.organization_id(j));
2633: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'demand id in this org := ' || org_availability_info.demand_id(j));
2634: END IF;
2635:
2636: -- dsting 2754446
2637: /*

Line 2657: msc_sch_wb.atp_debug('l_parent_index: ' || l_parent_index);

2653: * org_availability_info.conversion_rate(l_parent_index);
2654: END IF;
2655:
2656: IF PG_DEBUG in ('Y', 'C') THEN
2657: msc_sch_wb.atp_debug('l_parent_index: ' || l_parent_index);
2658: msc_sch_wb.atp_debug('l_avail_qty_top_uom: ' || l_avail_qty_top_uom);
2659: msc_sch_wb.atp_debug('l_available_quantity: ' || l_available_quantity);
2660: END IF;
2661:

Line 2658: msc_sch_wb.atp_debug('l_avail_qty_top_uom: ' || l_avail_qty_top_uom);

2654: END IF;
2655:
2656: IF PG_DEBUG in ('Y', 'C') THEN
2657: msc_sch_wb.atp_debug('l_parent_index: ' || l_parent_index);
2658: msc_sch_wb.atp_debug('l_avail_qty_top_uom: ' || l_avail_qty_top_uom);
2659: msc_sch_wb.atp_debug('l_available_quantity: ' || l_available_quantity);
2660: END IF;
2661:
2662: -- dsting do not update demands for diagnostic atp

Line 2659: msc_sch_wb.atp_debug('l_available_quantity: ' || l_available_quantity);

2655:
2656: IF PG_DEBUG in ('Y', 'C') THEN
2657: msc_sch_wb.atp_debug('l_parent_index: ' || l_parent_index);
2658: msc_sch_wb.atp_debug('l_avail_qty_top_uom: ' || l_avail_qty_top_uom);
2659: msc_sch_wb.atp_debug('l_available_quantity: ' || l_available_quantity);
2660: END IF;
2661:
2662: -- dsting do not update demands for diagnostic atp
2663: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP <> DIAGNOSTIC_ATP THEN

Line 2669: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Delete Demand');

2665: IF j > 1 AND l_available_quantity <= 0
2666: THEN
2667: --- if we do nto get anything from this org then we remove the demand
2668: IF PG_DEBUG in ('Y', 'C') THEN
2669: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Delete Demand');
2670: END IF;
2671: MSC_ATP_SUBST.delete_demand_subst(org_availability_info.demand_id(j),
2672: org_availability_info.plan_id(j));
2673: ELSE

Line 2677: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_available_quantity := ' || l_available_quantity);

2673: ELSE
2674:
2675: --- update demand
2676: IF PG_DEBUG in ('Y', 'C') THEN
2677: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_available_quantity := ' || l_available_quantity);
2678: END IF;
2679:
2680: -- 2754446
2681: -- IF org_availability_info.demand_quantity(j) > l_available_quantity and j > 1

Line 2688: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Update demand');

2684: THEN
2685: --- we update demands from J > 1 because we want to retain full demand in top org
2686: --- as CTP is still left to be done
2687: IF PG_DEBUG in ('Y', 'C') THEN
2688: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Update demand');
2689: END IF;
2690: MSC_ATP_SUBST.UPDATE_DEMAND(org_availability_info.demand_id(j),
2691: org_availability_info.plan_id(j),
2692: -- dsting 2754446

Line 2712: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Error occured in procedure Increment_Bucketed_Demands_Qty');

2708: l_return_status
2709: );
2710: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2711: IF PG_DEBUG in ('Y', 'C') THEN
2712: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Error occured in procedure Increment_Bucketed_Demands_Qty');
2713: END IF;
2714: RAISE FND_API.G_EXC_ERROR;
2715: END IF;
2716: END IF;

Line 2721: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'add pegging');

2717: -- time_phased_atp changes end
2718:
2719: END IF;
2720: IF PG_DEBUG in ('Y', 'C') THEN
2721: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'add pegging');
2722: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'ATP Flag := ' || org_availability_info.atp_flag(J));
2723: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atp_comp_flag :=' || org_availability_info.atp_comp_flag(j));
2724: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.quantity_ordered :=' || l_atp_insert_rec.quantity_ordered);
2725: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.requested_date_quantity :=' || l_atp_insert_rec.requested_date_quantity);

Line 2722: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'ATP Flag := ' || org_availability_info.atp_flag(J));

2718:
2719: END IF;
2720: IF PG_DEBUG in ('Y', 'C') THEN
2721: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'add pegging');
2722: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'ATP Flag := ' || org_availability_info.atp_flag(J));
2723: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atp_comp_flag :=' || org_availability_info.atp_comp_flag(j));
2724: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.quantity_ordered :=' || l_atp_insert_rec.quantity_ordered);
2725: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.requested_date_quantity :=' || l_atp_insert_rec.requested_date_quantity);
2726: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.atf_date_quantity :=' || l_atp_insert_rec.atf_date_quantity);

Line 2723: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atp_comp_flag :=' || org_availability_info.atp_comp_flag(j));

2719: END IF;
2720: IF PG_DEBUG in ('Y', 'C') THEN
2721: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'add pegging');
2722: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'ATP Flag := ' || org_availability_info.atp_flag(J));
2723: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atp_comp_flag :=' || org_availability_info.atp_comp_flag(j));
2724: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.quantity_ordered :=' || l_atp_insert_rec.quantity_ordered);
2725: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.requested_date_quantity :=' || l_atp_insert_rec.requested_date_quantity);
2726: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.atf_date_quantity :=' || l_atp_insert_rec.atf_date_quantity);
2727: END IF;

Line 2724: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.quantity_ordered :=' || l_atp_insert_rec.quantity_ordered);

2720: IF PG_DEBUG in ('Y', 'C') THEN
2721: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'add pegging');
2722: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'ATP Flag := ' || org_availability_info.atp_flag(J));
2723: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atp_comp_flag :=' || org_availability_info.atp_comp_flag(j));
2724: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.quantity_ordered :=' || l_atp_insert_rec.quantity_ordered);
2725: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.requested_date_quantity :=' || l_atp_insert_rec.requested_date_quantity);
2726: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.atf_date_quantity :=' || l_atp_insert_rec.atf_date_quantity);
2727: END IF;
2728:

Line 2725: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.requested_date_quantity :=' || l_atp_insert_rec.requested_date_quantity);

2721: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'add pegging');
2722: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'ATP Flag := ' || org_availability_info.atp_flag(J));
2723: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atp_comp_flag :=' || org_availability_info.atp_comp_flag(j));
2724: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.quantity_ordered :=' || l_atp_insert_rec.quantity_ordered);
2725: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.requested_date_quantity :=' || l_atp_insert_rec.requested_date_quantity);
2726: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.atf_date_quantity :=' || l_atp_insert_rec.atf_date_quantity);
2727: END IF;
2728:
2729: END IF;

Line 2726: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.atf_date_quantity :=' || l_atp_insert_rec.atf_date_quantity);

2722: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'ATP Flag := ' || org_availability_info.atp_flag(J));
2723: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atp_comp_flag :=' || org_availability_info.atp_comp_flag(j));
2724: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.quantity_ordered :=' || l_atp_insert_rec.quantity_ordered);
2725: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.requested_date_quantity :=' || l_atp_insert_rec.requested_date_quantity);
2726: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_insert_rec.atf_date_quantity :=' || l_atp_insert_rec.atf_date_quantity);
2727: END IF;
2728:
2729: END IF;
2730: END IF; -- dsting diagnostic ATP

Line 2733: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add pegging after onhand pass');

2729: END IF;
2730: END IF; -- dsting diagnostic ATP
2731:
2732: IF PG_DEBUG in ('Y', 'C') THEN
2733: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add pegging after onhand pass');
2734: END IF;
2735:
2736: -- 2754446
2737: l_PO_qty := org_availability_info.demand_quantity(j)

Line 2745: msc_sch_wb.atp_debug('l_PO_qty: ' || l_PO_qty);

2741: l_PO_qty := CEIL(ROUND(l_PO_qty,10));
2742: END IF;
2743:
2744: IF PG_DEBUG in ('Y', 'C') THEN
2745: msc_sch_wb.atp_debug('l_PO_qty: ' || l_PO_qty);
2746: msc_sch_wb.atp_debug('dmd qty: ' || org_availability_info.demand_quantity(j));
2747: msc_sch_Wb.atp_debug('conv rate: ' || org_availability_info.conversion_rate(l_parent_index));
2748: END IF;
2749:

Line 2746: msc_sch_wb.atp_debug('dmd qty: ' || org_availability_info.demand_quantity(j));

2742: END IF;
2743:
2744: IF PG_DEBUG in ('Y', 'C') THEN
2745: msc_sch_wb.atp_debug('l_PO_qty: ' || l_PO_qty);
2746: msc_sch_wb.atp_debug('dmd qty: ' || org_availability_info.demand_quantity(j));
2747: msc_sch_Wb.atp_debug('conv rate: ' || org_availability_info.conversion_rate(l_parent_index));
2748: END IF;
2749:
2750: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP OR

Line 2747: msc_sch_Wb.atp_debug('conv rate: ' || org_availability_info.conversion_rate(l_parent_index));

2743:
2744: IF PG_DEBUG in ('Y', 'C') THEN
2745: msc_sch_wb.atp_debug('l_PO_qty: ' || l_PO_qty);
2746: msc_sch_wb.atp_debug('dmd qty: ' || org_availability_info.demand_quantity(j));
2747: msc_sch_Wb.atp_debug('conv rate: ' || org_availability_info.conversion_rate(l_parent_index));
2748: END IF;
2749:
2750: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP OR
2751: (l_available_quantity > 0 or j =1)

Line 2755: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add demand Pegging');

2751: (l_available_quantity > 0 or j =1)
2752: THEN
2753: --- now add demand pegging
2754: IF PG_DEBUG in ('Y', 'C') THEN
2755: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add demand Pegging');
2756: END IF;
2757:
2758: Prep_Demand_Pegging_rec(l_pegging_rec,
2759: p_atp_record,

Line 2771: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || ' J1:= ' || j);

2767: -- dsting or if we're doing diagnostic atp
2768: -- dsting 2754446
2769: l_pegging_rec.supply_demand_quantity:= org_availability_info.demand_quantity(j);
2770: IF PG_DEBUG in ('Y', 'C') THEN
2771: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || ' J1:= ' || j);
2772: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'quantity := ' || l_pegging_rec.supply_demand_quantity);
2773: END IF;
2774: ELSE
2775: --- if it is other org then we create demand for least of what we need and what is available

Line 2772: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'quantity := ' || l_pegging_rec.supply_demand_quantity);

2768: -- dsting 2754446
2769: l_pegging_rec.supply_demand_quantity:= org_availability_info.demand_quantity(j);
2770: IF PG_DEBUG in ('Y', 'C') THEN
2771: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || ' J1:= ' || j);
2772: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'quantity := ' || l_pegging_rec.supply_demand_quantity);
2773: END IF;
2774: ELSE
2775: --- if it is other org then we create demand for least of what we need and what is available
2776: -- dsting 2754446

Line 2781: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || ' J:= ' || j);

2777: l_pegging_rec.supply_demand_quantity:=
2778: least(org_availability_info.demand_quantity(j),
2779: l_available_quantity * org_availability_info.conversion_rate(j));
2780: IF PG_DEBUG in ('Y', 'C') THEN
2781: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || ' J:= ' || j);
2782: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'quantity := ' ||
2783: l_pegging_rec.supply_demand_quantity);
2784: END IF;
2785:

Line 2782: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'quantity := ' ||

2778: least(org_availability_info.demand_quantity(j),
2779: l_available_quantity * org_availability_info.conversion_rate(j));
2780: IF PG_DEBUG in ('Y', 'C') THEN
2781: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || ' J:= ' || j);
2782: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'quantity := ' ||
2783: l_pegging_rec.supply_demand_quantity);
2784: END IF;
2785:
2786: END IF;

Line 2797: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'add Supply Pegging');

2793: --- we add supply pegging only for item where atp_flag = 'Y'
2794: IF org_availability_info.atp_flag(j) in ('Y', 'C') THEN
2795: --- now add supply pegging
2796: IF PG_DEBUG in ('Y', 'C') THEN
2797: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'add Supply Pegging');
2798: END IF;
2799:
2800: Prep_Supply_Pegging_Rec(l_pegging_rec,
2801: p_atp_record,

Line 2816: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'after adding Supply and Demand Pegging');

2812: END IF;
2813: -- END IF; -- if l_available_qty > 0
2814:
2815: IF PG_DEBUG in ('Y', 'C') THEN
2816: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'after adding Supply and Demand Pegging');
2817: END IF;
2818: --- now add planned order
2819: IF j > 1 and (l_available_quantity > 0 or MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP) THEN
2820: --- we create planned order for tier 2 orgs only

Line 2823: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_available_quantity > 0 or Diagnostic ATP');

2819: IF j > 1 and (l_available_quantity > 0 or MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP) THEN
2820: --- we create planned order for tier 2 orgs only
2821: -- we create the planned order in parent org
2822: IF PG_DEBUG in ('Y', 'C') THEN
2823: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_available_quantity > 0 or Diagnostic ATP');
2824: msc_sch_wb.atp_debug('qty from children: ' || NVL(org_availability_info.quantity_from_children(l_parent_index), 0));
2825: msc_sch_wb.atp_debug('l_available_quantity: '|| l_available_quantity);
2826: END IF;
2827:

Line 2824: msc_sch_wb.atp_debug('qty from children: ' || NVL(org_availability_info.quantity_from_children(l_parent_index), 0));

2820: --- we create planned order for tier 2 orgs only
2821: -- we create the planned order in parent org
2822: IF PG_DEBUG in ('Y', 'C') THEN
2823: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_available_quantity > 0 or Diagnostic ATP');
2824: msc_sch_wb.atp_debug('qty from children: ' || NVL(org_availability_info.quantity_from_children(l_parent_index), 0));
2825: msc_sch_wb.atp_debug('l_available_quantity: '|| l_available_quantity);
2826: END IF;
2827:
2828: -- We balance out the supply/demand for the parent org since it is not a constraint node

Line 2825: msc_sch_wb.atp_debug('l_available_quantity: '|| l_available_quantity);

2821: -- we create the planned order in parent org
2822: IF PG_DEBUG in ('Y', 'C') THEN
2823: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_available_quantity > 0 or Diagnostic ATP');
2824: msc_sch_wb.atp_debug('qty from children: ' || NVL(org_availability_info.quantity_from_children(l_parent_index), 0));
2825: msc_sch_wb.atp_debug('l_available_quantity: '|| l_available_quantity);
2826: END IF;
2827:
2828: -- We balance out the supply/demand for the parent org since it is not a constraint node
2829: -- for the last transfer child of an org that gets into org_availability_info,

Line 2846: msc_sch_wb.atp_debug('remaining dmd qty of parent: ' || l_diag_supply_qty);

2842: NVL(org_availability_info.quantity_from_children(l_parent_index), 0) -
2843: greatest(org_availability_info.request_date_quantity(l_parent_index), 0)
2844: ) + l_available_quantity;
2845: IF PG_DEBUG in ('Y', 'C') THEN
2846: msc_sch_wb.atp_debug('remaining dmd qty of parent: ' || l_diag_supply_qty);
2847: END IF;
2848: ELSE
2849: -- dsting 2754446
2850: -- l_diag_supply_qty := least(org_availability_info.demand_quantity(j),

Line 2854: msc_sch_Wb.atp_debug('l_PO_qty: ' || l_PO_qty);

2850: -- l_diag_supply_qty := least(org_availability_info.demand_quantity(j),
2851: l_diag_supply_qty := least(l_PO_qty,
2852: greatest(0,l_available_quantity));
2853: IF PG_DEBUG in ('Y', 'C') THEN
2854: msc_sch_Wb.atp_debug('l_PO_qty: ' || l_PO_qty);
2855: msc_sch_wb.atp_debug('l_PO_qty - avail qty: ' || l_diag_supply_qty);
2856: END IF;
2857: END IF;
2858:

Line 2855: msc_sch_wb.atp_debug('l_PO_qty - avail qty: ' || l_diag_supply_qty);

2851: l_diag_supply_qty := least(l_PO_qty,
2852: greatest(0,l_available_quantity));
2853: IF PG_DEBUG in ('Y', 'C') THEN
2854: msc_sch_Wb.atp_debug('l_PO_qty: ' || l_PO_qty);
2855: msc_sch_wb.atp_debug('l_PO_qty - avail qty: ' || l_diag_supply_qty);
2856: END IF;
2857: END IF;
2858:
2859: -- dsting set G_TOP_LAST_PO_PEGGING and G_TOP_LAST_PO_QTY in case the ctp

Line 2865: msc_sch_wb.atp_debug('Subst last PO pegging: ' || MSC_ATP_SUBST.G_TOP_LAST_PO_PEGGING);

2861: IF l_parent_index = 1 AND MSC_ATP_SUBST.G_TOP_LAST_PO_PEGGING is NULL THEN
2862: MSC_ATP_SUBST.G_TOP_LAST_PO_PEGGING := org_availability_info.PO_Pegging_id(j);
2863: MSC_ATP_SUBST.G_TOP_LAST_PO_QTY := l_diag_supply_qty;
2864: IF PG_DEBUG in ('Y', 'C') THEN
2865: msc_sch_wb.atp_debug('Subst last PO pegging: ' || MSC_ATP_SUBST.G_TOP_LAST_PO_PEGGING);
2866: END IF;
2867: END IF;
2868:
2869: IF l_diag_supply_qty > 0

Line 2918: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');

2914: -- Asssign the output to local variables.
2915: l_transaction_id := l_supply_rec.transaction_id;
2916: l_return_status := l_supply_rec.return_status;
2917: IF PG_DEBUG in ('Y', 'C') THEN
2918: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');
2919: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'DRP Plan Add Planned Inbound');
2920: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Id l_transaction_id: ' || l_transaction_id);
2921: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Type l_supply_rec.supply_type: '
2922: || l_supply_rec.supply_type);

Line 2919: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'DRP Plan Add Planned Inbound');

2915: l_transaction_id := l_supply_rec.transaction_id;
2916: l_return_status := l_supply_rec.return_status;
2917: IF PG_DEBUG in ('Y', 'C') THEN
2918: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');
2919: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'DRP Plan Add Planned Inbound');
2920: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Id l_transaction_id: ' || l_transaction_id);
2921: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Type l_supply_rec.supply_type: '
2922: || l_supply_rec.supply_type);
2923: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Return Status l_return_status: ' || l_return_status);

Line 2920: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Id l_transaction_id: ' || l_transaction_id);

2916: l_return_status := l_supply_rec.return_status;
2917: IF PG_DEBUG in ('Y', 'C') THEN
2918: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');
2919: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'DRP Plan Add Planned Inbound');
2920: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Id l_transaction_id: ' || l_transaction_id);
2921: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Type l_supply_rec.supply_type: '
2922: || l_supply_rec.supply_type);
2923: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Return Status l_return_status: ' || l_return_status);
2924: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');

Line 2921: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Type l_supply_rec.supply_type: '

2917: IF PG_DEBUG in ('Y', 'C') THEN
2918: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');
2919: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'DRP Plan Add Planned Inbound');
2920: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Id l_transaction_id: ' || l_transaction_id);
2921: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Type l_supply_rec.supply_type: '
2922: || l_supply_rec.supply_type);
2923: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Return Status l_return_status: ' || l_return_status);
2924: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');
2925: END IF;

Line 2923: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Return Status l_return_status: ' || l_return_status);

2919: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'DRP Plan Add Planned Inbound');
2920: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Id l_transaction_id: ' || l_transaction_id);
2921: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Type l_supply_rec.supply_type: '
2922: || l_supply_rec.supply_type);
2923: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Return Status l_return_status: ' || l_return_status);
2924: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');
2925: END IF;
2926:
2927: ELSE -- Create Planned Order otherwise.

Line 2924: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');

2920: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Id l_transaction_id: ' || l_transaction_id);
2921: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Type l_supply_rec.supply_type: '
2922: || l_supply_rec.supply_type);
2923: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Return Status l_return_status: ' || l_return_status);
2924: msc_sch_wb.atp_debug('----- ATP4drp Specific Debug Messages -----');
2925: END IF;
2926:
2927: ELSE -- Create Planned Order otherwise.
2928: IF PG_DEBUG in ('Y', 'C') THEN

Line 2929: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add planned order');

2925: END IF;
2926:
2927: ELSE -- Create Planned Order otherwise.
2928: IF PG_DEBUG in ('Y', 'C') THEN
2929: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add planned order');
2930: END IF;
2931: MSC_ATP_DB_UTILS.Add_Planned_Order(
2932: p_atp_record.instance_id,
2933: org_availability_info.plan_id(l_parent_index),

Line 2977: msc_sch_wb.atp_debug('balance supply/demand for nonconstrained node');

2973: MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP
2974: THEN
2975:
2976: IF PG_DEBUG in ('Y', 'C') THEN
2977: msc_sch_wb.atp_debug('balance supply/demand for nonconstrained node');
2978: END IF;
2979: -- Begin ATP4drp Create Planned Arrivals for DRP plans
2980: IF (NVL(MSC_ATP_PVT.G_PLAN_INFO_REC.plan_type,1) = 5) THEN
2981: l_supply_rec.instance_id := p_atp_record.instance_id;

Line 3025: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Id l_transaction_id: ' || l_transaction_id);

3021: -- Asssign the output to local variables.
3022: l_transaction_id := l_supply_rec.transaction_id;
3023: l_return_status := l_supply_rec.return_status;
3024: IF PG_DEBUG in ('Y', 'C') THEN
3025: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Id l_transaction_id: ' || l_transaction_id);
3026: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Type l_supply_rec.supply_type: '
3027: || l_supply_rec.supply_type);
3028: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Return Status l_return_status: ' || l_return_status);
3029: END IF;

Line 3026: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Type l_supply_rec.supply_type: '

3022: l_transaction_id := l_supply_rec.transaction_id;
3023: l_return_status := l_supply_rec.return_status;
3024: IF PG_DEBUG in ('Y', 'C') THEN
3025: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Id l_transaction_id: ' || l_transaction_id);
3026: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Type l_supply_rec.supply_type: '
3027: || l_supply_rec.supply_type);
3028: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Return Status l_return_status: ' || l_return_status);
3029: END IF;
3030:

Line 3028: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Return Status l_return_status: ' || l_return_status);

3024: IF PG_DEBUG in ('Y', 'C') THEN
3025: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Id l_transaction_id: ' || l_transaction_id);
3026: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Supply Type l_supply_rec.supply_type: '
3027: || l_supply_rec.supply_type);
3028: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Return Status l_return_status: ' || l_return_status);
3029: END IF;
3030:
3031: ELSE -- Create Planned Order otherwise.
3032: MSC_ATP_DB_UTILS.Add_Planned_Order(

Line 3073: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add pegging for PO');

3069: END IF;
3070:
3071: --- now add PO pegging
3072: IF PG_DEBUG in ('Y', 'C') THEN
3073: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add pegging for PO');
3074: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_parent_index := ' || l_parent_index);
3075: END IF;
3076:
3077: Prep_PO_Pegging_Rec(l_pegging_rec,

Line 3074: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_parent_index := ' || l_parent_index);

3070:
3071: --- now add PO pegging
3072: IF PG_DEBUG in ('Y', 'C') THEN
3073: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add pegging for PO');
3074: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_parent_index := ' || l_parent_index);
3075: END IF;
3076:
3077: Prep_PO_Pegging_Rec(l_pegging_rec,
3078: p_atp_record,

Line 3096: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'after adding pegging for supplies, demand and planned order');

3092: END IF;
3093: END IF; -- <>
3094: END IF; -- IF NVL(org_availability_info.demand_id(j), -1) > 0 THEN
3095: IF PG_DEBUG in ('Y', 'C') THEN
3096: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'after adding pegging for supplies, demand and planned order');
3097: END IF;
3098:
3099:
3100:

Line 3119: msc_sch_wb.atp_debug('ATP_Check_Subst: Update children quantity in parent org: idx '

3115: NVL(org_availability_info.steal_qty(j), 0)),
3116: l_PO_qty/org_availability_info.conversion_rate(l_parent_index));
3117:
3118: IF PG_DEBUG in ('Y', 'C') THEN
3119: msc_sch_wb.atp_debug('ATP_Check_Subst: Update children quantity in parent org: idx '
3120: || l_parent_index || ' qty: ' || org_availability_info.quantity_from_children(l_parent_index));
3121: END IF;
3122: END IF;
3123: */

Line 3138: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'After getting availablity for current item in all orgs');

3134: and organization_id = org_availability_info.organization_id(j);
3135: END LOOP;
3136:
3137: IF PG_DEBUG in ('Y', 'C') THEN
3138: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'After getting availablity for current item in all orgs');
3139: END IF;
3140: -- now we populate item info
3141: IF PG_DEBUG in ('Y', 'C') THEN
3142: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'End pegging id := ' || org_availability_info.demand_pegging_id(1));

Line 3142: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'End pegging id := ' || org_availability_info.demand_pegging_id(1));

3138: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'After getting availablity for current item in all orgs');
3139: END IF;
3140: -- now we populate item info
3141: IF PG_DEBUG in ('Y', 'C') THEN
3142: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'End pegging id := ' || org_availability_info.demand_pegging_id(1));
3143: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_counter := ' || l_item_cntr);
3144: END IF;
3145: Item_availability_info.End_pegging_id(l_item_cntr) := org_availability_info.demand_pegging_id(1);
3146: Item_availability_info.request_date_quantity(l_item_cntr) :=

Line 3143: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_counter := ' || l_item_cntr);

3139: END IF;
3140: -- now we populate item info
3141: IF PG_DEBUG in ('Y', 'C') THEN
3142: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'End pegging id := ' || org_availability_info.demand_pegging_id(1));
3143: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_counter := ' || l_item_cntr);
3144: END IF;
3145: Item_availability_info.End_pegging_id(l_item_cntr) := org_availability_info.demand_pegging_id(1);
3146: Item_availability_info.request_date_quantity(l_item_cntr) :=
3147: GREATEST(org_availability_info.request_date_quantity(1), 0) +

Line 3158: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_date_quantity := ' || Item_availability_info.request_date_quantity(l_item_cntr));

3154: l_sd_end_idx := l_all_atp_supply_demand.level.count;
3155:
3156: IF PG_DEBUG in ('Y', 'C') THEN
3157: --bug3467631 start
3158: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_date_quantity := ' || Item_availability_info.request_date_quantity(l_item_cntr));
3159: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Atf_Date_Quantity := ' || Item_availability_info.Atf_Date_Quantity(l_item_cntr));
3160: --bug3467631 end
3161: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_period_end_idx := ' || l_period_end_idx);
3162: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sd_end_idx := ' || l_sd_end_idx);

Line 3159: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Atf_Date_Quantity := ' || Item_availability_info.Atf_Date_Quantity(l_item_cntr));

3155:
3156: IF PG_DEBUG in ('Y', 'C') THEN
3157: --bug3467631 start
3158: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_date_quantity := ' || Item_availability_info.request_date_quantity(l_item_cntr));
3159: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Atf_Date_Quantity := ' || Item_availability_info.Atf_Date_Quantity(l_item_cntr));
3160: --bug3467631 end
3161: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_period_end_idx := ' || l_period_end_idx);
3162: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sd_end_idx := ' || l_sd_end_idx);
3163: END IF;

Line 3161: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_period_end_idx := ' || l_period_end_idx);

3157: --bug3467631 start
3158: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_date_quantity := ' || Item_availability_info.request_date_quantity(l_item_cntr));
3159: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Atf_Date_Quantity := ' || Item_availability_info.Atf_Date_Quantity(l_item_cntr));
3160: --bug3467631 end
3161: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_period_end_idx := ' || l_period_end_idx);
3162: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sd_end_idx := ' || l_sd_end_idx);
3163: END IF;
3164:
3165: item_availability_info.period_detail_end_Idx(l_item_cntr) := l_period_end_idx;

Line 3162: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sd_end_idx := ' || l_sd_end_idx);

3158: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_date_quantity := ' || Item_availability_info.request_date_quantity(l_item_cntr));
3159: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Atf_Date_Quantity := ' || Item_availability_info.Atf_Date_Quantity(l_item_cntr));
3160: --bug3467631 end
3161: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_period_end_idx := ' || l_period_end_idx);
3162: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sd_end_idx := ' || l_sd_end_idx);
3163: END IF;
3164:
3165: item_availability_info.period_detail_end_Idx(l_item_cntr) := l_period_end_idx;
3166: item_availability_info.sd_detail_end_idx(l_item_cntr) := l_sd_end_idx;

Line 3169: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'After updating item info');

3165: item_availability_info.period_detail_end_Idx(l_item_cntr) := l_period_end_idx;
3166: item_availability_info.sd_detail_end_idx(l_item_cntr) := l_sd_end_idx;
3167:
3168: IF PG_DEBUG in ('Y', 'C') THEN
3169: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'After updating item info');
3170: END IF;
3171:
3172: -- Set p_atp_record to the item that is used to satisfy the demand
3173: IF l_net_demand <= 0 THEN

Line 3175: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Met the requirement using item ' || item_availability_info.item_name(l_item_cntr));

3171:
3172: -- Set p_atp_record to the item that is used to satisfy the demand
3173: IF l_net_demand <= 0 THEN
3174: IF PG_DEBUG in ('Y', 'C') THEN
3175: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Met the requirement using item ' || item_availability_info.item_name(l_item_cntr));
3176: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Sr inv Id for the item := ' || item_availability_info.sr_inventory_item_id(l_item_cntr));
3177: END IF;
3178: --IF item_availability_info.sr_inventory_item_id(l_item_cntr) <> p_atp_record.inventory_item_id THEN
3179: --bug3467631

Line 3176: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Sr inv Id for the item := ' || item_availability_info.sr_inventory_item_id(l_item_cntr));

3172: -- Set p_atp_record to the item that is used to satisfy the demand
3173: IF l_net_demand <= 0 THEN
3174: IF PG_DEBUG in ('Y', 'C') THEN
3175: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Met the requirement using item ' || item_availability_info.item_name(l_item_cntr));
3176: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Sr inv Id for the item := ' || item_availability_info.sr_inventory_item_id(l_item_cntr));
3177: END IF;
3178: --IF item_availability_info.sr_inventory_item_id(l_item_cntr) <> p_atp_record.inventory_item_id THEN
3179: --bug3467631
3180: IF item_availability_info.sr_inventory_item_id(l_item_cntr) <>

Line 3184: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'demand is satisfied by substitute');

3180: IF item_availability_info.sr_inventory_item_id(l_item_cntr) <>
3181: NVL(p_atp_record.request_item_id,
3182: p_atp_record.inventory_item_id) THEN
3183: IF PG_DEBUG in ('Y', 'C') THEN
3184: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'demand is satisfied by substitute');
3185: END IF;
3186: --- set the flag
3187: l_satisfied_by_subst_flag := 1;
3188: ELSE

Line 3190: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'demand is satisfied by the original item');

3186: --- set the flag
3187: l_satisfied_by_subst_flag := 1;
3188: ELSE
3189: IF PG_DEBUG in ('Y', 'C') THEN
3190: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'demand is satisfied by the original item');
3191: END IF;
3192: l_satisfied_by_subst_flag := 2;
3193: END IF;
3194: IF PG_DEBUG in ('Y', 'C') THEN

Line 3195: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_satisfied_by_subst_flag := ' || l_satisfied_by_subst_flag);

3191: END IF;
3192: l_satisfied_by_subst_flag := 2;
3193: END IF;
3194: IF PG_DEBUG in ('Y', 'C') THEN
3195: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_satisfied_by_subst_flag := ' || l_satisfied_by_subst_flag);
3196: END IF;
3197:
3198: --l_demand_satisfied_by_item_id := item_availability_info.sr_inventory_item_id(l_item_cntr);
3199: /* time_phased_atp changes begin

Line 3214: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_id := ' || p_atp_record.inventory_item_id);

3210: p_atp_record.original_item_id := item_availability_info.sr_inventory_item_id(l_item_count);
3211: p_atp_record.original_item_name := item_availability_info.item_name(l_item_count);
3212:
3213: IF PG_DEBUG in ('Y', 'C') THEN
3214: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_id := ' || p_atp_record.inventory_item_id);
3215: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_name := ' || p_atp_record.inventory_item_name);
3216: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id := ' || p_atp_record.request_item_id);
3217: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_name := ' || p_atp_record.request_item_name);
3218: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_id := ' || p_atp_record.original_item_id);

Line 3215: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_name := ' || p_atp_record.inventory_item_name);

3211: p_atp_record.original_item_name := item_availability_info.item_name(l_item_count);
3212:
3213: IF PG_DEBUG in ('Y', 'C') THEN
3214: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_id := ' || p_atp_record.inventory_item_id);
3215: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_name := ' || p_atp_record.inventory_item_name);
3216: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id := ' || p_atp_record.request_item_id);
3217: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_name := ' || p_atp_record.request_item_name);
3218: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_id := ' || p_atp_record.original_item_id);
3219: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_name := ' || p_atp_record.original_item_name);

Line 3216: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id := ' || p_atp_record.request_item_id);

3212:
3213: IF PG_DEBUG in ('Y', 'C') THEN
3214: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_id := ' || p_atp_record.inventory_item_id);
3215: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_name := ' || p_atp_record.inventory_item_name);
3216: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id := ' || p_atp_record.request_item_id);
3217: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_name := ' || p_atp_record.request_item_name);
3218: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_id := ' || p_atp_record.original_item_id);
3219: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_name := ' || p_atp_record.original_item_name);
3220: END IF;

Line 3217: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_name := ' || p_atp_record.request_item_name);

3213: IF PG_DEBUG in ('Y', 'C') THEN
3214: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_id := ' || p_atp_record.inventory_item_id);
3215: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_name := ' || p_atp_record.inventory_item_name);
3216: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id := ' || p_atp_record.request_item_id);
3217: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_name := ' || p_atp_record.request_item_name);
3218: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_id := ' || p_atp_record.original_item_id);
3219: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_name := ' || p_atp_record.original_item_name);
3220: END IF;
3221: -- time_phased_atp changes end

Line 3218: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_id := ' || p_atp_record.original_item_id);

3214: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_id := ' || p_atp_record.inventory_item_id);
3215: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_name := ' || p_atp_record.inventory_item_name);
3216: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id := ' || p_atp_record.request_item_id);
3217: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_name := ' || p_atp_record.request_item_name);
3218: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_id := ' || p_atp_record.original_item_id);
3219: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_name := ' || p_atp_record.original_item_name);
3220: END IF;
3221: -- time_phased_atp changes end
3222:

Line 3219: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_name := ' || p_atp_record.original_item_name);

3215: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_name := ' || p_atp_record.inventory_item_name);
3216: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id := ' || p_atp_record.request_item_id);
3217: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_name := ' || p_atp_record.request_item_name);
3218: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_id := ' || p_atp_record.original_item_id);
3219: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_name := ' || p_atp_record.original_item_name);
3220: END IF;
3221: -- time_phased_atp changes end
3222:
3223: --p_atp_record.End_pegging_id := item_availability_info.End_pegging_id(l_item_cntr);

Line 3263: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'period_detail_begin_idx := '|| item_availability_info.period_detail_begin_idx(l_item_cntr));

3259: END IF;
3260:
3261: --- add suply demand and period details
3262: IF PG_DEBUG in ('Y', 'C') THEN
3263: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'period_detail_begin_idx := '|| item_availability_info.period_detail_begin_idx(l_item_cntr));
3264: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'period_detail_end_idx := ' || item_availability_info.period_detail_end_idx(l_item_cntr));
3265: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'sd_detail_begin_idx:= ' || item_availability_info.sd_detail_begin_idx(l_item_cntr));
3266: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'sd_detail_end_idx:= ' || item_availability_info.sd_detail_end_idx(l_item_cntr));
3267: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'p_atp_record.Atf_Date_Quantity:= ' || p_atp_record.Atf_Date_Quantity); --bug3467631

Line 3264: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'period_detail_end_idx := ' || item_availability_info.period_detail_end_idx(l_item_cntr));

3260:
3261: --- add suply demand and period details
3262: IF PG_DEBUG in ('Y', 'C') THEN
3263: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'period_detail_begin_idx := '|| item_availability_info.period_detail_begin_idx(l_item_cntr));
3264: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'period_detail_end_idx := ' || item_availability_info.period_detail_end_idx(l_item_cntr));
3265: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'sd_detail_begin_idx:= ' || item_availability_info.sd_detail_begin_idx(l_item_cntr));
3266: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'sd_detail_end_idx:= ' || item_availability_info.sd_detail_end_idx(l_item_cntr));
3267: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'p_atp_record.Atf_Date_Quantity:= ' || p_atp_record.Atf_Date_Quantity); --bug3467631
3268: END IF;

Line 3265: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'sd_detail_begin_idx:= ' || item_availability_info.sd_detail_begin_idx(l_item_cntr));

3261: --- add suply demand and period details
3262: IF PG_DEBUG in ('Y', 'C') THEN
3263: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'period_detail_begin_idx := '|| item_availability_info.period_detail_begin_idx(l_item_cntr));
3264: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'period_detail_end_idx := ' || item_availability_info.period_detail_end_idx(l_item_cntr));
3265: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'sd_detail_begin_idx:= ' || item_availability_info.sd_detail_begin_idx(l_item_cntr));
3266: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'sd_detail_end_idx:= ' || item_availability_info.sd_detail_end_idx(l_item_cntr));
3267: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'p_atp_record.Atf_Date_Quantity:= ' || p_atp_record.Atf_Date_Quantity); --bug3467631
3268: END IF;
3269: MSC_ATP_SUBST.Details_Output(l_all_atp_period,

Line 3266: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'sd_detail_end_idx:= ' || item_availability_info.sd_detail_end_idx(l_item_cntr));

3262: IF PG_DEBUG in ('Y', 'C') THEN
3263: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'period_detail_begin_idx := '|| item_availability_info.period_detail_begin_idx(l_item_cntr));
3264: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'period_detail_end_idx := ' || item_availability_info.period_detail_end_idx(l_item_cntr));
3265: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'sd_detail_begin_idx:= ' || item_availability_info.sd_detail_begin_idx(l_item_cntr));
3266: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'sd_detail_end_idx:= ' || item_availability_info.sd_detail_end_idx(l_item_cntr));
3267: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'p_atp_record.Atf_Date_Quantity:= ' || p_atp_record.Atf_Date_Quantity); --bug3467631
3268: END IF;
3269: MSC_ATP_SUBST.Details_Output(l_all_atp_period,
3270: l_all_atp_supply_demand,

Line 3267: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'p_atp_record.Atf_Date_Quantity:= ' || p_atp_record.Atf_Date_Quantity); --bug3467631

3263: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'period_detail_begin_idx := '|| item_availability_info.period_detail_begin_idx(l_item_cntr));
3264: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'period_detail_end_idx := ' || item_availability_info.period_detail_end_idx(l_item_cntr));
3265: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'sd_detail_begin_idx:= ' || item_availability_info.sd_detail_begin_idx(l_item_cntr));
3266: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'sd_detail_end_idx:= ' || item_availability_info.sd_detail_end_idx(l_item_cntr));
3267: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'p_atp_record.Atf_Date_Quantity:= ' || p_atp_record.Atf_Date_Quantity); --bug3467631
3268: END IF;
3269: MSC_ATP_SUBST.Details_Output(l_all_atp_period,
3270: l_all_atp_supply_demand,
3271: item_availability_info.period_detail_begin_idx(l_item_cntr),

Line 3283: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'remove demands for item ' || item_availability_info.item_name(i));

3279: FOR i in (l_item_cntr +1)..l_item_count LOOP
3280: IF NOT (l_org_item_detail_flag = 1 and l_satisfied_by_subst_flag = 1 and
3281: item_availability_info.sr_inventory_item_id(i) = MSC_ATP_SUBST.G_REQ_ITEM_SR_INV_ID) THEN
3282: IF PG_DEBUG in ('Y', 'C') THEN
3283: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'remove demands for item ' || item_availability_info.item_name(i));
3284: END IF;
3285: MSC_ATP_DB_UTILS.Remove_Invalid_SD_Rec(
3286: item_availability_info.End_pegging_id(i),
3287: null,

Line 3300: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Item Availability Picture After Onhand search');

3296: --l_item_cntr := l_item_cntr + 1;
3297:
3298: END LOOP; --- WHILE item_counter <= item_availability_info.inventory_item_id.count AND
3299: IF PG_DEBUG in ('Y', 'C') THEN
3300: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Item Availability Picture After Onhand search');
3301: END IF;
3302:
3303: IF PG_DEBUG in ('Y', 'C') THEN
3304: For i in 1..item_availability_info.inventory_item_id.count LOOP --bug3467631

Line 3305: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || item_availability_info.item_name(i) ||' ' ||item_availability_info.sr_inventory_item_id(i) ||

3301: END IF;
3302:
3303: IF PG_DEBUG in ('Y', 'C') THEN
3304: For i in 1..item_availability_info.inventory_item_id.count LOOP --bug3467631
3305: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || item_availability_info.item_name(i) ||' ' ||item_availability_info.sr_inventory_item_id(i) ||
3306: ' ' || item_availability_info.request_date_quantity(i) ||
3307: ' ' || item_availability_info.Atf_Date_Quantity(i));
3308: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || item_availability_info.family_sr_id(i) ||' ' ||item_availability_info.family_item_name(i));
3309:

Line 3308: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || item_availability_info.family_sr_id(i) ||' ' ||item_availability_info.family_item_name(i));

3304: For i in 1..item_availability_info.inventory_item_id.count LOOP --bug3467631
3305: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || item_availability_info.item_name(i) ||' ' ||item_availability_info.sr_inventory_item_id(i) ||
3306: ' ' || item_availability_info.request_date_quantity(i) ||
3307: ' ' || item_availability_info.Atf_Date_Quantity(i));
3308: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || item_availability_info.family_sr_id(i) ||' ' ||item_availability_info.family_item_name(i));
3309:
3310: END LOOP;
3311: END IF;
3312:

Line 3314: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Do backward CTP pass if needed. net demand: ' || l_net_demand);

3310: END LOOP;
3311: END IF;
3312:
3313: IF PG_DEBUG in ('Y', 'C') THEN
3314: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Do backward CTP pass if needed. net demand: ' || l_net_demand);
3315: END IF;
3316:
3317:
3318: --- if demand is not met then do CTP

Line 3327: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Net demand after Onhand search := ' || l_net_demand);

3323: --l_org_item_detail_flag := NVL(p_atp_record.req_item_detail_flag, 2);
3324: --l_org_item_detail_flag := 1;
3325: l_net_demand_after_oh_check := l_net_demand;
3326: IF PG_DEBUG in ('Y', 'C') THEN
3327: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Net demand after Onhand search := ' || l_net_demand);
3328: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_org_item_detail_flag := ' || l_org_item_detail_flag);
3329: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_satisfied_by_subst_flag := ' || l_satisfied_by_subst_flag);
3330: END IF;
3331: IF ((l_org_item_detail_flag = 1 AND l_satisfied_by_subst_flag = 1)) or (l_net_demand_after_oh_check > 0) THEN

Line 3328: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_org_item_detail_flag := ' || l_org_item_detail_flag);

3324: --l_org_item_detail_flag := 1;
3325: l_net_demand_after_oh_check := l_net_demand;
3326: IF PG_DEBUG in ('Y', 'C') THEN
3327: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Net demand after Onhand search := ' || l_net_demand);
3328: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_org_item_detail_flag := ' || l_org_item_detail_flag);
3329: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_satisfied_by_subst_flag := ' || l_satisfied_by_subst_flag);
3330: END IF;
3331: IF ((l_org_item_detail_flag = 1 AND l_satisfied_by_subst_flag = 1)) or (l_net_demand_after_oh_check > 0) THEN
3332:

Line 3329: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_satisfied_by_subst_flag := ' || l_satisfied_by_subst_flag);

3325: l_net_demand_after_oh_check := l_net_demand;
3326: IF PG_DEBUG in ('Y', 'C') THEN
3327: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Net demand after Onhand search := ' || l_net_demand);
3328: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_org_item_detail_flag := ' || l_org_item_detail_flag);
3329: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_satisfied_by_subst_flag := ' || l_satisfied_by_subst_flag);
3330: END IF;
3331: IF ((l_org_item_detail_flag = 1 AND l_satisfied_by_subst_flag = 1)) or (l_net_demand_after_oh_check > 0) THEN
3332:
3333: --- get create supply flag

Line 3336: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Backward Ctp');

3332:
3333: --- get create supply flag
3334: --- if create supply flag is null then default it to Demanded item
3335: IF PG_DEBUG in ('Y', 'C') THEN
3336: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Backward Ctp');
3337: END IF;
3338: l_create_supply_flag := MSC_ATP_SUBST.G_CREATE_SUPPLY_FLAG;
3339: l_count := item_availability_info.inventory_item_id.count;
3340: IF PG_DEBUG in ('Y', 'C') THEN

Line 3341: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'G_CREATE_SUPPLY_FLAG := ' || MSC_ATP_SUBST.G_CREATE_SUPPLY_FLAG);

3337: END IF;
3338: l_create_supply_flag := MSC_ATP_SUBST.G_CREATE_SUPPLY_FLAG;
3339: l_count := item_availability_info.inventory_item_id.count;
3340: IF PG_DEBUG in ('Y', 'C') THEN
3341: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'G_CREATE_SUPPLY_FLAG := ' || MSC_ATP_SUBST.G_CREATE_SUPPLY_FLAG);
3342: END IF;
3343: --- bug 2388707: if demand has already been met then just add req item to the list of items
3344: -- to do CTP on
3345: IF (l_org_item_detail_flag = 1 AND l_satisfied_by_subst_flag = 1) THEN

Line 3359: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'One item. highest rev ' || l_highest_rev_item_id);

3355: ELSIF MSC_ATP_SUBST.G_CREATE_SUPPLY_FLAG = G_HIGHEST_REV_ITEM THEN
3356: IF item_availability_info.inventory_item_id.count = 1 THEN
3357: --- we will come here if there are no substitutes or we are not substituting
3358: IF PG_DEBUG in ('Y', 'C') THEN
3359: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'One item. highest rev ' || l_highest_rev_item_id);
3360: END IF;
3361: IF (l_highest_rev_item_id = l_inventory_item_id) AND
3362: (item_availability_info.create_supply_flag(l_item_count) = 1) THEN
3363:

Line 3369: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Multiple items');

3365: END IF;
3366: ELSE
3367: --- we will come here if we have one or more substitutes and we are doing substitution
3368: IF PG_DEBUG in ('Y', 'C') THEN
3369: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Multiple items');
3370: END IF;
3371: For i in 1..item_availability_info.inventory_item_id.count LOOP
3372: -- find highest revision item
3373: IF item_availability_info.inventory_item_id(i) = l_highest_rev_item_id THEN

Line 3376: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'i := ' || i);

3372: -- find highest revision item
3373: IF item_availability_info.inventory_item_id(i) = l_highest_rev_item_id THEN
3374: l_highest_rev_item_index := i;
3375: IF PG_DEBUG in ('Y', 'C') THEN
3376: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'i := ' || i);
3377: END IF;
3378: EXIT;
3379: END IF;
3380:

Line 3383: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Counter for High. rev. item := ' || l_highest_rev_item_index);

3379: END IF;
3380:
3381: END LOOP;
3382: IF PG_DEBUG in ('Y', 'C') THEN
3383: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Counter for High. rev. item := ' || l_highest_rev_item_index);
3384: END IF;
3385: MSC_ATP_SUBST.Copy_Item_Info_rec(item_availability_info, l_item_ctp_info, l_highest_rev_item_index);
3386: END IF; -- IF item_availability_info.inventory_item_id.count = 1 THEN
3387: ELSE --- item attribute

Line 3399: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'List of items to do CTP on');

3395: END IF;
3396: END IF; -- IF MSC_ATP_SUBST.G_CREATE_SUPPLY_FLAG = 701
3397:
3398: IF PG_DEBUG in ('Y', 'C') THEN
3399: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'List of items to do CTP on');
3400: For i in reverse 1..l_item_ctp_info.inventory_item_id.count LOOP
3401: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || l_item_ctp_info.item_name(i) || ' ' || l_item_ctp_info.sr_inventory_item_id(i) );
3402: END LOOP;
3403: msc_sch_wb.atp_debug('Subst last PO pegging: ' || MSC_ATP_SUBST.G_TOP_LAST_PO_PEGGING);

Line 3401: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || l_item_ctp_info.item_name(i) || ' ' || l_item_ctp_info.sr_inventory_item_id(i) );

3397:
3398: IF PG_DEBUG in ('Y', 'C') THEN
3399: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'List of items to do CTP on');
3400: For i in reverse 1..l_item_ctp_info.inventory_item_id.count LOOP
3401: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || l_item_ctp_info.item_name(i) || ' ' || l_item_ctp_info.sr_inventory_item_id(i) );
3402: END LOOP;
3403: msc_sch_wb.atp_debug('Subst last PO pegging: ' || MSC_ATP_SUBST.G_TOP_LAST_PO_PEGGING);
3404: END IF;
3405:

Line 3403: msc_sch_wb.atp_debug('Subst last PO pegging: ' || MSC_ATP_SUBST.G_TOP_LAST_PO_PEGGING);

3399: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'List of items to do CTP on');
3400: For i in reverse 1..l_item_ctp_info.inventory_item_id.count LOOP
3401: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || l_item_ctp_info.item_name(i) || ' ' || l_item_ctp_info.sr_inventory_item_id(i) );
3402: END LOOP;
3403: msc_sch_wb.atp_debug('Subst last PO pegging: ' || MSC_ATP_SUBST.G_TOP_LAST_PO_PEGGING);
3404: END IF;
3405:
3406: -- AT this point we know on what item do we need to do CTP
3407: --l_net_demand :=

Line 3427: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Do CTP on := ' || l_item_ctp_info.item_name(i) || ' '

3423: EXIT;
3424: END IF;
3425: l_net_demand := p_atp_record.quantity_ordered - l_item_ctp_info.request_date_quantity(i);
3426: IF PG_DEBUG in ('Y', 'C') THEN
3427: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Do CTP on := ' || l_item_ctp_info.item_name(i) || ' '
3428: || l_item_ctp_info.sr_inventory_item_id(i));
3429: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand := ' || l_net_demand);
3430: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atp_comp_flag := ' || l_item_ctp_info.atp_comp_flag(i));
3431: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'create_supply_flag := ' || l_item_ctp_info.create_supply_flag(i));

Line 3429: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand := ' || l_net_demand);

3425: l_net_demand := p_atp_record.quantity_ordered - l_item_ctp_info.request_date_quantity(i);
3426: IF PG_DEBUG in ('Y', 'C') THEN
3427: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Do CTP on := ' || l_item_ctp_info.item_name(i) || ' '
3428: || l_item_ctp_info.sr_inventory_item_id(i));
3429: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand := ' || l_net_demand);
3430: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atp_comp_flag := ' || l_item_ctp_info.atp_comp_flag(i));
3431: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'create_supply_flag := ' || l_item_ctp_info.create_supply_flag(i));
3432: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'end pegging id := ' || l_item_ctp_info.end_pegging_id(i));
3433: END IF;

Line 3430: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atp_comp_flag := ' || l_item_ctp_info.atp_comp_flag(i));

3426: IF PG_DEBUG in ('Y', 'C') THEN
3427: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Do CTP on := ' || l_item_ctp_info.item_name(i) || ' '
3428: || l_item_ctp_info.sr_inventory_item_id(i));
3429: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand := ' || l_net_demand);
3430: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atp_comp_flag := ' || l_item_ctp_info.atp_comp_flag(i));
3431: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'create_supply_flag := ' || l_item_ctp_info.create_supply_flag(i));
3432: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'end pegging id := ' || l_item_ctp_info.end_pegging_id(i));
3433: END IF;
3434:

Line 3431: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'create_supply_flag := ' || l_item_ctp_info.create_supply_flag(i));

3427: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Do CTP on := ' || l_item_ctp_info.item_name(i) || ' '
3428: || l_item_ctp_info.sr_inventory_item_id(i));
3429: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand := ' || l_net_demand);
3430: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atp_comp_flag := ' || l_item_ctp_info.atp_comp_flag(i));
3431: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'create_supply_flag := ' || l_item_ctp_info.create_supply_flag(i));
3432: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'end pegging id := ' || l_item_ctp_info.end_pegging_id(i));
3433: END IF;
3434:
3435: -- ALLOC ATP CHANGES, 12973673

Line 3432: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'end pegging id := ' || l_item_ctp_info.end_pegging_id(i));

3428: || l_item_ctp_info.sr_inventory_item_id(i));
3429: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand := ' || l_net_demand);
3430: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atp_comp_flag := ' || l_item_ctp_info.atp_comp_flag(i));
3431: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'create_supply_flag := ' || l_item_ctp_info.create_supply_flag(i));
3432: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'end pegging id := ' || l_item_ctp_info.end_pegging_id(i));
3433: END IF;
3434:
3435: -- ALLOC ATP CHANGES, 12973673
3436: IF (MSC_ATP_PVT.G_INV_CTP = 4 AND MSC_ATP_PVT.G_HYBRID_ALLOC_ATP = 'Y') THEN

Line 3438: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'G_HYBRID_ALLOC_ATP is Y');

3434:
3435: -- ALLOC ATP CHANGES, 12973673
3436: IF (MSC_ATP_PVT.G_INV_CTP = 4 AND MSC_ATP_PVT.G_HYBRID_ALLOC_ATP = 'Y') THEN
3437: IF PG_DEBUG in ('Y', 'C') THEN
3438: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'G_HYBRID_ALLOC_ATP is Y');
3439: END IF;
3440:
3441: MSC_ATP_PVT.G_ALLOCATED_ATP := MSC_ATP_FUNC.check_alloc_exists(p_atp_record.instance_id,
3442: -1, --PLAN_ID

Line 3448: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'MSC_ATP_PVT.G_ALLOCATED_ATP = '||MSC_ATP_PVT.G_ALLOCATED_ATP);

3444: p_atp_record.organization_id,
3445: nvl(l_requested_ship_date,trunc(sysdate)));
3446:
3447: IF PG_DEBUG in ('Y', 'C') THEN
3448: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'MSC_ATP_PVT.G_ALLOCATED_ATP = '||MSC_ATP_PVT.G_ALLOCATED_ATP);
3449: END IF;
3450: END IF;
3451:
3452: IF l_item_ctp_info.atp_comp_flag(i) in ('Y', 'C', 'R') and l_item_ctp_info.create_supply_flag(i) = 1 THEN

Line 3477: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'assigning item_name: ' ||l_item_ctp_info.item_name(i));

3473: p_atp_record.organization_id
3474: );*/
3475: -- dsting
3476: IF PG_DEBUG in ('Y', 'C') THEN
3477: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'assigning item_name: ' ||l_item_ctp_info.item_name(i));
3478: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'assigning inventory_item_id: ' ||l_atp_rec.inventory_item_id);
3479: END IF;
3480: l_atp_rec.inventory_item_name := l_item_ctp_info.item_name(i);
3481: l_atp_rec.request_item_id := l_item_ctp_info.sr_inventory_item_id(i);

Line 3478: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'assigning inventory_item_id: ' ||l_atp_rec.inventory_item_id);

3474: );*/
3475: -- dsting
3476: IF PG_DEBUG in ('Y', 'C') THEN
3477: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'assigning item_name: ' ||l_item_ctp_info.item_name(i));
3478: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'assigning inventory_item_id: ' ||l_atp_rec.inventory_item_id);
3479: END IF;
3480: l_atp_rec.inventory_item_name := l_item_ctp_info.item_name(i);
3481: l_atp_rec.request_item_id := l_item_ctp_info.sr_inventory_item_id(i);
3482: l_atp_rec.organization_id := p_atp_record.organization_id;

Line 3494: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'demand class for CTP := ' || l_item_ctp_info.demand_class(i));

3490: l_atp_rec.refresh_number := p_refresh_number;
3491: l_atp_rec.refresh_number := null;
3492: l_atp_rec.ship_date := null;
3493: IF PG_DEBUG in ('Y', 'C') THEN
3494: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'demand class for CTP := ' || l_item_ctp_info.demand_class(i));
3495: END IF;
3496: l_atp_rec.demand_class := l_item_ctp_info.demand_class(i);
3497:
3498: l_plan_id := l_item_ctp_info.plan_id(i);

Line 3503: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.demand_id(i) ' || l_item_ctp_info.demand_id(i));

3499: l_assign_set_id := l_item_ctp_info.assign_set_id(i);
3500:
3501: l_atp_rec.subs_demand_id := l_item_ctp_info.demand_id(i); --5088719
3502: IF PG_DEBUG in ('Y', 'C') THEN
3503: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.demand_id(i) ' || l_item_ctp_info.demand_id(i));
3504: END IF;
3505:
3506: l_atp_rec.original_item_flag := 1;
3507: l_atp_rec.top_tier_org_flag := 1;

Line 3543: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_rec.requested_date_quantity := ' || l_atp_rec.requested_date_quantity);

3539: --Bug 3878343 , set l_atp_period to NULL, incase CTP is not done.
3540: l_atp_period := L_NULL_ATP_PERIOD;
3541: END IF;
3542: IF PG_DEBUG in ('Y', 'C') THEN
3543: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_rec.requested_date_quantity := ' || l_atp_rec.requested_date_quantity);
3544: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_rec.atf_date_quantity := ' || l_atp_rec.atf_date_quantity);
3545: END IF;
3546: l_net_demand := l_net_demand - l_atp_rec.requested_date_quantity;
3547: IF PG_DEBUG in ('Y', 'C') THEN

Line 3544: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_rec.atf_date_quantity := ' || l_atp_rec.atf_date_quantity);

3540: l_atp_period := L_NULL_ATP_PERIOD;
3541: END IF;
3542: IF PG_DEBUG in ('Y', 'C') THEN
3543: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_rec.requested_date_quantity := ' || l_atp_rec.requested_date_quantity);
3544: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_rec.atf_date_quantity := ' || l_atp_rec.atf_date_quantity);
3545: END IF;
3546: l_net_demand := l_net_demand - l_atp_rec.requested_date_quantity;
3547: IF PG_DEBUG in ('Y', 'C') THEN
3548: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand := ' || l_net_demand);

Line 3548: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand := ' || l_net_demand);

3544: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_rec.atf_date_quantity := ' || l_atp_rec.atf_date_quantity);
3545: END IF;
3546: l_net_demand := l_net_demand - l_atp_rec.requested_date_quantity;
3547: IF PG_DEBUG in ('Y', 'C') THEN
3548: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand := ' || l_net_demand);
3549: END IF;
3550:
3551: IF l_item_count = 1 THEN
3552: IF PG_DEBUG in ('Y', 'C') THEN

Line 3553: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Only one item');

3549: END IF;
3550:
3551: IF l_item_count = 1 THEN
3552: IF PG_DEBUG in ('Y', 'C') THEN
3553: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Only one item');
3554: END IF;
3555: l_item_idx := 1;
3556: ELSE
3557: --bug 2388707: If demand has already been met then we are just looking for original item

Line 3564: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'More item but we retun the index for original item');

3560: l_item_idx := l_item_count;
3561:
3562: ELSIF MSC_ATP_SUBST.G_CREATE_SUPPLY_FLAG = G_DEMANDED_ITEM THEN
3563: IF PG_DEBUG in ('Y', 'C') THEN
3564: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'More item but we retun the index for original item');
3565: END IF;
3566: l_item_idx := l_item_count;
3567: ELSIF MSC_ATP_SUBST.G_CREATE_SUPPLY_FLAG = G_HIGHEST_REV_ITEM THEN
3568: IF PG_DEBUG in ('Y', 'C') THEN

Line 3569: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Index for highest rev item');

3565: END IF;
3566: l_item_idx := l_item_count;
3567: ELSIF MSC_ATP_SUBST.G_CREATE_SUPPLY_FLAG = G_HIGHEST_REV_ITEM THEN
3568: IF PG_DEBUG in ('Y', 'C') THEN
3569: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Index for highest rev item');
3570: END IF;
3571: l_item_idx := l_highest_rev_item_index;
3572: ELSE
3573:

Line 3578: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'we have alread met req. We return index for req item');

3574: IF l_item_ctp_info.inventory_item_id.count = 1 THEN
3575: --- this case will be true only if we have already satisfied the demand
3576: --- using a substitute
3577: IF PG_DEBUG in ('Y', 'C') THEN
3578: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'we have alread met req. We return index for req item');
3579: END IF;
3580: l_item_idx := l_item_count;
3581: ELSE
3582: IF PG_DEBUG in ('Y', 'C') THEN

Line 3583: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Item Attib, index of current item');

3579: END IF;
3580: l_item_idx := l_item_count;
3581: ELSE
3582: IF PG_DEBUG in ('Y', 'C') THEN
3583: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Item Attib, index of current item');
3584: END IF;
3585: l_item_idx := i;
3586: END IF;
3587: END IF;

Line 3590: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_idx := ' || l_item_idx);

3586: END IF;
3587: END IF;
3588: END IF;
3589: IF PG_DEBUG in ('Y', 'C') THEN
3590: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_idx := ' || l_item_idx);
3591: END IF;
3592: l_item_ctp_info.request_date_quantity(i) :=
3593: NVL(l_item_ctp_info.request_date_quantity(i), 0) + l_atp_rec.requested_date_quantity;
3594: item_availability_info.request_date_quantity(l_item_idx) :=

Line 3606: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.request_date_quantity(l_item_idx) := '|| item_availability_info.request_date_quantity(l_item_idx));

3602: NVL(item_availability_info.atf_date_quantity(l_item_idx), 0) +
3603: + NVL(l_atp_rec.atf_date_quantity, l_atp_rec.requested_date_quantity);
3604:
3605: IF PG_DEBUG in ('Y', 'C') THEN --bug3467631
3606: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.request_date_quantity(l_item_idx) := '|| item_availability_info.request_date_quantity(l_item_idx));
3607: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_rec.requested_date_quantity := ' || l_atp_rec.requested_date_quantity);
3608: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.requested_date_quantity := ' || l_item_ctp_info.request_date_quantity(i));
3609: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.atf_date_quantity(l_item_idx) := '|| item_availability_info.atf_date_quantity(l_item_idx));
3610: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_rec.atf_date_quantity := ' || l_atp_rec.atf_date_quantity);

Line 3607: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_rec.requested_date_quantity := ' || l_atp_rec.requested_date_quantity);

3603: + NVL(l_atp_rec.atf_date_quantity, l_atp_rec.requested_date_quantity);
3604:
3605: IF PG_DEBUG in ('Y', 'C') THEN --bug3467631
3606: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.request_date_quantity(l_item_idx) := '|| item_availability_info.request_date_quantity(l_item_idx));
3607: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_rec.requested_date_quantity := ' || l_atp_rec.requested_date_quantity);
3608: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.requested_date_quantity := ' || l_item_ctp_info.request_date_quantity(i));
3609: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.atf_date_quantity(l_item_idx) := '|| item_availability_info.atf_date_quantity(l_item_idx));
3610: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_rec.atf_date_quantity := ' || l_atp_rec.atf_date_quantity);
3611: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.atf_date_quantity := ' || l_item_ctp_info.atf_date_quantity(i));

Line 3608: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.requested_date_quantity := ' || l_item_ctp_info.request_date_quantity(i));

3604:
3605: IF PG_DEBUG in ('Y', 'C') THEN --bug3467631
3606: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.request_date_quantity(l_item_idx) := '|| item_availability_info.request_date_quantity(l_item_idx));
3607: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_rec.requested_date_quantity := ' || l_atp_rec.requested_date_quantity);
3608: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.requested_date_quantity := ' || l_item_ctp_info.request_date_quantity(i));
3609: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.atf_date_quantity(l_item_idx) := '|| item_availability_info.atf_date_quantity(l_item_idx));
3610: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_rec.atf_date_quantity := ' || l_atp_rec.atf_date_quantity);
3611: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.atf_date_quantity := ' || l_item_ctp_info.atf_date_quantity(i));
3612: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.request_date_quantity(l_item_idx) := ' || item_availability_info.request_date_quantity(l_item_idx));

Line 3609: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.atf_date_quantity(l_item_idx) := '|| item_availability_info.atf_date_quantity(l_item_idx));

3605: IF PG_DEBUG in ('Y', 'C') THEN --bug3467631
3606: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.request_date_quantity(l_item_idx) := '|| item_availability_info.request_date_quantity(l_item_idx));
3607: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_rec.requested_date_quantity := ' || l_atp_rec.requested_date_quantity);
3608: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.requested_date_quantity := ' || l_item_ctp_info.request_date_quantity(i));
3609: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.atf_date_quantity(l_item_idx) := '|| item_availability_info.atf_date_quantity(l_item_idx));
3610: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_rec.atf_date_quantity := ' || l_atp_rec.atf_date_quantity);
3611: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.atf_date_quantity := ' || l_item_ctp_info.atf_date_quantity(i));
3612: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.request_date_quantity(l_item_idx) := ' || item_availability_info.request_date_quantity(l_item_idx));
3613: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.Atf_Date := ' || l_item_ctp_info.Atf_Date(i));

Line 3610: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_rec.atf_date_quantity := ' || l_atp_rec.atf_date_quantity);

3606: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.request_date_quantity(l_item_idx) := '|| item_availability_info.request_date_quantity(l_item_idx));
3607: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_rec.requested_date_quantity := ' || l_atp_rec.requested_date_quantity);
3608: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.requested_date_quantity := ' || l_item_ctp_info.request_date_quantity(i));
3609: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.atf_date_quantity(l_item_idx) := '|| item_availability_info.atf_date_quantity(l_item_idx));
3610: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_rec.atf_date_quantity := ' || l_atp_rec.atf_date_quantity);
3611: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.atf_date_quantity := ' || l_item_ctp_info.atf_date_quantity(i));
3612: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.request_date_quantity(l_item_idx) := ' || item_availability_info.request_date_quantity(l_item_idx));
3613: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.Atf_Date := ' || l_item_ctp_info.Atf_Date(i));
3614: END IF;

Line 3611: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.atf_date_quantity := ' || l_item_ctp_info.atf_date_quantity(i));

3607: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_rec.requested_date_quantity := ' || l_atp_rec.requested_date_quantity);
3608: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.requested_date_quantity := ' || l_item_ctp_info.request_date_quantity(i));
3609: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.atf_date_quantity(l_item_idx) := '|| item_availability_info.atf_date_quantity(l_item_idx));
3610: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_rec.atf_date_quantity := ' || l_atp_rec.atf_date_quantity);
3611: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.atf_date_quantity := ' || l_item_ctp_info.atf_date_quantity(i));
3612: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.request_date_quantity(l_item_idx) := ' || item_availability_info.request_date_quantity(l_item_idx));
3613: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.Atf_Date := ' || l_item_ctp_info.Atf_Date(i));
3614: END IF;
3615: IF l_net_demand <= 0 THEN

Line 3612: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.request_date_quantity(l_item_idx) := ' || item_availability_info.request_date_quantity(l_item_idx));

3608: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.requested_date_quantity := ' || l_item_ctp_info.request_date_quantity(i));
3609: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.atf_date_quantity(l_item_idx) := '|| item_availability_info.atf_date_quantity(l_item_idx));
3610: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_rec.atf_date_quantity := ' || l_atp_rec.atf_date_quantity);
3611: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.atf_date_quantity := ' || l_item_ctp_info.atf_date_quantity(i));
3612: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.request_date_quantity(l_item_idx) := ' || item_availability_info.request_date_quantity(l_item_idx));
3613: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.Atf_Date := ' || l_item_ctp_info.Atf_Date(i));
3614: END IF;
3615: IF l_net_demand <= 0 THEN
3616: IF l_net_demand_after_oh_check > 0 THEN

Line 3613: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.Atf_Date := ' || l_item_ctp_info.Atf_Date(i));

3609: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.atf_date_quantity(l_item_idx) := '|| item_availability_info.atf_date_quantity(l_item_idx));
3610: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_rec.atf_date_quantity := ' || l_atp_rec.atf_date_quantity);
3611: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.atf_date_quantity := ' || l_item_ctp_info.atf_date_quantity(i));
3612: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.request_date_quantity(l_item_idx) := ' || item_availability_info.request_date_quantity(l_item_idx));
3613: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.Atf_Date := ' || l_item_ctp_info.Atf_Date(i));
3614: END IF;
3615: IF l_net_demand <= 0 THEN
3616: IF l_net_demand_after_oh_check > 0 THEN
3617: -- we have met the demand

Line 3622: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Met the requirement using item ' || l_item_ctp_info.item_name(i));

3618: --- update the p_atp_record
3619: --l_ordered_item_id := p_atp_record.inventory_item_id;
3620: --l_demand_satisfied_by_item_id := l_item_ctp_info.sr_inventory_item_id(i);
3621: IF PG_DEBUG in ('Y', 'C') THEN
3622: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Met the requirement using item ' || l_item_ctp_info.item_name(i));
3623: END IF;
3624: --bug3467631
3625: IF l_item_ctp_info.sr_inventory_item_id(i) <> NVL(p_atp_record.request_item_id,
3626: p_atp_record.inventory_item_id) THEN

Line 3628: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'demand is satisfied by substitute');

3624: --bug3467631
3625: IF l_item_ctp_info.sr_inventory_item_id(i) <> NVL(p_atp_record.request_item_id,
3626: p_atp_record.inventory_item_id) THEN
3627: IF PG_DEBUG in ('Y', 'C') THEN
3628: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'demand is satisfied by substitute');
3629: END IF;
3630: --- set the flag
3631: l_satisfied_by_subst_flag := 1;
3632: ELSE

Line 3634: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'demand is satisfied by the original item');

3630: --- set the flag
3631: l_satisfied_by_subst_flag := 1;
3632: ELSE
3633: IF PG_DEBUG in ('Y', 'C') THEN
3634: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'demand is satisfied by the original item');
3635: END IF;
3636: l_satisfied_by_subst_flag := 2;
3637: END IF;
3638: IF PG_DEBUG in ('Y', 'C') THEN

Line 3639: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_satisfied_by_subst_flag := ' || l_satisfied_by_subst_flag);

3635: END IF;
3636: l_satisfied_by_subst_flag := 2;
3637: END IF;
3638: IF PG_DEBUG in ('Y', 'C') THEN
3639: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_satisfied_by_subst_flag := ' || l_satisfied_by_subst_flag);
3640: END IF;
3641:
3642: p_atp_record.requested_date_quantity := p_atp_record.quantity_ordered;
3643: p_atp_record.Atf_Date_Quantity :=

Line 3659: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_id := ' || p_atp_record.inventory_item_id);

3655: p_atp_record.original_item_id := item_availability_info.sr_inventory_item_id(l_item_count);
3656: p_atp_record.original_item_name := item_availability_info.item_name(l_item_count);
3657:
3658: IF PG_DEBUG in ('Y', 'C') THEN
3659: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_id := ' || p_atp_record.inventory_item_id);
3660: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_name := ' || p_atp_record.inventory_item_name);
3661: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id := ' || p_atp_record.request_item_id);
3662: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_name := ' || p_atp_record.request_item_name);
3663: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_id := ' || p_atp_record.original_item_id);

Line 3660: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_name := ' || p_atp_record.inventory_item_name);

3656: p_atp_record.original_item_name := item_availability_info.item_name(l_item_count);
3657:
3658: IF PG_DEBUG in ('Y', 'C') THEN
3659: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_id := ' || p_atp_record.inventory_item_id);
3660: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_name := ' || p_atp_record.inventory_item_name);
3661: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id := ' || p_atp_record.request_item_id);
3662: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_name := ' || p_atp_record.request_item_name);
3663: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_id := ' || p_atp_record.original_item_id);
3664: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_name := ' || p_atp_record.original_item_name);

Line 3661: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id := ' || p_atp_record.request_item_id);

3657:
3658: IF PG_DEBUG in ('Y', 'C') THEN
3659: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_id := ' || p_atp_record.inventory_item_id);
3660: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_name := ' || p_atp_record.inventory_item_name);
3661: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id := ' || p_atp_record.request_item_id);
3662: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_name := ' || p_atp_record.request_item_name);
3663: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_id := ' || p_atp_record.original_item_id);
3664: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_name := ' || p_atp_record.original_item_name);
3665: END IF;

Line 3662: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_name := ' || p_atp_record.request_item_name);

3658: IF PG_DEBUG in ('Y', 'C') THEN
3659: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_id := ' || p_atp_record.inventory_item_id);
3660: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_name := ' || p_atp_record.inventory_item_name);
3661: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id := ' || p_atp_record.request_item_id);
3662: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_name := ' || p_atp_record.request_item_name);
3663: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_id := ' || p_atp_record.original_item_id);
3664: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_name := ' || p_atp_record.original_item_name);
3665: END IF;
3666: -- time_phased_atp changes end

Line 3663: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_id := ' || p_atp_record.original_item_id);

3659: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_id := ' || p_atp_record.inventory_item_id);
3660: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_name := ' || p_atp_record.inventory_item_name);
3661: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id := ' || p_atp_record.request_item_id);
3662: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_name := ' || p_atp_record.request_item_name);
3663: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_id := ' || p_atp_record.original_item_id);
3664: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_name := ' || p_atp_record.original_item_name);
3665: END IF;
3666: -- time_phased_atp changes end
3667: --p_atp_record.End_pegging_id := item_availability_info.End_pegging_id(l_item_cntr);

Line 3664: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_name := ' || p_atp_record.original_item_name);

3660: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_name := ' || p_atp_record.inventory_item_name);
3661: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id := ' || p_atp_record.request_item_id);
3662: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_name := ' || p_atp_record.request_item_name);
3663: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_id := ' || p_atp_record.original_item_id);
3664: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_name := ' || p_atp_record.original_item_name);
3665: END IF;
3666: -- time_phased_atp changes end
3667: --p_atp_record.End_pegging_id := item_availability_info.End_pegging_id(l_item_cntr);
3668: --- this variable is populated in end_peggign id for this line in procedure schedule

Line 3726: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Remove Pegging for item := ' || item_availability_info.inventory_item_id(i));

3722: NOT(l_satisfied_by_subst_flag = 1 and l_org_item_detail_flag = 1 AND
3723: item_availability_info.sr_inventory_item_id(j) = MSC_ATP_SUBST.G_REQ_ITEM_SR_INV_ID) THEN
3724:
3725: IF PG_DEBUG in ('Y', 'C') THEN
3726: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Remove Pegging for item := ' || item_availability_info.inventory_item_id(i));
3727: END IF;
3728:
3729: MSC_ATP_DB_UTILS.Remove_Invalid_SD_Rec(
3730: item_availability_info.End_pegging_id(j),

Line 3745: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'demand met by a subst, provide detail for origninal item');

3741:
3742: --- we had already met the deamand using on hand/sch receipts of substitute item
3743: -- now we have found enough quantity for ordered item as well so we will update the columns
3744: IF PG_DEBUG in ('Y', 'C') THEN
3745: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'demand met by a subst, provide detail for origninal item');
3746: END IF;
3747: MSC_ATP_PVT.G_DEMAND_PEGGING_ID := l_demand_pegging_id;
3748: p_atp_record.req_item_req_date_qty := p_atp_record.quantity_ordered;
3749:

Line 3842: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'net demand after backward CTP := ' || l_net_demand);

3838: END LOOP;
3839: END IF;
3840:
3841: IF PG_DEBUG in ('Y', 'C') THEN
3842: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'net demand after backward CTP := ' || l_net_demand);
3843: END IF;
3844: IF PG_DEBUG in ('Y', 'C') THEN
3845: FOR i in reverse 1..item_availability_info.inventory_item_id.count LOOP
3846: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || item_availability_info.item_name(i) || ' ' ||

Line 3846: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || item_availability_info.item_name(i) || ' ' ||

3842: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'net demand after backward CTP := ' || l_net_demand);
3843: END IF;
3844: IF PG_DEBUG in ('Y', 'C') THEN
3845: FOR i in reverse 1..item_availability_info.inventory_item_id.count LOOP
3846: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || item_availability_info.item_name(i) || ' ' ||
3847: item_availability_info.sr_inventory_item_id(i) || ' ' ||
3848: item_availability_info.request_date_quantity(i));
3849: END LOOP;
3850: END IF;

Line 3853: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'p_atp_record.inventory_item_name: ' || p_atp_record.inventory_item_name );

3849: END LOOP;
3850: END IF;
3851:
3852: IF PG_DEBUG in ('Y', 'C') THEN
3853: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'p_atp_record.inventory_item_name: ' || p_atp_record.inventory_item_name );
3854: END IF;
3855:
3856: -- dsting skip Forward scheduling for diagnostic ATP
3857: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP THEN

Line 3859: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'no forward pass for diagnostic ATP');

3855:
3856: -- dsting skip Forward scheduling for diagnostic ATP
3857: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP THEN
3858: IF PG_DEBUG in ('Y', 'C') THEN
3859: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'no forward pass for diagnostic ATP');
3860: END IF;
3861:
3862: IF l_net_demand > 0 THEN
3863: /* time_phased_atp changes begin

Line 3878: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_id := ' || p_atp_record.inventory_item_id);

3874: p_atp_record.original_item_name := item_availability_info.item_name(l_item_count);
3875: -- time_phased_atp changes end
3876:
3877: IF PG_DEBUG in ('Y', 'C') THEN
3878: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_id := ' || p_atp_record.inventory_item_id);
3879: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_name := ' || p_atp_record.inventory_item_name);
3880: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id := ' || p_atp_record.request_item_id);
3881: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_name := ' || p_atp_record.request_item_name);
3882: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_id := ' || p_atp_record.original_item_id);

Line 3879: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_name := ' || p_atp_record.inventory_item_name);

3875: -- time_phased_atp changes end
3876:
3877: IF PG_DEBUG in ('Y', 'C') THEN
3878: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_id := ' || p_atp_record.inventory_item_id);
3879: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_name := ' || p_atp_record.inventory_item_name);
3880: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id := ' || p_atp_record.request_item_id);
3881: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_name := ' || p_atp_record.request_item_name);
3882: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_id := ' || p_atp_record.original_item_id);
3883: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_name := ' || p_atp_record.original_item_name);

Line 3880: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id := ' || p_atp_record.request_item_id);

3876:
3877: IF PG_DEBUG in ('Y', 'C') THEN
3878: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_id := ' || p_atp_record.inventory_item_id);
3879: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_name := ' || p_atp_record.inventory_item_name);
3880: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id := ' || p_atp_record.request_item_id);
3881: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_name := ' || p_atp_record.request_item_name);
3882: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_id := ' || p_atp_record.original_item_id);
3883: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_name := ' || p_atp_record.original_item_name);
3884: END IF;

Line 3881: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_name := ' || p_atp_record.request_item_name);

3877: IF PG_DEBUG in ('Y', 'C') THEN
3878: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_id := ' || p_atp_record.inventory_item_id);
3879: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_name := ' || p_atp_record.inventory_item_name);
3880: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id := ' || p_atp_record.request_item_id);
3881: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_name := ' || p_atp_record.request_item_name);
3882: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_id := ' || p_atp_record.original_item_id);
3883: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_name := ' || p_atp_record.original_item_name);
3884: END IF;
3885: p_atp_record.atf_date_quantity := item_availability_info.atf_date_quantity(l_item_count);

Line 3882: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_id := ' || p_atp_record.original_item_id);

3878: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_id := ' || p_atp_record.inventory_item_id);
3879: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_name := ' || p_atp_record.inventory_item_name);
3880: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id := ' || p_atp_record.request_item_id);
3881: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_name := ' || p_atp_record.request_item_name);
3882: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_id := ' || p_atp_record.original_item_id);
3883: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_name := ' || p_atp_record.original_item_name);
3884: END IF;
3885: p_atp_record.atf_date_quantity := item_availability_info.atf_date_quantity(l_item_count);
3886: p_atp_record.requested_date_quantity := item_availability_info.request_date_quantity(l_item_count);

Line 3883: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_name := ' || p_atp_record.original_item_name);

3879: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'inventory_item_name := ' || p_atp_record.inventory_item_name);
3880: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_id := ' || p_atp_record.request_item_id);
3881: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'request_item_name := ' || p_atp_record.request_item_name);
3882: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_id := ' || p_atp_record.original_item_id);
3883: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'original_item_name := ' || p_atp_record.original_item_name);
3884: END IF;
3885: p_atp_record.atf_date_quantity := item_availability_info.atf_date_quantity(l_item_count);
3886: p_atp_record.requested_date_quantity := item_availability_info.request_date_quantity(l_item_count);
3887: p_atp_record.available_quantity := item_availability_info.request_date_quantity(l_item_count);

Line 3896: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Do forward scheduling if needed. net demand: ' || l_net_demand);

3892: goto CLEANUP;
3893: END IF;
3894:
3895: IF PG_DEBUG in ('Y', 'C') THEN
3896: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Do forward scheduling if needed. net demand: ' || l_net_demand);
3897: END IF;
3898:
3899: --- we are done with backward CTP. Now do Forward Schedulling if needed
3900: IF ((l_org_item_detail_flag = 1 AND l_satisfied_by_subst_flag = 1)) or (l_net_demand > 0) THEN

Line 3907: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Inside Forward Scheduling');

3903: ELSE
3904: l_insert_flag := p_atp_record.insert_flag;
3905: END IF;
3906: IF PG_DEBUG in ('Y', 'C') THEN
3907: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Inside Forward Scheduling');
3908: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item count := ' || item_availability_info.inventory_item_id.count);
3909: END IF;
3910: FOR i in reverse 1..item_availability_info.inventory_item_id.count LOOP
3911: --- look for date by which we can meet by onhand

Line 3908: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item count := ' || item_availability_info.inventory_item_id.count);

3904: l_insert_flag := p_atp_record.insert_flag;
3905: END IF;
3906: IF PG_DEBUG in ('Y', 'C') THEN
3907: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Inside Forward Scheduling');
3908: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item count := ' || item_availability_info.inventory_item_id.count);
3909: END IF;
3910: FOR i in reverse 1..item_availability_info.inventory_item_id.count LOOP
3911: --- look for date by which we can meet by onhand
3912: l_net_demand := p_atp_record.quantity_ordered - item_availability_info.request_date_quantity(i);

Line 3914: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Get future onhand date for item := ' ||

3910: FOR i in reverse 1..item_availability_info.inventory_item_id.count LOOP
3911: --- look for date by which we can meet by onhand
3912: l_net_demand := p_atp_record.quantity_ordered - item_availability_info.request_date_quantity(i);
3913: IF PG_DEBUG in ('Y', 'C') THEN
3914: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Get future onhand date for item := ' ||
3915: item_availability_info.item_name(i));
3916: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Net demand future case := ' || l_net_demand);
3917: END IF;
3918:

Line 3916: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Net demand future case := ' || l_net_demand);

3912: l_net_demand := p_atp_record.quantity_ordered - item_availability_info.request_date_quantity(i);
3913: IF PG_DEBUG in ('Y', 'C') THEN
3914: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Get future onhand date for item := ' ||
3915: item_availability_info.item_name(i));
3916: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Net demand future case := ' || l_net_demand);
3917: END IF;
3918:
3919: -- ALLOC ATP CHANGES, 12973673
3920: IF (MSC_ATP_PVT.G_INV_CTP = 4 AND MSC_ATP_PVT.G_HYBRID_ALLOC_ATP = 'Y') THEN

Line 3922: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'G_HYBRID_ALLOC_ATP is Y');

3918:
3919: -- ALLOC ATP CHANGES, 12973673
3920: IF (MSC_ATP_PVT.G_INV_CTP = 4 AND MSC_ATP_PVT.G_HYBRID_ALLOC_ATP = 'Y') THEN
3921: IF PG_DEBUG in ('Y', 'C') THEN
3922: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'G_HYBRID_ALLOC_ATP is Y');
3923: END IF;
3924:
3925: MSC_ATP_PVT.G_ALLOCATED_ATP := MSC_ATP_FUNC.check_alloc_exists(p_atp_record.instance_id,
3926: -1, --PLAN_ID

Line 3932: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'MSC_ATP_PVT.G_ALLOCATED_ATP = '||MSC_ATP_PVT.G_ALLOCATED_ATP);

3928: p_atp_record.organization_id,
3929: nvl(l_requested_ship_date,trunc(sysdate)));
3930:
3931: IF PG_DEBUG in ('Y', 'C') THEN
3932: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'MSC_ATP_PVT.G_ALLOCATED_ATP = '||MSC_ATP_PVT.G_ALLOCATED_ATP);
3933: END IF;
3934: END IF;
3935:
3936: --- first update the demand so that the picture gets adjusted

Line 3963: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Error occured in procedure Increment_Bucketed_Demands_Qty');

3959: l_return_status
3960: );
3961: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
3962: IF PG_DEBUG in ('Y', 'C') THEN
3963: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Error occured in procedure Increment_Bucketed_Demands_Qty');
3964: END IF;
3965: RAISE FND_API.G_EXC_ERROR;
3966: END IF;
3967: END IF;

Line 3971: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Now get the future date');

3967: END IF;
3968: -- time_phased_atp changes end
3969:
3970: IF PG_DEBUG in ('Y', 'C') THEN
3971: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Now get the future date');
3972: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || item_availability_info.atp_flag(i));
3973: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atp_flag := ' || item_availability_info.atp_flag(i));
3974: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atp_flag := ' || item_availability_info.atp_comp_flag(i));
3975: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sys_date_top_org := ' || l_sys_date_top_org);

Line 3972: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || item_availability_info.atp_flag(i));

3968: -- time_phased_atp changes end
3969:
3970: IF PG_DEBUG in ('Y', 'C') THEN
3971: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Now get the future date');
3972: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || item_availability_info.atp_flag(i));
3973: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atp_flag := ' || item_availability_info.atp_flag(i));
3974: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atp_flag := ' || item_availability_info.atp_comp_flag(i));
3975: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sys_date_top_org := ' || l_sys_date_top_org);
3976: END IF;

Line 3973: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atp_flag := ' || item_availability_info.atp_flag(i));

3969:
3970: IF PG_DEBUG in ('Y', 'C') THEN
3971: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Now get the future date');
3972: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || item_availability_info.atp_flag(i));
3973: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atp_flag := ' || item_availability_info.atp_flag(i));
3974: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atp_flag := ' || item_availability_info.atp_comp_flag(i));
3975: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sys_date_top_org := ' || l_sys_date_top_org);
3976: END IF;
3977: IF item_availability_info.atp_flag(i) = 'N' and item_availability_info.atp_comp_flag(i) = 'N' THEN

Line 3974: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atp_flag := ' || item_availability_info.atp_comp_flag(i));

3970: IF PG_DEBUG in ('Y', 'C') THEN
3971: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Now get the future date');
3972: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || item_availability_info.atp_flag(i));
3973: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atp_flag := ' || item_availability_info.atp_flag(i));
3974: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atp_flag := ' || item_availability_info.atp_comp_flag(i));
3975: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sys_date_top_org := ' || l_sys_date_top_org);
3976: END IF;
3977: IF item_availability_info.atp_flag(i) = 'N' and item_availability_info.atp_comp_flag(i) = 'N' THEN
3978: --- we will come here only if item if req_date is passed due

Line 3975: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sys_date_top_org := ' || l_sys_date_top_org);

3971: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Now get the future date');
3972: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || item_availability_info.atp_flag(i));
3973: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atp_flag := ' || item_availability_info.atp_flag(i));
3974: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'atp_flag := ' || item_availability_info.atp_comp_flag(i));
3975: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_sys_date_top_org := ' || l_sys_date_top_org);
3976: END IF;
3977: IF item_availability_info.atp_flag(i) = 'N' and item_availability_info.atp_comp_flag(i) = 'N' THEN
3978: --- we will come here only if item if req_date is passed due
3979: l_atp_date_quantity_this_level := p_atp_record.quantity_ordered;

Line 4010: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Allocated ATP with demand priority');

4006: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
4007: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1) THEN
4008:
4009: IF PG_DEBUG in ('Y', 'C') THEN
4010: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Allocated ATP with demand priority');
4011: END IF;
4012: ---forward steal
4013: MSC_ATP_PVT.G_DEMAND_PEGGING_ID := item_availability_info.end_pegging_id(i);
4014:

Line 4069: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Fwd peg count for curr item := ' || l_atp_pegging_tab.count);

4065: );
4066:
4067: item_availability_info.fwd_steal_peg_begin_idx(i) := l_fwd_atp_pegging_tab.count +1;
4068: IF PG_DEBUG in ('Y', 'C') THEN
4069: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Fwd peg count for curr item := ' || l_atp_pegging_tab.count);
4070: END IF;
4071: FOR j in 1..l_atp_pegging_tab.count LOOP
4072: l_fwd_atp_pegging_tab.extend;
4073: l_fwd_atp_pegging_tab(l_fwd_atp_pegging_tab.count) := l_atp_pegging_tab(j);

Line 4078: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'fwd peg count := ' || l_fwd_atp_pegging_tab.count);

4074:
4075: END LOOP;
4076: item_availability_info.fwd_steal_peg_end_idx(i) := l_fwd_atp_pegging_tab.count;
4077: IF PG_DEBUG in ('Y', 'C') THEN
4078: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'fwd peg count := ' || l_fwd_atp_pegging_tab.count);
4079: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_date_this_level := ' || l_atp_date_this_level);
4080: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_date_quantity_this_level := ' || l_atp_date_quantity_this_level);
4081: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_used_available_quantity := ' || l_used_available_quantity); --bug3409973
4082: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atf_date_qty := ' || l_atf_date_qty); --bug3467631

Line 4079: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_date_this_level := ' || l_atp_date_this_level);

4075: END LOOP;
4076: item_availability_info.fwd_steal_peg_end_idx(i) := l_fwd_atp_pegging_tab.count;
4077: IF PG_DEBUG in ('Y', 'C') THEN
4078: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'fwd peg count := ' || l_fwd_atp_pegging_tab.count);
4079: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_date_this_level := ' || l_atp_date_this_level);
4080: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_date_quantity_this_level := ' || l_atp_date_quantity_this_level);
4081: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_used_available_quantity := ' || l_used_available_quantity); --bug3409973
4082: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atf_date_qty := ' || l_atf_date_qty); --bug3467631
4083: END IF;

Line 4080: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_date_quantity_this_level := ' || l_atp_date_quantity_this_level);

4076: item_availability_info.fwd_steal_peg_end_idx(i) := l_fwd_atp_pegging_tab.count;
4077: IF PG_DEBUG in ('Y', 'C') THEN
4078: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'fwd peg count := ' || l_fwd_atp_pegging_tab.count);
4079: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_date_this_level := ' || l_atp_date_this_level);
4080: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_date_quantity_this_level := ' || l_atp_date_quantity_this_level);
4081: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_used_available_quantity := ' || l_used_available_quantity); --bug3409973
4082: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atf_date_qty := ' || l_atf_date_qty); --bug3467631
4083: END IF;
4084: ELSE

Line 4081: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_used_available_quantity := ' || l_used_available_quantity); --bug3409973

4077: IF PG_DEBUG in ('Y', 'C') THEN
4078: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'fwd peg count := ' || l_fwd_atp_pegging_tab.count);
4079: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_date_this_level := ' || l_atp_date_this_level);
4080: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_date_quantity_this_level := ' || l_atp_date_quantity_this_level);
4081: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_used_available_quantity := ' || l_used_available_quantity); --bug3409973
4082: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atf_date_qty := ' || l_atf_date_qty); --bug3467631
4083: END IF;
4084: ELSE
4085: IF PG_DEBUG in ('Y', 'C') THEN

Line 4082: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atf_date_qty := ' || l_atf_date_qty); --bug3467631

4078: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'fwd peg count := ' || l_fwd_atp_pegging_tab.count);
4079: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_date_this_level := ' || l_atp_date_this_level);
4080: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_date_quantity_this_level := ' || l_atp_date_quantity_this_level);
4081: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_used_available_quantity := ' || l_used_available_quantity); --bug3409973
4082: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atf_date_qty := ' || l_atf_date_qty); --bug3467631
4083: END IF;
4084: ELSE
4085: IF PG_DEBUG in ('Y', 'C') THEN
4086: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'ATP without demand priority allocated ATP');

Line 4086: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'ATP without demand priority allocated ATP');

4082: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atf_date_qty := ' || l_atf_date_qty); --bug3467631
4083: END IF;
4084: ELSE
4085: IF PG_DEBUG in ('Y', 'C') THEN
4086: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'ATP without demand priority allocated ATP');
4087: END IF;
4088: --bug3467631 Inside Forward Scheduling re-initializing MSC_ATP_PVT.G_ITEM_INFO_REC
4089: --otherwise it will have substitute's values even when we are processing member item.
4090: --bug3467631 start

Line 4175: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Update with pegging info');

4171: SELECT msc_full_pegging_s.nextval
4172: INTO l_pegging_id
4173: FROM dual;
4174: IF PG_DEBUG in ('Y', 'C') THEN
4175: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Update with pegging info');
4176: END IF;
4177: item_availability_info.future_supply_peg_id(i) := l_pegging_id;
4178: FOR j in 1..l_atp_period.Level.COUNT LOOP
4179: l_atp_period.Pegging_Id(j) := l_pegging_id;

Line 4191: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add Supply demand details for the item');

4187:
4188:
4189: --- now add period and supply details
4190: IF PG_DEBUG in ('Y', 'C') THEN
4191: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add Supply demand details for the item');
4192: END IF;
4193: MSC_ATP_PROC.Details_Output(l_atp_period,
4194: l_atp_supply_demand,
4195: l_all_atp_period,

Line 4207: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_used_available_quantity := ' || l_used_available_quantity); --bug3467631

4203: item_availability_info.fut_atp_prd_detl_end_idx(i) := l_period_end_idx;
4204: item_availability_info.fut_atp_sd_detl_begin_idx(i) := l_sd_begin_idx;
4205: item_availability_info.fut_atp_sd_detl_end_idx(i) := l_sd_end_idx;
4206: IF PG_DEBUG in ('Y', 'C') THEN
4207: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_used_available_quantity := ' || l_used_available_quantity); --bug3467631
4208: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_date_this_level := ' || l_atp_date_this_level);
4209: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_date_quantity_this_level := ' || l_atp_date_quantity_this_level);
4210: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atf_date_qty := ' || l_atf_date_qty); --bug3467631
4211: END IF;

Line 4208: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_date_this_level := ' || l_atp_date_this_level);

4204: item_availability_info.fut_atp_sd_detl_begin_idx(i) := l_sd_begin_idx;
4205: item_availability_info.fut_atp_sd_detl_end_idx(i) := l_sd_end_idx;
4206: IF PG_DEBUG in ('Y', 'C') THEN
4207: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_used_available_quantity := ' || l_used_available_quantity); --bug3467631
4208: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_date_this_level := ' || l_atp_date_this_level);
4209: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_date_quantity_this_level := ' || l_atp_date_quantity_this_level);
4210: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atf_date_qty := ' || l_atf_date_qty); --bug3467631
4211: END IF;
4212: END IF; --- IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND

Line 4209: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_date_quantity_this_level := ' || l_atp_date_quantity_this_level);

4205: item_availability_info.fut_atp_sd_detl_end_idx(i) := l_sd_end_idx;
4206: IF PG_DEBUG in ('Y', 'C') THEN
4207: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_used_available_quantity := ' || l_used_available_quantity); --bug3467631
4208: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_date_this_level := ' || l_atp_date_this_level);
4209: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_date_quantity_this_level := ' || l_atp_date_quantity_this_level);
4210: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atf_date_qty := ' || l_atf_date_qty); --bug3467631
4211: END IF;
4212: END IF; --- IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
4213: --bug3467631 start

Line 4210: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atf_date_qty := ' || l_atf_date_qty); --bug3467631

4206: IF PG_DEBUG in ('Y', 'C') THEN
4207: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_used_available_quantity := ' || l_used_available_quantity); --bug3467631
4208: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_date_this_level := ' || l_atp_date_this_level);
4209: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_date_quantity_this_level := ' || l_atp_date_quantity_this_level);
4210: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atf_date_qty := ' || l_atf_date_qty); --bug3467631
4211: END IF;
4212: END IF; --- IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
4213: --bug3467631 start
4214: --added to set atf_date_quantity for item

Line 4235: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.atf_date_quantity(i) := ' ||

4231: LEAST(GREATEST(l_used_available_quantity, 0) +
4232: GREATEST(item_availability_info.request_date_quantity(i),0),
4233: MSC_ATP_PVT.INFINITE_NUMBER);--bug3467631
4234: IF PG_DEBUG in ('Y', 'C') THEN --bug3467631
4235: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.atf_date_quantity(i) := ' ||
4236: item_availability_info.atf_date_quantity(i)); --bug3467631
4237: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.used_available_quantity(i) := ' ||
4238: item_availability_info.used_available_quantity(i));
4239: END IF;

Line 4237: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.used_available_quantity(i) := ' ||

4233: MSC_ATP_PVT.INFINITE_NUMBER);--bug3467631
4234: IF PG_DEBUG in ('Y', 'C') THEN --bug3467631
4235: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.atf_date_quantity(i) := ' ||
4236: item_availability_info.atf_date_quantity(i)); --bug3467631
4237: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.used_available_quantity(i) := ' ||
4238: item_availability_info.used_available_quantity(i));
4239: END IF;
4240: IF (l_org_item_detail_flag = 1 AND l_satisfied_by_subst_flag = 1 AND i = l_item_count) THEN
4241: IF PG_DEBUG in ('Y', 'C') THEN

Line 4242: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'we have met the demand, we just check for avail of req item');

4238: item_availability_info.used_available_quantity(i));
4239: END IF;
4240: IF (l_org_item_detail_flag = 1 AND l_satisfied_by_subst_flag = 1 AND i = l_item_count) THEN
4241: IF PG_DEBUG in ('Y', 'C') THEN
4242: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'we have met the demand, we just check for avail of req item');
4243: END IF;
4244: EXIT;
4245: END IF;
4246: ELSE

Line 4255: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Now do Forward CTP');

4251: END IF;
4252:
4253: END LOOP;
4254: IF PG_DEBUG in ('Y', 'C') THEN
4255: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Now do Forward CTP');
4256: END IF;
4257: IF (l_org_item_detail_flag = 1 AND l_satisfied_by_subst_flag = 1
4258: and l_net_demand_after_oh_check > 0) THEN
4259: IF PG_DEBUG in ('Y', 'C') THEN

Line 4260: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || ' Demand was met by a CTP on sub. reset the l_item_ctp_info table');

4256: END IF;
4257: IF (l_org_item_detail_flag = 1 AND l_satisfied_by_subst_flag = 1
4258: and l_net_demand_after_oh_check > 0) THEN
4259: IF PG_DEBUG in ('Y', 'C') THEN
4260: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || ' Demand was met by a CTP on sub. reset the l_item_ctp_info table');
4261: END IF;
4262: l_item_ctp_info := l_null_item_avail_info;
4263: IF (MSC_ATP_SUBST.G_CREATE_SUPPLY_FLAG <> G_HIGHEST_REV_ITEM) or
4264: (MSC_ATP_SUBST.G_CREATE_SUPPLY_FLAG = G_HIGHEST_REV_ITEM and

Line 4274: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.request_date_quantity(i) := ' || l_item_ctp_info.request_date_quantity(i));

4270: FOR i in reverse 1..l_item_ctp_info.inventory_item_id.count LOOP
4271:
4272: l_net_demand := p_atp_record.quantity_ordered - l_item_ctp_info.request_date_quantity(i);
4273: IF PG_DEBUG in ('Y', 'C') THEN
4274: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.request_date_quantity(i) := ' || l_item_ctp_info.request_date_quantity(i));
4275: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand forward case := ' || l_net_demand);
4276: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Future atp date :=' || item_availability_info.future_atp_date(i));
4277: END IF;
4278:

Line 4275: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand forward case := ' || l_net_demand);

4271:
4272: l_net_demand := p_atp_record.quantity_ordered - l_item_ctp_info.request_date_quantity(i);
4273: IF PG_DEBUG in ('Y', 'C') THEN
4274: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.request_date_quantity(i) := ' || l_item_ctp_info.request_date_quantity(i));
4275: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand forward case := ' || l_net_demand);
4276: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Future atp date :=' || item_availability_info.future_atp_date(i));
4277: END IF;
4278:
4279: -- ALLOC ATP CHANGES, 12973673

Line 4276: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Future atp date :=' || item_availability_info.future_atp_date(i));

4272: l_net_demand := p_atp_record.quantity_ordered - l_item_ctp_info.request_date_quantity(i);
4273: IF PG_DEBUG in ('Y', 'C') THEN
4274: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_ctp_info.request_date_quantity(i) := ' || l_item_ctp_info.request_date_quantity(i));
4275: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand forward case := ' || l_net_demand);
4276: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Future atp date :=' || item_availability_info.future_atp_date(i));
4277: END IF;
4278:
4279: -- ALLOC ATP CHANGES, 12973673
4280: IF (MSC_ATP_PVT.G_INV_CTP = 4 AND MSC_ATP_PVT.G_HYBRID_ALLOC_ATP = 'Y') THEN

Line 4282: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'G_HYBRID_ALLOC_ATP is Y');

4278:
4279: -- ALLOC ATP CHANGES, 12973673
4280: IF (MSC_ATP_PVT.G_INV_CTP = 4 AND MSC_ATP_PVT.G_HYBRID_ALLOC_ATP = 'Y') THEN
4281: IF PG_DEBUG in ('Y', 'C') THEN
4282: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'G_HYBRID_ALLOC_ATP is Y');
4283: END IF;
4284:
4285: MSC_ATP_PVT.G_ALLOCATED_ATP := MSC_ATP_FUNC.check_alloc_exists(p_atp_record.instance_id,
4286: -1, --PLAN_ID

Line 4292: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'MSC_ATP_PVT.G_ALLOCATED_ATP = '||MSC_ATP_PVT.G_ALLOCATED_ATP);

4288: p_atp_record.organization_id,
4289: nvl(l_requested_ship_date,trunc(sysdate)));
4290:
4291: IF PG_DEBUG in ('Y', 'C') THEN
4292: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'MSC_ATP_PVT.G_ALLOCATED_ATP = '||MSC_ATP_PVT.G_ALLOCATED_ATP);
4293: END IF;
4294: END IF;
4295:
4296: IF l_item_ctp_info.atp_comp_flag(i) in ('Y', 'C', 'R') and l_item_ctp_info.create_supply_flag(i) = 1 THEN

Line 4321: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_idx := ' || l_item_idx);

4317: END IF;
4318: END IF;
4319: END IF;
4320: IF PG_DEBUG in ('Y', 'C') THEN
4321: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_idx := ' || l_item_idx);
4322: END IF;
4323: l_atp_rec.error_code := 0;
4324: l_atp_rec.available_quantity := NULL;
4325: l_atp_rec.requested_date_quantity := NULL;

Line 4394: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Date from multi level CTP := ' || l_atp_rec.ship_date);

4390: MSC_ATP_PVT.G_ALLOCATED_ATP := l_alloc_atp; --ALLOC ATP CHANGES, 12973673
4391: END IF;
4392:
4393: IF PG_DEBUG in ('Y', 'C') THEN
4394: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Date from multi level CTP := ' || l_atp_rec.ship_date);
4395: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Date from SRs on this level :='
4396: || item_availability_info.future_atp_date(l_item_idx));
4397: END IF;
4398:

Line 4395: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Date from SRs on this level :='

4391: END IF;
4392:
4393: IF PG_DEBUG in ('Y', 'C') THEN
4394: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Date from multi level CTP := ' || l_atp_rec.ship_date);
4395: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Date from SRs on this level :='
4396: || item_availability_info.future_atp_date(l_item_idx));
4397: END IF;
4398:
4399: IF l_atp_rec.ship_date < item_availability_info.future_atp_date(l_item_idx) THEN

Line 4402: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Going down is better. so we add the supply demand dets');

4398:
4399: IF l_atp_rec.ship_date < item_availability_info.future_atp_date(l_item_idx) THEN
4400: -- going down is better
4401: IF PG_DEBUG in ('Y', 'C') THEN
4402: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Going down is better. so we add the supply demand dets');
4403: END IF;
4404: --- add l_atp_period and l_atp_supply_demand
4405: -- dsting: l_period_begin_idx := l_all_atp_supply_demand.level.COUNT;
4406: l_period_begin_idx := l_all_atp_period.level.COUNT;

Line 4447: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'idemand priority alloc ATP, count := '|| l_atp_pegging_tab.count);

4443:
4444: --- recreate forward pegging array
4445: l_atp_pegging_tab.delete;
4446: IF PG_DEBUG in ('Y', 'C') THEN
4447: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'idemand priority alloc ATP, count := '|| l_atp_pegging_tab.count);
4448: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'begin_Idx := ' ||item_availability_info.fwd_steal_peg_begin_idx(l_item_idx));
4449: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'end_idx := ' || item_availability_info.fwd_steal_peg_end_idx(l_item_idx));
4450: END IF;
4451: FOR j in item_availability_info.fwd_steal_peg_begin_idx(l_item_idx)..item_availability_info.fwd_steal_peg_end_idx(l_item_idx) LOOP

Line 4448: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'begin_Idx := ' ||item_availability_info.fwd_steal_peg_begin_idx(l_item_idx));

4444: --- recreate forward pegging array
4445: l_atp_pegging_tab.delete;
4446: IF PG_DEBUG in ('Y', 'C') THEN
4447: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'idemand priority alloc ATP, count := '|| l_atp_pegging_tab.count);
4448: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'begin_Idx := ' ||item_availability_info.fwd_steal_peg_begin_idx(l_item_idx));
4449: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'end_idx := ' || item_availability_info.fwd_steal_peg_end_idx(l_item_idx));
4450: END IF;
4451: FOR j in item_availability_info.fwd_steal_peg_begin_idx(l_item_idx)..item_availability_info.fwd_steal_peg_end_idx(l_item_idx) LOOP
4452: l_atp_pegging_tab.extend;

Line 4449: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'end_idx := ' || item_availability_info.fwd_steal_peg_end_idx(l_item_idx));

4445: l_atp_pegging_tab.delete;
4446: IF PG_DEBUG in ('Y', 'C') THEN
4447: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'idemand priority alloc ATP, count := '|| l_atp_pegging_tab.count);
4448: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'begin_Idx := ' ||item_availability_info.fwd_steal_peg_begin_idx(l_item_idx));
4449: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'end_idx := ' || item_availability_info.fwd_steal_peg_end_idx(l_item_idx));
4450: END IF;
4451: FOR j in item_availability_info.fwd_steal_peg_begin_idx(l_item_idx)..item_availability_info.fwd_steal_peg_end_idx(l_item_idx) LOOP
4452: l_atp_pegging_tab.extend;
4453: l_atp_pegging_tab(l_atp_pegging_tab.count) := l_fwd_atp_pegging_tab(j);

Line 4456: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'count after recreating := ' || l_atp_pegging_tab.count);

4452: l_atp_pegging_tab.extend;
4453: l_atp_pegging_tab(l_atp_pegging_tab.count) := l_fwd_atp_pegging_tab(j);
4454: END LOOP;
4455: IF PG_DEBUG in ('Y', 'C') THEN
4456: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'count after recreating := ' || l_atp_pegging_tab.count);
4457: END IF;
4458:
4459: MSC_ATP_DB_UTILS.Remove_Invalid_Future_SD(l_atp_pegging_tab);
4460: END IF;

Line 4466: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Staying on this level is OK. We remove pegging for current level');

4462:
4463: --- going down is worse than date on this level.
4464: --- we remove pegging and supply demands
4465: IF PG_DEBUG in ('Y', 'C') THEN
4466: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Staying on this level is OK. We remove pegging for current level');
4467: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'G_FUTURE_PEGGING_ID := ' || MSC_ATP_PVT.G_FUTURE_PEGGING_ID);
4468: END IF;
4469: MSC_ATP_DB_UTILS.Remove_Invalid_SD_Rec(
4470: MSC_ATP_PVT.G_FUTURE_PEGGING_ID,

Line 4467: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'G_FUTURE_PEGGING_ID := ' || MSC_ATP_PVT.G_FUTURE_PEGGING_ID);

4463: --- going down is worse than date on this level.
4464: --- we remove pegging and supply demands
4465: IF PG_DEBUG in ('Y', 'C') THEN
4466: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Staying on this level is OK. We remove pegging for current level');
4467: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'G_FUTURE_PEGGING_ID := ' || MSC_ATP_PVT.G_FUTURE_PEGGING_ID);
4468: END IF;
4469: MSC_ATP_DB_UTILS.Remove_Invalid_SD_Rec(
4470: MSC_ATP_PVT.G_FUTURE_PEGGING_ID,
4471: null,

Line 4489: msc_sch_wb.atp_debug('Item :'||i || item_availability_info.sr_inventory_item_id(i) ||

4485: --- now we should know dates for all the items
4486: --- we can now compare the dates and give the best results back
4487: IF PG_DEBUG in ('Y', 'C') THEN
4488: For i in reverse 1..item_availability_info.inventory_item_id.count LOOP
4489: msc_sch_wb.atp_debug('Item :'||i || item_availability_info.sr_inventory_item_id(i) ||
4490: ', Avail Date : ' || item_availability_info.future_atp_date(i) ||
4491: ', : used_available_quantity ' || item_availability_info.used_available_quantity(i)||
4492: ', : Atf_Date_Quantity ' || item_availability_info.Atf_Date_Quantity(i) ||
4493: ', : Atf_Date ' || item_availability_info.Atf_Date(i));

Line 4539: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'idemand priority alloc ATP, count := '|| l_atp_pegging_tab.count);

4535:
4536: --- recreate forward pegging array
4537: l_atp_pegging_tab.delete;
4538: IF PG_DEBUG in ('Y', 'C') THEN
4539: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'idemand priority alloc ATP, count := '|| l_atp_pegging_tab.count);
4540: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'begin_Idx := ' ||item_availability_info.fwd_steal_peg_begin_idx(l_item_count));
4541: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'end_idx := ' || item_availability_info.fwd_steal_peg_end_idx(l_item_count));
4542: END IF;
4543: FOR j in item_availability_info.fwd_steal_peg_begin_idx(l_item_count)..item_availability_info.fwd_steal_peg_end_idx(l_item_count) LOOP

Line 4540: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'begin_Idx := ' ||item_availability_info.fwd_steal_peg_begin_idx(l_item_count));

4536: --- recreate forward pegging array
4537: l_atp_pegging_tab.delete;
4538: IF PG_DEBUG in ('Y', 'C') THEN
4539: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'idemand priority alloc ATP, count := '|| l_atp_pegging_tab.count);
4540: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'begin_Idx := ' ||item_availability_info.fwd_steal_peg_begin_idx(l_item_count));
4541: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'end_idx := ' || item_availability_info.fwd_steal_peg_end_idx(l_item_count));
4542: END IF;
4543: FOR j in item_availability_info.fwd_steal_peg_begin_idx(l_item_count)..item_availability_info.fwd_steal_peg_end_idx(l_item_count) LOOP
4544: l_atp_pegging_tab.extend;

Line 4541: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'end_idx := ' || item_availability_info.fwd_steal_peg_end_idx(l_item_count));

4537: l_atp_pegging_tab.delete;
4538: IF PG_DEBUG in ('Y', 'C') THEN
4539: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'idemand priority alloc ATP, count := '|| l_atp_pegging_tab.count);
4540: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'begin_Idx := ' ||item_availability_info.fwd_steal_peg_begin_idx(l_item_count));
4541: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'end_idx := ' || item_availability_info.fwd_steal_peg_end_idx(l_item_count));
4542: END IF;
4543: FOR j in item_availability_info.fwd_steal_peg_begin_idx(l_item_count)..item_availability_info.fwd_steal_peg_end_idx(l_item_count) LOOP
4544: l_atp_pegging_tab.extend;
4545: l_atp_pegging_tab(l_atp_pegging_tab.count) := l_fwd_atp_pegging_tab(j);

Line 4548: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'count after recreating := ' || l_atp_pegging_tab.count);

4544: l_atp_pegging_tab.extend;
4545: l_atp_pegging_tab(l_atp_pegging_tab.count) := l_fwd_atp_pegging_tab(j);
4546: END LOOP;
4547: IF PG_DEBUG in ('Y', 'C') THEN
4548: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'count after recreating := ' || l_atp_pegging_tab.count);
4549: END IF;
4550:
4551: MSC_ATP_DB_UTILS.Remove_Invalid_Future_SD(l_atp_pegging_tab);
4552: END IF;

Line 4579: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_idx := ' || l_item_idx);

4575: END LOOP;
4576: --- now we have found best case scenrio
4577: --- so we populate the info
4578: IF PG_DEBUG in ('Y', 'C') THEN
4579: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_idx := ' || l_item_idx);
4580: END IF;
4581:
4582: -- time_phased_atp
4583: --p_atp_record.inventory_item_id := item_availability_info.sr_inventory_item_id(l_item_idx);

Line 4614: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'p_atp_record.inventory_item_id := '|| p_atp_record.inventory_item_id);

4610: p_atp_record.ship_date := item_availability_info.future_atp_date(l_item_idx);
4611: p_atp_record.available_quantity := item_availability_info.atp_date_quantity(l_item_idx);
4612: --p_atp_record.inventory_item_name := item_availability_info.item_name(l_item_idx); --bug3467631 set above
4613: IF PG_DEBUG in ('Y', 'C') THEN
4614: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'p_atp_record.inventory_item_id := '|| p_atp_record.inventory_item_id);
4615: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'end_pegging_id := ' || item_availability_info.end_pegging_id(l_item_idx));
4616: END IF;
4617: MSC_ATP_PVT.G_DEMAND_PEGGING_ID := item_availability_info.end_pegging_id(l_item_idx);
4618:

Line 4615: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'end_pegging_id := ' || item_availability_info.end_pegging_id(l_item_idx));

4611: p_atp_record.available_quantity := item_availability_info.atp_date_quantity(l_item_idx);
4612: --p_atp_record.inventory_item_name := item_availability_info.item_name(l_item_idx); --bug3467631 set above
4613: IF PG_DEBUG in ('Y', 'C') THEN
4614: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'p_atp_record.inventory_item_id := '|| p_atp_record.inventory_item_id);
4615: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'end_pegging_id := ' || item_availability_info.end_pegging_id(l_item_idx));
4616: END IF;
4617: MSC_ATP_PVT.G_DEMAND_PEGGING_ID := item_availability_info.end_pegging_id(l_item_idx);
4618:
4619: --- now populate the info for original item

Line 4635: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add details for pegging for backward search');

4631:
4632: --- now we add supply demand and period details
4633: --- first we add details for backward search
4634: IF PG_DEBUG in ('Y', 'C') THEN
4635: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add details for pegging for backward search');
4636: END IF;
4637: MSC_ATP_SUBST.Details_Output(l_all_atp_period,
4638: l_all_atp_supply_demand,
4639: item_availability_info.period_detail_begin_idx(l_item_idx),

Line 4648: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add details for backward CTP');

4644: x_atp_supply_demand,
4645: l_return_status);
4646: --- now add details for backward CTP
4647: IF PG_DEBUG in ('Y', 'C') THEN
4648: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add details for backward CTP');
4649: END IF;
4650: IF item_availability_info.ctp_prd_detl_begin_idx(l_item_idx) is not null and
4651: item_availability_info.ctp_sd_detl_begin_idx(l_item_idx) is not null THEN
4652: MSC_ATP_SUBST.Details_Output(l_all_atp_period,

Line 4664: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'add details for forward search');

4660: l_return_status);
4661: END IF;
4662: --- now add future atp details
4663: IF PG_DEBUG in ('Y', 'C') THEN
4664: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'add details for forward search');
4665: END IF;
4666: IF NVL(item_availability_info.fut_ctp_prd_detl_begin_idx(l_item_idx), 0 ) > 0 THEN
4667: --- going down is better
4668: --- ad future period and supply demand details

Line 4670: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add s/d details for forward CTP');

4666: IF NVL(item_availability_info.fut_ctp_prd_detl_begin_idx(l_item_idx), 0 ) > 0 THEN
4667: --- going down is better
4668: --- ad future period and supply demand details
4669: IF PG_DEBUG in ('Y', 'C') THEN
4670: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add s/d details for forward CTP');
4671: END IF;
4672: MSC_ATP_SUBST.Details_Output(l_all_atp_period,
4673: l_all_atp_supply_demand,
4674: item_availability_info.fut_ctp_prd_detl_begin_idx(l_item_idx),

Line 4689: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item is non-atpable, dont do pegging');

4685: --- first we add pegging for this supply
4686: IF item_availability_info.atp_flag(l_item_idx) = 'N'
4687: and item_availability_info.atp_flag(l_item_idx) = 'N' THEN
4688: IF PG_DEBUG in ('Y', 'C') THEN
4689: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item is non-atpable, dont do pegging');
4690: END IF;
4691: ELSE
4692: ---forward steal: demand has already been created, we dont want to create it again
4693: IF NOT((MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND

Line 4697: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add pegging and s/d details for SRS');

4693: IF NOT((MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
4694: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
4695: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN
4696: IF PG_DEBUG in ('Y', 'C') THEN
4697: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add pegging and s/d details for SRS');
4698: END IF;
4699:
4700: l_pegging_rec.session_id:= MSC_ATP_PVT.G_SESSION_ID;
4701: l_pegging_rec.order_line_id:= MSC_ATP_PVT.G_ORDER_LINE_ID;

Line 4727: msc_sch_wb.atp_debug('family_sr_id: ' || item_availability_info.family_sr_id(l_item_idx));

4723: l_pegging_rec.inventory_item_name := item_availability_info.item_name(l_item_idx);
4724: END IF;
4725: -- time_phased_atp changes end
4726: IF PG_DEBUG in ('Y', 'C') THEN
4727: msc_sch_wb.atp_debug('family_sr_id: ' || item_availability_info.family_sr_id(l_item_idx));
4728: msc_sch_wb.atp_debug('family_item_name: ' || item_availability_info.family_item_name(l_item_idx));
4729: msc_sch_wb.atp_debug('sr_inventory_item_id: ' || item_availability_info.sr_inventory_item_id(l_item_idx));
4730: msc_sch_wb.atp_debug('item_name: ' || item_availability_info.item_name(l_item_idx));
4731: END IF;

Line 4728: msc_sch_wb.atp_debug('family_item_name: ' || item_availability_info.family_item_name(l_item_idx));

4724: END IF;
4725: -- time_phased_atp changes end
4726: IF PG_DEBUG in ('Y', 'C') THEN
4727: msc_sch_wb.atp_debug('family_sr_id: ' || item_availability_info.family_sr_id(l_item_idx));
4728: msc_sch_wb.atp_debug('family_item_name: ' || item_availability_info.family_item_name(l_item_idx));
4729: msc_sch_wb.atp_debug('sr_inventory_item_id: ' || item_availability_info.sr_inventory_item_id(l_item_idx));
4730: msc_sch_wb.atp_debug('item_name: ' || item_availability_info.item_name(l_item_idx));
4731: END IF;
4732:

Line 4729: msc_sch_wb.atp_debug('sr_inventory_item_id: ' || item_availability_info.sr_inventory_item_id(l_item_idx));

4725: -- time_phased_atp changes end
4726: IF PG_DEBUG in ('Y', 'C') THEN
4727: msc_sch_wb.atp_debug('family_sr_id: ' || item_availability_info.family_sr_id(l_item_idx));
4728: msc_sch_wb.atp_debug('family_item_name: ' || item_availability_info.family_item_name(l_item_idx));
4729: msc_sch_wb.atp_debug('sr_inventory_item_id: ' || item_availability_info.sr_inventory_item_id(l_item_idx));
4730: msc_sch_wb.atp_debug('item_name: ' || item_availability_info.item_name(l_item_idx));
4731: END IF;
4732:
4733: l_pegging_rec.aggregate_time_fence_date := item_availability_info.Atf_Date(l_item_idx); --bug3467631

Line 4730: msc_sch_wb.atp_debug('item_name: ' || item_availability_info.item_name(l_item_idx));

4726: IF PG_DEBUG in ('Y', 'C') THEN
4727: msc_sch_wb.atp_debug('family_sr_id: ' || item_availability_info.family_sr_id(l_item_idx));
4728: msc_sch_wb.atp_debug('family_item_name: ' || item_availability_info.family_item_name(l_item_idx));
4729: msc_sch_wb.atp_debug('sr_inventory_item_id: ' || item_availability_info.sr_inventory_item_id(l_item_idx));
4730: msc_sch_wb.atp_debug('item_name: ' || item_availability_info.item_name(l_item_idx));
4731: END IF;
4732:
4733: l_pegging_rec.aggregate_time_fence_date := item_availability_info.Atf_Date(l_item_idx); --bug3467631
4734: l_pegging_rec.resource_id := NULL;

Line 4759: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_future_supply_pegging_id :=' || l_pegging_id);

4755: l_pegging_rec.request_item_id := p_atp_record.request_item_id;
4756:
4757: MSC_ATP_SUBST.add_pegging(l_pegging_rec);
4758: IF PG_DEBUG in ('Y', 'C') THEN
4759: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_future_supply_pegging_id :=' || l_pegging_id);
4760: END IF;
4761: MSC_ATP_SUBST.Details_Output(l_all_atp_period,
4762: l_all_atp_supply_demand,
4763: item_availability_info.fut_atp_prd_detl_begin_idx(l_item_idx),

Line 4775: msc_Sch_wb.atp_debug('ATP_Check_Subst: ' || 'Remove pegging and supply demand details for all items');

4771: END IF; -- IF NOT((MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
4772: END IF;
4773: --- now delete pegging and supply demand info
4774: IF PG_DEBUG in ('Y', 'C') THEN
4775: msc_Sch_wb.atp_debug('ATP_Check_Subst: ' || 'Remove pegging and supply demand details for all items');
4776: END IF;
4777: --- now delete pegging and supply demand info
4778: IF PG_DEBUG in ('Y', 'C') THEN
4779: msc_Sch_wb.atp_debug('ATP_Check_Subst: ' || 'Remove pegging and supply demand details for all items');

Line 4779: msc_Sch_wb.atp_debug('ATP_Check_Subst: ' || 'Remove pegging and supply demand details for all items');

4775: msc_Sch_wb.atp_debug('ATP_Check_Subst: ' || 'Remove pegging and supply demand details for all items');
4776: END IF;
4777: --- now delete pegging and supply demand info
4778: IF PG_DEBUG in ('Y', 'C') THEN
4779: msc_Sch_wb.atp_debug('ATP_Check_Subst: ' || 'Remove pegging and supply demand details for all items');
4780: END IF;
4781:
4782: For j in 1..item_availability_info.inventory_item_id.count LOOP
4783: IF PG_DEBUG in ('Y', 'C') THEN

Line 4784: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'In loop for removing supply demand of all items');

4780: END IF;
4781:
4782: For j in 1..item_availability_info.inventory_item_id.count LOOP
4783: IF PG_DEBUG in ('Y', 'C') THEN
4784: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'In loop for removing supply demand of all items');
4785: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_idx :- ' || l_item_idx);
4786: END IF;
4787: IF (item_availability_info.inventory_item_id(j)
4788: <> item_availability_info.inventory_item_id(l_item_idx)) THEN

Line 4785: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_idx :- ' || l_item_idx);

4781:
4782: For j in 1..item_availability_info.inventory_item_id.count LOOP
4783: IF PG_DEBUG in ('Y', 'C') THEN
4784: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'In loop for removing supply demand of all items');
4785: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_item_idx :- ' || l_item_idx);
4786: END IF;
4787: IF (item_availability_info.inventory_item_id(j)
4788: <> item_availability_info.inventory_item_id(l_item_idx)) THEN
4789:

Line 4792: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Remove Pegging for item := '

4788: <> item_availability_info.inventory_item_id(l_item_idx)) THEN
4789:
4790:
4791: IF PG_DEBUG in ('Y', 'C') THEN
4792: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Remove Pegging for item := '
4793: || item_availability_info.inventory_item_id(j));
4794: END IF;
4795: ---- remove forward stealing pegging
4796: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND

Line 4804: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'idemand priority alloc ATP, count := '|| l_atp_pegging_tab.count);

4800:
4801: --- recreate forward pegging array
4802: l_atp_pegging_tab.delete;
4803: IF PG_DEBUG in ('Y', 'C') THEN
4804: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'idemand priority alloc ATP, count := '|| l_atp_pegging_tab.count);
4805: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'begin_Idx := ' ||item_availability_info.fwd_steal_peg_begin_idx(j));
4806: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'end_idx := ' || item_availability_info.fwd_steal_peg_end_idx(j));
4807: END IF;
4808: FOR l_item_cntr in item_availability_info.fwd_steal_peg_begin_idx(j)..item_availability_info.fwd_steal_peg_end_idx(j) LOOP

Line 4805: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'begin_Idx := ' ||item_availability_info.fwd_steal_peg_begin_idx(j));

4801: --- recreate forward pegging array
4802: l_atp_pegging_tab.delete;
4803: IF PG_DEBUG in ('Y', 'C') THEN
4804: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'idemand priority alloc ATP, count := '|| l_atp_pegging_tab.count);
4805: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'begin_Idx := ' ||item_availability_info.fwd_steal_peg_begin_idx(j));
4806: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'end_idx := ' || item_availability_info.fwd_steal_peg_end_idx(j));
4807: END IF;
4808: FOR l_item_cntr in item_availability_info.fwd_steal_peg_begin_idx(j)..item_availability_info.fwd_steal_peg_end_idx(j) LOOP
4809: l_atp_pegging_tab.extend;

Line 4806: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'end_idx := ' || item_availability_info.fwd_steal_peg_end_idx(j));

4802: l_atp_pegging_tab.delete;
4803: IF PG_DEBUG in ('Y', 'C') THEN
4804: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'idemand priority alloc ATP, count := '|| l_atp_pegging_tab.count);
4805: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'begin_Idx := ' ||item_availability_info.fwd_steal_peg_begin_idx(j));
4806: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'end_idx := ' || item_availability_info.fwd_steal_peg_end_idx(j));
4807: END IF;
4808: FOR l_item_cntr in item_availability_info.fwd_steal_peg_begin_idx(j)..item_availability_info.fwd_steal_peg_end_idx(j) LOOP
4809: l_atp_pegging_tab.extend;
4810: l_atp_pegging_tab(l_atp_pegging_tab.count) := l_fwd_atp_pegging_tab(l_item_cntr);

Line 4813: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'count after recreating := ' || l_atp_pegging_tab.count);

4809: l_atp_pegging_tab.extend;
4810: l_atp_pegging_tab(l_atp_pegging_tab.count) := l_fwd_atp_pegging_tab(l_item_cntr);
4811: END LOOP;
4812: IF PG_DEBUG in ('Y', 'C') THEN
4813: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'count after recreating := ' || l_atp_pegging_tab.count);
4814: END IF;
4815:
4816: MSC_ATP_DB_UTILS.Remove_Invalid_Future_SD(l_atp_pegging_tab);
4817: END IF;

Line 4833: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_org_item_detail_flag := ' || l_org_item_detail_flag);

4829:
4830: END IF;
4831: --- now set the error code
4832: IF PG_DEBUG in ('Y', 'C') THEN
4833: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_org_item_detail_flag := ' || l_org_item_detail_flag);
4834: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_satisfied_by_subst_flag := '|| l_satisfied_by_subst_flag);
4835: END IF;
4836: IF ((NVL(l_org_item_detail_flag, -1) <>1 OR NVL(l_satisfied_by_subst_flag,-1) <> 1)) THEN
4837:

Line 4834: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_satisfied_by_subst_flag := '|| l_satisfied_by_subst_flag);

4830: END IF;
4831: --- now set the error code
4832: IF PG_DEBUG in ('Y', 'C') THEN
4833: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_org_item_detail_flag := ' || l_org_item_detail_flag);
4834: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_satisfied_by_subst_flag := '|| l_satisfied_by_subst_flag);
4835: END IF;
4836: IF ((NVL(l_org_item_detail_flag, -1) <>1 OR NVL(l_satisfied_by_subst_flag,-1) <> 1)) THEN
4837:
4838: IF item_availability_info.atp_flag(l_item_idx) = 'N'

Line 4845: msc_Sch_wb.atp_debug('ATP_Check_Subst: ' || 'Set error code');

4841: --- if item we used to satify the demand is non-atpable then we want to show thate error
4842: -- we will come here only if date is apps due
4843: ELSE
4844: IF PG_DEBUG in ('Y', 'C') THEN
4845: msc_Sch_wb.atp_debug('ATP_Check_Subst: ' || 'Set error code');
4846: END IF;
4847: IF p_atp_record.ship_date is not NULL THEN
4848: p_atp_record.error_code := MSC_ATP_PVT.ATP_REQ_DATE_FAIL;
4849:

Line 4864: msc_sch_wb.atp_debug('MAtching cal date not found, in atp_check_subs');

4860: EXCEPTION
4861:
4862: WHEN MSC_ATP_PVT.NO_MATCHING_DATE_IN_CAL THEN --bug3583705
4863: IF PG_DEBUG in ('Y', 'C') THEN
4864: msc_sch_wb.atp_debug('MAtching cal date not found, in atp_check_subs');
4865: END IF;
4866: p_atp_record.error_code := MSC_ATP_PVT.NO_MATCHING_CAL_DATE;
4867: RAISE MSC_ATP_PVT.NO_MATCHING_DATE_IN_CAL;
4868:

Line 4889: msc_sch_wb.atp_debug('ATP_CHECK_SUBS: NO_MATCHING_CAL_DATE');

4885: IF (p_atp_record.error_code IS NULL) or (p_atp_record.error_code IN (0,61,150)) THEN
4886: IF l_msg_app='MRP' AND l_msg_name='GEN-DATE OUT OF BOUNDS' THEN
4887: p_atp_record.error_code := MSC_ATP_PVT.NO_MATCHING_CAL_DATE;
4888: IF PG_DEBUG in ('Y', 'C') THEN
4889: msc_sch_wb.atp_debug('ATP_CHECK_SUBS: NO_MATCHING_CAL_DATE');
4890: END IF;
4891: ELSE
4892: p_atp_record.error_code := MSC_ATP_PVT.ATP_PROCESSING_ERROR; -- ATP Processing Error
4893: IF PG_DEBUG in ('Y', 'C') THEN

Line 4894: msc_sch_wb.atp_debug('ATP_CHECK_SUBS: ATP_PROCESSING_ERROR');

4890: END IF;
4891: ELSE
4892: p_atp_record.error_code := MSC_ATP_PVT.ATP_PROCESSING_ERROR; -- ATP Processing Error
4893: IF PG_DEBUG in ('Y', 'C') THEN
4894: msc_sch_wb.atp_debug('ATP_CHECK_SUBS: ATP_PROCESSING_ERROR');
4895: END IF;
4896: END IF;
4897: END IF;
4898: --bug3583705 end

Line 4903: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'error := ' || sqlerrm);

4899: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
4900: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME , 'ATP_CHECK_SUBST');
4901: END IF;
4902: IF PG_DEBUG in ('Y', 'C') THEN
4903: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'error := ' || sqlerrm);
4904: END IF;
4905:
4906: FOR i in 1..item_availability_info.inventory_item_id.count LOOP
4907: IF PG_DEBUG in ('Y', 'C') THEN

Line 4908: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'delete demand for item ' || item_availability_info.item_name(i)

4904: END IF;
4905:
4906: FOR i in 1..item_availability_info.inventory_item_id.count LOOP
4907: IF PG_DEBUG in ('Y', 'C') THEN
4908: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'delete demand for item ' || item_availability_info.item_name(i)
4909: || ' ' || item_availability_info.sr_inventory_item_id(i));
4910: END IF;
4911:
4912: MSC_ATP_DB_UTILS.Remove_Invalid_SD_Rec(item_availability_info.end_pegging_id(i),

Line 4950: msc_sch_wb.atp_debug('**** Begin Get_Item_Substitutes ****');

4946: l_request_date date;
4947: BEGIN
4948:
4949: IF PG_DEBUG in ('Y', 'C') THEN
4950: msc_sch_wb.atp_debug('**** Begin Get_Item_Substitutes ****');
4951: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_inventory_item_id = ' || p_inventory_item_id);
4952: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_instance_id := ' || p_instance_id);
4953: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_plan_id := ' || p_plan_id);
4954: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_customer_id := ' || p_customer_id);

Line 4951: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_inventory_item_id = ' || p_inventory_item_id);

4947: BEGIN
4948:
4949: IF PG_DEBUG in ('Y', 'C') THEN
4950: msc_sch_wb.atp_debug('**** Begin Get_Item_Substitutes ****');
4951: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_inventory_item_id = ' || p_inventory_item_id);
4952: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_instance_id := ' || p_instance_id);
4953: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_plan_id := ' || p_plan_id);
4954: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_customer_id := ' || p_customer_id);
4955: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_customer_site_id := ' || p_customer_site_id);

Line 4952: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_instance_id := ' || p_instance_id);

4948:
4949: IF PG_DEBUG in ('Y', 'C') THEN
4950: msc_sch_wb.atp_debug('**** Begin Get_Item_Substitutes ****');
4951: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_inventory_item_id = ' || p_inventory_item_id);
4952: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_instance_id := ' || p_instance_id);
4953: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_plan_id := ' || p_plan_id);
4954: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_customer_id := ' || p_customer_id);
4955: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_customer_site_id := ' || p_customer_site_id);
4956: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_request_date := ' || p_request_date);

Line 4953: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_plan_id := ' || p_plan_id);

4949: IF PG_DEBUG in ('Y', 'C') THEN
4950: msc_sch_wb.atp_debug('**** Begin Get_Item_Substitutes ****');
4951: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_inventory_item_id = ' || p_inventory_item_id);
4952: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_instance_id := ' || p_instance_id);
4953: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_plan_id := ' || p_plan_id);
4954: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_customer_id := ' || p_customer_id);
4955: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_customer_site_id := ' || p_customer_site_id);
4956: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_request_date := ' || p_request_date);
4957: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_item_table.count := ' || p_item_table.inventory_item_id.count);

Line 4954: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_customer_id := ' || p_customer_id);

4950: msc_sch_wb.atp_debug('**** Begin Get_Item_Substitutes ****');
4951: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_inventory_item_id = ' || p_inventory_item_id);
4952: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_instance_id := ' || p_instance_id);
4953: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_plan_id := ' || p_plan_id);
4954: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_customer_id := ' || p_customer_id);
4955: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_customer_site_id := ' || p_customer_site_id);
4956: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_request_date := ' || p_request_date);
4957: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_item_table.count := ' || p_item_table.inventory_item_id.count);
4958: END IF;

Line 4955: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_customer_site_id := ' || p_customer_site_id);

4951: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_inventory_item_id = ' || p_inventory_item_id);
4952: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_instance_id := ' || p_instance_id);
4953: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_plan_id := ' || p_plan_id);
4954: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_customer_id := ' || p_customer_id);
4955: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_customer_site_id := ' || p_customer_site_id);
4956: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_request_date := ' || p_request_date);
4957: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_item_table.count := ' || p_item_table.inventory_item_id.count);
4958: END IF;
4959:

Line 4956: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_request_date := ' || p_request_date);

4952: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_instance_id := ' || p_instance_id);
4953: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_plan_id := ' || p_plan_id);
4954: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_customer_id := ' || p_customer_id);
4955: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_customer_site_id := ' || p_customer_site_id);
4956: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_request_date := ' || p_request_date);
4957: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_item_table.count := ' || p_item_table.inventory_item_id.count);
4958: END IF;
4959:
4960: l_request_date := trunc(p_request_date);

Line 4957: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_item_table.count := ' || p_item_table.inventory_item_id.count);

4953: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_plan_id := ' || p_plan_id);
4954: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_customer_id := ' || p_customer_id);
4955: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_customer_site_id := ' || p_customer_site_id);
4956: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_request_date := ' || p_request_date);
4957: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_item_table.count := ' || p_item_table.inventory_item_id.count);
4958: END IF;
4959:
4960: l_request_date := trunc(p_request_date);
4961:

Line 4963: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'G_HIERARCHY_PROFILE = '||MSC_ATP_PVT.G_HIERARCHY_PROFILE);

4959:
4960: l_request_date := trunc(p_request_date);
4961:
4962: IF PG_DEBUG in ('Y', 'C') THEN
4963: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'G_HIERARCHY_PROFILE = '||MSC_ATP_PVT.G_HIERARCHY_PROFILE);
4964: END IF;
4965: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 2) THEN
4966: IF PG_DEBUG in ('Y', 'C') THEN
4967: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'Customer class alloc atp. Set the local varibale from global var');

Line 4967: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'Customer class alloc atp. Set the local varibale from global var');

4963: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'G_HIERARCHY_PROFILE = '||MSC_ATP_PVT.G_HIERARCHY_PROFILE);
4964: END IF;
4965: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 2) THEN
4966: IF PG_DEBUG in ('Y', 'C') THEN
4967: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'Customer class alloc atp. Set the local varibale from global var');
4968: END IF;
4969: l_customer_id := MSC_ATP_PVT.G_PARTNER_ID;
4970: l_customer_site_id := MSC_ATP_PVT.G_PARTNER_SITE_ID;
4971: ELSIF p_customer_id is not null

Line 4976: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'Convert customer/site id');

4972: --and p_customer_site_id is not null
4973: THEN
4974:
4975: IF PG_DEBUG in ('Y', 'C') THEN
4976: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'Convert customer/site id');
4977: END IF;
4978: BEGIN
4979: SELECT TP_ID
4980: INTO l_customer_id

Line 4991: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'l_customer_id = '||l_customer_id);

4987: l_customer_id := NULL;
4988: END ;
4989:
4990: IF PG_DEBUG in ('Y', 'C') THEN
4991: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'l_customer_id = '||l_customer_id);
4992: END IF;
4993:
4994: BEGIN
4995: SELECT TP_SITE_ID

Line 5006: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'l_customer_site_id := ' || l_customer_site_id);

5002: WHEN NO_DATA_FOUND THEN
5003: l_customer_site_id := null;
5004: END ;
5005: IF PG_DEBUG in ('Y', 'C') THEN
5006: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'l_customer_site_id := ' || l_customer_site_id);
5007: END IF;
5008:
5009: ELSE
5010: IF PG_DEBUG in ('Y', 'C') THEN

Line 5011: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'Customer/customer site is not give');

5007: END IF;
5008:
5009: ELSE
5010: IF PG_DEBUG in ('Y', 'C') THEN
5011: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'Customer/customer site is not give');
5012: END IF;
5013: l_customer_id := null;
5014: l_customer_site_id := null;
5015: END IF;

Line 5018: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'l_customer_id := ' || l_customer_id);

5014: l_customer_site_id := null;
5015: END IF;
5016:
5017: IF PG_DEBUG in ('Y', 'C') THEN
5018: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'l_customer_id := ' || l_customer_id);
5019: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'l_customer_site_id := ' || l_customer_site_id);
5020: END IF;
5021:
5022: /*-----------------------------------------------------

Line 5019: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'l_customer_site_id := ' || l_customer_site_id);

5015: END IF;
5016:
5017: IF PG_DEBUG in ('Y', 'C') THEN
5018: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'l_customer_id := ' || l_customer_id);
5019: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'l_customer_site_id := ' || l_customer_site_id);
5020: END IF;
5021:
5022: /*-----------------------------------------------------
5023: Changed substitution rule picking logic as a part of GOP Web Service:

Line 5065: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'Number of customer specific rule := ' || l_count_no_site);

5061: AND mis.customer_id = l_customer_id
5062: AND NVL(mis.customer_site_id, -1) = -1;
5063:
5064: IF PG_DEBUG in ('Y', 'C') THEN
5065: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'Number of customer specific rule := ' || l_count_no_site);
5066: END IF;
5067: END IF;
5068:
5069: IF PG_DEBUG in ('Y', 'C') THEN

Line 5070: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'Number of customer_site specific rule := ' || l_count);

5066: END IF;
5067: END IF;
5068:
5069: IF PG_DEBUG in ('Y', 'C') THEN
5070: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'Number of customer_site specific rule := ' || l_count);
5071: END IF;
5072:
5073: IF l_count > 0 THEN
5074: ---- customer specific rule

Line 5076: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'Get Customer_site specific rule');

5072:
5073: IF l_count > 0 THEN
5074: ---- customer specific rule
5075: IF PG_DEBUG in ('Y', 'C') THEN
5076: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'Get Customer_site specific rule');
5077: END IF;
5078: SELECT mis.higher_item_id, mis.partial_fulfillment_flag,
5079: msi1.sr_inventory_item_id, msi1.item_name, mis.highest_item_id,
5080: mis.effective_date, mis.disable_date,

Line 5144: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_item_table.count := ' || p_item_table.inventory_item_id.count);

5140: -- time_phased_atp changes end
5141: Order By mis.effective_date, mis.rank desc;
5142:
5143: IF PG_DEBUG in ('Y', 'C') THEN
5144: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_item_table.count := ' || p_item_table.inventory_item_id.count);
5145: END IF;
5146:
5147: FOR i in 1..p_item_table.inventory_item_id.count LOOP
5148: IF PG_DEBUG in ('Y', 'C') THEN

Line 5149: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'counter: Inv_id : sr_inv_id : item_name : par_full_flg :: effective dt : disbale dt ');

5145: END IF;
5146:
5147: FOR i in 1..p_item_table.inventory_item_id.count LOOP
5148: IF PG_DEBUG in ('Y', 'C') THEN
5149: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'counter: Inv_id : sr_inv_id : item_name : par_full_flg :: effective dt : disbale dt ');
5150: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || i || ' : ' || p_item_table.inventory_item_id(i) || ' : '
5151: || p_item_table.sr_inventory_item_id(i) || ' : '
5152: || p_item_table.item_name(i) || ' : '
5153: || p_item_table.partial_fulfillment_flag(i)

Line 5150: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || i || ' : ' || p_item_table.inventory_item_id(i) || ' : '

5146:
5147: FOR i in 1..p_item_table.inventory_item_id.count LOOP
5148: IF PG_DEBUG in ('Y', 'C') THEN
5149: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'counter: Inv_id : sr_inv_id : item_name : par_full_flg :: effective dt : disbale dt ');
5150: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || i || ' : ' || p_item_table.inventory_item_id(i) || ' : '
5151: || p_item_table.sr_inventory_item_id(i) || ' : '
5152: || p_item_table.item_name(i) || ' : '
5153: || p_item_table.partial_fulfillment_flag(i)
5154: || l_effective_dates(i)

Line 5156: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'counter: family_sr_id : family_dest_id : family_item_name : atf_date ');

5152: || p_item_table.item_name(i) || ' : '
5153: || p_item_table.partial_fulfillment_flag(i)
5154: || l_effective_dates(i)
5155: || l_disable_dates(i));
5156: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'counter: family_sr_id : family_dest_id : family_item_name : atf_date ');
5157: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || i || ' : ' || p_item_table.family_sr_id(i) || ' : '
5158: || p_item_table.family_dest_id(i) || ' : '
5159: || p_item_table.family_item_name(i) || ' : '
5160: || p_item_table.atf_date(i));

Line 5157: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || i || ' : ' || p_item_table.family_sr_id(i) || ' : '

5153: || p_item_table.partial_fulfillment_flag(i)
5154: || l_effective_dates(i)
5155: || l_disable_dates(i));
5156: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'counter: family_sr_id : family_dest_id : family_item_name : atf_date ');
5157: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || i || ' : ' || p_item_table.family_sr_id(i) || ' : '
5158: || p_item_table.family_dest_id(i) || ' : '
5159: || p_item_table.family_item_name(i) || ' : '
5160: || p_item_table.atf_date(i));
5161: END IF;

Line 5167: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'Get Customer specific rule');

5163:
5164: ELSIF l_count_no_site > 0 THEN
5165:
5166: IF PG_DEBUG in ('Y', 'C') THEN
5167: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'Get Customer specific rule');
5168: END IF;
5169: SELECT mis.higher_item_id, mis.partial_fulfillment_flag,
5170: msi1.sr_inventory_item_id, msi1.item_name, mis.highest_item_id,
5171: mis.effective_date, mis.disable_date,

Line 5226: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_item_table.count := ' || p_item_table.inventory_item_id.count);

5222: AND msi2.plan_id = msi1.plan_id
5223: Order By mis.effective_date, mis.rank desc;
5224:
5225: IF PG_DEBUG in ('Y', 'C') THEN
5226: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_item_table.count := ' || p_item_table.inventory_item_id.count);
5227: END IF;
5228:
5229: FOR i in 1..p_item_table.inventory_item_id.count LOOP
5230: IF PG_DEBUG in ('Y', 'C') THEN

Line 5231: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'counter: Inv_id : sr_inv_id : item_name : par_full_flg :: effective dt : disbale dt ');

5227: END IF;
5228:
5229: FOR i in 1..p_item_table.inventory_item_id.count LOOP
5230: IF PG_DEBUG in ('Y', 'C') THEN
5231: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'counter: Inv_id : sr_inv_id : item_name : par_full_flg :: effective dt : disbale dt ');
5232: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || i || ' : ' || p_item_table.inventory_item_id(i) || ' : '
5233: || p_item_table.sr_inventory_item_id(i) || ' : '
5234: || p_item_table.item_name(i) || ' : '
5235: || p_item_table.partial_fulfillment_flag(i)

Line 5232: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || i || ' : ' || p_item_table.inventory_item_id(i) || ' : '

5228:
5229: FOR i in 1..p_item_table.inventory_item_id.count LOOP
5230: IF PG_DEBUG in ('Y', 'C') THEN
5231: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'counter: Inv_id : sr_inv_id : item_name : par_full_flg :: effective dt : disbale dt ');
5232: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || i || ' : ' || p_item_table.inventory_item_id(i) || ' : '
5233: || p_item_table.sr_inventory_item_id(i) || ' : '
5234: || p_item_table.item_name(i) || ' : '
5235: || p_item_table.partial_fulfillment_flag(i)
5236: || l_effective_dates(i)

Line 5238: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'counter: family_sr_id : family_dest_id : family_item_name : atf_date ');

5234: || p_item_table.item_name(i) || ' : '
5235: || p_item_table.partial_fulfillment_flag(i)
5236: || l_effective_dates(i)
5237: || l_disable_dates(i));
5238: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'counter: family_sr_id : family_dest_id : family_item_name : atf_date ');
5239: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || i || ' : ' || p_item_table.family_sr_id(i) || ' : '
5240: || p_item_table.family_dest_id(i) || ' : '
5241: || p_item_table.family_item_name(i) || ' : '
5242: || p_item_table.atf_date(i));

Line 5239: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || i || ' : ' || p_item_table.family_sr_id(i) || ' : '

5235: || p_item_table.partial_fulfillment_flag(i)
5236: || l_effective_dates(i)
5237: || l_disable_dates(i));
5238: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'counter: family_sr_id : family_dest_id : family_item_name : atf_date ');
5239: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || i || ' : ' || p_item_table.family_sr_id(i) || ' : '
5240: || p_item_table.family_dest_id(i) || ' : '
5241: || p_item_table.family_item_name(i) || ' : '
5242: || p_item_table.atf_date(i));
5243: END IF;

Line 5250: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'Get Generic rule');

5246: ELSE
5247: ---generic rule
5248:
5249: IF PG_DEBUG in ('Y', 'C') THEN
5250: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'Get Generic rule');
5251: END IF;
5252: --- get generic rule
5253: --- no customer defined, get generic rule
5254: SELECT mis.higher_item_id, mis.partial_fulfillment_flag,

Line 5332: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'Get Generic rule as Customer is not found..');

5328:
5329: ELSE
5330:
5331: IF PG_DEBUG in ('Y', 'C') THEN
5332: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'Get Generic rule as Customer is not found..');
5333: END IF;
5334: --IF l_customer_id is NULL or l_customer_site_id is NULL THEN
5335: --- no customer defined, get generic rule
5336: SELECT mis.higher_item_id, mis.partial_fulfillment_flag,

Line 5400: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_item_table.count := ' || p_item_table.inventory_item_id.count);

5396: Order By mis.rank desc;
5397:
5398:
5399: IF PG_DEBUG in ('Y', 'C') THEN
5400: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'p_item_table.count := ' || p_item_table.inventory_item_id.count);
5401: END IF;
5402:
5403: END IF;
5404:

Line 5407: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'counter: Inv_id : sr_inv_id : item_name : par_full_flg ');

5403: END IF;
5404:
5405: FOR i in 1..p_item_table.inventory_item_id.count LOOP
5406: IF PG_DEBUG in ('Y', 'C') THEN
5407: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'counter: Inv_id : sr_inv_id : item_name : par_full_flg ');
5408: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || i || ' : ' || p_item_table.inventory_item_id(i) || ' : ' || p_item_table.sr_inventory_item_id(i) || ' : ' ||
5409: p_item_table.item_name(i) || ' : ' || p_item_table.partial_fulfillment_flag(i));
5410: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'counter: family_sr_id : family_dest_id : family_item_name : atf_date ');
5411: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || i || ' : ' || p_item_table.family_sr_id(i) || ' : '

Line 5408: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || i || ' : ' || p_item_table.inventory_item_id(i) || ' : ' || p_item_table.sr_inventory_item_id(i) || ' : ' ||

5404:
5405: FOR i in 1..p_item_table.inventory_item_id.count LOOP
5406: IF PG_DEBUG in ('Y', 'C') THEN
5407: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'counter: Inv_id : sr_inv_id : item_name : par_full_flg ');
5408: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || i || ' : ' || p_item_table.inventory_item_id(i) || ' : ' || p_item_table.sr_inventory_item_id(i) || ' : ' ||
5409: p_item_table.item_name(i) || ' : ' || p_item_table.partial_fulfillment_flag(i));
5410: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'counter: family_sr_id : family_dest_id : family_item_name : atf_date ');
5411: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || i || ' : ' || p_item_table.family_sr_id(i) || ' : '
5412: || p_item_table.family_dest_id(i) || ' : '

Line 5410: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'counter: family_sr_id : family_dest_id : family_item_name : atf_date ');

5406: IF PG_DEBUG in ('Y', 'C') THEN
5407: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'counter: Inv_id : sr_inv_id : item_name : par_full_flg ');
5408: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || i || ' : ' || p_item_table.inventory_item_id(i) || ' : ' || p_item_table.sr_inventory_item_id(i) || ' : ' ||
5409: p_item_table.item_name(i) || ' : ' || p_item_table.partial_fulfillment_flag(i));
5410: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'counter: family_sr_id : family_dest_id : family_item_name : atf_date ');
5411: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || i || ' : ' || p_item_table.family_sr_id(i) || ' : '
5412: || p_item_table.family_dest_id(i) || ' : '
5413: || p_item_table.family_item_name(i) || ' : '
5414: || p_item_table.atf_date(i));

Line 5411: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || i || ' : ' || p_item_table.family_sr_id(i) || ' : '

5407: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'counter: Inv_id : sr_inv_id : item_name : par_full_flg ');
5408: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || i || ' : ' || p_item_table.inventory_item_id(i) || ' : ' || p_item_table.sr_inventory_item_id(i) || ' : ' ||
5409: p_item_table.item_name(i) || ' : ' || p_item_table.partial_fulfillment_flag(i));
5410: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'counter: family_sr_id : family_dest_id : family_item_name : atf_date ');
5411: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || i || ' : ' || p_item_table.family_sr_id(i) || ' : '
5412: || p_item_table.family_dest_id(i) || ' : '
5413: || p_item_table.family_item_name(i) || ' : '
5414: || p_item_table.atf_date(i));
5415: END IF;

Line 5427: msc_sch_wb.atp_debug('BEGIN Update_demand ');

5423: p_quantity number)
5424: IS
5425: BEGIN
5426: IF PG_DEBUG in ('Y', 'C') THEN
5427: msc_sch_wb.atp_debug('BEGIN Update_demand ');
5428: msc_sch_wb.atp_debug('Update_demand: ' || 'p_demand_id := ' || p_demand_id);
5429: msc_sch_wb.atp_debug('Update_demand: ' || 'p_plan_id := ' || p_plan_id);
5430: msc_sch_wb.atp_debug('Update_demand: ' || 'p_quantity := ' || p_quantity);
5431: END IF;

Line 5428: msc_sch_wb.atp_debug('Update_demand: ' || 'p_demand_id := ' || p_demand_id);

5424: IS
5425: BEGIN
5426: IF PG_DEBUG in ('Y', 'C') THEN
5427: msc_sch_wb.atp_debug('BEGIN Update_demand ');
5428: msc_sch_wb.atp_debug('Update_demand: ' || 'p_demand_id := ' || p_demand_id);
5429: msc_sch_wb.atp_debug('Update_demand: ' || 'p_plan_id := ' || p_plan_id);
5430: msc_sch_wb.atp_debug('Update_demand: ' || 'p_quantity := ' || p_quantity);
5431: END IF;
5432:

Line 5429: msc_sch_wb.atp_debug('Update_demand: ' || 'p_plan_id := ' || p_plan_id);

5425: BEGIN
5426: IF PG_DEBUG in ('Y', 'C') THEN
5427: msc_sch_wb.atp_debug('BEGIN Update_demand ');
5428: msc_sch_wb.atp_debug('Update_demand: ' || 'p_demand_id := ' || p_demand_id);
5429: msc_sch_wb.atp_debug('Update_demand: ' || 'p_plan_id := ' || p_plan_id);
5430: msc_sch_wb.atp_debug('Update_demand: ' || 'p_quantity := ' || p_quantity);
5431: END IF;
5432:
5433: update msc_demands

Line 5430: msc_sch_wb.atp_debug('Update_demand: ' || 'p_quantity := ' || p_quantity);

5426: IF PG_DEBUG in ('Y', 'C') THEN
5427: msc_sch_wb.atp_debug('BEGIN Update_demand ');
5428: msc_sch_wb.atp_debug('Update_demand: ' || 'p_demand_id := ' || p_demand_id);
5429: msc_sch_wb.atp_debug('Update_demand: ' || 'p_plan_id := ' || p_plan_id);
5430: msc_sch_wb.atp_debug('Update_demand: ' || 'p_quantity := ' || p_quantity);
5431: END IF;
5432:
5433: update msc_demands
5434: set using_requirement_quantity = p_quantity

Line 5438: msc_sch_wb.atp_debug('Update_demand: ' || 'Number of Rows Updated := ' || SQL%ROWCOUNT);

5434: set using_requirement_quantity = p_quantity
5435: where demand_id = p_demand_id
5436: and plan_id = p_plan_id;
5437: IF PG_DEBUG in ('Y', 'C') THEN
5438: msc_sch_wb.atp_debug('Update_demand: ' || 'Number of Rows Updated := ' || SQL%ROWCOUNT);
5439: END IF;
5440:
5441: IF MSC_ATP_PVT.G_INV_CTP = 4 and MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y'
5442: AND MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1 AND MSC_ATP_PVT.G_ALLOCATION_METHOD = 1 THEN

Line 5445: msc_sch_wb.atp_debug('Update_demand: ' || 'Update preallocated demand');

5441: IF MSC_ATP_PVT.G_INV_CTP = 4 and MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y'
5442: AND MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1 AND MSC_ATP_PVT.G_ALLOCATION_METHOD = 1 THEN
5443:
5444: IF PG_DEBUG in ('Y', 'C') THEN
5445: msc_sch_wb.atp_debug('Update_demand: ' || 'Update preallocated demand');
5446: END IF;
5447: update msc_alloc_demands
5448: set allocated_quantity = p_quantity
5449: where parent_demand_id = p_demand_id

Line 5453: msc_sch_wb.atp_debug('Update_demand: ' || 'Number of Rows Updated := ' || SQL%ROWCOUNT);

5449: where parent_demand_id = p_demand_id
5450: and plan_id = p_plan_id;
5451:
5452: IF PG_DEBUG in ('Y', 'C') THEN
5453: msc_sch_wb.atp_debug('Update_demand: ' || 'Number of Rows Updated := ' || SQL%ROWCOUNT);
5454: END IF;
5455: END IF;
5456:
5457:

Line 5466: msc_sch_wb.atp_debug('Delete_demand_subst: ' || 'BEGIN delete demand subst ');

5462: p_plan_id number)
5463: IS
5464: BEGIN
5465: IF PG_DEBUG in ('Y', 'C') THEN
5466: msc_sch_wb.atp_debug('Delete_demand_subst: ' || 'BEGIN delete demand subst ');
5467: msc_sch_wb.atp_debug('Delete_demand_subst: ' || 'p_demand_id := ' || p_demand_id);
5468: msc_sch_wb.atp_debug('Delete_demand_subst: ' || 'p_plan_id := ' || p_plan_id);
5469: END IF;
5470:

Line 5467: msc_sch_wb.atp_debug('Delete_demand_subst: ' || 'p_demand_id := ' || p_demand_id);

5463: IS
5464: BEGIN
5465: IF PG_DEBUG in ('Y', 'C') THEN
5466: msc_sch_wb.atp_debug('Delete_demand_subst: ' || 'BEGIN delete demand subst ');
5467: msc_sch_wb.atp_debug('Delete_demand_subst: ' || 'p_demand_id := ' || p_demand_id);
5468: msc_sch_wb.atp_debug('Delete_demand_subst: ' || 'p_plan_id := ' || p_plan_id);
5469: END IF;
5470:
5471:

Line 5468: msc_sch_wb.atp_debug('Delete_demand_subst: ' || 'p_plan_id := ' || p_plan_id);

5464: BEGIN
5465: IF PG_DEBUG in ('Y', 'C') THEN
5466: msc_sch_wb.atp_debug('Delete_demand_subst: ' || 'BEGIN delete demand subst ');
5467: msc_sch_wb.atp_debug('Delete_demand_subst: ' || 'p_demand_id := ' || p_demand_id);
5468: msc_sch_wb.atp_debug('Delete_demand_subst: ' || 'p_plan_id := ' || p_plan_id);
5469: END IF;
5470:
5471:
5472: --- DELETE DEMAND

Line 5478: msc_sch_wb.atp_debug('Delete_demand_subst: ' || 'Number of Rows deleted := ' || SQL%ROWCOUNT);

5474: where demand_id = p_demand_id
5475: and plan_id = p_plan_id;
5476:
5477: IF PG_DEBUG in ('Y', 'C') THEN
5478: msc_sch_wb.atp_debug('Delete_demand_subst: ' || 'Number of Rows deleted := ' || SQL%ROWCOUNT);
5479: END IF;
5480:
5481: IF MSC_ATP_PVT.G_INV_CTP = 4 and MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y'
5482: AND MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1 AND MSC_ATP_PVT.G_ALLOCATION_METHOD = 1 THEN

Line 5485: msc_sch_wb.atp_debug('Delete_demand_subst: ' || 'Delete Allocated demand');

5481: IF MSC_ATP_PVT.G_INV_CTP = 4 and MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y'
5482: AND MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1 AND MSC_ATP_PVT.G_ALLOCATION_METHOD = 1 THEN
5483:
5484: IF PG_DEBUG in ('Y', 'C') THEN
5485: msc_sch_wb.atp_debug('Delete_demand_subst: ' || 'Delete Allocated demand');
5486: END IF;
5487: delete msc_alloc_demands
5488: where parent_demand_id = p_demand_id
5489: and plan_id = p_plan_id;

Line 5492: msc_sch_wb.atp_debug('Delete_demand_subst: ' || 'Number of Rows deleted := ' || SQL%ROWCOUNT);

5488: where parent_demand_id = p_demand_id
5489: and plan_id = p_plan_id;
5490:
5491: IF PG_DEBUG in ('Y', 'C') THEN
5492: msc_sch_wb.atp_debug('Delete_demand_subst: ' || 'Number of Rows deleted := ' || SQL%ROWCOUNT);
5493: END IF;
5494:
5495: END IF;
5496:

Line 5505: msc_sch_wb.atp_debug('ADD_PEGGING: ' || 'Add pegging for Peg id : ' || p_pegging_rec.pegging_id);

5501: p_pegging_rec IN mrp_atp_details_temp%ROWTYPE)
5502: IS
5503: BEGIN
5504: IF PG_DEBUG in ('Y', 'C') THEN
5505: msc_sch_wb.atp_debug('ADD_PEGGING: ' || 'Add pegging for Peg id : ' || p_pegging_rec.pegging_id);
5506: msc_sch_wb.atp_debug('ADD_PEGGING: ' || 'intransit lead time: ' || p_pegging_rec.INTRANSIT_LEAD_TIME);
5507: msc_sch_wb.atp_debug('ADD_PEGGING: ' || 'aggregate_time_fence_date: ' || p_pegging_rec.aggregate_time_fence_date); --bug3467631
5508: END IF;
5509:

Line 5506: msc_sch_wb.atp_debug('ADD_PEGGING: ' || 'intransit lead time: ' || p_pegging_rec.INTRANSIT_LEAD_TIME);

5502: IS
5503: BEGIN
5504: IF PG_DEBUG in ('Y', 'C') THEN
5505: msc_sch_wb.atp_debug('ADD_PEGGING: ' || 'Add pegging for Peg id : ' || p_pegging_rec.pegging_id);
5506: msc_sch_wb.atp_debug('ADD_PEGGING: ' || 'intransit lead time: ' || p_pegging_rec.INTRANSIT_LEAD_TIME);
5507: msc_sch_wb.atp_debug('ADD_PEGGING: ' || 'aggregate_time_fence_date: ' || p_pegging_rec.aggregate_time_fence_date); --bug3467631
5508: END IF;
5509:
5510: INSERT into mrp_atp_details_temp

Line 5507: msc_sch_wb.atp_debug('ADD_PEGGING: ' || 'aggregate_time_fence_date: ' || p_pegging_rec.aggregate_time_fence_date); --bug3467631

5503: BEGIN
5504: IF PG_DEBUG in ('Y', 'C') THEN
5505: msc_sch_wb.atp_debug('ADD_PEGGING: ' || 'Add pegging for Peg id : ' || p_pegging_rec.pegging_id);
5506: msc_sch_wb.atp_debug('ADD_PEGGING: ' || 'intransit lead time: ' || p_pegging_rec.INTRANSIT_LEAD_TIME);
5507: msc_sch_wb.atp_debug('ADD_PEGGING: ' || 'aggregate_time_fence_date: ' || p_pegging_rec.aggregate_time_fence_date); --bug3467631
5508: END IF;
5509:
5510: INSERT into mrp_atp_details_temp
5511: (session_id,

Line 5700: msc_sch_wb.atp_debug('ADD_PEGGING: ' || 'Number of rows : ' || SQL%ROWCOUNT);

5696: p_pegging_rec.intransit_cal_code, -- Bug 3826234
5697: p_pegging_rec.manufacturing_cal_code -- Bug 3826234
5698: );
5699: IF PG_DEBUG in ('Y', 'C') THEN
5700: msc_sch_wb.atp_debug('ADD_PEGGING: ' || 'Number of rows : ' || SQL%ROWCOUNT);
5701: END IF;
5702: END ADD_PEGGING;
5703:
5704: Procedure Extend_Item_Info_Rec_Typ(

Line 5843: msc_sch_wb.atp_debug('***** Begin Details_Output Procedure *****');

5839: i PLS_INTEGER;
5840: Begin
5841:
5842: IF PG_DEBUG in ('Y', 'C') THEN
5843: msc_sch_wb.atp_debug('***** Begin Details_Output Procedure *****');
5844: msc_sch_wb.atp_debug('Details_Output: ' || 'p_begin_period_idx : = ' || p_begin_period_idx);
5845: msc_sch_wb.atp_debug('Details_Output: ' || 'p_end_period_idx := ' || p_end_period_idx);
5846: msc_sch_wb.atp_debug('Details_Output: ' || 'p_begin_sd_idx := ' || p_begin_sd_idx);
5847: msc_sch_wb.atp_debug('Details_Output: ' || 'p_end_sd_idx := ' || p_end_sd_idx);

Line 5844: msc_sch_wb.atp_debug('Details_Output: ' || 'p_begin_period_idx : = ' || p_begin_period_idx);

5840: Begin
5841:
5842: IF PG_DEBUG in ('Y', 'C') THEN
5843: msc_sch_wb.atp_debug('***** Begin Details_Output Procedure *****');
5844: msc_sch_wb.atp_debug('Details_Output: ' || 'p_begin_period_idx : = ' || p_begin_period_idx);
5845: msc_sch_wb.atp_debug('Details_Output: ' || 'p_end_period_idx := ' || p_end_period_idx);
5846: msc_sch_wb.atp_debug('Details_Output: ' || 'p_begin_sd_idx := ' || p_begin_sd_idx);
5847: msc_sch_wb.atp_debug('Details_Output: ' || 'p_end_sd_idx := ' || p_end_sd_idx);
5848: END IF;

Line 5845: msc_sch_wb.atp_debug('Details_Output: ' || 'p_end_period_idx := ' || p_end_period_idx);

5841:
5842: IF PG_DEBUG in ('Y', 'C') THEN
5843: msc_sch_wb.atp_debug('***** Begin Details_Output Procedure *****');
5844: msc_sch_wb.atp_debug('Details_Output: ' || 'p_begin_period_idx : = ' || p_begin_period_idx);
5845: msc_sch_wb.atp_debug('Details_Output: ' || 'p_end_period_idx := ' || p_end_period_idx);
5846: msc_sch_wb.atp_debug('Details_Output: ' || 'p_begin_sd_idx := ' || p_begin_sd_idx);
5847: msc_sch_wb.atp_debug('Details_Output: ' || 'p_end_sd_idx := ' || p_end_sd_idx);
5848: END IF;
5849:

Line 5846: msc_sch_wb.atp_debug('Details_Output: ' || 'p_begin_sd_idx := ' || p_begin_sd_idx);

5842: IF PG_DEBUG in ('Y', 'C') THEN
5843: msc_sch_wb.atp_debug('***** Begin Details_Output Procedure *****');
5844: msc_sch_wb.atp_debug('Details_Output: ' || 'p_begin_period_idx : = ' || p_begin_period_idx);
5845: msc_sch_wb.atp_debug('Details_Output: ' || 'p_end_period_idx := ' || p_end_period_idx);
5846: msc_sch_wb.atp_debug('Details_Output: ' || 'p_begin_sd_idx := ' || p_begin_sd_idx);
5847: msc_sch_wb.atp_debug('Details_Output: ' || 'p_end_sd_idx := ' || p_end_sd_idx);
5848: END IF;
5849:
5850: x_return_status := FND_API.G_RET_STS_SUCCESS;

Line 5847: msc_sch_wb.atp_debug('Details_Output: ' || 'p_end_sd_idx := ' || p_end_sd_idx);

5843: msc_sch_wb.atp_debug('***** Begin Details_Output Procedure *****');
5844: msc_sch_wb.atp_debug('Details_Output: ' || 'p_begin_period_idx : = ' || p_begin_period_idx);
5845: msc_sch_wb.atp_debug('Details_Output: ' || 'p_end_period_idx := ' || p_end_period_idx);
5846: msc_sch_wb.atp_debug('Details_Output: ' || 'p_begin_sd_idx := ' || p_begin_sd_idx);
5847: msc_sch_wb.atp_debug('Details_Output: ' || 'p_end_sd_idx := ' || p_end_sd_idx);
5848: END IF;
5849:
5850: x_return_status := FND_API.G_RET_STS_SUCCESS;
5851:

Line 5986: msc_sch_wb.atp_debug('Details_Output: item '||

5982: x_atp_supply_demand.End_Pegging_Id(l_count+l_sd_count):=
5983: p_atp_supply_demand.End_Pegging_Id(i);
5984:
5985: IF PG_DEBUG in ('Y', 'C') THEN
5986: msc_sch_wb.atp_debug('Details_Output: item '||
5987: p_atp_supply_demand.inventory_item_id(i)||
5988: ' : org '|| p_atp_supply_demand.organization_id(i) ||
5989: ' : qty '|| p_atp_supply_demand.supply_demand_quantity(i) ||
5990: ' : peg '|| p_atp_supply_demand.pegging_id(i));

Line 5998: msc_sch_wb.atp_debug('***** End Details_Output Procedure *****');

5994: END LOOP;
5995: END IF;
5996:
5997: IF PG_DEBUG in ('Y', 'C') THEN
5998: msc_sch_wb.atp_debug('***** End Details_Output Procedure *****');
5999: END IF;
6000:
6001: END Details_Output;
6002:

Line 6011: msc_sch_wb.atp_debug('***** start Copy_Item_Info_Rec ****');

6007: l_return_status varchar2(1);
6008: l_count number;
6009: BEGIN
6010: IF PG_DEBUG in ('Y', 'C') THEN
6011: msc_sch_wb.atp_debug('***** start Copy_Item_Info_Rec ****');
6012: END IF;
6013: MSC_ATP_SUBST.Extend_Item_Info_Rec_Typ(p_child_item_info, l_return_status);
6014: l_count := p_child_item_info.inventory_item_id.count;
6015: p_child_item_info.inventory_item_id(l_count) := p_parent_item_info.inventory_item_id(p_index);

Line 6068: msc_sch_wb.atp_debug('***** END Copy_Item_Info_Rec ****');

6064: p_child_item_info.Atf_Date_Quantity(l_count) := p_parent_item_info.Atf_Date_Quantity(p_index);
6065:
6066:
6067: IF PG_DEBUG in ('Y', 'C') THEN
6068: msc_sch_wb.atp_debug('***** END Copy_Item_Info_Rec ****');
6069: END IF;
6070:
6071: END Copy_Item_Info_Rec;
6072:

Line 6090: msc_sch_wb.atp_debug('***** Begin SUBST Add_Mat_Demand *****');

6086: temp_sd_qty number;
6087: l_record_source number := 2; -- for plan order pegging
6088: BEGIN
6089: IF PG_DEBUG in ('Y', 'C') THEN
6090: msc_sch_wb.atp_debug('***** Begin SUBST Add_Mat_Demand *****');
6091: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.quantity_ordered '||p_atp_rec.quantity_ordered);
6092: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.requested_ship_date '||p_atp_rec.requested_ship_date);
6093: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.origination_type '||p_atp_rec.origination_type);
6094: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.inventory_item_id '||p_atp_rec.inventory_item_id);

Line 6091: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.quantity_ordered '||p_atp_rec.quantity_ordered);

6087: l_record_source number := 2; -- for plan order pegging
6088: BEGIN
6089: IF PG_DEBUG in ('Y', 'C') THEN
6090: msc_sch_wb.atp_debug('***** Begin SUBST Add_Mat_Demand *****');
6091: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.quantity_ordered '||p_atp_rec.quantity_ordered);
6092: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.requested_ship_date '||p_atp_rec.requested_ship_date);
6093: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.origination_type '||p_atp_rec.origination_type);
6094: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.inventory_item_id '||p_atp_rec.inventory_item_id);
6095: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.organization_id '||p_atp_rec.organization_id);

Line 6092: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.requested_ship_date '||p_atp_rec.requested_ship_date);

6088: BEGIN
6089: IF PG_DEBUG in ('Y', 'C') THEN
6090: msc_sch_wb.atp_debug('***** Begin SUBST Add_Mat_Demand *****');
6091: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.quantity_ordered '||p_atp_rec.quantity_ordered);
6092: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.requested_ship_date '||p_atp_rec.requested_ship_date);
6093: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.origination_type '||p_atp_rec.origination_type);
6094: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.inventory_item_id '||p_atp_rec.inventory_item_id);
6095: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.organization_id '||p_atp_rec.organization_id);
6096: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.demand_source_line '||p_atp_rec.demand_source_line);

Line 6093: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.origination_type '||p_atp_rec.origination_type);

6089: IF PG_DEBUG in ('Y', 'C') THEN
6090: msc_sch_wb.atp_debug('***** Begin SUBST Add_Mat_Demand *****');
6091: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.quantity_ordered '||p_atp_rec.quantity_ordered);
6092: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.requested_ship_date '||p_atp_rec.requested_ship_date);
6093: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.origination_type '||p_atp_rec.origination_type);
6094: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.inventory_item_id '||p_atp_rec.inventory_item_id);
6095: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.organization_id '||p_atp_rec.organization_id);
6096: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.demand_source_line '||p_atp_rec.demand_source_line);
6097: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.instance_id '||p_atp_rec.instance_id);

Line 6094: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.inventory_item_id '||p_atp_rec.inventory_item_id);

6090: msc_sch_wb.atp_debug('***** Begin SUBST Add_Mat_Demand *****');
6091: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.quantity_ordered '||p_atp_rec.quantity_ordered);
6092: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.requested_ship_date '||p_atp_rec.requested_ship_date);
6093: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.origination_type '||p_atp_rec.origination_type);
6094: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.inventory_item_id '||p_atp_rec.inventory_item_id);
6095: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.organization_id '||p_atp_rec.organization_id);
6096: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.demand_source_line '||p_atp_rec.demand_source_line);
6097: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.instance_id '||p_atp_rec.instance_id);
6098: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_plan_id = ' || p_plan_id);

Line 6095: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.organization_id '||p_atp_rec.organization_id);

6091: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.quantity_ordered '||p_atp_rec.quantity_ordered);
6092: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.requested_ship_date '||p_atp_rec.requested_ship_date);
6093: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.origination_type '||p_atp_rec.origination_type);
6094: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.inventory_item_id '||p_atp_rec.inventory_item_id);
6095: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.organization_id '||p_atp_rec.organization_id);
6096: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.demand_source_line '||p_atp_rec.demand_source_line);
6097: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.instance_id '||p_atp_rec.instance_id);
6098: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_plan_id = ' || p_plan_id);
6099: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.action '||p_atp_rec.action);

Line 6096: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.demand_source_line '||p_atp_rec.demand_source_line);

6092: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.requested_ship_date '||p_atp_rec.requested_ship_date);
6093: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.origination_type '||p_atp_rec.origination_type);
6094: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.inventory_item_id '||p_atp_rec.inventory_item_id);
6095: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.organization_id '||p_atp_rec.organization_id);
6096: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.demand_source_line '||p_atp_rec.demand_source_line);
6097: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.instance_id '||p_atp_rec.instance_id);
6098: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_plan_id = ' || p_plan_id);
6099: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.action '||p_atp_rec.action);
6100: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'request_item_id :=' || p_atp_rec.request_item_id);

Line 6097: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.instance_id '||p_atp_rec.instance_id);

6093: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.origination_type '||p_atp_rec.origination_type);
6094: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.inventory_item_id '||p_atp_rec.inventory_item_id);
6095: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.organization_id '||p_atp_rec.organization_id);
6096: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.demand_source_line '||p_atp_rec.demand_source_line);
6097: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.instance_id '||p_atp_rec.instance_id);
6098: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_plan_id = ' || p_plan_id);
6099: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.action '||p_atp_rec.action);
6100: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'request_item_id :=' || p_atp_rec.request_item_id);
6101: END IF;

Line 6098: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_plan_id = ' || p_plan_id);

6094: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.inventory_item_id '||p_atp_rec.inventory_item_id);
6095: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.organization_id '||p_atp_rec.organization_id);
6096: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.demand_source_line '||p_atp_rec.demand_source_line);
6097: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.instance_id '||p_atp_rec.instance_id);
6098: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_plan_id = ' || p_plan_id);
6099: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.action '||p_atp_rec.action);
6100: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'request_item_id :=' || p_atp_rec.request_item_id);
6101: END IF;
6102: --IF (p_atp_rec.origination_type NOT IN (6, 30)) THEN

Line 6099: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.action '||p_atp_rec.action);

6095: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.organization_id '||p_atp_rec.organization_id);
6096: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.demand_source_line '||p_atp_rec.demand_source_line);
6097: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.instance_id '||p_atp_rec.instance_id);
6098: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_plan_id = ' || p_plan_id);
6099: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.action '||p_atp_rec.action);
6100: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'request_item_id :=' || p_atp_rec.request_item_id);
6101: END IF;
6102: --IF (p_atp_rec.origination_type NOT IN (6, 30)) THEN
6103:

Line 6100: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'request_item_id :=' || p_atp_rec.request_item_id);

6096: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.demand_source_line '||p_atp_rec.demand_source_line);
6097: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.instance_id '||p_atp_rec.instance_id);
6098: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_plan_id = ' || p_plan_id);
6099: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'p_atp_rec.action '||p_atp_rec.action);
6100: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'request_item_id :=' || p_atp_rec.request_item_id);
6101: END IF;
6102: --IF (p_atp_rec.origination_type NOT IN (6, 30)) THEN
6103:
6104: IF PG_DEBUG in ('Y', 'C') THEN

Line 6105: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'before insert into msc_demands');

6101: END IF;
6102: --IF (p_atp_rec.origination_type NOT IN (6, 30)) THEN
6103:
6104: IF PG_DEBUG in ('Y', 'C') THEN
6105: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'before insert into msc_demands');
6106: END IF;
6107:
6108: INSERT INTO MSC_DEMANDS(
6109: DEMAND_ID,

Line 6166: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'Numbe of rows inserted := ' || SQL%ROWCOUNT);

6162: --1657855, remove support for min allocation
6163: ---p_atp_rec.stolen_flag)
6164: RETURNING DEMAND_ID INTO x_demand_id;
6165: IF PG_DEBUG in ('Y', 'C') THEN
6166: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'Numbe of rows inserted := ' || SQL%ROWCOUNT);
6167: END IF;
6168: IF ((MSC_ATP_PVT.G_INV_CTP = 4) AND
6169: (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
6170: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND

Line 6174: msc_sch_wb.atp_debug('Add_Mat_Demand: before insert into'||

6170: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
6171: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN
6172:
6173: IF PG_DEBUG in ('Y', 'C') THEN
6174: msc_sch_wb.atp_debug('Add_Mat_Demand: before insert into'||
6175: ' msc_alloc_demands');
6176: END IF;
6177:
6178: INSERT INTO MSC_ALLOC_DEMANDS(

Line 6214: msc_sch_wb.atp_debug('***** End Add_Mat_Demand *****');

6210: sysdate);
6211: END IF;
6212: --END IF;
6213: IF PG_DEBUG in ('Y', 'C') THEN
6214: msc_sch_wb.atp_debug('***** End Add_Mat_Demand *****');
6215: END IF;
6216:
6217: END Add_Mat_Demand;
6218: */