DBA Data[Home] [Help]

APPS.MSC_ATP_ALLOC dependencies on MRP_ATP_DETAILS_TEMP

Line 585: into mrp_atp_details_temp.

581: END IF;
582:
583: /*
584: 1. Copy the supply demand records from msc_alloc_supplies and msc_alloc_demands
585: into mrp_atp_details_temp.
586: 2. We copy from_demand_class for stealing records from MSC_ALLOC_SUPPLIES.
587: 3. Allocated Qty <= Total Supply Demand Quantity.
588: 4. MSC_ALLOC_TEMP holds the demand classes on p_request_date. A join between MSC_ALLOC_TEMP
589: and msc_alloc_supplies/msc_alloc_demands ensures we chose only request date demand classes.

Line 629: INSERT INTO MRP_ATP_DETAILS_TEMP

625: RAISE FND_API.G_EXC_ERROR;
626: END IF;
627: -- time_phased_atp changes end
628: ELSE
629: INSERT INTO MRP_ATP_DETAILS_TEMP
630: (session_id, atp_level, inventory_item_id, organization_id, identifier1, identifier3,
631: supply_demand_type, supply_demand_date, supply_demand_quantity, supply_demand_source_type,
632: allocated_quantity, record_type, scenario_id, disposition_name, demand_class, char1,
633: uom_code, plan_id, inventory_item_name, organization_code,

Line 829: MRP_ATP_DETAILS_TEMP

825: SUM(DECODE(SUPPLY_DEMAND_TYPE, 2, ALLOCATED_QUANTITY, 0)) col5, -- Total Supply
826: SUM(DECODE(SUPPLY_DEMAND_TYPE, 1, ALLOCATED_QUANTITY, 0)) col6, -- Total Demand
827: SUM(ALLOCATED_QUANTITY) col7 -- Period Quantity
828: FROM
829: MRP_ATP_DETAILS_TEMP
830: WHERE
831: SESSION_ID = p_session_id
832: AND RECORD_TYPE = l_record_type
833: GROUP BY

Line 1038: into mrp_atp_details_temp. Perform allocation in the process.

1034: END IF;
1035:
1036: /*
1037: 1. Copy the supply demand records from msc_supplies and msc_demands
1038: into mrp_atp_details_temp. Perform allocation in the process.
1039: 2. Forward consumtion logic is such that individual stealing acts cannot be recorded,
1040: therefore, we do not select from_demand_class.
1041: 3. MSC_ALLOC_TEMP here stores allocation demand classes. We make a cartesian to split the supplies/demands
1042: 4. Finally we put only those records where allocated_quantity <> 0

Line 1087: INSERT INTO MRP_ATP_DETAILS_TEMP

1083: IF PG_DEBUG in ('Y', 'C') THEN
1084: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'User defined demand class, Optimized plan');
1085: END IF;
1086:
1087: INSERT INTO MRP_ATP_DETAILS_TEMP
1088: (session_id, atp_level, inventory_item_id, organization_id, identifier1, identifier3,
1089: supply_demand_type, supply_demand_date, supply_demand_quantity, supply_demand_source_type,
1090: allocated_quantity, record_type, scenario_id, disposition_name, demand_class, uom_code,
1091: inventory_item_name, organization_code, identifier2, identifier4,

Line 1460: INSERT INTO MRP_ATP_DETAILS_TEMP

1456: IF PG_DEBUG in ('Y', 'C') THEN
1457: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'User defined demand class, Unoptimized plan');
1458: END IF;
1459:
1460: INSERT INTO MRP_ATP_DETAILS_TEMP
1461: (session_id, atp_level, inventory_item_id, organization_id, identifier1, identifier3,
1462: supply_demand_type, supply_demand_date, supply_demand_quantity, supply_demand_source_type,
1463: allocated_quantity, record_type, scenario_id, disposition_name, demand_class, uom_code,
1464: inventory_item_name, organization_code, identifier2, identifier4,

Line 1857: FROM MRP_ATP_DETAILS_TEMP

1853: SUM(DECODE(SUPPLY_DEMAND_TYPE, 2, SUPPLY_DEMAND_QUANTITY, 0)) col7,
1854: SUM(DECODE(SUPPLY_DEMAND_TYPE, 1, SUPPLY_DEMAND_QUANTITY, 0)) col8,
1855: SUM(SUPPLY_DEMAND_QUANTITY) col9,
1856: IDENTIFIER4 col10
1857: FROM MRP_ATP_DETAILS_TEMP
1858: WHERE SESSION_ID = p_session_id
1859: AND RECORD_TYPE = l_record_type
1860: GROUP BY DEMAND_CLASS, SUPPLY_DEMAND_DATE,
1861: IDENTIFIER2, IDENTIFIER4

Line 2021: into mrp_atp_details_temp in case of Customer Class Allocated ATP.

2017:
2018:
2019: /*
2020: 1. Copy the supply demand records from msc_supplies and msc_demands
2021: into mrp_atp_details_temp in case of Customer Class Allocated ATP.
2022: 2. Forward consumtion logic is such that individual stealing acts cannot be recorded,
2023: therefore, we do not select from_demand_class.
2024: But we select partner_id and partner_site_id, class and demand_class.
2025: 3. Finally we put only those records where allocated_quantity <> 0

Line 2070: INSERT INTO MRP_ATP_DETAILS_TEMP

2066: IF PG_DEBUG in ('Y', 'C') THEN
2067: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'User defined customer class, Optimized plan');
2068: END IF;
2069:
2070: INSERT INTO MRP_ATP_DETAILS_TEMP
2071: (session_id, atp_level, inventory_item_id, organization_id, identifier1, identifier3,
2072: supply_demand_type, supply_demand_date, supply_demand_quantity, supply_demand_source_type,
2073: allocated_quantity, record_type, scenario_id, disposition_name, demand_class, class, customer_id,
2074: customer_site_id, uom_code, inventory_item_name, organization_code, identifier2, identifier4,

Line 2443: INSERT INTO MRP_ATP_DETAILS_TEMP

2439: IF PG_DEBUG in ('Y', 'C') THEN
2440: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'User defined customer class, Unoptimized plan');
2441: END IF;
2442:
2443: INSERT INTO MRP_ATP_DETAILS_TEMP
2444: (session_id, atp_level, inventory_item_id, organization_id, identifier1, identifier3,
2445: supply_demand_type, supply_demand_date, supply_demand_quantity, supply_demand_source_type,
2446: allocated_quantity, record_type, scenario_id, disposition_name, demand_class, class, customer_id,
2447: customer_site_id, uom_code, inventory_item_name, organization_code, identifier2, identifier4,

Line 2859: FROM MRP_ATP_DETAILS_TEMP

2855: SUM(DECODE(SUPPLY_DEMAND_TYPE, 2, SUPPLY_DEMAND_QUANTITY, 0)) col10,
2856: SUM(DECODE(SUPPLY_DEMAND_TYPE, 1, SUPPLY_DEMAND_QUANTITY, 0)) col11,
2857: SUM(SUPPLY_DEMAND_QUANTITY) col12,
2858: CUSTOMER_SITE_ID col13
2859: FROM MRP_ATP_DETAILS_TEMP
2860: WHERE SESSION_ID = p_session_id
2861: AND RECORD_TYPE = l_record_type
2862: GROUP BY DEMAND_CLASS, SUPPLY_DEMAND_DATE, IDENTIFIER2, IDENTIFIER4,
2863: CLASS, CUSTOMER_ID, CUSTOMER_SITE_ID

Line 3050: INSERT INTO MRP_ATP_DETAILS_TEMP

3046: /* rajjain 02/12/2003 bug 2795992
3047: IF G_ROUNDING_CONTROL_FLAG=1 THEN
3048: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will round off.');
3049: FORALL l_period_counter IN 1..p_atp_period.Period_Start_Date.COUNT
3050: INSERT INTO MRP_ATP_DETAILS_TEMP
3051: (
3052: session_id,
3053: scenario_id,
3054: atp_level,

Line 3095: INSERT INTO MRP_ATP_DETAILS_TEMP

3091: );
3092: ELSE -- IF G_ROUNDING_CONTROL_FLAG=1 THEN
3093: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will not round off.');*/
3094: FORALL l_period_counter IN 1..p_atp_period.Period_Start_Date.COUNT
3095: INSERT INTO MRP_ATP_DETAILS_TEMP
3096: (
3097: session_id,
3098: scenario_id,
3099: atp_level,

Line 3165: INSERT INTO MRP_ATP_DETAILS_TEMP

3161: -- Now do the summing for Total.
3162: IF PG_DEBUG in ('Y', 'C') THEN
3163: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Before the summing SQL for Total');
3164: END IF;
3165: INSERT INTO MRP_ATP_DETAILS_TEMP
3166: (
3167: session_id,
3168: scenario_id,
3169: atp_level,

Line 3260: MRP_ATP_DETAILS_TEMP madt,

3256: MSC_ATP_PVT.INFINITE_NUMBER,
3257: -- rajjain 02/13/2003 Bug 2795372
3258: SUM(GREATEST(madt.cumulative_quantity, 0))) cumulative_quantity
3259: FROM
3260: MRP_ATP_DETAILS_TEMP madt,
3261: (SELECT DISTINCT(period_start_date) period_start_date
3262: FROM MRP_ATP_DETAILS_TEMP
3263: WHERE session_id = p_session_id
3264: AND record_type = l_record_type) mapt

Line 3262: FROM MRP_ATP_DETAILS_TEMP

3258: SUM(GREATEST(madt.cumulative_quantity, 0))) cumulative_quantity
3259: FROM
3260: MRP_ATP_DETAILS_TEMP madt,
3261: (SELECT DISTINCT(period_start_date) period_start_date
3262: FROM MRP_ATP_DETAILS_TEMP
3263: WHERE session_id = p_session_id
3264: AND record_type = l_record_type) mapt
3265: WHERE
3266: madt.session_id = p_session_id

Line 3298: INSERT INTO MRP_ATP_DETAILS_TEMP

3294: /* rajjain 02/12/2003 bug 2795992
3295: IF G_ROUNDING_CONTROL_FLAG=1 THEN
3296: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will round off.');
3297: FORALL l_period_counter IN 1..p_atp_period.Period_Start_Date.COUNT
3298: INSERT INTO MRP_ATP_DETAILS_TEMP
3299: (
3300: session_id,
3301: scenario_id,
3302: atp_level,

Line 3343: INSERT INTO MRP_ATP_DETAILS_TEMP

3339: );
3340: ELSE -- IF G_ROUNDING_CONTROL_FLAG=1 THEN
3341: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will not round off.');*/
3342: FORALL l_period_counter IN 1..p_atp_period.Period_Start_Date.COUNT
3343: INSERT INTO MRP_ATP_DETAILS_TEMP
3344: (
3345: session_id,
3346: scenario_id,
3347: atp_level,

Line 3399: INSERT INTO MRP_ATP_DETAILS_TEMP

3395: /* rajjain 02/12/2003 bug 2795992
3396: IF G_ROUNDING_CONTROL_FLAG=1 THEN
3397: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will round off.');
3398: FORALL l_period_counter IN 1..p_atp_period.Period_Start_Date.COUNT
3399: INSERT INTO MRP_ATP_DETAILS_TEMP
3400: (
3401: session_id,
3402: scenario_id,
3403: atp_level,

Line 3446: INSERT INTO MRP_ATP_DETAILS_TEMP

3442: );
3443: ELSE -- IF G_ROUNDING_CONTROL_FLAG=1 THEN
3444: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will not round off.');*/
3445: FORALL l_period_counter IN 1..p_atp_period.Period_Start_Date.COUNT
3446: INSERT INTO MRP_ATP_DETAILS_TEMP
3447: (
3448: session_id,
3449: scenario_id,
3450: atp_level,

Line 3514: INSERT INTO MRP_ATP_DETAILS_TEMP

3510: -- Now do the summing for Total.
3511: IF PG_DEBUG in ('Y', 'C') THEN
3512: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Before the summing SQL for Total');
3513: END IF;
3514: INSERT INTO MRP_ATP_DETAILS_TEMP
3515: (
3516: session_id,
3517: scenario_id,
3518: atp_level,

Line 3600: MRP_ATP_DETAILS_TEMP madt

3596: p_infinite_time_fence_date,
3597: MSC_ATP_PVT.INFINITE_NUMBER,
3598: SUM(madt.adjusted_cum_quantity)) adjusted_cum_quantity
3599: FROM
3600: MRP_ATP_DETAILS_TEMP madt
3601: WHERE
3602: madt.session_id = p_session_id
3603: AND madt.record_type = l_record_type
3604: AND madt.demand_class <> G_UNALLOCATED_DC

Line 3611: UPDATE MRP_ATP_DETAILS_TEMP madt

3607: ) final;
3608:
3609: /* New allocation logic for time phased ATP changes begin */
3610: IF (p_dest_inv_item_id <> p_dest_family_item_id) and (G_ATF_Date is not null) THEN
3611: UPDATE MRP_ATP_DETAILS_TEMP madt
3612: SET (Actual_Allocation_Percent, Allocation_Percent)=
3613: (SELECT mv.allocation_percent, mv.level_alloc_percent
3614: FROM MSC_ITEM_HIERARCHY_MV mv
3615: WHERE mv.Demand_Class = madt.Demand_Class

Line 3629: UPDATE MRP_ATP_DETAILS_TEMP madt

3625: WHERE madt.Record_Type = 1
3626: AND madt.Session_Id = p_session_id;
3627: ELSE
3628: /* Removed join with msc_system_items as part of New allocation logic for time phased ATP changes*/
3629: UPDATE MRP_ATP_DETAILS_TEMP madt
3630: --rajjain 02/13/2003 Bug 2795636
3631: --SET (Allocation_Percent, Actual_Allocation_Percent)=
3632: SET (Actual_Allocation_Percent, Allocation_Percent)=
3633: (SELECT mv.allocation_percent, mv.level_alloc_percent

Line 3669: INSERT INTO MRP_ATP_DETAILS_TEMP

3665: /* rajjain 02/12/2003 bug 2795992
3666: IF G_ROUNDING_CONTROL_FLAG=1 THEN
3667: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will round off.');
3668: FORALL l_period_counter IN 1..p_atp_period.Period_Start_Date.COUNT
3669: INSERT INTO MRP_ATP_DETAILS_TEMP
3670: (
3671: session_id,
3672: scenario_id,
3673: atp_level,

Line 3720: INSERT INTO MRP_ATP_DETAILS_TEMP

3716: );
3717: ELSE -- IF G_ROUNDING_CONTROL_FLAG=1 THEN
3718: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will not round off.');*/
3719: FORALL l_period_counter IN 1..p_atp_period.Period_Start_Date.COUNT
3720: INSERT INTO MRP_ATP_DETAILS_TEMP
3721: (
3722: session_id,
3723: scenario_id,
3724: atp_level,

Line 3782: INSERT INTO MRP_ATP_DETAILS_TEMP

3778: /* rajjain 02/12/2003 bug 2795992
3779: IF G_ROUNDING_CONTROL_FLAG=1 THEN
3780: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will round off.');
3781: FORALL l_period_counter IN 1..p_atp_period.Period_Start_Date.COUNT
3782: INSERT INTO MRP_ATP_DETAILS_TEMP
3783: (
3784: session_id,
3785: scenario_id,
3786: atp_level,

Line 3835: INSERT INTO MRP_ATP_DETAILS_TEMP

3831: );
3832: ELSE -- IF G_ROUNDING_CONTROL_FLAG=1 THEN
3833: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will not round off.');*/
3834: FORALL l_period_counter IN 1..p_atp_period.Period_Start_Date.COUNT
3835: INSERT INTO MRP_ATP_DETAILS_TEMP
3836: (
3837: session_id,
3838: scenario_id,
3839: atp_level,

Line 3909: INSERT INTO MRP_ATP_DETAILS_TEMP

3905:
3906: IF PG_DEBUG in ('Y', 'C') THEN
3907: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Before the summing SQL for customer level');
3908: END IF;
3909: INSERT INTO MRP_ATP_DETAILS_TEMP
3910: (
3911: session_id,
3912: scenario_id,
3913: atp_level,

Line 4002: MRP_ATP_DETAILS_TEMP madt

3998: p_infinite_time_fence_date,
3999: MSC_ATP_PVT.INFINITE_NUMBER,
4000: SUM(madt.adjusted_cum_quantity)) adjusted_cum_quantity
4001: FROM
4002: MRP_ATP_DETAILS_TEMP madt
4003: WHERE
4004: madt.session_id = p_session_id
4005: AND madt.record_type = l_record_type
4006: AND madt.ATP_Level = 3

Line 4039: INSERT INTO MRP_ATP_DETAILS_TEMP

4035: IF PG_DEBUG in ('Y', 'C') THEN
4036: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Before the summing SQL for customer class level');
4037: END IF;
4038:
4039: INSERT INTO MRP_ATP_DETAILS_TEMP
4040: (
4041: session_id,
4042: scenario_id,
4043: atp_level,

Line 4129: MRP_ATP_DETAILS_TEMP madt

4125: p_infinite_time_fence_date,
4126: MSC_ATP_PVT.INFINITE_NUMBER,
4127: SUM(madt.adjusted_cum_quantity)) adjusted_cum_quantity
4128: FROM
4129: MRP_ATP_DETAILS_TEMP madt
4130: WHERE
4131: madt.session_id = p_session_id
4132: AND madt.record_type = l_record_type
4133: AND madt.ATP_Level = 2

Line 4165: INSERT INTO MRP_ATP_DETAILS_TEMP

4161: IF PG_DEBUG in ('Y', 'C') THEN
4162: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Before the summing SQL at grand total level');
4163: END IF;
4164:
4165: INSERT INTO MRP_ATP_DETAILS_TEMP
4166: (
4167: session_id,
4168: scenario_id,
4169: atp_level,

Line 4252: MRP_ATP_DETAILS_TEMP madt

4248: p_infinite_time_fence_date,
4249: MSC_ATP_PVT.INFINITE_NUMBER,
4250: SUM(madt.adjusted_cum_quantity)) adjusted_cum_quantity
4251: FROM
4252: MRP_ATP_DETAILS_TEMP madt
4253: WHERE
4254: madt.session_id = p_session_id
4255: AND madt.record_type = l_record_type
4256: AND madt.ATP_Level = 1

Line 4276: UPDATE MRP_ATP_DETAILS_TEMP madt

4272: END IF;
4273:
4274: /* New allocation logic for time phased ATP changes begin */
4275: IF (p_dest_inv_item_id <> p_dest_family_item_id) and (G_ATF_Date is not null) THEN
4276: UPDATE MRP_ATP_DETAILS_TEMP madt
4277: --rajjain 02/13/2003 Bug 2795636
4278: --SET (Allocation_Percent, Actual_Allocation_Percent)=
4279: SET (Actual_Allocation_Percent, Allocation_Percent)=
4280: (SELECT mv.allocation_percent, mv.level_alloc_percent

Line 4298: UPDATE MRP_ATP_DETAILS_TEMP madt

4294: WHERE madt.Record_Type = 1
4295: AND madt.Session_Id = p_session_id;
4296: ELSE
4297: /* Removed join with msc_system_items as part of New allocation logic for time phased ATP changes*/
4298: UPDATE MRP_ATP_DETAILS_TEMP madt
4299: --rajjain 02/13/2003 Bug 2795636
4300: --SET (Allocation_Percent, Actual_Allocation_Percent)=
4301: SET (Actual_Allocation_Percent, Allocation_Percent)=
4302: (SELECT mv.allocation_percent, mv.level_alloc_percent