DBA Data[Home] [Help]

APPS.MSC_AATP_PVT dependencies on MSC_SCH_WB

Line 35: msc_sch_wb.atp_debug(p_msg || p_atp_info.atp_period(i) || ':' ||

31: i PLS_INTEGER;
32: BEGIN
33: i := p_atp_info.atp_qty.FIRST;
34: while i is not null loop
35: msc_sch_wb.atp_debug(p_msg || p_atp_info.atp_period(i) || ':' ||
36: p_atp_info.atp_qty(i));
37: i := p_atp_info.atp_qty.NEXT(i);
38: end loop;
39: END Print_Period_Qty;

Line 50: msc_sch_wb.atp_debug('**** PROCEDURE move_SD_plsql_into_SD_temp ****');

46: -- ship_rec_cal
47: l_sysdate DATE := trunc(sysdate); --4135752
48: BEGIN
49: IF PG_DEBUG in ('Y', 'C') THEN
50: msc_sch_wb.atp_debug('**** PROCEDURE move_SD_plsql_into_SD_temp ****');
51: END IF;
52:
53: FORALL k IN 1..x_atp_supply_demand.Level.COUNT
54: INSERT INTO msc_atp_sd_details_temp (

Line 148: msc_sch_wb.atp_debug('item_alloc_avail_opt: constrained plan: ' || p_plan_id);

144: x_atp_qtys OUT NoCopy MRP_ATP_PUB.number_arr
145: ) IS
146: BEGIN
147: IF PG_DEBUG in ('Y', 'C') THEN
148: msc_sch_wb.atp_debug('item_alloc_avail_opt: constrained plan: ' || p_plan_id);
149: END IF;
150: -- Bug 3550296 and 3574164. IMPLEMENT_DATE AND DMD_SATISFIED_DATE are changed to
151: -- IMPLEMENT_SHIP_DATE and PLANNED_SHIP_DATE resp.
152: SELECT SD_DATE,

Line 677: msc_sch_wb.atp_debug('item_alloc_avail_unopt: UNconstrained plan: ' || p_plan_id);

673: x_atp_qtys OUT NoCopy MRP_ATP_PUB.number_arr
674: ) IS
675: BEGIN
676: IF PG_DEBUG in ('Y', 'C') THEN
677: msc_sch_wb.atp_debug('item_alloc_avail_unopt: UNconstrained plan: ' || p_plan_id);
678: END IF;
679:
680: SELECT SD_DATE,
681: SUM(SD_QTY)

Line 1057: msc_sch_wb.atp_debug('item_alloc_avail_opt_unalloc: Get unallocated qtys as well. constrained plan: ' || p_plan_id);

1053: x_atp_unalloc_qtys OUT NoCopy MRP_ATP_PUB.number_arr
1054: ) IS
1055: BEGIN
1056: IF PG_DEBUG in ('Y', 'C') THEN
1057: msc_sch_wb.atp_debug('item_alloc_avail_opt_unalloc: Get unallocated qtys as well. constrained plan: ' || p_plan_id);
1058: END IF;
1059: -- Bug 3550296 and 3574164. IMPLEMENT_DATE AND DMD_SATISFIED_DATE are changed to
1060: -- IMPLEMENT_SHIP_DATE and PLANNED_SHIP_DATE resp.
1061: SELECT SD_DATE,

Line 1551: msc_sch_wb.atp_debug('item_alloc_avail_unopt_unalloc: Get unallocated qtys as well. UNconstrained plan: ' || p_plan_id);

1547: x_atp_unalloc_qtys OUT NoCopy MRP_ATP_PUB.number_arr
1548: ) IS
1549: BEGIN
1550: IF PG_DEBUG in ('Y', 'C') THEN
1551: msc_sch_wb.atp_debug('item_alloc_avail_unopt_unalloc: Get unallocated qtys as well. UNconstrained plan: ' || p_plan_id);
1552: END IF;
1553:
1554: SELECT SD_DATE,
1555: SUM(UNALLOC_SD_QTY),

Line 1934: msc_sch_wb.atp_debug('item_alloc_avail_opt_dtls: constrained plan: ' || p_plan_id);

1930: l_null_char VARCHAR2(1);
1931: l_sysdate DATE := trunc(sysdate); --4135752
1932: BEGIN
1933: IF PG_DEBUG in ('Y', 'C') THEN
1934: msc_sch_wb.atp_debug('item_alloc_avail_opt_dtls: constrained plan: ' || p_plan_id);
1935: END IF;
1936:
1937: INSERT INTO msc_atp_sd_details_temp (
1938: ATP_Level,

Line 2561: msc_sch_wb.atp_debug('item_alloc_avail_unopt_dtls: UNconstrained plan: ' || p_plan_id);

2557: l_null_char VARCHAR2(1);
2558: l_sysdate DATE := trunc(sysdate);--4135752
2559: BEGIN
2560: IF PG_DEBUG in ('Y', 'C') THEN
2561: msc_sch_wb.atp_debug('item_alloc_avail_unopt_dtls: UNconstrained plan: ' || p_plan_id);
2562: END IF;
2563:
2564: INSERT INTO msc_atp_sd_details_temp (
2565: ATP_Level,

Line 3090: msc_sch_wb.atp_debug('item_alloc_avail');

3086: x_atp_qtys OUT NoCopy MRP_ATP_PUB.number_arr
3087: ) IS
3088: BEGIN
3089: IF PG_DEBUG in ('Y', 'C') THEN
3090: msc_sch_wb.atp_debug('item_alloc_avail');
3091: END IF;
3092:
3093: IF nvl(p_optimized_plan, 2) = 1 THEN
3094: item_alloc_avail_opt(

Line 3144: msc_sch_wb.atp_debug('item_alloc_avail_unalloc: Get unallocated qtys as well');

3140: x_atp_unalloc_qtys OUT NoCopy MRP_ATP_PUB.number_arr
3141: ) IS
3142: BEGIN
3143: IF PG_DEBUG in ('Y', 'C') THEN
3144: msc_sch_wb.atp_debug('item_alloc_avail_unalloc: Get unallocated qtys as well');
3145: END IF;
3146:
3147: IF nvl(p_optimized_plan, 2) = 1 THEN
3148: item_alloc_avail_opt_unalloc(

Line 3202: msc_sch_wb.atp_debug('item_alloc_avail_dtls');

3198: p_sys_next_date IN DATE) --bug3099066
3199: IS
3200: BEGIN
3201: IF PG_DEBUG in ('Y', 'C') THEN
3202: msc_sch_wb.atp_debug('item_alloc_avail_dtls');
3203: END IF;
3204:
3205: IF nvl(p_optimized_plan, 2) = 1 THEN
3206: item_alloc_avail_opt_dtls(

Line 3261: msc_sch_wb.atp_debug('*******Begin Atp_Demand_Class_Consume Procedure******');

3257: l_allowed_stealing_qty NUMBER;
3258: BEGIN
3259:
3260: IF PG_DEBUG in ('Y', 'C') THEN
3261: msc_sch_wb.atp_debug('*******Begin Atp_Demand_Class_Consume Procedure******');
3262:
3263: m := p_current_atp.atp_period.FIRST;
3264: WHILE m is not null LOOP
3265: msc_sch_wb.atp_debug('Atp_Demand_Class_Consume: ' || 'p_current_atp.atp_period , qty = '||

Line 3265: msc_sch_wb.atp_debug('Atp_Demand_Class_Consume: ' || 'p_current_atp.atp_period , qty = '||

3261: msc_sch_wb.atp_debug('*******Begin Atp_Demand_Class_Consume Procedure******');
3262:
3263: m := p_current_atp.atp_period.FIRST;
3264: WHILE m is not null LOOP
3265: msc_sch_wb.atp_debug('Atp_Demand_Class_Consume: ' || 'p_current_atp.atp_period , qty = '||
3266: p_current_atp.atp_period(m) ||' : '|| p_current_atp.atp_qty(m) );
3267: m := p_current_atp.atp_qty.Next(m);
3268: END LOOP;
3269:

Line 3272: msc_sch_wb.atp_debug('Atp_Demand_Class_Consume: ' || 'p_steal_atp.atp_period and qty = '||

3268: END LOOP;
3269:
3270: m := p_steal_atp.atp_period.FIRST;
3271: WHILE m is not null LOOP
3272: msc_sch_wb.atp_debug('Atp_Demand_Class_Consume: ' || 'p_steal_atp.atp_period and qty = '||
3273: p_steal_atp.atp_period(m) ||' : '|| p_steal_atp.atp_qty(m));
3274: m := p_steal_atp.atp_qty.Next(m);
3275: END LOOP;
3276: END IF;

Line 3307: msc_sch_wb.atp_debug('Atp_Demand_Class_Consume: ' || 'exit at k = ' ||to_char(k)||' and i = ' ||to_char(i));

3303: AND (p_current_atp.atp_period(k+1)>p_steal_atp.atp_period(i)))
3304: THEN
3305: -- this is the starting point, we can exit now
3306: IF PG_DEBUG in ('Y', 'C') THEN
3307: msc_sch_wb.atp_debug('Atp_Demand_Class_Consume: ' || 'exit at k = ' ||to_char(k)||' and i = ' ||to_char(i));
3308: END IF;
3309: EXIT;
3310: ELSE
3311: k := p_current_atp.atp_period.NEXT(k);

Line 3319: msc_sch_wb.atp_debug ('Atp_Demand_Class_Consume: ' || 'starting consumption for (i) th element in stealing tab, start from j th element of current tab. i = '||i || 'j = '||j);

3315:
3316: j:= k;
3317:
3318: IF PG_DEBUG in ('Y', 'C') THEN
3319: msc_sch_wb.atp_debug ('Atp_Demand_Class_Consume: ' || 'starting consumption for (i) th element in stealing tab, start from j th element of current tab. i = '||i || 'j = '||j);
3320: END IF;
3321:
3322: WHILE (NVL(j, -1) > 0) LOOP
3323:

Line 3385: msc_sch_wb.atp_debug ('Add_to_Next_Steal_Atp: ' || 'we are in i loop for current steal, i='||i);

3381: FOR i IN 1..p_current_atp.atp_period.COUNT LOOP
3382: -- we only worry about the neg quantity (that's why we need to steal
3383:
3384: IF PG_DEBUG in ('Y', 'C') THEN
3385: msc_sch_wb.atp_debug ('Add_to_Next_Steal_Atp: ' || 'we are in i loop for current steal, i='||i);
3386: END IF;
3387: IF p_current_atp.atp_qty(i) < 0 THEN
3388: l_processed := FALSE; --1923405
3389: WHILE (j IS NOT NULL) LOOP

Line 3391: msc_sch_wb.atp_debug ('Add_to_Next_Steal_Atp: ' || 'we are in j loop for next steal, j='||j);

3387: IF p_current_atp.atp_qty(i) < 0 THEN
3388: l_processed := FALSE; --1923405
3389: WHILE (j IS NOT NULL) LOOP
3390: IF PG_DEBUG in ('Y', 'C') THEN
3391: msc_sch_wb.atp_debug ('Add_to_Next_Steal_Atp: ' || 'we are in j loop for next steal, j='||j);
3392: END IF;
3393: IF p_next_steal_atp.atp_qty(j) < 0 THEN
3394:
3395: k := k+1;

Line 3560: msc_sch_wb.atp_debug('******* Item_Alloc_Cum_Atp *******');

3556:
3557: BEGIN
3558:
3559: IF PG_DEBUG in ('Y', 'C') THEN
3560: msc_sch_wb.atp_debug('******* Item_Alloc_Cum_Atp *******');
3561: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id );
3562: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_level =' || p_level );
3563: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_identifier =' || p_identifier);
3564: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_scenario_id =' || p_scenario_id);

Line 3561: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id );

3557: BEGIN
3558:
3559: IF PG_DEBUG in ('Y', 'C') THEN
3560: msc_sch_wb.atp_debug('******* Item_Alloc_Cum_Atp *******');
3561: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id );
3562: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_level =' || p_level );
3563: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_identifier =' || p_identifier);
3564: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_scenario_id =' || p_scenario_id);
3565: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);

Line 3562: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_level =' || p_level );

3558:
3559: IF PG_DEBUG in ('Y', 'C') THEN
3560: msc_sch_wb.atp_debug('******* Item_Alloc_Cum_Atp *******');
3561: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id );
3562: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_level =' || p_level );
3563: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_identifier =' || p_identifier);
3564: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_scenario_id =' || p_scenario_id);
3565: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
3566: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);

Line 3563: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_identifier =' || p_identifier);

3559: IF PG_DEBUG in ('Y', 'C') THEN
3560: msc_sch_wb.atp_debug('******* Item_Alloc_Cum_Atp *******');
3561: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id );
3562: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_level =' || p_level );
3563: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_identifier =' || p_identifier);
3564: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_scenario_id =' || p_scenario_id);
3565: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
3566: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);
3567: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_item_id =' || p_request_item_id);

Line 3564: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_scenario_id =' || p_scenario_id);

3560: msc_sch_wb.atp_debug('******* Item_Alloc_Cum_Atp *******');
3561: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id );
3562: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_level =' || p_level );
3563: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_identifier =' || p_identifier);
3564: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_scenario_id =' || p_scenario_id);
3565: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
3566: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);
3567: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_item_id =' || p_request_item_id);
3568: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);

Line 3565: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);

3561: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id );
3562: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_level =' || p_level );
3563: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_identifier =' || p_identifier);
3564: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_scenario_id =' || p_scenario_id);
3565: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
3566: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);
3567: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_item_id =' || p_request_item_id);
3568: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
3569: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);

Line 3566: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);

3562: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_level =' || p_level );
3563: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_identifier =' || p_identifier);
3564: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_scenario_id =' || p_scenario_id);
3565: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
3566: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);
3567: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_item_id =' || p_request_item_id);
3568: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
3569: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
3570: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );

Line 3567: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_item_id =' || p_request_item_id);

3563: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_identifier =' || p_identifier);
3564: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_scenario_id =' || p_scenario_id);
3565: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
3566: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);
3567: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_item_id =' || p_request_item_id);
3568: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
3569: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
3570: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
3571: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_insert_flag =' || p_insert_flag );

Line 3568: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);

3564: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_scenario_id =' || p_scenario_id);
3565: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
3566: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);
3567: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_item_id =' || p_request_item_id);
3568: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
3569: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
3570: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
3571: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_insert_flag =' || p_insert_flag );
3572: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_atf_date =' || p_atf_date );

Line 3569: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);

3565: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
3566: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);
3567: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_item_id =' || p_request_item_id);
3568: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
3569: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
3570: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
3571: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_insert_flag =' || p_insert_flag );
3572: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_atf_date =' || p_atf_date );
3573: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_get_mat_in_rec.sys_next_osc_date =' || p_get_mat_in_rec.sys_next_osc_date); --bug3333114

Line 3570: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );

3566: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);
3567: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_item_id =' || p_request_item_id);
3568: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
3569: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
3570: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
3571: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_insert_flag =' || p_insert_flag );
3572: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_atf_date =' || p_atf_date );
3573: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_get_mat_in_rec.sys_next_osc_date =' || p_get_mat_in_rec.sys_next_osc_date); --bug3333114
3574: END IF;

Line 3571: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_insert_flag =' || p_insert_flag );

3567: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_item_id =' || p_request_item_id);
3568: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
3569: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
3570: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
3571: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_insert_flag =' || p_insert_flag );
3572: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_atf_date =' || p_atf_date );
3573: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_get_mat_in_rec.sys_next_osc_date =' || p_get_mat_in_rec.sys_next_osc_date); --bug3333114
3574: END IF;
3575:

Line 3572: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_atf_date =' || p_atf_date );

3568: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
3569: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
3570: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
3571: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_insert_flag =' || p_insert_flag );
3572: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_atf_date =' || p_atf_date );
3573: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_get_mat_in_rec.sys_next_osc_date =' || p_get_mat_in_rec.sys_next_osc_date); --bug3333114
3574: END IF;
3575:
3576:

Line 3573: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_get_mat_in_rec.sys_next_osc_date =' || p_get_mat_in_rec.sys_next_osc_date); --bug3333114

3569: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
3570: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
3571: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_insert_flag =' || p_insert_flag );
3572: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_atf_date =' || p_atf_date );
3573: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_get_mat_in_rec.sys_next_osc_date =' || p_get_mat_in_rec.sys_next_osc_date); --bug3333114
3574: END IF;
3575:
3576:
3577: /*-----------------------------------------------------------------------------------------+

Line 3628: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error selecting uom_code for the item');

3624: AND sr_inventory_item_id = p_inventory_item_id;
3625: EXCEPTION
3626: WHEN OTHERS THEN
3627: IF PG_DEBUG in ('Y', 'C') THEN
3628: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error selecting uom_code for the item');
3629: END IF;
3630: END;
3631: ELSE
3632: -- we need not select this in case of ATP QUERY as this information is available in G_ITEM_INFO_REC

Line 3656: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Item to be used = ' || l_item_to_use);

3652: l_item_to_use := l_inv_item_id;
3653: END IF;
3654:
3655: IF PG_DEBUG in ('Y', 'C') THEN
3656: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Item to be used = ' || l_item_to_use);
3657: END IF;
3658: /* New allocation logic for time_phased_atp changes end */
3659:
3660: -- select the priority and allocation_percent for that item/demand class.

Line 3669: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error retrieving Priority and Demand Class');

3665: p_demand_class, p_request_date, l_level_id, l_priority, l_allocation_percent, l_return_status);
3666:
3667: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
3668: IF PG_DEBUG in ('Y', 'C') THEN
3669: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error retrieving Priority and Demand Class');
3670: END IF;
3671: END IF;
3672: ELSE
3673: l_priority := -1;

Line 3681: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_allocation_percent = '||l_allocation_percent);

3677: -- find the demand classes that have priority higher (small number) than
3678: -- the requested demand class
3679:
3680: IF PG_DEBUG in ('Y', 'C') THEN
3681: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_allocation_percent = '||l_allocation_percent);
3682: END IF;
3683:
3684: /* rajjain 01/29/2003 Bug 2737596
3685: We don't need to select all demand classes in case this procdure is

Line 3690: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before select the high priority demand class');

3686: called from MSC_AATP_PVT.VIEW_ALLOCATION for view total*/
3687: IF p_identifier <> -1 or (p_identifier = -1 and p_scenario_id <> -1) THEN
3688:
3689: IF PG_DEBUG in ('Y', 'C') THEN
3690: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before select the high priority demand class');
3691: END IF;
3692:
3693: /*AATP Forward Consumption rajjain begin
3694: 1. Now we select all the demand classes in l_demand_class_tab irrespective of demand class for which

Line 3711: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);

3707: -- bug 1680719
3708: IF l_level_id = -1 THEN
3709:
3710: IF PG_DEBUG in ('Y', 'C') THEN
3711: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);
3712: END IF;
3713: SELECT demand_class, priority, allocation_percent
3714: BULK COLLECT INTO l_demand_class_tab, l_demand_class_priority_tab, l_allocation_percent_tab
3715: FROM msc_item_hierarchy_mv

Line 3727: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);

3723:
3724: ELSIF l_level_id = 1 THEN
3725:
3726: IF PG_DEBUG in ('Y', 'C') THEN
3727: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);
3728: END IF;
3729: SELECT demand_class, priority, allocation_percent
3730: BULK COLLECT INTO l_demand_class_tab, l_demand_class_priority_tab, l_allocation_percent_tab
3731: FROM msc_item_hierarchy_mv

Line 3742: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);

3738:
3739: ELSIF l_level_id = 2 THEN
3740:
3741: IF PG_DEBUG in ('Y', 'C') THEN
3742: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);
3743: END IF;
3744: SELECT mv1.demand_class, mv1.priority, mv1.class, mv1.partner_id, 0, mv1.allocation_percent
3745: BULK COLLECT INTO l_demand_class_tab, l_demand_class_priority_tab,
3746: l_class_tab, l_partner_tab, l_fw_consume_tab, l_allocation_percent_tab

Line 3763: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);

3759: -- bug 1680719
3760: -- we need to select the class, partner_id, partner_site_id
3761:
3762: IF PG_DEBUG in ('Y', 'C') THEN
3763: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);
3764: END IF;
3765: SELECT mv1.demand_class, mv1.priority, mv1.class, mv1.partner_id, 0, mv1.allocation_percent
3766: BULK COLLECT INTO l_demand_class_tab, l_demand_class_priority_tab,
3767: l_class_tab, l_partner_tab, l_fw_consume_tab, l_allocation_percent_tab

Line 3784: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_tab.count = '||

3780: /* time_phased_atp changes end */
3781:
3782: mm := l_demand_class_tab.FIRST;
3783: IF PG_DEBUG in ('Y', 'C') THEN
3784: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_tab.count = '||
3785: l_demand_class_tab.count);
3786: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_priority_tab.count = '||
3787: l_demand_class_priority_tab.count);
3788: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_allocation_percent_tab.count = '||

Line 3786: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_priority_tab.count = '||

3782: mm := l_demand_class_tab.FIRST;
3783: IF PG_DEBUG in ('Y', 'C') THEN
3784: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_tab.count = '||
3785: l_demand_class_tab.count);
3786: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_priority_tab.count = '||
3787: l_demand_class_priority_tab.count);
3788: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_allocation_percent_tab.count = '||
3789: l_allocation_percent_tab.count);
3790: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_class_tab.count = '||

Line 3788: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_allocation_percent_tab.count = '||

3784: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_tab.count = '||
3785: l_demand_class_tab.count);
3786: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_priority_tab.count = '||
3787: l_demand_class_priority_tab.count);
3788: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_allocation_percent_tab.count = '||
3789: l_allocation_percent_tab.count);
3790: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_class_tab.count = '||
3791: l_class_tab.count);
3792: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_partner_tab.count = '||

Line 3790: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_class_tab.count = '||

3786: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_priority_tab.count = '||
3787: l_demand_class_priority_tab.count);
3788: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_allocation_percent_tab.count = '||
3789: l_allocation_percent_tab.count);
3790: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_class_tab.count = '||
3791: l_class_tab.count);
3792: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_partner_tab.count = '||
3793: l_partner_tab.count);
3794: END IF;

Line 3792: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_partner_tab.count = '||

3788: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_allocation_percent_tab.count = '||
3789: l_allocation_percent_tab.count);
3790: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_class_tab.count = '||
3791: l_class_tab.count);
3792: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_partner_tab.count = '||
3793: l_partner_tab.count);
3794: END IF;
3795:
3796: END IF;

Line 3835: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_tab.count = '|| l_demand_class_tab.count);

3831: END IF;
3832:
3833: mm := l_demand_class_tab.FIRST;
3834: IF PG_DEBUG in ('Y', 'C') THEN
3835: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_tab.count = '|| l_demand_class_tab.count);
3836: END IF;
3837:
3838: /*AATP Forward Consumption rajjain begin
3839: 1. Level_id in (-1, 1) ->

Line 3853: msc_sch_wb.atp_debug('---------------------l_demand_class_tab'||l_demand_class_tab(mm));--6359986

3849: IF l_level_id in (-1, 1) THEN
3850:
3851: WHILE mm is not null LOOP
3852:
3853: msc_sch_wb.atp_debug('---------------------l_demand_class_tab'||l_demand_class_tab(mm));--6359986
3854: IF (l_demand_class_tab(mm) ='-1') then --6359986
3855: IF(MSC_ATP_PVT.G_ZERO_ALLOCATION_PERC = 'N') THEN --6359986
3856: IF l_allocation_percent_tab(mm) <> 0 THEN
3857: l_lowest_priority_demand_class := l_demand_class_tab(mm);

Line 3860: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority_demand_class: ' ||

3856: IF l_allocation_percent_tab(mm) <> 0 THEN
3857: l_lowest_priority_demand_class := l_demand_class_tab(mm);
3858: l_lowest_priority := l_demand_class_priority_tab(mm);
3859: IF PG_DEBUG in ('Y', 'C') THEN
3860: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority_demand_class: ' ||
3861: l_lowest_priority_demand_class);
3862: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority: ' ||
3863: l_lowest_priority);
3864: END IF;

Line 3862: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority: ' ||

3858: l_lowest_priority := l_demand_class_priority_tab(mm);
3859: IF PG_DEBUG in ('Y', 'C') THEN
3860: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority_demand_class: ' ||
3861: l_lowest_priority_demand_class);
3862: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority: ' ||
3863: l_lowest_priority);
3864: END IF;
3865: EXIT;
3866: END IF;

Line 3871: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority_demand_class: ' ||

3867: ELSE --6359986 start
3868: l_lowest_priority_demand_class := l_demand_class_tab(mm);
3869: l_lowest_priority := l_demand_class_priority_tab(mm);
3870: IF PG_DEBUG in ('Y', 'C') THEN
3871: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority_demand_class: ' ||
3872: l_lowest_priority_demand_class);
3873: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority: ' ||
3874: l_lowest_priority);
3875: END IF;

Line 3873: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority: ' ||

3869: l_lowest_priority := l_demand_class_priority_tab(mm);
3870: IF PG_DEBUG in ('Y', 'C') THEN
3871: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority_demand_class: ' ||
3872: l_lowest_priority_demand_class);
3873: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority: ' ||
3874: l_lowest_priority);
3875: END IF;
3876: EXIT;
3877: END IF;

Line 3883: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority_demand_class: ' ||

3879: ELSE
3880: l_lowest_priority_demand_class := l_demand_class_tab(mm);
3881: l_lowest_priority := l_demand_class_priority_tab(mm);
3882: IF PG_DEBUG in ('Y', 'C') THEN
3883: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority_demand_class: ' ||
3884: l_lowest_priority_demand_class);
3885: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority: ' ||
3886: l_lowest_priority);
3887: END IF;

Line 3885: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority: ' ||

3881: l_lowest_priority := l_demand_class_priority_tab(mm);
3882: IF PG_DEBUG in ('Y', 'C') THEN
3883: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority_demand_class: ' ||
3884: l_lowest_priority_demand_class);
3885: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority: ' ||
3886: l_lowest_priority);
3887: END IF;
3888: EXIT;
3889: END IF; --6359986 end

Line 3932: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'mm: '||mm);

3928: l_fw_consume_tab(mm) := 4;
3929: mm := l_demand_class_tab.Prior(mm);
3930: exit;
3931: END IF; --6359986 end
3932: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'mm: '||mm);
3933: mm := l_demand_class_tab.Prior(mm);
3934: END LOOP;
3935: --l_lowest_priority := trunc(l_demand_class_priority_tab(mm), -3); --5634348, commenting it
3936:

Line 4020: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_tab.count = '||

4016: l_demand_class_tab(i) := p_demand_class;
4017: l_allocation_percent_tab(i) := l_allocation_percent;
4018:
4019: IF PG_DEBUG in ('Y', 'C') THEN
4020: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_tab.count = '||
4021: l_demand_class_tab.count);
4022: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_priority_tab.count = '||
4023: l_demand_class_priority_tab.count);
4024: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_allocation_percent_tab.count = '||

Line 4022: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_priority_tab.count = '||

4018:
4019: IF PG_DEBUG in ('Y', 'C') THEN
4020: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_tab.count = '||
4021: l_demand_class_tab.count);
4022: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_priority_tab.count = '||
4023: l_demand_class_priority_tab.count);
4024: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_allocation_percent_tab.count = '||
4025: l_allocation_percent_tab.count);
4026: END IF;

Line 4024: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_allocation_percent_tab.count = '||

4020: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_tab.count = '||
4021: l_demand_class_tab.count);
4022: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_priority_tab.count = '||
4023: l_demand_class_priority_tab.count);
4024: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_allocation_percent_tab.count = '||
4025: l_allocation_percent_tab.count);
4026: END IF;
4027:
4028: END IF;

Line 4032: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_fw_consume_tab.count = '|| l_fw_consume_tab.count);

4028: END IF;
4029:
4030: mm := l_fw_consume_tab.FIRST;
4031: IF PG_DEBUG in ('Y', 'C') THEN
4032: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_fw_consume_tab.count = '|| l_fw_consume_tab.count);
4033: WHILE mm is not null LOOP
4034: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_fw_consume_tab = '||
4035: l_fw_consume_tab(mm));
4036:

Line 4034: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_fw_consume_tab = '||

4030: mm := l_fw_consume_tab.FIRST;
4031: IF PG_DEBUG in ('Y', 'C') THEN
4032: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_fw_consume_tab.count = '|| l_fw_consume_tab.count);
4033: WHILE mm is not null LOOP
4034: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_fw_consume_tab = '||
4035: l_fw_consume_tab(mm));
4036:
4037: -- krajan : 2745212
4038: mm := l_fw_consume_tab.Next(mm);

Line 4059: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);

4055: l_org_code := MSC_ATP_PVT.G_ORG_INFO_REC.org_code;
4056: /* Modularize Item and Org Info */
4057:
4058: IF PG_DEBUG in ('Y', 'C') THEN
4059: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
4060: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
4061: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
4062: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_default_demand_class'|| l_default_demand_class);
4063: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_org_code'|| l_org_code);

Line 4060: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);

4056: /* Modularize Item and Org Info */
4057:
4058: IF PG_DEBUG in ('Y', 'C') THEN
4059: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
4060: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
4061: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
4062: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_default_demand_class'|| l_default_demand_class);
4063: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_org_code'|| l_org_code);
4064: END IF;

Line 4061: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);

4057:
4058: IF PG_DEBUG in ('Y', 'C') THEN
4059: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
4060: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
4061: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
4062: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_default_demand_class'|| l_default_demand_class);
4063: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_org_code'|| l_org_code);
4064: END IF;
4065: --diag_atp

Line 4062: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_default_demand_class'|| l_default_demand_class);

4058: IF PG_DEBUG in ('Y', 'C') THEN
4059: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
4060: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
4061: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
4062: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_default_demand_class'|| l_default_demand_class);
4063: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_org_code'|| l_org_code);
4064: END IF;
4065: --diag_atp
4066: -- rajjain 01/29/2003 Bug 2737596

Line 4063: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_org_code'|| l_org_code);

4059: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
4060: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
4061: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
4062: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_default_demand_class'|| l_default_demand_class);
4063: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_org_code'|| l_org_code);
4064: END IF;
4065: --diag_atp
4066: -- rajjain 01/29/2003 Bug 2737596
4067: -- Need to call get_infinite_time_fence_date procedure in case call is from View allocation

Line 4078: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_infinite_time_fence_date'|| l_infinite_time_fence_date);

4074: ---diag_atp
4075: l_infinite_time_fence_date := p_get_mat_in_rec.infinite_time_fence_date;
4076: END IF;
4077: IF PG_DEBUG in ('Y', 'C') THEN
4078: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_infinite_time_fence_date'|| l_infinite_time_fence_date);
4079: END IF;
4080:
4081: -- Now go demand class by demand class and calculate the allocated picture
4082: FOR i in 1..l_demand_class_tab.COUNT LOOP

Line 4086: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'in i loop, i = '||i);

4082: FOR i in 1..l_demand_class_tab.COUNT LOOP
4083:
4084: l_demand_class := l_demand_class_tab(i);
4085: IF PG_DEBUG in ('Y', 'C') THEN
4086: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'in i loop, i = '||i);
4087: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class = '||l_demand_class);
4088: END IF;
4089: -- get the daily net availability for DCi
4090: IF (NVL(p_insert_flag, 0) = 0 OR l_demand_class <> p_demand_class) THEN

Line 4087: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class = '||l_demand_class);

4083:
4084: l_demand_class := l_demand_class_tab(i);
4085: IF PG_DEBUG in ('Y', 'C') THEN
4086: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'in i loop, i = '||i);
4087: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class = '||l_demand_class);
4088: END IF;
4089: -- get the daily net availability for DCi
4090: IF (NVL(p_insert_flag, 0) = 0 OR l_demand_class <> p_demand_class) THEN
4091: -- we don't want details

Line 4093: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

4089: -- get the daily net availability for DCi
4090: IF (NVL(p_insert_flag, 0) = 0 OR l_demand_class <> p_demand_class) THEN
4091: -- we don't want details
4092: IF PG_DEBUG in ('Y', 'C') THEN
4093: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4094: 'Inside IF (NVL(p_insert_flag, 0) = 0');
4095: END IF;
4096:
4097: /* AATP Forward Consumption rajjain

Line 4102: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

4098: We calculate unallocated availability alongwith allocated availability calculation
4099: for first demand class if Forward consumption method is method2*/
4100: IF i=1 AND G_ATP_FW_CONSUME_METHOD = 2 THEN
4101: IF PG_DEBUG in ('Y', 'C') THEN
4102: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4103: 'Inside IF i=1 AND Method2');
4104: END IF;
4105: -- time_phased_atp
4106: IF l_time_phased_atp='N' THEN

Line 4143: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error occured in procedure Item_Alloc_Avail_Pf_Unalloc');

4139: l_return_status
4140: );
4141: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4142: IF PG_DEBUG in ('Y', 'C') THEN
4143: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error occured in procedure Item_Alloc_Avail_Pf_Unalloc');
4144: END IF;
4145: RAISE FND_API.G_EXC_ERROR;
4146: END IF;
4147: END IF;

Line 4150: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Before Atp_Consume for l_unallocated_atp');

4146: END IF;
4147: END IF;
4148:
4149: IF PG_DEBUG in ('Y', 'C') THEN
4150: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Before Atp_Consume for l_unallocated_atp');
4151: mm := l_unallocated_atp.atp_qty.FIRST;
4152: while mm is not null loop
4153: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||
4154: l_current_atp.atp_period(mm) || ':' || l_unallocated_atp.atp_qty(mm));

Line 4153: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||

4149: IF PG_DEBUG in ('Y', 'C') THEN
4150: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Before Atp_Consume for l_unallocated_atp');
4151: mm := l_unallocated_atp.atp_qty.FIRST;
4152: while mm is not null loop
4153: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||
4154: l_current_atp.atp_period(mm) || ':' || l_unallocated_atp.atp_qty(mm));
4155: mm := l_unallocated_atp.atp_qty.NEXT(mm);
4156: end loop;
4157: END IF;

Line 4170: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error occured in procedure Pf_Atp_Consume');

4166: MSC_ATP_PF.Bw_Fw_Cum, --b/w, f/w consumption and accumulation
4167: p_atf_date);
4168: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4169: IF PG_DEBUG in ('Y', 'C') THEN
4170: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error occured in procedure Pf_Atp_Consume');
4171: END IF;
4172: RAISE FND_API.G_EXC_ERROR;
4173: END IF;
4174: ELSE

Line 4179: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After Atp_Consume for l_unallocated_atp');

4175: MSC_ATP_PROC.Atp_Consume(l_unallocated_atp.atp_qty, l_unallocated_atp.atp_qty.COUNT);
4176: END IF;
4177:
4178: IF PG_DEBUG in ('Y', 'C') THEN
4179: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After Atp_Consume for l_unallocated_atp');
4180: mm := l_unallocated_atp.atp_qty.FIRST;
4181: while mm is not null loop
4182: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||
4183: l_current_atp.atp_period(mm) || ':' || l_unallocated_atp.atp_qty(mm));

Line 4182: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||

4178: IF PG_DEBUG in ('Y', 'C') THEN
4179: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After Atp_Consume for l_unallocated_atp');
4180: mm := l_unallocated_atp.atp_qty.FIRST;
4181: while mm is not null loop
4182: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||
4183: l_current_atp.atp_period(mm) || ':' || l_unallocated_atp.atp_qty(mm));
4184: mm := l_unallocated_atp.atp_qty.NEXT(mm);
4185: end loop;
4186: END IF;

Line 4190: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

4186: END IF;
4187:
4188: ELSE
4189: IF PG_DEBUG in ('Y', 'C') THEN
4190: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4191: 'Inside ELSE of IF i=1 AND G_ATP_FW_CONSUME_METHOD = 2 THEN');
4192: END IF;
4193: -- time_phased_atp
4194: IF l_time_phased_atp='N' THEN

Line 4228: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error occured in procedure Item_Alloc_Avail_Pf');

4224: l_return_status
4225: );
4226: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4227: IF PG_DEBUG in ('Y', 'C') THEN
4228: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error occured in procedure Item_Alloc_Avail_Pf');
4229: END IF;
4230: RAISE FND_API.G_EXC_ERROR;
4231: END IF;
4232: END IF;

Line 4236: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: After calculating daily net availability');

4232: END IF;
4233: END IF;
4234:
4235: IF PG_DEBUG in ('Y', 'C') THEN
4236: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: After calculating daily net availability');
4237: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ', l_current_atp);
4238: END IF;
4239:
4240: ELSE

Line 4244: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

4240: ELSE
4241: -- IF (NVL(p_insert_flag, 0) <> 0 AND l_demand_class = p_demand_class)
4242: -- OR p_scenario_id = -1
4243: IF PG_DEBUG in ('Y', 'C') THEN
4244: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4245: 'Inside ELSE of IF (NVL(p_insert_flag, 0)=0 OR l_demand_class<>p_demand_class)');
4246: END IF;
4247: MSC_ATP_DB_UTILS.Clear_SD_Details_Temp();
4248:

Line 4291: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error occured in procedure Item_Alloc_Avail_Pf_Dtls');

4287: l_return_status
4288: );
4289: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4290: IF PG_DEBUG in ('Y', 'C') THEN
4291: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error occured in procedure Item_Alloc_Avail_Pf_Dtls');
4292: END IF;
4293: RAISE FND_API.G_EXC_ERROR;
4294: END IF;
4295: END IF;

Line 4299: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after insert into msc_atp_sd_details_temp');

4295: END IF;
4296:
4297: -- for period ATP
4298: IF PG_DEBUG in ('Y', 'C') THEN
4299: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after insert into msc_atp_sd_details_temp');
4300: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'num rows : ' || SQL%ROWCOUNT);
4301: END IF;
4302:
4303: /*AATP Forward Consumption rajjain begin

Line 4300: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'num rows : ' || SQL%ROWCOUNT);

4296:
4297: -- for period ATP
4298: IF PG_DEBUG in ('Y', 'C') THEN
4299: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after insert into msc_atp_sd_details_temp');
4300: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'num rows : ' || SQL%ROWCOUNT);
4301: END IF;
4302:
4303: /*AATP Forward Consumption rajjain begin
4304: If request comes at topmost demand class level get unallocated data

Line 4317: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to get_unalloc_data_from_SD_temp');

4313: END IF;
4314:
4315: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
4316: IF PG_DEBUG in ('Y', 'C') THEN
4317: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to get_unalloc_data_from_SD_temp');
4318: END IF;
4319: END IF;
4320:
4321: IF PG_DEBUG in ('Y', 'C') THEN

Line 4322: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After get_unalloc_data_from_SD_temp');

4318: END IF;
4319: END IF;
4320:
4321: IF PG_DEBUG in ('Y', 'C') THEN
4322: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After get_unalloc_data_from_SD_temp');
4323: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_unallocated_atp.atp_qty.COUNT : '||l_unallocated_atp.atp_qty.COUNT);
4324: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Before Atp_Consume for l_unallocated_atp');
4325: mm := l_unallocated_atp.atp_qty.FIRST;
4326: while mm is not null loop

Line 4323: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_unallocated_atp.atp_qty.COUNT : '||l_unallocated_atp.atp_qty.COUNT);

4319: END IF;
4320:
4321: IF PG_DEBUG in ('Y', 'C') THEN
4322: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After get_unalloc_data_from_SD_temp');
4323: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_unallocated_atp.atp_qty.COUNT : '||l_unallocated_atp.atp_qty.COUNT);
4324: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Before Atp_Consume for l_unallocated_atp');
4325: mm := l_unallocated_atp.atp_qty.FIRST;
4326: while mm is not null loop
4327: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||

Line 4324: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Before Atp_Consume for l_unallocated_atp');

4320:
4321: IF PG_DEBUG in ('Y', 'C') THEN
4322: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After get_unalloc_data_from_SD_temp');
4323: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_unallocated_atp.atp_qty.COUNT : '||l_unallocated_atp.atp_qty.COUNT);
4324: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Before Atp_Consume for l_unallocated_atp');
4325: mm := l_unallocated_atp.atp_qty.FIRST;
4326: while mm is not null loop
4327: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||
4328: x_atp_period.Period_Start_Date(mm) || ':' || l_unallocated_atp.atp_qty(mm));

Line 4327: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||

4323: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_unallocated_atp.atp_qty.COUNT : '||l_unallocated_atp.atp_qty.COUNT);
4324: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Before Atp_Consume for l_unallocated_atp');
4325: mm := l_unallocated_atp.atp_qty.FIRST;
4326: while mm is not null loop
4327: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||
4328: x_atp_period.Period_Start_Date(mm) || ':' || l_unallocated_atp.atp_qty(mm));
4329: mm := l_unallocated_atp.atp_qty.NEXT(mm);
4330: end loop;
4331: END IF;

Line 4344: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error occured in procedure Pf_Atp_Consume');

4340: MSC_ATP_PF.Bw_Fw_Cum, --b/w, f/w consumption and accumulation
4341: p_atf_date);
4342: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4343: IF PG_DEBUG in ('Y', 'C') THEN
4344: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error occured in procedure Pf_Atp_Consume');
4345: END IF;
4346: RAISE FND_API.G_EXC_ERROR;
4347: END IF;
4348: ELSE

Line 4353: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After Atp_Consume for l_unallocated_atp');

4349: MSC_ATP_PROC.Atp_Consume(l_unallocated_atp.atp_qty, l_unallocated_atp.atp_qty.COUNT);
4350: END IF;
4351:
4352: IF PG_DEBUG in ('Y', 'C') THEN
4353: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After Atp_Consume for l_unallocated_atp');
4354: mm := l_unallocated_atp.atp_qty.FIRST;
4355: while mm is not null loop
4356: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||
4357: x_atp_period.Period_Start_Date(mm) || ':' || l_unallocated_atp.atp_qty(mm));

Line 4356: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||

4352: IF PG_DEBUG in ('Y', 'C') THEN
4353: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After Atp_Consume for l_unallocated_atp');
4354: mm := l_unallocated_atp.atp_qty.FIRST;
4355: while mm is not null loop
4356: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||
4357: x_atp_period.Period_Start_Date(mm) || ':' || l_unallocated_atp.atp_qty(mm));
4358: mm := l_unallocated_atp.atp_qty.NEXT(mm);
4359: end loop;
4360: END IF;

Line 4368: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error occured in procedure Get_Period_Data_From_Sd_Temp');

4364: IF l_time_phased_atp='Y' THEN
4365: MSC_ATP_PF.Get_Period_Data_From_Sd_Temp(x_atp_period, l_return_status);
4366: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4367: IF PG_DEBUG in ('Y', 'C') THEN
4368: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error occured in procedure Get_Period_Data_From_Sd_Temp');
4369: END IF;
4370: RAISE FND_API.G_EXC_ERROR;
4371: END IF;
4372: ELSE

Line 4379: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error occured in procedure get_alloc_data_from_SD_temp');

4375: user opens ATP SD window from ATP pegging in allocated scenarios*/
4376: MSC_ATP_PROC.Get_Alloc_Data_From_Sd_Temp(x_atp_period, l_return_status);
4377: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4378: IF PG_DEBUG in ('Y', 'C') THEN
4379: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error occured in procedure get_alloc_data_from_SD_temp');
4380: END IF;
4381: RAISE FND_API.G_EXC_ERROR;
4382: END IF;
4383: END IF;

Line 4386: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Need not get unalloc data from SD temp');

4382: END IF;
4383: END IF;
4384:
4385: IF PG_DEBUG in ('Y', 'C') THEN
4386: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Need not get unalloc data from SD temp');
4387: END IF;
4388: END IF;
4389:
4390: -- old netting code here

Line 4400: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'right after the big query');

4396:
4397: END IF;
4398:
4399: IF PG_DEBUG in ('Y', 'C') THEN
4400: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'right after the big query');
4401: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4402: l_current_atp);
4403: END IF;
4404:

Line 4422: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error occured in procedure Pf_Atp_Consume');

4418: MSC_ATP_PF.Backward, --b/w consumption
4419: p_atf_date);
4420: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4421: IF PG_DEBUG in ('Y', 'C') THEN
4422: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error occured in procedure Pf_Atp_Consume');
4423: END IF;
4424: RAISE FND_API.G_EXC_ERROR;
4425: END IF;
4426: ELSE

Line 4431: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'right after the backward consume');

4427: MSC_ATP_PROC.Atp_Backward_Consume(l_current_atp.atp_qty);
4428: END IF;
4429:
4430: IF PG_DEBUG in ('Y', 'C') THEN
4431: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'right after the backward consume');
4432: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4433: l_current_atp);
4434: END IF;
4435:

Line 4492: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'class changed');

4488: -- class changed. If priority of both classes are not the same,
4489: -- then we need to change the curr_steal_atp at class level.
4490:
4491: IF PG_DEBUG in ('Y', 'C') THEN
4492: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'class changed');
4493: END IF;
4494:
4495: IF trunc(l_demand_class_priority_tab(i), -3) >
4496: trunc(l_demand_class_priority_tab (i-1), -3) THEN

Line 4499: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'class priority changed');

4495: IF trunc(l_demand_class_priority_tab(i), -3) >
4496: trunc(l_demand_class_priority_tab (i-1), -3) THEN
4497:
4498: IF PG_DEBUG in ('Y', 'C') THEN
4499: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'class priority changed');
4500: END IF;
4501: l_class_curr_steal_atp := l_class_next_steal_atp;
4502: l_class_next_steal_atp := l_null_steal_atp;
4503: END IF;

Line 4513: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'same class');

4509: l_next_steal_atp := l_null_steal_atp;
4510:
4511: ELSE
4512: IF PG_DEBUG in ('Y', 'C') THEN
4513: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'same class');
4514: END IF;
4515: IF (l_partner_tab(i) <> l_partner_tab(i-1)) THEN
4516: -- customer changed. If priority of both customers are not the
4517: -- same, we need to change the curr_steal_atp at partner level.

Line 4520: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'customer changed');

4516: -- customer changed. If priority of both customers are not the
4517: -- same, we need to change the curr_steal_atp at partner level.
4518:
4519: IF PG_DEBUG in ('Y', 'C') THEN
4520: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'customer changed');
4521: END IF;
4522:
4523: IF trunc(l_demand_class_priority_tab(i), -2) >
4524: trunc(l_demand_class_priority_tab (i-1), -2) THEN

Line 4526: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'customer priority changed');

4522:
4523: IF trunc(l_demand_class_priority_tab(i), -2) >
4524: trunc(l_demand_class_priority_tab (i-1), -2) THEN
4525: IF PG_DEBUG in ('Y', 'C') THEN
4526: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'customer priority changed');
4527: END IF;
4528:
4529: l_partner_curr_steal_atp := l_partner_next_steal_atp;
4530: l_partner_next_steal_atp := l_null_steal_atp;

Line 4539: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'same customer ');

4535:
4536: ELSE
4537: -- same customer
4538: IF PG_DEBUG in ('Y', 'C') THEN
4539: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'same customer ');
4540: END IF;
4541:
4542: IF (l_demand_class_priority_tab(i) >
4543: l_demand_class_priority_tab (i-1)) THEN

Line 4547: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'site priority changed');

4543: l_demand_class_priority_tab (i-1)) THEN
4544: -- site level priority changed
4545:
4546: IF PG_DEBUG in ('Y', 'C') THEN
4547: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'site priority changed');
4548: END IF;
4549: l_current_steal_atp := l_next_steal_atp;
4550: l_next_steal_atp := l_null_steal_atp;
4551:

Line 4560: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before we decide we need to do dc consumption');

4556: END IF; -- IF (i > 1)
4557:
4558: END IF; -- IF l_level_id IN (-1, 1)
4559: IF PG_DEBUG in ('Y', 'C') THEN
4560: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before we decide we need to do dc consumption');
4561: END IF;
4562: IF (i > 1) THEN
4563: IF ( -- this is the huge condition
4564: ((l_level_id IN (-1, 1)) AND

Line 4584: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class : '||p_demand_class);

4580: l_temp_atp := l_current_atp;
4581: END IF;
4582:
4583: IF PG_DEBUG in ('Y', 'C') THEN
4584: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class : '||p_demand_class);
4585: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_tab(i) : '||l_demand_class_tab(i));
4586: END IF;
4587:
4588: -- 1680719

Line 4585: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_tab(i) : '||l_demand_class_tab(i));

4581: END IF;
4582:
4583: IF PG_DEBUG in ('Y', 'C') THEN
4584: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class : '||p_demand_class);
4585: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_tab(i) : '||l_demand_class_tab(i));
4586: END IF;
4587:
4588: -- 1680719
4589: -- since we have hierarchy now, before we do demand class

Line 4598: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before consume l_class_curr_steal_atp');

4594:
4595: IF l_class_tab(i) <> l_class_tab(1) THEN
4596:
4597: IF PG_DEBUG in ('Y', 'C') THEN
4598: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before consume l_class_curr_steal_atp');
4599: Print_Period_Qty('l_class_curr_steal_atp.atp_period:atp_qty = ',
4600: l_class_curr_steal_atp);
4601: END IF;
4602:

Line 4608: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After consume l_class_curr_steal_atp');

4604: pass p_atf_date to make sure we do not do demand class consumption across ATF*/
4605: MSC_AATP_PVT.Atp_Demand_Class_Consume(l_current_atp, l_class_curr_steal_atp, p_atf_date);
4606:
4607: IF PG_DEBUG in ('Y', 'C') THEN
4608: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After consume l_class_curr_steal_atp');
4609: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4610: l_current_atp);
4611: Print_Period_Qty('l_class_curr_steal_atp.atp_period:atp_qty = ',
4612: l_class_curr_steal_atp);

Line 4628: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before consume l_partner_curr_steal_atp');

4624:
4625: IF (l_class_tab(i) <> l_class_tab(1)) OR
4626: (l_partner_tab(i) <> l_partner_tab(1)) THEN
4627: IF PG_DEBUG in ('Y', 'C') THEN
4628: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before consume l_partner_curr_steal_atp');
4629: END IF;
4630: /* time_phased_atp
4631: pass p_atf_date to make sure we do not do demand class consumption across ATF*/
4632: MSC_AATP_PVT.Atp_Demand_Class_Consume(l_current_atp, l_partner_curr_steal_atp, p_atf_date);

Line 4635: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After consume l_partner_curr_steal_atp');

4631: pass p_atf_date to make sure we do not do demand class consumption across ATF*/
4632: MSC_AATP_PVT.Atp_Demand_Class_Consume(l_current_atp, l_partner_curr_steal_atp, p_atf_date);
4633:
4634: IF PG_DEBUG in ('Y', 'C') THEN
4635: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After consume l_partner_curr_steal_atp');
4636: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4637: l_current_atp);
4638: Print_Period_Qty('l_partner_curr_steal_atp.atp_period:atp_qty = ',
4639: l_partner_curr_steal_atp);

Line 4647: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Before consume current_steal_atp');

4643:
4644: END IF; -- IF l_level_id IN (2,3)
4645:
4646: IF PG_DEBUG in ('Y', 'C') THEN
4647: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Before consume current_steal_atp');
4648: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4649: l_current_atp);
4650: END IF;
4651:

Line 4657: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After consume l_current_steal_atp');

4653: pass p_atf_date to make sure we do not do demand class consumption across ATF*/
4654: MSC_AATP_PVT.Atp_Demand_Class_Consume(l_current_atp, l_current_steal_atp, p_atf_date);
4655:
4656: IF PG_DEBUG in ('Y', 'C') THEN
4657: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After consume l_current_steal_atp');
4658:
4659: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4660: l_current_atp);
4661: Print_Period_Qty('l_current_steal_atp.atp_period:atp_qty = ',

Line 4693: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'k before FOR LOOP = ' || k);

4689: MSC_SATP_FUNC.Extend_Atp_Supply_Demand(l_temp_atp_supply_demand, l_return_status,
4690: l_current_atp.atp_qty.COUNT);
4691:
4692: IF PG_DEBUG in ('Y', 'C') THEN
4693: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'k before FOR LOOP = ' || k);
4694: END IF;
4695:
4696: FOR j in 1..l_current_atp.atp_qty.COUNT LOOP
4697:

Line 4702: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

4698: IF l_current_atp.atp_qty(j) < l_temp_atp.atp_qty(j) THEN
4699: -- this is the stealing quantity in that period
4700:
4701: IF PG_DEBUG in ('Y', 'C') THEN
4702: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4703: 'l_current_atp.atp_qty(j)='||l_current_atp.atp_qty(j));
4704: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4705: 'l_temp_atp.atp_qty(j)='||l_temp_atp.atp_qty(j));
4706: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

Line 4704: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

4700:
4701: IF PG_DEBUG in ('Y', 'C') THEN
4702: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4703: 'l_current_atp.atp_qty(j)='||l_current_atp.atp_qty(j));
4704: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4705: 'l_temp_atp.atp_qty(j)='||l_temp_atp.atp_qty(j));
4706: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4707: 'l_steal_period_quantity='||l_steal_period_quantity);
4708: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

Line 4706: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

4702: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4703: 'l_current_atp.atp_qty(j)='||l_current_atp.atp_qty(j));
4704: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4705: 'l_temp_atp.atp_qty(j)='||l_temp_atp.atp_qty(j));
4706: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4707: 'l_steal_period_quantity='||l_steal_period_quantity);
4708: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4709: 'x_atp_period.period_start_date(j)='||x_atp_period.period_start_date(j));
4710: END IF;

Line 4708: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

4704: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4705: 'l_temp_atp.atp_qty(j)='||l_temp_atp.atp_qty(j));
4706: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4707: 'l_steal_period_quantity='||l_steal_period_quantity);
4708: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4709: 'x_atp_period.period_start_date(j)='||x_atp_period.period_start_date(j));
4710: END IF;
4711:
4712: -- bug 1413459: the stealing quantity should be the current

Line 4769: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'k after FOR LOOP = ' || k);

4765: END IF;
4766: END LOOP;
4767:
4768: IF PG_DEBUG in ('Y', 'C') THEN
4769: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'k after FOR LOOP = ' || k);
4770: END IF;
4771:
4772: --rajjain trim the remaining 12/10/2002
4773: MSC_SATP_FUNC.Trim_Atp_Supply_Demand(l_temp_atp_supply_demand, l_return_status,

Line 4787: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Inside IF l_level_id IN (-1, 1) THEN');

4783:
4784: -- AATP Forward Consumption rajjain begin
4785: IF l_level_id IN (-1, 1) THEN
4786: IF PG_DEBUG in ('Y', 'C') THEN
4787: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Inside IF l_level_id IN (-1, 1) THEN');
4788: END IF;
4789:
4790: /*1. If level_id is in (-1, 1) and forward consumption method is method1
4791: for the lowest priority demand class -> add negatives from l_current_steal to

Line 4798: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This is l_lowest_priority_demand_class');

4794: for the lowest priority demand class -> call Atp_Remove_Negatives to remove
4795: all the negatives from l_current_atp*/
4796: IF l_demand_class = l_lowest_priority_demand_class THEN
4797: IF PG_DEBUG in ('Y', 'C') THEN
4798: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This is l_lowest_priority_demand_class');
4799: END IF;
4800: IF G_ATP_FW_CONSUME_METHOD = 1 THEN
4801: IF PG_DEBUG in ('Y', 'C') THEN
4802: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Method 1');

Line 4802: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Method 1');

4798: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This is l_lowest_priority_demand_class');
4799: END IF;
4800: IF G_ATP_FW_CONSUME_METHOD = 1 THEN
4801: IF PG_DEBUG in ('Y', 'C') THEN
4802: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Method 1');
4803: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
4804: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Add_to_Current_Atp');
4805: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4806: l_current_atp);

Line 4803: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'level = '||l_level_id);

4799: END IF;
4800: IF G_ATP_FW_CONSUME_METHOD = 1 THEN
4801: IF PG_DEBUG in ('Y', 'C') THEN
4802: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Method 1');
4803: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
4804: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Add_to_Current_Atp');
4805: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4806: l_current_atp);
4807: Print_Period_Qty('l_current_steal_atp.atp_period:atp_qty = ',

Line 4804: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Add_to_Current_Atp');

4800: IF G_ATP_FW_CONSUME_METHOD = 1 THEN
4801: IF PG_DEBUG in ('Y', 'C') THEN
4802: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Method 1');
4803: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
4804: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Add_to_Current_Atp');
4805: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4806: l_current_atp);
4807: Print_Period_Qty('l_current_steal_atp.atp_period:atp_qty = ',
4808: l_current_steal_atp);

Line 4814: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Add_to_Current_Atp');

4810:
4811: MSC_AATP_PROC.Add_to_Current_Atp(l_current_steal_atp, l_current_atp, l_return_status);
4812: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
4813: IF PG_DEBUG in ('Y', 'C') THEN
4814: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Add_to_Current_Atp');
4815: END IF;
4816: END IF;
4817: IF PG_DEBUG in ('Y', 'C') THEN
4818: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Add_to_Current_Atp');

Line 4818: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Add_to_Current_Atp');

4814: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Add_to_Current_Atp');
4815: END IF;
4816: END IF;
4817: IF PG_DEBUG in ('Y', 'C') THEN
4818: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Add_to_Current_Atp');
4819: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4820: l_current_atp);
4821: END IF;
4822:

Line 4826: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Forward_Consume');

4822:
4823: MSC_AATP_PROC.Atp_Forward_Consume(l_current_atp.atp_period, p_atf_date, l_current_atp.atp_qty, l_return_status);
4824: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
4825: IF PG_DEBUG in ('Y', 'C') THEN
4826: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Forward_Consume');
4827: END IF;
4828: END IF;
4829:
4830: IF PG_DEBUG in ('Y', 'C') THEN

Line 4831: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Atp_Forward_Consume for last demand class');

4827: END IF;
4828: END IF;
4829:
4830: IF PG_DEBUG in ('Y', 'C') THEN
4831: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Atp_Forward_Consume for last demand class');
4832: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4833: l_current_atp);
4834: END IF;
4835:

Line 4843: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Remove_Negatives');

4839:
4840: MSC_AATP_PROC.Atp_Remove_Negatives(l_current_atp.atp_qty, l_return_status);
4841: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
4842: IF PG_DEBUG in ('Y', 'C') THEN
4843: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Remove_Negatives');
4844: END IF;
4845: END IF;
4846:
4847: IF PG_DEBUG in ('Y', 'C') THEN

Line 4848: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Atp_Remove_Negatives');

4844: END IF;
4845: END IF;
4846:
4847: IF PG_DEBUG in ('Y', 'C') THEN
4848: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Atp_Remove_Negatives');
4849: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4850: l_current_atp);
4851: END IF;
4852:

Line 4855: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Method 2');

4851: END IF;
4852:
4853: ELSE
4854: IF PG_DEBUG in ('Y', 'C') THEN
4855: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Method 2');
4856: END IF;
4857: MSC_AATP_PROC.Atp_remove_negatives(l_current_atp.atp_qty, l_return_status);
4858: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
4859: IF PG_DEBUG in ('Y', 'C') THEN

Line 4860: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_remove_negatives');

4856: END IF;
4857: MSC_AATP_PROC.Atp_remove_negatives(l_current_atp.atp_qty, l_return_status);
4858: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
4859: IF PG_DEBUG in ('Y', 'C') THEN
4860: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_remove_negatives');
4861: END IF;
4862: END IF;
4863:
4864: END IF;

Line 4868: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This is not the l_lowest_priority_demand_class');

4864: END IF;
4865:
4866: ELSE
4867: IF PG_DEBUG in ('Y', 'C') THEN
4868: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This is not the l_lowest_priority_demand_class');
4869: END IF;
4870: IF l_demand_class_priority_tab(i) < l_lowest_priority OR G_ATP_FW_CONSUME_METHOD = 2 THEN
4871: -- this demand class is not the lowest priority demand class
4872: -- add negatives from l_current_atp to l_next_steal_atp

Line 4874: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: '||'l_demand_class_priority_tab(i)

4870: IF l_demand_class_priority_tab(i) < l_lowest_priority OR G_ATP_FW_CONSUME_METHOD = 2 THEN
4871: -- this demand class is not the lowest priority demand class
4872: -- add negatives from l_current_atp to l_next_steal_atp
4873: IF PG_DEBUG in ('Y', 'C') THEN
4874: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: '||'l_demand_class_priority_tab(i) 4875: ' OR G_ATP_FW_CONSUME_METHOD = 2');
4876: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Add_to_Next_Steal_Atp');
4877: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4878: l_current_atp);

Line 4876: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Add_to_Next_Steal_Atp');

4872: -- add negatives from l_current_atp to l_next_steal_atp
4873: IF PG_DEBUG in ('Y', 'C') THEN
4874: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: '||'l_demand_class_priority_tab(i) 4875: ' OR G_ATP_FW_CONSUME_METHOD = 2');
4876: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Add_to_Next_Steal_Atp');
4877: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4878: l_current_atp);
4879: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',
4880: l_next_steal_atp);

Line 4886: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Add_to_Next_Steal_Atp');

4882:
4883: -- we need to prepare the l_next_steal_atp for next priority
4884: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_atp, l_next_steal_atp);
4885: IF PG_DEBUG in ('Y', 'C') THEN
4886: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Add_to_Next_Steal_Atp');
4887: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4888: l_current_atp);
4889: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',
4890: l_next_steal_atp);

Line 4899: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This is the last element of current priority');

4895: -- this is the last element of current priority, so we also need
4896: -- to add l_steal_atp into l_next_steal_atp if we can not finish
4897: -- the stealing at this priority
4898: IF PG_DEBUG in ('Y', 'C') THEN
4899: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This is the last element of current priority');
4900: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
4901: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
4902:
4903: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',

Line 4900: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'level = '||l_level_id);

4896: -- to add l_steal_atp into l_next_steal_atp if we can not finish
4897: -- the stealing at this priority
4898: IF PG_DEBUG in ('Y', 'C') THEN
4899: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This is the last element of current priority');
4900: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
4901: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
4902:
4903: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',
4904: l_next_steal_atp);

Line 4901: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');

4897: -- the stealing at this priority
4898: IF PG_DEBUG in ('Y', 'C') THEN
4899: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This is the last element of current priority');
4900: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
4901: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
4902:
4903: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',
4904: l_next_steal_atp);
4905: END IF;

Line 4910: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Add_to_Next_Steal_Atp');

4906:
4907: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_steal_atp, l_next_steal_atp);
4908:
4909: IF PG_DEBUG in ('Y', 'C') THEN
4910: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Add_to_Next_Steal_Atp');
4911:
4912: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',
4913: l_next_steal_atp);
4914: END IF;

Line 4923: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This demand class is of l_lowest_priority');

4919: /* this is the lowest priority demand class in case
4920: we have multiple demand classes at lowest priority
4921: do forward consumption for all the lowest priority demand classes for method 1*/
4922: IF PG_DEBUG in ('Y', 'C') THEN
4923: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This demand class is of l_lowest_priority');
4924: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
4925: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4926: 'before Forward Consumption for lowest priority demand classes');
4927: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',

Line 4924: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'level = '||l_level_id);

4920: we have multiple demand classes at lowest priority
4921: do forward consumption for all the lowest priority demand classes for method 1*/
4922: IF PG_DEBUG in ('Y', 'C') THEN
4923: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This demand class is of l_lowest_priority');
4924: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
4925: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4926: 'before Forward Consumption for lowest priority demand classes');
4927: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4928: l_current_atp);

Line 4925: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

4921: do forward consumption for all the lowest priority demand classes for method 1*/
4922: IF PG_DEBUG in ('Y', 'C') THEN
4923: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This demand class is of l_lowest_priority');
4924: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
4925: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4926: 'before Forward Consumption for lowest priority demand classes');
4927: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4928: l_current_atp);
4929: END IF;

Line 4934: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Forward_Consume');

4930:
4931: MSC_AATP_PROC.Atp_Forward_Consume(l_current_atp.atp_period, p_atf_date, l_current_atp.atp_qty, l_return_status);
4932: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
4933: IF PG_DEBUG in ('Y', 'C') THEN
4934: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Forward_Consume');
4935: END IF;
4936: END IF;
4937: IF PG_DEBUG in ('Y', 'C') THEN
4938: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

Line 4938: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

4934: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Forward_Consume');
4935: END IF;
4936: END IF;
4937: IF PG_DEBUG in ('Y', 'C') THEN
4938: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4939: 'after Forward Consumption for lowest priority demand classes');
4940: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4941: l_current_atp);
4942: END IF;

Line 4951: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Remove_Negatives');

4947:
4948: MSC_AATP_PROC.Atp_Remove_Negatives(l_current_atp.atp_qty, l_return_status);
4949: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
4950: IF PG_DEBUG in ('Y', 'C') THEN
4951: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Remove_Negatives');
4952: END IF;
4953: END IF;
4954:
4955: IF PG_DEBUG in ('Y', 'C') THEN

Line 4956: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Atp_Remove_Negatives');

4952: END IF;
4953: END IF;
4954:
4955: IF PG_DEBUG in ('Y', 'C') THEN
4956: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Atp_Remove_Negatives');
4957: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4958: l_current_atp);
4959: END IF;
4960:

Line 4967: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Inside ELSE of IF l_level_id IN (-1, 1) THEN');

4963: END IF;
4964:
4965: ELSE --IF l_level_id IN (-1, 1) THEN
4966: IF PG_DEBUG in ('Y', 'C') THEN
4967: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Inside ELSE of IF l_level_id IN (-1, 1) THEN');
4968: END IF;
4969: IF l_demand_class = l_lowest_priority_demand_class THEN
4970: IF PG_DEBUG in ('Y', 'C') THEN
4971: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This is l_lowest_priority_demand_class');

Line 4971: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This is l_lowest_priority_demand_class');

4967: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Inside ELSE of IF l_level_id IN (-1, 1) THEN');
4968: END IF;
4969: IF l_demand_class = l_lowest_priority_demand_class THEN
4970: IF PG_DEBUG in ('Y', 'C') THEN
4971: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This is l_lowest_priority_demand_class');
4972: END IF;
4973: IF G_ATP_FW_CONSUME_METHOD = 1 THEN
4974: IF PG_DEBUG in ('Y', 'C') THEN
4975: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Method 1');

Line 4975: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Method 1');

4971: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This is l_lowest_priority_demand_class');
4972: END IF;
4973: IF G_ATP_FW_CONSUME_METHOD = 1 THEN
4974: IF PG_DEBUG in ('Y', 'C') THEN
4975: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Method 1');
4976: END IF;
4977: IF l_fw_consume_tab(i) = 4 THEN
4978: -- add all negatives to l_current_atp and do forward consumption
4979: IF PG_DEBUG in ('Y', 'C') THEN

Line 4980: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_fw_consume_tab(i) is 4');

4976: END IF;
4977: IF l_fw_consume_tab(i) = 4 THEN
4978: -- add all negatives to l_current_atp and do forward consumption
4979: IF PG_DEBUG in ('Y', 'C') THEN
4980: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_fw_consume_tab(i) is 4');
4981: END IF;
4982: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_steal_atp, l_next_steal_atp);
4983: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_next_steal_atp, l_partner_next_steal_atp);
4984: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_partner_curr_steal_atp,

Line 4991: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Add_to_Next_Steal_Atp');

4987: l_class_next_steal_atp);
4988: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_class_curr_steal_atp,
4989: l_class_next_steal_atp);
4990: IF PG_DEBUG in ('Y', 'C') THEN
4991: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Add_to_Next_Steal_Atp');
4992:
4993: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4994: l_current_atp);
4995: Print_Period_Qty('l_class_next_steal_atp.atp_period:atp_qty = ',

Line 5001: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Add_to_Current_Atp');

4997: END IF;
4998: MSC_AATP_PROC.Add_to_Current_Atp(l_class_next_steal_atp, l_current_atp, l_return_status);
4999: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5000: IF PG_DEBUG in ('Y', 'C') THEN
5001: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Add_to_Current_Atp');
5002: END IF;
5003: END IF;
5004:
5005: IF PG_DEBUG in ('Y', 'C') THEN

Line 5006: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Add_to_Current_Atp');

5002: END IF;
5003: END IF;
5004:
5005: IF PG_DEBUG in ('Y', 'C') THEN
5006: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Add_to_Current_Atp');
5007:
5008: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5009: l_current_atp);
5010: Print_Period_Qty('l_class_next_steal_atp.atp_period:atp_qty = ',

Line 5016: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Forward_Consume');

5012: END IF;
5013: MSC_AATP_PROC.Atp_Forward_Consume(l_current_atp.atp_period, p_atf_date, l_current_atp.atp_qty, l_return_status);
5014: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5015: IF PG_DEBUG in ('Y', 'C') THEN
5016: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Forward_Consume');
5017: END IF;
5018: END IF;
5019: IF PG_DEBUG in ('Y', 'C') THEN
5020: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Atp_forward_consume');

Line 5020: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Atp_forward_consume');

5016: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Forward_Consume');
5017: END IF;
5018: END IF;
5019: IF PG_DEBUG in ('Y', 'C') THEN
5020: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Atp_forward_consume');
5021:
5022: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5023: l_current_atp);
5024: END IF;

Line 5033: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Remove_Negatives');

5029:
5030: MSC_AATP_PROC.Atp_Remove_Negatives(l_current_atp.atp_qty, l_return_status);
5031: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5032: IF PG_DEBUG in ('Y', 'C') THEN
5033: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Remove_Negatives');
5034: END IF;
5035: END IF;
5036:
5037: IF PG_DEBUG in ('Y', 'C') THEN

Line 5038: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Atp_Remove_Negatives');

5034: END IF;
5035: END IF;
5036:
5037: IF PG_DEBUG in ('Y', 'C') THEN
5038: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Atp_Remove_Negatives');
5039: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5040: l_current_atp);
5041: END IF;
5042: END IF;

Line 5046: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Method 2');

5042: END IF;
5043: ELSE
5044: -- method2, remove negatives from l_current_atp
5045: IF PG_DEBUG in ('Y', 'C') THEN
5046: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Method 2');
5047: END IF;
5048: MSC_AATP_PROC.Atp_remove_negatives(l_current_atp.atp_qty, l_return_status);
5049: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5050: IF PG_DEBUG in ('Y', 'C') THEN

Line 5051: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_remove_negatives');

5047: END IF;
5048: MSC_AATP_PROC.Atp_remove_negatives(l_current_atp.atp_qty, l_return_status);
5049: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5050: IF PG_DEBUG in ('Y', 'C') THEN
5051: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_remove_negatives');
5052: END IF;
5053: END IF;
5054:
5055: END IF;

Line 5058: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

5054:
5055: END IF;
5056: ELSE --IF l_demand_class = l_lowest_priority_demand_class THEN
5057: IF PG_DEBUG in ('Y', 'C') THEN
5058: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5059: 'This is not the l_lowest_priority_demand_class');
5060: END IF;
5061: IF G_ATP_FW_CONSUME_METHOD = 2 OR
5062: (G_ATP_FW_CONSUME_METHOD = 1 AND l_fw_consume_tab(i) = 0) THEN

Line 5064: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Inside IF G_ATP_FW_CONSUME_METHOD = 2 OR '||

5060: END IF;
5061: IF G_ATP_FW_CONSUME_METHOD = 2 OR
5062: (G_ATP_FW_CONSUME_METHOD = 1 AND l_fw_consume_tab(i) = 0) THEN
5063: IF PG_DEBUG in ('Y', 'C') THEN
5064: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Inside IF G_ATP_FW_CONSUME_METHOD = 2 OR '||
5065: '(G_ATP_FW_CONSUME_METHOD = 1 AND l_fw_consume_tab(i) = 0)');
5066: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
5067:
5068: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',

Line 5066: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');

5062: (G_ATP_FW_CONSUME_METHOD = 1 AND l_fw_consume_tab(i) = 0) THEN
5063: IF PG_DEBUG in ('Y', 'C') THEN
5064: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Inside IF G_ATP_FW_CONSUME_METHOD = 2 OR '||
5065: '(G_ATP_FW_CONSUME_METHOD = 1 AND l_fw_consume_tab(i) = 0)');
5066: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
5067:
5068: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5069: l_current_atp);
5070: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',

Line 5077: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Add_to_Next_Steal_Atp');

5073:
5074: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_atp, l_next_steal_atp);
5075:
5076: IF PG_DEBUG in ('Y', 'C') THEN
5077: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Add_to_Next_Steal_Atp');
5078:
5079: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5080: l_current_atp);
5081: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',

Line 5093: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

5089: -- either we are at last record in l_demand_class_tab or
5090: -- we are at last record at current customer class level in l_demand_class_tab or
5091: -- this is the lowest priority customer at customer class level
5092: IF PG_DEBUG in ('Y', 'C') THEN
5093: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5094: 'We are at lowest priority customer at current customer class level ');
5095: END IF;
5096:
5097: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_steal_atp, l_next_steal_atp);

Line 5106: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Adding Add_to_Next_Steal_Atp');

5102: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_partner_next_steal_atp,
5103: l_class_next_steal_atp);
5104: END IF;
5105: IF PG_DEBUG in ('Y', 'C') THEN
5106: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Adding Add_to_Next_Steal_Atp');
5107:
5108: Print_Period_Qty('l_class_next_steal_atp.atp_period:atp_qty = ',
5109: l_class_next_steal_atp);
5110: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',

Line 5120: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

5116:
5117: -- next customer class is at higher priority then this cc
5118: -- add negatives from class_curr_steal to class_next_steal
5119: IF PG_DEBUG in ('Y', 'C') THEN
5120: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5121: 'next customer class is at higher priority then this cc');
5122: END IF;
5123: IF PG_DEBUG in ('Y', 'C') THEN
5124: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');

Line 5124: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');

5120: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5121: 'next customer class is at higher priority then this cc');
5122: END IF;
5123: IF PG_DEBUG in ('Y', 'C') THEN
5124: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
5125:
5126: Print_Period_Qty('l_class_next_steal_atp.atp_period:atp_qty = ',
5127: l_class_next_steal_atp);
5128: Print_Period_Qty('l_class_curr_steal_atp.atp_period:atp_qty = ',

Line 5134: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Adding Add_to_Next_Steal_Atp');

5130: END IF;
5131: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_class_curr_steal_atp,
5132: l_class_next_steal_atp);
5133: IF PG_DEBUG in ('Y', 'C') THEN
5134: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Adding Add_to_Next_Steal_Atp');
5135:
5136: Print_Period_Qty('l_class_next_steal_atp.atp_period:atp_qty = ',
5137: l_class_next_steal_atp);
5138: Print_Period_Qty('l_class_curr_steal_atp.atp_period:atp_qty = ',

Line 5146: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

5142: END IF;
5143:
5144: ELSE
5145: IF PG_DEBUG in ('Y', 'C') THEN
5146: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5147: 'We are not at lowest priority customer at current customer class level ');
5148: END IF;
5149: IF (l_partner_tab(i) <> l_partner_tab(i+1))
5150: OR (G_ATP_FW_CONSUME_METHOD = 1 AND l_fw_consume_tab(i) = 2) THEN

Line 5154: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

5150: OR (G_ATP_FW_CONSUME_METHOD = 1 AND l_fw_consume_tab(i) = 2) THEN
5151: -- either we are at last record at current customer level in l_demand_class_tab or
5152: -- this is the lowest priority site at this customer level
5153: IF PG_DEBUG in ('Y', 'C') THEN
5154: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5155: 'We are at lowest priority customer site at current customer level ');
5156: END IF;
5157: IF PG_DEBUG in ('Y', 'C') THEN
5158: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');

Line 5158: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');

5154: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5155: 'We are at lowest priority customer site at current customer level ');
5156: END IF;
5157: IF PG_DEBUG in ('Y', 'C') THEN
5158: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
5159:
5160: Print_Period_Qty('l_current_steal_atp.atp_period:atp_qty = ',
5161: l_current_steal_atp);
5162: Print_Period_Qty('l_partner_next_steal_atp.atp_period:atp_qty = ',

Line 5175: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Adding Add_to_Next_Steal_Atp');

5171: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_next_steal_atp, l_partner_next_steal_atp);
5172: END IF;
5173:
5174: IF PG_DEBUG in ('Y', 'C') THEN
5175: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Adding Add_to_Next_Steal_Atp');
5176:
5177: Print_Period_Qty('l_current_steal_atp.atp_period:atp_qty = ',
5178: l_current_steal_atp);
5179: Print_Period_Qty('l_partner_next_steal_atp.atp_period:atp_qty = ',

Line 5185: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

5181: END IF;
5182: IF trunc(l_demand_class_priority_tab(i), -2)<
5183: trunc(l_demand_class_priority_tab (i+1), -2) THEN
5184: IF PG_DEBUG in ('Y', 'C') THEN
5185: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5186: 'next customer is at higher priority then this customer');
5187: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
5188:
5189: Print_Period_Qty('l_partner_curr_steal_atp.atp_period:atp_qty = ',

Line 5187: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');

5183: trunc(l_demand_class_priority_tab (i+1), -2) THEN
5184: IF PG_DEBUG in ('Y', 'C') THEN
5185: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5186: 'next customer is at higher priority then this customer');
5187: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
5188:
5189: Print_Period_Qty('l_partner_curr_steal_atp.atp_period:atp_qty = ',
5190: l_partner_curr_steal_atp);
5191: Print_Period_Qty('l_partner_next_steal_atp.atp_period:atp_qty = ',

Line 5199: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Adding Add_to_Next_Steal_Atp');

5195: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_partner_curr_steal_atp,
5196: l_partner_next_steal_atp);
5197:
5198: IF PG_DEBUG in ('Y', 'C') THEN
5199: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Adding Add_to_Next_Steal_Atp');
5200:
5201: Print_Period_Qty('l_partner_curr_steal_atp.atp_period:atp_qty = ',
5202: l_partner_curr_steal_atp);
5203: Print_Period_Qty('l_partner_next_steal_atp.atp_period:atp_qty = ',

Line 5213: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

5209:
5210: ELSE
5211: -- we are not at last site under this customer
5212: IF PG_DEBUG in ('Y', 'C') THEN
5213: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5214: 'we are not at last site under this customer');
5215: END IF;
5216: IF (l_demand_class_priority_tab(i)<>
5217: l_demand_class_priority_tab (i+1)) THEN

Line 5220: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

5216: IF (l_demand_class_priority_tab(i)<>
5217: l_demand_class_priority_tab (i+1)) THEN
5218: -- next site under this customer is not at same priority as this site
5219: IF PG_DEBUG in ('Y', 'C') THEN
5220: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5221: 'next site under this customer is not at same priority as this site');
5222: END IF;
5223: IF PG_DEBUG in ('Y', 'C') THEN
5224: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');

Line 5224: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');

5220: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5221: 'next site under this customer is not at same priority as this site');
5222: END IF;
5223: IF PG_DEBUG in ('Y', 'C') THEN
5224: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
5225:
5226: Print_Period_Qty('l_current_steal_atp.atp_period:atp_qty = ',
5227: l_current_steal_atp);
5228: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',

Line 5233: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Adding Add_to_Next_Steal_Atp');

5229: l_next_steal_atp);
5230: END IF;
5231: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_steal_atp, l_next_steal_atp);
5232: IF PG_DEBUG in ('Y', 'C') THEN
5233: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Adding Add_to_Next_Steal_Atp');
5234:
5235: Print_Period_Qty('l_current_steal_atp.atp_period:atp_qty = ',
5236: l_current_steal_atp);
5237: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',

Line 5248: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_fw_consume_tab(i) = 2');

5244: IF G_ATP_FW_CONSUME_METHOD = 1 AND l_fw_consume_tab(i) <> 0 THEN
5245: IF l_fw_consume_tab(i) = 2 THEN
5246: -- add negatives from l_next_steal_atp to l_current_atp and then do forward consumption
5247: IF PG_DEBUG in ('Y', 'C') THEN
5248: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_fw_consume_tab(i) = 2');
5249: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Current_Atp');
5250:
5251: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5252: l_current_atp);

Line 5249: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Current_Atp');

5245: IF l_fw_consume_tab(i) = 2 THEN
5246: -- add negatives from l_next_steal_atp to l_current_atp and then do forward consumption
5247: IF PG_DEBUG in ('Y', 'C') THEN
5248: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_fw_consume_tab(i) = 2');
5249: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Current_Atp');
5250:
5251: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5252: l_current_atp);
5253: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',

Line 5259: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Add_to_Current_Atp');

5255: END IF;
5256: MSC_AATP_PROC.Add_to_Current_Atp(l_next_steal_atp, l_current_atp, l_return_status);
5257: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5258: IF PG_DEBUG in ('Y', 'C') THEN
5259: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Add_to_Current_Atp');
5260: END IF;
5261: END IF;
5262: IF PG_DEBUG in ('Y', 'C') THEN
5263: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Adding Add_to_Current_Atp');

Line 5263: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Adding Add_to_Current_Atp');

5259: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Add_to_Current_Atp');
5260: END IF;
5261: END IF;
5262: IF PG_DEBUG in ('Y', 'C') THEN
5263: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Adding Add_to_Current_Atp');
5264:
5265: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5266: l_current_atp);
5267: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',

Line 5273: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_fw_consume_tab(i) = 3');

5269: END IF;
5270: ELSIF l_fw_consume_tab(i) = 3 THEN
5271: -- add negatives from l_partner_next_steal_atp to l_current_atp and then do forward consumption
5272: IF PG_DEBUG in ('Y', 'C') THEN
5273: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_fw_consume_tab(i) = 3');
5274: END IF;
5275: IF PG_DEBUG in ('Y', 'C') THEN
5276: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Current_Atp');
5277:

Line 5276: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Current_Atp');

5272: IF PG_DEBUG in ('Y', 'C') THEN
5273: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_fw_consume_tab(i) = 3');
5274: END IF;
5275: IF PG_DEBUG in ('Y', 'C') THEN
5276: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Current_Atp');
5277:
5278: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5279: l_current_atp);
5280: Print_Period_Qty('l_partner_next_steal_atp.atp_period:atp_qty = ',

Line 5286: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Add_to_Current_Atp');

5282: END IF;
5283: MSC_AATP_PROC.Add_to_Current_Atp(l_partner_next_steal_atp, l_current_atp, l_return_status);
5284: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5285: IF PG_DEBUG in ('Y', 'C') THEN
5286: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Add_to_Current_Atp');
5287: END IF;
5288: END IF;
5289: IF PG_DEBUG in ('Y', 'C') THEN
5290: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Adding Add_to_Current_Atp');

Line 5290: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Adding Add_to_Current_Atp');

5286: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Add_to_Current_Atp');
5287: END IF;
5288: END IF;
5289: IF PG_DEBUG in ('Y', 'C') THEN
5290: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Adding Add_to_Current_Atp');
5291:
5292: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5293: l_current_atp);
5294: Print_Period_Qty('l_partner_next_steal_atp.atp_period:atp_qty = ',

Line 5299: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Before Atp_Forward_Consume for Method1');

5295: l_partner_next_steal_atp);
5296: END IF;
5297: END IF;
5298: IF PG_DEBUG in ('Y', 'C') THEN
5299: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Before Atp_Forward_Consume for Method1');
5300: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5301: l_current_atp);
5302: END IF;
5303: MSC_AATP_PROC.Atp_Forward_Consume(l_current_atp.atp_period, p_atf_date, l_current_atp.atp_qty, l_return_status);

Line 5306: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Forward_Consume');

5302: END IF;
5303: MSC_AATP_PROC.Atp_Forward_Consume(l_current_atp.atp_period, p_atf_date, l_current_atp.atp_qty, l_return_status);
5304: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5305: IF PG_DEBUG in ('Y', 'C') THEN
5306: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Forward_Consume');
5307: END IF;
5308: END IF;
5309: IF PG_DEBUG in ('Y', 'C') THEN
5310: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After Atp_Forward_Consume for Method1');

Line 5310: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After Atp_Forward_Consume for Method1');

5306: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Forward_Consume');
5307: END IF;
5308: END IF;
5309: IF PG_DEBUG in ('Y', 'C') THEN
5310: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After Atp_Forward_Consume for Method1');
5311: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5312: l_current_atp);
5313: END IF;
5314:

Line 5322: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Remove_Negatives');

5318:
5319: MSC_AATP_PROC.Atp_Remove_Negatives(l_current_atp.atp_qty, l_return_status);
5320: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5321: IF PG_DEBUG in ('Y', 'C') THEN
5322: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Remove_Negatives');
5323: END IF;
5324: END IF;
5325:
5326: IF PG_DEBUG in ('Y', 'C') THEN

Line 5327: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Atp_Remove_Negatives');

5323: END IF;
5324: END IF;
5325:
5326: IF PG_DEBUG in ('Y', 'C') THEN
5327: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Atp_Remove_Negatives');
5328: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5329: l_current_atp);
5330: END IF;
5331: END IF;

Line 5339: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Before Atp_Accumulate for Method2');

5335:
5336: IF G_ATP_FW_CONSUME_METHOD = 2 THEN
5337: -- method2, do accumulation and then calculate the adjusted cum
5338: IF PG_DEBUG in ('Y', 'C') THEN
5339: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Before Atp_Accumulate for Method2');
5340: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5341: l_current_atp);
5342: END IF;
5343:

Line 5347: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After Atp_Accumulate for Method2');

5343:
5344: MSC_ATP_PROC.Atp_Accumulate(l_current_atp.atp_qty);
5345:
5346: IF PG_DEBUG in ('Y', 'C') THEN
5347: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After Atp_Accumulate for Method2');
5348: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5349: l_current_atp);
5350: END IF;
5351:

Line 5355: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Forward_Consume');

5351:
5352: MSC_AATP_PROC.Atp_Adjusted_Cum(l_current_atp, l_unallocated_atp, l_return_status);
5353: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5354: IF PG_DEBUG in ('Y', 'C') THEN
5355: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Forward_Consume');
5356: END IF;
5357: END IF;
5358: IF PG_DEBUG in ('Y', 'C') THEN
5359: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

Line 5359: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

5355: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Forward_Consume');
5356: END IF;
5357: END IF;
5358: IF PG_DEBUG in ('Y', 'C') THEN
5359: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5360: 'l_current_atp after Atp_Adjusted_Cum for Method2');
5361: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5362: l_current_atp);
5363: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

Line 5363: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

5359: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5360: 'l_current_atp after Atp_Adjusted_Cum for Method2');
5361: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5362: l_current_atp);
5363: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5364: 'l_unallocated_atp after Atp_Adjusted_Cum for Method2');
5365: mm := l_unallocated_atp.atp_qty.FIRST;
5366: while mm is not null loop
5367: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||

Line 5367: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||

5363: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5364: 'l_unallocated_atp after Atp_Adjusted_Cum for Method2');
5365: mm := l_unallocated_atp.atp_qty.FIRST;
5366: while mm is not null loop
5367: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||
5368: l_current_atp.atp_period(mm) || ':' || l_unallocated_atp.atp_qty(mm));
5369: mm := l_unallocated_atp.atp_qty.NEXT(mm);
5370: end loop;
5371: END IF;

Line 5384: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class = '||p_demand_class);

5380: END IF;
5381:
5382: -- 1665110
5383: IF PG_DEBUG in ('Y', 'C') THEN
5384: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class = '||p_demand_class);
5385: END IF;
5386: EXIT WHEN (l_demand_class = p_demand_class);
5387: IF PG_DEBUG in ('Y', 'C') THEN
5388: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after the exit statement, so we did not exit');

Line 5388: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after the exit statement, so we did not exit');

5384: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class = '||p_demand_class);
5385: END IF;
5386: EXIT WHEN (l_demand_class = p_demand_class);
5387: IF PG_DEBUG in ('Y', 'C') THEN
5388: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after the exit statement, so we did not exit');
5389: END IF;
5390:
5391: END LOOP;
5392:

Line 5403: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Right after the Atp_Accumulate');

5399: -- as we have the adjusted cum picture available if forward consumption method is 2
5400: MSC_ATP_PROC.Atp_Accumulate(l_current_atp.atp_qty);
5401:
5402: IF PG_DEBUG in ('Y', 'C') THEN
5403: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Right after the Atp_Accumulate');
5404: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_current_atp.atp_period.count = '||
5405: l_current_atp.atp_period.count);
5406: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_current_atp.atp_qty.count = '||
5407: l_current_atp.atp_qty.count);

Line 5404: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_current_atp.atp_period.count = '||

5400: MSC_ATP_PROC.Atp_Accumulate(l_current_atp.atp_qty);
5401:
5402: IF PG_DEBUG in ('Y', 'C') THEN
5403: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Right after the Atp_Accumulate');
5404: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_current_atp.atp_period.count = '||
5405: l_current_atp.atp_period.count);
5406: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_current_atp.atp_qty.count = '||
5407: l_current_atp.atp_qty.count);
5408: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',

Line 5406: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_current_atp.atp_qty.count = '||

5402: IF PG_DEBUG in ('Y', 'C') THEN
5403: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Right after the Atp_Accumulate');
5404: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_current_atp.atp_period.count = '||
5405: l_current_atp.atp_period.count);
5406: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_current_atp.atp_qty.count = '||
5407: l_current_atp.atp_qty.count);
5408: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5409: l_current_atp);
5410: END IF;

Line 5553: msc_sch_wb.atp_debug('******* Res_Alloc_Cum_Atp *******');

5549:
5550: BEGIN
5551:
5552: IF PG_DEBUG in ('Y', 'C') THEN
5553: msc_sch_wb.atp_debug('******* Res_Alloc_Cum_Atp *******');
5554: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id);
5555: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
5556: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_department_id =' || p_department_id);
5557: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_resource_id =' || p_resource_id);

Line 5554: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id);

5550: BEGIN
5551:
5552: IF PG_DEBUG in ('Y', 'C') THEN
5553: msc_sch_wb.atp_debug('******* Res_Alloc_Cum_Atp *******');
5554: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id);
5555: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
5556: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_department_id =' || p_department_id);
5557: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_resource_id =' || p_resource_id);
5558: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);

Line 5555: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);

5551:
5552: IF PG_DEBUG in ('Y', 'C') THEN
5553: msc_sch_wb.atp_debug('******* Res_Alloc_Cum_Atp *******');
5554: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id);
5555: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
5556: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_department_id =' || p_department_id);
5557: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_resource_id =' || p_resource_id);
5558: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
5559: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);

Line 5556: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_department_id =' || p_department_id);

5552: IF PG_DEBUG in ('Y', 'C') THEN
5553: msc_sch_wb.atp_debug('******* Res_Alloc_Cum_Atp *******');
5554: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id);
5555: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
5556: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_department_id =' || p_department_id);
5557: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_resource_id =' || p_resource_id);
5558: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
5559: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
5560: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );

Line 5557: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_resource_id =' || p_resource_id);

5553: msc_sch_wb.atp_debug('******* Res_Alloc_Cum_Atp *******');
5554: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id);
5555: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
5556: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_department_id =' || p_department_id);
5557: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_resource_id =' || p_resource_id);
5558: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
5559: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
5560: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
5561: END IF;

Line 5558: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);

5554: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id);
5555: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
5556: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_department_id =' || p_department_id);
5557: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_resource_id =' || p_resource_id);
5558: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
5559: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
5560: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
5561: END IF;
5562: MSO_Batch_flag := NVL(fnd_profile.value('MSO_BATCHABLE_FLAG'),'N');

Line 5559: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);

5555: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
5556: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_department_id =' || p_department_id);
5557: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_resource_id =' || p_resource_id);
5558: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
5559: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
5560: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
5561: END IF;
5562: MSO_Batch_flag := NVL(fnd_profile.value('MSO_BATCHABLE_FLAG'),'N');
5563: IF PG_DEBUG in ('Y', 'C') THEN

Line 5560: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );

5556: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_department_id =' || p_department_id);
5557: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_resource_id =' || p_resource_id);
5558: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
5559: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
5560: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
5561: END IF;
5562: MSO_Batch_flag := NVL(fnd_profile.value('MSO_BATCHABLE_FLAG'),'N');
5563: IF PG_DEBUG in ('Y', 'C') THEN
5564: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'MSO_Batch_flag := ' || MSO_Batch_flag);

Line 5564: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'MSO_Batch_flag := ' || MSO_Batch_flag);

5560: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
5561: END IF;
5562: MSO_Batch_flag := NVL(fnd_profile.value('MSO_BATCHABLE_FLAG'),'N');
5563: IF PG_DEBUG in ('Y', 'C') THEN
5564: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'MSO_Batch_flag := ' || MSO_Batch_flag);
5565: END IF;
5566: Begin
5567: SELECT DECODE(plans.plan_type, 4, 2,
5568: DECODE(daily_material_constraints, 1, 1,

Line 5607: msc_sch_wb.atp_debug('Res_alloc_Cum_ATP: l_optimized_plan: ' || l_optimized_plan);

5603: l_optimized_plan := 2;
5604: l_constraint_plan := 0;
5605: END;
5606: IF PG_DEBUG in ('Y', 'C') THEN
5607: msc_sch_wb.atp_debug('Res_alloc_Cum_ATP: l_optimized_plan: ' || l_optimized_plan);
5608: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_constraint_plan =' || l_constraint_plan);
5609: END IF;
5610:
5611: IF (MSO_Batch_Flag = 'Y') and (l_constraint_plan = 1) and (p_batchable_flag = 1) THEN

Line 5608: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_constraint_plan =' || l_constraint_plan);

5604: l_constraint_plan := 0;
5605: END;
5606: IF PG_DEBUG in ('Y', 'C') THEN
5607: msc_sch_wb.atp_debug('Res_alloc_Cum_ATP: l_optimized_plan: ' || l_optimized_plan);
5608: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_constraint_plan =' || l_constraint_plan);
5609: END IF;
5610:
5611: IF (MSO_Batch_Flag = 'Y') and (l_constraint_plan = 1) and (p_batchable_flag = 1) THEN
5612: IF PG_DEBUG in ('Y', 'C') THEN

Line 5613: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Do Batching');

5609: END IF;
5610:
5611: IF (MSO_Batch_Flag = 'Y') and (l_constraint_plan = 1) and (p_batchable_flag = 1) THEN
5612: IF PG_DEBUG in ('Y', 'C') THEN
5613: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Do Batching');
5614: END IF;
5615: l_use_batching := 1;
5616: ELSE
5617: IF PG_DEBUG in ('Y', 'C') THEN

Line 5618: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'No Batching');

5614: END IF;
5615: l_use_batching := 1;
5616: ELSE
5617: IF PG_DEBUG in ('Y', 'C') THEN
5618: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'No Batching');
5619: END IF;
5620: l_use_batching := 0;
5621: END IF;
5622:

Line 5650: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Error retrieving Priority and Demand Class');

5646: p_request_date, l_level_id, l_priority, l_allocation_percent, l_return_status);
5647:
5648: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5649: IF PG_DEBUG in ('Y', 'C') THEN
5650: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Error retrieving Priority and Demand Class');
5651: END IF;
5652: END IF;
5653: ELSE
5654: l_priority := -1;

Line 5664: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_allocation_percent = '||l_allocation_percent);

5660:
5661: -- IF l_allocation_percent <> 0.0 THEN
5662:
5663: IF PG_DEBUG in ('Y', 'C') THEN
5664: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_allocation_percent = '||l_allocation_percent);
5665: END IF;
5666: -- We don't need to select all demand classes in case this procdure is
5667: -- called from MSC_AATP_PVT.VIEW_ALLOCATION as we don't need to take care
5668: -- of any existing stealing.

Line 5672: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'before select the high priority demand class');

5668: -- of any existing stealing.
5669: IF p_identifier <> -1 THEN
5670:
5671: IF PG_DEBUG in ('Y', 'C') THEN
5672: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'before select the high priority demand class');
5673: END IF;
5674:
5675: -- bug 1680719
5676: --bug3948494 Do not select Higher priority DC if the requested DC

Line 5682: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);

5678: IF l_level_id = -1 AND l_priority <> 1 THEN
5679:
5680:
5681: IF PG_DEBUG in ('Y', 'C') THEN
5682: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);
5683: END IF;
5684: SELECT demand_class, priority
5685: BULK COLLECT INTO l_demand_class_tab, l_demand_class_priority_tab
5686: FROM msc_resource_hierarchy_mv

Line 5699: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);

5695:
5696: ELSIF l_level_id = 1 THEN
5697:
5698: IF PG_DEBUG in ('Y', 'C') THEN
5699: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);
5700: END IF;
5701: SELECT demand_class, priority
5702: BULK COLLECT INTO l_demand_class_tab, l_demand_class_priority_tab
5703: FROM msc_resource_hierarchy_mv

Line 5717: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);

5713: ELSIF l_level_id = 2 THEN
5714:
5715:
5716: IF PG_DEBUG in ('Y', 'C') THEN
5717: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);
5718: END IF;
5719: SELECT mv1.demand_class, mv1.priority, mv1.class, mv1.partner_id
5720: BULK COLLECT INTO l_demand_class_tab, l_demand_class_priority_tab,
5721: l_class_tab, l_partner_tab

Line 5740: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);

5736: -- bug 1680719
5737: -- we need to select the class, partner_id, partner_site_id
5738:
5739: IF PG_DEBUG in ('Y', 'C') THEN
5740: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);
5741: END IF;
5742: SELECT mv1.demand_class, mv1.priority, mv1.class, mv1.partner_id
5743: BULK COLLECT INTO l_demand_class_tab, l_demand_class_priority_tab,
5744: l_class_tab, l_partner_tab

Line 5791: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_demand_class_tab and priority = '||

5787: mm := l_demand_class_tab.FIRST;
5788:
5789: WHILE mm is not null LOOP
5790: IF PG_DEBUG in ('Y', 'C') THEN
5791: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_demand_class_tab and priority = '||
5792: l_demand_class_tab(mm) ||' : '|| l_demand_class_priority_tab(mm));
5793: END IF;
5794:
5795: IF l_level_id in (2,3) THEN

Line 5797: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_class_tab and partner = '||

5793: END IF;
5794:
5795: IF l_level_id in (2,3) THEN
5796: IF PG_DEBUG in ('Y', 'C') THEN
5797: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_class_tab and partner = '||
5798: l_class_tab(mm) ||' : '||l_partner_tab(mm));
5799: END IF;
5800: END IF;
5801:

Line 5827: msc_sch_wb.atp_debug('Sys next Date : '||to_char(l_sys_next_date, 'DD-MON-YYYY'));

5823: p_instance_id,
5824: TRUNC(sysdate));
5825:
5826: IF PG_DEBUG in ('Y', 'C') THEN
5827: msc_sch_wb.atp_debug('Sys next Date : '||to_char(l_sys_next_date, 'DD-MON-YYYY'));
5828: END IF;
5829:
5830: IF (l_sys_next_date is NULL) THEN
5831: msc_sch_wb.atp_debug('Sys Next Date is null');

Line 5831: msc_sch_wb.atp_debug('Sys Next Date is null');

5827: msc_sch_wb.atp_debug('Sys next Date : '||to_char(l_sys_next_date, 'DD-MON-YYYY'));
5828: END IF;
5829:
5830: IF (l_sys_next_date is NULL) THEN
5831: msc_sch_wb.atp_debug('Sys Next Date is null');
5832: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.NO_MATCHING_CAL_DATE;
5833: RAISE FND_API.G_EXC_ERROR;
5834: END IF;
5835: --bug3333114 end

Line 5832: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.NO_MATCHING_CAL_DATE;

5828: END IF;
5829:
5830: IF (l_sys_next_date is NULL) THEN
5831: msc_sch_wb.atp_debug('Sys Next Date is null');
5832: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.NO_MATCHING_CAL_DATE;
5833: RAISE FND_API.G_EXC_ERROR;
5834: END IF;
5835: --bug3333114 end
5836:

Line 5838: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);

5834: END IF;
5835: --bug3333114 end
5836:
5837: IF PG_DEBUG in ('Y', 'C') THEN
5838: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
5839: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
5840: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
5841: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_default_demand_class'|| l_default_demand_class);
5842: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_org_code'|| l_org_code);

Line 5839: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);

5835: --bug3333114 end
5836:
5837: IF PG_DEBUG in ('Y', 'C') THEN
5838: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
5839: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
5840: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
5841: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_default_demand_class'|| l_default_demand_class);
5842: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_org_code'|| l_org_code);
5843: END IF;

Line 5840: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);

5836:
5837: IF PG_DEBUG in ('Y', 'C') THEN
5838: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
5839: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
5840: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
5841: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_default_demand_class'|| l_default_demand_class);
5842: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_org_code'|| l_org_code);
5843: END IF;
5844:

Line 5841: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_default_demand_class'|| l_default_demand_class);

5837: IF PG_DEBUG in ('Y', 'C') THEN
5838: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
5839: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
5840: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
5841: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_default_demand_class'|| l_default_demand_class);
5842: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_org_code'|| l_org_code);
5843: END IF;
5844:
5845: FOR i in 1..l_demand_class_tab.COUNT LOOP

Line 5842: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_org_code'|| l_org_code);

5838: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
5839: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
5840: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
5841: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_default_demand_class'|| l_default_demand_class);
5842: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_org_code'|| l_org_code);
5843: END IF;
5844:
5845: FOR i in 1..l_demand_class_tab.COUNT LOOP
5846: l_demand_class := l_demand_class_tab(i);

Line 5848: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'in i loop, i = '||i);

5844:
5845: FOR i in 1..l_demand_class_tab.COUNT LOOP
5846: l_demand_class := l_demand_class_tab(i);
5847: IF PG_DEBUG in ('Y', 'C') THEN
5848: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'in i loop, i = '||i);
5849: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_demand_class = '||l_demand_class);
5850: END IF;
5851: -- get the daily net availability for DCi
5852: IF (NVL(p_insert_flag, 0) = 0 OR l_demand_class <> p_demand_class) THEN

Line 5849: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_demand_class = '||l_demand_class);

5845: FOR i in 1..l_demand_class_tab.COUNT LOOP
5846: l_demand_class := l_demand_class_tab(i);
5847: IF PG_DEBUG in ('Y', 'C') THEN
5848: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'in i loop, i = '||i);
5849: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_demand_class = '||l_demand_class);
5850: END IF;
5851: -- get the daily net availability for DCi
5852: IF (NVL(p_insert_flag, 0) = 0 OR l_demand_class <> p_demand_class) THEN
5853: -- we don't want details

Line 5858: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Constrained Plan Batching');

5854:
5855: IF (l_use_batching = 1) THEN
5856: IF (l_optimized_plan = 1) THEN -- Constrained Plan Bug 2809639
5857: IF PG_DEBUG in ('Y', 'C') THEN
5858: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Constrained Plan Batching');
5859: END IF;
5860: SELECT SD_DATE,
5861: SUM(SD_QTY)
5862: BULK COLLECT INTO

Line 6075: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Other Plans Batching');

6071: GROUP BY SD_DATE
6072: ORDER BY SD_DATE;--4698199
6073: ELSE -- now Other plans Bug 2809639
6074: IF PG_DEBUG in ('Y', 'C') THEN
6075: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Other Plans Batching');
6076: END IF;
6077: SELECT SD_DATE,
6078: SUM(SD_QTY)
6079: BULK COLLECT INTO

Line 6255: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Constrained Plan No Batching');

6251: ELSE --- IF l_use_batching =1 THEN
6252:
6253: IF (l_optimized_plan = 1) THEN -- Constrained Plan Bug 2809639
6254: IF PG_DEBUG in ('Y', 'C') THEN
6255: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Constrained Plan No Batching');
6256: END IF;
6257: SELECT SD_DATE,
6258: SUM(SD_QTY)
6259: BULK COLLECT INTO

Line 6464: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Other Plans No Batching');

6460: GROUP BY SD_DATE
6461: ORDER BY SD_DATE;--4698199
6462: ELSE -- now Other plans Bug 2809639
6463: IF PG_DEBUG in ('Y', 'C') THEN
6464: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Other Plans No Batching');
6465: END IF;
6466: SELECT SD_DATE,
6467: SUM(SD_QTY)
6468: BULK COLLECT INTO

Line 6646: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Constrained Plan Batching Details');

6642:
6643: IF (l_use_batching = 1) THEN
6644: IF (l_optimized_plan = 1) THEN -- Constrained Plan Bug 2809639
6645: IF PG_DEBUG in ('Y', 'C') THEN
6646: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Constrained Plan Batching Details');
6647: END IF;
6648: INSERT INTO msc_atp_sd_details_temp (
6649: ATP_Level,
6650: Order_line_id,

Line 6983: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Other Plans Batching Details');

6979: )
6980: ; -- dsting removed order by col25;
6981: ELSE -- now Other plans Bug 2809639
6982: IF PG_DEBUG in ('Y', 'C') THEN
6983: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Other Plans Batching Details');
6984: END IF;
6985: INSERT INTO msc_atp_sd_details_temp (
6986: ATP_Level,
6987: Order_line_id,

Line 7281: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Constrained Plan No Batching Details');

7277: ELSE
7278:
7279: IF (l_optimized_plan = 1) THEN -- Constrained Plan Bug 2809639
7280: IF PG_DEBUG in ('Y', 'C') THEN
7281: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Constrained Plan No Batching Details');
7282: END IF;
7283: INSERT INTO msc_atp_sd_details_temp (
7284: ATP_Level,
7285: Order_line_id,

Line 7607: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Other Plans No Batching Details');

7603: )
7604: ; -- dsting removed order by col25;
7605: ELSE -- now Other plans Bug 2809639
7606: IF PG_DEBUG in ('Y', 'C') THEN
7607: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Other Plans No Batching Details');
7608: END IF;
7609: INSERT INTO msc_atp_sd_details_temp (
7610: ATP_Level,
7611: Order_line_id,

Line 7894: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'after insert into msc_atp_sd_details_temp');

7890: END IF; --- If l_use_batching =1 then
7891:
7892: -- for period ATP
7893: IF PG_DEBUG in ('Y', 'C') THEN
7894: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'after insert into msc_atp_sd_details_temp');
7895: END IF;
7896: MSC_ATP_PROC.get_period_data_from_SD_temp(x_atp_period);
7897:
7898: l_current_atp.atp_period := x_atp_period.Period_Start_Date;

Line 7906: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'right after the big query');

7902:
7903: END IF;
7904:
7905: IF PG_DEBUG in ('Y', 'C') THEN
7906: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'right after the big query');
7907: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
7908: l_current_atp);
7909: END IF;
7910:

Line 7915: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'right after the backward consume');

7911: -- do backward consumption for DCi
7912: MSC_ATP_PROC.Atp_Backward_Consume(l_current_atp.atp_qty);
7913:
7914: IF PG_DEBUG in ('Y', 'C') THEN
7915: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'right after the backward consume');
7916: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
7917: l_current_atp);
7918: END IF;
7919:

Line 7974: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'class changed');

7970: -- class changed. If priority of both classes are not the same,
7971: -- then we need to change the curr_steal_atp at class level.
7972:
7973: IF PG_DEBUG in ('Y', 'C') THEN
7974: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'class changed');
7975: END IF;
7976:
7977: IF trunc(l_demand_class_priority_tab(i), -3) >
7978: trunc(l_demand_class_priority_tab (i-1), -3) THEN

Line 7981: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'class priority changed');

7977: IF trunc(l_demand_class_priority_tab(i), -3) >
7978: trunc(l_demand_class_priority_tab (i-1), -3) THEN
7979:
7980: IF PG_DEBUG in ('Y', 'C') THEN
7981: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'class priority changed');
7982: END IF;
7983: l_class_curr_steal_atp := l_class_next_steal_atp;
7984: l_class_next_steal_atp := l_null_steal_atp;
7985: END IF;

Line 7995: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'same class');

7991: l_next_steal_atp := l_null_steal_atp;
7992:
7993: ELSE
7994: IF PG_DEBUG in ('Y', 'C') THEN
7995: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'same class');
7996: END IF;
7997: IF (l_partner_tab(i) <> l_partner_tab(i-1)) THEN
7998: -- customer changed. If priority of both customers are not the
7999: -- same, we need to change the curr_steal_atp at partner level.

Line 8002: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'customer changed');

7998: -- customer changed. If priority of both customers are not the
7999: -- same, we need to change the curr_steal_atp at partner level.
8000:
8001: IF PG_DEBUG in ('Y', 'C') THEN
8002: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'customer changed');
8003: END IF;
8004:
8005: IF trunc(l_demand_class_priority_tab(i), -2) >
8006: trunc(l_demand_class_priority_tab (i-1), -2) THEN

Line 8008: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'customer priority changed');

8004:
8005: IF trunc(l_demand_class_priority_tab(i), -2) >
8006: trunc(l_demand_class_priority_tab (i-1), -2) THEN
8007: IF PG_DEBUG in ('Y', 'C') THEN
8008: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'customer priority changed');
8009: END IF;
8010:
8011: l_partner_curr_steal_atp := l_partner_next_steal_atp;
8012: l_partner_next_steal_atp := l_null_steal_atp;

Line 8021: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'same customer ');

8017:
8018: ELSE
8019: -- same customer
8020: IF PG_DEBUG in ('Y', 'C') THEN
8021: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'same customer ');
8022: END IF;
8023:
8024: IF (l_demand_class_priority_tab(i) >
8025: l_demand_class_priority_tab (i-1)) THEN

Line 8029: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'site priority changed');

8025: l_demand_class_priority_tab (i-1)) THEN
8026: -- site level priority changed
8027:
8028: IF PG_DEBUG in ('Y', 'C') THEN
8029: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'site priority changed');
8030: END IF;
8031: l_current_steal_atp := l_next_steal_atp;
8032: l_next_steal_atp := l_null_steal_atp;
8033:

Line 8042: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'before we decide we need to do dc consumption');

8038: END IF; -- IF (i > 1)
8039:
8040: END IF; -- IF l_level_id IN (-1, 1)
8041: IF PG_DEBUG in ('Y', 'C') THEN
8042: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'before we decide we need to do dc consumption');
8043: END IF;
8044:
8045: IF (i > 1) THEN
8046: IF ( -- this is the huge condition

Line 8077: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'before consume l_class_curr_steal_atp');

8073:
8074: IF l_class_tab(i) <> l_class_tab(1) THEN
8075:
8076: IF PG_DEBUG in ('Y', 'C') THEN
8077: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'before consume l_class_curr_steal_atp');
8078: Print_Period_Qty('l_class_curr_steal_atp.atp_period:atp_qty = ',
8079: l_class_curr_steal_atp);
8080: END IF;
8081:

Line 8085: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'After consume l_class_curr_steal_atp');

8081:
8082: MSC_AATP_PVT.Atp_Demand_Class_Consume(l_current_atp, l_class_curr_steal_atp);
8083:
8084: IF PG_DEBUG in ('Y', 'C') THEN
8085: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'After consume l_class_curr_steal_atp');
8086: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
8087: l_current_atp);
8088: Print_Period_Qty('l_class_curr_steal_atp.atp_period:atp_qty = ',
8089: l_class_curr_steal_atp);

Line 8104: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'before consume l_partner_curr_steal_atp');

8100: IF (l_class_tab(i) <> l_class_tab(1)) OR
8101: (l_partner_tab(i) <> l_partner_tab(1)) THEN
8102:
8103: IF PG_DEBUG in ('Y', 'C') THEN
8104: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'before consume l_partner_curr_steal_atp');
8105: END IF;
8106: MSC_AATP_PVT.Atp_Demand_Class_Consume(l_current_atp, l_partner_curr_steal_atp);
8107:
8108: IF PG_DEBUG in ('Y', 'C') THEN

Line 8109: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'After consume l_partner_curr_steal_atp');

8105: END IF;
8106: MSC_AATP_PVT.Atp_Demand_Class_Consume(l_current_atp, l_partner_curr_steal_atp);
8107:
8108: IF PG_DEBUG in ('Y', 'C') THEN
8109: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'After consume l_partner_curr_steal_atp');
8110: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
8111: l_current_atp);
8112: Print_Period_Qty('l_partner_curr_steal_atp.atp_period:atp_qty = ',
8113: l_partner_curr_steal_atp);

Line 8121: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Before consume current_steal_atp');

8117:
8118: END IF; -- IF l_level_id IN (2,3)
8119:
8120: IF PG_DEBUG in ('Y', 'C') THEN
8121: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Before consume current_steal_atp');
8122:
8123: Print_Period_Qty('l_current_steal_atp.atp_period:atp_qty = ',
8124: l_current_steal_atp);
8125:

Line 8131: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'After consume l_current_steal_atp');

8127:
8128: MSC_AATP_PVT.Atp_Demand_Class_Consume(l_current_atp, l_current_steal_atp);
8129:
8130: IF PG_DEBUG in ('Y', 'C') THEN
8131: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'After consume l_current_steal_atp');
8132:
8133: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
8134: l_current_atp);
8135: Print_Period_Qty('l_current_steal_atp.atp_period:atp_qty = ',

Line 8218: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'level = '||l_level_id);

8214: -- to add l_steal_atp into l_next_steal_atp if we can not finish
8215: -- the stealing at this priority
8216:
8217: IF PG_DEBUG in ('Y', 'C') THEN
8218: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
8219: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
8220: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',
8221: l_next_steal_atp);
8222:

Line 8219: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');

8215: -- the stealing at this priority
8216:
8217: IF PG_DEBUG in ('Y', 'C') THEN
8218: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
8219: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
8220: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',
8221: l_next_steal_atp);
8222:
8223: END IF;

Line 8228: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'after Add_to_Next_Steal_Atp');

8224:
8225: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_steal_atp, l_next_steal_atp);
8226:
8227: IF PG_DEBUG in ('Y', 'C') THEN
8228: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'after Add_to_Next_Steal_Atp');
8229: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',
8230: l_next_steal_atp);
8231: END IF;
8232:

Line 8238: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'level = '||l_level_id);

8234:
8235: ELSE -- IF l_level_id IN (-1, 1)
8236: -- this is for hierarchy customer level and site level
8237: IF PG_DEBUG in ('Y', 'C') THEN
8238: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
8239: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'i = '||i);
8240: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_class_tab(i) = '||l_class_tab(i));
8241: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_class_tab(i+1) = '||l_class_tab(i+1));
8242: END IF;

Line 8239: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'i = '||i);

8235: ELSE -- IF l_level_id IN (-1, 1)
8236: -- this is for hierarchy customer level and site level
8237: IF PG_DEBUG in ('Y', 'C') THEN
8238: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
8239: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'i = '||i);
8240: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_class_tab(i) = '||l_class_tab(i));
8241: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_class_tab(i+1) = '||l_class_tab(i+1));
8242: END IF;
8243: IF (l_class_tab(i) <> l_class_tab(i+1)) THEN

Line 8240: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_class_tab(i) = '||l_class_tab(i));

8236: -- this is for hierarchy customer level and site level
8237: IF PG_DEBUG in ('Y', 'C') THEN
8238: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
8239: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'i = '||i);
8240: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_class_tab(i) = '||l_class_tab(i));
8241: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_class_tab(i+1) = '||l_class_tab(i+1));
8242: END IF;
8243: IF (l_class_tab(i) <> l_class_tab(i+1)) THEN
8244:

Line 8241: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_class_tab(i+1) = '||l_class_tab(i+1));

8237: IF PG_DEBUG in ('Y', 'C') THEN
8238: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
8239: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'i = '||i);
8240: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_class_tab(i) = '||l_class_tab(i));
8241: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_class_tab(i+1) = '||l_class_tab(i+1));
8242: END IF;
8243: IF (l_class_tab(i) <> l_class_tab(i+1)) THEN
8244:
8245: -- class changed. If priority of both classes are not the same,

Line 8248: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'class changed');

8244:
8245: -- class changed. If priority of both classes are not the same,
8246: -- then we need to change the curr_steal_atp at class level.
8247: IF PG_DEBUG in ('Y', 'C') THEN
8248: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'class changed');
8249: END IF;
8250:
8251: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_steal_atp, l_next_steal_atp);
8252: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_next_steal_atp, l_partner_next_steal_atp);

Line 8269: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'class the same');

8265:
8266: ELSE
8267:
8268: IF PG_DEBUG in ('Y', 'C') THEN
8269: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'class the same');
8270: END IF;
8271: IF (l_partner_tab(i) <> l_partner_tab(i+1)) THEN
8272: -- customer changed
8273: IF PG_DEBUG in ('Y', 'C') THEN

Line 8274: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'customer not the same');

8270: END IF;
8271: IF (l_partner_tab(i) <> l_partner_tab(i+1)) THEN
8272: -- customer changed
8273: IF PG_DEBUG in ('Y', 'C') THEN
8274: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'customer not the same');
8275: END IF;
8276: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_steal_atp, l_next_steal_atp);
8277:
8278: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_next_steal_atp, l_partner_next_steal_atp);

Line 8285: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'customer priority changed');

8281: trunc(l_demand_class_priority_tab (i+1), -2) THEN
8282: -- customer priority changed
8283:
8284: IF PG_DEBUG in ('Y', 'C') THEN
8285: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'customer priority changed');
8286: END IF;
8287: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_partner_curr_steal_atp,
8288: l_partner_next_steal_atp);
8289:

Line 8296: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'customer the same');

8292:
8293: ELSE
8294: -- same customer
8295: IF PG_DEBUG in ('Y', 'C') THEN
8296: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'customer the same');
8297: END IF;
8298: IF (l_demand_class_priority_tab(i)<>
8299: l_demand_class_priority_tab (i+1)) THEN
8300: -- site level priority changed

Line 8311: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_demand_class = '||p_demand_class);

8307: END IF;
8308:
8309: -- 1665110
8310: IF PG_DEBUG in ('Y', 'C') THEN
8311: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_demand_class = '||p_demand_class);
8312: END IF;
8313: EXIT WHEN (l_demand_class = p_demand_class);
8314: IF PG_DEBUG in ('Y', 'C') THEN
8315: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'after the exit statement, so we did not exit');

Line 8315: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'after the exit statement, so we did not exit');

8311: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_demand_class = '||p_demand_class);
8312: END IF;
8313: EXIT WHEN (l_demand_class = p_demand_class);
8314: IF PG_DEBUG in ('Y', 'C') THEN
8315: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'after the exit statement, so we did not exit');
8316: END IF;
8317:
8318: END LOOP;
8319:

Line 8323: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'right after the Atp_Accumulate');

8319:
8320: MSC_ATP_PROC.Atp_Accumulate(l_current_atp.atp_qty);
8321:
8322: IF PG_DEBUG in ('Y', 'C') THEN
8323: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'right after the Atp_Accumulate');
8324: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
8325: l_current_atp);
8326: END IF;
8327:

Line 8459: msc_sch_wb.atp_debug('******* Supplier_Alloc_Cum_Atp *******');

8455:
8456: BEGIN
8457:
8458: IF PG_DEBUG in ('Y', 'C') THEN
8459: msc_sch_wb.atp_debug('******* Supplier_Alloc_Cum_Atp *******');
8460: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.instance_id =' || p_sup_atp_info_rec.instance_id);
8461: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.supplier_id =' || p_sup_atp_info_rec.supplier_id);
8462: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.supplier_site_id =' || p_sup_atp_info_rec.supplier_site_id);
8463: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.inventory_item_id =' || p_sup_atp_info_rec.inventory_item_id);

Line 8460: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.instance_id =' || p_sup_atp_info_rec.instance_id);

8456: BEGIN
8457:
8458: IF PG_DEBUG in ('Y', 'C') THEN
8459: msc_sch_wb.atp_debug('******* Supplier_Alloc_Cum_Atp *******');
8460: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.instance_id =' || p_sup_atp_info_rec.instance_id);
8461: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.supplier_id =' || p_sup_atp_info_rec.supplier_id);
8462: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.supplier_site_id =' || p_sup_atp_info_rec.supplier_site_id);
8463: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.inventory_item_id =' || p_sup_atp_info_rec.inventory_item_id);
8464: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.organization_id =' || p_sup_atp_info_rec.organization_id);

Line 8461: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.supplier_id =' || p_sup_atp_info_rec.supplier_id);

8457:
8458: IF PG_DEBUG in ('Y', 'C') THEN
8459: msc_sch_wb.atp_debug('******* Supplier_Alloc_Cum_Atp *******');
8460: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.instance_id =' || p_sup_atp_info_rec.instance_id);
8461: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.supplier_id =' || p_sup_atp_info_rec.supplier_id);
8462: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.supplier_site_id =' || p_sup_atp_info_rec.supplier_site_id);
8463: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.inventory_item_id =' || p_sup_atp_info_rec.inventory_item_id);
8464: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.organization_id =' || p_sup_atp_info_rec.organization_id);
8465: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.demand_class =' || p_sup_atp_info_rec.demand_class);

Line 8462: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.supplier_site_id =' || p_sup_atp_info_rec.supplier_site_id);

8458: IF PG_DEBUG in ('Y', 'C') THEN
8459: msc_sch_wb.atp_debug('******* Supplier_Alloc_Cum_Atp *******');
8460: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.instance_id =' || p_sup_atp_info_rec.instance_id);
8461: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.supplier_id =' || p_sup_atp_info_rec.supplier_id);
8462: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.supplier_site_id =' || p_sup_atp_info_rec.supplier_site_id);
8463: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.inventory_item_id =' || p_sup_atp_info_rec.inventory_item_id);
8464: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.organization_id =' || p_sup_atp_info_rec.organization_id);
8465: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.demand_class =' || p_sup_atp_info_rec.demand_class);
8466: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );

Line 8463: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.inventory_item_id =' || p_sup_atp_info_rec.inventory_item_id);

8459: msc_sch_wb.atp_debug('******* Supplier_Alloc_Cum_Atp *******');
8460: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.instance_id =' || p_sup_atp_info_rec.instance_id);
8461: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.supplier_id =' || p_sup_atp_info_rec.supplier_id);
8462: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.supplier_site_id =' || p_sup_atp_info_rec.supplier_site_id);
8463: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.inventory_item_id =' || p_sup_atp_info_rec.inventory_item_id);
8464: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.organization_id =' || p_sup_atp_info_rec.organization_id);
8465: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.demand_class =' || p_sup_atp_info_rec.demand_class);
8466: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
8467: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.shipping_cal_code =' || p_sup_atp_info_rec.shipping_cal_code );

Line 8464: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.organization_id =' || p_sup_atp_info_rec.organization_id);

8460: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.instance_id =' || p_sup_atp_info_rec.instance_id);
8461: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.supplier_id =' || p_sup_atp_info_rec.supplier_id);
8462: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.supplier_site_id =' || p_sup_atp_info_rec.supplier_site_id);
8463: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.inventory_item_id =' || p_sup_atp_info_rec.inventory_item_id);
8464: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.organization_id =' || p_sup_atp_info_rec.organization_id);
8465: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.demand_class =' || p_sup_atp_info_rec.demand_class);
8466: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
8467: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.shipping_cal_code =' || p_sup_atp_info_rec.shipping_cal_code );
8468: END IF;

Line 8465: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.demand_class =' || p_sup_atp_info_rec.demand_class);

8461: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.supplier_id =' || p_sup_atp_info_rec.supplier_id);
8462: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.supplier_site_id =' || p_sup_atp_info_rec.supplier_site_id);
8463: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.inventory_item_id =' || p_sup_atp_info_rec.inventory_item_id);
8464: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.organization_id =' || p_sup_atp_info_rec.organization_id);
8465: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.demand_class =' || p_sup_atp_info_rec.demand_class);
8466: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
8467: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.shipping_cal_code =' || p_sup_atp_info_rec.shipping_cal_code );
8468: END IF;
8469:

Line 8466: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );

8462: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.supplier_site_id =' || p_sup_atp_info_rec.supplier_site_id);
8463: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.inventory_item_id =' || p_sup_atp_info_rec.inventory_item_id);
8464: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.organization_id =' || p_sup_atp_info_rec.organization_id);
8465: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.demand_class =' || p_sup_atp_info_rec.demand_class);
8466: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
8467: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.shipping_cal_code =' || p_sup_atp_info_rec.shipping_cal_code );
8468: END IF;
8469:
8470:

Line 8467: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.shipping_cal_code =' || p_sup_atp_info_rec.shipping_cal_code );

8463: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.inventory_item_id =' || p_sup_atp_info_rec.inventory_item_id);
8464: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.organization_id =' || p_sup_atp_info_rec.organization_id);
8465: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.demand_class =' || p_sup_atp_info_rec.demand_class);
8466: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
8467: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.shipping_cal_code =' || p_sup_atp_info_rec.shipping_cal_code );
8468: END IF;
8469:
8470:
8471: -- find all the demand classes that we need to take care: all the demand

Line 8507: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_plan_start_date = '||l_plan_start_date);

8503: l_org_id := MSC_ATP_PVT.G_PLAN_INFO_REC.organization_id;
8504: l_cutoff_date := MSC_ATP_PVT.G_PLAN_INFO_REC.plan_cutoff_date;
8505:
8506: IF PG_DEBUG in ('Y', 'C') THEN
8507: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_plan_start_date = '||l_plan_start_date);
8508: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_instance_id = '||l_instance_id);
8509: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_org_id = '||l_org_id);
8510: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_cutoff_date = '||l_cutoff_date);
8511: END IF;

Line 8508: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_instance_id = '||l_instance_id);

8504: l_cutoff_date := MSC_ATP_PVT.G_PLAN_INFO_REC.plan_cutoff_date;
8505:
8506: IF PG_DEBUG in ('Y', 'C') THEN
8507: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_plan_start_date = '||l_plan_start_date);
8508: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_instance_id = '||l_instance_id);
8509: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_org_id = '||l_org_id);
8510: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_cutoff_date = '||l_cutoff_date);
8511: END IF;
8512:

Line 8509: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_org_id = '||l_org_id);

8505:
8506: IF PG_DEBUG in ('Y', 'C') THEN
8507: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_plan_start_date = '||l_plan_start_date);
8508: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_instance_id = '||l_instance_id);
8509: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_org_id = '||l_org_id);
8510: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_cutoff_date = '||l_cutoff_date);
8511: END IF;
8512:
8513: --s_cto_rearch

Line 8510: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_cutoff_date = '||l_cutoff_date);

8506: IF PG_DEBUG in ('Y', 'C') THEN
8507: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_plan_start_date = '||l_plan_start_date);
8508: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_instance_id = '||l_instance_id);
8509: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_org_id = '||l_org_id);
8510: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_cutoff_date = '||l_cutoff_date);
8511: END IF;
8512:
8513: --s_cto_rearch
8514: IF (p_sup_atp_info_rec.bom_item_type = 4 and p_sup_atp_info_rec.rep_ord_flag = 'Y') THEN

Line 8534: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'before select the high priority demand class');

8530: -- the requested demand class
8531:
8532: -- IF l_allocation_percent <> 0.0 THEN
8533: IF PG_DEBUG in ('Y', 'C') THEN
8534: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'before select the high priority demand class');
8535: END IF;
8536:
8537: -- bug 1680719
8538: --bug3948494 Do not select Higher priority DC if the requested DC

Line 8543: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_allocation_percent = '||l_allocation_percent);

8539: --is at highest priority , we donot honor for forward consumption method here.
8540: IF l_level_id = -1 AND l_priority <> 1 THEN
8541:
8542: IF PG_DEBUG in ('Y', 'C') THEN
8543: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_allocation_percent = '||l_allocation_percent);
8544: END IF;
8545: SELECT demand_class, priority
8546: BULK COLLECT INTO l_demand_class_tab, l_demand_class_priority_tab
8547: FROM msc_item_hierarchy_mv

Line 8560: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);

8556:
8557: ELSIF l_level_id = 1 THEN
8558:
8559: IF PG_DEBUG in ('Y', 'C') THEN
8560: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);
8561: END IF;
8562: SELECT demand_class, priority
8563: BULK COLLECT INTO l_demand_class_tab, l_demand_class_priority_tab
8564: FROM msc_item_hierarchy_mv

Line 8578: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);

8574: ELSIF l_level_id = 2 THEN
8575:
8576:
8577: IF PG_DEBUG in ('Y', 'C') THEN
8578: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);
8579: END IF;
8580: SELECT mv1.demand_class, mv1.priority, mv1.class, mv1.partner_id
8581: BULK COLLECT INTO l_demand_class_tab, l_demand_class_priority_tab,
8582: l_class_tab, l_partner_tab

Line 8602: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);

8598: -- bug 1680719
8599: -- we need to select the class, partner_id, partner_site_id
8600:
8601: IF PG_DEBUG in ('Y', 'C') THEN
8602: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);
8603: END IF;
8604: SELECT mv1.demand_class, mv1.priority, mv1.class, mv1.partner_id
8605: BULK COLLECT INTO l_demand_class_tab, l_demand_class_priority_tab,
8606: l_class_tab, l_partner_tab

Line 8650: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_demand_class_tab and priority = '||

8646: mm := l_demand_class_tab.FIRST;
8647:
8648: WHILE mm is not null LOOP
8649: IF PG_DEBUG in ('Y', 'C') THEN
8650: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_demand_class_tab and priority = '||
8651: l_demand_class_tab(mm) ||' : '|| l_demand_class_priority_tab(mm));
8652: END IF;
8653:
8654: IF l_level_id in (2,3) THEN

Line 8656: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_class_tab and partner = '||

8652: END IF;
8653:
8654: IF l_level_id in (2,3) THEN
8655: IF PG_DEBUG in ('Y', 'C') THEN
8656: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_class_tab and partner = '||
8657: l_class_tab(mm) ||' : '||l_partner_tab(mm));
8658: END IF;
8659: END IF;
8660:

Line 8676: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_uom_code and l_postprocessing_lead_time = '||

8672: --AND inventory_item_id = p_sup_atp_info_rec.inventory_item_id;
8673: AND inventory_item_id = l_inv_item_id;
8674:
8675: IF PG_DEBUG in ('Y', 'C') THEN
8676: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_uom_code and l_postprocessing_lead_time = '||
8677: l_uom_code ||' : '||l_postprocessing_lead_time);
8678: END IF;
8679:
8680: -- for performance reason, we need to get the following info and

Line 8712: msc_sch_wb.atp_debug('Sys next Date : '||to_char(l_sys_next_date, 'DD-MON-YYYY'));

8708: l_instance_id,
8709: TRUNC(sysdate));
8710:
8711: IF PG_DEBUG in ('Y', 'C') THEN
8712: msc_sch_wb.atp_debug('Sys next Date : '||to_char(l_sys_next_date, 'DD-MON-YYYY'));
8713: END IF;
8714:
8715: IF (l_sys_next_date is NULL) THEN
8716: msc_sch_wb.atp_debug('Sys Next Date is null');

Line 8716: msc_sch_wb.atp_debug('Sys Next Date is null');

8712: msc_sch_wb.atp_debug('Sys next Date : '||to_char(l_sys_next_date, 'DD-MON-YYYY'));
8713: END IF;
8714:
8715: IF (l_sys_next_date is NULL) THEN
8716: msc_sch_wb.atp_debug('Sys Next Date is null');
8717: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.NO_MATCHING_CAL_DATE;
8718: RAISE FND_API.G_EXC_ERROR;
8719: END IF;
8720: --bug3333114 end

Line 8717: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.NO_MATCHING_CAL_DATE;

8713: END IF;
8714:
8715: IF (l_sys_next_date is NULL) THEN
8716: msc_sch_wb.atp_debug('Sys Next Date is null');
8717: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.NO_MATCHING_CAL_DATE;
8718: RAISE FND_API.G_EXC_ERROR;
8719: END IF;
8720: --bug3333114 end
8721:

Line 8723: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.manufacturing_cal_code='||p_sup_atp_info_rec.manufacturing_cal_code);

8719: END IF;
8720: --bug3333114 end
8721:
8722: IF PG_DEBUG in ('Y', 'C') THEN
8723: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.manufacturing_cal_code='||p_sup_atp_info_rec.manufacturing_cal_code);
8724: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
8725: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
8726: END IF;
8727: -- ship_rec_cal changes end

Line 8724: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);

8720: --bug3333114 end
8721:
8722: IF PG_DEBUG in ('Y', 'C') THEN
8723: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.manufacturing_cal_code='||p_sup_atp_info_rec.manufacturing_cal_code);
8724: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
8725: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
8726: END IF;
8727: -- ship_rec_cal changes end
8728:

Line 8725: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);

8721:
8722: IF PG_DEBUG in ('Y', 'C') THEN
8723: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.manufacturing_cal_code='||p_sup_atp_info_rec.manufacturing_cal_code);
8724: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
8725: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
8726: END IF;
8727: -- ship_rec_cal changes end
8728:
8729:

Line 8733: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'in i loop, i = '||i);

8729:
8730: FOR i in 1..l_demand_class_tab.COUNT LOOP
8731: l_demand_class := l_demand_class_tab(i);
8732: IF PG_DEBUG in ('Y', 'C') THEN
8733: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'in i loop, i = '||i);
8734: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_demand_class = '||l_demand_class);
8735: END IF;
8736: --=======================================================================================================
8737: -- ship_rec_cal changes begin

Line 8734: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_demand_class = '||l_demand_class);

8730: FOR i in 1..l_demand_class_tab.COUNT LOOP
8731: l_demand_class := l_demand_class_tab(i);
8732: IF PG_DEBUG in ('Y', 'C') THEN
8733: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'in i loop, i = '||i);
8734: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_demand_class = '||l_demand_class);
8735: END IF;
8736: --=======================================================================================================
8737: -- ship_rec_cal changes begin
8738: --=======================================================================================================

Line 9638: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'after insert into msc_atp_sd_details_temp');

9634: -- ship_rec_cal changes end
9635: --=======================================================================================================
9636: -- for period ATP
9637: IF PG_DEBUG in ('Y', 'C') THEN
9638: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'after insert into msc_atp_sd_details_temp');
9639: END IF;
9640: MSC_ATP_PROC.get_period_data_from_SD_temp(x_atp_period);
9641:
9642: l_current_atp.atp_period := x_atp_period.Period_Start_Date;

Line 9650: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'right after the big query');

9646:
9647: END IF;
9648:
9649: IF PG_DEBUG in ('Y', 'C') THEN
9650: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'right after the big query');
9651: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
9652: l_current_atp);
9653: END IF;
9654:

Line 9659: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'right after the backward consume');

9655: -- do backward consumption for DCi
9656: MSC_ATP_PROC.Atp_Backward_Consume(l_current_atp.atp_qty);
9657:
9658: IF PG_DEBUG in ('Y', 'C') THEN
9659: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'right after the backward consume');
9660: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
9661: l_current_atp);
9662: END IF;
9663:

Line 9718: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'class changed');

9714: -- class changed. If priority of both classes are not the same,
9715: -- then we need to change the curr_steal_atp at class level.
9716:
9717: IF PG_DEBUG in ('Y', 'C') THEN
9718: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'class changed');
9719: END IF;
9720:
9721: IF trunc(l_demand_class_priority_tab(i), -3) >
9722: trunc(l_demand_class_priority_tab (i-1), -3) THEN

Line 9725: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'class priority changed');

9721: IF trunc(l_demand_class_priority_tab(i), -3) >
9722: trunc(l_demand_class_priority_tab (i-1), -3) THEN
9723:
9724: IF PG_DEBUG in ('Y', 'C') THEN
9725: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'class priority changed');
9726: END IF;
9727: l_class_curr_steal_atp := l_class_next_steal_atp;
9728: l_class_next_steal_atp := l_null_steal_atp;
9729: END IF;

Line 9739: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'same class');

9735: l_next_steal_atp := l_null_steal_atp;
9736:
9737: ELSE
9738: IF PG_DEBUG in ('Y', 'C') THEN
9739: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'same class');
9740: END IF;
9741: IF (l_partner_tab(i) <> l_partner_tab(i-1)) THEN
9742: -- customer changed. If priority of both customers are not the
9743: -- same, we need to change the curr_steal_atp at partner level.

Line 9746: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'customer changed');

9742: -- customer changed. If priority of both customers are not the
9743: -- same, we need to change the curr_steal_atp at partner level.
9744:
9745: IF PG_DEBUG in ('Y', 'C') THEN
9746: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'customer changed');
9747: END IF;
9748:
9749: IF trunc(l_demand_class_priority_tab(i), -2) >
9750: trunc(l_demand_class_priority_tab (i-1), -2) THEN

Line 9752: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'customer priority changed');

9748:
9749: IF trunc(l_demand_class_priority_tab(i), -2) >
9750: trunc(l_demand_class_priority_tab (i-1), -2) THEN
9751: IF PG_DEBUG in ('Y', 'C') THEN
9752: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'customer priority changed');
9753: END IF;
9754:
9755: l_partner_curr_steal_atp := l_partner_next_steal_atp;
9756: l_partner_next_steal_atp := l_null_steal_atp;

Line 9766: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'same customer ');

9762:
9763: ELSE
9764: -- same customer
9765: IF PG_DEBUG in ('Y', 'C') THEN
9766: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'same customer ');
9767: END IF;
9768:
9769: IF (l_demand_class_priority_tab(i) >
9770: l_demand_class_priority_tab (i-1)) THEN

Line 9774: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'site priority changed');

9770: l_demand_class_priority_tab (i-1)) THEN
9771: -- site level priority changed
9772:
9773: IF PG_DEBUG in ('Y', 'C') THEN
9774: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'site priority changed');
9775: END IF;
9776: l_current_steal_atp := l_next_steal_atp;
9777: l_next_steal_atp := l_null_steal_atp;
9778:

Line 9787: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'before we decide we need to do dc consumption');

9783: END IF; -- IF (i > 1)
9784:
9785: END IF; -- IF l_level_id IN (-1, 1)
9786: IF PG_DEBUG in ('Y', 'C') THEN
9787: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'before we decide we need to do dc consumption');
9788: END IF;
9789: IF (i > 1) THEN
9790: IF ( -- this is the huge condition
9791: ((l_level_id IN (-1, 1)) AND

Line 9820: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'before consume l_class_curr_steal_atp');

9816:
9817: IF l_class_tab(i) <> l_class_tab(1) THEN
9818:
9819: IF PG_DEBUG in ('Y', 'C') THEN
9820: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'before consume l_class_curr_steal_atp');
9821: Print_Period_Qty('l_class_curr_steal_atp.atp_period:atp_qty = ',
9822: l_class_curr_steal_atp);
9823: END IF;
9824:

Line 9828: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'After consume l_class_curr_steal_atp');

9824:
9825: MSC_AATP_PVT.Atp_demand_class_Consume(l_current_atp, l_class_curr_steal_atp);
9826:
9827: IF PG_DEBUG in ('Y', 'C') THEN
9828: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'After consume l_class_curr_steal_atp');
9829: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
9830: l_current_atp);
9831: Print_Period_Qty('l_class_curr_steal_atp.atp_period:atp_qty = ',
9832: l_class_curr_steal_atp);

Line 9847: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'before consume l_partner_curr_steal_atp');

9843: IF (l_class_tab(i) <> l_class_tab(1)) OR
9844: (l_partner_tab(i) <> l_partner_tab(1)) THEN
9845:
9846: IF PG_DEBUG in ('Y', 'C') THEN
9847: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'before consume l_partner_curr_steal_atp');
9848: END IF;
9849: MSC_AATP_PVT.Atp_demand_class_Consume(l_current_atp, l_partner_curr_steal_atp);
9850:
9851: IF PG_DEBUG in ('Y', 'C') THEN

Line 9852: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'After consume l_partner_curr_steal_atp');

9848: END IF;
9849: MSC_AATP_PVT.Atp_demand_class_Consume(l_current_atp, l_partner_curr_steal_atp);
9850:
9851: IF PG_DEBUG in ('Y', 'C') THEN
9852: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'After consume l_partner_curr_steal_atp');
9853: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
9854: l_current_atp);
9855: Print_Period_Qty('l_partner_curr_steal_atp.atp_period:atp_qty = ',
9856: l_partner_curr_steal_atp);

Line 9863: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'Before consume current_steal_atp');

9859:
9860: END IF; -- IF l_level_id IN (2,3)
9861:
9862: IF PG_DEBUG in ('Y', 'C') THEN
9863: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'Before consume current_steal_atp');
9864: Print_Period_Qty('l_current_steal_atp.atp_period:atp_qty = ',
9865: l_current_steal_atp);
9866: END IF;
9867:

Line 9871: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'After consume l_current_steal_atp');

9867:
9868: MSC_AATP_PVT.Atp_demand_class_Consume(l_current_atp, l_current_steal_atp);
9869:
9870: IF PG_DEBUG in ('Y', 'C') THEN
9871: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'After consume l_current_steal_atp');
9872: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
9873: l_current_atp);
9874: Print_Period_Qty('l_current_steal_atp.atp_period:atp_qty = ',
9875: l_current_steal_atp);

Line 9961: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'level = '||l_level_id);

9957: -- to add l_steal_atp into l_next_steal_atp if we can not finish
9958: -- the stealing at this priority
9959:
9960: IF PG_DEBUG in ('Y', 'C') THEN
9961: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
9962: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
9963: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',
9964: l_next_steal_atp);
9965: END IF;

Line 9962: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');

9958: -- the stealing at this priority
9959:
9960: IF PG_DEBUG in ('Y', 'C') THEN
9961: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
9962: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
9963: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',
9964: l_next_steal_atp);
9965: END IF;
9966:

Line 9970: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'after Add_to_Next_Steal_Atp');

9966:
9967: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_steal_atp, l_next_steal_atp);
9968:
9969: IF PG_DEBUG in ('Y', 'C') THEN
9970: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'after Add_to_Next_Steal_Atp');
9971: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',
9972: l_next_steal_atp);
9973: END IF;
9974:

Line 9980: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'level = '||l_level_id);

9976:
9977: ELSE -- IF l_level_id IN (-1, 1)
9978: -- this is for hierarchy customer level and site level
9979: IF PG_DEBUG in ('Y', 'C') THEN
9980: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
9981: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'i = '||i);
9982: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_class_tab(i) = '||l_class_tab(i));
9983: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_class_tab(i+1) = '||l_class_tab(i+1));
9984: END IF;

Line 9981: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'i = '||i);

9977: ELSE -- IF l_level_id IN (-1, 1)
9978: -- this is for hierarchy customer level and site level
9979: IF PG_DEBUG in ('Y', 'C') THEN
9980: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
9981: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'i = '||i);
9982: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_class_tab(i) = '||l_class_tab(i));
9983: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_class_tab(i+1) = '||l_class_tab(i+1));
9984: END IF;
9985: IF (l_class_tab(i) <> l_class_tab(i+1)) THEN

Line 9982: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_class_tab(i) = '||l_class_tab(i));

9978: -- this is for hierarchy customer level and site level
9979: IF PG_DEBUG in ('Y', 'C') THEN
9980: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
9981: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'i = '||i);
9982: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_class_tab(i) = '||l_class_tab(i));
9983: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_class_tab(i+1) = '||l_class_tab(i+1));
9984: END IF;
9985: IF (l_class_tab(i) <> l_class_tab(i+1)) THEN
9986:

Line 9983: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_class_tab(i+1) = '||l_class_tab(i+1));

9979: IF PG_DEBUG in ('Y', 'C') THEN
9980: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
9981: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'i = '||i);
9982: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_class_tab(i) = '||l_class_tab(i));
9983: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_class_tab(i+1) = '||l_class_tab(i+1));
9984: END IF;
9985: IF (l_class_tab(i) <> l_class_tab(i+1)) THEN
9986:
9987: -- class changed. If priority of both classes are not the same,

Line 9990: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'class changed');

9986:
9987: -- class changed. If priority of both classes are not the same,
9988: -- then we need to change the curr_steal_atp at class level.
9989: IF PG_DEBUG in ('Y', 'C') THEN
9990: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'class changed');
9991: END IF;
9992:
9993: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_steal_atp, l_next_steal_atp);
9994: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_next_steal_atp, l_partner_next_steal_atp);

Line 10012: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'class the same');

10008:
10009: ELSE
10010:
10011: IF PG_DEBUG in ('Y', 'C') THEN
10012: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'class the same');
10013: END IF;
10014: IF (l_partner_tab(i) <> l_partner_tab(i+1)) THEN
10015: -- customer changed
10016: IF PG_DEBUG in ('Y', 'C') THEN

Line 10017: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'customer not the same');

10013: END IF;
10014: IF (l_partner_tab(i) <> l_partner_tab(i+1)) THEN
10015: -- customer changed
10016: IF PG_DEBUG in ('Y', 'C') THEN
10017: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'customer not the same');
10018: END IF;
10019: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_steal_atp, l_next_steal_atp);
10020:
10021: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_next_steal_atp, l_partner_next_steal_atp);

Line 10028: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'customer priority changed');

10024: trunc(l_demand_class_priority_tab (i+1), -2) THEN
10025: -- customer priority changed
10026:
10027: IF PG_DEBUG in ('Y', 'C') THEN
10028: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'customer priority changed');
10029: END IF;
10030: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_partner_curr_steal_atp,
10031: l_partner_next_steal_atp);
10032:

Line 10039: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'customer the same');

10035:
10036: ELSE
10037: -- same customer
10038: IF PG_DEBUG in ('Y', 'C') THEN
10039: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'customer the same');
10040: END IF;
10041: IF (l_demand_class_priority_tab(i)<>
10042: l_demand_class_priority_tab (i+1)) THEN
10043: -- site level priority changed

Line 10054: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.demand_class = '||p_sup_atp_info_rec.demand_class);

10050: END IF;
10051:
10052: -- 1665110
10053: IF PG_DEBUG in ('Y', 'C') THEN
10054: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.demand_class = '||p_sup_atp_info_rec.demand_class);
10055: END IF;
10056: EXIT WHEN (l_demand_class = p_sup_atp_info_rec.demand_class);
10057: IF PG_DEBUG in ('Y', 'C') THEN
10058: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'after the exit statement, so we did not exit');

Line 10058: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'after the exit statement, so we did not exit');

10054: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.demand_class = '||p_sup_atp_info_rec.demand_class);
10055: END IF;
10056: EXIT WHEN (l_demand_class = p_sup_atp_info_rec.demand_class);
10057: IF PG_DEBUG in ('Y', 'C') THEN
10058: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'after the exit statement, so we did not exit');
10059: END IF;
10060:
10061: END LOOP;
10062: MSC_ATP_PROC.Atp_Accumulate(l_current_atp.atp_qty);

Line 10065: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'right after the Atp_Accumulate');

10061: END LOOP;
10062: MSC_ATP_PROC.Atp_Accumulate(l_current_atp.atp_qty);
10063:
10064: IF PG_DEBUG in ('Y', 'C') THEN
10065: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'right after the Atp_Accumulate');
10066: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
10067: l_current_atp);
10068: END IF;
10069:

Line 10076: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'Error occured in procedure Atp_Remove_Negatives');

10072: --4055719 , calling remove -ves
10073: MSC_AATP_PROC.Atp_Remove_Negatives(x_atp_period.Cumulative_Quantity, l_return_status);
10074: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
10075: IF PG_DEBUG in ('Y', 'C') THEN
10076: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'Error occured in procedure Atp_Remove_Negatives');
10077: END IF;
10078: RAISE FND_API.G_EXC_ERROR;
10079: END IF;
10080:

Line 10154: msc_sch_wb.atp_debug('******** Get_DC_Info ********');

10150: l_time_phase NUMBER;
10151:
10152: BEGIN
10153: IF PG_DEBUG in ('Y', 'C') THEN
10154: msc_sch_wb.atp_debug('******** Get_DC_Info ********');
10155: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_instance_id =' || p_instance_id);
10156: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_inv_item_id =' || p_inv_item_id);
10157: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_org_id =' || p_org_id);
10158: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_dept_id =' || p_dept_id);

Line 10155: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_instance_id =' || p_instance_id);

10151:
10152: BEGIN
10153: IF PG_DEBUG in ('Y', 'C') THEN
10154: msc_sch_wb.atp_debug('******** Get_DC_Info ********');
10155: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_instance_id =' || p_instance_id);
10156: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_inv_item_id =' || p_inv_item_id);
10157: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_org_id =' || p_org_id);
10158: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_dept_id =' || p_dept_id);
10159: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_res_id =' || p_res_id);

Line 10156: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_inv_item_id =' || p_inv_item_id);

10152: BEGIN
10153: IF PG_DEBUG in ('Y', 'C') THEN
10154: msc_sch_wb.atp_debug('******** Get_DC_Info ********');
10155: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_instance_id =' || p_instance_id);
10156: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_inv_item_id =' || p_inv_item_id);
10157: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_org_id =' || p_org_id);
10158: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_dept_id =' || p_dept_id);
10159: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_res_id =' || p_res_id);
10160: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_demand_class =' || p_demand_class);

Line 10157: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_org_id =' || p_org_id);

10153: IF PG_DEBUG in ('Y', 'C') THEN
10154: msc_sch_wb.atp_debug('******** Get_DC_Info ********');
10155: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_instance_id =' || p_instance_id);
10156: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_inv_item_id =' || p_inv_item_id);
10157: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_org_id =' || p_org_id);
10158: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_dept_id =' || p_dept_id);
10159: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_res_id =' || p_res_id);
10160: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_demand_class =' || p_demand_class);
10161: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_request_date =' || p_request_date );

Line 10158: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_dept_id =' || p_dept_id);

10154: msc_sch_wb.atp_debug('******** Get_DC_Info ********');
10155: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_instance_id =' || p_instance_id);
10156: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_inv_item_id =' || p_inv_item_id);
10157: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_org_id =' || p_org_id);
10158: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_dept_id =' || p_dept_id);
10159: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_res_id =' || p_res_id);
10160: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_demand_class =' || p_demand_class);
10161: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_request_date =' || p_request_date );
10162: END IF;

Line 10159: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_res_id =' || p_res_id);

10155: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_instance_id =' || p_instance_id);
10156: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_inv_item_id =' || p_inv_item_id);
10157: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_org_id =' || p_org_id);
10158: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_dept_id =' || p_dept_id);
10159: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_res_id =' || p_res_id);
10160: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_demand_class =' || p_demand_class);
10161: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_request_date =' || p_request_date );
10162: END IF;
10163:

Line 10160: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_demand_class =' || p_demand_class);

10156: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_inv_item_id =' || p_inv_item_id);
10157: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_org_id =' || p_org_id);
10158: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_dept_id =' || p_dept_id);
10159: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_res_id =' || p_res_id);
10160: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_demand_class =' || p_demand_class);
10161: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_request_date =' || p_request_date );
10162: END IF;
10163:
10164: -- initialize API return status to success

Line 10161: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_request_date =' || p_request_date );

10157: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_org_id =' || p_org_id);
10158: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_dept_id =' || p_dept_id);
10159: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_res_id =' || p_res_id);
10160: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_demand_class =' || p_demand_class);
10161: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_request_date =' || p_request_date );
10162: END IF;
10163:
10164: -- initialize API return status to success
10165: x_return_status := FND_API.G_RET_STS_SUCCESS;

Line 10234: msc_sch_wb.atp_debug('Exception in Get_DC_Info');

10230:
10231: END IF;
10232: WHEN OTHERS THEN
10233: IF PG_DEBUG in ('Y', 'C') THEN
10234: msc_sch_wb.atp_debug('Exception in Get_DC_Info');
10235: END IF;
10236:
10237: x_priority := -1;
10238: END;

Line 10306: msc_sch_wb.atp_debug('Exception in Get_DC_Info');

10302: END IF;
10303:
10304: WHEN OTHERS THEN
10305: IF PG_DEBUG in ('Y', 'C') THEN
10306: msc_sch_wb.atp_debug('Exception in Get_DC_Info');
10307: END IF;
10308:
10309: x_priority := -1;
10310: END;

Line 10315: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'Error code:' || to_char(sqlcode));

10311: END IF;
10312: EXCEPTION
10313: WHEN OTHERS THEN
10314: IF PG_DEBUG in ('Y', 'C') THEN
10315: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'Error code:' || to_char(sqlcode));
10316: END IF;
10317: x_priority := -1;
10318: x_alloc_percent := 0;
10319: x_return_status := FND_API.G_RET_STS_ERROR;

Line 10363: msc_sch_wb.set_session_id(p_session_id);

10359: l_demand_class VARCHAR2(80);
10360: -- Agilent Allocated ATP Based on Planning Details changes End
10361:
10362: BEGIN
10363: msc_sch_wb.set_session_id(p_session_id);
10364: IF PG_DEBUG in ('Y', 'C') THEN
10365: msc_sch_wb.atp_debug('Begin View_Allocation');
10366: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_inventory_item_id = ' ||to_char(p_inventory_item_id));
10367: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_instance_id = ' ||to_char(p_instance_id));

Line 10365: msc_sch_wb.atp_debug('Begin View_Allocation');

10361:
10362: BEGIN
10363: msc_sch_wb.set_session_id(p_session_id);
10364: IF PG_DEBUG in ('Y', 'C') THEN
10365: msc_sch_wb.atp_debug('Begin View_Allocation');
10366: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_inventory_item_id = ' ||to_char(p_inventory_item_id));
10367: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_instance_id = ' ||to_char(p_instance_id));
10368: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_organization_id = ' ||to_char(p_organization_id));
10369: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_department_id = ' ||to_char(p_department_id));

Line 10366: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_inventory_item_id = ' ||to_char(p_inventory_item_id));

10362: BEGIN
10363: msc_sch_wb.set_session_id(p_session_id);
10364: IF PG_DEBUG in ('Y', 'C') THEN
10365: msc_sch_wb.atp_debug('Begin View_Allocation');
10366: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_inventory_item_id = ' ||to_char(p_inventory_item_id));
10367: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_instance_id = ' ||to_char(p_instance_id));
10368: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_organization_id = ' ||to_char(p_organization_id));
10369: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_department_id = ' ||to_char(p_department_id));
10370: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_resource_id = ' ||to_char(p_resource_id));

Line 10367: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_instance_id = ' ||to_char(p_instance_id));

10363: msc_sch_wb.set_session_id(p_session_id);
10364: IF PG_DEBUG in ('Y', 'C') THEN
10365: msc_sch_wb.atp_debug('Begin View_Allocation');
10366: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_inventory_item_id = ' ||to_char(p_inventory_item_id));
10367: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_instance_id = ' ||to_char(p_instance_id));
10368: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_organization_id = ' ||to_char(p_organization_id));
10369: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_department_id = ' ||to_char(p_department_id));
10370: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_resource_id = ' ||to_char(p_resource_id));
10371: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_demand_class = ' ||p_demand_class);

Line 10368: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_organization_id = ' ||to_char(p_organization_id));

10364: IF PG_DEBUG in ('Y', 'C') THEN
10365: msc_sch_wb.atp_debug('Begin View_Allocation');
10366: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_inventory_item_id = ' ||to_char(p_inventory_item_id));
10367: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_instance_id = ' ||to_char(p_instance_id));
10368: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_organization_id = ' ||to_char(p_organization_id));
10369: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_department_id = ' ||to_char(p_department_id));
10370: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_resource_id = ' ||to_char(p_resource_id));
10371: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_demand_class = ' ||p_demand_class);
10372: END IF;

Line 10369: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_department_id = ' ||to_char(p_department_id));

10365: msc_sch_wb.atp_debug('Begin View_Allocation');
10366: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_inventory_item_id = ' ||to_char(p_inventory_item_id));
10367: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_instance_id = ' ||to_char(p_instance_id));
10368: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_organization_id = ' ||to_char(p_organization_id));
10369: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_department_id = ' ||to_char(p_department_id));
10370: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_resource_id = ' ||to_char(p_resource_id));
10371: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_demand_class = ' ||p_demand_class);
10372: END IF;
10373:

Line 10370: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_resource_id = ' ||to_char(p_resource_id));

10366: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_inventory_item_id = ' ||to_char(p_inventory_item_id));
10367: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_instance_id = ' ||to_char(p_instance_id));
10368: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_organization_id = ' ||to_char(p_organization_id));
10369: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_department_id = ' ||to_char(p_department_id));
10370: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_resource_id = ' ||to_char(p_resource_id));
10371: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_demand_class = ' ||p_demand_class);
10372: END IF;
10373:
10374: -- Bug 2396523 : krajan : Added debug messages

Line 10371: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_demand_class = ' ||p_demand_class);

10367: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_instance_id = ' ||to_char(p_instance_id));
10368: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_organization_id = ' ||to_char(p_organization_id));
10369: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_department_id = ' ||to_char(p_department_id));
10370: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_resource_id = ' ||to_char(p_resource_id));
10371: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_demand_class = ' ||p_demand_class);
10372: END IF;
10373:
10374: -- Bug 2396523 : krajan : Added debug messages
10375: IF PG_DEBUG in ('Y', 'C') THEN

Line 10376: msc_sch_wb.atp_debug('View_Allocation: ' || 'P_DEMAND_CLASS ' || p_demand_class);

10372: END IF;
10373:
10374: -- Bug 2396523 : krajan : Added debug messages
10375: IF PG_DEBUG in ('Y', 'C') THEN
10376: msc_sch_wb.atp_debug('View_Allocation: ' || 'P_DEMAND_CLASS ' || p_demand_class);
10377: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_INV_CTP= ' || MSC_ATP_PVT.G_INV_CTP);
10378: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_HIERARCHY_PROFILE = '|| MSC_ATP_PVT.G_HIERARCHY_PROFILE );
10379: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_ALLOCATED_ATP = ' || MSC_ATP_PVT.G_ALLOCATED_ATP );
10380: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_ALLOCATION_METHOD = '|| MSC_ATP_PVT.G_ALLOCATION_METHOD );

Line 10377: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_INV_CTP= ' || MSC_ATP_PVT.G_INV_CTP);

10373:
10374: -- Bug 2396523 : krajan : Added debug messages
10375: IF PG_DEBUG in ('Y', 'C') THEN
10376: msc_sch_wb.atp_debug('View_Allocation: ' || 'P_DEMAND_CLASS ' || p_demand_class);
10377: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_INV_CTP= ' || MSC_ATP_PVT.G_INV_CTP);
10378: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_HIERARCHY_PROFILE = '|| MSC_ATP_PVT.G_HIERARCHY_PROFILE );
10379: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_ALLOCATED_ATP = ' || MSC_ATP_PVT.G_ALLOCATED_ATP );
10380: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_ALLOCATION_METHOD = '|| MSC_ATP_PVT.G_ALLOCATION_METHOD );
10381: END IF;

Line 10378: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_HIERARCHY_PROFILE = '|| MSC_ATP_PVT.G_HIERARCHY_PROFILE );

10374: -- Bug 2396523 : krajan : Added debug messages
10375: IF PG_DEBUG in ('Y', 'C') THEN
10376: msc_sch_wb.atp_debug('View_Allocation: ' || 'P_DEMAND_CLASS ' || p_demand_class);
10377: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_INV_CTP= ' || MSC_ATP_PVT.G_INV_CTP);
10378: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_HIERARCHY_PROFILE = '|| MSC_ATP_PVT.G_HIERARCHY_PROFILE );
10379: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_ALLOCATED_ATP = ' || MSC_ATP_PVT.G_ALLOCATED_ATP );
10380: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_ALLOCATION_METHOD = '|| MSC_ATP_PVT.G_ALLOCATION_METHOD );
10381: END IF;
10382:

Line 10379: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_ALLOCATED_ATP = ' || MSC_ATP_PVT.G_ALLOCATED_ATP );

10375: IF PG_DEBUG in ('Y', 'C') THEN
10376: msc_sch_wb.atp_debug('View_Allocation: ' || 'P_DEMAND_CLASS ' || p_demand_class);
10377: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_INV_CTP= ' || MSC_ATP_PVT.G_INV_CTP);
10378: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_HIERARCHY_PROFILE = '|| MSC_ATP_PVT.G_HIERARCHY_PROFILE );
10379: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_ALLOCATED_ATP = ' || MSC_ATP_PVT.G_ALLOCATED_ATP );
10380: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_ALLOCATION_METHOD = '|| MSC_ATP_PVT.G_ALLOCATION_METHOD );
10381: END IF;
10382:
10383: -- krajan : 2400676

Line 10380: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_ALLOCATION_METHOD = '|| MSC_ATP_PVT.G_ALLOCATION_METHOD );

10376: msc_sch_wb.atp_debug('View_Allocation: ' || 'P_DEMAND_CLASS ' || p_demand_class);
10377: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_INV_CTP= ' || MSC_ATP_PVT.G_INV_CTP);
10378: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_HIERARCHY_PROFILE = '|| MSC_ATP_PVT.G_HIERARCHY_PROFILE );
10379: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_ALLOCATED_ATP = ' || MSC_ATP_PVT.G_ALLOCATED_ATP );
10380: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_ALLOCATION_METHOD = '|| MSC_ATP_PVT.G_ALLOCATION_METHOD );
10381: END IF;
10382:
10383: -- krajan : 2400676
10384: IF PG_DEBUG in ('Y', 'C') THEN

Line 10385: msc_sch_wb.atp_debug('View_Allocation: ' || 'Resetting Global Error Code');

10381: END IF;
10382:
10383: -- krajan : 2400676
10384: IF PG_DEBUG in ('Y', 'C') THEN
10385: msc_sch_wb.atp_debug('View_Allocation: ' || 'Resetting Global Error Code');
10386: END IF;
10387: MSC_SCH_WB.G_ATP_ERROR_CODE := 0;
10388:
10389: -- As part of ship_rec_cal. No need for SQL here. Just call the function straight.

Line 10387: MSC_SCH_WB.G_ATP_ERROR_CODE := 0;

10383: -- krajan : 2400676
10384: IF PG_DEBUG in ('Y', 'C') THEN
10385: msc_sch_wb.atp_debug('View_Allocation: ' || 'Resetting Global Error Code');
10386: END IF;
10387: MSC_SCH_WB.G_ATP_ERROR_CODE := 0;
10388:
10389: -- As part of ship_rec_cal. No need for SQL here. Just call the function straight.
10390: /*
10391: --Get sysdate to later pass on to the procedure.

Line 10402: msc_sch_wb.atp_debug('View_Allocation: ' || 'Request Date : '||to_char(l_request_date, 'DD-MON-YYYY'));

10398:
10399: l_request_date := MSC_CALENDAR.NEXT_WORK_DAY(p_organization_id, p_instance_id, 1, sysdate);
10400:
10401: IF PG_DEBUG in ('Y', 'C') THEN
10402: msc_sch_wb.atp_debug('View_Allocation: ' || 'Request Date : '||to_char(l_request_date, 'DD-MON-YYYY'));
10403: END IF;
10404: -- krajan : 2400676
10405: IF (l_request_date = NULL) THEN
10406: IF PG_DEBUG in ('Y', 'C') THEN

Line 10407: msc_sch_wb.atp_debug('View_Allocation: ' || 'Request date is null');

10403: END IF;
10404: -- krajan : 2400676
10405: IF (l_request_date = NULL) THEN
10406: IF PG_DEBUG in ('Y', 'C') THEN
10407: msc_sch_wb.atp_debug('View_Allocation: ' || 'Request date is null');
10408: END IF;
10409: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.NO_MATCHING_CAL_DATE;
10410: RAISE FND_API.G_EXC_ERROR;
10411: END IF;

Line 10409: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.NO_MATCHING_CAL_DATE;

10405: IF (l_request_date = NULL) THEN
10406: IF PG_DEBUG in ('Y', 'C') THEN
10407: msc_sch_wb.atp_debug('View_Allocation: ' || 'Request date is null');
10408: END IF;
10409: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.NO_MATCHING_CAL_DATE;
10410: RAISE FND_API.G_EXC_ERROR;
10411: END IF;
10412:
10413: --Check if the request is for Item or Department-Resource.

Line 10437: msc_sch_wb.atp_debug('View_Allocation: ' || 'Plan Id : '||to_char(l_plan_id));

10433: l_assign_set_id := l_plan_info_rec.assignment_set_id;
10434: -- changes for bug 2392456 ends
10435:
10436: IF PG_DEBUG in ('Y', 'C') THEN
10437: msc_sch_wb.atp_debug('View_Allocation: ' || 'Plan Id : '||to_char(l_plan_id));
10438: msc_sch_wb.atp_debug('View_Allocation: ' || 'Assignment Set Id : '||to_char(l_assign_set_id));
10439: END IF;
10440:
10441: -- krajan : 2400676

Line 10438: msc_sch_wb.atp_debug('View_Allocation: ' || 'Assignment Set Id : '||to_char(l_assign_set_id));

10434: -- changes for bug 2392456 ends
10435:
10436: IF PG_DEBUG in ('Y', 'C') THEN
10437: msc_sch_wb.atp_debug('View_Allocation: ' || 'Plan Id : '||to_char(l_plan_id));
10438: msc_sch_wb.atp_debug('View_Allocation: ' || 'Assignment Set Id : '||to_char(l_assign_set_id));
10439: END IF;
10440:
10441: -- krajan : 2400676
10442: IF (l_plan_id IS NULL) OR (l_plan_id = -1) THEN

Line 10444: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Plan_ID is null or -1');

10440:
10441: -- krajan : 2400676
10442: IF (l_plan_id IS NULL) OR (l_plan_id = -1) THEN
10443: IF PG_DEBUG in ('Y', 'C') THEN
10444: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Plan_ID is null or -1');
10445: END IF;
10446: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.PLAN_NOT_FOUND;
10447: RAISE FND_API.G_EXC_ERROR;
10448: END IF;

Line 10446: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.PLAN_NOT_FOUND;

10442: IF (l_plan_id IS NULL) OR (l_plan_id = -1) THEN
10443: IF PG_DEBUG in ('Y', 'C') THEN
10444: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Plan_ID is null or -1');
10445: END IF;
10446: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.PLAN_NOT_FOUND;
10447: RAISE FND_API.G_EXC_ERROR;
10448: END IF;
10449:
10450: IF (l_plan_id = -100) THEN

Line 10452: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Plan_ID is -100 : Summary Running');

10448: END IF;
10449:
10450: IF (l_plan_id = -100) THEN
10451: IF PG_DEBUG in ('Y', 'C') THEN
10452: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Plan_ID is -100 : Summary Running');
10453: END IF;
10454: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.SUMM_CONC_PROG_RUNNING;
10455: RAISE FND_API.G_EXC_ERROR;
10456: END IF;

Line 10454: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.SUMM_CONC_PROG_RUNNING;

10450: IF (l_plan_id = -100) THEN
10451: IF PG_DEBUG in ('Y', 'C') THEN
10452: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Plan_ID is -100 : Summary Running');
10453: END IF;
10454: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.SUMM_CONC_PROG_RUNNING;
10455: RAISE FND_API.G_EXC_ERROR;
10456: END IF;
10457:
10458: IF (l_plan_id = -200) THEN

Line 10460: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Plan_ID is -200 : Summary Running');

10456: END IF;
10457:
10458: IF (l_plan_id = -200) THEN
10459: IF PG_DEBUG in ('Y', 'C') THEN
10460: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Plan_ID is -200 : Summary Running');
10461: END IF;
10462: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.RUN_POST_PLAN_ALLOC;
10463: RAISE FND_API.G_EXC_ERROR;
10464: END IF;

Line 10462: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.RUN_POST_PLAN_ALLOC;

10458: IF (l_plan_id = -200) THEN
10459: IF PG_DEBUG in ('Y', 'C') THEN
10460: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Plan_ID is -200 : Summary Running');
10461: END IF;
10462: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.RUN_POST_PLAN_ALLOC;
10463: RAISE FND_API.G_EXC_ERROR;
10464: END IF;
10465:
10466:

Line 10511: msc_sch_wb.atp_debug('View_Allocation: before '||

10507: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
10508: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN
10509:
10510: IF PG_DEBUG in ('Y', 'C') THEN
10511: msc_sch_wb.atp_debug('View_Allocation: before '||
10512: 'calling Item_Pre_Allocated_Atp for Totals');
10513: END IF;
10514: -- Set demand_class to NULL to obtain totals.
10515:

Line 10554: msc_sch_wb.atp_debug('View_Allocation: before calling '||

10550: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
10551: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN
10552:
10553: IF PG_DEBUG in ('Y', 'C') THEN
10554: msc_sch_wb.atp_debug('View_Allocation: before calling '||
10555: 'Get_Hierarchy_Demand_Class for Demand Class');
10556: END IF;
10557: -- Code for Get_Hierarchy_Demand_Class
10558:

Line 10663: msc_sch_wb.atp_debug('View_Allocation: ' || 'Plan not found ');

10659: mdr.resource_id, mdr.department_id;--, desig.demand_class;
10660: EXCEPTION
10661: WHEN NO_DATA_FOUND THEN
10662: IF PG_DEBUG in ('Y', 'C') THEN
10663: msc_sch_wb.atp_debug('View_Allocation: ' || 'Plan not found ');
10664: END IF;
10665: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.PLAN_NOT_FOUND;
10666: RAISE FND_API.G_EXC_ERROR;
10667: WHEN others THEN

Line 10665: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.PLAN_NOT_FOUND;

10661: WHEN NO_DATA_FOUND THEN
10662: IF PG_DEBUG in ('Y', 'C') THEN
10663: msc_sch_wb.atp_debug('View_Allocation: ' || 'Plan not found ');
10664: END IF;
10665: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.PLAN_NOT_FOUND;
10666: RAISE FND_API.G_EXC_ERROR;
10667: WHEN others THEN
10668: IF PG_DEBUG in ('Y', 'C') THEN
10669: msc_sch_wb.atp_debug('View_Allocation: ' || 'Error getting plan id :'||sqlcode);

Line 10669: msc_sch_wb.atp_debug('View_Allocation: ' || 'Error getting plan id :'||sqlcode);

10665: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.PLAN_NOT_FOUND;
10666: RAISE FND_API.G_EXC_ERROR;
10667: WHEN others THEN
10668: IF PG_DEBUG in ('Y', 'C') THEN
10669: msc_sch_wb.atp_debug('View_Allocation: ' || 'Error getting plan id :'||sqlcode);
10670: END IF;
10671: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;
10672: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
10673: END;

Line 10671: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;

10667: WHEN others THEN
10668: IF PG_DEBUG in ('Y', 'C') THEN
10669: msc_sch_wb.atp_debug('View_Allocation: ' || 'Error getting plan id :'||sqlcode);
10670: END IF;
10671: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;
10672: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
10673: END;
10674:
10675: IF PG_DEBUG in ('Y', 'C') THEN

Line 10676: msc_sch_wb.atp_debug('View_Allocation: ' || 'Plan Id : '||to_char(l_plan_id));

10672: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
10673: END;
10674:
10675: IF PG_DEBUG in ('Y', 'C') THEN
10676: msc_sch_wb.atp_debug('View_Allocation: ' || 'Plan Id : '||to_char(l_plan_id));
10677: END IF;
10678:
10679: --Call Res_Alloc_Cum_Atp to get the period ATP info
10680: --for the department/resource. Set insert_flag = 1, for period atp details.

Line 10699: msc_sch_wb.atp_debug('View_Allocation: ' || 'Convert res_item UOM');

10695: l_batchable_flag := 0;
10696: l_max_capacity := 0;
10697: END;
10698: IF PG_DEBUG in ('Y', 'C') THEN
10699: msc_sch_wb.atp_debug('View_Allocation: ' || 'Convert res_item UOM');
10700: END IF;
10701: IF (l_batchable_flag = 1) THEN
10702: BEGIN
10703: SELECT conversion_rate

Line 10716: msc_sch_wb.atp_debug('View_Allocation: ' || 'l_res_conversion_rate := ' || l_res_conversion_rate);

10712: END;
10713:
10714: END IF;
10715: IF PG_DEBUG in ('Y', 'C') THEN
10716: msc_sch_wb.atp_debug('View_Allocation: ' || 'l_res_conversion_rate := ' || l_res_conversion_rate);
10717: END IF;
10718:
10719: -- Agilent Allocated ATP Based on Planning Details changes Begin
10720:

Line 10794: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ');

10790:
10791: END IF;
10792:
10793: IF PG_DEBUG in ('Y', 'C') THEN
10794: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ');
10795: Print_Period_Qty('l_atp_info.atp_period:atp_qty = ',
10796: l_atp_info);
10797: END IF;
10798:

Line 10802: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.NO_SUPPLY_DEMAND;

10798:
10799: -- krajan : 2400676
10800: IF (l_atp_period.period_quantity.COUNT = 0) THEN
10801: -- rajjain bug 2951786 05/13/2003
10802: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.NO_SUPPLY_DEMAND;
10803: -- MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;
10804: IF PG_DEBUG in ('Y', 'C') THEN
10805: msc_sch_wb.atp_debug ('View_Allocation: ' || 'l_atp_period is NULL');
10806: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Error Code: ' || MSC_SCH_WB.G_ATP_ERROR_CODE);

Line 10803: -- MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;

10799: -- krajan : 2400676
10800: IF (l_atp_period.period_quantity.COUNT = 0) THEN
10801: -- rajjain bug 2951786 05/13/2003
10802: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.NO_SUPPLY_DEMAND;
10803: -- MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;
10804: IF PG_DEBUG in ('Y', 'C') THEN
10805: msc_sch_wb.atp_debug ('View_Allocation: ' || 'l_atp_period is NULL');
10806: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Error Code: ' || MSC_SCH_WB.G_ATP_ERROR_CODE);
10807: END IF;

Line 10805: msc_sch_wb.atp_debug ('View_Allocation: ' || 'l_atp_period is NULL');

10801: -- rajjain bug 2951786 05/13/2003
10802: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.NO_SUPPLY_DEMAND;
10803: -- MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;
10804: IF PG_DEBUG in ('Y', 'C') THEN
10805: msc_sch_wb.atp_debug ('View_Allocation: ' || 'l_atp_period is NULL');
10806: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Error Code: ' || MSC_SCH_WB.G_ATP_ERROR_CODE);
10807: END IF;
10808: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
10809: END IF;

Line 10806: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Error Code: ' || MSC_SCH_WB.G_ATP_ERROR_CODE);

10802: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.NO_SUPPLY_DEMAND;
10803: -- MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;
10804: IF PG_DEBUG in ('Y', 'C') THEN
10805: msc_sch_wb.atp_debug ('View_Allocation: ' || 'l_atp_period is NULL');
10806: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Error Code: ' || MSC_SCH_WB.G_ATP_ERROR_CODE);
10807: END IF;
10808: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
10809: END IF;
10810:

Line 10815: msc_sch_wb.atp_debug('View_Allocation: ' || 'l_atp_period.period_start_date and Period_Quantity = '||

10811: IF PG_DEBUG in ('Y', 'C') THEN
10812: mm := l_atp_period.Period_Quantity.FIRST;
10813:
10814: WHILE mm is not null LOOP
10815: msc_sch_wb.atp_debug('View_Allocation: ' || 'l_atp_period.period_start_date and Period_Quantity = '||
10816: l_atp_period.period_start_date(mm) ||' : '|| l_atp_period.Period_Quantity(mm));
10817: mm := l_atp_period.Period_Quantity.Next(mm);
10818: END LOOP;
10819: END IF;

Line 10842: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Something wrong in call to PUT_INTO_TEMP_TABLE');

10838: l_msg_count);
10839:
10840: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
10841: IF PG_DEBUG in ('Y', 'C') THEN
10842: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Something wrong in call to PUT_INTO_TEMP_TABLE');
10843: END IF;
10844: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;
10845: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
10846: END IF;*/

Line 10844: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;

10840: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
10841: IF PG_DEBUG in ('Y', 'C') THEN
10842: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Something wrong in call to PUT_INTO_TEMP_TABLE');
10843: END IF;
10844: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;
10845: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
10846: END IF;*/
10847:
10848: -- rajjain 01/29/2003 begin Bug 2737596

Line 10850: msc_sch_wb.atp_debug('View_Allocation: ' || 'l_atp_supply_demand.level.COUNT: ' || l_atp_supply_demand.level.COUNT);

10846: END IF;*/
10847:
10848: -- rajjain 01/29/2003 begin Bug 2737596
10849: IF PG_DEBUG in ('Y', 'C') THEN
10850: msc_sch_wb.atp_debug('View_Allocation: ' || 'l_atp_supply_demand.level.COUNT: ' || l_atp_supply_demand.level.COUNT);
10851: END IF;
10852:
10853: MSC_ATP_UTILS.PUT_SD_DATA(l_atp_supply_demand, NULL, p_session_id);
10854:

Line 10856: msc_sch_wb.atp_debug('View_Allocation: ' || ' Inserted supply demand records ');

10852:
10853: MSC_ATP_UTILS.PUT_SD_DATA(l_atp_supply_demand, NULL, p_session_id);
10854:
10855: IF PG_DEBUG in ('Y', 'C') THEN
10856: msc_sch_wb.atp_debug('View_Allocation: ' || ' Inserted supply demand records ');
10857: END IF;
10858:
10859: IF PG_DEBUG in ('Y', 'C') THEN
10860: msc_sch_wb.atp_debug('View_Allocation: ' || 'l_atp_period.level.count: ' || l_atp_period.level.count);

Line 10860: msc_sch_wb.atp_debug('View_Allocation: ' || 'l_atp_period.level.count: ' || l_atp_period.level.count);

10856: msc_sch_wb.atp_debug('View_Allocation: ' || ' Inserted supply demand records ');
10857: END IF;
10858:
10859: IF PG_DEBUG in ('Y', 'C') THEN
10860: msc_sch_wb.atp_debug('View_Allocation: ' || 'l_atp_period.level.count: ' || l_atp_period.level.count);
10861: END IF;
10862:
10863: MSC_ATP_UTILS.PUT_PERIOD_DATA(l_atp_period, NULL, p_session_id);
10864:

Line 10866: msc_sch_wb.atp_debug('View_Allocation: ' || ' Inserted period records ');

10862:
10863: MSC_ATP_UTILS.PUT_PERIOD_DATA(l_atp_period, NULL, p_session_id);
10864:
10865: IF PG_DEBUG in ('Y', 'C') THEN
10866: msc_sch_wb.atp_debug('View_Allocation: ' || ' Inserted period records ');
10867: END IF;
10868: -- rajjain 01/29/2003 end Bug 2737596
10869:
10870: -- krajan : 2400614

Line 10876: msc_sch_wb.atp_debug ('Error in View_Allocation: Expected Error Raised');

10872:
10873: WHEN FND_API.G_EXC_ERROR THEN
10874: -- ATP ERROR CODE WILL BE SET before this exception is raised
10875: IF PG_DEBUG in ('Y', 'C') THEN
10876: msc_sch_wb.atp_debug ('Error in View_Allocation: Expected Error Raised');
10877: END IF;
10878: x_return_status := FND_API.G_RET_STS_ERROR;
10879: IF (MSC_SCH_WB.G_ATP_ERROR_CODE = 0) THEN
10880: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;

Line 10879: IF (MSC_SCH_WB.G_ATP_ERROR_CODE = 0) THEN

10875: IF PG_DEBUG in ('Y', 'C') THEN
10876: msc_sch_wb.atp_debug ('Error in View_Allocation: Expected Error Raised');
10877: END IF;
10878: x_return_status := FND_API.G_RET_STS_ERROR;
10879: IF (MSC_SCH_WB.G_ATP_ERROR_CODE = 0) THEN
10880: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;
10881: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
10882: END IF;
10883:

Line 10880: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;

10876: msc_sch_wb.atp_debug ('Error in View_Allocation: Expected Error Raised');
10877: END IF;
10878: x_return_status := FND_API.G_RET_STS_ERROR;
10879: IF (MSC_SCH_WB.G_ATP_ERROR_CODE = 0) THEN
10880: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;
10881: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
10882: END IF;
10883:
10884: WHEN MSC_ATP_PUB.ATP_INVALID_OBJECTS_FOUND THEN

Line 10886: msc_sch_wb.atp_debug ('Error in View_Allocation: Invalid Objects Found');

10882: END IF;
10883:
10884: WHEN MSC_ATP_PUB.ATP_INVALID_OBJECTS_FOUND THEN
10885: IF PG_DEBUG in ('Y', 'C') THEN
10886: msc_sch_wb.atp_debug ('Error in View_Allocation: Invalid Objects Found');
10887: END IF;
10888: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_INVALID_OBJECTS;
10889: x_return_status := FND_API.G_RET_STS_ERROR;
10890:

Line 10888: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_INVALID_OBJECTS;

10884: WHEN MSC_ATP_PUB.ATP_INVALID_OBJECTS_FOUND THEN
10885: IF PG_DEBUG in ('Y', 'C') THEN
10886: msc_sch_wb.atp_debug ('Error in View_Allocation: Invalid Objects Found');
10887: END IF;
10888: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_INVALID_OBJECTS;
10889: x_return_status := FND_API.G_RET_STS_ERROR;
10890:
10891: WHEN OTHERS THEN
10892: IF PG_DEBUG in ('Y', 'C') THEN

Line 10893: msc_sch_wb.atp_debug ('Error in View_Allocation');

10889: x_return_status := FND_API.G_RET_STS_ERROR;
10890:
10891: WHEN OTHERS THEN
10892: IF PG_DEBUG in ('Y', 'C') THEN
10893: msc_sch_wb.atp_debug ('Error in View_Allocation');
10894: END IF;
10895: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
10896: IF (MSC_SCH_WB.G_ATP_ERROR_CODE = 0) THEN
10897: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;

Line 10896: IF (MSC_SCH_WB.G_ATP_ERROR_CODE = 0) THEN

10892: IF PG_DEBUG in ('Y', 'C') THEN
10893: msc_sch_wb.atp_debug ('Error in View_Allocation');
10894: END IF;
10895: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
10896: IF (MSC_SCH_WB.G_ATP_ERROR_CODE = 0) THEN
10897: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;
10898: END IF;
10899:
10900: END View_allocation;

Line 10897: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;

10893: msc_sch_wb.atp_debug ('Error in View_Allocation');
10894: END IF;
10895: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
10896: IF (MSC_SCH_WB.G_ATP_ERROR_CODE = 0) THEN
10897: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;
10898: END IF;
10899:
10900: END View_allocation;
10901:

Line 10977: msc_sch_wb.atp_debug('********* Begin Stealing ************');

10973: -- Keep decrementing the net_demand and exit if it is <= 0
10974: -- If the net_demand is still > 0, pass that back to the calling routing
10975:
10976: IF PG_DEBUG in ('Y', 'C') THEN
10977: msc_sch_wb.atp_debug('********* Begin Stealing ************');
10978: END IF;
10979:
10980: /* time_phased_atp changes begin
10981: initialize variables*/

Line 10991: msc_sch_wb.atp_debug('Stealing: ' || 'Time Phased ATP = ' || l_time_phased_atp);

10987: l_time_phased_atp := 'Y';
10988: l_process_item_id := p_atp_record.request_item_id;
10989: l_pf_item_id := MSC_ATP_PVT.G_ITEM_INFO_REC.product_family_id;
10990: IF PG_DEBUG in ('Y', 'C') THEN
10991: msc_sch_wb.atp_debug('Stealing: ' || 'Time Phased ATP = ' || l_time_phased_atp);
10992: msc_sch_wb.atp_debug('Stealing: ' || 'ATF Date = ' || p_atp_record.atf_date);
10993: msc_sch_wb.atp_debug('Stealing: ' || 'l_pf_item_id = ' || l_pf_item_id);
10994: END IF;
10995: ELSE

Line 10992: msc_sch_wb.atp_debug('Stealing: ' || 'ATF Date = ' || p_atp_record.atf_date);

10988: l_process_item_id := p_atp_record.request_item_id;
10989: l_pf_item_id := MSC_ATP_PVT.G_ITEM_INFO_REC.product_family_id;
10990: IF PG_DEBUG in ('Y', 'C') THEN
10991: msc_sch_wb.atp_debug('Stealing: ' || 'Time Phased ATP = ' || l_time_phased_atp);
10992: msc_sch_wb.atp_debug('Stealing: ' || 'ATF Date = ' || p_atp_record.atf_date);
10993: msc_sch_wb.atp_debug('Stealing: ' || 'l_pf_item_id = ' || l_pf_item_id);
10994: END IF;
10995: ELSE
10996: l_process_item_id := p_atp_record.inventory_item_id;

Line 10993: msc_sch_wb.atp_debug('Stealing: ' || 'l_pf_item_id = ' || l_pf_item_id);

10989: l_pf_item_id := MSC_ATP_PVT.G_ITEM_INFO_REC.product_family_id;
10990: IF PG_DEBUG in ('Y', 'C') THEN
10991: msc_sch_wb.atp_debug('Stealing: ' || 'Time Phased ATP = ' || l_time_phased_atp);
10992: msc_sch_wb.atp_debug('Stealing: ' || 'ATF Date = ' || p_atp_record.atf_date);
10993: msc_sch_wb.atp_debug('Stealing: ' || 'l_pf_item_id = ' || l_pf_item_id);
10994: END IF;
10995: ELSE
10996: l_process_item_id := p_atp_record.inventory_item_id;
10997: END IF;

Line 11034: msc_sch_wb.atp_debug('ATP_Check: ' || 'p_atp_record.requested_ship_date = '||p_atp_record.requested_ship_date);

11030: ELSE
11031: l_item_to_use := l_inv_item_id;
11032: END IF;
11033: IF PG_DEBUG in ('Y', 'C') THEN
11034: msc_sch_wb.atp_debug('ATP_Check: ' || 'p_atp_record.requested_ship_date = '||p_atp_record.requested_ship_date);
11035: msc_sch_wb.atp_debug('ATP_Check: ' || 'Item to be used = '||l_item_to_use);
11036: END IF;
11037: /* New allocation logic for time_phased_atp changes end */
11038:

Line 11035: msc_sch_wb.atp_debug('ATP_Check: ' || 'Item to be used = '||l_item_to_use);

11031: l_item_to_use := l_inv_item_id;
11032: END IF;
11033: IF PG_DEBUG in ('Y', 'C') THEN
11034: msc_sch_wb.atp_debug('ATP_Check: ' || 'p_atp_record.requested_ship_date = '||p_atp_record.requested_ship_date);
11035: msc_sch_wb.atp_debug('ATP_Check: ' || 'Item to be used = '||l_item_to_use);
11036: END IF;
11037: /* New allocation logic for time_phased_atp changes end */
11038:
11039: BEGIN

Line 11074: msc_sch_wb.atp_debug('Stealing: ' || 'No Data found ');

11070:
11071: EXCEPTION
11072: WHEN NO_DATA_FOUND THEN
11073: IF PG_DEBUG in ('Y', 'C') THEN
11074: msc_sch_wb.atp_debug('Stealing: ' || 'No Data found ');
11075: END IF;
11076: l_priority := NULL;
11077: l_level_id := NULL;
11078: l_partner_id := NULL;

Line 11083: msc_sch_wb.atp_debug('Stealing: ' || 'l_priority = '||l_priority);

11079: l_class := NULL;
11080: END ;
11081:
11082: IF PG_DEBUG in ('Y', 'C') THEN
11083: msc_sch_wb.atp_debug('Stealing: ' || 'l_priority = '||l_priority);
11084: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);
11085: msc_sch_wb.atp_debug('Stealing: ' || 'l_partner_id = '||l_partner_id);
11086: msc_sch_wb.atp_debug('Stealing: ' || 'l_class = '||l_class);
11087: msc_sch_wb.atp_debug('Stealing: ' || 'before finding the lower priority dc ');

Line 11084: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);

11080: END ;
11081:
11082: IF PG_DEBUG in ('Y', 'C') THEN
11083: msc_sch_wb.atp_debug('Stealing: ' || 'l_priority = '||l_priority);
11084: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);
11085: msc_sch_wb.atp_debug('Stealing: ' || 'l_partner_id = '||l_partner_id);
11086: msc_sch_wb.atp_debug('Stealing: ' || 'l_class = '||l_class);
11087: msc_sch_wb.atp_debug('Stealing: ' || 'before finding the lower priority dc ');
11088: END IF;

Line 11085: msc_sch_wb.atp_debug('Stealing: ' || 'l_partner_id = '||l_partner_id);

11081:
11082: IF PG_DEBUG in ('Y', 'C') THEN
11083: msc_sch_wb.atp_debug('Stealing: ' || 'l_priority = '||l_priority);
11084: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);
11085: msc_sch_wb.atp_debug('Stealing: ' || 'l_partner_id = '||l_partner_id);
11086: msc_sch_wb.atp_debug('Stealing: ' || 'l_class = '||l_class);
11087: msc_sch_wb.atp_debug('Stealing: ' || 'before finding the lower priority dc ');
11088: END IF;
11089:

Line 11086: msc_sch_wb.atp_debug('Stealing: ' || 'l_class = '||l_class);

11082: IF PG_DEBUG in ('Y', 'C') THEN
11083: msc_sch_wb.atp_debug('Stealing: ' || 'l_priority = '||l_priority);
11084: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);
11085: msc_sch_wb.atp_debug('Stealing: ' || 'l_partner_id = '||l_partner_id);
11086: msc_sch_wb.atp_debug('Stealing: ' || 'l_class = '||l_class);
11087: msc_sch_wb.atp_debug('Stealing: ' || 'before finding the lower priority dc ');
11088: END IF;
11089:
11090: IF l_level_id = -1 THEN

Line 11087: msc_sch_wb.atp_debug('Stealing: ' || 'before finding the lower priority dc ');

11083: msc_sch_wb.atp_debug('Stealing: ' || 'l_priority = '||l_priority);
11084: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);
11085: msc_sch_wb.atp_debug('Stealing: ' || 'l_partner_id = '||l_partner_id);
11086: msc_sch_wb.atp_debug('Stealing: ' || 'l_class = '||l_class);
11087: msc_sch_wb.atp_debug('Stealing: ' || 'before finding the lower priority dc ');
11088: END IF;
11089:
11090: IF l_level_id = -1 THEN
11091: IF PG_DEBUG in ('Y', 'C') THEN

Line 11092: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);

11088: END IF;
11089:
11090: IF l_level_id = -1 THEN
11091: IF PG_DEBUG in ('Y', 'C') THEN
11092: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);
11093: END IF;
11094:
11095: SELECT mv.demand_class, mv.priority, mv.allocation_percent
11096: BULK COLLECT INTO l_demand_class_tab_new, l_dmd_class_priority_tab_new, l_allocation_percent_tab --6359986

Line 11109: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);

11105: ORDER BY mv.priority asc , mv.allocation_percent desc ;
11106:
11107: ELSIF l_level_id = 1 THEN
11108: IF PG_DEBUG in ('Y', 'C') THEN
11109: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);
11110: END IF;
11111:
11112: SELECT mv.demand_class, mv.priority, mv.allocation_percent
11113: BULK COLLECT INTO l_demand_class_tab_new, l_dmd_class_priority_tab_new, l_allocation_percent_tab --6359986

Line 11127: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);

11123:
11124: ELSIF l_level_id = 2 THEN
11125:
11126: IF PG_DEBUG in ('Y', 'C') THEN
11127: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);
11128: END IF;
11129: SELECT mv1.demand_class, mv1.priority, mv1.allocation_percent
11130: BULK COLLECT INTO l_demand_class_tab_new, l_dmd_class_priority_tab_new,l_allocation_percent_tab --6359986
11131: FROM msc_item_hierarchy_mv mv1

Line 11148: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);

11144:
11145: ELSIF l_level_id = 3 THEN
11146:
11147: IF PG_DEBUG in ('Y', 'C') THEN
11148: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);
11149: END IF;
11150: SELECT mv1.demand_class, mv1.priority, mv1.allocation_percent
11151: BULK COLLECT INTO l_demand_class_tab_new, l_dmd_class_priority_tab_new,l_allocation_percent_tab --6359986
11152: FROM msc_item_hierarchy_mv mv1

Line 11173: msc_sch_wb.atp_debug('Stealing: ' || 'l_demand_class_tab_new.count = '||l_demand_class_tab_new.count);--6359986

11169:
11170: END IF;
11171:
11172: IF PG_DEBUG in ('Y', 'C') THEN
11173: msc_sch_wb.atp_debug('Stealing: ' || 'l_demand_class_tab_new.count = '||l_demand_class_tab_new.count);--6359986
11174: END IF;
11175: --diag_atp
11176: l_get_mat_in_rec.rounding_control_flag := MSC_ATP_PVT.G_ITEM_INFO_REC.rounding_control_type;
11177: l_get_mat_in_rec.dest_inv_item_id := l_inv_item_id;

Line 11213: msc_sch_wb.atp_debug('Stealing: ' || 'Inside the loop of demand class');

11209:
11210: FOR i in 1..l_demand_class_tab.COUNT LOOP
11211: l_demand_class := l_demand_class_tab(i);
11212: IF PG_DEBUG in ('Y', 'C') THEN
11213: msc_sch_wb.atp_debug('Stealing: ' || 'Inside the loop of demand class');
11214: msc_sch_wb.atp_debug('Stealing: ' || 'l_demand_class'||l_demand_class);
11215: END IF;
11216:
11217: -- time_phased_atp changes begin

Line 11214: msc_sch_wb.atp_debug('Stealing: ' || 'l_demand_class'||l_demand_class);

11210: FOR i in 1..l_demand_class_tab.COUNT LOOP
11211: l_demand_class := l_demand_class_tab(i);
11212: IF PG_DEBUG in ('Y', 'C') THEN
11213: msc_sch_wb.atp_debug('Stealing: ' || 'Inside the loop of demand class');
11214: msc_sch_wb.atp_debug('Stealing: ' || 'l_demand_class'||l_demand_class);
11215: END IF;
11216:
11217: -- time_phased_atp changes begin
11218: l_mat_atp_info_rec.instance_id := p_atp_record.instance_id;

Line 11257: msc_sch_wb.atp_debug('Back in Stealing');

11253: l_get_mat_out_rec.infinite_time_fence_date := l_mat_atp_info_rec.infinite_time_fence_date;
11254: p_atp_record.requested_date_quantity := l_mat_atp_info_rec.requested_date_quantity;
11255:
11256: IF PG_DEBUG in ('Y', 'C') THEN
11257: msc_sch_wb.atp_debug('Back in Stealing');
11258: END IF;
11259: -- time_phased_atp changes end
11260:
11261: -- 1430561: move the p_net_demand calculation to the end so that

Line 11266: msc_sch_wb.atp_debug('Stealing: ' || 'p_net_demand = '||to_char(p_net_demand));

11262: -- we insert the right demand quantity
11263: -- p_net_demand := (p_net_demand - greatest(l_requested_date_quantity, 0)) ;
11264:
11265: IF PG_DEBUG in ('Y', 'C') THEN
11266: msc_sch_wb.atp_debug('Stealing: ' || 'p_net_demand = '||to_char(p_net_demand));
11267: END IF;
11268: -- if we don't have atp for this demand class , don't bother
11269: -- generate pegging tree, demand record.
11270:

Line 11272: msc_sch_wb.atp_debug('Stealing: ' || 'p_atp_record.requested_date_quantity = '||

11268: -- if we don't have atp for this demand class , don't bother
11269: -- generate pegging tree, demand record.
11270:
11271: IF PG_DEBUG in ('Y', 'C') THEN
11272: msc_sch_wb.atp_debug('Stealing: ' || 'p_atp_record.requested_date_quantity = '||
11273: p_atp_record.requested_date_quantity);
11274: END IF;
11275:
11276: IF p_atp_record.requested_date_quantity > 0 THEN

Line 11354: msc_sch_wb.atp_debug('Stealing: ' || 'Error occured in procedure Add_PF_Stealing_Supply_Details');

11350: p_atp_record.order_number,
11351: l_return_status);
11352: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
11353: IF PG_DEBUG in ('Y', 'C') THEN
11354: msc_sch_wb.atp_debug('Stealing: ' || 'Error occured in procedure Add_PF_Stealing_Supply_Details');
11355: END IF;
11356: RAISE FND_API.G_EXC_ERROR;
11357: END IF;
11358: END IF;

Line 11362: msc_sch_wb.atp_debug('Stealing Supply Id : ' || l_demand_id);

11358: END IF;
11359: -- time_phased_atp changes end
11360:
11361: IF PG_DEBUG in ('Y', 'C') THEN
11362: msc_sch_wb.atp_debug('Stealing Supply Id : ' || l_demand_id);
11363: END IF;
11364:
11365: ELSIF l_time_phased_atp = 'Y' THEN
11366: IF p_atp_record.requested_ship_date <= p_atp_record.atf_date THEN

Line 11380: msc_sch_wb.atp_debug('Stealing: l_mem_stealing_qty = ' || l_mem_stealing_qty);

11376: l_mem_stealing_qty := LEAST(NVL(l_atf_date_qty, 0), (p_net_demand - l_pf_stealing_qty));
11377: END IF;
11378: END IF;
11379: IF PG_DEBUG in ('Y', 'C') THEN
11380: msc_sch_wb.atp_debug('Stealing: l_mem_stealing_qty = ' || l_mem_stealing_qty);
11381: msc_sch_wb.atp_debug('Stealing: l_pf_stealing_qty = ' || l_pf_stealing_qty);
11382: END IF;
11383: END IF;
11384:

Line 11381: msc_sch_wb.atp_debug('Stealing: l_pf_stealing_qty = ' || l_pf_stealing_qty);

11377: END IF;
11378: END IF;
11379: IF PG_DEBUG in ('Y', 'C') THEN
11380: msc_sch_wb.atp_debug('Stealing: l_mem_stealing_qty = ' || l_mem_stealing_qty);
11381: msc_sch_wb.atp_debug('Stealing: l_pf_stealing_qty = ' || l_pf_stealing_qty);
11382: END IF;
11383: END IF;
11384:
11385: x_total_mem_stealing_qty := x_total_mem_stealing_qty + l_mem_stealing_qty;

Line 11388: msc_sch_wb.atp_debug('Stealing: x_total_mem_stealing_qty = ' || x_total_mem_stealing_qty);

11384:
11385: x_total_mem_stealing_qty := x_total_mem_stealing_qty + l_mem_stealing_qty;
11386: x_total_pf_stealing_qty := x_total_pf_stealing_qty + l_pf_stealing_qty;
11387: IF PG_DEBUG in ('Y', 'C') THEN
11388: msc_sch_wb.atp_debug('Stealing: x_total_mem_stealing_qty = ' || x_total_mem_stealing_qty);
11389: msc_sch_wb.atp_debug('Stealing: x_total_pf_stealing_qty = ' || x_total_pf_stealing_qty);
11390: END IF;
11391: -- time_phased_atp changes end
11392:

Line 11389: msc_sch_wb.atp_debug('Stealing: x_total_pf_stealing_qty = ' || x_total_pf_stealing_qty);

11385: x_total_mem_stealing_qty := x_total_mem_stealing_qty + l_mem_stealing_qty;
11386: x_total_pf_stealing_qty := x_total_pf_stealing_qty + l_pf_stealing_qty;
11387: IF PG_DEBUG in ('Y', 'C') THEN
11388: msc_sch_wb.atp_debug('Stealing: x_total_mem_stealing_qty = ' || x_total_mem_stealing_qty);
11389: msc_sch_wb.atp_debug('Stealing: x_total_pf_stealing_qty = ' || x_total_pf_stealing_qty);
11390: END IF;
11391: -- time_phased_atp changes end
11392:
11393: -- populate insert rec to pegging tree for this demand

Line 11409: msc_sch_wb.atp_debug('Stealing: ' || 'Modular Use Org_code : '||l_org_code);

11405: MSC_ATP_PROC.get_global_org_info (p_atp_record.instance_id,
11406: p_atp_record.organization_id );
11407: l_org_code := MSC_ATP_PVT.G_ORG_INFO_REC.org_code;
11408: IF PG_DEBUG in ('Y', 'C') THEN
11409: msc_sch_wb.atp_debug('Stealing: ' || 'Modular Use Org_code : '||l_org_code);
11410: END IF;
11411: /*l_org_code := MSC_ATP_FUNC.get_org_code(p_atp_record.instance_id,
11412: p_atp_record.organization_id);
11413: Modularize Item and Org Info */

Line 11480: msc_sch_wb.atp_debug('Stealing: l_pegging_rec.allocated_quantity = ' ||l_pegging_rec.allocated_quantity);

11476: p_net_demand);
11477: END IF;
11478:
11479: IF PG_DEBUG in ('Y', 'C') THEN
11480: msc_sch_wb.atp_debug('Stealing: l_pegging_rec.allocated_quantity = ' ||l_pegging_rec.allocated_quantity);
11481: END IF;
11482: l_pegging_rec.component_identifier :=
11483: NVL(p_atp_record.component_identifier, MSC_ATP_PVT.G_COMP_LINE_ID);
11484:

Line 11519: msc_sch_wb.atp_debug('ATP_Check: ' || '----------- Calendars passed to Pegging -----------------');

11515: l_pegging_rec.summary_flag := MSC_ATP_PVT.G_SUMMARY_FLAG; -- for summary enhancement
11516: l_pegging_rec.demand_class := l_demand_class;
11517: -- Bug 3826234 start
11518: IF PG_DEBUG in ('Y', 'C') THEN
11519: msc_sch_wb.atp_debug('ATP_Check: ' || '----------- Calendars passed to Pegging -----------------');
11520: msc_sch_wb.atp_debug('ATP_Check: ' || 'shipping_cal_code = ' ||p_atp_record.shipping_cal_code);
11521: msc_sch_wb.atp_debug('ATP_Check: ' || 'receiving_cal_code = ' ||p_atp_record.receiving_cal_code);
11522: msc_sch_wb.atp_debug('ATP_Check: ' || 'intransit_cal_code = ' ||p_atp_record.intransit_cal_code);
11523: msc_sch_wb.atp_debug('ATP_Check: ' || 'manufacturing_cal_code = ' ||p_atp_record.manufacturing_cal_code);

Line 11520: msc_sch_wb.atp_debug('ATP_Check: ' || 'shipping_cal_code = ' ||p_atp_record.shipping_cal_code);

11516: l_pegging_rec.demand_class := l_demand_class;
11517: -- Bug 3826234 start
11518: IF PG_DEBUG in ('Y', 'C') THEN
11519: msc_sch_wb.atp_debug('ATP_Check: ' || '----------- Calendars passed to Pegging -----------------');
11520: msc_sch_wb.atp_debug('ATP_Check: ' || 'shipping_cal_code = ' ||p_atp_record.shipping_cal_code);
11521: msc_sch_wb.atp_debug('ATP_Check: ' || 'receiving_cal_code = ' ||p_atp_record.receiving_cal_code);
11522: msc_sch_wb.atp_debug('ATP_Check: ' || 'intransit_cal_code = ' ||p_atp_record.intransit_cal_code);
11523: msc_sch_wb.atp_debug('ATP_Check: ' || 'manufacturing_cal_code = ' ||p_atp_record.manufacturing_cal_code);
11524: msc_sch_wb.atp_debug('ATP_Check: ' || 'to_organization_id = ' ||p_atp_record.to_organization_id);

Line 11521: msc_sch_wb.atp_debug('ATP_Check: ' || 'receiving_cal_code = ' ||p_atp_record.receiving_cal_code);

11517: -- Bug 3826234 start
11518: IF PG_DEBUG in ('Y', 'C') THEN
11519: msc_sch_wb.atp_debug('ATP_Check: ' || '----------- Calendars passed to Pegging -----------------');
11520: msc_sch_wb.atp_debug('ATP_Check: ' || 'shipping_cal_code = ' ||p_atp_record.shipping_cal_code);
11521: msc_sch_wb.atp_debug('ATP_Check: ' || 'receiving_cal_code = ' ||p_atp_record.receiving_cal_code);
11522: msc_sch_wb.atp_debug('ATP_Check: ' || 'intransit_cal_code = ' ||p_atp_record.intransit_cal_code);
11523: msc_sch_wb.atp_debug('ATP_Check: ' || 'manufacturing_cal_code = ' ||p_atp_record.manufacturing_cal_code);
11524: msc_sch_wb.atp_debug('ATP_Check: ' || 'to_organization_id = ' ||p_atp_record.to_organization_id);
11525: END IF;

Line 11522: msc_sch_wb.atp_debug('ATP_Check: ' || 'intransit_cal_code = ' ||p_atp_record.intransit_cal_code);

11518: IF PG_DEBUG in ('Y', 'C') THEN
11519: msc_sch_wb.atp_debug('ATP_Check: ' || '----------- Calendars passed to Pegging -----------------');
11520: msc_sch_wb.atp_debug('ATP_Check: ' || 'shipping_cal_code = ' ||p_atp_record.shipping_cal_code);
11521: msc_sch_wb.atp_debug('ATP_Check: ' || 'receiving_cal_code = ' ||p_atp_record.receiving_cal_code);
11522: msc_sch_wb.atp_debug('ATP_Check: ' || 'intransit_cal_code = ' ||p_atp_record.intransit_cal_code);
11523: msc_sch_wb.atp_debug('ATP_Check: ' || 'manufacturing_cal_code = ' ||p_atp_record.manufacturing_cal_code);
11524: msc_sch_wb.atp_debug('ATP_Check: ' || 'to_organization_id = ' ||p_atp_record.to_organization_id);
11525: END IF;
11526: IF p_parent_pegging_id = MSC_ATP_PVT.G_DEMAND_PEGGING_ID THEN

Line 11523: msc_sch_wb.atp_debug('ATP_Check: ' || 'manufacturing_cal_code = ' ||p_atp_record.manufacturing_cal_code);

11519: msc_sch_wb.atp_debug('ATP_Check: ' || '----------- Calendars passed to Pegging -----------------');
11520: msc_sch_wb.atp_debug('ATP_Check: ' || 'shipping_cal_code = ' ||p_atp_record.shipping_cal_code);
11521: msc_sch_wb.atp_debug('ATP_Check: ' || 'receiving_cal_code = ' ||p_atp_record.receiving_cal_code);
11522: msc_sch_wb.atp_debug('ATP_Check: ' || 'intransit_cal_code = ' ||p_atp_record.intransit_cal_code);
11523: msc_sch_wb.atp_debug('ATP_Check: ' || 'manufacturing_cal_code = ' ||p_atp_record.manufacturing_cal_code);
11524: msc_sch_wb.atp_debug('ATP_Check: ' || 'to_organization_id = ' ||p_atp_record.to_organization_id);
11525: END IF;
11526: IF p_parent_pegging_id = MSC_ATP_PVT.G_DEMAND_PEGGING_ID THEN
11527: l_pegging_rec.shipping_cal_code := p_atp_record.shipping_cal_code;

Line 11524: msc_sch_wb.atp_debug('ATP_Check: ' || 'to_organization_id = ' ||p_atp_record.to_organization_id);

11520: msc_sch_wb.atp_debug('ATP_Check: ' || 'shipping_cal_code = ' ||p_atp_record.shipping_cal_code);
11521: msc_sch_wb.atp_debug('ATP_Check: ' || 'receiving_cal_code = ' ||p_atp_record.receiving_cal_code);
11522: msc_sch_wb.atp_debug('ATP_Check: ' || 'intransit_cal_code = ' ||p_atp_record.intransit_cal_code);
11523: msc_sch_wb.atp_debug('ATP_Check: ' || 'manufacturing_cal_code = ' ||p_atp_record.manufacturing_cal_code);
11524: msc_sch_wb.atp_debug('ATP_Check: ' || 'to_organization_id = ' ||p_atp_record.to_organization_id);
11525: END IF;
11526: IF p_parent_pegging_id = MSC_ATP_PVT.G_DEMAND_PEGGING_ID THEN
11527: l_pegging_rec.shipping_cal_code := p_atp_record.shipping_cal_code;
11528: l_pegging_rec.receiving_cal_code := p_atp_record.receiving_cal_code;

Line 11532: msc_sch_wb.atp_debug('ATP_Check: ' || 'Inside IF');

11528: l_pegging_rec.receiving_cal_code := p_atp_record.receiving_cal_code;
11529: l_pegging_rec.intransit_cal_code := p_atp_record.intransit_cal_code;
11530: l_pegging_rec.manufacturing_cal_code := p_atp_record.manufacturing_cal_code;
11531: IF PG_DEBUG in ('Y', 'C') THEN
11532: msc_sch_wb.atp_debug('ATP_Check: ' || 'Inside IF');
11533: END IF;
11534: ELSIF NVL(p_atp_record.to_organization_id,p_atp_record.organization_id)
11535: <> p_atp_record.organization_id THEN
11536: l_pegging_rec.shipping_cal_code := p_atp_record.shipping_cal_code;

Line 11541: msc_sch_wb.atp_debug('ATP_Check: ' || 'Inside ELSIF');

11537: l_pegging_rec.receiving_cal_code := p_atp_record.receiving_cal_code;
11538: l_pegging_rec.intransit_cal_code := p_atp_record.intransit_cal_code;
11539: l_pegging_rec.manufacturing_cal_code := NULL;
11540: IF PG_DEBUG in ('Y', 'C') THEN
11541: msc_sch_wb.atp_debug('ATP_Check: ' || 'Inside ELSIF');
11542: END IF;
11543: ELSE
11544: l_pegging_rec.manufacturing_cal_code := p_atp_record.manufacturing_cal_code;
11545: l_pegging_rec.shipping_cal_code := NULL;

Line 11549: msc_sch_wb.atp_debug('ATP_Check: ' || 'Inside ELSE');

11545: l_pegging_rec.shipping_cal_code := NULL;
11546: l_pegging_rec.receiving_cal_code := NULL;
11547: l_pegging_rec.intransit_cal_code := NULL;
11548: IF PG_DEBUG in ('Y', 'C') THEN
11549: msc_sch_wb.atp_debug('ATP_Check: ' || 'Inside ELSE');
11550: END IF;
11551: END IF;
11552: -- Bug 3826234 end
11553: MSC_ATP_DB_UTILS.Add_Pegging(l_pegging_rec, l_atp_pegging_id);

Line 11591: msc_sch_wb.atp_debug('********* END Stealing ************');

11587: END IF;
11588:
11589: END LOOP;
11590: IF PG_DEBUG in ('Y', 'C') THEN
11591: msc_sch_wb.atp_debug('********* END Stealing ************');
11592: END IF;
11593: END Stealing;
11594: END MSC_AATP_PVT;