DBA Data[Home] [Help]

APPS.MSC_ATP_PVT dependencies on MSC_DEMANDS

Line 6672: Added by avjain to capture original request date to insert in msc-demands

6668: ELSE
6669: l_requested_ship_date := p_atp_record.requested_ship_date;
6670: END IF;
6671: /*
6672: Added by avjain to capture original request date to insert in msc-demands
6673: original_request_date corresponds to request date for 24*7 ATP which gives
6674: the request date
6675: */
6676: l_original_req_ship_date := nvl(p_atp_record.original_request_date,l_requested_ship_date);

Line 8539: update msc_demands

8535: p_atp_record.quantity_ordered-
8536: l_sub_requested_date_quantity );
8537: END IF;
8538:
8539: update msc_demands
8540: set USING_REQUIREMENT_QUANTITY =
8541: MSC_ATP_UTILS.Truncate_Demand((USING_REQUIREMENT_QUANTITY-
8542: greatest(l_sub_requested_date_quantity, 0))) -- 5598066
8543: where demand_id = l_demand_id

Line 8799: update msc_demands

8795: -- using the pegging_id to find the demand_id and plan_id
8796: ---demandxyz
8797: --- Initially we created the demand for l_requested_date_qty
8798: --- now we update the quantity
8799: update msc_demands
8800: set USING_REQUIREMENT_QUANTITY = p_atp_record.quantity_ordered
8801: where plan_id = p_plan_id and
8802: demand_id = l_demand_id;
8803:

Line 8863: update msc_demands

8859: -- we need to change the requested quantity for that primary
8860: -- component to what was requested minus
8861: -- what got satisfied by the stealing
8862:
8863: update msc_demands
8864: set USING_REQUIREMENT_QUANTITY =
8865: (p_atp_record.quantity_ordered - l_stealing_qty)
8866: where demand_id = l_demand_id
8867: and plan_id = p_plan_id;

Line 8979: update msc_demands

8975: msc_sch_wb.atp_debug('ATP_Check: ' || 'l_net_demand: ' || l_net_demand);
8976: msc_sch_wb.atp_debug('ATP_Check: ' || 'l_demand_id: ' || l_demand_id);
8977: END IF;
8978:
8979: update msc_demands
8980: set using_requirement_quantity = MSC_ATP_UTILS.Truncate_Demand(p_atp_record.requested_date_quantity + l_stealing_requested_date_qty)
8981: where demand_id = l_demand_id
8982: and plan_id = p_plan_id;
8983:

Line 9189: UPDATE msc_demands

9185: -- bug 1302394: we should adjust the date
9186: -- of the demand which causes this planned order
9187: -- as well so that they can cancel each other.
9188:
9189: UPDATE msc_demands
9190: SET USING_ASSEMBLY_DEMAND_DATE = l_atp_date_this_level
9191: --ngoel 8/30/2000 Check if this needs to be changed to l_atp_date_this_level.
9192: WHERE demand_id = l_demand_id
9193: AND plan_id = p_plan_id;

Line 9252: UPDATE msc_demands

9248: WHERE sr_instance_id = p_atp_record.instance_id
9249: AND DEMAND_ID = l_demand_id
9250: returning inventory_item_id into l_inventory_item_id;
9251: ELSE
9252: UPDATE msc_demands
9253: SET
9254: --start changes for plan by request date
9255: USING_ASSEMBLY_DEMAND_DATE =
9256: DECODE(ORIGINATION_TYPE,

Line 9675: UPDATE msc_demands

9671: p_atp_record.error_code := ATP_REQ_DATE_FAIL;
9672: ---- bug 1819638
9673: ---remove the demand record as supply is 0 on the req_date
9674:
9675: UPDATE msc_demands
9676: SET USING_REQUIREMENT_QUANTITY = 0
9677: WHERE demand_id = l_demand_id
9678: AND plan_id = p_plan_id
9679: returning inventory_item_id into l_inventory_item_id;

Line 9696: msc_sch_wb.atp_debug('ATP_Check: ' || 'in sumary mode, update msc-demands');

9692:
9693: -- update summary records removed in ODS cases - for summary enhancement
9694: IF MSC_ATP_PVT.G_SUMMARY_FLAG = 'Y' AND p_plan_id = -1 THEN
9695: IF PG_DEBUG in ('Y', 'C') THEN
9696: msc_sch_wb.atp_debug('ATP_Check: ' || 'in sumary mode, update msc-demands');
9697: msc_sch_wb.atp_debug('ATP_Check: ' || 'l_inventory_item_id := ' || l_inventory_item_id);
9698: msc_sch_wb.atp_debug('ATP_Check: ' || 'l_requested_ship_date := ' || l_requested_ship_date);
9699: END IF;
9700:

Line 12823: update msc_demands

12819:
12820: /*
12821: -- 1228607: since we add this planned order,
12822: -- we need to work on the demand record for this too.
12823: update msc_demands
12824: set USING_REQUIREMENT_QUANTITY =
12825: (USING_REQUIREMENT_QUANTITY -
12826: LEAST(l_net_demand, 0))
12827: where demand_id = l_demand_id

Line 14757: update msc_demands

14753: MSC_ATP_DB_UTILS.Update_Pegging( l_substitutes_rec.pegging_id(l_index),
14754: null,
14755: l_atp_ctp_qty );
14756: END IF;
14757: update msc_demands
14758: set USING_REQUIREMENT_QUANTITY = MSC_ATP_UTILS.Truncate_Demand(l_atp_ctp_qty) -- 5598066
14759: where demand_id = l_substitutes_rec.demand_id(l_index)
14760: and plan_id = p_plan_id
14761: returning inventory_item_id

Line 14897: update msc_demands

14893:
14894: -- dsting diag_atp. do not adjust the demands for diagnostic ATP
14895:
14896: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP <> 1 THEN
14897: update msc_demands
14898: set USING_REQUIREMENT_QUANTITY =
14899: MSC_ATP_UTILS.Truncate_Demand((USING_REQUIREMENT_QUANTITY-l_net_demand)) -- 5598066
14900: where demand_id = l_demand_id
14901: and plan_id = p_plan_id

Line 14940: msc_sch_wb.atp_debug('ATP_Check: ' || 'in sumary mode, update msc-demands');

14936:
14937: -- update summary records removed in ODS cases - for summary enhancement
14938: IF MSC_ATP_PVT.G_SUMMARY_FLAG = 'Y' AND p_plan_id = -1 THEN
14939: IF PG_DEBUG in ('Y', 'C') THEN
14940: msc_sch_wb.atp_debug('ATP_Check: ' || 'in sumary mode, update msc-demands');
14941: msc_sch_wb.atp_debug('ATP_Check: ' || 'l_inventory_item_id := ' || l_inventory_item_id);
14942: msc_sch_wb.atp_debug('ATP_Check: ' || 'l_requested_ship_date := ' || l_requested_ship_date);
14943: END IF;
14944:

Line 15061: /*update msc_demands

15057:
15058: -- 1228607
15059: --- This code has been moved before stealing
15060: --- so that demand record is correct before stealing takes place
15061: /*update msc_demands
15062: set USING_REQUIREMENT_QUANTITY =
15063: (USING_REQUIREMENT_QUANTITY-l_net_demand)
15064: where demand_id = l_demand_id
15065: and plan_id = p_plan_id;*/

Line 15110: update msc_demands

15106:
15107: -- dsting diag_atp do not adjust the demands for diagnostic atp
15108: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP <> 1 THEN
15109:
15110: update msc_demands
15111: set USING_REQUIREMENT_QUANTITY =
15112: MSC_ATP_UTILS.Truncate_Demand((USING_REQUIREMENT_QUANTITY-l_net_demand)) -- 5598066
15113: where demand_id = l_demand_id
15114: and plan_id = p_plan_id

Line 15153: msc_sch_wb.atp_debug('ATP_Check: ' || 'in sumary mode, update msc-demands');

15149: -- update summary records removed in ODS cases - for summary enhancement
15150: IF MSC_ATP_PVT.G_SUMMARY_FLAG = 'Y' AND p_plan_id = -1 THEN
15151: IF PG_DEBUG in ('Y', 'C') THEN
15152: msc_sch_wb.atp_debug('ATP_Check: ' || 'update sd table for component');
15153: msc_sch_wb.atp_debug('ATP_Check: ' || 'in sumary mode, update msc-demands');
15154: msc_sch_wb.atp_debug('ATP_Check: ' || 'l_inventory_item_id := ' || l_inventory_item_id);
15155: msc_sch_wb.atp_debug('ATP_Check: ' || 'l_requested_ship_date := ' || l_requested_ship_date);
15156: END IF;
15157:

Line 15210: -- for override case for CTO, do not adjust demand date in msc_demands

15206: IF p_atp_record.ship_date IS NOT NULL THEN
15207: -- Update only if p_atp_record.ship_date is NOT NULL
15208:
15209: -- dsting ATO 2465370
15210: -- for override case for CTO, do not adjust demand date in msc_demands
15211: --bug 3564511: always update the date on PO demands
15212: --IF NVL(G_LINE_OVERRIDE_FLAG, 'N') = 'N'
15213: --OR (NVL(C_ITEM_INFO_REC.cto_source_org_id, -1) <> p_atp_record.organization_id
15214: --AND p_parent_pegging_id is not null)

Line 15228: UPDATE msc_demands

15224: IF PG_DEBUG in ('Y','C') THEN
15225: msc_sch_wb.atp_debug('ATO update details_temp 12: ' || l_parent_pegging_id || ' date: ' || p_atp_record.ship_date);
15226: END IF;
15227:
15228: UPDATE msc_demands
15229: --SET USING_ASSEMBLY_DEMAND_DATE = NVL(p_atp_record.ship_date,
15230: -- USING_ASSEMBLY_DEMAND_DATE)
15231: -- For bug 2259824, move the demand to the end of day
15232: ----start changes for plan by request date