DBA Data[Home] [Help]

APPS.MSC_ATP_SUBST dependencies on MSC_ATP_PVT

Line 186: x_pegging_rec.session_id:= MSC_ATP_PVT.G_SESSION_ID;

182: ) IS
183: l_parent_org_idx NUMBER;
184: BEGIN
185:
186: x_pegging_rec.session_id:= MSC_ATP_PVT.G_SESSION_ID;
187: x_pegging_rec.order_line_id := MSC_ATP_PVT.G_ORDER_LINE_ID;
188:
189: x_pegging_rec.organization_id := org_avail_info.organization_id(p_org_idx);
190:

Line 187: x_pegging_rec.order_line_id := MSC_ATP_PVT.G_ORDER_LINE_ID;

183: l_parent_org_idx NUMBER;
184: BEGIN
185:
186: x_pegging_rec.session_id:= MSC_ATP_PVT.G_SESSION_ID;
187: x_pegging_rec.order_line_id := MSC_ATP_PVT.G_ORDER_LINE_ID;
188:
189: x_pegging_rec.organization_id := org_avail_info.organization_id(p_org_idx);
190:
191: x_pegging_rec.organization_code := org_avail_info.org_code(p_org_idx);

Line 206: x_pegging_rec.summary_flag := MSC_ATP_PVT.G_SUMMARY_FLAG;

202: x_pegging_rec.supplier_site_id := NULL;
203: x_pegging_rec.supplier_site_name := NULL;
204: x_pegging_rec.substitution_window := item_availability_info.substitution_window(p_item_idx);
205:
206: x_pegging_rec.summary_flag := MSC_ATP_PVT.G_SUMMARY_FLAG;
207: --bug3467631 start
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.

Line 274: NVL(p_atp_record.component_identifier, MSC_ATP_PVT.G_COMP_LINE_ID);

270:
271: -- for demo:1153192
272: x_pegging_rec.constraint_flag := 'N';
273: x_pegging_rec.component_identifier :=
274: NVL(p_atp_record.component_identifier, MSC_ATP_PVT.G_COMP_LINE_ID);
275:
276: --- bug 2152184: For PF based ATP inventory_item_id field contains id for PF item
277: --- cto looks at pegging tree to place their demands. Since CTO expects to find
278: -- id for the requested item, we add the following column. CTO will now read from this column

Line 374: x_pegging_rec.supply_demand_source_type:= MSC_ATP_PVT.TRANSFER;

370: x_pegging_rec.organization_code := org_avail_info.org_code(p_org_idx);
371:
372: x_pegging_rec.identifier2:= org_avail_info.plan_id(l_parent_idx);
373: x_pegging_rec.identifier3 := p_transaction_id;
374: x_pegging_rec.supply_demand_source_type:= MSC_ATP_PVT.TRANSFER;
375:
376: x_pegging_rec.supply_demand_quantity := p_PO_qty;
377: x_pegging_rec.supply_demand_type:= 2;
378: x_pegging_rec.supply_demand_date:= org_avail_info.requested_ship_date(l_parent_idx);

Line 379: x_pegging_rec.source_type := MSC_ATP_PVT.TRANSFER;

375:
376: x_pegging_rec.supply_demand_quantity := p_PO_qty;
377: x_pegging_rec.supply_demand_type:= 2;
378: x_pegging_rec.supply_demand_date:= org_avail_info.requested_ship_date(l_parent_idx);
379: x_pegging_rec.source_type := MSC_ATP_PVT.TRANSFER;
380:
381: -- for demo:1153192
382: x_pegging_rec.component_identifier :=
383: NVL(p_atp_record.component_identifier, MSC_ATP_PVT.G_COMP_LINE_ID);

Line 383: NVL(p_atp_record.component_identifier, MSC_ATP_PVT.G_COMP_LINE_ID);

379: x_pegging_rec.source_type := MSC_ATP_PVT.TRANSFER;
380:
381: -- for demo:1153192
382: x_pegging_rec.component_identifier :=
383: NVL(p_atp_record.component_identifier, MSC_ATP_PVT.G_COMP_LINE_ID);
384: --bug3467631
385: x_pegging_rec.request_item_id := NVL(p_atp_record.request_item_id,
386: p_atp_record.inventory_item_id);
387:

Line 509: x_pegging_rec.supply_demand_source_type:= MSC_ATP_PVT.ATP;

505: x_pegging_rec.organization_id:= org_avail_info.organization_id(p_org_idx);
506: x_pegging_rec.organization_code := org_avail_info.org_code(p_org_idx);
507: x_pegging_rec.identifier2 := org_avail_info.plan_id(p_org_idx);
508: x_pegging_rec.identifier3 := p_transaction_id;
509: x_pegging_rec.supply_demand_source_type:= MSC_ATP_PVT.ATP;
510: -- dsting 2754446
511: -- x_pegging_rec.supply_demand_quantity:= org_avail_info.request_date_quantity(p_org_idx);
512: x_pegging_rec.supply_demand_quantity:= org_avail_info.req_date_unadj_qty(p_org_idx);
513: x_pegging_rec.supply_demand_date:= org_avail_info.requested_ship_date(p_org_idx);

Line 517: NVL(p_atp_record.component_identifier, MSC_ATP_PVT.G_COMP_LINE_ID);

513: x_pegging_rec.supply_demand_date:= org_avail_info.requested_ship_date(p_org_idx);
514: x_pegging_rec.supply_demand_type:= 2;
515: x_pegging_rec.source_type := 0;
516: x_pegging_rec.component_identifier :=
517: NVL(p_atp_record.component_identifier, MSC_ATP_PVT.G_COMP_LINE_ID);
518:
519: IF NVL(org_avail_info.constraint_type(p_org_idx), NOSOURCES_NONCONSTRAINT)
520: <> NOSOURCES_NONCONSTRAINT
521: THEN

Line 650: l_item_attribute_rec MSC_ATP_PVT.item_attribute_rec;

646: L_DEMAND_SATISFIED_FLAG number;
647: l_org_item_detail_flag number;
648: l_item_ctp_info Item_Info_Rec_Typ;
649: l_null_item_avail_info Item_Info_Rec_Typ;
650: l_item_attribute_rec MSC_ATP_PVT.item_attribute_rec;
651: l_plan_info_rec MSC_ATP_PVT.plan_info_rec; --- for bug 2392456
652:
653: L_HIGHEST_REV_ITEM_ID number;
654: L_ITEM_COUNT number;

Line 651: l_plan_info_rec MSC_ATP_PVT.plan_info_rec; --- for bug 2392456

647: l_org_item_detail_flag number;
648: l_item_ctp_info Item_Info_Rec_Typ;
649: l_null_item_avail_info Item_Info_Rec_Typ;
650: l_item_attribute_rec MSC_ATP_PVT.item_attribute_rec;
651: l_plan_info_rec MSC_ATP_PVT.plan_info_rec; --- for bug 2392456
652:
653: L_HIGHEST_REV_ITEM_ID number;
654: L_ITEM_COUNT number;
655: L_ASSIGN_SET_ID number;

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

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

Line 1051: MSC_ATP_PVT.G_ALLOCATED_ATP := 'N';

1047: RAISE FND_API.G_EXC_ERROR;
1048: END IF;
1049: ELSE -- DRP plan re-set variables.
1050: -- Allocated and PF ATP de-supported for DRP Plans.
1051: MSC_ATP_PVT.G_ALLOCATED_ATP := 'N';
1052: org_availability_info.family_sr_id(l_process_org_cntr) :=
1053: item_availability_info.sr_inventory_item_id(l_item_cntr);
1054: org_availability_info.family_dest_id(l_process_org_cntr) :=
1055: item_availability_info.inventory_item_id(l_item_cntr);

Line 1070: MSC_ATP_PVT.G_TIME_PHASED_PF_ENABLED := 'Y';

1066: /* To support new logic for dependent demands allocation in time phased PF rule based AATP scenarios
1067: Set global variable. This is used in Get_Item_Demand_Alloc_Percent function*/
1068: IF org_availability_info.atf_date(l_process_org_cntr) is not null THEN
1069: /* Set global variable. This is used in Get_Item_Demand_Alloc_Percent function*/
1070: MSC_ATP_PVT.G_TIME_PHASED_PF_ENABLED := 'Y';
1071: ELSE
1072: MSC_ATP_PVT.G_TIME_PHASED_PF_ENABLED := 'N';
1073: END IF;
1074:

Line 1072: MSC_ATP_PVT.G_TIME_PHASED_PF_ENABLED := 'N';

1068: IF org_availability_info.atf_date(l_process_org_cntr) is not null THEN
1069: /* Set global variable. This is used in Get_Item_Demand_Alloc_Percent function*/
1070: MSC_ATP_PVT.G_TIME_PHASED_PF_ENABLED := 'Y';
1071: ELSE
1072: MSC_ATP_PVT.G_TIME_PHASED_PF_ENABLED := 'N';
1073: END IF;
1074:
1075: -- dsting 2754446 Add uom conversion
1076: -- l_net_demand and demand_quantity stays in request org's uom

Line 1134: l_item_attribute_rec := MSC_ATP_PVT.G_ITEM_INFO_REC;--bug3298426

1130: item_availability_info.sr_inventory_item_id(l_item_cntr),
1131: org_availability_info.organization_id(l_process_org_cntr),
1132: l_item_attribute_rec);--bug3298426
1133:
1134: l_item_attribute_rec := MSC_ATP_PVT.G_ITEM_INFO_REC;--bug3298426
1135: -- store values
1136: org_availability_info.atp_flag(l_process_org_cntr) := l_item_attribute_rec.atp_flag;
1137: org_availability_info.atp_comp_flag(l_process_org_cntr) := l_item_attribute_rec.atp_comp_flag;
1138: org_availability_info.post_pro_lt(l_process_org_cntr) := l_item_attribute_rec.post_pro_lt;

Line 1186: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') THEN

1182: item_availability_info.unit_weight(l_item_cntr) := l_item_attribute_rec.unit_weight;
1183:
1184: END IF;
1185: ---alloc
1186: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') THEN
1187: /* To support new logic for dependent demands allocation in time phased PF rule based AATP scenarios
1188: Making changes to support new allocation logic for time_phased_atp changes too that were missed
1189: out earlier as part of this exercise*/
1190: IF org_availability_info.atf_date(l_process_org_cntr) is not null THEN

Line 1210: IF MSC_ATP_PVT.G_MEM_RULE_WITHIN_ATF = 'Y' THEN

1206: RAISE FND_API.G_EXC_ERROR;
1207: END IF;
1208:
1209: IF l_requested_ship_date <= org_availability_info.atf_date(l_process_org_cntr) THEN
1210: IF MSC_ATP_PVT.G_MEM_RULE_WITHIN_ATF = 'Y' THEN
1211: l_item_to_use := item_availability_info.inventory_item_id(l_item_cntr);
1212: ELSE
1213: --bug3467631 family_dest_id is item-org attribute
1214: --l_item_to_use := item_availability_info.family_dest_id(l_item_cntr);

Line 1218: IF MSC_ATP_PVT.G_PF_RULE_OUTSIDE_ATF = 'Y' THEN

1214: --l_item_to_use := item_availability_info.family_dest_id(l_item_cntr);
1215: l_item_to_use := org_availability_info.family_dest_id(l_process_org_cntr);
1216: END IF;
1217: ELSE
1218: IF MSC_ATP_PVT.G_PF_RULE_OUTSIDE_ATF = 'Y' THEN
1219: --bug3467631 family_dest_id is item-org attribute
1220: --l_item_to_use := item_availability_info.family_dest_id(l_item_cntr);
1221: l_item_to_use := org_availability_info.family_dest_id(l_process_org_cntr);
1222: ELSE

Line 1237: MSC_AATP_FUNC.Get_Hierarchy_Demand_Class(MSC_ATP_PVT.G_PARTNER_ID,

1233: /* New allocation logic for time_phased_atp changes end */
1234:
1235: --- get the demand class
1236: l_demand_class :=
1237: MSC_AATP_FUNC.Get_Hierarchy_Demand_Class(MSC_ATP_PVT.G_PARTNER_ID,
1238: MSC_ATP_PVT.G_PARTNER_SITE_ID,
1239: l_item_to_use,
1240: org_availability_info.organization_id(l_process_org_cntr),
1241: p_atp_record.instance_id,

Line 1238: MSC_ATP_PVT.G_PARTNER_SITE_ID,

1234:
1235: --- get the demand class
1236: l_demand_class :=
1237: MSC_AATP_FUNC.Get_Hierarchy_Demand_Class(MSC_ATP_PVT.G_PARTNER_ID,
1238: MSC_ATP_PVT.G_PARTNER_SITE_ID,
1239: l_item_to_use,
1240: org_availability_info.organization_id(l_process_org_cntr),
1241: p_atp_record.instance_id,
1242: l_requested_ship_date,

Line 1251: org_availability_info.allocation_rule(l_process_org_cntr) := MSC_ATP_PVT.G_ALLOCATION_RULE_NAME;

1247: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'demand_class = '|| l_demand_class);
1248: END IF;
1249:
1250: org_availability_info.demand_class(l_process_org_cntr) := l_demand_class;
1251: org_availability_info.allocation_rule(l_process_org_cntr) := MSC_ATP_PVT.G_ALLOCATION_RULE_NAME;
1252:
1253: --- we store demand class for top org so that we can use it during CTP/ Forward search etc
1254: IF l_process_org_cntr = 1 THEN
1255: item_availability_info.demand_class(l_item_cntr) := l_demand_class;

Line 1457: IF MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y' and l_atp_flag in ('Y', 'C') and l_net_demand > 0 THEN

1453: l_atp_insert_rec.origination_type := 30;
1454:
1455: l_atp_insert_rec.demand_source_line := p_atp_record.demand_source_line;
1456:
1457: IF MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y' and l_atp_flag in ('Y', 'C') and l_net_demand > 0 THEN
1458: --- if we are doing allocated atp then we would need to do stealing
1459: --- In case of stealing we would need to put only demand for available quantity
1460: --- If we put ordered quantity then we would need to readjust this demand again
1461: ----Instea we just put how the available qty so that we do not need to re-adjust the demand

Line 1482: IF (NVL(MSC_ATP_PVT.G_PLAN_INFO_REC.plan_type,1) <> 5) THEN --4686870

1478: ELSE
1479: -- dependent demand
1480: -- this is not the top level demand, which we should consider it
1481: -- as planned order demand
1482: IF (NVL(MSC_ATP_PVT.G_PLAN_INFO_REC.plan_type,1) <> 5) THEN --4686870
1483: l_atp_insert_rec.origination_type := 1;
1484: ELSE
1485: l_atp_insert_rec.origination_type := -200;
1486: END IF; --4686870

Line 1491: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP THEN

1487:
1488: l_atp_insert_rec.demand_source_line := null;
1489:
1490: -- dsting diag_atp
1491: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP THEN
1492: IF PG_DEBUG in ('Y', 'C') THEN
1493: msc_sch_wb.atp_debug('place full dmd: ' || l_net_demand);
1494: END IF;
1495: -- dsting 2754446

Line 1600: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND (l_atp_flag in ('Y', 'C')) and l_net_demand > 0 THEN

1596: msc_sch_wb.atp_debug('steal_qty: ' || org_availability_info.steal_qty(1));
1597: msc_sch_wb.atp_debug('net_dmd: ' || l_net_demand);
1598: END IF;
1599:
1600: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND (l_atp_flag in ('Y', 'C')) and l_net_demand > 0 THEN
1601:
1602: IF PG_DEBUG in ('Y', 'C') THEN
1603: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'we are in the setup for stealing');
1604: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand := ' || l_net_demand);

Line 1606: g_atp_record.error_code := MSC_ATP_PVT.ALLSUCCESS;

1602: IF PG_DEBUG in ('Y', 'C') THEN
1603: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'we are in the setup for stealing');
1604: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_net_demand := ' || l_net_demand);
1605: END IF;
1606: g_atp_record.error_code := MSC_ATP_PVT.ALLSUCCESS;
1607:
1608: -- time_phased_atp
1609: g_atp_record.inventory_item_id := org_availability_info.family_sr_id(l_process_org_cntr);
1610:

Line 1657: MSC_ATP_PVT.G_DEMAND_PEGGING_ID := org_availability_info.demand_pegging_id(1);

1653:
1654: -- 2754446
1655: l_stealing_requested_date_qty := g_atp_record.quantity_ordered;
1656: -- l_stealing_requested_date_qty := l_net_demand;
1657: MSC_ATP_PVT.G_DEMAND_PEGGING_ID := org_availability_info.demand_pegging_id(1);
1658:
1659: -- time_phased_atp
1660: g_atp_record.atf_date := org_availability_info.atf_date(l_process_org_cntr);
1661: l_post_stealing_dmd := g_atp_record.quantity_ordered; --bug3467631 change done

Line 1730: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP <> DIAGNOSTIC_ATP THEN

1726: to_char(l_net_demand));
1727: END IF;
1728:
1729: -- dsting diag_atp
1730: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP <> DIAGNOSTIC_ATP THEN
1731: --- now we update the demand
1732: IF l_process_org_cntr =1 THEN
1733: IF PG_DEBUG in ('Y', 'C') THEN
1734: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Top Org, update demand');

Line 1849: MSC_ATP_PVT.G_SESSION_ID,

1845: NULL,
1846: org_availability_info.assign_set_id(l_parent_org_cntr),
1847: l_item_sourcing_info_rec,
1848: --MRP_ATP_PUB.number_arr(NULL),
1849: MSC_ATP_PVT.G_SESSION_ID,
1850: l_sources,
1851: l_return_status);
1852: IF l_sources.source_type.count = 0 THEN
1853: org_availability_info.constraint_type(l_parent_org_cntr) := NOSOURCES_NONCONSTRAINT;

Line 1857: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP THEN

1853: org_availability_info.constraint_type(l_parent_org_cntr) := NOSOURCES_NONCONSTRAINT;
1854: END IF;
1855: ELSE
1856: l_sources := l_null_sources;
1857: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP THEN
1858: IF PG_DEBUG in ('Y', 'C') THEN
1859: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'constraint type: MATERIAL_CONSTRAINT');
1860: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'make_buy_code: ' || l_make_buy_cd);
1861: END IF;

Line 1880: IF l_sources.source_type(i) = MSC_ATP_PVT.TRANSFER THEN

1876: END IF;
1877:
1878: FOR i in 1..l_sources.organization_id.count LOOP
1879:
1880: IF l_sources.source_type(i) = MSC_ATP_PVT.TRANSFER THEN
1881:
1882: -- we only consider 'Transfer' type sources in this pass
1883:
1884: l_to_location_id := null;

Line 1906: IF l_sources.source_type(i) = MSC_ATP_PVT.TRANSFER THEN

1902: msc_sch_wb.atp_debug('* Receiving Org ID : '|| org_availability_info.organization_id(l_parent_org_cntr) );
1903: msc_sch_wb.atp_debug('* Ship Method : '|| l_sources.Ship_Method(i) );
1904: END IF;
1905:
1906: IF l_sources.source_type(i) = MSC_ATP_PVT.TRANSFER THEN
1907: -- receiving party is org
1908: l_receiving_cal_code := MSC_CALENDAR.Get_Calendar_Code(
1909: p_atp_record.instance_id,
1910: null,

Line 2164: ELSIF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP THEN

2160: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'PO Pegging id := ' || l_pegging_id);
2161: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Src Organization_id := ' || l_sources.organization_id(i));
2162: END IF;
2163: org_availability_info.PO_pegging_id(l_count) := l_pegging_id;
2164: ELSIF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP THEN
2165: l_transfer_found := 1;
2166:
2167: Prep_Common_pegging_rec(
2168: l_pegging_rec,

Line 2300: MSC_ATP_PVT.G_demand_pegging_id := org_availability_info.demand_pegging_id(1);

2296: IF PG_DEBUG in ('Y', 'C') THEN
2297: msc_sch_wb.atp_debug('lt or ptf constraint end_pegging_id: ' || org_availability_info.demand_pegging_id(1));
2298: END IF;
2299:
2300: MSC_ATP_PVT.G_demand_pegging_id := org_availability_info.demand_pegging_id(1);
2301: l_pegging_rec.organization_id :=
2302: org_availability_info.organization_id(l_parent_org_cntr);
2303: l_pegging_rec.organization_code := MSC_ATP_FUNC.get_org_code(
2304: p_atp_record.instance_id,

Line 2325: l_pegging_rec.source_type := MSC_ATP_PVT.TRANSFER;

2321:
2322: l_pegging_rec.supply_demand_quantity := 0;
2323: l_pegging_rec.supply_demand_type := 2; -- supply
2324: l_pegging_rec.supply_demand_date:= org_availability_info.requested_ship_date(l_parent_org_cntr);
2325: l_pegging_rec.source_type := MSC_ATP_PVT.TRANSFER;
2326:
2327: l_pegging_rec.atp_level := p_level+1;
2328: l_pegging_rec.scenario_id := p_scenario_id;
2329: l_pegging_rec.pegging_type := TRANSFER_PEG_TYP;

Line 2363: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP AND l_transfer_found <> 1 AND

2359: END IF;
2360:
2361: -- if this is diagnostic atp, and there are no transfer sources, and we cannot create
2362: -- a supply on the demanded item then flag it as a material constraint.
2363: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP AND l_transfer_found <> 1 AND
2364: l_create_supply_on_orig_item = 0
2365: THEN
2366: org_availability_info.constraint_type(l_parent_org_cntr) := MATERIAL_CONSTRAINT;
2367: END IF;

Line 2399: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP THEN

2395:
2396: -- dsting diag_atp
2397: -- I need to know the quantity from children in advance to balance supply/demand
2398: /* 2754446 I'm doing this in advance already
2399: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP THEN
2400: FOR j in reverse 2..org_availability_info.organization_id.count LOOP
2401: l_parent_index := org_availability_info.parent_org_idx(j);
2402: -- 2754446
2403: l_addt_qty := LEAST((GREATEST(org_availability_info.request_date_quantity(j), 0) +

Line 2469: p_atp_record.error_code := MSC_ATP_PVT.ATP_NOT_APPL;

2465: END IF;
2466:
2467: IF j = 1 THEN
2468: --- bug 2344501: set the error only if it is a top org
2469: p_atp_record.error_code := MSC_ATP_PVT.ATP_NOT_APPL;
2470: END IF;
2471:
2472: l_transaction_id := NULL;
2473: IF j > 1 AND (l_available_quantity > 0 OR MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP) THEN

Line 2473: IF j > 1 AND (l_available_quantity > 0 OR MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP) THEN

2469: p_atp_record.error_code := MSC_ATP_PVT.ATP_NOT_APPL;
2470: END IF;
2471:
2472: l_transaction_id := NULL;
2473: IF j > 1 AND (l_available_quantity > 0 OR MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP) THEN
2474:
2475: -- dsting diag_atp
2476: -- may need to adjust the PO for diagnostic atp
2477: -- IF l_available_quantity >0 THEN

Line 2487: IF (NVL(MSC_ATP_PVT.G_PLAN_INFO_REC.plan_type,1) = 5) THEN

2483: l_PO_qty := CEIL(ROUND(l_PO_qty,10));
2484: END IF;
2485:
2486: -- Begin ATP4drp Create Planned Arrivals for DRP plans
2487: IF (NVL(MSC_ATP_PVT.G_PLAN_INFO_REC.plan_type,1) = 5) THEN
2488: l_supply_rec.instance_id := p_atp_record.instance_id;
2489: l_supply_rec.plan_id := org_availability_info.plan_id(l_parent_index);
2490: l_supply_rec.inventory_item_id := org_availability_info.family_dest_id(l_parent_index);
2491: -- DRP Plan re-set to member For time_phased_atp

Line 2640: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP <> DIAGNOSTIC_ATP THEN

2636: msc_sch_wb.atp_debug('l_available_quantity: ' || l_available_quantity);
2637: END IF;
2638:
2639: -- dsting do not update demands for diagnostic atp
2640: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP <> DIAGNOSTIC_ATP THEN
2641:
2642: IF j > 1 AND l_available_quantity <= 0
2643: THEN
2644: --- if we do nto get anything from this org then we remove the demand

Line 2727: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP OR

2723: msc_sch_wb.atp_debug('dmd qty: ' || org_availability_info.demand_quantity(j));
2724: msc_sch_Wb.atp_debug('conv rate: ' || org_availability_info.conversion_rate(l_parent_index));
2725: END IF;
2726:
2727: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP OR
2728: (l_available_quantity > 0 or j =1)
2729: THEN
2730: --- now add demand pegging
2731: IF PG_DEBUG in ('Y', 'C') THEN

Line 2742: IF j =1 OR MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP THEN

2738: j,
2739: item_availability_info,
2740: l_item_cntr);
2741:
2742: IF j =1 OR MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP THEN
2743: --- if it is top org then we add complete quantity
2744: -- dsting or if we're doing diagnostic atp
2745: -- dsting 2754446
2746: l_pegging_rec.supply_demand_quantity:= org_availability_info.demand_quantity(j);

Line 2796: IF j > 1 and (l_available_quantity > 0 or MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP) THEN

2792: IF PG_DEBUG in ('Y', 'C') THEN
2793: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'after adding Supply and Demand Pegging');
2794: END IF;
2795: --- now add planned order
2796: IF j > 1 and (l_available_quantity > 0 or MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP) THEN
2797: --- we create planned order for tier 2 orgs only
2798: -- we create the planned order in parent org
2799: IF PG_DEBUG in ('Y', 'C') THEN
2800: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_available_quantity > 0 or Diagnostic ATP');

Line 2815: ) AND MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP

2811: IF ((j = org_availability_info.parent_org_idx.count OR
2812: org_availability_info.parent_org_idx(j+1) <>
2813: org_availability_info.parent_org_idx(j)) AND
2814: NOT (l_parent_index = 1 and l_create_supply_on_orig_item = 1)
2815: ) AND MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP
2816: THEN
2817: -- dsting 2754446
2818: l_diag_supply_qty := (org_availability_info.demand_quantity(l_parent_index) -
2819: NVL(org_availability_info.quantity_from_children(l_parent_index), 0) -

Line 2851: IF (NVL(MSC_ATP_PVT.G_PLAN_INFO_REC.plan_type,1) = 5) THEN

2847: OR MSC_ATP_SUBST.G_TOP_LAST_PO_PEGGING = org_availability_info.PO_Pegging_id(j)
2848: THEN
2849:
2850: -- Begin ATP4drp Create Planned Arrivals for DRP plans
2851: IF (NVL(MSC_ATP_PVT.G_PLAN_INFO_REC.plan_type,1) = 5) THEN
2852: l_supply_rec.instance_id := p_atp_record.instance_id;
2853: l_supply_rec.plan_id := org_availability_info.plan_id(l_parent_index);
2854: l_supply_rec.inventory_item_id := org_availability_info.family_dest_id(l_parent_index);
2855: -- DRP Plan re-set to member For time_phased_atp

Line 2950: MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP

2946: -- dsting open a planned order supply in the org to balance the
2947: -- demand if it is not a constraint node and its demand is greater than the supply
2948: IF org_availability_info.constraint_type(j) = NOSOURCES_NONCONSTRAINT AND
2949: org_availability_info.demand_quantity(j) > l_available_quantity AND
2950: MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP
2951: THEN
2952:
2953: IF PG_DEBUG in ('Y', 'C') THEN
2954: msc_sch_wb.atp_debug('balance supply/demand for nonconstrained node');

Line 2957: IF (NVL(MSC_ATP_PVT.G_PLAN_INFO_REC.plan_type,1) = 5) THEN

2953: IF PG_DEBUG in ('Y', 'C') THEN
2954: msc_sch_wb.atp_debug('balance supply/demand for nonconstrained node');
2955: END IF;
2956: -- Begin ATP4drp Create Planned Arrivals for DRP plans
2957: IF (NVL(MSC_ATP_PVT.G_PLAN_INFO_REC.plan_type,1) = 5) THEN
2958: l_supply_rec.instance_id := p_atp_record.instance_id;
2959: l_supply_rec.plan_id := org_availability_info.plan_id(l_parent_index);
2960: l_supply_rec.inventory_item_id := org_availability_info.family_dest_id(l_parent_index);
2961: -- DRP Plan re-set to member For time_phased_atp

Line 3080: IF j > 1 AND MSC_ATP_PVT.G_DIAGNOSTIC_ATP <> DIAGNOSTIC_ATP THEN

3076:
3077:
3078: /* --- now set the quantity from children
3079: -- dsting I already got it for diagnostic atp
3080: IF j > 1 AND MSC_ATP_PVT.G_DIAGNOSTIC_ATP <> DIAGNOSTIC_ATP THEN
3081: l_PO_qty := org_availability_info.real_dmd_qty(j)
3082: * org_availability_info.conversion_rate(l_parent_index)
3083: / org_availability_info.conversion_rate(j);
3084:

Line 3202: MSC_ATP_PVT.G_DEMAND_PEGGING_ID := item_availability_info.End_pegging_id(l_item_cntr);

3198: -- time_phased_atp changes end
3199:
3200: --p_atp_record.End_pegging_id := item_availability_info.End_pegging_id(l_item_cntr);
3201: --- this variable is populated in end_peggign id for this line in procedure schedule
3202: MSC_ATP_PVT.G_DEMAND_PEGGING_ID := item_availability_info.End_pegging_id(l_item_cntr);
3203: l_demand_pegging_id := item_availability_info.End_pegging_id(l_item_cntr);
3204:
3205: p_atp_record.requested_date_quantity := item_availability_info.request_date_quantity(l_item_cntr);
3206: p_atp_record.available_quantity := item_availability_info.request_date_quantity(l_item_cntr);

Line 3266: MSC_ATP_PVT.UNDO,

3262: MSC_ATP_DB_UTILS.Remove_Invalid_SD_Rec(
3263: item_availability_info.End_pegging_id(i),
3264: null,
3265: item_availability_info.plan_id(i),
3266: MSC_ATP_PVT.UNDO,
3267: null,
3268: l_return_status);
3269: END IF;
3270: END LOOP;

Line 3393: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP THEN

3389: ELSE
3390: l_insert_flag := p_atp_record.insert_flag;
3391: END IF;
3392:
3393: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP THEN
3394: MSC_ATP_PVT.G_DEMAND_PEGGING_ID := item_availability_info.end_pegging_id(1);
3395: END IF;
3396:
3397: FOR i in reverse 1..l_item_ctp_info.inventory_item_id.count LOOP

Line 3394: MSC_ATP_PVT.G_DEMAND_PEGGING_ID := item_availability_info.end_pegging_id(1);

3390: l_insert_flag := p_atp_record.insert_flag;
3391: END IF;
3392:
3393: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP THEN
3394: MSC_ATP_PVT.G_DEMAND_PEGGING_ID := item_availability_info.end_pegging_id(1);
3395: END IF;
3396:
3397: FOR i in reverse 1..l_item_ctp_info.inventory_item_id.count LOOP
3398:

Line 3424: l_atp_rec.identifier := MSC_ATP_PVT.G_ORDER_LINE_ID;

3420: -- no need to do uom conversion
3421: l_atp_rec.instance_id := p_atp_record.instance_id;
3422: -- what do we need to do with thie ???
3423: l_atp_rec.demand_source_line := null;
3424: l_atp_rec.identifier := MSC_ATP_PVT.G_ORDER_LINE_ID;
3425: l_atp_rec.component_identifier := null ; --l_comp_requirements.component_identifier(j);
3426:
3427: -- time_phased_atp bug3467631
3428: l_atp_rec.inventory_item_id := l_item_ctp_info.family_sr_id(i);

Line 3469: MSC_ATP_PVT.G_DEMAND_PEGGING_ID := l_item_ctp_info.end_pegging_id(i);

3465:
3466: l_atp_rec.original_item_flag := 1;
3467: l_atp_rec.top_tier_org_flag := 1;
3468: l_atp_rec.delivery_lead_time := 0;
3469: MSC_ATP_PVT.G_DEMAND_PEGGING_ID := l_item_ctp_info.end_pegging_id(i);
3470: --diag_atp
3471: l_atp_rec.plan_name := l_item_ctp_info.plan_name(i);
3472:
3473: -- dsting diag_atp

Line 3474: MSC_ATP_PVT.G_HAVE_MAKE_BUY_PARENT := 0;

3470: --diag_atp
3471: l_atp_rec.plan_name := l_item_ctp_info.plan_name(i);
3472:
3473: -- dsting diag_atp
3474: MSC_ATP_PVT.G_HAVE_MAKE_BUY_PARENT := 0;
3475:
3476: -- bug3467631 done for ship_rec_cal
3477: l_atp_rec.shipping_cal_code := p_atp_record.shipping_cal_code;
3478: l_atp_rec.receiving_cal_code := p_atp_record.receiving_cal_code;

Line 3482: MSC_ATP_PVT.ATP_Check(l_atp_rec,

3478: l_atp_rec.receiving_cal_code := p_atp_record.receiving_cal_code;
3479: l_atp_rec.intransit_cal_code := p_atp_record.intransit_cal_code;
3480: l_atp_rec.manufacturing_cal_code := p_atp_record.manufacturing_cal_code;
3481:
3482: MSC_ATP_PVT.ATP_Check(l_atp_rec,
3483: l_plan_id,
3484: p_level ,
3485: p_scenario_id,
3486: 1,

Line 3625: MSC_ATP_PVT.G_DEMAND_PEGGING_ID := l_item_ctp_info.End_pegging_id(i);

3621: END IF;
3622: -- time_phased_atp changes end
3623: --p_atp_record.End_pegging_id := item_availability_info.End_pegging_id(l_item_cntr);
3624: --- this variable is populated in end_peggign id for this line in procedure schedule
3625: MSC_ATP_PVT.G_DEMAND_PEGGING_ID := l_item_ctp_info.End_pegging_id(i);
3626: l_demand_pegging_id := l_item_ctp_info.End_pegging_id(i);
3627:
3628: IF NVL(p_atp_record.atp_lead_time, 0) > 0 THEN
3629: /* ship_rec_cal

Line 3689: MSC_ATP_PVT.UNDO,

3685: MSC_ATP_DB_UTILS.Remove_Invalid_SD_Rec(
3686: item_availability_info.End_pegging_id(j),
3687: null,
3688: item_availability_info.plan_id(j),
3689: MSC_ATP_PVT.UNDO,
3690: null,
3691: l_return_status);
3692:
3693: END IF; -- IF item_availability_info.inventory_item_id(j) <> l_item_ctp_info.inventory

Line 3703: MSC_ATP_PVT.G_DEMAND_PEGGING_ID := l_demand_pegging_id;

3699: -- now we have found enough quantity for ordered item as well so we will update the columns
3700: IF PG_DEBUG in ('Y', 'C') THEN
3701: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'demand met by a subst, provide detail for origninal item');
3702: END IF;
3703: MSC_ATP_PVT.G_DEMAND_PEGGING_ID := l_demand_pegging_id;
3704: p_atp_record.req_item_req_date_qty := p_atp_record.quantity_ordered;
3705:
3706: IF NVL(p_atp_record.atp_lead_time, 0) > 0 THEN
3707: /* ship_rec_cal

Line 3749: MSC_ATP_PVT.UNDO,

3745: MSC_ATP_DB_UTILS.Remove_Invalid_SD_Rec(
3746: item_availability_info.End_pegging_id(l_item_count),
3747: null,
3748: item_availability_info.plan_id(l_item_count),
3749: MSC_ATP_PVT.UNDO,
3750: null,
3751: l_return_status);
3752: END IF;
3753:

Line 3813: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP THEN

3809: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'p_atp_record.inventory_item_name: ' || p_atp_record.inventory_item_name );
3810: END IF;
3811:
3812: -- dsting skip Forward scheduling for diagnostic ATP
3813: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP = DIAGNOSTIC_ATP THEN
3814: IF PG_DEBUG in ('Y', 'C') THEN
3815: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'no forward pass for diagnostic ATP');
3816: END IF;
3817:

Line 3938: MSC_ATP_PVT.G_TIME_PHASED_PF_ENABLED := 'Y';

3934: /* To support new logic for dependent demands allocation in time phased PF rule based AATP scenarios
3935: Set global variable. This is used in Get_Item_Demand_Alloc_Percent function*/
3936: IF item_availability_info.atf_date(i) is not null THEN
3937: /* Set global variable. This is used in Get_Item_Demand_Alloc_Percent function*/
3938: MSC_ATP_PVT.G_TIME_PHASED_PF_ENABLED := 'Y';
3939: ELSE
3940: MSC_ATP_PVT.G_TIME_PHASED_PF_ENABLED := 'N';
3941: END IF;
3942:

Line 3940: MSC_ATP_PVT.G_TIME_PHASED_PF_ENABLED := 'N';

3936: IF item_availability_info.atf_date(i) is not null THEN
3937: /* Set global variable. This is used in Get_Item_Demand_Alloc_Percent function*/
3938: MSC_ATP_PVT.G_TIME_PHASED_PF_ENABLED := 'Y';
3939: ELSE
3940: MSC_ATP_PVT.G_TIME_PHASED_PF_ENABLED := 'N';
3941: END IF;
3942:
3943: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
3944: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND

Line 3943: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND

3939: ELSE
3940: MSC_ATP_PVT.G_TIME_PHASED_PF_ENABLED := 'N';
3941: END IF;
3942:
3943: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
3944: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
3945: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1) THEN
3946:
3947: IF PG_DEBUG in ('Y', 'C') THEN

Line 3944: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND

3940: MSC_ATP_PVT.G_TIME_PHASED_PF_ENABLED := 'N';
3941: END IF;
3942:
3943: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
3944: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
3945: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1) THEN
3946:
3947: IF PG_DEBUG in ('Y', 'C') THEN
3948: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Allocated ATP with demand priority');

Line 3945: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1) THEN

3941: END IF;
3942:
3943: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
3944: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
3945: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1) THEN
3946:
3947: IF PG_DEBUG in ('Y', 'C') THEN
3948: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Allocated ATP with demand priority');
3949: END IF;

Line 3951: MSC_ATP_PVT.G_DEMAND_PEGGING_ID := item_availability_info.end_pegging_id(i);

3947: IF PG_DEBUG in ('Y', 'C') THEN
3948: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Allocated ATP with demand priority');
3949: END IF;
3950: ---forward steal
3951: MSC_ATP_PVT.G_DEMAND_PEGGING_ID := item_availability_info.end_pegging_id(i);
3952:
3953: -- dsting setting global item_attributes so get_forward_material_atp populates the
3954: -- item attributes in pegging. Since G_ITEM_INFO_REC may not be the
3955: -- item we are processing (ie a substitute)

Line 3956: MSC_ATP_PVT.G_ITEM_INFO_REC.product_family_id := item_availability_info.family_dest_id(i); --bug3467631

3952:
3953: -- dsting setting global item_attributes so get_forward_material_atp populates the
3954: -- item attributes in pegging. Since G_ITEM_INFO_REC may not be the
3955: -- item we are processing (ie a substitute)
3956: MSC_ATP_PVT.G_ITEM_INFO_REC.product_family_id := item_availability_info.family_dest_id(i); --bug3467631
3957: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_flag := item_availability_info.atp_flag(i);
3958: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_comp_flag := item_availability_info.atp_comp_flag(i);
3959: MSC_ATP_PVT.G_ITEM_INFO_REC.pre_pro_lt := item_availability_info.pre_pro_lt(i);
3960: MSC_ATP_PVT.G_ITEM_INFO_REC.post_pro_lt := item_availability_info.post_pro_lt(i);

Line 3957: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_flag := item_availability_info.atp_flag(i);

3953: -- dsting setting global item_attributes so get_forward_material_atp populates the
3954: -- item attributes in pegging. Since G_ITEM_INFO_REC may not be the
3955: -- item we are processing (ie a substitute)
3956: MSC_ATP_PVT.G_ITEM_INFO_REC.product_family_id := item_availability_info.family_dest_id(i); --bug3467631
3957: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_flag := item_availability_info.atp_flag(i);
3958: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_comp_flag := item_availability_info.atp_comp_flag(i);
3959: MSC_ATP_PVT.G_ITEM_INFO_REC.pre_pro_lt := item_availability_info.pre_pro_lt(i);
3960: MSC_ATP_PVT.G_ITEM_INFO_REC.post_pro_lt := item_availability_info.post_pro_lt(i);
3961: MSC_ATP_PVT.G_ITEM_INFO_REC.fixed_lt := item_availability_info.fixed_lt(i);

Line 3958: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_comp_flag := item_availability_info.atp_comp_flag(i);

3954: -- item attributes in pegging. Since G_ITEM_INFO_REC may not be the
3955: -- item we are processing (ie a substitute)
3956: MSC_ATP_PVT.G_ITEM_INFO_REC.product_family_id := item_availability_info.family_dest_id(i); --bug3467631
3957: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_flag := item_availability_info.atp_flag(i);
3958: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_comp_flag := item_availability_info.atp_comp_flag(i);
3959: MSC_ATP_PVT.G_ITEM_INFO_REC.pre_pro_lt := item_availability_info.pre_pro_lt(i);
3960: MSC_ATP_PVT.G_ITEM_INFO_REC.post_pro_lt := item_availability_info.post_pro_lt(i);
3961: MSC_ATP_PVT.G_ITEM_INFO_REC.fixed_lt := item_availability_info.fixed_lt(i);
3962: MSC_ATP_PVT.G_ITEM_INFO_REC.variable_lt := item_availability_info.variable_lt(i);

Line 3959: MSC_ATP_PVT.G_ITEM_INFO_REC.pre_pro_lt := item_availability_info.pre_pro_lt(i);

3955: -- item we are processing (ie a substitute)
3956: MSC_ATP_PVT.G_ITEM_INFO_REC.product_family_id := item_availability_info.family_dest_id(i); --bug3467631
3957: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_flag := item_availability_info.atp_flag(i);
3958: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_comp_flag := item_availability_info.atp_comp_flag(i);
3959: MSC_ATP_PVT.G_ITEM_INFO_REC.pre_pro_lt := item_availability_info.pre_pro_lt(i);
3960: MSC_ATP_PVT.G_ITEM_INFO_REC.post_pro_lt := item_availability_info.post_pro_lt(i);
3961: MSC_ATP_PVT.G_ITEM_INFO_REC.fixed_lt := item_availability_info.fixed_lt(i);
3962: MSC_ATP_PVT.G_ITEM_INFO_REC.variable_lt := item_availability_info.variable_lt(i);
3963: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_weight := item_availability_info.unit_weight(i);

Line 3960: MSC_ATP_PVT.G_ITEM_INFO_REC.post_pro_lt := item_availability_info.post_pro_lt(i);

3956: MSC_ATP_PVT.G_ITEM_INFO_REC.product_family_id := item_availability_info.family_dest_id(i); --bug3467631
3957: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_flag := item_availability_info.atp_flag(i);
3958: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_comp_flag := item_availability_info.atp_comp_flag(i);
3959: MSC_ATP_PVT.G_ITEM_INFO_REC.pre_pro_lt := item_availability_info.pre_pro_lt(i);
3960: MSC_ATP_PVT.G_ITEM_INFO_REC.post_pro_lt := item_availability_info.post_pro_lt(i);
3961: MSC_ATP_PVT.G_ITEM_INFO_REC.fixed_lt := item_availability_info.fixed_lt(i);
3962: MSC_ATP_PVT.G_ITEM_INFO_REC.variable_lt := item_availability_info.variable_lt(i);
3963: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_weight := item_availability_info.unit_weight(i);
3964: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_volume := item_availability_info.unit_volume(i);

Line 3961: MSC_ATP_PVT.G_ITEM_INFO_REC.fixed_lt := item_availability_info.fixed_lt(i);

3957: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_flag := item_availability_info.atp_flag(i);
3958: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_comp_flag := item_availability_info.atp_comp_flag(i);
3959: MSC_ATP_PVT.G_ITEM_INFO_REC.pre_pro_lt := item_availability_info.pre_pro_lt(i);
3960: MSC_ATP_PVT.G_ITEM_INFO_REC.post_pro_lt := item_availability_info.post_pro_lt(i);
3961: MSC_ATP_PVT.G_ITEM_INFO_REC.fixed_lt := item_availability_info.fixed_lt(i);
3962: MSC_ATP_PVT.G_ITEM_INFO_REC.variable_lt := item_availability_info.variable_lt(i);
3963: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_weight := item_availability_info.unit_weight(i);
3964: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_volume := item_availability_info.unit_volume(i);
3965: MSC_ATP_PVT.G_ITEM_INFO_REC.weight_uom := item_availability_info.weight_uom(i);

Line 3962: MSC_ATP_PVT.G_ITEM_INFO_REC.variable_lt := item_availability_info.variable_lt(i);

3958: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_comp_flag := item_availability_info.atp_comp_flag(i);
3959: MSC_ATP_PVT.G_ITEM_INFO_REC.pre_pro_lt := item_availability_info.pre_pro_lt(i);
3960: MSC_ATP_PVT.G_ITEM_INFO_REC.post_pro_lt := item_availability_info.post_pro_lt(i);
3961: MSC_ATP_PVT.G_ITEM_INFO_REC.fixed_lt := item_availability_info.fixed_lt(i);
3962: MSC_ATP_PVT.G_ITEM_INFO_REC.variable_lt := item_availability_info.variable_lt(i);
3963: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_weight := item_availability_info.unit_weight(i);
3964: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_volume := item_availability_info.unit_volume(i);
3965: MSC_ATP_PVT.G_ITEM_INFO_REC.weight_uom := item_availability_info.weight_uom(i);
3966: MSC_ATP_PVT.G_ITEM_INFO_REC.volume_uom := item_availability_info.volume_uom(i);

Line 3963: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_weight := item_availability_info.unit_weight(i);

3959: MSC_ATP_PVT.G_ITEM_INFO_REC.pre_pro_lt := item_availability_info.pre_pro_lt(i);
3960: MSC_ATP_PVT.G_ITEM_INFO_REC.post_pro_lt := item_availability_info.post_pro_lt(i);
3961: MSC_ATP_PVT.G_ITEM_INFO_REC.fixed_lt := item_availability_info.fixed_lt(i);
3962: MSC_ATP_PVT.G_ITEM_INFO_REC.variable_lt := item_availability_info.variable_lt(i);
3963: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_weight := item_availability_info.unit_weight(i);
3964: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_volume := item_availability_info.unit_volume(i);
3965: MSC_ATP_PVT.G_ITEM_INFO_REC.weight_uom := item_availability_info.weight_uom(i);
3966: MSC_ATP_PVT.G_ITEM_INFO_REC.volume_uom := item_availability_info.volume_uom(i);
3967: MSC_ATP_PVT.G_ITEM_INFO_REC.substitution_window := item_availability_info.substitution_window(i);

Line 3964: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_volume := item_availability_info.unit_volume(i);

3960: MSC_ATP_PVT.G_ITEM_INFO_REC.post_pro_lt := item_availability_info.post_pro_lt(i);
3961: MSC_ATP_PVT.G_ITEM_INFO_REC.fixed_lt := item_availability_info.fixed_lt(i);
3962: MSC_ATP_PVT.G_ITEM_INFO_REC.variable_lt := item_availability_info.variable_lt(i);
3963: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_weight := item_availability_info.unit_weight(i);
3964: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_volume := item_availability_info.unit_volume(i);
3965: MSC_ATP_PVT.G_ITEM_INFO_REC.weight_uom := item_availability_info.weight_uom(i);
3966: MSC_ATP_PVT.G_ITEM_INFO_REC.volume_uom := item_availability_info.volume_uom(i);
3967: MSC_ATP_PVT.G_ITEM_INFO_REC.substitution_window := item_availability_info.substitution_window(i);
3968: MSC_ATP_PVT.G_ITEM_INFO_REC.organization_id := NULL;

Line 3965: MSC_ATP_PVT.G_ITEM_INFO_REC.weight_uom := item_availability_info.weight_uom(i);

3961: MSC_ATP_PVT.G_ITEM_INFO_REC.fixed_lt := item_availability_info.fixed_lt(i);
3962: MSC_ATP_PVT.G_ITEM_INFO_REC.variable_lt := item_availability_info.variable_lt(i);
3963: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_weight := item_availability_info.unit_weight(i);
3964: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_volume := item_availability_info.unit_volume(i);
3965: MSC_ATP_PVT.G_ITEM_INFO_REC.weight_uom := item_availability_info.weight_uom(i);
3966: MSC_ATP_PVT.G_ITEM_INFO_REC.volume_uom := item_availability_info.volume_uom(i);
3967: MSC_ATP_PVT.G_ITEM_INFO_REC.substitution_window := item_availability_info.substitution_window(i);
3968: MSC_ATP_PVT.G_ITEM_INFO_REC.organization_id := NULL;
3969:

Line 3966: MSC_ATP_PVT.G_ITEM_INFO_REC.volume_uom := item_availability_info.volume_uom(i);

3962: MSC_ATP_PVT.G_ITEM_INFO_REC.variable_lt := item_availability_info.variable_lt(i);
3963: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_weight := item_availability_info.unit_weight(i);
3964: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_volume := item_availability_info.unit_volume(i);
3965: MSC_ATP_PVT.G_ITEM_INFO_REC.weight_uom := item_availability_info.weight_uom(i);
3966: MSC_ATP_PVT.G_ITEM_INFO_REC.volume_uom := item_availability_info.volume_uom(i);
3967: MSC_ATP_PVT.G_ITEM_INFO_REC.substitution_window := item_availability_info.substitution_window(i);
3968: MSC_ATP_PVT.G_ITEM_INFO_REC.organization_id := NULL;
3969:
3970: MSC_AATP_REQ.Get_Forward_Material_Atp(

Line 3967: MSC_ATP_PVT.G_ITEM_INFO_REC.substitution_window := item_availability_info.substitution_window(i);

3963: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_weight := item_availability_info.unit_weight(i);
3964: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_volume := item_availability_info.unit_volume(i);
3965: MSC_ATP_PVT.G_ITEM_INFO_REC.weight_uom := item_availability_info.weight_uom(i);
3966: MSC_ATP_PVT.G_ITEM_INFO_REC.volume_uom := item_availability_info.volume_uom(i);
3967: MSC_ATP_PVT.G_ITEM_INFO_REC.substitution_window := item_availability_info.substitution_window(i);
3968: MSC_ATP_PVT.G_ITEM_INFO_REC.organization_id := NULL;
3969:
3970: MSC_AATP_REQ.Get_Forward_Material_Atp(
3971: p_atp_record.instance_id,

Line 3968: MSC_ATP_PVT.G_ITEM_INFO_REC.organization_id := NULL;

3964: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_volume := item_availability_info.unit_volume(i);
3965: MSC_ATP_PVT.G_ITEM_INFO_REC.weight_uom := item_availability_info.weight_uom(i);
3966: MSC_ATP_PVT.G_ITEM_INFO_REC.volume_uom := item_availability_info.volume_uom(i);
3967: MSC_ATP_PVT.G_ITEM_INFO_REC.substitution_window := item_availability_info.substitution_window(i);
3968: MSC_ATP_PVT.G_ITEM_INFO_REC.organization_id := NULL;
3969:
3970: MSC_AATP_REQ.Get_Forward_Material_Atp(
3971: p_atp_record.instance_id,
3972: item_availability_info.plan_id(i),

Line 4019: --bug3467631 Inside Forward Scheduling re-initializing MSC_ATP_PVT.G_ITEM_INFO_REC

4015: ELSE
4016: IF PG_DEBUG in ('Y', 'C') THEN
4017: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'ATP without demand priority allocated ATP');
4018: END IF;
4019: --bug3467631 Inside Forward Scheduling re-initializing MSC_ATP_PVT.G_ITEM_INFO_REC
4020: --otherwise it will have substitute's values even when we are processing member item.
4021: --bug3467631 start
4022: MSC_ATP_PVT.G_ITEM_INFO_REC.product_family_id := item_availability_info.family_dest_id(i);
4023: MSC_ATP_PVT.G_ITEM_INFO_REC.inventory_item_id := item_availability_info.inventory_item_id(i);

Line 4022: MSC_ATP_PVT.G_ITEM_INFO_REC.product_family_id := item_availability_info.family_dest_id(i);

4018: END IF;
4019: --bug3467631 Inside Forward Scheduling re-initializing MSC_ATP_PVT.G_ITEM_INFO_REC
4020: --otherwise it will have substitute's values even when we are processing member item.
4021: --bug3467631 start
4022: MSC_ATP_PVT.G_ITEM_INFO_REC.product_family_id := item_availability_info.family_dest_id(i);
4023: MSC_ATP_PVT.G_ITEM_INFO_REC.inventory_item_id := item_availability_info.inventory_item_id(i);
4024: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_flag := item_availability_info.atp_flag(i);
4025: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_comp_flag := item_availability_info.atp_comp_flag(i);
4026: MSC_ATP_PVT.G_ITEM_INFO_REC.pre_pro_lt := item_availability_info.pre_pro_lt(i);

Line 4023: MSC_ATP_PVT.G_ITEM_INFO_REC.inventory_item_id := item_availability_info.inventory_item_id(i);

4019: --bug3467631 Inside Forward Scheduling re-initializing MSC_ATP_PVT.G_ITEM_INFO_REC
4020: --otherwise it will have substitute's values even when we are processing member item.
4021: --bug3467631 start
4022: MSC_ATP_PVT.G_ITEM_INFO_REC.product_family_id := item_availability_info.family_dest_id(i);
4023: MSC_ATP_PVT.G_ITEM_INFO_REC.inventory_item_id := item_availability_info.inventory_item_id(i);
4024: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_flag := item_availability_info.atp_flag(i);
4025: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_comp_flag := item_availability_info.atp_comp_flag(i);
4026: MSC_ATP_PVT.G_ITEM_INFO_REC.pre_pro_lt := item_availability_info.pre_pro_lt(i);
4027: MSC_ATP_PVT.G_ITEM_INFO_REC.post_pro_lt := item_availability_info.post_pro_lt(i);

Line 4024: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_flag := item_availability_info.atp_flag(i);

4020: --otherwise it will have substitute's values even when we are processing member item.
4021: --bug3467631 start
4022: MSC_ATP_PVT.G_ITEM_INFO_REC.product_family_id := item_availability_info.family_dest_id(i);
4023: MSC_ATP_PVT.G_ITEM_INFO_REC.inventory_item_id := item_availability_info.inventory_item_id(i);
4024: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_flag := item_availability_info.atp_flag(i);
4025: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_comp_flag := item_availability_info.atp_comp_flag(i);
4026: MSC_ATP_PVT.G_ITEM_INFO_REC.pre_pro_lt := item_availability_info.pre_pro_lt(i);
4027: MSC_ATP_PVT.G_ITEM_INFO_REC.post_pro_lt := item_availability_info.post_pro_lt(i);
4028: MSC_ATP_PVT.G_ITEM_INFO_REC.fixed_lt := item_availability_info.fixed_lt(i);

Line 4025: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_comp_flag := item_availability_info.atp_comp_flag(i);

4021: --bug3467631 start
4022: MSC_ATP_PVT.G_ITEM_INFO_REC.product_family_id := item_availability_info.family_dest_id(i);
4023: MSC_ATP_PVT.G_ITEM_INFO_REC.inventory_item_id := item_availability_info.inventory_item_id(i);
4024: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_flag := item_availability_info.atp_flag(i);
4025: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_comp_flag := item_availability_info.atp_comp_flag(i);
4026: MSC_ATP_PVT.G_ITEM_INFO_REC.pre_pro_lt := item_availability_info.pre_pro_lt(i);
4027: MSC_ATP_PVT.G_ITEM_INFO_REC.post_pro_lt := item_availability_info.post_pro_lt(i);
4028: MSC_ATP_PVT.G_ITEM_INFO_REC.fixed_lt := item_availability_info.fixed_lt(i);
4029: MSC_ATP_PVT.G_ITEM_INFO_REC.variable_lt := item_availability_info.variable_lt(i);

Line 4026: MSC_ATP_PVT.G_ITEM_INFO_REC.pre_pro_lt := item_availability_info.pre_pro_lt(i);

4022: MSC_ATP_PVT.G_ITEM_INFO_REC.product_family_id := item_availability_info.family_dest_id(i);
4023: MSC_ATP_PVT.G_ITEM_INFO_REC.inventory_item_id := item_availability_info.inventory_item_id(i);
4024: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_flag := item_availability_info.atp_flag(i);
4025: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_comp_flag := item_availability_info.atp_comp_flag(i);
4026: MSC_ATP_PVT.G_ITEM_INFO_REC.pre_pro_lt := item_availability_info.pre_pro_lt(i);
4027: MSC_ATP_PVT.G_ITEM_INFO_REC.post_pro_lt := item_availability_info.post_pro_lt(i);
4028: MSC_ATP_PVT.G_ITEM_INFO_REC.fixed_lt := item_availability_info.fixed_lt(i);
4029: MSC_ATP_PVT.G_ITEM_INFO_REC.variable_lt := item_availability_info.variable_lt(i);
4030: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_weight := item_availability_info.unit_weight(i);

Line 4027: MSC_ATP_PVT.G_ITEM_INFO_REC.post_pro_lt := item_availability_info.post_pro_lt(i);

4023: MSC_ATP_PVT.G_ITEM_INFO_REC.inventory_item_id := item_availability_info.inventory_item_id(i);
4024: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_flag := item_availability_info.atp_flag(i);
4025: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_comp_flag := item_availability_info.atp_comp_flag(i);
4026: MSC_ATP_PVT.G_ITEM_INFO_REC.pre_pro_lt := item_availability_info.pre_pro_lt(i);
4027: MSC_ATP_PVT.G_ITEM_INFO_REC.post_pro_lt := item_availability_info.post_pro_lt(i);
4028: MSC_ATP_PVT.G_ITEM_INFO_REC.fixed_lt := item_availability_info.fixed_lt(i);
4029: MSC_ATP_PVT.G_ITEM_INFO_REC.variable_lt := item_availability_info.variable_lt(i);
4030: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_weight := item_availability_info.unit_weight(i);
4031: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_volume := item_availability_info.unit_volume(i);

Line 4028: MSC_ATP_PVT.G_ITEM_INFO_REC.fixed_lt := item_availability_info.fixed_lt(i);

4024: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_flag := item_availability_info.atp_flag(i);
4025: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_comp_flag := item_availability_info.atp_comp_flag(i);
4026: MSC_ATP_PVT.G_ITEM_INFO_REC.pre_pro_lt := item_availability_info.pre_pro_lt(i);
4027: MSC_ATP_PVT.G_ITEM_INFO_REC.post_pro_lt := item_availability_info.post_pro_lt(i);
4028: MSC_ATP_PVT.G_ITEM_INFO_REC.fixed_lt := item_availability_info.fixed_lt(i);
4029: MSC_ATP_PVT.G_ITEM_INFO_REC.variable_lt := item_availability_info.variable_lt(i);
4030: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_weight := item_availability_info.unit_weight(i);
4031: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_volume := item_availability_info.unit_volume(i);
4032: MSC_ATP_PVT.G_ITEM_INFO_REC.weight_uom := item_availability_info.weight_uom(i);

Line 4029: MSC_ATP_PVT.G_ITEM_INFO_REC.variable_lt := item_availability_info.variable_lt(i);

4025: MSC_ATP_PVT.G_ITEM_INFO_REC.atp_comp_flag := item_availability_info.atp_comp_flag(i);
4026: MSC_ATP_PVT.G_ITEM_INFO_REC.pre_pro_lt := item_availability_info.pre_pro_lt(i);
4027: MSC_ATP_PVT.G_ITEM_INFO_REC.post_pro_lt := item_availability_info.post_pro_lt(i);
4028: MSC_ATP_PVT.G_ITEM_INFO_REC.fixed_lt := item_availability_info.fixed_lt(i);
4029: MSC_ATP_PVT.G_ITEM_INFO_REC.variable_lt := item_availability_info.variable_lt(i);
4030: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_weight := item_availability_info.unit_weight(i);
4031: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_volume := item_availability_info.unit_volume(i);
4032: MSC_ATP_PVT.G_ITEM_INFO_REC.weight_uom := item_availability_info.weight_uom(i);
4033: MSC_ATP_PVT.G_ITEM_INFO_REC.volume_uom := item_availability_info.volume_uom(i);

Line 4030: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_weight := item_availability_info.unit_weight(i);

4026: MSC_ATP_PVT.G_ITEM_INFO_REC.pre_pro_lt := item_availability_info.pre_pro_lt(i);
4027: MSC_ATP_PVT.G_ITEM_INFO_REC.post_pro_lt := item_availability_info.post_pro_lt(i);
4028: MSC_ATP_PVT.G_ITEM_INFO_REC.fixed_lt := item_availability_info.fixed_lt(i);
4029: MSC_ATP_PVT.G_ITEM_INFO_REC.variable_lt := item_availability_info.variable_lt(i);
4030: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_weight := item_availability_info.unit_weight(i);
4031: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_volume := item_availability_info.unit_volume(i);
4032: MSC_ATP_PVT.G_ITEM_INFO_REC.weight_uom := item_availability_info.weight_uom(i);
4033: MSC_ATP_PVT.G_ITEM_INFO_REC.volume_uom := item_availability_info.volume_uom(i);
4034: MSC_ATP_PVT.G_ITEM_INFO_REC.substitution_window := item_availability_info.substitution_window(i);

Line 4031: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_volume := item_availability_info.unit_volume(i);

4027: MSC_ATP_PVT.G_ITEM_INFO_REC.post_pro_lt := item_availability_info.post_pro_lt(i);
4028: MSC_ATP_PVT.G_ITEM_INFO_REC.fixed_lt := item_availability_info.fixed_lt(i);
4029: MSC_ATP_PVT.G_ITEM_INFO_REC.variable_lt := item_availability_info.variable_lt(i);
4030: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_weight := item_availability_info.unit_weight(i);
4031: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_volume := item_availability_info.unit_volume(i);
4032: MSC_ATP_PVT.G_ITEM_INFO_REC.weight_uom := item_availability_info.weight_uom(i);
4033: MSC_ATP_PVT.G_ITEM_INFO_REC.volume_uom := item_availability_info.volume_uom(i);
4034: MSC_ATP_PVT.G_ITEM_INFO_REC.substitution_window := item_availability_info.substitution_window(i);
4035: --bug3467631 end

Line 4032: MSC_ATP_PVT.G_ITEM_INFO_REC.weight_uom := item_availability_info.weight_uom(i);

4028: MSC_ATP_PVT.G_ITEM_INFO_REC.fixed_lt := item_availability_info.fixed_lt(i);
4029: MSC_ATP_PVT.G_ITEM_INFO_REC.variable_lt := item_availability_info.variable_lt(i);
4030: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_weight := item_availability_info.unit_weight(i);
4031: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_volume := item_availability_info.unit_volume(i);
4032: MSC_ATP_PVT.G_ITEM_INFO_REC.weight_uom := item_availability_info.weight_uom(i);
4033: MSC_ATP_PVT.G_ITEM_INFO_REC.volume_uom := item_availability_info.volume_uom(i);
4034: MSC_ATP_PVT.G_ITEM_INFO_REC.substitution_window := item_availability_info.substitution_window(i);
4035: --bug3467631 end
4036: -- time_phased_atp changes begin

Line 4033: MSC_ATP_PVT.G_ITEM_INFO_REC.volume_uom := item_availability_info.volume_uom(i);

4029: MSC_ATP_PVT.G_ITEM_INFO_REC.variable_lt := item_availability_info.variable_lt(i);
4030: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_weight := item_availability_info.unit_weight(i);
4031: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_volume := item_availability_info.unit_volume(i);
4032: MSC_ATP_PVT.G_ITEM_INFO_REC.weight_uom := item_availability_info.weight_uom(i);
4033: MSC_ATP_PVT.G_ITEM_INFO_REC.volume_uom := item_availability_info.volume_uom(i);
4034: MSC_ATP_PVT.G_ITEM_INFO_REC.substitution_window := item_availability_info.substitution_window(i);
4035: --bug3467631 end
4036: -- time_phased_atp changes begin
4037: l_mat_atp_info_rec.instance_id := p_atp_record.instance_id;

Line 4034: MSC_ATP_PVT.G_ITEM_INFO_REC.substitution_window := item_availability_info.substitution_window(i);

4030: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_weight := item_availability_info.unit_weight(i);
4031: MSC_ATP_PVT.G_ITEM_INFO_REC.unit_volume := item_availability_info.unit_volume(i);
4032: MSC_ATP_PVT.G_ITEM_INFO_REC.weight_uom := item_availability_info.weight_uom(i);
4033: MSC_ATP_PVT.G_ITEM_INFO_REC.volume_uom := item_availability_info.volume_uom(i);
4034: MSC_ATP_PVT.G_ITEM_INFO_REC.substitution_window := item_availability_info.substitution_window(i);
4035: --bug3467631 end
4036: -- time_phased_atp changes begin
4037: l_mat_atp_info_rec.instance_id := p_atp_record.instance_id;
4038: l_mat_atp_info_rec.plan_id := item_availability_info.plan_id(i);

Line 4137: END IF; --- IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND

4133: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_date_this_level := ' || l_atp_date_this_level);
4134: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atp_date_quantity_this_level := ' || l_atp_date_quantity_this_level);
4135: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'l_atf_date_qty := ' || l_atf_date_qty); --bug3467631
4136: END IF;
4137: END IF; --- IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
4138: --bug3467631 start
4139: --added to set atf_date_quantity for item
4140: IF l_mat_atp_info_rec.requested_date > l_mat_atp_info_rec.atf_date THEN
4141: item_availability_info.atf_date_quantity(i) :=

Line 4158: MSC_ATP_PVT.INFINITE_NUMBER);--bug3467631

4154: -- time_phased_atp
4155: item_availability_info.used_available_quantity(i) :=
4156: LEAST(GREATEST(l_used_available_quantity, 0) +
4157: GREATEST(item_availability_info.request_date_quantity(i),0),
4158: MSC_ATP_PVT.INFINITE_NUMBER);--bug3467631
4159: IF PG_DEBUG in ('Y', 'C') THEN --bug3467631
4160: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.atf_date_quantity(i) := ' ||
4161: item_availability_info.atf_date_quantity(i)); --bug3467631
4162: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item_availability_info.used_available_quantity(i) := ' ||

Line 4238: l_atp_rec.identifier := MSC_ATP_PVT.G_ORDER_LINE_ID;

4234: -- no need to do uom conversion
4235: l_atp_rec.instance_id := p_atp_record.instance_id;
4236: -- what do we need to do with thie ???
4237: l_atp_rec.demand_source_line := null;
4238: l_atp_rec.identifier := MSC_ATP_PVT.G_ORDER_LINE_ID;
4239: --- what do we do with this??
4240: l_atp_rec.component_identifier := null; -- l_comp_requirements.component_identifier(j);
4241:
4242: -- time_phased_atp

Line 4274: MSC_ATP_PVT.G_DEMAND_PEGGING_ID := l_item_ctp_info.end_pegging_id(i);

4270:
4271: --diag_atp: pass the plan name so that if PO are created then plan_name is used for pegging
4272: l_atp_rec.plan_name := l_item_ctp_info.plan_name(i);
4273:
4274: MSC_ATP_PVT.G_DEMAND_PEGGING_ID := l_item_ctp_info.end_pegging_id(i);
4275: l_atp_rec.top_tier_org_flag := 1;
4276: l_atp_rec.original_item_flag := 1;
4277: -- bug3467631 done for ship_rec_cal
4278: l_atp_rec.shipping_cal_code := p_atp_record.shipping_cal_code;

Line 4282: MSC_ATP_PVT.ATP_Check(l_atp_rec,

4278: l_atp_rec.shipping_cal_code := p_atp_record.shipping_cal_code;
4279: l_atp_rec.receiving_cal_code := p_atp_record.receiving_cal_code;
4280: l_atp_rec.intransit_cal_code := p_atp_record.intransit_cal_code;
4281: l_atp_rec.manufacturing_cal_code := p_atp_record.manufacturing_cal_code;
4282: MSC_ATP_PVT.ATP_Check(l_atp_rec,
4283: l_plan_id,
4284: p_level ,
4285: p_scenario_id,
4286: 2, -- forward schedulling

Line 4341: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND

4337: item_availability_info.future_atp_date(l_item_idx) := l_atp_rec.ship_date;
4338: item_availability_info.atp_date_quantity(l_item_idx) :=
4339: l_atp_rec.available_quantity;
4340: ---- remove forward stealing pegging
4341: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
4342: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
4343: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1) THEN
4344:
4345: --- recreate forward pegging array

Line 4342: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND

4338: item_availability_info.atp_date_quantity(l_item_idx) :=
4339: l_atp_rec.available_quantity;
4340: ---- remove forward stealing pegging
4341: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
4342: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
4343: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1) THEN
4344:
4345: --- recreate forward pegging array
4346: l_atp_pegging_tab.delete;

Line 4343: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1) THEN

4339: l_atp_rec.available_quantity;
4340: ---- remove forward stealing pegging
4341: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
4342: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
4343: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1) THEN
4344:
4345: --- recreate forward pegging array
4346: l_atp_pegging_tab.delete;
4347: IF PG_DEBUG in ('Y', 'C') THEN

Line 4368: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'G_FUTURE_PEGGING_ID := ' || MSC_ATP_PVT.G_FUTURE_PEGGING_ID);

4364: --- going down is worse than date on this level.
4365: --- we remove pegging and supply demands
4366: IF PG_DEBUG in ('Y', 'C') THEN
4367: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Staying on this level is OK. We remove pegging for current level');
4368: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'G_FUTURE_PEGGING_ID := ' || MSC_ATP_PVT.G_FUTURE_PEGGING_ID);
4369: END IF;
4370: MSC_ATP_DB_UTILS.Remove_Invalid_SD_Rec(
4371: MSC_ATP_PVT.G_FUTURE_PEGGING_ID,
4372: null,

Line 4371: MSC_ATP_PVT.G_FUTURE_PEGGING_ID,

4367: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Staying on this level is OK. We remove pegging for current level');
4368: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'G_FUTURE_PEGGING_ID := ' || MSC_ATP_PVT.G_FUTURE_PEGGING_ID);
4369: END IF;
4370: MSC_ATP_DB_UTILS.Remove_Invalid_SD_Rec(
4371: MSC_ATP_PVT.G_FUTURE_PEGGING_ID,
4372: null,
4373: l_plan_id,
4374: MSC_ATP_PVT.UNDO,
4375: null,

Line 4374: MSC_ATP_PVT.UNDO,

4370: MSC_ATP_DB_UTILS.Remove_Invalid_SD_Rec(
4371: MSC_ATP_PVT.G_FUTURE_PEGGING_ID,
4372: null,
4373: l_plan_id,
4374: MSC_ATP_PVT.UNDO,
4375: null,
4376: l_return_status);
4377:
4378:

Line 4402: MSC_ATP_PVT.G_DEMAND_PEGGING_ID := l_demand_pegging_id;

4398:
4399: IF (l_org_item_detail_flag = 1 AND l_satisfied_by_subst_flag = 1) THEN
4400: -- demand has already beed satisfied by a substitute
4401: --- so we just add data for original item
4402: MSC_ATP_PVT.G_DEMAND_PEGGING_ID := l_demand_pegging_id;
4403: p_atp_record.request_item_id := item_availability_info.sr_inventory_item_id(l_item_count);
4404: p_atp_record.req_item_req_date_qty := item_availability_info.request_date_quantity(l_item_count);
4405:
4406: --p_atp_record.req_item_available_date := item_availability_info.future_atp_date(l_item_count);

Line 4432: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND

4428: --p_atp_record.request_item_name := item_availability_info.item_name(l_item_count); --bug3467631
4429: --p_atp_record.original_item_name := item_availability_info.item_name(l_item_count);
4430:
4431: ---- remove forward stealing pegging
4432: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
4433: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
4434: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1) AND
4435: item_availability_info.atp_flag(l_item_count) in ('Y', 'C') THEN
4436:

Line 4433: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND

4429: --p_atp_record.original_item_name := item_availability_info.item_name(l_item_count);
4430:
4431: ---- remove forward stealing pegging
4432: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
4433: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
4434: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1) AND
4435: item_availability_info.atp_flag(l_item_count) in ('Y', 'C') THEN
4436:
4437: --- recreate forward pegging array

Line 4434: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1) AND

4430:
4431: ---- remove forward stealing pegging
4432: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
4433: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
4434: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1) AND
4435: item_availability_info.atp_flag(l_item_count) in ('Y', 'C') THEN
4436:
4437: --- recreate forward pegging array
4438: l_atp_pegging_tab.delete;

Line 4460: MSC_ATP_PVT.UNDO,

4456: MSC_ATP_DB_UTILS.Remove_Invalid_SD_Rec(
4457: item_availability_info.End_pegging_id(l_item_count),
4458: null,
4459: item_availability_info.plan_id(l_item_count),
4460: MSC_ATP_PVT.UNDO,
4461: null,
4462: l_return_status);
4463:
4464: ELSE

Line 4518: MSC_ATP_PVT.G_DEMAND_PEGGING_ID := item_availability_info.end_pegging_id(l_item_idx);

4514: IF PG_DEBUG in ('Y', 'C') THEN
4515: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'p_atp_record.inventory_item_id := '|| p_atp_record.inventory_item_id);
4516: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'end_pegging_id := ' || item_availability_info.end_pegging_id(l_item_idx));
4517: END IF;
4518: MSC_ATP_PVT.G_DEMAND_PEGGING_ID := item_availability_info.end_pegging_id(l_item_idx);
4519:
4520: --- now populate the info for original item
4521: -- time_phased_atp
4522: --bug3709707 atf_date also populated so that correct atf date is returned to schedule

Line 4594: IF NOT((MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND

4590: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'item is non-atpable, dont do pegging');
4591: END IF;
4592: ELSE
4593: ---forward steal: demand has already been created, we dont want to create it again
4594: IF NOT((MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
4595: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
4596: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN
4597: IF PG_DEBUG in ('Y', 'C') THEN
4598: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add pegging and s/d details for SRS');

Line 4595: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND

4591: END IF;
4592: ELSE
4593: ---forward steal: demand has already been created, we dont want to create it again
4594: IF NOT((MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
4595: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
4596: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN
4597: IF PG_DEBUG in ('Y', 'C') THEN
4598: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add pegging and s/d details for SRS');
4599: END IF;

Line 4596: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN

4592: ELSE
4593: ---forward steal: demand has already been created, we dont want to create it again
4594: IF NOT((MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
4595: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
4596: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN
4597: IF PG_DEBUG in ('Y', 'C') THEN
4598: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add pegging and s/d details for SRS');
4599: END IF;
4600:

Line 4601: l_pegging_rec.session_id:= MSC_ATP_PVT.G_SESSION_ID;

4597: IF PG_DEBUG in ('Y', 'C') THEN
4598: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add pegging and s/d details for SRS');
4599: END IF;
4600:
4601: l_pegging_rec.session_id:= MSC_ATP_PVT.G_SESSION_ID;
4602: l_pegging_rec.order_line_id:= MSC_ATP_PVT.G_ORDER_LINE_ID;
4603: l_pegging_rec.parent_pegging_id:= item_availability_info.end_pegging_id(l_item_idx);
4604: l_pegging_rec.pegging_id := item_availability_info.future_supply_peg_id(l_item_idx);
4605: l_pegging_rec.end_pegging_id := item_availability_info.end_pegging_id(l_item_idx);

Line 4602: l_pegging_rec.order_line_id:= MSC_ATP_PVT.G_ORDER_LINE_ID;

4598: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Add pegging and s/d details for SRS');
4599: END IF;
4600:
4601: l_pegging_rec.session_id:= MSC_ATP_PVT.G_SESSION_ID;
4602: l_pegging_rec.order_line_id:= MSC_ATP_PVT.G_ORDER_LINE_ID;
4603: l_pegging_rec.parent_pegging_id:= item_availability_info.end_pegging_id(l_item_idx);
4604: l_pegging_rec.pegging_id := item_availability_info.future_supply_peg_id(l_item_idx);
4605: l_pegging_rec.end_pegging_id := item_availability_info.end_pegging_id(l_item_idx);
4606: l_pegging_rec.atp_level:= p_level + 1;

Line 4644: l_pegging_rec.supply_demand_source_type:= MSC_ATP_PVT.ATP;

4640: l_pegging_rec.supplier_name := NULL;
4641: l_pegging_rec.supplier_site_id := NULL;
4642: l_pegging_rec.supplier_site_name := NULL;
4643: l_pegging_rec.scenario_id:= p_scenario_id;
4644: l_pegging_rec.supply_demand_source_type:= MSC_ATP_PVT.ATP;
4645: l_pegging_rec.supply_demand_quantity:= item_availability_info.atp_date_quantity(l_item_idx);
4646: l_pegging_rec.supply_demand_date:= item_availability_info.future_atp_date(l_item_idx);
4647: l_pegging_rec.supply_demand_type:= 2;
4648: l_pegging_rec.source_type := 0;

Line 4650: NVL(p_atp_record.component_identifier, MSC_ATP_PVT.G_COMP_LINE_ID);

4646: l_pegging_rec.supply_demand_date:= item_availability_info.future_atp_date(l_item_idx);
4647: l_pegging_rec.supply_demand_type:= 2;
4648: l_pegging_rec.source_type := 0;
4649: l_pegging_rec.component_identifier :=
4650: NVL(p_atp_record.component_identifier, MSC_ATP_PVT.G_COMP_LINE_ID);
4651:
4652: l_pegging_rec.constraint_flag := 'N';
4653:
4654:

Line 4655: l_pegging_rec.summary_flag := MSC_ATP_PVT.G_SUMMARY_FLAG;

4651:
4652: l_pegging_rec.constraint_flag := 'N';
4653:
4654:
4655: l_pegging_rec.summary_flag := MSC_ATP_PVT.G_SUMMARY_FLAG;
4656: l_pegging_rec.request_item_id := p_atp_record.request_item_id;
4657:
4658: MSC_ATP_SUBST.add_pegging(l_pegging_rec);
4659: IF PG_DEBUG in ('Y', 'C') THEN

Line 4672: END IF; -- IF NOT((MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND

4668: x_atp_period,
4669: x_atp_supply_demand,
4670: l_return_status);
4671: END IF;
4672: END IF; -- IF NOT((MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
4673: END IF;
4674: --- now delete pegging and supply demand info
4675: IF PG_DEBUG in ('Y', 'C') THEN
4676: msc_Sch_wb.atp_debug('ATP_Check_Subst: ' || 'Remove pegging and supply demand details for all items');

Line 4697: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND

4693: msc_sch_wb.atp_debug('ATP_Check_Subst: ' || 'Remove Pegging for item := '
4694: || item_availability_info.inventory_item_id(j));
4695: END IF;
4696: ---- remove forward stealing pegging
4697: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
4698: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
4699: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1) AND
4700: (item_availability_info.atp_flag(j) in ('Y', 'C')) THEN
4701:

Line 4698: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND

4694: || item_availability_info.inventory_item_id(j));
4695: END IF;
4696: ---- remove forward stealing pegging
4697: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
4698: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
4699: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1) AND
4700: (item_availability_info.atp_flag(j) in ('Y', 'C')) THEN
4701:
4702: --- recreate forward pegging array

Line 4699: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1) AND

4695: END IF;
4696: ---- remove forward stealing pegging
4697: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
4698: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
4699: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1) AND
4700: (item_availability_info.atp_flag(j) in ('Y', 'C')) THEN
4701:
4702: --- recreate forward pegging array
4703: l_atp_pegging_tab.delete;

Line 4724: MSC_ATP_PVT.UNDO,

4720: MSC_ATP_DB_UTILS.Remove_Invalid_SD_Rec(
4721: item_availability_info.End_pegging_id(j),
4722: null,
4723: item_availability_info.plan_id(j),
4724: MSC_ATP_PVT.UNDO,
4725: null,
4726: l_return_status);
4727:
4728: END IF; -- IF item_availability_info.inventory_item_id(j) <> l_item_ctp_info.inventory

Line 4741: p_atp_record.error_code := MSC_ATP_PVT.ATP_NOT_APPL;

4737: IF ((NVL(l_org_item_detail_flag, -1) <>1 OR NVL(l_satisfied_by_subst_flag,-1) <> 1)) THEN
4738:
4739: IF item_availability_info.atp_flag(l_item_idx) = 'N'
4740: and item_availability_info.atp_comp_flag(l_item_idx) = 'N' THEN
4741: p_atp_record.error_code := MSC_ATP_PVT.ATP_NOT_APPL;
4742: --- if item we used to satify the demand is non-atpable then we want to show thate error
4743: -- we will come here only if date is apps due
4744: ELSE
4745: IF PG_DEBUG in ('Y', 'C') THEN

Line 4749: p_atp_record.error_code := MSC_ATP_PVT.ATP_REQ_DATE_FAIL;

4745: IF PG_DEBUG in ('Y', 'C') THEN
4746: msc_Sch_wb.atp_debug('ATP_Check_Subst: ' || 'Set error code');
4747: END IF;
4748: IF p_atp_record.ship_date is not NULL THEN
4749: p_atp_record.error_code := MSC_ATP_PVT.ATP_REQ_DATE_FAIL;
4750:
4751: ELSE
4752: p_atp_record.error_code := MSC_ATP_PVT.ATP_REQ_QTY_FAIL;
4753: END IF;

Line 4752: p_atp_record.error_code := MSC_ATP_PVT.ATP_REQ_QTY_FAIL;

4748: IF p_atp_record.ship_date is not NULL THEN
4749: p_atp_record.error_code := MSC_ATP_PVT.ATP_REQ_DATE_FAIL;
4750:
4751: ELSE
4752: p_atp_record.error_code := MSC_ATP_PVT.ATP_REQ_QTY_FAIL;
4753: END IF;
4754: END IF;
4755: END IF;
4756:

Line 4763: WHEN MSC_ATP_PVT.NO_MATCHING_DATE_IN_CAL THEN --bug3583705

4759: null;
4760: END IF ; --- if l_substitution_type = ALL_OR_NOTHING THEN
4761: EXCEPTION
4762:
4763: WHEN MSC_ATP_PVT.NO_MATCHING_DATE_IN_CAL THEN --bug3583705
4764: IF PG_DEBUG in ('Y', 'C') THEN
4765: msc_sch_wb.atp_debug('MAtching cal date not found, in atp_check_subs');
4766: END IF;
4767: p_atp_record.error_code := MSC_ATP_PVT.NO_MATCHING_CAL_DATE;

Line 4767: p_atp_record.error_code := MSC_ATP_PVT.NO_MATCHING_CAL_DATE;

4763: WHEN MSC_ATP_PVT.NO_MATCHING_DATE_IN_CAL THEN --bug3583705
4764: IF PG_DEBUG in ('Y', 'C') THEN
4765: msc_sch_wb.atp_debug('MAtching cal date not found, in atp_check_subs');
4766: END IF;
4767: p_atp_record.error_code := MSC_ATP_PVT.NO_MATCHING_CAL_DATE;
4768: RAISE MSC_ATP_PVT.NO_MATCHING_DATE_IN_CAL;
4769:
4770: WHEN OTHERS THEN
4771: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;

Line 4768: RAISE MSC_ATP_PVT.NO_MATCHING_DATE_IN_CAL;

4764: IF PG_DEBUG in ('Y', 'C') THEN
4765: msc_sch_wb.atp_debug('MAtching cal date not found, in atp_check_subs');
4766: END IF;
4767: p_atp_record.error_code := MSC_ATP_PVT.NO_MATCHING_CAL_DATE;
4768: RAISE MSC_ATP_PVT.NO_MATCHING_DATE_IN_CAL;
4769:
4770: WHEN OTHERS THEN
4771: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4772:

Line 4775: --p_atp_record.error_code := MSC_ATP_PVT.ATP_PROCESSING_ERROR;

4771: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
4772:
4773: -- dsting set error_code
4774: --bug3583705 start
4775: --p_atp_record.error_code := MSC_ATP_PVT.ATP_PROCESSING_ERROR;
4776: /* Check if this is actually coming from a calendar routine*/
4777: l_encoded_text := fnd_message.GET_ENCODED;
4778: IF l_encoded_text IS NULL THEN
4779: l_msg_app := NULL;

Line 4788: p_atp_record.error_code := MSC_ATP_PVT.NO_MATCHING_CAL_DATE;

4784:
4785: -- Error Handling Changes
4786: IF (p_atp_record.error_code IS NULL) or (p_atp_record.error_code IN (0,61,150)) THEN
4787: IF l_msg_app='MRP' AND l_msg_name='GEN-DATE OUT OF BOUNDS' THEN
4788: p_atp_record.error_code := MSC_ATP_PVT.NO_MATCHING_CAL_DATE;
4789: IF PG_DEBUG in ('Y', 'C') THEN
4790: msc_sch_wb.atp_debug('ATP_CHECK_SUBS: NO_MATCHING_CAL_DATE');
4791: END IF;
4792: ELSE

Line 4793: p_atp_record.error_code := MSC_ATP_PVT.ATP_PROCESSING_ERROR; -- ATP Processing Error

4789: IF PG_DEBUG in ('Y', 'C') THEN
4790: msc_sch_wb.atp_debug('ATP_CHECK_SUBS: NO_MATCHING_CAL_DATE');
4791: END IF;
4792: ELSE
4793: p_atp_record.error_code := MSC_ATP_PVT.ATP_PROCESSING_ERROR; -- ATP Processing Error
4794: IF PG_DEBUG in ('Y', 'C') THEN
4795: msc_sch_wb.atp_debug('ATP_CHECK_SUBS: ATP_PROCESSING_ERROR');
4796: END IF;
4797: END IF;

Line 4816: MSC_ATP_PVT.UNDO,

4812:
4813: MSC_ATP_DB_UTILS.Remove_Invalid_SD_Rec(item_availability_info.end_pegging_id(i),
4814: null,
4815: item_availability_info.plan_id(i),
4816: MSC_ATP_PVT.UNDO,
4817: null,
4818: l_return_status);
4819:
4820: END LOOP;

Line 4823: RAISE MSC_ATP_PVT.NO_MATCHING_DATE_IN_CAL;

4819:
4820: END LOOP;
4821:
4822: IF l_msg_app='MRP' AND l_msg_name='GEN-DATE OUT OF BOUNDS' THEN --bug3583705
4823: RAISE MSC_ATP_PVT.NO_MATCHING_DATE_IN_CAL;
4824: ELSE
4825: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
4826: END IF;
4827: END ATP_Check_Subst;

Line 4863: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'G_HIERARCHY_PROFILE = '||MSC_ATP_PVT.G_HIERARCHY_PROFILE);

4859:
4860: l_request_date := trunc(p_request_date);
4861:
4862: IF PG_DEBUG in ('Y', 'C') THEN
4863: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'G_HIERARCHY_PROFILE = '||MSC_ATP_PVT.G_HIERARCHY_PROFILE);
4864: END IF;
4865: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 2) THEN
4866: IF PG_DEBUG in ('Y', 'C') THEN
4867: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'Customer class alloc atp. Set the local varibale from global var');

Line 4865: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 2) THEN

4861:
4862: IF PG_DEBUG in ('Y', 'C') THEN
4863: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'G_HIERARCHY_PROFILE = '||MSC_ATP_PVT.G_HIERARCHY_PROFILE);
4864: END IF;
4865: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 2) THEN
4866: IF PG_DEBUG in ('Y', 'C') THEN
4867: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'Customer class alloc atp. Set the local varibale from global var');
4868: END IF;
4869: l_customer_id := MSC_ATP_PVT.G_PARTNER_ID;

Line 4869: l_customer_id := MSC_ATP_PVT.G_PARTNER_ID;

4865: IF (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 2) THEN
4866: IF PG_DEBUG in ('Y', 'C') THEN
4867: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'Customer class alloc atp. Set the local varibale from global var');
4868: END IF;
4869: l_customer_id := MSC_ATP_PVT.G_PARTNER_ID;
4870: l_customer_site_id := MSC_ATP_PVT.G_PARTNER_SITE_ID;
4871: ELSIF p_customer_id is not null and p_customer_site_id is not null THEN
4872:
4873: IF PG_DEBUG in ('Y', 'C') THEN

Line 4870: l_customer_site_id := MSC_ATP_PVT.G_PARTNER_SITE_ID;

4866: IF PG_DEBUG in ('Y', 'C') THEN
4867: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'Customer class alloc atp. Set the local varibale from global var');
4868: END IF;
4869: l_customer_id := MSC_ATP_PVT.G_PARTNER_ID;
4870: l_customer_site_id := MSC_ATP_PVT.G_PARTNER_SITE_ID;
4871: ELSIF p_customer_id is not null and p_customer_site_id is not null THEN
4872:
4873: IF PG_DEBUG in ('Y', 'C') THEN
4874: msc_sch_wb.atp_debug('Get_Item_Substitutes: ' || 'Convert customer/site id');

Line 5215: IF MSC_ATP_PVT.G_INV_CTP = 4 and MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y'

5211: IF PG_DEBUG in ('Y', 'C') THEN
5212: msc_sch_wb.atp_debug('Update_demand: ' || 'Number of Rows Updated := ' || SQL%ROWCOUNT);
5213: END IF;
5214:
5215: IF MSC_ATP_PVT.G_INV_CTP = 4 and MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y'
5216: AND MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1 AND MSC_ATP_PVT.G_ALLOCATION_METHOD = 1 THEN
5217:
5218: IF PG_DEBUG in ('Y', 'C') THEN
5219: msc_sch_wb.atp_debug('Update_demand: ' || 'Update preallocated demand');

Line 5216: AND MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1 AND MSC_ATP_PVT.G_ALLOCATION_METHOD = 1 THEN

5212: msc_sch_wb.atp_debug('Update_demand: ' || 'Number of Rows Updated := ' || SQL%ROWCOUNT);
5213: END IF;
5214:
5215: IF MSC_ATP_PVT.G_INV_CTP = 4 and MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y'
5216: AND MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1 AND MSC_ATP_PVT.G_ALLOCATION_METHOD = 1 THEN
5217:
5218: IF PG_DEBUG in ('Y', 'C') THEN
5219: msc_sch_wb.atp_debug('Update_demand: ' || 'Update preallocated demand');
5220: END IF;

Line 5255: IF MSC_ATP_PVT.G_INV_CTP = 4 and MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y'

5251: IF PG_DEBUG in ('Y', 'C') THEN
5252: msc_sch_wb.atp_debug('Delete_demand_subst: ' || 'Number of Rows deleted := ' || SQL%ROWCOUNT);
5253: END IF;
5254:
5255: IF MSC_ATP_PVT.G_INV_CTP = 4 and MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y'
5256: AND MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1 AND MSC_ATP_PVT.G_ALLOCATION_METHOD = 1 THEN
5257:
5258: IF PG_DEBUG in ('Y', 'C') THEN
5259: msc_sch_wb.atp_debug('Delete_demand_subst: ' || 'Delete Allocated demand');

Line 5256: AND MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1 AND MSC_ATP_PVT.G_ALLOCATION_METHOD = 1 THEN

5252: msc_sch_wb.atp_debug('Delete_demand_subst: ' || 'Number of Rows deleted := ' || SQL%ROWCOUNT);
5253: END IF;
5254:
5255: IF MSC_ATP_PVT.G_INV_CTP = 4 and MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y'
5256: AND MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1 AND MSC_ATP_PVT.G_ALLOCATION_METHOD = 1 THEN
5257:
5258: IF PG_DEBUG in ('Y', 'C') THEN
5259: msc_sch_wb.atp_debug('Delete_demand_subst: ' || 'Delete Allocated demand');
5260: END IF;

Line 5407: --NVL(MSC_ATP_PVT.G_DEMAND_PEGGING_ID, msc_full_pegging_s.currval),

5403: p_pegging_rec.supply_demand_source_type,
5404: p_pegging_rec.supply_demand_quantity,
5405: p_pegging_rec.supply_demand_type,
5406: p_pegging_rec.supply_demand_date,
5407: --NVL(MSC_ATP_PVT.G_DEMAND_PEGGING_ID, msc_full_pegging_s.currval),
5408: p_pegging_rec.end_pegging_id,
5409: p_pegging_rec.constraint_flag,
5410: p_pegging_rec.allocated_quantity, -- 1527660
5411: p_pegging_rec.number1,

Line 5444: 1, TRUNC(p_pegging_rec.REQUIRED_DATE) + MSC_ATP_PVT.G_END_OF_DAY,

5440: -- p_pegging_rec.REQUIRED_DATE,
5441: -- Bug 2748730. Move the required_date to day end only when the pegging is for demand line
5442: -- This is applicable irrespective of whether the line is overridden or not
5443: DECODE(p_pegging_rec.supply_demand_type,
5444: 1, TRUNC(p_pegging_rec.REQUIRED_DATE) + MSC_ATP_PVT.G_END_OF_DAY,
5445: p_pegging_rec.REQUIRED_DATE),
5446: p_pegging_rec.OPERATION_SEQUENCE_ID,
5447: p_pegging_rec.SOURCING_RULE_NAME,
5448: p_pegging_rec.OFFSET,

Line 5911: TRUNC(p_atp_rec.requested_ship_date) + MSC_ATP_PVT.G_END_OF_DAY , -- For bug 2259824

5907: ---STOLEN_FLAG) -- 02/16: Stealing
5908: VALUES(
5909: msc_demands_s.nextval,
5910: p_atp_rec.quantity_ordered,
5911: TRUNC(p_atp_rec.requested_ship_date) + MSC_ATP_PVT.G_END_OF_DAY , -- For bug 2259824
5912: 1, -- discrete demand
5913: p_atp_rec.origination_type,
5914: p_atp_rec.inventory_item_id,
5915: p_plan_id,

Line 5932: MSC_ATP_PVT.G_PARTNER_ID,

5928: 30, p_atp_rec.order_number,
5929: null),
5930: decode(p_atp_rec.origination_type, 6, 2, 30, 2, null),
5931: decode(p_atp_rec.origination_type, 6, 0, 30, 0, null),
5932: MSC_ATP_PVT.G_PARTNER_ID,
5933: MSC_ATP_PVT.G_PARTNER_SITE_ID,
5934: p_atp_rec.request_item_id,
5935: l_record_source) -- For plan order pegging
5936: --1657855, remove support for min allocation

Line 5933: MSC_ATP_PVT.G_PARTNER_SITE_ID,

5929: null),
5930: decode(p_atp_rec.origination_type, 6, 2, 30, 2, null),
5931: decode(p_atp_rec.origination_type, 6, 0, 30, 0, null),
5932: MSC_ATP_PVT.G_PARTNER_ID,
5933: MSC_ATP_PVT.G_PARTNER_SITE_ID,
5934: p_atp_rec.request_item_id,
5935: l_record_source) -- For plan order pegging
5936: --1657855, remove support for min allocation
5937: ---p_atp_rec.stolen_flag)

Line 5942: IF ((MSC_ATP_PVT.G_INV_CTP = 4) AND

5938: RETURNING DEMAND_ID INTO x_demand_id;
5939: IF PG_DEBUG in ('Y', 'C') THEN
5940: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'Numbe of rows inserted := ' || SQL%ROWCOUNT);
5941: END IF;
5942: IF ((MSC_ATP_PVT.G_INV_CTP = 4) AND
5943: (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
5944: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
5945: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN
5946:

Line 5943: (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND

5939: IF PG_DEBUG in ('Y', 'C') THEN
5940: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'Numbe of rows inserted := ' || SQL%ROWCOUNT);
5941: END IF;
5942: IF ((MSC_ATP_PVT.G_INV_CTP = 4) AND
5943: (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
5944: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
5945: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN
5946:
5947: IF PG_DEBUG in ('Y', 'C') THEN

Line 5944: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND

5940: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'Numbe of rows inserted := ' || SQL%ROWCOUNT);
5941: END IF;
5942: IF ((MSC_ATP_PVT.G_INV_CTP = 4) AND
5943: (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
5944: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
5945: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN
5946:
5947: IF PG_DEBUG in ('Y', 'C') THEN
5948: msc_sch_wb.atp_debug('Add_Mat_Demand: before insert into'||

Line 5945: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN

5941: END IF;
5942: IF ((MSC_ATP_PVT.G_INV_CTP = 4) AND
5943: (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
5944: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
5945: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN
5946:
5947: IF PG_DEBUG in ('Y', 'C') THEN
5948: msc_sch_wb.atp_debug('Add_Mat_Demand: before insert into'||
5949: ' msc_alloc_demands');