DBA Data[Home] [Help]

APPS.MSC_ATP_DB_UTILS dependencies on MSC_DEMANDS

Line 62: /* In time phased atp scenarios add demand in msc_demands for member item*/

58:
59: -- time_phased_atp changes begin
60: IF (p_atp_rec.inventory_item_id <> p_atp_rec.request_item_id) and p_atp_rec.atf_date is not null THEN
61: l_time_phased_atp := 'Y';
62: /* In time phased atp scenarios add demand in msc_demands for member item*/
63: l_insert_item_id := p_atp_rec.request_item_id;
64: IF PG_DEBUG in ('Y', 'C') THEN
65: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'Time Phased ATP = ' || l_time_phased_atp);
66: END IF;

Line 71: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'Insert demand in msc_demands for ' || l_insert_item_id);

67: ELSE
68: l_insert_item_id := p_atp_rec.inventory_item_id;
69: END IF;
70: IF PG_DEBUG in ('Y', 'C') THEN
71: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'Insert demand in msc_demands for ' || l_insert_item_id);
72: END IF;
73: -- time_phased_atp changes end
74:
75: IF (p_plan_id = -1) THEN -- ods, put into ods tables

Line 114: VALUES( msc_demands_s.nextval,

110: --which now holds the value of Intransit Lead Time
111: INTRANSIT_LEAD_TIME,
112: SHIP_SET_NAME, --bug3263368
113: ARRIVAL_SET_NAME) --bug3263368
114: VALUES( msc_demands_s.nextval,
115: p_atp_rec.instance_id,
116: p_atp_rec.inventory_item_id,
117: p_atp_rec.organization_id,
118: p_atp_rec.demand_source_type,

Line 240: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'inside update of msc_demands');

236: --as this code is redundent commenting it out avjain
237: /*IF (p_atp_rec.origination_type IN (6, 30)) AND NVL(p_atp_rec.old_demand_id, 0) > 0 THEN
238:
239: IF PG_DEBUG in ('Y', 'C') THEN
240: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'inside update of msc_demands');
241: END IF;
242:
243: -- For bug 2259824, move the demand to the end of day
244: UPDATE msc_demands

Line 244: UPDATE msc_demands

240: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'inside update of msc_demands');
241: END IF;
242:
243: -- For bug 2259824, move the demand to the end of day
244: UPDATE msc_demands
245: SET using_requirement_quantity = p_atp_rec.quantity_ordered,
246: USING_ASSEMBLY_DEMAND_DATE=
247: decode(MSC_ATP_PVT.G_PLAN_INFO_REC.schedule_by_date_type,
248: MSC_ATP_PVT.G_SCHEDULE_DATE_LEGEND,

Line 277: -- bug 2795053-reopen (ssurendr) update the demand_satisfied_date in msc_demands

273: ship_to_site_id = MSC_ATP_PVT.G_PARTNER_SITE_ID,
274: inventory_item_id = p_atp_rec.inventory_item_id,
275: -- 24x7
276: atp_synchronization_flag = 0,
277: -- bug 2795053-reopen (ssurendr) update the demand_satisfied_date in msc_demands
278: dmd_satisfied_date = TRUNC(p_atp_rec.requested_ship_date) + MSC_ATP_PVT.G_END_OF_DAY
279: WHERE sr_instance_id = p_atp_rec.instance_id
280: AND plan_id = p_plan_id
281: AND sales_order_line_id = p_atp_rec.demand_source_line

Line 340: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'before insert into msc_demands');

336: IF (SQL%NOTFOUND OR (p_atp_rec.origination_type NOT IN (6, 30)) OR
337: NVL(p_atp_rec.old_demand_id,0 ) = 0) THEN
338:
339: IF PG_DEBUG in ('Y', 'C') THEN
340: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'before insert into msc_demands');
341: END IF;
342:
343: INSERT INTO MSC_DEMANDS(
344: DEMAND_ID,

Line 343: INSERT INTO MSC_DEMANDS(

339: IF PG_DEBUG in ('Y', 'C') THEN
340: msc_sch_wb.atp_debug('Add_Mat_Demand: ' || 'before insert into msc_demands');
341: END IF;
342:
343: INSERT INTO MSC_DEMANDS(
344: DEMAND_ID,
345: USING_REQUIREMENT_QUANTITY,
346: SCHEDULE_SHIP_DATE, --plan by request date
347: USING_ASSEMBLY_DEMAND_DATE,

Line 373: -- bug 2795053-reopen (ssurendr) insert the demand_satisfied_date in msc_demands

369: SHIP_TO_SITE_ID,
370: RECORD_SOURCE, -- For plan order pegging
371: -- 24x7
372: ATP_SYNCHRONIZATION_FLAG,
373: -- bug 2795053-reopen (ssurendr) insert the demand_satisfied_date in msc_demands
374: DMD_SATISFIED_DATE,
375: -- rajjain bug 2771075 04/25/2003 Populate disposition_id column with the demand_id
376: DISPOSITION_ID,
377: --s_cto_rearch

Line 395: msc_demands_s.nextval,

391: SHIP_SET_NAME, --bug3263368
392: ARRIVAL_SET_NAME --bug3263368
393: )
394: VALUES(
395: msc_demands_s.nextval,
396: MSC_ATP_UTILS.Truncate_Demand(p_atp_rec.quantity_ordered), -- 5598066
397: -- start changes for plan by request date
398: decode(p_atp_rec.origination_type,
399: 6, TRUNC(p_atp_rec.requested_ship_date) + MSC_ATP_PVT.G_END_OF_DAY,

Line 477: -- bug 2795053-reopen (ssurendr) insert the demand_satisfied_date in msc_demands

473: MSC_ATP_PVT.G_PARTNER_SITE_ID,
474: l_record_source, -- For plan order pegging
475: -- 24x7
476: 0,
477: -- bug 2795053-reopen (ssurendr) insert the demand_satisfied_date in msc_demands
478: TRUNC(p_atp_rec.requested_ship_date) + MSC_ATP_PVT.G_END_OF_DAY,
479: msc_demands_s.nextval,
480: --s_cto_rearch
481: p_atp_rec.parent_line_id,

Line 479: msc_demands_s.nextval,

475: -- 24x7
476: 0,
477: -- bug 2795053-reopen (ssurendr) insert the demand_satisfied_date in msc_demands
478: TRUNC(p_atp_rec.requested_ship_date) + MSC_ATP_PVT.G_END_OF_DAY,
479: msc_demands_s.nextval,
480: --s_cto_rearch
481: p_atp_rec.parent_line_id,
482: p_atp_rec.ato_model_line_id,
483: p_atp_rec.top_model_line_id,

Line 1433: msc_sch_wb.atp_debug('Delete_Row: ' || 'Deleting msc_demands with identifier = '||

1429:
1430: END IF;
1431: ELSE
1432: IF PG_DEBUG in ('Y', 'C') THEN
1433: msc_sch_wb.atp_debug('Delete_Row: ' || 'Deleting msc_demands with identifier = '||
1434: p_identifier ||' : plan id = '||p_plan_id);
1435: END IF;
1436:
1437: IF MSC_ATP_PVT.G_SUMMARY_FLAG = 'Y' THEN

Line 1467: UPDATE msc_demands

1463:
1464: -- Bug # 1868383, do not delete old demand records, rather just update qty = 0
1465: -- Bug 2738280. Club the 2 update SQL's into one.
1466: -- Collect all the entities required for updating summary tables here.
1467: UPDATE msc_demands
1468: SET old_demand_quantity = using_requirement_quantity,
1469: -- bug 2863322 : change the column used to store date
1470: old_using_assembly_demand_date = using_assembly_demand_date,
1471: applied = 2,

Line 1544: FROM MSC_DEMANDS

1540: l_organization_id,
1541: l_refresh_number_tab,
1542: l_qty_tab,
1543: l_old_demand_date
1544: FROM MSC_DEMANDS
1545: WHERE sr_instance_id = p_instance_id
1546: AND plan_id = p_plan_id
1547: AND using_requirement_quantity > 0
1548: -- CTO ODR and Simplified Pegging

Line 1580: UPDATE msc_demands

1576: -- msc_sch_wb.atp_debug('Delete_Row: ' || 'x_demand_id.COUNT:' || x_demand_id.COUNT);
1577: --END IF;
1578:
1579: --FORALL i in 1..x_demand_id.COUNT --cmro
1580: UPDATE msc_demands
1581: SET old_demand_quantity = using_requirement_quantity,
1582: old_using_assembly_demand_date = using_assembly_demand_date,
1583: applied = 2,
1584: status = 0,

Line 1630: SELECT msc_demands_s.nextval

1626: l_ins_refresh_number_tab(l_ins_refresh_number_tab.COUNT) := l_refresh_number_tab(i);
1627: l_ins_qty_tab(l_ins_qty_tab.COUNT) := l_qty_tab(i);
1628: l_ins_date_tab(l_ins_date_tab.COUNT) := l_old_demand_date(i);
1629:
1630: SELECT msc_demands_s.nextval
1631: INTO l_copy_demand_id(l_copy_demand_id.COUNT)
1632: FROM dual;
1633: END IF;
1634: END LOOP;

Line 1643: INSERT INTO MSC_DEMANDS(

1639: msc_sch_wb.atp_debug('Delete_Row: ' || 'i_ins_item_id_tab.COUNT:' || i_ins_item_id_tab.COUNT);
1640: END IF;
1641:
1642: FORALL i IN 1..i_ins_item_id_tab.COUNT
1643: INSERT INTO MSC_DEMANDS(
1644: DEMAND_ID,
1645: USING_REQUIREMENT_QUANTITY,
1646: USING_ASSEMBLY_DEMAND_DATE,
1647: DEMAND_TYPE,

Line 1867: SELECT msc_demands_s.nextval

1863: l_ins_qty_tab(l_ins_qty_tab.COUNT) := l_qty_tab(i);
1864: l_ins_date_tab(l_ins_date_tab.COUNT) := l_old_demand_date(i);
1865: l_ins_demand_class_tab(l_ins_demand_class_tab.COUNT) := l_demand_class_tab(i);
1866:
1867: SELECT msc_demands_s.nextval
1868: INTO l_copy_demand_id(l_copy_demand_id.COUNT)
1869: FROM dual;
1870:
1871: END IF;

Line 1880: -1 * allocated_quantity, -- multiply by -1 since the copy record will be stored in msc_demands

1876: SELECT sales_order_line_id,
1877: inventory_item_id,
1878: organization_id,
1879: refresh_number,
1880: -1 * allocated_quantity, -- multiply by -1 since the copy record will be stored in msc_demands
1881: supply_date,
1882: demand_class
1883: BULK COLLECT INTO
1884: l_identifier_tab,

Line 1971: SELECT msc_demands_s.nextval

1967: l_ins_qty_tab(l_ins_qty_tab.COUNT) := l_qty_tab(i);
1968: l_ins_date_tab(l_ins_date_tab.COUNT) := l_old_demand_date(i);
1969: l_ins_demand_class_tab(l_ins_demand_class_tab.COUNT) := l_demand_class_tab(i);
1970:
1971: SELECT msc_demands_s.nextval
1972: INTO l_copy_demand_id(l_copy_demand_id.COUNT)
1973: FROM dual;
1974: END IF;
1975: END LOOP;

Line 2275: msc_sch_wb.atp_debug('Remove_Invalid_SD_Rec: ' || 'delete stealing demand from msc_demands, demand_id = '||

2271:
2272: IF NVL(c1.char1, '@@@') <> '@@@' THEN
2273:
2274: IF PG_DEBUG in ('Y', 'C') THEN
2275: msc_sch_wb.atp_debug('Remove_Invalid_SD_Rec: ' || 'delete stealing demand from msc_demands, demand_id = '||
2276: c1.identifier3);
2277: END IF;
2278:
2279: DELETE FROM MSC_DEMANDS

Line 2279: DELETE FROM MSC_DEMANDS

2275: msc_sch_wb.atp_debug('Remove_Invalid_SD_Rec: ' || 'delete stealing demand from msc_demands, demand_id = '||
2276: c1.identifier3);
2277: END IF;
2278:
2279: DELETE FROM MSC_DEMANDS
2280: WHERE demand_id = c1.identifier3
2281: AND plan_id = c1.identifier2;
2282: END IF;
2283: END IF; -- IF NVL(c1.inventory_item_id, -1) > 0 THEN

Line 2300: DELETE FROM MSC_DEMANDS

2296:
2297: -- Bug 1661545, if scheduling was unsuccessful, old demand record needs to be
2298: -- preserved back, as it was updated to 0 in the begining in case of reschedule in PDS.
2299:
2300: DELETE FROM MSC_DEMANDS
2301: WHERE demand_id = c1.identifier3
2302: AND plan_id = c1.identifier2
2303: AND old_demand_quantity IS NULL
2304: -- for bug 2120698, need to get the date and quantity from here

Line 3042: UPDATE msc_demands

3038: IF MSC_ATP_PVT.G_DIAGNOSTIC_ATP <> 1 THEN
3039:
3040: l_prim_uom_dmd_qty := p_quantity * nvl(p_uom_conv_rate, 1);
3041:
3042: UPDATE msc_demands
3043: SET USING_REQUIREMENT_QUANTITY = MSC_ATP_UTILS.Truncate_Demand(l_prim_uom_dmd_qty),
3044: -- 24x7 -- 5598066
3045: atp_synchronization_flag = 0
3046: WHERE demand_id = l_demand_id

Line 3421: UPDATE MSC_DEMANDS

3417: IF PG_DEBUG in ('Y', 'C') THEN
3418: msc_sch_wb.atp_debug('Inside If of else p_plan_id = -1'); --bug3397904
3419: END IF;
3420:
3421: UPDATE MSC_DEMANDS
3422: SET
3423: --start changes for plan by request date
3424: SCHEDULE_SHIP_DATE = TRUNC(NVL(p_supply_demand_date,SCHEDULE_SHIP_DATE)) + MSC_ATP_PVT.G_END_OF_DAY,
3425: USING_ASSEMBLY_DEMAND_DATE =

Line 3466: -- bug 2795053-reopen (ssurendr) update the demand_satisfied_date in msc_demands

3462: --end changes for plan by request date
3463: USING_REQUIREMENT_QUANTITY = MSC_ATP_UTILS.Truncate_Demand(NVL(p_supply_demand_qty,USING_REQUIREMENT_QUANTITY)), -- Bug 1501787
3464: -- 24x7 -- 5598066
3465: ATP_SYNCHRONIZATION_FLAG = 0,
3466: -- bug 2795053-reopen (ssurendr) update the demand_satisfied_date in msc_demands
3467: DMD_SATISFIED_DATE = TRUNC(GREATEST(p_dmd_satisfied_date,DMD_SATISFIED_DATE)) + MSC_ATP_PVT.G_END_OF_DAY,
3468: -- ship_rec_cal changes begin
3469: SCHEDULE_ARRIVAL_DATE = NVL(p_sch_arrival_date, SCHEDULE_ARRIVAL_DATE),
3470: ORDER_DATE_TYPE_CODE = NVL(p_order_date_type, ORDER_DATE_TYPE_CODE),

Line 3777: UPDATE msc_demands

3773: END LOOP;
3774: END IF;
3775:
3776: FORALL m IN 1..p_del_demand_ids.COUNT
3777: UPDATE msc_demands
3778: SET using_requirement_quantity = MSC_ATP_UTILS.Truncate_Demand(old_demand_quantity), -- 5598066
3779: -- bug 2863322 : change the column used to store date
3780: using_assembly_demand_date = old_using_assembly_demand_date,
3781: inventory_item_id = p_inv_item_ids(m),

Line 3850: DELETE FROM MSC_DEMANDS

3846: ELSE
3847:
3848: -- Delete from MSC_ALLOC_DEMANDS
3849: FORALL i IN 1..p_copy_demand_ids.COUNT
3850: DELETE FROM MSC_DEMANDS
3851: WHERE demand_id = p_copy_demand_ids(i)
3852: AND plan_id = p_copy_plan_ids(i);
3853:
3854: END IF;

Line 3879: from msc_demands but for time phased ATP inventory item id in msc_demands

3875: END IF;
3876:
3877: /*bug 6642564 we do no want inventory item id to be updated
3878: in case of time phased ATP as,the inventory item id we are picking up
3879: from msc_demands but for time phased ATP inventory item id in msc_demands
3880: is of member item and msc_alloc_demands could me member item of product
3881: family item */
3882:
3883: IF p_time_phased_set = 'Y' THEN

Line 4695: DELETE FROM msc_demands

4691:
4692: msc_sch_wb.atp_debug('Delete_Copy_Demand : ' || 'unallocated ATP');
4693:
4694: FORALL i IN 1..p_copy_demand_ids.COUNT
4695: DELETE FROM msc_demands
4696: WHERE demand_id = p_copy_demand_ids(i)
4697: AND plan_id = p_copy_plan_ids(i)
4698: AND refresh_number <= (SELECT nvl(latest_refresh_number,-1)
4699: FROM MSC_PLANS

Line 4738: UPDATE MSC_DEMANDS

4734: msc_sch_wb.atp_debug('Flush_Data_In_Pds : ' || 'override_flag : ' || p_ship_arrival_date_rec.atp_override_flag);
4735: END IF;
4736:
4737: -- Update PDS
4738: UPDATE MSC_DEMANDS
4739: SET SCHEDULE_ARRIVAL_DATE = p_ship_arrival_date_rec.scheduled_arrival_date,
4740: LATEST_ACCEPTABLE_DATE = p_ship_arrival_date_rec.latest_acceptable_date,
4741: ORDER_DATE_TYPE_CODE = p_ship_arrival_date_rec.order_date_type,
4742: SHIP_SET_NAME = p_ship_arrival_date_rec.ship_set_name,--plan by request date