DBA Data[Home] [Help]

APPS.MSC_ATP_DB_UTILS dependencies on MSC_ALLOC_DEMANDS

Line 443: msc_sch_wb.atp_debug('Add_Mat_Demand: before update of msc_alloc_demands');

439: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
440: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN
441:
442: IF PG_DEBUG in ('Y', 'C') THEN
443: msc_sch_wb.atp_debug('Add_Mat_Demand: before update of msc_alloc_demands');
444: END IF;
445:
446: UPDATE msc_alloc_demands
447: SET old_allocated_quantity = allocated_quantity,

Line 446: UPDATE msc_alloc_demands

442: IF PG_DEBUG in ('Y', 'C') THEN
443: msc_sch_wb.atp_debug('Add_Mat_Demand: before update of msc_alloc_demands');
444: END IF;
445:
446: UPDATE msc_alloc_demands
447: SET old_allocated_quantity = allocated_quantity,
448: old_demand_date = demand_date,
449: plan_id = p_plan_id,
450: organization_id = p_atp_rec.organization_id,

Line 676: msc_sch_wb.atp_debug('Add_Mat_Demand: before insert into msc_alloc_demands');

672: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
673: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN
674:
675: IF PG_DEBUG in ('Y', 'C') THEN
676: msc_sch_wb.atp_debug('Add_Mat_Demand: before insert into msc_alloc_demands');
677: END IF;
678:
679: INSERT INTO MSC_ALLOC_DEMANDS(
680: PLAN_ID,

Line 679: INSERT INTO MSC_ALLOC_DEMANDS(

675: IF PG_DEBUG in ('Y', 'C') THEN
676: msc_sch_wb.atp_debug('Add_Mat_Demand: before insert into msc_alloc_demands');
677: END IF;
678:
679: INSERT INTO MSC_ALLOC_DEMANDS(
680: PLAN_ID,
681: INVENTORY_ITEM_ID,
682: ORGANIZATION_ID,
683: SR_INSTANCE_ID,

Line 1872: msc_sch_wb.atp_debug('Delete_Row: before update of msc_alloc_demands');

1868: --(MSC_ATP_PVT.G_ALLOCATION_METHOD = 1))) AND p_ato_model_line_id is null THEN
1869: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1))) THEN
1870:
1871: IF PG_DEBUG in ('Y', 'C') THEN
1872: msc_sch_wb.atp_debug('Delete_Row: before update of msc_alloc_demands');
1873: END IF;
1874:
1875: IF MSC_ATP_PVT.G_SUMMARY_FLAG = 'N' THEN
1876: -- If condition added for summary enhancement

Line 1885: UPDATE msc_alloc_demands

1881: msc_sch_wb.atp_debug('Delete_Row: l_identifier_tab.COUNT ' || l_identifier_tab.COUNT);
1882: END IF;
1883:
1884: FORALL i IN 1..l_identifier_tab.COUNT
1885: UPDATE msc_alloc_demands
1886: SET old_allocated_quantity = allocated_quantity,
1887: old_demand_date = demand_date,
1888: allocated_quantity = 0,
1889: old_refresh_number = refresh_number, -- For summary enhancement

Line 1942: FROM msc_alloc_demands

1938: l_refresh_number_tab,
1939: l_qty_tab,
1940: l_old_demand_date,
1941: l_demand_class_tab
1942: FROM msc_alloc_demands
1943: WHERE sr_instance_id = p_instance_id
1944: AND plan_id = p_plan_id
1945: AND allocated_quantity > 0
1946: -- CTO ODR and Simplified Pegging

Line 1978: UPDATE msc_alloc_demands

1974: msc_sch_wb.atp_debug('Delete_Row: l_identifier_tab.COUNT ' || l_identifier_tab.COUNT);
1975: END IF;
1976:
1977: FORALL i IN 1..l_identifier_tab.COUNT
1978: UPDATE msc_alloc_demands
1979: SET old_allocated_quantity = allocated_quantity,
1980: old_demand_date = demand_date,
1981: allocated_quantity = 0,
1982: old_refresh_number = refresh_number, -- For summary enhancement

Line 2139: INSERT INTO MSC_ALLOC_DEMANDS(

2135: msc_sch_wb.atp_debug('Delete_Row: i_ins_item_id_tab.COUNT ' || i_ins_item_id_tab.COUNT);
2136: END IF;
2137:
2138: FORALL i IN 1..i_ins_item_id_tab.COUNT
2139: INSERT INTO MSC_ALLOC_DEMANDS(
2140: PLAN_ID,
2141: INVENTORY_ITEM_ID,
2142: ORGANIZATION_ID,
2143: SR_INSTANCE_ID,

Line 2490: ' msc_alloc_demands');

2486: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN
2487:
2488: IF PG_DEBUG in ('Y', 'C') THEN
2489: msc_sch_wb.atp_debug('Remove_Invalid_SD_Rec: before delete of' ||
2490: ' msc_alloc_demands');
2491: END IF;
2492:
2493: DELETE FROM MSC_ALLOC_DEMANDS
2494: WHERE parent_demand_id = c1.identifier3

Line 2493: DELETE FROM MSC_ALLOC_DEMANDS

2489: msc_sch_wb.atp_debug('Remove_Invalid_SD_Rec: before delete of' ||
2490: ' msc_alloc_demands');
2491: END IF;
2492:
2493: DELETE FROM MSC_ALLOC_DEMANDS
2494: WHERE parent_demand_id = c1.identifier3
2495: AND old_allocated_quantity IS NULL
2496: AND plan_id = c1.identifier2;
2497:

Line 2499: msc_sch_wb.atp_debug('Remove_Invalid_SD_Rec: ' || 'No. of demand deleted from msc_alloc_demands = '|| SQL%ROWCOUNT);

2495: AND old_allocated_quantity IS NULL
2496: AND plan_id = c1.identifier2;
2497:
2498: IF PG_DEBUG in ('Y', 'C') THEN
2499: msc_sch_wb.atp_debug('Remove_Invalid_SD_Rec: ' || 'No. of demand deleted from msc_alloc_demands = '|| SQL%ROWCOUNT);
2500: END IF;
2501: END IF;
2502: -- Allocated ATP Based on Planning Details -- Agilent changes End
2503:

Line 3249: ' msc_alloc_demands');

3245: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN
3246:
3247: IF PG_DEBUG in ('Y', 'C') THEN
3248: msc_sch_wb.atp_debug('Update_Planned_Order: before update of' ||
3249: ' msc_alloc_demands');
3250: END IF;
3251: UPDATE msc_alloc_demands
3252: SET allocated_quantity = MSC_ATP_UTILS.Truncate_Demand(l_prim_uom_dmd_qty) --5598066
3253: WHERE parent_demand_id = l_demand_id

Line 3251: UPDATE msc_alloc_demands

3247: IF PG_DEBUG in ('Y', 'C') THEN
3248: msc_sch_wb.atp_debug('Update_Planned_Order: before update of' ||
3249: ' msc_alloc_demands');
3250: END IF;
3251: UPDATE msc_alloc_demands
3252: SET allocated_quantity = MSC_ATP_UTILS.Truncate_Demand(l_prim_uom_dmd_qty) --5598066
3253: WHERE parent_demand_id = l_demand_id
3254: AND plan_id = l_plan_id;
3255:

Line 3675: ' msc_alloc_demands');

3671: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN
3672:
3673: IF PG_DEBUG in ('Y', 'C') THEN
3674: msc_sch_wb.atp_debug('Update_SD_Date: before update of ' ||
3675: ' msc_alloc_demands');
3676: END IF;
3677:
3678: UPDATE MSC_ALLOC_DEMANDS
3679: SET ALLOCATED_QUANTITY = MSC_ATP_UTILS.Truncate_Demand(NVL(p_supply_demand_qty,

Line 3678: UPDATE MSC_ALLOC_DEMANDS

3674: msc_sch_wb.atp_debug('Update_SD_Date: before update of ' ||
3675: ' msc_alloc_demands');
3676: END IF;
3677:
3678: UPDATE MSC_ALLOC_DEMANDS
3679: SET ALLOCATED_QUANTITY = MSC_ATP_UTILS.Truncate_Demand(NVL(p_supply_demand_qty,
3680: ALLOCATED_QUANTITY)), --5598066
3681: DEMAND_DATE = NVL(p_supply_demand_date, DEMAND_DATE),
3682: LAST_UPDATED_BY = FND_GLOBAL.USER_ID,

Line 4015: -- Delete from MSC_ALLOC_DEMANDS

4011: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
4012: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) OR
4013: (p_time_phased_set = 'Y') THEN
4014:
4015: -- Delete from MSC_ALLOC_DEMANDS
4016: FORALL i IN 1..p_copy_demand_ids.COUNT
4017: DELETE FROM MSC_ALLOC_DEMANDS
4018: WHERE parent_demand_id = p_copy_demand_ids(i)
4019: AND plan_id = p_copy_plan_ids(i);

Line 4017: DELETE FROM MSC_ALLOC_DEMANDS

4013: (p_time_phased_set = 'Y') THEN
4014:
4015: -- Delete from MSC_ALLOC_DEMANDS
4016: FORALL i IN 1..p_copy_demand_ids.COUNT
4017: DELETE FROM MSC_ALLOC_DEMANDS
4018: WHERE parent_demand_id = p_copy_demand_ids(i)
4019: AND plan_id = p_copy_plan_ids(i);
4020:
4021: ELSE

Line 4023: -- Delete from MSC_ALLOC_DEMANDS

4019: AND plan_id = p_copy_plan_ids(i);
4020:
4021: ELSE
4022:
4023: -- Delete from MSC_ALLOC_DEMANDS
4024: FORALL i IN 1..p_copy_demand_ids.COUNT
4025: DELETE FROM MSC_DEMANDS
4026: WHERE demand_id = p_copy_demand_ids(i)
4027: AND plan_id = p_copy_plan_ids(i);

Line 4049: ' msc_alloc_demands');

4045: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN
4046:
4047: IF PG_DEBUG in ('Y', 'C') THEN
4048: msc_sch_wb.atp_debug('Undo_Delete_Row: before update of ' ||
4049: ' msc_alloc_demands');
4050: END IF;
4051:
4052: /*bug 6642564 we do no want inventory item id to be updated
4053: in case of time phased ATP as,the inventory item id we are picking up

Line 4055: is of member item and msc_alloc_demands could me member item of product

4051:
4052: /*bug 6642564 we do no want inventory item id to be updated
4053: in case of time phased ATP as,the inventory item id we are picking up
4054: from msc_demands but for time phased ATP inventory item id in msc_demands
4055: is of member item and msc_alloc_demands could me member item of product
4056: family item */
4057:
4058: IF p_time_phased_set = 'Y' THEN
4059:

Line 4061: UPDATE msc_alloc_demands

4057:
4058: IF p_time_phased_set = 'Y' THEN
4059:
4060: FORALL m IN 1..p_del_demand_ids.COUNT
4061: UPDATE msc_alloc_demands
4062: SET allocated_quantity = MSC_ATP_UTILS.Truncate_Demand(old_allocated_quantity), --5598066
4063: demand_date = old_demand_date ,
4064: old_allocated_quantity = null,
4065: old_demand_date = null,

Line 4078: UPDATE msc_alloc_demands

4074:
4075: ELSE
4076:
4077: FORALL m IN 1..p_del_demand_ids.COUNT
4078: UPDATE msc_alloc_demands
4079: SET allocated_quantity = MSC_ATP_UTILS.Truncate_Demand(old_allocated_quantity), --5598066
4080: demand_date = old_demand_date ,
4081: old_allocated_quantity = null,
4082: old_demand_date = null,

Line 4861: DELETE FROM msc_alloc_demands

4857:
4858: msc_sch_wb.atp_debug('Delete_Copy_Demand : ' || 'allocated ATP or time phased PF');
4859:
4860: FORALL i IN 1..p_copy_demand_ids.COUNT
4861: DELETE FROM msc_alloc_demands
4862: WHERE parent_demand_id = p_copy_demand_ids(i)
4863: AND plan_id = p_copy_plan_ids(i)
4864: AND refresh_number <= (SELECT nvl(latest_refresh_number,-1)
4865: FROM MSC_PLANS

Line 6061: ' msc_alloc_demands');

6057: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN
6058:
6059: IF PG_DEBUG in ('Y', 'C') THEN
6060: msc_sch_wb.atp_debug('Hide_SD_Rec: before update of' ||
6061: ' msc_alloc_demands');
6062: END IF;
6063:
6064: UPDATE MSC_ALLOC_DEMANDS
6065: SET inventory_item_id = -1*inventory_item_id

Line 6064: UPDATE MSC_ALLOC_DEMANDS

6060: msc_sch_wb.atp_debug('Hide_SD_Rec: before update of' ||
6061: ' msc_alloc_demands');
6062: END IF;
6063:
6064: UPDATE MSC_ALLOC_DEMANDS
6065: SET inventory_item_id = -1*inventory_item_id
6066: WHERE parent_demand_id = c1.identifier3
6067: AND old_allocated_quantity IS NULL
6068: AND plan_id = c1.identifier2

Line 6072: msc_sch_wb.atp_debug('Hide_SD_Rec: ' || 'No. of demand updated from msc_alloc_demands = '|| SQL%ROWCOUNT);

6068: AND plan_id = c1.identifier2
6069: AND inventory_item_id > 0;
6070:
6071: IF PG_DEBUG in ('Y', 'C') THEN
6072: msc_sch_wb.atp_debug('Hide_SD_Rec: ' || 'No. of demand updated from msc_alloc_demands = '|| SQL%ROWCOUNT);
6073: END IF;
6074: END IF;
6075: ELSE -- IF NVL(c1.inventory_item_id, -1) > 0 THEN
6076:

Line 6232: DELETE FROM MSC_ALLOC_DEMANDS

6228: (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
6229: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
6230: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN
6231:
6232: DELETE FROM MSC_ALLOC_DEMANDS
6233: WHERE parent_demand_id = c1.identifier3
6234: AND old_allocated_quantity IS NULL
6235: AND plan_id = c1.identifier2;
6236:

Line 6238: msc_sch_wb.atp_debug('Delete_SD_Rec: ' || 'No. of demand deleted from msc_alloc_demands = '|| SQL%ROWCOUNT);

6234: AND old_allocated_quantity IS NULL
6235: AND plan_id = c1.identifier2;
6236:
6237: IF PG_DEBUG in ('Y', 'C') THEN
6238: msc_sch_wb.atp_debug('Delete_SD_Rec: ' || 'No. of demand deleted from msc_alloc_demands = '|| SQL%ROWCOUNT);
6239: END IF;
6240: END IF;
6241:
6242: ELSE -- IF NVL(c1.inventory_item_id, -1) > 0 THEN

Line 6407: UPDATE MSC_ALLOC_DEMANDS

6403: (MSC_ATP_PVT.G_ALLOCATED_ATP = 'Y') AND
6404: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
6405: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN
6406:
6407: UPDATE MSC_ALLOC_DEMANDS
6408: SET inventory_item_id = -1*inventory_item_id
6409: WHERE parent_demand_id = c1.identifier3
6410: AND old_allocated_quantity IS NULL
6411: AND plan_id = c1.identifier2

Line 6415: msc_sch_wb.atp_debug('Restore_SD_Rec: ' || 'No. of demand updated from msc_alloc_demands = '|| SQL%ROWCOUNT);

6411: AND plan_id = c1.identifier2
6412: AND inventory_item_id < 0;
6413:
6414: IF PG_DEBUG in ('Y', 'C') THEN
6415: msc_sch_wb.atp_debug('Restore_SD_Rec: ' || 'No. of demand updated from msc_alloc_demands = '|| SQL%ROWCOUNT);
6416: END IF;
6417: END IF;
6418:
6419: ELSE -- IF NVL(c1.inventory_item_id, -1) > 0 THEN