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 740: msc_sch_wb.atp_debug('item_alloc_avail_unopt: UNconstrained plan: ' || p_plan_id);

736: x_atp_qtys OUT NoCopy MRP_ATP_PUB.number_arr
737: ) IS
738: BEGIN
739: IF PG_DEBUG in ('Y', 'C') THEN
740: msc_sch_wb.atp_debug('item_alloc_avail_unopt: UNconstrained plan: ' || p_plan_id);
741: END IF;
742:
743: SELECT SD_DATE,
744: SUM(SD_QTY)

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

1142: x_atp_unalloc_qtys OUT NoCopy MRP_ATP_PUB.number_arr
1143: ) IS
1144: BEGIN
1145: IF PG_DEBUG in ('Y', 'C') THEN
1146: msc_sch_wb.atp_debug('item_alloc_avail_opt_unalloc: Get unallocated qtys as well. constrained plan: ' || p_plan_id);
1147: END IF;
1148: -- Bug 3550296 and 3574164. IMPLEMENT_DATE AND DMD_SATISFIED_DATE are changed to
1149: -- IMPLEMENT_SHIP_DATE and PLANNED_SHIP_DATE resp.
1150: SELECT SD_DATE,

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

1678: x_atp_unalloc_qtys OUT NoCopy MRP_ATP_PUB.number_arr
1679: ) IS
1680: BEGIN
1681: IF PG_DEBUG in ('Y', 'C') THEN
1682: msc_sch_wb.atp_debug('item_alloc_avail_unopt_unalloc: Get unallocated qtys as well. UNconstrained plan: ' || p_plan_id);
1683: END IF;
1684:
1685: SELECT SD_DATE,
1686: SUM(UNALLOC_SD_QTY),

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

2086: l_null_char VARCHAR2(1);
2087: l_sysdate DATE := trunc(sysdate); --4135752
2088: BEGIN
2089: IF PG_DEBUG in ('Y', 'C') THEN
2090: msc_sch_wb.atp_debug('item_alloc_avail_opt_dtls: constrained plan: ' || p_plan_id);
2091: END IF;
2092:
2093: INSERT INTO msc_atp_sd_details_temp (
2094: ATP_Level,

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

2755: l_null_char VARCHAR2(1);
2756: l_sysdate DATE := trunc(sysdate);--4135752
2757: BEGIN
2758: IF PG_DEBUG in ('Y', 'C') THEN
2759: msc_sch_wb.atp_debug('item_alloc_avail_unopt_dtls: UNconstrained plan: ' || p_plan_id);
2760: END IF;
2761:
2762: INSERT INTO msc_atp_sd_details_temp (
2763: ATP_Level,

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

3310: x_atp_qtys OUT NoCopy MRP_ATP_PUB.number_arr
3311: ) IS
3312: BEGIN
3313: IF PG_DEBUG in ('Y', 'C') THEN
3314: msc_sch_wb.atp_debug('item_alloc_avail');
3315: END IF;
3316:
3317: IF nvl(p_optimized_plan, 2) = 1 THEN
3318: item_alloc_avail_opt(

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

3364: x_atp_unalloc_qtys OUT NoCopy MRP_ATP_PUB.number_arr
3365: ) IS
3366: BEGIN
3367: IF PG_DEBUG in ('Y', 'C') THEN
3368: msc_sch_wb.atp_debug('item_alloc_avail_unalloc: Get unallocated qtys as well');
3369: END IF;
3370:
3371: IF nvl(p_optimized_plan, 2) = 1 THEN
3372: item_alloc_avail_opt_unalloc(

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

3422: p_sys_next_date IN DATE) --bug3099066
3423: IS
3424: BEGIN
3425: IF PG_DEBUG in ('Y', 'C') THEN
3426: msc_sch_wb.atp_debug('item_alloc_avail_dtls');
3427: END IF;
3428:
3429: IF nvl(p_optimized_plan, 2) = 1 THEN
3430: item_alloc_avail_opt_dtls(

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

3481: l_allowed_stealing_qty NUMBER;
3482: BEGIN
3483:
3484: IF PG_DEBUG in ('Y', 'C') THEN
3485: msc_sch_wb.atp_debug('*******Begin Atp_Demand_Class_Consume Procedure******');
3486:
3487: m := p_current_atp.atp_period.FIRST;
3488: WHILE m is not null LOOP
3489: msc_sch_wb.atp_debug('Atp_Demand_Class_Consume: ' || 'p_current_atp.atp_period , qty = '||

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

3485: msc_sch_wb.atp_debug('*******Begin Atp_Demand_Class_Consume Procedure******');
3486:
3487: m := p_current_atp.atp_period.FIRST;
3488: WHILE m is not null LOOP
3489: msc_sch_wb.atp_debug('Atp_Demand_Class_Consume: ' || 'p_current_atp.atp_period , qty = '||
3490: p_current_atp.atp_period(m) ||' : '|| p_current_atp.atp_qty(m) );
3491: m := p_current_atp.atp_qty.Next(m);
3492: END LOOP;
3493:

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

3492: END LOOP;
3493:
3494: m := p_steal_atp.atp_period.FIRST;
3495: WHILE m is not null LOOP
3496: msc_sch_wb.atp_debug('Atp_Demand_Class_Consume: ' || 'p_steal_atp.atp_period and qty = '||
3497: p_steal_atp.atp_period(m) ||' : '|| p_steal_atp.atp_qty(m));
3498: m := p_steal_atp.atp_qty.Next(m);
3499: END LOOP;
3500: END IF;

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

3527: AND (p_current_atp.atp_period(k+1)>p_steal_atp.atp_period(i)))
3528: THEN
3529: -- this is the starting point, we can exit now
3530: IF PG_DEBUG in ('Y', 'C') THEN
3531: msc_sch_wb.atp_debug('Atp_Demand_Class_Consume: ' || 'exit at k = ' ||to_char(k)||' and i = ' ||to_char(i));
3532: END IF;
3533: EXIT;
3534: ELSE
3535: k := p_current_atp.atp_period.NEXT(k);

Line 3543: 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);

3539:
3540: j:= k;
3541:
3542: IF PG_DEBUG in ('Y', 'C') THEN
3543: 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);
3544: END IF;
3545:
3546: WHILE (NVL(j, -1) > 0) LOOP
3547:

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

3605: FOR i IN 1..p_current_atp.atp_period.COUNT LOOP
3606: -- we only worry about the neg quantity (that's why we need to steal
3607:
3608: IF PG_DEBUG in ('Y', 'C') THEN
3609: msc_sch_wb.atp_debug ('Add_to_Next_Steal_Atp: ' || 'we are in i loop for current steal, i='||i);
3610: END IF;
3611: IF p_current_atp.atp_qty(i) < 0 THEN
3612: l_processed := FALSE; --1923405
3613: WHILE (j IS NOT NULL) LOOP

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

3611: IF p_current_atp.atp_qty(i) < 0 THEN
3612: l_processed := FALSE; --1923405
3613: WHILE (j IS NOT NULL) LOOP
3614: IF PG_DEBUG in ('Y', 'C') THEN
3615: msc_sch_wb.atp_debug ('Add_to_Next_Steal_Atp: ' || 'we are in j loop for next steal, j='||j);
3616: END IF;
3617: IF p_next_steal_atp.atp_qty(j) < 0 THEN
3618:
3619: k := k+1;

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

3780:
3781: BEGIN
3782:
3783: IF PG_DEBUG in ('Y', 'C') THEN
3784: msc_sch_wb.atp_debug('******* Item_Alloc_Cum_Atp *******');
3785: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id );
3786: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_level =' || p_level );
3787: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_identifier =' || p_identifier);
3788: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_scenario_id =' || p_scenario_id);

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

3781: BEGIN
3782:
3783: IF PG_DEBUG in ('Y', 'C') THEN
3784: msc_sch_wb.atp_debug('******* Item_Alloc_Cum_Atp *******');
3785: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id );
3786: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_level =' || p_level );
3787: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_identifier =' || p_identifier);
3788: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_scenario_id =' || p_scenario_id);
3789: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);

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

3782:
3783: IF PG_DEBUG in ('Y', 'C') THEN
3784: msc_sch_wb.atp_debug('******* Item_Alloc_Cum_Atp *******');
3785: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id );
3786: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_level =' || p_level );
3787: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_identifier =' || p_identifier);
3788: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_scenario_id =' || p_scenario_id);
3789: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
3790: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);

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

3783: IF PG_DEBUG in ('Y', 'C') THEN
3784: msc_sch_wb.atp_debug('******* Item_Alloc_Cum_Atp *******');
3785: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id );
3786: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_level =' || p_level );
3787: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_identifier =' || p_identifier);
3788: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_scenario_id =' || p_scenario_id);
3789: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
3790: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);
3791: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_item_id =' || p_request_item_id);

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

3784: msc_sch_wb.atp_debug('******* Item_Alloc_Cum_Atp *******');
3785: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id );
3786: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_level =' || p_level );
3787: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_identifier =' || p_identifier);
3788: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_scenario_id =' || p_scenario_id);
3789: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
3790: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);
3791: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_item_id =' || p_request_item_id);
3792: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);

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

3785: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id );
3786: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_level =' || p_level );
3787: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_identifier =' || p_identifier);
3788: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_scenario_id =' || p_scenario_id);
3789: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
3790: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);
3791: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_item_id =' || p_request_item_id);
3792: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
3793: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);

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

3786: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_level =' || p_level );
3787: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_identifier =' || p_identifier);
3788: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_scenario_id =' || p_scenario_id);
3789: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
3790: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);
3791: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_item_id =' || p_request_item_id);
3792: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
3793: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
3794: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );

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

3787: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_identifier =' || p_identifier);
3788: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_scenario_id =' || p_scenario_id);
3789: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
3790: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);
3791: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_item_id =' || p_request_item_id);
3792: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
3793: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
3794: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
3795: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_insert_flag =' || p_insert_flag );

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

3788: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_scenario_id =' || p_scenario_id);
3789: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
3790: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);
3791: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_item_id =' || p_request_item_id);
3792: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
3793: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
3794: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
3795: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_insert_flag =' || p_insert_flag );
3796: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_atf_date =' || p_atf_date );

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

3789: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
3790: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);
3791: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_item_id =' || p_request_item_id);
3792: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
3793: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
3794: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
3795: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_insert_flag =' || p_insert_flag );
3796: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_atf_date =' || p_atf_date );
3797: 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 3794: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );

3790: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);
3791: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_item_id =' || p_request_item_id);
3792: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
3793: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
3794: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
3795: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_insert_flag =' || p_insert_flag );
3796: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_atf_date =' || p_atf_date );
3797: 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
3798: END IF;

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

3791: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_item_id =' || p_request_item_id);
3792: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
3793: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
3794: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
3795: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_insert_flag =' || p_insert_flag );
3796: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_atf_date =' || p_atf_date );
3797: 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
3798: END IF;
3799:

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

3792: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
3793: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
3794: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
3795: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_insert_flag =' || p_insert_flag );
3796: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_atf_date =' || p_atf_date );
3797: 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
3798: END IF;
3799:
3800:

Line 3797: 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

3793: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
3794: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
3795: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_insert_flag =' || p_insert_flag );
3796: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_atf_date =' || p_atf_date );
3797: 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
3798: END IF;
3799:
3800:
3801: /*-----------------------------------------------------------------------------------------+

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

3848: AND sr_inventory_item_id = p_inventory_item_id;
3849: EXCEPTION
3850: WHEN OTHERS THEN
3851: IF PG_DEBUG in ('Y', 'C') THEN
3852: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error selecting uom_code for the item');
3853: END IF;
3854: END;
3855: ELSE
3856: -- we need not select this in case of ATP QUERY as this information is available in G_ITEM_INFO_REC

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

3876: l_item_to_use := l_inv_item_id;
3877: END IF;
3878:
3879: IF PG_DEBUG in ('Y', 'C') THEN
3880: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Item to be used = ' || l_item_to_use);
3881: END IF;
3882: /* New allocation logic for time_phased_atp changes end */
3883:
3884: -- select the priority and allocation_percent for that item/demand class.

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

3889: p_demand_class, p_request_date, l_level_id, l_priority, l_allocation_percent, l_return_status);
3890:
3891: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
3892: IF PG_DEBUG in ('Y', 'C') THEN
3893: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error retrieving Priority and Demand Class');
3894: END IF;
3895: END IF;
3896: ELSE
3897: l_priority := -1;

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

3901: -- find the demand classes that have priority higher (small number) than
3902: -- the requested demand class
3903:
3904: IF PG_DEBUG in ('Y', 'C') THEN
3905: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_allocation_percent = '||l_allocation_percent);
3906: END IF;
3907:
3908: /* rajjain 01/29/2003 Bug 2737596
3909: We don't need to select all demand classes in case this procdure is

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

3910: called from MSC_AATP_PVT.VIEW_ALLOCATION for view total*/
3911: IF p_identifier <> -1 or (p_identifier = -1 and p_scenario_id <> -1) THEN
3912:
3913: IF PG_DEBUG in ('Y', 'C') THEN
3914: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before select the high priority demand class');
3915: END IF;
3916:
3917: /*AATP Forward Consumption rajjain begin
3918: 1. Now we select all the demand classes in l_demand_class_tab irrespective of demand class for which

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

3931: -- bug 1680719
3932: IF l_level_id = -1 THEN
3933:
3934: IF PG_DEBUG in ('Y', 'C') THEN
3935: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);
3936: END IF;
3937: SELECT demand_class, priority, allocation_percent
3938: BULK COLLECT INTO l_demand_class_tab, l_demand_class_priority_tab, l_allocation_percent_tab
3939: FROM msc_item_hierarchy_mv

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

3947:
3948: ELSIF l_level_id = 1 THEN
3949:
3950: IF PG_DEBUG in ('Y', 'C') THEN
3951: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);
3952: END IF;
3953: SELECT demand_class, priority, allocation_percent
3954: BULK COLLECT INTO l_demand_class_tab, l_demand_class_priority_tab, l_allocation_percent_tab
3955: FROM msc_item_hierarchy_mv

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

3962:
3963: ELSIF l_level_id = 2 THEN
3964:
3965: IF PG_DEBUG in ('Y', 'C') THEN
3966: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);
3967: END IF;
3968: SELECT mv1.demand_class, mv1.priority, mv1.class, mv1.partner_id, 0, mv1.allocation_percent
3969: BULK COLLECT INTO l_demand_class_tab, l_demand_class_priority_tab,
3970: l_class_tab, l_partner_tab, l_fw_consume_tab, l_allocation_percent_tab

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

3983: -- bug 1680719
3984: -- we need to select the class, partner_id, partner_site_id
3985:
3986: IF PG_DEBUG in ('Y', 'C') THEN
3987: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);
3988: END IF;
3989: SELECT mv1.demand_class, mv1.priority, mv1.class, mv1.partner_id, 0, mv1.allocation_percent
3990: BULK COLLECT INTO l_demand_class_tab, l_demand_class_priority_tab,
3991: l_class_tab, l_partner_tab, l_fw_consume_tab, l_allocation_percent_tab

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

4004: /* time_phased_atp changes end */
4005:
4006: mm := l_demand_class_tab.FIRST;
4007: IF PG_DEBUG in ('Y', 'C') THEN
4008: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_tab.count = '||
4009: l_demand_class_tab.count);
4010: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_priority_tab.count = '||
4011: l_demand_class_priority_tab.count);
4012: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_allocation_percent_tab.count = '||

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

4006: mm := l_demand_class_tab.FIRST;
4007: IF PG_DEBUG in ('Y', 'C') THEN
4008: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_tab.count = '||
4009: l_demand_class_tab.count);
4010: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_priority_tab.count = '||
4011: l_demand_class_priority_tab.count);
4012: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_allocation_percent_tab.count = '||
4013: l_allocation_percent_tab.count);
4014: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_class_tab.count = '||

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

4008: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_tab.count = '||
4009: l_demand_class_tab.count);
4010: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_priority_tab.count = '||
4011: l_demand_class_priority_tab.count);
4012: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_allocation_percent_tab.count = '||
4013: l_allocation_percent_tab.count);
4014: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_class_tab.count = '||
4015: l_class_tab.count);
4016: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_partner_tab.count = '||

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

4010: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_priority_tab.count = '||
4011: l_demand_class_priority_tab.count);
4012: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_allocation_percent_tab.count = '||
4013: l_allocation_percent_tab.count);
4014: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_class_tab.count = '||
4015: l_class_tab.count);
4016: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_partner_tab.count = '||
4017: l_partner_tab.count);
4018: END IF;

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

4012: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_allocation_percent_tab.count = '||
4013: l_allocation_percent_tab.count);
4014: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_class_tab.count = '||
4015: l_class_tab.count);
4016: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_partner_tab.count = '||
4017: l_partner_tab.count);
4018: END IF;
4019:
4020: END IF;

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

4055: END IF;
4056:
4057: mm := l_demand_class_tab.FIRST;
4058: IF PG_DEBUG in ('Y', 'C') THEN
4059: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_tab.count = '|| l_demand_class_tab.count);
4060: END IF;
4061:
4062: /*AATP Forward Consumption rajjain begin
4063: 1. Level_id in (-1, 1) ->

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

4073: IF l_level_id in (-1, 1) THEN
4074:
4075: WHILE mm is not null LOOP
4076:
4077: msc_sch_wb.atp_debug('---------------------l_demand_class_tab'||l_demand_class_tab(mm));--6359986
4078: IF (l_demand_class_tab(mm) ='-1') then --6359986
4079: IF(MSC_ATP_PVT.G_ZERO_ALLOCATION_PERC = 'N') THEN --6359986
4080: IF l_allocation_percent_tab(mm) <> 0 THEN
4081: l_lowest_priority_demand_class := l_demand_class_tab(mm);

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

4080: IF l_allocation_percent_tab(mm) <> 0 THEN
4081: l_lowest_priority_demand_class := l_demand_class_tab(mm);
4082: l_lowest_priority := l_demand_class_priority_tab(mm);
4083: IF PG_DEBUG in ('Y', 'C') THEN
4084: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority_demand_class: ' ||
4085: l_lowest_priority_demand_class);
4086: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority: ' ||
4087: l_lowest_priority);
4088: END IF;

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

4082: l_lowest_priority := l_demand_class_priority_tab(mm);
4083: IF PG_DEBUG in ('Y', 'C') THEN
4084: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority_demand_class: ' ||
4085: l_lowest_priority_demand_class);
4086: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority: ' ||
4087: l_lowest_priority);
4088: END IF;
4089: EXIT;
4090: END IF;

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

4091: ELSE --6359986 start
4092: l_lowest_priority_demand_class := l_demand_class_tab(mm);
4093: l_lowest_priority := l_demand_class_priority_tab(mm);
4094: IF PG_DEBUG in ('Y', 'C') THEN
4095: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority_demand_class: ' ||
4096: l_lowest_priority_demand_class);
4097: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority: ' ||
4098: l_lowest_priority);
4099: END IF;

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

4093: l_lowest_priority := l_demand_class_priority_tab(mm);
4094: IF PG_DEBUG in ('Y', 'C') THEN
4095: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority_demand_class: ' ||
4096: l_lowest_priority_demand_class);
4097: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority: ' ||
4098: l_lowest_priority);
4099: END IF;
4100: EXIT;
4101: END IF;

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

4103: ELSE
4104: l_lowest_priority_demand_class := l_demand_class_tab(mm);
4105: l_lowest_priority := l_demand_class_priority_tab(mm);
4106: IF PG_DEBUG in ('Y', 'C') THEN
4107: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority_demand_class: ' ||
4108: l_lowest_priority_demand_class);
4109: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority: ' ||
4110: l_lowest_priority);
4111: END IF;

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

4105: l_lowest_priority := l_demand_class_priority_tab(mm);
4106: IF PG_DEBUG in ('Y', 'C') THEN
4107: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority_demand_class: ' ||
4108: l_lowest_priority_demand_class);
4109: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_lowest_priority: ' ||
4110: l_lowest_priority);
4111: END IF;
4112: EXIT;
4113: END IF; --6359986 end

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

4152: l_fw_consume_tab(mm) := 4;
4153: mm := l_demand_class_tab.Prior(mm);
4154: exit;
4155: END IF; --6359986 end
4156: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'mm: '||mm);
4157: mm := l_demand_class_tab.Prior(mm);
4158: END LOOP;
4159: --l_lowest_priority := trunc(l_demand_class_priority_tab(mm), -3); --5634348, commenting it
4160:

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

4240: l_demand_class_tab(i) := p_demand_class;
4241: l_allocation_percent_tab(i) := l_allocation_percent;
4242:
4243: IF PG_DEBUG in ('Y', 'C') THEN
4244: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_tab.count = '||
4245: l_demand_class_tab.count);
4246: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_priority_tab.count = '||
4247: l_demand_class_priority_tab.count);
4248: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_allocation_percent_tab.count = '||

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

4242:
4243: IF PG_DEBUG in ('Y', 'C') THEN
4244: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_tab.count = '||
4245: l_demand_class_tab.count);
4246: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_priority_tab.count = '||
4247: l_demand_class_priority_tab.count);
4248: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_allocation_percent_tab.count = '||
4249: l_allocation_percent_tab.count);
4250: END IF;

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

4244: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_tab.count = '||
4245: l_demand_class_tab.count);
4246: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_priority_tab.count = '||
4247: l_demand_class_priority_tab.count);
4248: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_allocation_percent_tab.count = '||
4249: l_allocation_percent_tab.count);
4250: END IF;
4251:
4252: END IF;

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

4252: END IF;
4253:
4254: mm := l_fw_consume_tab.FIRST;
4255: IF PG_DEBUG in ('Y', 'C') THEN
4256: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_fw_consume_tab.count = '|| l_fw_consume_tab.count);
4257: WHILE mm is not null LOOP
4258: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_fw_consume_tab = '||
4259: l_fw_consume_tab(mm));
4260:

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

4254: mm := l_fw_consume_tab.FIRST;
4255: IF PG_DEBUG in ('Y', 'C') THEN
4256: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_fw_consume_tab.count = '|| l_fw_consume_tab.count);
4257: WHILE mm is not null LOOP
4258: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_fw_consume_tab = '||
4259: l_fw_consume_tab(mm));
4260:
4261: -- krajan : 2745212
4262: mm := l_fw_consume_tab.Next(mm);

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

4279: l_org_code := MSC_ATP_PVT.G_ORG_INFO_REC.org_code;
4280: /* Modularize Item and Org Info */
4281:
4282: IF PG_DEBUG in ('Y', 'C') THEN
4283: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
4284: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
4285: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
4286: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_default_demand_class'|| l_default_demand_class);
4287: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_org_code'|| l_org_code);

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

4280: /* Modularize Item and Org Info */
4281:
4282: IF PG_DEBUG in ('Y', 'C') THEN
4283: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
4284: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
4285: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
4286: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_default_demand_class'|| l_default_demand_class);
4287: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_org_code'|| l_org_code);
4288: END IF;

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

4281:
4282: IF PG_DEBUG in ('Y', 'C') THEN
4283: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
4284: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
4285: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
4286: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_default_demand_class'|| l_default_demand_class);
4287: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_org_code'|| l_org_code);
4288: END IF;
4289: --diag_atp

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

4282: IF PG_DEBUG in ('Y', 'C') THEN
4283: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
4284: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
4285: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
4286: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_default_demand_class'|| l_default_demand_class);
4287: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_org_code'|| l_org_code);
4288: END IF;
4289: --diag_atp
4290: -- rajjain 01/29/2003 Bug 2737596

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

4283: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
4284: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
4285: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
4286: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_default_demand_class'|| l_default_demand_class);
4287: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_org_code'|| l_org_code);
4288: END IF;
4289: --diag_atp
4290: -- rajjain 01/29/2003 Bug 2737596
4291: -- Need to call get_infinite_time_fence_date procedure in case call is from View allocation

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

4298: ---diag_atp
4299: l_infinite_time_fence_date := p_get_mat_in_rec.infinite_time_fence_date;
4300: END IF;
4301: IF PG_DEBUG in ('Y', 'C') THEN
4302: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_infinite_time_fence_date'|| l_infinite_time_fence_date);
4303: END IF;
4304:
4305: -- Now go demand class by demand class and calculate the allocated picture
4306: FOR i in 1..l_demand_class_tab.COUNT LOOP

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

4306: FOR i in 1..l_demand_class_tab.COUNT LOOP
4307:
4308: l_demand_class := l_demand_class_tab(i);
4309: IF PG_DEBUG in ('Y', 'C') THEN
4310: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'in i loop, i = '||i);
4311: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class = '||l_demand_class);
4312: END IF;
4313: -- get the daily net availability for DCi
4314: IF (NVL(p_insert_flag, 0) = 0 OR l_demand_class <> p_demand_class) THEN

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

4307:
4308: l_demand_class := l_demand_class_tab(i);
4309: IF PG_DEBUG in ('Y', 'C') THEN
4310: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'in i loop, i = '||i);
4311: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class = '||l_demand_class);
4312: END IF;
4313: -- get the daily net availability for DCi
4314: IF (NVL(p_insert_flag, 0) = 0 OR l_demand_class <> p_demand_class) THEN
4315: -- we don't want details

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

4313: -- get the daily net availability for DCi
4314: IF (NVL(p_insert_flag, 0) = 0 OR l_demand_class <> p_demand_class) THEN
4315: -- we don't want details
4316: IF PG_DEBUG in ('Y', 'C') THEN
4317: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4318: 'Inside IF (NVL(p_insert_flag, 0) = 0');
4319: END IF;
4320:
4321: /* AATP Forward Consumption rajjain

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

4322: We calculate unallocated availability alongwith allocated availability calculation
4323: for first demand class if Forward consumption method is method2*/
4324: IF i=1 AND G_ATP_FW_CONSUME_METHOD = 2 THEN
4325: IF PG_DEBUG in ('Y', 'C') THEN
4326: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4327: 'Inside IF i=1 AND Method2');
4328: END IF;
4329: -- time_phased_atp
4330: IF l_time_phased_atp='N' THEN

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

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

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

4372: END IF;
4373: END IF;
4374:
4375: IF PG_DEBUG in ('Y', 'C') THEN
4376: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Before Atp_Consume for l_unallocated_atp');
4377: mm := l_unallocated_atp.atp_qty.FIRST;
4378: while mm is not null loop
4379: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||
4380: l_current_atp.atp_period(mm) || ':' || l_unallocated_atp.atp_qty(mm));

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

4375: IF PG_DEBUG in ('Y', 'C') THEN
4376: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Before Atp_Consume for l_unallocated_atp');
4377: mm := l_unallocated_atp.atp_qty.FIRST;
4378: while mm is not null loop
4379: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||
4380: l_current_atp.atp_period(mm) || ':' || l_unallocated_atp.atp_qty(mm));
4381: mm := l_unallocated_atp.atp_qty.NEXT(mm);
4382: end loop;
4383: END IF;

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

4392: MSC_ATP_PF.Bw_Fw_Cum, --b/w, f/w consumption and accumulation
4393: p_atf_date);
4394: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4395: IF PG_DEBUG in ('Y', 'C') THEN
4396: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error occured in procedure Pf_Atp_Consume');
4397: END IF;
4398: RAISE FND_API.G_EXC_ERROR;
4399: END IF;
4400: ELSE

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

4401: MSC_ATP_PROC.Atp_Consume(l_unallocated_atp.atp_qty, l_unallocated_atp.atp_qty.COUNT);
4402: END IF;
4403:
4404: IF PG_DEBUG in ('Y', 'C') THEN
4405: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After Atp_Consume for l_unallocated_atp');
4406: mm := l_unallocated_atp.atp_qty.FIRST;
4407: while mm is not null loop
4408: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||
4409: l_current_atp.atp_period(mm) || ':' || l_unallocated_atp.atp_qty(mm));

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

4404: IF PG_DEBUG in ('Y', 'C') THEN
4405: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After Atp_Consume for l_unallocated_atp');
4406: mm := l_unallocated_atp.atp_qty.FIRST;
4407: while mm is not null loop
4408: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||
4409: l_current_atp.atp_period(mm) || ':' || l_unallocated_atp.atp_qty(mm));
4410: mm := l_unallocated_atp.atp_qty.NEXT(mm);
4411: end loop;
4412: END IF;

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

4412: END IF;
4413:
4414: ELSE
4415: IF PG_DEBUG in ('Y', 'C') THEN
4416: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4417: 'Inside ELSE of IF i=1 AND G_ATP_FW_CONSUME_METHOD = 2 THEN');
4418: END IF;
4419: -- time_phased_atp
4420: IF l_time_phased_atp='N' THEN

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

4452: l_return_status
4453: );
4454: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4455: IF PG_DEBUG in ('Y', 'C') THEN
4456: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error occured in procedure Item_Alloc_Avail_Pf');
4457: END IF;
4458: RAISE FND_API.G_EXC_ERROR;
4459: END IF;
4460: END IF;

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

4460: END IF;
4461: END IF;
4462:
4463: IF PG_DEBUG in ('Y', 'C') THEN
4464: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: After calculating daily net availability');
4465: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ', l_current_atp);
4466: END IF;
4467:
4468: ELSE

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

4468: ELSE
4469: -- IF (NVL(p_insert_flag, 0) <> 0 AND l_demand_class = p_demand_class)
4470: -- OR p_scenario_id = -1
4471: IF PG_DEBUG in ('Y', 'C') THEN
4472: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4473: 'Inside ELSE of IF (NVL(p_insert_flag, 0)=0 OR l_demand_class<>p_demand_class)');
4474: END IF;
4475: MSC_ATP_DB_UTILS.Clear_SD_Details_Temp();
4476:

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

4517: l_return_status
4518: );
4519: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4520: IF PG_DEBUG in ('Y', 'C') THEN
4521: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error occured in procedure Item_Alloc_Avail_Pf_Dtls');
4522: END IF;
4523: RAISE FND_API.G_EXC_ERROR;
4524: END IF;
4525: END IF;

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

4525: END IF;
4526:
4527: -- for period ATP
4528: IF PG_DEBUG in ('Y', 'C') THEN
4529: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after insert into msc_atp_sd_details_temp');
4530: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'num rows : ' || SQL%ROWCOUNT);
4531: END IF;
4532:
4533: /*AATP Forward Consumption rajjain begin

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

4526:
4527: -- for period ATP
4528: IF PG_DEBUG in ('Y', 'C') THEN
4529: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after insert into msc_atp_sd_details_temp');
4530: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'num rows : ' || SQL%ROWCOUNT);
4531: END IF;
4532:
4533: /*AATP Forward Consumption rajjain begin
4534: If request comes at topmost demand class level get unallocated data

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

4543: END IF;
4544:
4545: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
4546: IF PG_DEBUG in ('Y', 'C') THEN
4547: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to get_unalloc_data_from_SD_temp');
4548: END IF;
4549: END IF;
4550:
4551: IF PG_DEBUG in ('Y', 'C') THEN

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

4548: END IF;
4549: END IF;
4550:
4551: IF PG_DEBUG in ('Y', 'C') THEN
4552: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After get_unalloc_data_from_SD_temp');
4553: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_unallocated_atp.atp_qty.COUNT : '||l_unallocated_atp.atp_qty.COUNT);
4554: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Before Atp_Consume for l_unallocated_atp');
4555: mm := l_unallocated_atp.atp_qty.FIRST;
4556: while mm is not null loop

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

4549: END IF;
4550:
4551: IF PG_DEBUG in ('Y', 'C') THEN
4552: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After get_unalloc_data_from_SD_temp');
4553: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_unallocated_atp.atp_qty.COUNT : '||l_unallocated_atp.atp_qty.COUNT);
4554: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Before Atp_Consume for l_unallocated_atp');
4555: mm := l_unallocated_atp.atp_qty.FIRST;
4556: while mm is not null loop
4557: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||

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

4550:
4551: IF PG_DEBUG in ('Y', 'C') THEN
4552: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After get_unalloc_data_from_SD_temp');
4553: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_unallocated_atp.atp_qty.COUNT : '||l_unallocated_atp.atp_qty.COUNT);
4554: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Before Atp_Consume for l_unallocated_atp');
4555: mm := l_unallocated_atp.atp_qty.FIRST;
4556: while mm is not null loop
4557: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||
4558: x_atp_period.Period_Start_Date(mm) || ':' || l_unallocated_atp.atp_qty(mm));

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

4553: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_unallocated_atp.atp_qty.COUNT : '||l_unallocated_atp.atp_qty.COUNT);
4554: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Before Atp_Consume for l_unallocated_atp');
4555: mm := l_unallocated_atp.atp_qty.FIRST;
4556: while mm is not null loop
4557: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||
4558: x_atp_period.Period_Start_Date(mm) || ':' || l_unallocated_atp.atp_qty(mm));
4559: mm := l_unallocated_atp.atp_qty.NEXT(mm);
4560: end loop;
4561: END IF;

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

4570: MSC_ATP_PF.Bw_Fw_Cum, --b/w, f/w consumption and accumulation
4571: p_atf_date);
4572: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4573: IF PG_DEBUG in ('Y', 'C') THEN
4574: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error occured in procedure Pf_Atp_Consume');
4575: END IF;
4576: RAISE FND_API.G_EXC_ERROR;
4577: END IF;
4578: ELSE

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

4579: MSC_ATP_PROC.Atp_Consume(l_unallocated_atp.atp_qty, l_unallocated_atp.atp_qty.COUNT);
4580: END IF;
4581:
4582: IF PG_DEBUG in ('Y', 'C') THEN
4583: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After Atp_Consume for l_unallocated_atp');
4584: mm := l_unallocated_atp.atp_qty.FIRST;
4585: while mm is not null loop
4586: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||
4587: x_atp_period.Period_Start_Date(mm) || ':' || l_unallocated_atp.atp_qty(mm));

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

4582: IF PG_DEBUG in ('Y', 'C') THEN
4583: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After Atp_Consume for l_unallocated_atp');
4584: mm := l_unallocated_atp.atp_qty.FIRST;
4585: while mm is not null loop
4586: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||
4587: x_atp_period.Period_Start_Date(mm) || ':' || l_unallocated_atp.atp_qty(mm));
4588: mm := l_unallocated_atp.atp_qty.NEXT(mm);
4589: end loop;
4590: END IF;

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

4594: IF l_time_phased_atp='Y' THEN
4595: MSC_ATP_PF.Get_Period_Data_From_Sd_Temp(x_atp_period, l_return_status);
4596: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4597: IF PG_DEBUG in ('Y', 'C') THEN
4598: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error occured in procedure Get_Period_Data_From_Sd_Temp');
4599: END IF;
4600: RAISE FND_API.G_EXC_ERROR;
4601: END IF;
4602: ELSE

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

4605: user opens ATP SD window from ATP pegging in allocated scenarios*/
4606: MSC_ATP_PROC.Get_Alloc_Data_From_Sd_Temp(x_atp_period, l_return_status);
4607: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4608: IF PG_DEBUG in ('Y', 'C') THEN
4609: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error occured in procedure get_alloc_data_from_SD_temp');
4610: END IF;
4611: RAISE FND_API.G_EXC_ERROR;
4612: END IF;
4613: END IF;

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

4612: END IF;
4613: END IF;
4614:
4615: IF PG_DEBUG in ('Y', 'C') THEN
4616: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Need not get unalloc data from SD temp');
4617: END IF;
4618: END IF;
4619:
4620: -- old netting code here

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

4626:
4627: END IF;
4628:
4629: IF PG_DEBUG in ('Y', 'C') THEN
4630: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'right after the big query');
4631: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4632: l_current_atp);
4633: END IF;
4634:

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

4648: MSC_ATP_PF.Backward, --b/w consumption
4649: p_atf_date);
4650: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4651: IF PG_DEBUG in ('Y', 'C') THEN
4652: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error occured in procedure Pf_Atp_Consume');
4653: END IF;
4654: RAISE FND_API.G_EXC_ERROR;
4655: END IF;
4656: ELSE

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

4657: MSC_ATP_PROC.Atp_Backward_Consume(l_current_atp.atp_qty);
4658: END IF;
4659:
4660: IF PG_DEBUG in ('Y', 'C') THEN
4661: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'right after the backward consume');
4662: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4663: l_current_atp);
4664: END IF;
4665:

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

4718: -- class changed. If priority of both classes are not the same,
4719: -- then we need to change the curr_steal_atp at class level.
4720:
4721: IF PG_DEBUG in ('Y', 'C') THEN
4722: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'class changed');
4723: END IF;
4724:
4725: IF trunc(l_demand_class_priority_tab(i), -3) >
4726: trunc(l_demand_class_priority_tab (i-1), -3) THEN

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

4725: IF trunc(l_demand_class_priority_tab(i), -3) >
4726: trunc(l_demand_class_priority_tab (i-1), -3) THEN
4727:
4728: IF PG_DEBUG in ('Y', 'C') THEN
4729: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'class priority changed');
4730: END IF;
4731: l_class_curr_steal_atp := l_class_next_steal_atp;
4732: l_class_next_steal_atp := l_null_steal_atp;
4733: END IF;

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

4739: l_next_steal_atp := l_null_steal_atp;
4740:
4741: ELSE
4742: IF PG_DEBUG in ('Y', 'C') THEN
4743: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'same class');
4744: END IF;
4745: IF (l_partner_tab(i) <> l_partner_tab(i-1)) THEN
4746: -- customer changed. If priority of both customers are not the
4747: -- same, we need to change the curr_steal_atp at partner level.

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

4746: -- customer changed. If priority of both customers are not the
4747: -- same, we need to change the curr_steal_atp at partner level.
4748:
4749: IF PG_DEBUG in ('Y', 'C') THEN
4750: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'customer changed');
4751: END IF;
4752:
4753: IF trunc(l_demand_class_priority_tab(i), -2) >
4754: trunc(l_demand_class_priority_tab (i-1), -2) THEN

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

4752:
4753: IF trunc(l_demand_class_priority_tab(i), -2) >
4754: trunc(l_demand_class_priority_tab (i-1), -2) THEN
4755: IF PG_DEBUG in ('Y', 'C') THEN
4756: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'customer priority changed');
4757: END IF;
4758:
4759: l_partner_curr_steal_atp := l_partner_next_steal_atp;
4760: l_partner_next_steal_atp := l_null_steal_atp;

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

4765:
4766: ELSE
4767: -- same customer
4768: IF PG_DEBUG in ('Y', 'C') THEN
4769: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'same customer ');
4770: END IF;
4771:
4772: IF (l_demand_class_priority_tab(i) >
4773: l_demand_class_priority_tab (i-1)) THEN

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

4773: l_demand_class_priority_tab (i-1)) THEN
4774: -- site level priority changed
4775:
4776: IF PG_DEBUG in ('Y', 'C') THEN
4777: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'site priority changed');
4778: END IF;
4779: l_current_steal_atp := l_next_steal_atp;
4780: l_next_steal_atp := l_null_steal_atp;
4781:

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

4786: END IF; -- IF (i > 1)
4787:
4788: END IF; -- IF l_level_id IN (-1, 1)
4789: IF PG_DEBUG in ('Y', 'C') THEN
4790: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before we decide we need to do dc consumption');
4791: END IF;
4792: IF (i > 1) THEN
4793: IF ( -- this is the huge condition
4794: ((l_level_id IN (-1, 1)) AND

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

4810: l_temp_atp := l_current_atp;
4811: END IF;
4812:
4813: IF PG_DEBUG in ('Y', 'C') THEN
4814: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class : '||p_demand_class);
4815: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_tab(i) : '||l_demand_class_tab(i));
4816: END IF;
4817:
4818: -- 1680719

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

4811: END IF;
4812:
4813: IF PG_DEBUG in ('Y', 'C') THEN
4814: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class : '||p_demand_class);
4815: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_demand_class_tab(i) : '||l_demand_class_tab(i));
4816: END IF;
4817:
4818: -- 1680719
4819: -- since we have hierarchy now, before we do demand class

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

4824:
4825: IF l_class_tab(i) <> l_class_tab(1) THEN
4826:
4827: IF PG_DEBUG in ('Y', 'C') THEN
4828: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before consume l_class_curr_steal_atp');
4829: Print_Period_Qty('l_class_curr_steal_atp.atp_period:atp_qty = ',
4830: l_class_curr_steal_atp);
4831: END IF;
4832:

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

4834: pass p_atf_date to make sure we do not do demand class consumption across ATF*/
4835: MSC_AATP_PVT.Atp_Demand_Class_Consume(l_current_atp, l_class_curr_steal_atp, p_atf_date);
4836:
4837: IF PG_DEBUG in ('Y', 'C') THEN
4838: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After consume l_class_curr_steal_atp');
4839: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4840: l_current_atp);
4841: Print_Period_Qty('l_class_curr_steal_atp.atp_period:atp_qty = ',
4842: l_class_curr_steal_atp);

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

4854:
4855: IF (l_class_tab(i) <> l_class_tab(1)) OR
4856: (l_partner_tab(i) <> l_partner_tab(1)) THEN
4857: IF PG_DEBUG in ('Y', 'C') THEN
4858: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before consume l_partner_curr_steal_atp');
4859: END IF;
4860: /* time_phased_atp
4861: pass p_atf_date to make sure we do not do demand class consumption across ATF*/
4862: MSC_AATP_PVT.Atp_Demand_Class_Consume(l_current_atp, l_partner_curr_steal_atp, p_atf_date);

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

4861: pass p_atf_date to make sure we do not do demand class consumption across ATF*/
4862: MSC_AATP_PVT.Atp_Demand_Class_Consume(l_current_atp, l_partner_curr_steal_atp, p_atf_date);
4863:
4864: IF PG_DEBUG in ('Y', 'C') THEN
4865: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After consume l_partner_curr_steal_atp');
4866: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4867: l_current_atp);
4868: Print_Period_Qty('l_partner_curr_steal_atp.atp_period:atp_qty = ',
4869: l_partner_curr_steal_atp);

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

4873:
4874: END IF; -- IF l_level_id IN (2,3)
4875:
4876: IF PG_DEBUG in ('Y', 'C') THEN
4877: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Before consume current_steal_atp');
4878: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4879: l_current_atp);
4880: END IF;
4881:

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

4883: pass p_atf_date to make sure we do not do demand class consumption across ATF*/
4884: MSC_AATP_PVT.Atp_Demand_Class_Consume(l_current_atp, l_current_steal_atp, p_atf_date);
4885:
4886: IF PG_DEBUG in ('Y', 'C') THEN
4887: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After consume l_current_steal_atp');
4888:
4889: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
4890: l_current_atp);
4891: Print_Period_Qty('l_current_steal_atp.atp_period:atp_qty = ',

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

4919: MSC_SATP_FUNC.Extend_Atp_Supply_Demand(l_temp_atp_supply_demand, l_return_status,
4920: l_current_atp.atp_qty.COUNT);
4921:
4922: IF PG_DEBUG in ('Y', 'C') THEN
4923: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'k before FOR LOOP = ' || k);
4924: END IF;
4925:
4926: FOR j in 1..l_current_atp.atp_qty.COUNT LOOP
4927:

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

4928: IF l_current_atp.atp_qty(j) < l_temp_atp.atp_qty(j) THEN
4929: -- this is the stealing quantity in that period
4930:
4931: IF PG_DEBUG in ('Y', 'C') THEN
4932: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4933: 'l_current_atp.atp_qty(j)='||l_current_atp.atp_qty(j));
4934: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4935: 'l_temp_atp.atp_qty(j)='||l_temp_atp.atp_qty(j));
4936: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

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

4930:
4931: IF PG_DEBUG in ('Y', 'C') THEN
4932: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4933: 'l_current_atp.atp_qty(j)='||l_current_atp.atp_qty(j));
4934: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4935: 'l_temp_atp.atp_qty(j)='||l_temp_atp.atp_qty(j));
4936: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4937: 'l_steal_period_quantity='||l_steal_period_quantity);
4938: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

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

4932: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4933: 'l_current_atp.atp_qty(j)='||l_current_atp.atp_qty(j));
4934: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4935: 'l_temp_atp.atp_qty(j)='||l_temp_atp.atp_qty(j));
4936: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4937: 'l_steal_period_quantity='||l_steal_period_quantity);
4938: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4939: 'x_atp_period.period_start_date(j)='||x_atp_period.period_start_date(j));
4940: END IF;

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

4934: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4935: 'l_temp_atp.atp_qty(j)='||l_temp_atp.atp_qty(j));
4936: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4937: 'l_steal_period_quantity='||l_steal_period_quantity);
4938: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
4939: 'x_atp_period.period_start_date(j)='||x_atp_period.period_start_date(j));
4940: END IF;
4941:
4942: -- bug 1413459: the stealing quantity should be the current

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

4995: END IF;
4996: END LOOP;
4997:
4998: IF PG_DEBUG in ('Y', 'C') THEN
4999: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'k after FOR LOOP = ' || k);
5000: END IF;
5001:
5002: --rajjain trim the remaining 12/10/2002
5003: MSC_SATP_FUNC.Trim_Atp_Supply_Demand(l_temp_atp_supply_demand, l_return_status,

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

5013:
5014: -- AATP Forward Consumption rajjain begin
5015: IF l_level_id IN (-1, 1) THEN
5016: IF PG_DEBUG in ('Y', 'C') THEN
5017: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Inside IF l_level_id IN (-1, 1) THEN');
5018: END IF;
5019:
5020: /*1. If level_id is in (-1, 1) and forward consumption method is method1
5021: for the lowest priority demand class -> add negatives from l_current_steal to

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

5024: for the lowest priority demand class -> call Atp_Remove_Negatives to remove
5025: all the negatives from l_current_atp*/
5026: IF l_demand_class = l_lowest_priority_demand_class THEN
5027: IF PG_DEBUG in ('Y', 'C') THEN
5028: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This is l_lowest_priority_demand_class');
5029: END IF;
5030: IF G_ATP_FW_CONSUME_METHOD = 1 THEN
5031: IF PG_DEBUG in ('Y', 'C') THEN
5032: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Method 1');

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

5028: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This is l_lowest_priority_demand_class');
5029: END IF;
5030: IF G_ATP_FW_CONSUME_METHOD = 1 THEN
5031: IF PG_DEBUG in ('Y', 'C') THEN
5032: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Method 1');
5033: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
5034: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Add_to_Current_Atp');
5035: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5036: l_current_atp);

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

5029: END IF;
5030: IF G_ATP_FW_CONSUME_METHOD = 1 THEN
5031: IF PG_DEBUG in ('Y', 'C') THEN
5032: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Method 1');
5033: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
5034: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Add_to_Current_Atp');
5035: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5036: l_current_atp);
5037: Print_Period_Qty('l_current_steal_atp.atp_period:atp_qty = ',

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

5030: IF G_ATP_FW_CONSUME_METHOD = 1 THEN
5031: IF PG_DEBUG in ('Y', 'C') THEN
5032: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Method 1');
5033: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
5034: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Add_to_Current_Atp');
5035: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5036: l_current_atp);
5037: Print_Period_Qty('l_current_steal_atp.atp_period:atp_qty = ',
5038: l_current_steal_atp);

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

5040:
5041: MSC_AATP_PROC.Add_to_Current_Atp(l_current_steal_atp, l_current_atp, l_return_status);
5042: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5043: IF PG_DEBUG in ('Y', 'C') THEN
5044: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Add_to_Current_Atp');
5045: END IF;
5046: END IF;
5047: IF PG_DEBUG in ('Y', 'C') THEN
5048: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Add_to_Current_Atp');

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

5044: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Add_to_Current_Atp');
5045: END IF;
5046: END IF;
5047: IF PG_DEBUG in ('Y', 'C') THEN
5048: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Add_to_Current_Atp');
5049: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5050: l_current_atp);
5051: END IF;
5052:

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

5052:
5053: MSC_AATP_PROC.Atp_Forward_Consume(l_current_atp.atp_period, p_atf_date, l_current_atp.atp_qty, l_return_status);
5054: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5055: IF PG_DEBUG in ('Y', 'C') THEN
5056: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Forward_Consume');
5057: END IF;
5058: END IF;
5059:
5060: IF PG_DEBUG in ('Y', 'C') THEN

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

5057: END IF;
5058: END IF;
5059:
5060: IF PG_DEBUG in ('Y', 'C') THEN
5061: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Atp_Forward_Consume for last demand class');
5062: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5063: l_current_atp);
5064: END IF;
5065:

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

5069:
5070: MSC_AATP_PROC.Atp_Remove_Negatives(l_current_atp.atp_qty, l_return_status);
5071: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5072: IF PG_DEBUG in ('Y', 'C') THEN
5073: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Remove_Negatives');
5074: END IF;
5075: END IF;
5076:
5077: IF PG_DEBUG in ('Y', 'C') THEN

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

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

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

5081: END IF;
5082:
5083: ELSE
5084: IF PG_DEBUG in ('Y', 'C') THEN
5085: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Method 2');
5086: END IF;
5087: MSC_AATP_PROC.Atp_remove_negatives(l_current_atp.atp_qty, l_return_status);
5088: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5089: IF PG_DEBUG in ('Y', 'C') THEN

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

5086: END IF;
5087: MSC_AATP_PROC.Atp_remove_negatives(l_current_atp.atp_qty, l_return_status);
5088: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5089: IF PG_DEBUG in ('Y', 'C') THEN
5090: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_remove_negatives');
5091: END IF;
5092: END IF;
5093:
5094: END IF;

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

5094: END IF;
5095:
5096: ELSE
5097: IF PG_DEBUG in ('Y', 'C') THEN
5098: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This is not the l_lowest_priority_demand_class');
5099: END IF;
5100: IF l_demand_class_priority_tab(i) < l_lowest_priority OR G_ATP_FW_CONSUME_METHOD = 2 THEN
5101: -- this demand class is not the lowest priority demand class
5102: -- add negatives from l_current_atp to l_next_steal_atp

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

5100: IF l_demand_class_priority_tab(i) < l_lowest_priority OR G_ATP_FW_CONSUME_METHOD = 2 THEN
5101: -- this demand class is not the lowest priority demand class
5102: -- add negatives from l_current_atp to l_next_steal_atp
5103: IF PG_DEBUG in ('Y', 'C') THEN
5104: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: '||'l_demand_class_priority_tab(i) 5105: ' OR G_ATP_FW_CONSUME_METHOD = 2');
5106: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Add_to_Next_Steal_Atp');
5107: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5108: l_current_atp);

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

5102: -- add negatives from l_current_atp to l_next_steal_atp
5103: IF PG_DEBUG in ('Y', 'C') THEN
5104: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: '||'l_demand_class_priority_tab(i) 5105: ' OR G_ATP_FW_CONSUME_METHOD = 2');
5106: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Add_to_Next_Steal_Atp');
5107: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5108: l_current_atp);
5109: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',
5110: l_next_steal_atp);

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

5112:
5113: -- we need to prepare the l_next_steal_atp for next priority
5114: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_atp, l_next_steal_atp);
5115: IF PG_DEBUG in ('Y', 'C') THEN
5116: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Add_to_Next_Steal_Atp');
5117: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5118: l_current_atp);
5119: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',
5120: l_next_steal_atp);

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

5125: -- this is the last element of current priority, so we also need
5126: -- to add l_steal_atp into l_next_steal_atp if we can not finish
5127: -- the stealing at this priority
5128: IF PG_DEBUG in ('Y', 'C') THEN
5129: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This is the last element of current priority');
5130: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
5131: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
5132:
5133: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',

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

5126: -- to add l_steal_atp into l_next_steal_atp if we can not finish
5127: -- the stealing at this priority
5128: IF PG_DEBUG in ('Y', 'C') THEN
5129: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This is the last element of current priority');
5130: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
5131: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
5132:
5133: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',
5134: l_next_steal_atp);

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

5127: -- the stealing at this priority
5128: IF PG_DEBUG in ('Y', 'C') THEN
5129: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This is the last element of current priority');
5130: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
5131: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
5132:
5133: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',
5134: l_next_steal_atp);
5135: END IF;

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

5136:
5137: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_steal_atp, l_next_steal_atp);
5138:
5139: IF PG_DEBUG in ('Y', 'C') THEN
5140: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Add_to_Next_Steal_Atp');
5141:
5142: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',
5143: l_next_steal_atp);
5144: END IF;

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

5149: /* this is the lowest priority demand class in case
5150: we have multiple demand classes at lowest priority
5151: do forward consumption for all the lowest priority demand classes for method 1*/
5152: IF PG_DEBUG in ('Y', 'C') THEN
5153: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This demand class is of l_lowest_priority');
5154: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
5155: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5156: 'before Forward Consumption for lowest priority demand classes');
5157: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',

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

5150: we have multiple demand classes at lowest priority
5151: do forward consumption for all the lowest priority demand classes for method 1*/
5152: IF PG_DEBUG in ('Y', 'C') THEN
5153: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This demand class is of l_lowest_priority');
5154: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
5155: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5156: 'before Forward Consumption for lowest priority demand classes');
5157: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5158: l_current_atp);

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

5151: do forward consumption for all the lowest priority demand classes for method 1*/
5152: IF PG_DEBUG in ('Y', 'C') THEN
5153: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This demand class is of l_lowest_priority');
5154: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
5155: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5156: 'before Forward Consumption for lowest priority demand classes');
5157: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5158: l_current_atp);
5159: END IF;

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

5160:
5161: MSC_AATP_PROC.Atp_Forward_Consume(l_current_atp.atp_period, p_atf_date, l_current_atp.atp_qty, l_return_status);
5162: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5163: IF PG_DEBUG in ('Y', 'C') THEN
5164: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Forward_Consume');
5165: END IF;
5166: END IF;
5167: IF PG_DEBUG in ('Y', 'C') THEN
5168: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

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

5164: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Forward_Consume');
5165: END IF;
5166: END IF;
5167: IF PG_DEBUG in ('Y', 'C') THEN
5168: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5169: 'after Forward Consumption for lowest priority demand classes');
5170: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5171: l_current_atp);
5172: END IF;

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

5177:
5178: MSC_AATP_PROC.Atp_Remove_Negatives(l_current_atp.atp_qty, l_return_status);
5179: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5180: IF PG_DEBUG in ('Y', 'C') THEN
5181: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Remove_Negatives');
5182: END IF;
5183: END IF;
5184:
5185: IF PG_DEBUG in ('Y', 'C') THEN

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

5182: END IF;
5183: END IF;
5184:
5185: IF PG_DEBUG in ('Y', 'C') THEN
5186: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Atp_Remove_Negatives');
5187: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5188: l_current_atp);
5189: END IF;
5190:

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

5193: END IF;
5194:
5195: ELSE --IF l_level_id IN (-1, 1) THEN
5196: IF PG_DEBUG in ('Y', 'C') THEN
5197: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Inside ELSE of IF l_level_id IN (-1, 1) THEN');
5198: END IF;
5199: IF l_demand_class = l_lowest_priority_demand_class THEN
5200: IF PG_DEBUG in ('Y', 'C') THEN
5201: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This is l_lowest_priority_demand_class');

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

5197: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Inside ELSE of IF l_level_id IN (-1, 1) THEN');
5198: END IF;
5199: IF l_demand_class = l_lowest_priority_demand_class THEN
5200: IF PG_DEBUG in ('Y', 'C') THEN
5201: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This is l_lowest_priority_demand_class');
5202: END IF;
5203: IF G_ATP_FW_CONSUME_METHOD = 1 THEN
5204: IF PG_DEBUG in ('Y', 'C') THEN
5205: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Method 1');

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

5201: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'This is l_lowest_priority_demand_class');
5202: END IF;
5203: IF G_ATP_FW_CONSUME_METHOD = 1 THEN
5204: IF PG_DEBUG in ('Y', 'C') THEN
5205: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Method 1');
5206: END IF;
5207: IF l_fw_consume_tab(i) = 4 THEN
5208: -- add all negatives to l_current_atp and do forward consumption
5209: IF PG_DEBUG in ('Y', 'C') THEN

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

5206: END IF;
5207: IF l_fw_consume_tab(i) = 4 THEN
5208: -- add all negatives to l_current_atp and do forward consumption
5209: IF PG_DEBUG in ('Y', 'C') THEN
5210: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_fw_consume_tab(i) is 4');
5211: END IF;
5212: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_steal_atp, l_next_steal_atp);
5213: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_next_steal_atp, l_partner_next_steal_atp);
5214: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_partner_curr_steal_atp,

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

5217: l_class_next_steal_atp);
5218: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_class_curr_steal_atp,
5219: l_class_next_steal_atp);
5220: IF PG_DEBUG in ('Y', 'C') THEN
5221: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Add_to_Next_Steal_Atp');
5222:
5223: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5224: l_current_atp);
5225: Print_Period_Qty('l_class_next_steal_atp.atp_period:atp_qty = ',

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

5227: END IF;
5228: MSC_AATP_PROC.Add_to_Current_Atp(l_class_next_steal_atp, l_current_atp, l_return_status);
5229: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5230: IF PG_DEBUG in ('Y', 'C') THEN
5231: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Add_to_Current_Atp');
5232: END IF;
5233: END IF;
5234:
5235: IF PG_DEBUG in ('Y', 'C') THEN

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

5232: END IF;
5233: END IF;
5234:
5235: IF PG_DEBUG in ('Y', 'C') THEN
5236: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Add_to_Current_Atp');
5237:
5238: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5239: l_current_atp);
5240: Print_Period_Qty('l_class_next_steal_atp.atp_period:atp_qty = ',

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

5242: END IF;
5243: MSC_AATP_PROC.Atp_Forward_Consume(l_current_atp.atp_period, p_atf_date, l_current_atp.atp_qty, l_return_status);
5244: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5245: IF PG_DEBUG in ('Y', 'C') THEN
5246: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Forward_Consume');
5247: END IF;
5248: END IF;
5249: IF PG_DEBUG in ('Y', 'C') THEN
5250: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Atp_forward_consume');

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

5246: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Forward_Consume');
5247: END IF;
5248: END IF;
5249: IF PG_DEBUG in ('Y', 'C') THEN
5250: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Atp_forward_consume');
5251:
5252: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5253: l_current_atp);
5254: END IF;

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

5259:
5260: MSC_AATP_PROC.Atp_Remove_Negatives(l_current_atp.atp_qty, l_return_status);
5261: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5262: IF PG_DEBUG in ('Y', 'C') THEN
5263: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Remove_Negatives');
5264: END IF;
5265: END IF;
5266:
5267: IF PG_DEBUG in ('Y', 'C') THEN

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

5264: END IF;
5265: END IF;
5266:
5267: IF PG_DEBUG in ('Y', 'C') THEN
5268: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Atp_Remove_Negatives');
5269: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5270: l_current_atp);
5271: END IF;
5272: END IF;

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

5272: END IF;
5273: ELSE
5274: -- method2, remove negatives from l_current_atp
5275: IF PG_DEBUG in ('Y', 'C') THEN
5276: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Method 2');
5277: END IF;
5278: MSC_AATP_PROC.Atp_remove_negatives(l_current_atp.atp_qty, l_return_status);
5279: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5280: IF PG_DEBUG in ('Y', 'C') THEN

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

5277: END IF;
5278: MSC_AATP_PROC.Atp_remove_negatives(l_current_atp.atp_qty, l_return_status);
5279: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5280: IF PG_DEBUG in ('Y', 'C') THEN
5281: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_remove_negatives');
5282: END IF;
5283: END IF;
5284:
5285: END IF;

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

5284:
5285: END IF;
5286: ELSE --IF l_demand_class = l_lowest_priority_demand_class THEN
5287: IF PG_DEBUG in ('Y', 'C') THEN
5288: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5289: 'This is not the l_lowest_priority_demand_class');
5290: END IF;
5291: IF G_ATP_FW_CONSUME_METHOD = 2 OR
5292: (G_ATP_FW_CONSUME_METHOD = 1 AND l_fw_consume_tab(i) = 0) THEN

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

5290: END IF;
5291: IF G_ATP_FW_CONSUME_METHOD = 2 OR
5292: (G_ATP_FW_CONSUME_METHOD = 1 AND l_fw_consume_tab(i) = 0) THEN
5293: IF PG_DEBUG in ('Y', 'C') THEN
5294: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Inside IF G_ATP_FW_CONSUME_METHOD = 2 OR '||
5295: '(G_ATP_FW_CONSUME_METHOD = 1 AND l_fw_consume_tab(i) = 0)');
5296: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
5297:
5298: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',

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

5292: (G_ATP_FW_CONSUME_METHOD = 1 AND l_fw_consume_tab(i) = 0) THEN
5293: IF PG_DEBUG in ('Y', 'C') THEN
5294: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Inside IF G_ATP_FW_CONSUME_METHOD = 2 OR '||
5295: '(G_ATP_FW_CONSUME_METHOD = 1 AND l_fw_consume_tab(i) = 0)');
5296: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
5297:
5298: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5299: l_current_atp);
5300: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',

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

5303:
5304: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_atp, l_next_steal_atp);
5305:
5306: IF PG_DEBUG in ('Y', 'C') THEN
5307: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Add_to_Next_Steal_Atp');
5308:
5309: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5310: l_current_atp);
5311: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',

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

5319: -- either we are at last record in l_demand_class_tab or
5320: -- we are at last record at current customer class level in l_demand_class_tab or
5321: -- this is the lowest priority customer at customer class level
5322: IF PG_DEBUG in ('Y', 'C') THEN
5323: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5324: 'We are at lowest priority customer at current customer class level ');
5325: END IF;
5326:
5327: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_steal_atp, l_next_steal_atp);

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

5332: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_partner_next_steal_atp,
5333: l_class_next_steal_atp);
5334: END IF;
5335: IF PG_DEBUG in ('Y', 'C') THEN
5336: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Adding Add_to_Next_Steal_Atp');
5337:
5338: Print_Period_Qty('l_class_next_steal_atp.atp_period:atp_qty = ',
5339: l_class_next_steal_atp);
5340: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',

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

5346:
5347: -- next customer class is at higher priority then this cc
5348: -- add negatives from class_curr_steal to class_next_steal
5349: IF PG_DEBUG in ('Y', 'C') THEN
5350: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5351: 'next customer class is at higher priority then this cc');
5352: END IF;
5353: IF PG_DEBUG in ('Y', 'C') THEN
5354: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');

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

5350: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5351: 'next customer class is at higher priority then this cc');
5352: END IF;
5353: IF PG_DEBUG in ('Y', 'C') THEN
5354: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
5355:
5356: Print_Period_Qty('l_class_next_steal_atp.atp_period:atp_qty = ',
5357: l_class_next_steal_atp);
5358: Print_Period_Qty('l_class_curr_steal_atp.atp_period:atp_qty = ',

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

5360: END IF;
5361: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_class_curr_steal_atp,
5362: l_class_next_steal_atp);
5363: IF PG_DEBUG in ('Y', 'C') THEN
5364: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Adding Add_to_Next_Steal_Atp');
5365:
5366: Print_Period_Qty('l_class_next_steal_atp.atp_period:atp_qty = ',
5367: l_class_next_steal_atp);
5368: Print_Period_Qty('l_class_curr_steal_atp.atp_period:atp_qty = ',

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

5372: END IF;
5373:
5374: ELSE
5375: IF PG_DEBUG in ('Y', 'C') THEN
5376: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5377: 'We are not at lowest priority customer at current customer class level ');
5378: END IF;
5379: IF (l_partner_tab(i) <> l_partner_tab(i+1))
5380: OR (G_ATP_FW_CONSUME_METHOD = 1 AND l_fw_consume_tab(i) = 2) THEN

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

5380: OR (G_ATP_FW_CONSUME_METHOD = 1 AND l_fw_consume_tab(i) = 2) THEN
5381: -- either we are at last record at current customer level in l_demand_class_tab or
5382: -- this is the lowest priority site at this customer level
5383: IF PG_DEBUG in ('Y', 'C') THEN
5384: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5385: 'We are at lowest priority customer site at current customer level ');
5386: END IF;
5387: IF PG_DEBUG in ('Y', 'C') THEN
5388: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');

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

5384: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5385: 'We are at lowest priority customer site at current customer level ');
5386: END IF;
5387: IF PG_DEBUG in ('Y', 'C') THEN
5388: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
5389:
5390: Print_Period_Qty('l_current_steal_atp.atp_period:atp_qty = ',
5391: l_current_steal_atp);
5392: Print_Period_Qty('l_partner_next_steal_atp.atp_period:atp_qty = ',

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

5401: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_next_steal_atp, l_partner_next_steal_atp);
5402: END IF;
5403:
5404: IF PG_DEBUG in ('Y', 'C') THEN
5405: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Adding Add_to_Next_Steal_Atp');
5406:
5407: Print_Period_Qty('l_current_steal_atp.atp_period:atp_qty = ',
5408: l_current_steal_atp);
5409: Print_Period_Qty('l_partner_next_steal_atp.atp_period:atp_qty = ',

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

5411: END IF;
5412: IF trunc(l_demand_class_priority_tab(i), -2)<
5413: trunc(l_demand_class_priority_tab (i+1), -2) THEN
5414: IF PG_DEBUG in ('Y', 'C') THEN
5415: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5416: 'next customer is at higher priority then this customer');
5417: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
5418:
5419: Print_Period_Qty('l_partner_curr_steal_atp.atp_period:atp_qty = ',

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

5413: trunc(l_demand_class_priority_tab (i+1), -2) THEN
5414: IF PG_DEBUG in ('Y', 'C') THEN
5415: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5416: 'next customer is at higher priority then this customer');
5417: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
5418:
5419: Print_Period_Qty('l_partner_curr_steal_atp.atp_period:atp_qty = ',
5420: l_partner_curr_steal_atp);
5421: Print_Period_Qty('l_partner_next_steal_atp.atp_period:atp_qty = ',

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

5425: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_partner_curr_steal_atp,
5426: l_partner_next_steal_atp);
5427:
5428: IF PG_DEBUG in ('Y', 'C') THEN
5429: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Adding Add_to_Next_Steal_Atp');
5430:
5431: Print_Period_Qty('l_partner_curr_steal_atp.atp_period:atp_qty = ',
5432: l_partner_curr_steal_atp);
5433: Print_Period_Qty('l_partner_next_steal_atp.atp_period:atp_qty = ',

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

5439:
5440: ELSE
5441: -- we are not at last site under this customer
5442: IF PG_DEBUG in ('Y', 'C') THEN
5443: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5444: 'we are not at last site under this customer');
5445: END IF;
5446: IF (l_demand_class_priority_tab(i)<>
5447: l_demand_class_priority_tab (i+1)) THEN

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

5446: IF (l_demand_class_priority_tab(i)<>
5447: l_demand_class_priority_tab (i+1)) THEN
5448: -- next site under this customer is not at same priority as this site
5449: IF PG_DEBUG in ('Y', 'C') THEN
5450: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5451: 'next site under this customer is not at same priority as this site');
5452: END IF;
5453: IF PG_DEBUG in ('Y', 'C') THEN
5454: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');

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

5450: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5451: 'next site under this customer is not at same priority as this site');
5452: END IF;
5453: IF PG_DEBUG in ('Y', 'C') THEN
5454: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
5455:
5456: Print_Period_Qty('l_current_steal_atp.atp_period:atp_qty = ',
5457: l_current_steal_atp);
5458: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',

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

5459: l_next_steal_atp);
5460: END IF;
5461: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_steal_atp, l_next_steal_atp);
5462: IF PG_DEBUG in ('Y', 'C') THEN
5463: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Adding Add_to_Next_Steal_Atp');
5464:
5465: Print_Period_Qty('l_current_steal_atp.atp_period:atp_qty = ',
5466: l_current_steal_atp);
5467: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',

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

5474: IF G_ATP_FW_CONSUME_METHOD = 1 AND l_fw_consume_tab(i) <> 0 THEN
5475: IF l_fw_consume_tab(i) = 2 THEN
5476: -- add negatives from l_next_steal_atp to l_current_atp and then do forward consumption
5477: IF PG_DEBUG in ('Y', 'C') THEN
5478: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_fw_consume_tab(i) = 2');
5479: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Current_Atp');
5480:
5481: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5482: l_current_atp);

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

5475: IF l_fw_consume_tab(i) = 2 THEN
5476: -- add negatives from l_next_steal_atp to l_current_atp and then do forward consumption
5477: IF PG_DEBUG in ('Y', 'C') THEN
5478: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_fw_consume_tab(i) = 2');
5479: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Current_Atp');
5480:
5481: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5482: l_current_atp);
5483: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',

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

5485: END IF;
5486: MSC_AATP_PROC.Add_to_Current_Atp(l_next_steal_atp, l_current_atp, l_return_status);
5487: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5488: IF PG_DEBUG in ('Y', 'C') THEN
5489: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Add_to_Current_Atp');
5490: END IF;
5491: END IF;
5492: IF PG_DEBUG in ('Y', 'C') THEN
5493: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Adding Add_to_Current_Atp');

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

5489: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Add_to_Current_Atp');
5490: END IF;
5491: END IF;
5492: IF PG_DEBUG in ('Y', 'C') THEN
5493: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Adding Add_to_Current_Atp');
5494:
5495: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5496: l_current_atp);
5497: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',

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

5499: END IF;
5500: ELSIF l_fw_consume_tab(i) = 3 THEN
5501: -- add negatives from l_partner_next_steal_atp to l_current_atp and then do forward consumption
5502: IF PG_DEBUG in ('Y', 'C') THEN
5503: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_fw_consume_tab(i) = 3');
5504: END IF;
5505: IF PG_DEBUG in ('Y', 'C') THEN
5506: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Current_Atp');
5507:

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

5502: IF PG_DEBUG in ('Y', 'C') THEN
5503: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_fw_consume_tab(i) = 3');
5504: END IF;
5505: IF PG_DEBUG in ('Y', 'C') THEN
5506: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'before Adding Add_to_Current_Atp');
5507:
5508: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5509: l_current_atp);
5510: Print_Period_Qty('l_partner_next_steal_atp.atp_period:atp_qty = ',

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

5512: END IF;
5513: MSC_AATP_PROC.Add_to_Current_Atp(l_partner_next_steal_atp, l_current_atp, l_return_status);
5514: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5515: IF PG_DEBUG in ('Y', 'C') THEN
5516: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Add_to_Current_Atp');
5517: END IF;
5518: END IF;
5519: IF PG_DEBUG in ('Y', 'C') THEN
5520: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Adding Add_to_Current_Atp');

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

5516: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Add_to_Current_Atp');
5517: END IF;
5518: END IF;
5519: IF PG_DEBUG in ('Y', 'C') THEN
5520: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Adding Add_to_Current_Atp');
5521:
5522: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5523: l_current_atp);
5524: Print_Period_Qty('l_partner_next_steal_atp.atp_period:atp_qty = ',

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

5525: l_partner_next_steal_atp);
5526: END IF;
5527: END IF;
5528: IF PG_DEBUG in ('Y', 'C') THEN
5529: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Before Atp_Forward_Consume for Method1');
5530: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5531: l_current_atp);
5532: END IF;
5533: MSC_AATP_PROC.Atp_Forward_Consume(l_current_atp.atp_period, p_atf_date, l_current_atp.atp_qty, l_return_status);

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

5532: END IF;
5533: MSC_AATP_PROC.Atp_Forward_Consume(l_current_atp.atp_period, p_atf_date, l_current_atp.atp_qty, l_return_status);
5534: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5535: IF PG_DEBUG in ('Y', 'C') THEN
5536: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Forward_Consume');
5537: END IF;
5538: END IF;
5539: IF PG_DEBUG in ('Y', 'C') THEN
5540: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After Atp_Forward_Consume for Method1');

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

5536: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Forward_Consume');
5537: END IF;
5538: END IF;
5539: IF PG_DEBUG in ('Y', 'C') THEN
5540: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After Atp_Forward_Consume for Method1');
5541: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5542: l_current_atp);
5543: END IF;
5544:

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

5548:
5549: MSC_AATP_PROC.Atp_Remove_Negatives(l_current_atp.atp_qty, l_return_status);
5550: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5551: IF PG_DEBUG in ('Y', 'C') THEN
5552: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Remove_Negatives');
5553: END IF;
5554: END IF;
5555:
5556: IF PG_DEBUG in ('Y', 'C') THEN

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

5553: END IF;
5554: END IF;
5555:
5556: IF PG_DEBUG in ('Y', 'C') THEN
5557: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after Atp_Remove_Negatives');
5558: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5559: l_current_atp);
5560: END IF;
5561: END IF;

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

5565:
5566: IF G_ATP_FW_CONSUME_METHOD = 2 THEN
5567: -- method2, do accumulation and then calculate the adjusted cum
5568: IF PG_DEBUG in ('Y', 'C') THEN
5569: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Before Atp_Accumulate for Method2');
5570: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5571: l_current_atp);
5572: END IF;
5573:

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

5573:
5574: MSC_ATP_PROC.Atp_Accumulate(l_current_atp.atp_qty);
5575:
5576: IF PG_DEBUG in ('Y', 'C') THEN
5577: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'After Atp_Accumulate for Method2');
5578: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5579: l_current_atp);
5580: END IF;
5581:

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

5581:
5582: MSC_AATP_PROC.Atp_Adjusted_Cum(l_current_atp, l_unallocated_atp, l_return_status);
5583: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5584: IF PG_DEBUG in ('Y', 'C') THEN
5585: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Forward_Consume');
5586: END IF;
5587: END IF;
5588: IF PG_DEBUG in ('Y', 'C') THEN
5589: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

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

5585: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Error in call to Atp_Forward_Consume');
5586: END IF;
5587: END IF;
5588: IF PG_DEBUG in ('Y', 'C') THEN
5589: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5590: 'l_current_atp after Atp_Adjusted_Cum for Method2');
5591: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5592: l_current_atp);
5593: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||

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

5589: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5590: 'l_current_atp after Atp_Adjusted_Cum for Method2');
5591: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5592: l_current_atp);
5593: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5594: 'l_unallocated_atp after Atp_Adjusted_Cum for Method2');
5595: mm := l_unallocated_atp.atp_qty.FIRST;
5596: while mm is not null loop
5597: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||

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

5593: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' ||
5594: 'l_unallocated_atp after Atp_Adjusted_Cum for Method2');
5595: mm := l_unallocated_atp.atp_qty.FIRST;
5596: while mm is not null loop
5597: msc_sch_wb.atp_debug('l_unallocated_atp.atp_period:atp_qty = ' ||
5598: l_current_atp.atp_period(mm) || ':' || l_unallocated_atp.atp_qty(mm));
5599: mm := l_unallocated_atp.atp_qty.NEXT(mm);
5600: end loop;
5601: END IF;

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

5610: END IF;
5611:
5612: -- 1665110
5613: IF PG_DEBUG in ('Y', 'C') THEN
5614: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class = '||p_demand_class);
5615: END IF;
5616: EXIT WHEN (l_demand_class = p_demand_class);
5617: IF PG_DEBUG in ('Y', 'C') THEN
5618: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after the exit statement, so we did not exit');

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

5614: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'p_demand_class = '||p_demand_class);
5615: END IF;
5616: EXIT WHEN (l_demand_class = p_demand_class);
5617: IF PG_DEBUG in ('Y', 'C') THEN
5618: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'after the exit statement, so we did not exit');
5619: END IF;
5620:
5621: END LOOP;
5622:

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

5629: -- as we have the adjusted cum picture available if forward consumption method is 2
5630: MSC_ATP_PROC.Atp_Accumulate(l_current_atp.atp_qty);
5631:
5632: IF PG_DEBUG in ('Y', 'C') THEN
5633: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Right after the Atp_Accumulate');
5634: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_current_atp.atp_period.count = '||
5635: l_current_atp.atp_period.count);
5636: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_current_atp.atp_qty.count = '||
5637: l_current_atp.atp_qty.count);

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

5630: MSC_ATP_PROC.Atp_Accumulate(l_current_atp.atp_qty);
5631:
5632: IF PG_DEBUG in ('Y', 'C') THEN
5633: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Right after the Atp_Accumulate');
5634: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_current_atp.atp_period.count = '||
5635: l_current_atp.atp_period.count);
5636: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_current_atp.atp_qty.count = '||
5637: l_current_atp.atp_qty.count);
5638: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',

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

5632: IF PG_DEBUG in ('Y', 'C') THEN
5633: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'Right after the Atp_Accumulate');
5634: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_current_atp.atp_period.count = '||
5635: l_current_atp.atp_period.count);
5636: msc_sch_wb.atp_debug('Item_Alloc_Cum_Atp: ' || 'l_current_atp.atp_qty.count = '||
5637: l_current_atp.atp_qty.count);
5638: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
5639: l_current_atp);
5640: END IF;

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

5779:
5780: BEGIN
5781:
5782: IF PG_DEBUG in ('Y', 'C') THEN
5783: msc_sch_wb.atp_debug('******* Res_Alloc_Cum_Atp *******');
5784: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id);
5785: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
5786: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_department_id =' || p_department_id);
5787: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_resource_id =' || p_resource_id);

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

5780: BEGIN
5781:
5782: IF PG_DEBUG in ('Y', 'C') THEN
5783: msc_sch_wb.atp_debug('******* Res_Alloc_Cum_Atp *******');
5784: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id);
5785: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
5786: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_department_id =' || p_department_id);
5787: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_resource_id =' || p_resource_id);
5788: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);

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

5781:
5782: IF PG_DEBUG in ('Y', 'C') THEN
5783: msc_sch_wb.atp_debug('******* Res_Alloc_Cum_Atp *******');
5784: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id);
5785: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
5786: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_department_id =' || p_department_id);
5787: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_resource_id =' || p_resource_id);
5788: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
5789: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);

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

5782: IF PG_DEBUG in ('Y', 'C') THEN
5783: msc_sch_wb.atp_debug('******* Res_Alloc_Cum_Atp *******');
5784: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id);
5785: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
5786: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_department_id =' || p_department_id);
5787: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_resource_id =' || p_resource_id);
5788: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
5789: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
5790: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );

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

5783: msc_sch_wb.atp_debug('******* Res_Alloc_Cum_Atp *******');
5784: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id);
5785: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
5786: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_department_id =' || p_department_id);
5787: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_resource_id =' || p_resource_id);
5788: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
5789: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
5790: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
5791: END IF;

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

5784: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_plan_id =' || p_plan_id);
5785: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
5786: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_department_id =' || p_department_id);
5787: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_resource_id =' || p_resource_id);
5788: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
5789: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
5790: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
5791: END IF;
5792: MSO_Batch_flag := NVL(fnd_profile.value('MSO_BATCHABLE_FLAG'),'N');

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

5785: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_instance_id =' || p_instance_id);
5786: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_department_id =' || p_department_id);
5787: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_resource_id =' || p_resource_id);
5788: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
5789: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
5790: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
5791: END IF;
5792: MSO_Batch_flag := NVL(fnd_profile.value('MSO_BATCHABLE_FLAG'),'N');
5793: IF PG_DEBUG in ('Y', 'C') THEN

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

5786: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_department_id =' || p_department_id);
5787: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_resource_id =' || p_resource_id);
5788: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_organization_id =' || p_organization_id);
5789: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_demand_class =' || p_demand_class);
5790: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
5791: END IF;
5792: MSO_Batch_flag := NVL(fnd_profile.value('MSO_BATCHABLE_FLAG'),'N');
5793: IF PG_DEBUG in ('Y', 'C') THEN
5794: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'MSO_Batch_flag := ' || MSO_Batch_flag);

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

5790: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
5791: END IF;
5792: MSO_Batch_flag := NVL(fnd_profile.value('MSO_BATCHABLE_FLAG'),'N');
5793: IF PG_DEBUG in ('Y', 'C') THEN
5794: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'MSO_Batch_flag := ' || MSO_Batch_flag);
5795: END IF;
5796: Begin
5797: SELECT DECODE(plans.plan_type, 4, 2,
5798: DECODE(daily_material_constraints, 1, 1,

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

5833: l_optimized_plan := 2;
5834: l_constraint_plan := 0;
5835: END;
5836: IF PG_DEBUG in ('Y', 'C') THEN
5837: msc_sch_wb.atp_debug('Res_alloc_Cum_ATP: l_optimized_plan: ' || l_optimized_plan);
5838: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_constraint_plan =' || l_constraint_plan);
5839: END IF;
5840:
5841: IF (MSO_Batch_Flag = 'Y') and (l_constraint_plan = 1) and (p_batchable_flag = 1) THEN

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

5834: l_constraint_plan := 0;
5835: END;
5836: IF PG_DEBUG in ('Y', 'C') THEN
5837: msc_sch_wb.atp_debug('Res_alloc_Cum_ATP: l_optimized_plan: ' || l_optimized_plan);
5838: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_constraint_plan =' || l_constraint_plan);
5839: END IF;
5840:
5841: IF (MSO_Batch_Flag = 'Y') and (l_constraint_plan = 1) and (p_batchable_flag = 1) THEN
5842: IF PG_DEBUG in ('Y', 'C') THEN

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

5839: END IF;
5840:
5841: IF (MSO_Batch_Flag = 'Y') and (l_constraint_plan = 1) and (p_batchable_flag = 1) THEN
5842: IF PG_DEBUG in ('Y', 'C') THEN
5843: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Do Batching');
5844: END IF;
5845: l_use_batching := 1;
5846: ELSE
5847: IF PG_DEBUG in ('Y', 'C') THEN

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

5844: END IF;
5845: l_use_batching := 1;
5846: ELSE
5847: IF PG_DEBUG in ('Y', 'C') THEN
5848: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'No Batching');
5849: END IF;
5850: l_use_batching := 0;
5851: END IF;
5852:

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

5876: p_request_date, l_level_id, l_priority, l_allocation_percent, l_return_status);
5877:
5878: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
5879: IF PG_DEBUG in ('Y', 'C') THEN
5880: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Error retrieving Priority and Demand Class');
5881: END IF;
5882: END IF;
5883: ELSE
5884: l_priority := -1;

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

5890:
5891: -- IF l_allocation_percent <> 0.0 THEN
5892:
5893: IF PG_DEBUG in ('Y', 'C') THEN
5894: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_allocation_percent = '||l_allocation_percent);
5895: END IF;
5896: -- We don't need to select all demand classes in case this procdure is
5897: -- called from MSC_AATP_PVT.VIEW_ALLOCATION as we don't need to take care
5898: -- of any existing stealing.

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

5898: -- of any existing stealing.
5899: IF p_identifier <> -1 THEN
5900:
5901: IF PG_DEBUG in ('Y', 'C') THEN
5902: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'before select the high priority demand class');
5903: END IF;
5904:
5905: -- bug 1680719
5906: --bug3948494 Do not select Higher priority DC if the requested DC

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

5908: IF l_level_id = -1 AND l_priority <> 1 THEN
5909:
5910:
5911: IF PG_DEBUG in ('Y', 'C') THEN
5912: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);
5913: END IF;
5914: SELECT demand_class, priority
5915: BULK COLLECT INTO l_demand_class_tab, l_demand_class_priority_tab
5916: FROM msc_resource_hierarchy_mv

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

5925:
5926: ELSIF l_level_id = 1 THEN
5927:
5928: IF PG_DEBUG in ('Y', 'C') THEN
5929: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);
5930: END IF;
5931: SELECT demand_class, priority
5932: BULK COLLECT INTO l_demand_class_tab, l_demand_class_priority_tab
5933: FROM msc_resource_hierarchy_mv

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

5943: ELSIF l_level_id = 2 THEN
5944:
5945:
5946: IF PG_DEBUG in ('Y', 'C') THEN
5947: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);
5948: END IF;
5949: SELECT mv1.demand_class, mv1.priority, mv1.class, mv1.partner_id
5950: BULK COLLECT INTO l_demand_class_tab, l_demand_class_priority_tab,
5951: l_class_tab, l_partner_tab

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

5966: -- bug 1680719
5967: -- we need to select the class, partner_id, partner_site_id
5968:
5969: IF PG_DEBUG in ('Y', 'C') THEN
5970: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);
5971: END IF;
5972: SELECT mv1.demand_class, mv1.priority, mv1.class, mv1.partner_id
5973: BULK COLLECT INTO l_demand_class_tab, l_demand_class_priority_tab,
5974: l_class_tab, l_partner_tab

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

6017: mm := l_demand_class_tab.FIRST;
6018:
6019: WHILE mm is not null LOOP
6020: IF PG_DEBUG in ('Y', 'C') THEN
6021: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_demand_class_tab and priority = '||
6022: l_demand_class_tab(mm) ||' : '|| l_demand_class_priority_tab(mm));
6023: END IF;
6024:
6025: IF l_level_id in (2,3) THEN

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

6023: END IF;
6024:
6025: IF l_level_id in (2,3) THEN
6026: IF PG_DEBUG in ('Y', 'C') THEN
6027: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_class_tab and partner = '||
6028: l_class_tab(mm) ||' : '||l_partner_tab(mm));
6029: END IF;
6030: END IF;
6031:

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

6053: p_instance_id,
6054: TRUNC(sysdate));
6055:
6056: IF PG_DEBUG in ('Y', 'C') THEN
6057: msc_sch_wb.atp_debug('Sys next Date : '||to_char(l_sys_next_date, 'DD-MON-YYYY'));
6058: END IF;
6059:
6060: IF (l_sys_next_date is NULL) THEN
6061: msc_sch_wb.atp_debug('Sys Next Date is null');

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

6057: msc_sch_wb.atp_debug('Sys next Date : '||to_char(l_sys_next_date, 'DD-MON-YYYY'));
6058: END IF;
6059:
6060: IF (l_sys_next_date is NULL) THEN
6061: msc_sch_wb.atp_debug('Sys Next Date is null');
6062: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.NO_MATCHING_CAL_DATE;
6063: RAISE FND_API.G_EXC_ERROR;
6064: END IF;
6065: --bug3333114 end

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

6058: END IF;
6059:
6060: IF (l_sys_next_date is NULL) THEN
6061: msc_sch_wb.atp_debug('Sys Next Date is null');
6062: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.NO_MATCHING_CAL_DATE;
6063: RAISE FND_API.G_EXC_ERROR;
6064: END IF;
6065: --bug3333114 end
6066:

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

6064: END IF;
6065: --bug3333114 end
6066:
6067: IF PG_DEBUG in ('Y', 'C') THEN
6068: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
6069: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
6070: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
6071: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_default_demand_class'|| l_default_demand_class);
6072: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_org_code'|| l_org_code);

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

6065: --bug3333114 end
6066:
6067: IF PG_DEBUG in ('Y', 'C') THEN
6068: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
6069: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
6070: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
6071: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_default_demand_class'|| l_default_demand_class);
6072: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_org_code'|| l_org_code);
6073: END IF;

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

6066:
6067: IF PG_DEBUG in ('Y', 'C') THEN
6068: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
6069: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
6070: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
6071: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_default_demand_class'|| l_default_demand_class);
6072: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_org_code'|| l_org_code);
6073: END IF;
6074:

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

6067: IF PG_DEBUG in ('Y', 'C') THEN
6068: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
6069: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
6070: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
6071: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_default_demand_class'|| l_default_demand_class);
6072: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_org_code'|| l_org_code);
6073: END IF;
6074:
6075: FOR i in 1..l_demand_class_tab.COUNT LOOP

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

6068: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
6069: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
6070: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
6071: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_default_demand_class'|| l_default_demand_class);
6072: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_org_code'|| l_org_code);
6073: END IF;
6074:
6075: FOR i in 1..l_demand_class_tab.COUNT LOOP
6076: l_demand_class := l_demand_class_tab(i);

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

6074:
6075: FOR i in 1..l_demand_class_tab.COUNT LOOP
6076: l_demand_class := l_demand_class_tab(i);
6077: IF PG_DEBUG in ('Y', 'C') THEN
6078: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'in i loop, i = '||i);
6079: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_demand_class = '||l_demand_class);
6080: END IF;
6081: -- get the daily net availability for DCi
6082: IF (NVL(p_insert_flag, 0) = 0 OR l_demand_class <> p_demand_class) THEN

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

6075: FOR i in 1..l_demand_class_tab.COUNT LOOP
6076: l_demand_class := l_demand_class_tab(i);
6077: IF PG_DEBUG in ('Y', 'C') THEN
6078: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'in i loop, i = '||i);
6079: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_demand_class = '||l_demand_class);
6080: END IF;
6081: -- get the daily net availability for DCi
6082: IF (NVL(p_insert_flag, 0) = 0 OR l_demand_class <> p_demand_class) THEN
6083: -- we don't want details

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

6084:
6085: IF (l_use_batching = 1) THEN
6086: IF (l_optimized_plan = 1) THEN -- Constrained Plan Bug 2809639
6087: IF PG_DEBUG in ('Y', 'C') THEN
6088: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Constrained Plan Batching');
6089: END IF;
6090: SELECT SD_DATE,
6091: SUM(SD_QTY)
6092: BULK COLLECT INTO

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

6301: GROUP BY SD_DATE
6302: ORDER BY SD_DATE;--4698199
6303: ELSE -- now Other plans Bug 2809639
6304: IF PG_DEBUG in ('Y', 'C') THEN
6305: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Other Plans Batching');
6306: END IF;
6307: SELECT SD_DATE,
6308: SUM(SD_QTY)
6309: BULK COLLECT INTO

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

6481: ELSE --- IF l_use_batching =1 THEN
6482:
6483: IF (l_optimized_plan = 1) THEN -- Constrained Plan Bug 2809639
6484: IF PG_DEBUG in ('Y', 'C') THEN
6485: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Constrained Plan No Batching');
6486: END IF;
6487: SELECT SD_DATE,
6488: SUM(SD_QTY)
6489: BULK COLLECT INTO

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

6690: GROUP BY SD_DATE
6691: ORDER BY SD_DATE;--4698199
6692: ELSE -- now Other plans Bug 2809639
6693: IF PG_DEBUG in ('Y', 'C') THEN
6694: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Other Plans No Batching');
6695: END IF;
6696: SELECT SD_DATE,
6697: SUM(SD_QTY)
6698: BULK COLLECT INTO

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

6872:
6873: IF (l_use_batching = 1) THEN
6874: IF (l_optimized_plan = 1) THEN -- Constrained Plan Bug 2809639
6875: IF PG_DEBUG in ('Y', 'C') THEN
6876: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Constrained Plan Batching Details');
6877: END IF;
6878: INSERT INTO msc_atp_sd_details_temp (
6879: ATP_Level,
6880: Order_line_id,

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

7209: )
7210: ; -- dsting removed order by col25;
7211: ELSE -- now Other plans Bug 2809639
7212: IF PG_DEBUG in ('Y', 'C') THEN
7213: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Other Plans Batching Details');
7214: END IF;
7215: INSERT INTO msc_atp_sd_details_temp (
7216: ATP_Level,
7217: Order_line_id,

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

7507: ELSE
7508:
7509: IF (l_optimized_plan = 1) THEN -- Constrained Plan Bug 2809639
7510: IF PG_DEBUG in ('Y', 'C') THEN
7511: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Constrained Plan No Batching Details');
7512: END IF;
7513: INSERT INTO msc_atp_sd_details_temp (
7514: ATP_Level,
7515: Order_line_id,

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

7833: )
7834: ; -- dsting removed order by col25;
7835: ELSE -- now Other plans Bug 2809639
7836: IF PG_DEBUG in ('Y', 'C') THEN
7837: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Other Plans No Batching Details');
7838: END IF;
7839: INSERT INTO msc_atp_sd_details_temp (
7840: ATP_Level,
7841: Order_line_id,

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

8120: END IF; --- If l_use_batching =1 then
8121:
8122: -- for period ATP
8123: IF PG_DEBUG in ('Y', 'C') THEN
8124: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'after insert into msc_atp_sd_details_temp');
8125: END IF;
8126: MSC_ATP_PROC.get_period_data_from_SD_temp(x_atp_period);
8127:
8128: l_current_atp.atp_period := x_atp_period.Period_Start_Date;

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

8132:
8133: END IF;
8134:
8135: IF PG_DEBUG in ('Y', 'C') THEN
8136: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'right after the big query');
8137: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
8138: l_current_atp);
8139: END IF;
8140:

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

8141: -- do backward consumption for DCi
8142: MSC_ATP_PROC.Atp_Backward_Consume(l_current_atp.atp_qty);
8143:
8144: IF PG_DEBUG in ('Y', 'C') THEN
8145: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'right after the backward consume');
8146: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
8147: l_current_atp);
8148: END IF;
8149:

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

8200: -- class changed. If priority of both classes are not the same,
8201: -- then we need to change the curr_steal_atp at class level.
8202:
8203: IF PG_DEBUG in ('Y', 'C') THEN
8204: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'class changed');
8205: END IF;
8206:
8207: IF trunc(l_demand_class_priority_tab(i), -3) >
8208: trunc(l_demand_class_priority_tab (i-1), -3) THEN

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

8207: IF trunc(l_demand_class_priority_tab(i), -3) >
8208: trunc(l_demand_class_priority_tab (i-1), -3) THEN
8209:
8210: IF PG_DEBUG in ('Y', 'C') THEN
8211: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'class priority changed');
8212: END IF;
8213: l_class_curr_steal_atp := l_class_next_steal_atp;
8214: l_class_next_steal_atp := l_null_steal_atp;
8215: END IF;

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

8221: l_next_steal_atp := l_null_steal_atp;
8222:
8223: ELSE
8224: IF PG_DEBUG in ('Y', 'C') THEN
8225: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'same class');
8226: END IF;
8227: IF (l_partner_tab(i) <> l_partner_tab(i-1)) THEN
8228: -- customer changed. If priority of both customers are not the
8229: -- same, we need to change the curr_steal_atp at partner level.

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

8228: -- customer changed. If priority of both customers are not the
8229: -- same, we need to change the curr_steal_atp at partner level.
8230:
8231: IF PG_DEBUG in ('Y', 'C') THEN
8232: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'customer changed');
8233: END IF;
8234:
8235: IF trunc(l_demand_class_priority_tab(i), -2) >
8236: trunc(l_demand_class_priority_tab (i-1), -2) THEN

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

8234:
8235: IF trunc(l_demand_class_priority_tab(i), -2) >
8236: trunc(l_demand_class_priority_tab (i-1), -2) THEN
8237: IF PG_DEBUG in ('Y', 'C') THEN
8238: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'customer priority changed');
8239: END IF;
8240:
8241: l_partner_curr_steal_atp := l_partner_next_steal_atp;
8242: l_partner_next_steal_atp := l_null_steal_atp;

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

8247:
8248: ELSE
8249: -- same customer
8250: IF PG_DEBUG in ('Y', 'C') THEN
8251: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'same customer ');
8252: END IF;
8253:
8254: IF (l_demand_class_priority_tab(i) >
8255: l_demand_class_priority_tab (i-1)) THEN

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

8255: l_demand_class_priority_tab (i-1)) THEN
8256: -- site level priority changed
8257:
8258: IF PG_DEBUG in ('Y', 'C') THEN
8259: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'site priority changed');
8260: END IF;
8261: l_current_steal_atp := l_next_steal_atp;
8262: l_next_steal_atp := l_null_steal_atp;
8263:

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

8268: END IF; -- IF (i > 1)
8269:
8270: END IF; -- IF l_level_id IN (-1, 1)
8271: IF PG_DEBUG in ('Y', 'C') THEN
8272: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'before we decide we need to do dc consumption');
8273: END IF;
8274:
8275: IF (i > 1) THEN
8276: IF ( -- this is the huge condition

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

8303:
8304: IF l_class_tab(i) <> l_class_tab(1) THEN
8305:
8306: IF PG_DEBUG in ('Y', 'C') THEN
8307: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'before consume l_class_curr_steal_atp');
8308: Print_Period_Qty('l_class_curr_steal_atp.atp_period:atp_qty = ',
8309: l_class_curr_steal_atp);
8310: END IF;
8311:

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

8311:
8312: MSC_AATP_PVT.Atp_Demand_Class_Consume(l_current_atp, l_class_curr_steal_atp);
8313:
8314: IF PG_DEBUG in ('Y', 'C') THEN
8315: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'After consume l_class_curr_steal_atp');
8316: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
8317: l_current_atp);
8318: Print_Period_Qty('l_class_curr_steal_atp.atp_period:atp_qty = ',
8319: l_class_curr_steal_atp);

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

8330: IF (l_class_tab(i) <> l_class_tab(1)) OR
8331: (l_partner_tab(i) <> l_partner_tab(1)) THEN
8332:
8333: IF PG_DEBUG in ('Y', 'C') THEN
8334: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'before consume l_partner_curr_steal_atp');
8335: END IF;
8336: MSC_AATP_PVT.Atp_Demand_Class_Consume(l_current_atp, l_partner_curr_steal_atp);
8337:
8338: IF PG_DEBUG in ('Y', 'C') THEN

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

8335: END IF;
8336: MSC_AATP_PVT.Atp_Demand_Class_Consume(l_current_atp, l_partner_curr_steal_atp);
8337:
8338: IF PG_DEBUG in ('Y', 'C') THEN
8339: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'After consume l_partner_curr_steal_atp');
8340: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
8341: l_current_atp);
8342: Print_Period_Qty('l_partner_curr_steal_atp.atp_period:atp_qty = ',
8343: l_partner_curr_steal_atp);

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

8347:
8348: END IF; -- IF l_level_id IN (2,3)
8349:
8350: IF PG_DEBUG in ('Y', 'C') THEN
8351: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'Before consume current_steal_atp');
8352:
8353: Print_Period_Qty('l_current_steal_atp.atp_period:atp_qty = ',
8354: l_current_steal_atp);
8355:

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

8357:
8358: MSC_AATP_PVT.Atp_Demand_Class_Consume(l_current_atp, l_current_steal_atp);
8359:
8360: IF PG_DEBUG in ('Y', 'C') THEN
8361: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'After consume l_current_steal_atp');
8362:
8363: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
8364: l_current_atp);
8365: Print_Period_Qty('l_current_steal_atp.atp_period:atp_qty = ',

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

8444: -- to add l_steal_atp into l_next_steal_atp if we can not finish
8445: -- the stealing at this priority
8446:
8447: IF PG_DEBUG in ('Y', 'C') THEN
8448: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
8449: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
8450: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',
8451: l_next_steal_atp);
8452:

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

8445: -- the stealing at this priority
8446:
8447: IF PG_DEBUG in ('Y', 'C') THEN
8448: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
8449: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
8450: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',
8451: l_next_steal_atp);
8452:
8453: END IF;

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

8454:
8455: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_steal_atp, l_next_steal_atp);
8456:
8457: IF PG_DEBUG in ('Y', 'C') THEN
8458: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'after Add_to_Next_Steal_Atp');
8459: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',
8460: l_next_steal_atp);
8461: END IF;
8462:

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

8464:
8465: ELSE -- IF l_level_id IN (-1, 1)
8466: -- this is for hierarchy customer level and site level
8467: IF PG_DEBUG in ('Y', 'C') THEN
8468: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
8469: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'i = '||i);
8470: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_class_tab(i) = '||l_class_tab(i));
8471: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_class_tab(i+1) = '||l_class_tab(i+1));
8472: END IF;

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

8465: ELSE -- IF l_level_id IN (-1, 1)
8466: -- this is for hierarchy customer level and site level
8467: IF PG_DEBUG in ('Y', 'C') THEN
8468: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
8469: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'i = '||i);
8470: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_class_tab(i) = '||l_class_tab(i));
8471: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_class_tab(i+1) = '||l_class_tab(i+1));
8472: END IF;
8473: IF (l_class_tab(i) <> l_class_tab(i+1)) THEN

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

8466: -- this is for hierarchy customer level and site level
8467: IF PG_DEBUG in ('Y', 'C') THEN
8468: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
8469: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'i = '||i);
8470: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_class_tab(i) = '||l_class_tab(i));
8471: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_class_tab(i+1) = '||l_class_tab(i+1));
8472: END IF;
8473: IF (l_class_tab(i) <> l_class_tab(i+1)) THEN
8474:

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

8467: IF PG_DEBUG in ('Y', 'C') THEN
8468: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
8469: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'i = '||i);
8470: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_class_tab(i) = '||l_class_tab(i));
8471: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'l_class_tab(i+1) = '||l_class_tab(i+1));
8472: END IF;
8473: IF (l_class_tab(i) <> l_class_tab(i+1)) THEN
8474:
8475: -- class changed. If priority of both classes are not the same,

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

8474:
8475: -- class changed. If priority of both classes are not the same,
8476: -- then we need to change the curr_steal_atp at class level.
8477: IF PG_DEBUG in ('Y', 'C') THEN
8478: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'class changed');
8479: END IF;
8480:
8481: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_steal_atp, l_next_steal_atp);
8482: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_next_steal_atp, l_partner_next_steal_atp);

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

8495:
8496: ELSE
8497:
8498: IF PG_DEBUG in ('Y', 'C') THEN
8499: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'class the same');
8500: END IF;
8501: IF (l_partner_tab(i) <> l_partner_tab(i+1)) THEN
8502: -- customer changed
8503: IF PG_DEBUG in ('Y', 'C') THEN

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

8500: END IF;
8501: IF (l_partner_tab(i) <> l_partner_tab(i+1)) THEN
8502: -- customer changed
8503: IF PG_DEBUG in ('Y', 'C') THEN
8504: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'customer not the same');
8505: END IF;
8506: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_steal_atp, l_next_steal_atp);
8507:
8508: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_next_steal_atp, l_partner_next_steal_atp);

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

8511: trunc(l_demand_class_priority_tab (i+1), -2) THEN
8512: -- customer priority changed
8513:
8514: IF PG_DEBUG in ('Y', 'C') THEN
8515: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'customer priority changed');
8516: END IF;
8517: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_partner_curr_steal_atp,
8518: l_partner_next_steal_atp);
8519:

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

8522:
8523: ELSE
8524: -- same customer
8525: IF PG_DEBUG in ('Y', 'C') THEN
8526: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'customer the same');
8527: END IF;
8528: IF (l_demand_class_priority_tab(i)<>
8529: l_demand_class_priority_tab (i+1)) THEN
8530: -- site level priority changed

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

8537: END IF;
8538:
8539: -- 1665110
8540: IF PG_DEBUG in ('Y', 'C') THEN
8541: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_demand_class = '||p_demand_class);
8542: END IF;
8543: EXIT WHEN (l_demand_class = p_demand_class);
8544: IF PG_DEBUG in ('Y', 'C') THEN
8545: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'after the exit statement, so we did not exit');

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

8541: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'p_demand_class = '||p_demand_class);
8542: END IF;
8543: EXIT WHEN (l_demand_class = p_demand_class);
8544: IF PG_DEBUG in ('Y', 'C') THEN
8545: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'after the exit statement, so we did not exit');
8546: END IF;
8547:
8548: END LOOP;
8549:

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

8549:
8550: MSC_ATP_PROC.Atp_Accumulate(l_current_atp.atp_qty);
8551:
8552: IF PG_DEBUG in ('Y', 'C') THEN
8553: msc_sch_wb.atp_debug('Res_Alloc_Cum_Atp: ' || 'right after the Atp_Accumulate');
8554: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
8555: l_current_atp);
8556: END IF;
8557:

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

8685:
8686: BEGIN
8687:
8688: IF PG_DEBUG in ('Y', 'C') THEN
8689: msc_sch_wb.atp_debug('******* Supplier_Alloc_Cum_Atp *******');
8690: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.instance_id =' || p_sup_atp_info_rec.instance_id);
8691: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.supplier_id =' || p_sup_atp_info_rec.supplier_id);
8692: 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);
8693: 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 8690: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.instance_id =' || p_sup_atp_info_rec.instance_id);

8686: BEGIN
8687:
8688: IF PG_DEBUG in ('Y', 'C') THEN
8689: msc_sch_wb.atp_debug('******* Supplier_Alloc_Cum_Atp *******');
8690: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.instance_id =' || p_sup_atp_info_rec.instance_id);
8691: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.supplier_id =' || p_sup_atp_info_rec.supplier_id);
8692: 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);
8693: 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);
8694: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.organization_id =' || p_sup_atp_info_rec.organization_id);

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

8687:
8688: IF PG_DEBUG in ('Y', 'C') THEN
8689: msc_sch_wb.atp_debug('******* Supplier_Alloc_Cum_Atp *******');
8690: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.instance_id =' || p_sup_atp_info_rec.instance_id);
8691: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.supplier_id =' || p_sup_atp_info_rec.supplier_id);
8692: 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);
8693: 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);
8694: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.organization_id =' || p_sup_atp_info_rec.organization_id);
8695: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.demand_class =' || p_sup_atp_info_rec.demand_class);

Line 8692: 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);

8688: IF PG_DEBUG in ('Y', 'C') THEN
8689: msc_sch_wb.atp_debug('******* Supplier_Alloc_Cum_Atp *******');
8690: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.instance_id =' || p_sup_atp_info_rec.instance_id);
8691: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.supplier_id =' || p_sup_atp_info_rec.supplier_id);
8692: 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);
8693: 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);
8694: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.organization_id =' || p_sup_atp_info_rec.organization_id);
8695: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.demand_class =' || p_sup_atp_info_rec.demand_class);
8696: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );

Line 8693: 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);

8689: msc_sch_wb.atp_debug('******* Supplier_Alloc_Cum_Atp *******');
8690: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.instance_id =' || p_sup_atp_info_rec.instance_id);
8691: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.supplier_id =' || p_sup_atp_info_rec.supplier_id);
8692: 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);
8693: 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);
8694: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.organization_id =' || p_sup_atp_info_rec.organization_id);
8695: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.demand_class =' || p_sup_atp_info_rec.demand_class);
8696: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
8697: 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 8694: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.organization_id =' || p_sup_atp_info_rec.organization_id);

8690: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.instance_id =' || p_sup_atp_info_rec.instance_id);
8691: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.supplier_id =' || p_sup_atp_info_rec.supplier_id);
8692: 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);
8693: 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);
8694: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.organization_id =' || p_sup_atp_info_rec.organization_id);
8695: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.demand_class =' || p_sup_atp_info_rec.demand_class);
8696: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
8697: 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 );
8698: END IF;

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

8691: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.supplier_id =' || p_sup_atp_info_rec.supplier_id);
8692: 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);
8693: 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);
8694: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.organization_id =' || p_sup_atp_info_rec.organization_id);
8695: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.demand_class =' || p_sup_atp_info_rec.demand_class);
8696: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
8697: 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 );
8698: END IF;
8699:

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

8692: 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);
8693: 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);
8694: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.organization_id =' || p_sup_atp_info_rec.organization_id);
8695: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.demand_class =' || p_sup_atp_info_rec.demand_class);
8696: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
8697: 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 );
8698: END IF;
8699:
8700:

Line 8697: 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 );

8693: 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);
8694: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.organization_id =' || p_sup_atp_info_rec.organization_id);
8695: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.demand_class =' || p_sup_atp_info_rec.demand_class);
8696: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_request_date =' || p_request_date );
8697: 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 );
8698: END IF;
8699:
8700:
8701: -- find all the demand classes that we need to take care: all the demand

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

8733: l_org_id := MSC_ATP_PVT.G_PLAN_INFO_REC.organization_id;
8734: l_cutoff_date := MSC_ATP_PVT.G_PLAN_INFO_REC.plan_cutoff_date;
8735:
8736: IF PG_DEBUG in ('Y', 'C') THEN
8737: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_plan_start_date = '||l_plan_start_date);
8738: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_instance_id = '||l_instance_id);
8739: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_org_id = '||l_org_id);
8740: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_cutoff_date = '||l_cutoff_date);
8741: END IF;

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

8734: l_cutoff_date := MSC_ATP_PVT.G_PLAN_INFO_REC.plan_cutoff_date;
8735:
8736: IF PG_DEBUG in ('Y', 'C') THEN
8737: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_plan_start_date = '||l_plan_start_date);
8738: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_instance_id = '||l_instance_id);
8739: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_org_id = '||l_org_id);
8740: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_cutoff_date = '||l_cutoff_date);
8741: END IF;
8742:

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

8735:
8736: IF PG_DEBUG in ('Y', 'C') THEN
8737: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_plan_start_date = '||l_plan_start_date);
8738: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_instance_id = '||l_instance_id);
8739: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_org_id = '||l_org_id);
8740: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_cutoff_date = '||l_cutoff_date);
8741: END IF;
8742:
8743: --s_cto_rearch

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

8736: IF PG_DEBUG in ('Y', 'C') THEN
8737: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_plan_start_date = '||l_plan_start_date);
8738: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_instance_id = '||l_instance_id);
8739: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_org_id = '||l_org_id);
8740: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_cutoff_date = '||l_cutoff_date);
8741: END IF;
8742:
8743: --s_cto_rearch
8744: IF (p_sup_atp_info_rec.bom_item_type = 4 AND (p_sup_atp_info_rec.rep_ord_flag = 'Y'

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

8761: -- the requested demand class
8762:
8763: -- IF l_allocation_percent <> 0.0 THEN
8764: IF PG_DEBUG in ('Y', 'C') THEN
8765: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'before select the high priority demand class');
8766: END IF;
8767:
8768: -- bug 1680719
8769: --bug3948494 Do not select Higher priority DC if the requested DC

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

8770: --is at highest priority , we donot honor for forward consumption method here.
8771: IF l_level_id = -1 AND l_priority <> 1 THEN
8772:
8773: IF PG_DEBUG in ('Y', 'C') THEN
8774: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_allocation_percent = '||l_allocation_percent);
8775: END IF;
8776: SELECT demand_class, priority
8777: BULK COLLECT INTO l_demand_class_tab, l_demand_class_priority_tab
8778: FROM msc_item_hierarchy_mv

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

8787:
8788: ELSIF l_level_id = 1 THEN
8789:
8790: IF PG_DEBUG in ('Y', 'C') THEN
8791: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);
8792: END IF;
8793: SELECT demand_class, priority
8794: BULK COLLECT INTO l_demand_class_tab, l_demand_class_priority_tab
8795: FROM msc_item_hierarchy_mv

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

8805: ELSIF l_level_id = 2 THEN
8806:
8807:
8808: IF PG_DEBUG in ('Y', 'C') THEN
8809: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);
8810: END IF;
8811: SELECT mv1.demand_class, mv1.priority, mv1.class, mv1.partner_id
8812: BULK COLLECT INTO l_demand_class_tab, l_demand_class_priority_tab,
8813: l_class_tab, l_partner_tab

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

8829: -- bug 1680719
8830: -- we need to select the class, partner_id, partner_site_id
8831:
8832: IF PG_DEBUG in ('Y', 'C') THEN
8833: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_level_id = '||l_level_id);
8834: END IF;
8835: SELECT mv1.demand_class, mv1.priority, mv1.class, mv1.partner_id
8836: BULK COLLECT INTO l_demand_class_tab, l_demand_class_priority_tab,
8837: l_class_tab, l_partner_tab

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

8877: mm := l_demand_class_tab.FIRST;
8878:
8879: WHILE mm is not null LOOP
8880: IF PG_DEBUG in ('Y', 'C') THEN
8881: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_demand_class_tab and priority = '||
8882: l_demand_class_tab(mm) ||' : '|| l_demand_class_priority_tab(mm));
8883: END IF;
8884:
8885: IF l_level_id in (2,3) THEN

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

8883: END IF;
8884:
8885: IF l_level_id in (2,3) THEN
8886: IF PG_DEBUG in ('Y', 'C') THEN
8887: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_class_tab and partner = '||
8888: l_class_tab(mm) ||' : '||l_partner_tab(mm));
8889: END IF;
8890: END IF;
8891:

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

8903: --AND inventory_item_id = p_sup_atp_info_rec.inventory_item_id;
8904: AND inventory_item_id = l_inv_item_id;
8905:
8906: IF PG_DEBUG in ('Y', 'C') THEN
8907: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_uom_code and l_postprocessing_lead_time = '||
8908: l_uom_code ||' : '||l_postprocessing_lead_time);
8909: END IF;
8910:
8911: -- for performance reason, we need to get the following info and

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

8939: l_instance_id,
8940: TRUNC(sysdate));
8941:
8942: IF PG_DEBUG in ('Y', 'C') THEN
8943: msc_sch_wb.atp_debug('Sys next Date : '||to_char(l_sys_next_date, 'DD-MON-YYYY'));
8944: END IF;
8945:
8946: IF (l_sys_next_date is NULL) THEN
8947: msc_sch_wb.atp_debug('Sys Next Date is null');

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

8943: msc_sch_wb.atp_debug('Sys next Date : '||to_char(l_sys_next_date, 'DD-MON-YYYY'));
8944: END IF;
8945:
8946: IF (l_sys_next_date is NULL) THEN
8947: msc_sch_wb.atp_debug('Sys Next Date is null');
8948: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.NO_MATCHING_CAL_DATE;
8949: RAISE FND_API.G_EXC_ERROR;
8950: END IF;
8951: --bug3333114 end

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

8944: END IF;
8945:
8946: IF (l_sys_next_date is NULL) THEN
8947: msc_sch_wb.atp_debug('Sys Next Date is null');
8948: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.NO_MATCHING_CAL_DATE;
8949: RAISE FND_API.G_EXC_ERROR;
8950: END IF;
8951: --bug3333114 end
8952:

Line 8954: 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);

8950: END IF;
8951: --bug3333114 end
8952:
8953: IF PG_DEBUG in ('Y', 'C') THEN
8954: 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);
8955: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
8956: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
8957: END IF;
8958: -- ship_rec_cal changes end

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

8951: --bug3333114 end
8952:
8953: IF PG_DEBUG in ('Y', 'C') THEN
8954: 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);
8955: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
8956: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
8957: END IF;
8958: -- ship_rec_cal changes end
8959:

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

8952:
8953: IF PG_DEBUG in ('Y', 'C') THEN
8954: 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);
8955: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_calendar_code='||l_calendar_code);
8956: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
8957: END IF;
8958: -- ship_rec_cal changes end
8959:
8960:

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

8960:
8961: FOR i in 1..l_demand_class_tab.COUNT LOOP
8962: l_demand_class := l_demand_class_tab(i);
8963: IF PG_DEBUG in ('Y', 'C') THEN
8964: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'in i loop, i = '||i);
8965: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_demand_class = '||l_demand_class);
8966: END IF;
8967: --=======================================================================================================
8968: -- ship_rec_cal changes begin

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

8961: FOR i in 1..l_demand_class_tab.COUNT LOOP
8962: l_demand_class := l_demand_class_tab(i);
8963: IF PG_DEBUG in ('Y', 'C') THEN
8964: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'in i loop, i = '||i);
8965: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_demand_class = '||l_demand_class);
8966: END IF;
8967: --=======================================================================================================
8968: -- ship_rec_cal changes begin
8969: --=======================================================================================================

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

9865: -- ship_rec_cal changes end
9866: --=======================================================================================================
9867: -- for period ATP
9868: IF PG_DEBUG in ('Y', 'C') THEN
9869: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'after insert into msc_atp_sd_details_temp');
9870: END IF;
9871: MSC_ATP_PROC.get_period_data_from_SD_temp(x_atp_period);
9872:
9873: l_current_atp.atp_period := x_atp_period.Period_Start_Date;

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

9877:
9878: END IF;
9879:
9880: IF PG_DEBUG in ('Y', 'C') THEN
9881: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'right after the big query');
9882: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
9883: l_current_atp);
9884: END IF;
9885:

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

9886: -- do backward consumption for DCi
9887: MSC_ATP_PROC.Atp_Backward_Consume(l_current_atp.atp_qty);
9888:
9889: IF PG_DEBUG in ('Y', 'C') THEN
9890: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'right after the backward consume');
9891: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
9892: l_current_atp);
9893: END IF;
9894:

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

9945: -- class changed. If priority of both classes are not the same,
9946: -- then we need to change the curr_steal_atp at class level.
9947:
9948: IF PG_DEBUG in ('Y', 'C') THEN
9949: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'class changed');
9950: END IF;
9951:
9952: IF trunc(l_demand_class_priority_tab(i), -3) >
9953: trunc(l_demand_class_priority_tab (i-1), -3) THEN

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

9952: IF trunc(l_demand_class_priority_tab(i), -3) >
9953: trunc(l_demand_class_priority_tab (i-1), -3) THEN
9954:
9955: IF PG_DEBUG in ('Y', 'C') THEN
9956: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'class priority changed');
9957: END IF;
9958: l_class_curr_steal_atp := l_class_next_steal_atp;
9959: l_class_next_steal_atp := l_null_steal_atp;
9960: END IF;

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

9966: l_next_steal_atp := l_null_steal_atp;
9967:
9968: ELSE
9969: IF PG_DEBUG in ('Y', 'C') THEN
9970: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'same class');
9971: END IF;
9972: IF (l_partner_tab(i) <> l_partner_tab(i-1)) THEN
9973: -- customer changed. If priority of both customers are not the
9974: -- same, we need to change the curr_steal_atp at partner level.

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

9973: -- customer changed. If priority of both customers are not the
9974: -- same, we need to change the curr_steal_atp at partner level.
9975:
9976: IF PG_DEBUG in ('Y', 'C') THEN
9977: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'customer changed');
9978: END IF;
9979:
9980: IF trunc(l_demand_class_priority_tab(i), -2) >
9981: trunc(l_demand_class_priority_tab (i-1), -2) THEN

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

9979:
9980: IF trunc(l_demand_class_priority_tab(i), -2) >
9981: trunc(l_demand_class_priority_tab (i-1), -2) THEN
9982: IF PG_DEBUG in ('Y', 'C') THEN
9983: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'customer priority changed');
9984: END IF;
9985:
9986: l_partner_curr_steal_atp := l_partner_next_steal_atp;
9987: l_partner_next_steal_atp := l_null_steal_atp;

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

9993:
9994: ELSE
9995: -- same customer
9996: IF PG_DEBUG in ('Y', 'C') THEN
9997: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'same customer ');
9998: END IF;
9999:
10000: IF (l_demand_class_priority_tab(i) >
10001: l_demand_class_priority_tab (i-1)) THEN

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

10001: l_demand_class_priority_tab (i-1)) THEN
10002: -- site level priority changed
10003:
10004: IF PG_DEBUG in ('Y', 'C') THEN
10005: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'site priority changed');
10006: END IF;
10007: l_current_steal_atp := l_next_steal_atp;
10008: l_next_steal_atp := l_null_steal_atp;
10009:

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

10014: END IF; -- IF (i > 1)
10015:
10016: END IF; -- IF l_level_id IN (-1, 1)
10017: IF PG_DEBUG in ('Y', 'C') THEN
10018: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'before we decide we need to do dc consumption');
10019: END IF;
10020: IF (i > 1) THEN
10021: IF ( -- this is the huge condition
10022: ((l_level_id IN (-1, 1)) AND

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

10047:
10048: IF l_class_tab(i) <> l_class_tab(1) THEN
10049:
10050: IF PG_DEBUG in ('Y', 'C') THEN
10051: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'before consume l_class_curr_steal_atp');
10052: Print_Period_Qty('l_class_curr_steal_atp.atp_period:atp_qty = ',
10053: l_class_curr_steal_atp);
10054: END IF;
10055:

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

10055:
10056: MSC_AATP_PVT.Atp_demand_class_Consume(l_current_atp, l_class_curr_steal_atp);
10057:
10058: IF PG_DEBUG in ('Y', 'C') THEN
10059: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'After consume l_class_curr_steal_atp');
10060: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
10061: l_current_atp);
10062: Print_Period_Qty('l_class_curr_steal_atp.atp_period:atp_qty = ',
10063: l_class_curr_steal_atp);

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

10074: IF (l_class_tab(i) <> l_class_tab(1)) OR
10075: (l_partner_tab(i) <> l_partner_tab(1)) THEN
10076:
10077: IF PG_DEBUG in ('Y', 'C') THEN
10078: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'before consume l_partner_curr_steal_atp');
10079: END IF;
10080: MSC_AATP_PVT.Atp_demand_class_Consume(l_current_atp, l_partner_curr_steal_atp);
10081:
10082: IF PG_DEBUG in ('Y', 'C') THEN

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

10079: END IF;
10080: MSC_AATP_PVT.Atp_demand_class_Consume(l_current_atp, l_partner_curr_steal_atp);
10081:
10082: IF PG_DEBUG in ('Y', 'C') THEN
10083: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'After consume l_partner_curr_steal_atp');
10084: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
10085: l_current_atp);
10086: Print_Period_Qty('l_partner_curr_steal_atp.atp_period:atp_qty = ',
10087: l_partner_curr_steal_atp);

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

10090:
10091: END IF; -- IF l_level_id IN (2,3)
10092:
10093: IF PG_DEBUG in ('Y', 'C') THEN
10094: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'Before consume current_steal_atp');
10095: Print_Period_Qty('l_current_steal_atp.atp_period:atp_qty = ',
10096: l_current_steal_atp);
10097: END IF;
10098:

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

10098:
10099: MSC_AATP_PVT.Atp_demand_class_Consume(l_current_atp, l_current_steal_atp);
10100:
10101: IF PG_DEBUG in ('Y', 'C') THEN
10102: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'After consume l_current_steal_atp');
10103: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
10104: l_current_atp);
10105: Print_Period_Qty('l_current_steal_atp.atp_period:atp_qty = ',
10106: l_current_steal_atp);

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

10188: -- to add l_steal_atp into l_next_steal_atp if we can not finish
10189: -- the stealing at this priority
10190:
10191: IF PG_DEBUG in ('Y', 'C') THEN
10192: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
10193: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
10194: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',
10195: l_next_steal_atp);
10196: END IF;

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

10189: -- the stealing at this priority
10190:
10191: IF PG_DEBUG in ('Y', 'C') THEN
10192: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
10193: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'before Adding Add_to_Next_Steal_Atp');
10194: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',
10195: l_next_steal_atp);
10196: END IF;
10197:

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

10197:
10198: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_steal_atp, l_next_steal_atp);
10199:
10200: IF PG_DEBUG in ('Y', 'C') THEN
10201: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'after Add_to_Next_Steal_Atp');
10202: Print_Period_Qty('l_next_steal_atp.atp_period:atp_qty = ',
10203: l_next_steal_atp);
10204: END IF;
10205:

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

10207:
10208: ELSE -- IF l_level_id IN (-1, 1)
10209: -- this is for hierarchy customer level and site level
10210: IF PG_DEBUG in ('Y', 'C') THEN
10211: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
10212: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'i = '||i);
10213: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_class_tab(i) = '||l_class_tab(i));
10214: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_class_tab(i+1) = '||l_class_tab(i+1));
10215: END IF;

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

10208: ELSE -- IF l_level_id IN (-1, 1)
10209: -- this is for hierarchy customer level and site level
10210: IF PG_DEBUG in ('Y', 'C') THEN
10211: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
10212: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'i = '||i);
10213: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_class_tab(i) = '||l_class_tab(i));
10214: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_class_tab(i+1) = '||l_class_tab(i+1));
10215: END IF;
10216: IF (l_class_tab(i) <> l_class_tab(i+1)) THEN

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

10209: -- this is for hierarchy customer level and site level
10210: IF PG_DEBUG in ('Y', 'C') THEN
10211: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
10212: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'i = '||i);
10213: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_class_tab(i) = '||l_class_tab(i));
10214: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_class_tab(i+1) = '||l_class_tab(i+1));
10215: END IF;
10216: IF (l_class_tab(i) <> l_class_tab(i+1)) THEN
10217:

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

10210: IF PG_DEBUG in ('Y', 'C') THEN
10211: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'level = '||l_level_id);
10212: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'i = '||i);
10213: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_class_tab(i) = '||l_class_tab(i));
10214: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'l_class_tab(i+1) = '||l_class_tab(i+1));
10215: END IF;
10216: IF (l_class_tab(i) <> l_class_tab(i+1)) THEN
10217:
10218: -- class changed. If priority of both classes are not the same,

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

10217:
10218: -- class changed. If priority of both classes are not the same,
10219: -- then we need to change the curr_steal_atp at class level.
10220: IF PG_DEBUG in ('Y', 'C') THEN
10221: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'class changed');
10222: END IF;
10223:
10224: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_steal_atp, l_next_steal_atp);
10225: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_next_steal_atp, l_partner_next_steal_atp);

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

10239:
10240: ELSE
10241:
10242: IF PG_DEBUG in ('Y', 'C') THEN
10243: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'class the same');
10244: END IF;
10245: IF (l_partner_tab(i) <> l_partner_tab(i+1)) THEN
10246: -- customer changed
10247: IF PG_DEBUG in ('Y', 'C') THEN

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

10244: END IF;
10245: IF (l_partner_tab(i) <> l_partner_tab(i+1)) THEN
10246: -- customer changed
10247: IF PG_DEBUG in ('Y', 'C') THEN
10248: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'customer not the same');
10249: END IF;
10250: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_steal_atp, l_next_steal_atp);
10251:
10252: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_next_steal_atp, l_partner_next_steal_atp);

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

10255: trunc(l_demand_class_priority_tab (i+1), -2) THEN
10256: -- customer priority changed
10257:
10258: IF PG_DEBUG in ('Y', 'C') THEN
10259: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'customer priority changed');
10260: END IF;
10261: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_partner_curr_steal_atp,
10262: l_partner_next_steal_atp);
10263:

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

10266:
10267: ELSE
10268: -- same customer
10269: IF PG_DEBUG in ('Y', 'C') THEN
10270: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'customer the same');
10271: END IF;
10272: IF (l_demand_class_priority_tab(i)<>
10273: l_demand_class_priority_tab (i+1)) THEN
10274: -- site level priority changed

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

10281: END IF;
10282:
10283: -- 1665110
10284: IF PG_DEBUG in ('Y', 'C') THEN
10285: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.demand_class = '||p_sup_atp_info_rec.demand_class);
10286: END IF;
10287: EXIT WHEN (l_demand_class = p_sup_atp_info_rec.demand_class);
10288: IF PG_DEBUG in ('Y', 'C') THEN
10289: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'after the exit statement, so we did not exit');

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

10285: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'p_sup_atp_info_rec.demand_class = '||p_sup_atp_info_rec.demand_class);
10286: END IF;
10287: EXIT WHEN (l_demand_class = p_sup_atp_info_rec.demand_class);
10288: IF PG_DEBUG in ('Y', 'C') THEN
10289: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'after the exit statement, so we did not exit');
10290: END IF;
10291:
10292: END LOOP;
10293: MSC_ATP_PROC.Atp_Accumulate(l_current_atp.atp_qty);

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

10292: END LOOP;
10293: MSC_ATP_PROC.Atp_Accumulate(l_current_atp.atp_qty);
10294:
10295: IF PG_DEBUG in ('Y', 'C') THEN
10296: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'right after the Atp_Accumulate');
10297: Print_Period_Qty('l_current_atp.atp_period:atp_qty = ',
10298: l_current_atp);
10299: END IF;
10300:

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

10303: --4055719 , calling remove -ves
10304: MSC_AATP_PROC.Atp_Remove_Negatives(x_atp_period.Cumulative_Quantity, l_return_status);
10305: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
10306: IF PG_DEBUG in ('Y', 'C') THEN
10307: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ' || 'Error occured in procedure Atp_Remove_Negatives');
10308: END IF;
10309: RAISE FND_API.G_EXC_ERROR;
10310: END IF;
10311:

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

10381: l_time_phase NUMBER;
10382:
10383: BEGIN
10384: IF PG_DEBUG in ('Y', 'C') THEN
10385: msc_sch_wb.atp_debug('******** Get_DC_Info ********');
10386: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_instance_id =' || p_instance_id);
10387: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_inv_item_id =' || p_inv_item_id);
10388: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_org_id =' || p_org_id);
10389: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_dept_id =' || p_dept_id);

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

10382:
10383: BEGIN
10384: IF PG_DEBUG in ('Y', 'C') THEN
10385: msc_sch_wb.atp_debug('******** Get_DC_Info ********');
10386: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_instance_id =' || p_instance_id);
10387: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_inv_item_id =' || p_inv_item_id);
10388: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_org_id =' || p_org_id);
10389: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_dept_id =' || p_dept_id);
10390: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_res_id =' || p_res_id);

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

10383: BEGIN
10384: IF PG_DEBUG in ('Y', 'C') THEN
10385: msc_sch_wb.atp_debug('******** Get_DC_Info ********');
10386: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_instance_id =' || p_instance_id);
10387: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_inv_item_id =' || p_inv_item_id);
10388: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_org_id =' || p_org_id);
10389: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_dept_id =' || p_dept_id);
10390: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_res_id =' || p_res_id);
10391: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_demand_class =' || p_demand_class);

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

10384: IF PG_DEBUG in ('Y', 'C') THEN
10385: msc_sch_wb.atp_debug('******** Get_DC_Info ********');
10386: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_instance_id =' || p_instance_id);
10387: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_inv_item_id =' || p_inv_item_id);
10388: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_org_id =' || p_org_id);
10389: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_dept_id =' || p_dept_id);
10390: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_res_id =' || p_res_id);
10391: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_demand_class =' || p_demand_class);
10392: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_request_date =' || p_request_date );

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

10385: msc_sch_wb.atp_debug('******** Get_DC_Info ********');
10386: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_instance_id =' || p_instance_id);
10387: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_inv_item_id =' || p_inv_item_id);
10388: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_org_id =' || p_org_id);
10389: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_dept_id =' || p_dept_id);
10390: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_res_id =' || p_res_id);
10391: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_demand_class =' || p_demand_class);
10392: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_request_date =' || p_request_date );
10393: END IF;

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

10386: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_instance_id =' || p_instance_id);
10387: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_inv_item_id =' || p_inv_item_id);
10388: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_org_id =' || p_org_id);
10389: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_dept_id =' || p_dept_id);
10390: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_res_id =' || p_res_id);
10391: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_demand_class =' || p_demand_class);
10392: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_request_date =' || p_request_date );
10393: END IF;
10394:

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

10387: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_inv_item_id =' || p_inv_item_id);
10388: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_org_id =' || p_org_id);
10389: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_dept_id =' || p_dept_id);
10390: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_res_id =' || p_res_id);
10391: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_demand_class =' || p_demand_class);
10392: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_request_date =' || p_request_date );
10393: END IF;
10394:
10395: -- initialize API return status to success

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

10388: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_org_id =' || p_org_id);
10389: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_dept_id =' || p_dept_id);
10390: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_res_id =' || p_res_id);
10391: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_demand_class =' || p_demand_class);
10392: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'p_request_date =' || p_request_date );
10393: END IF;
10394:
10395: -- initialize API return status to success
10396: x_return_status := FND_API.G_RET_STS_SUCCESS;

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

10461:
10462: END IF;
10463: WHEN OTHERS THEN
10464: IF PG_DEBUG in ('Y', 'C') THEN
10465: msc_sch_wb.atp_debug('Exception in Get_DC_Info');
10466: END IF;
10467:
10468: x_priority := -1;
10469: END;

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

10533: END IF;
10534:
10535: WHEN OTHERS THEN
10536: IF PG_DEBUG in ('Y', 'C') THEN
10537: msc_sch_wb.atp_debug('Exception in Get_DC_Info');
10538: END IF;
10539:
10540: x_priority := -1;
10541: END;

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

10542: END IF;
10543: EXCEPTION
10544: WHEN OTHERS THEN
10545: IF PG_DEBUG in ('Y', 'C') THEN
10546: msc_sch_wb.atp_debug('Get_DC_Info: ' || 'Error code:' || to_char(sqlcode));
10547: END IF;
10548: x_priority := -1;
10549: x_alloc_percent := 0;
10550: x_return_status := FND_API.G_RET_STS_ERROR;

Line 10594: msc_sch_wb.set_session_id(p_session_id);

10590: l_demand_class VARCHAR2(80);
10591: -- Agilent Allocated ATP Based on Planning Details changes End
10592:
10593: BEGIN
10594: msc_sch_wb.set_session_id(p_session_id);
10595: IF PG_DEBUG in ('Y', 'C') THEN
10596: msc_sch_wb.atp_debug('Begin View_Allocation');
10597: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_inventory_item_id = ' ||to_char(p_inventory_item_id));
10598: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_instance_id = ' ||to_char(p_instance_id));

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

10592:
10593: BEGIN
10594: msc_sch_wb.set_session_id(p_session_id);
10595: IF PG_DEBUG in ('Y', 'C') THEN
10596: msc_sch_wb.atp_debug('Begin View_Allocation');
10597: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_inventory_item_id = ' ||to_char(p_inventory_item_id));
10598: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_instance_id = ' ||to_char(p_instance_id));
10599: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_organization_id = ' ||to_char(p_organization_id));
10600: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_department_id = ' ||to_char(p_department_id));

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

10593: BEGIN
10594: msc_sch_wb.set_session_id(p_session_id);
10595: IF PG_DEBUG in ('Y', 'C') THEN
10596: msc_sch_wb.atp_debug('Begin View_Allocation');
10597: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_inventory_item_id = ' ||to_char(p_inventory_item_id));
10598: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_instance_id = ' ||to_char(p_instance_id));
10599: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_organization_id = ' ||to_char(p_organization_id));
10600: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_department_id = ' ||to_char(p_department_id));
10601: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_resource_id = ' ||to_char(p_resource_id));

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

10594: msc_sch_wb.set_session_id(p_session_id);
10595: IF PG_DEBUG in ('Y', 'C') THEN
10596: msc_sch_wb.atp_debug('Begin View_Allocation');
10597: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_inventory_item_id = ' ||to_char(p_inventory_item_id));
10598: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_instance_id = ' ||to_char(p_instance_id));
10599: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_organization_id = ' ||to_char(p_organization_id));
10600: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_department_id = ' ||to_char(p_department_id));
10601: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_resource_id = ' ||to_char(p_resource_id));
10602: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_demand_class = ' ||p_demand_class);

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

10595: IF PG_DEBUG in ('Y', 'C') THEN
10596: msc_sch_wb.atp_debug('Begin View_Allocation');
10597: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_inventory_item_id = ' ||to_char(p_inventory_item_id));
10598: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_instance_id = ' ||to_char(p_instance_id));
10599: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_organization_id = ' ||to_char(p_organization_id));
10600: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_department_id = ' ||to_char(p_department_id));
10601: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_resource_id = ' ||to_char(p_resource_id));
10602: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_demand_class = ' ||p_demand_class);
10603: END IF;

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

10596: msc_sch_wb.atp_debug('Begin View_Allocation');
10597: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_inventory_item_id = ' ||to_char(p_inventory_item_id));
10598: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_instance_id = ' ||to_char(p_instance_id));
10599: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_organization_id = ' ||to_char(p_organization_id));
10600: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_department_id = ' ||to_char(p_department_id));
10601: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_resource_id = ' ||to_char(p_resource_id));
10602: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_demand_class = ' ||p_demand_class);
10603: END IF;
10604:

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

10597: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_inventory_item_id = ' ||to_char(p_inventory_item_id));
10598: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_instance_id = ' ||to_char(p_instance_id));
10599: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_organization_id = ' ||to_char(p_organization_id));
10600: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_department_id = ' ||to_char(p_department_id));
10601: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_resource_id = ' ||to_char(p_resource_id));
10602: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_demand_class = ' ||p_demand_class);
10603: END IF;
10604:
10605: -- Bug 2396523 : krajan : Added debug messages

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

10598: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_instance_id = ' ||to_char(p_instance_id));
10599: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_organization_id = ' ||to_char(p_organization_id));
10600: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_department_id = ' ||to_char(p_department_id));
10601: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_resource_id = ' ||to_char(p_resource_id));
10602: msc_sch_wb.atp_debug('View_Allocation: ' || 'p_demand_class = ' ||p_demand_class);
10603: END IF;
10604:
10605: -- Bug 2396523 : krajan : Added debug messages
10606: IF PG_DEBUG in ('Y', 'C') THEN

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

10603: END IF;
10604:
10605: -- Bug 2396523 : krajan : Added debug messages
10606: IF PG_DEBUG in ('Y', 'C') THEN
10607: msc_sch_wb.atp_debug('View_Allocation: ' || 'P_DEMAND_CLASS ' || p_demand_class);
10608: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_INV_CTP= ' || MSC_ATP_PVT.G_INV_CTP);
10609: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_HIERARCHY_PROFILE = '|| MSC_ATP_PVT.G_HIERARCHY_PROFILE );
10610: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_ALLOCATED_ATP = ' || MSC_ATP_PVT.G_ALLOCATED_ATP );
10611: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_ALLOCATION_METHOD = '|| MSC_ATP_PVT.G_ALLOCATION_METHOD );

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

10604:
10605: -- Bug 2396523 : krajan : Added debug messages
10606: IF PG_DEBUG in ('Y', 'C') THEN
10607: msc_sch_wb.atp_debug('View_Allocation: ' || 'P_DEMAND_CLASS ' || p_demand_class);
10608: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_INV_CTP= ' || MSC_ATP_PVT.G_INV_CTP);
10609: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_HIERARCHY_PROFILE = '|| MSC_ATP_PVT.G_HIERARCHY_PROFILE );
10610: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_ALLOCATED_ATP = ' || MSC_ATP_PVT.G_ALLOCATED_ATP );
10611: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_ALLOCATION_METHOD = '|| MSC_ATP_PVT.G_ALLOCATION_METHOD );
10612: END IF;

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

10605: -- Bug 2396523 : krajan : Added debug messages
10606: IF PG_DEBUG in ('Y', 'C') THEN
10607: msc_sch_wb.atp_debug('View_Allocation: ' || 'P_DEMAND_CLASS ' || p_demand_class);
10608: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_INV_CTP= ' || MSC_ATP_PVT.G_INV_CTP);
10609: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_HIERARCHY_PROFILE = '|| MSC_ATP_PVT.G_HIERARCHY_PROFILE );
10610: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_ALLOCATED_ATP = ' || MSC_ATP_PVT.G_ALLOCATED_ATP );
10611: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_ALLOCATION_METHOD = '|| MSC_ATP_PVT.G_ALLOCATION_METHOD );
10612: END IF;
10613:

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

10606: IF PG_DEBUG in ('Y', 'C') THEN
10607: msc_sch_wb.atp_debug('View_Allocation: ' || 'P_DEMAND_CLASS ' || p_demand_class);
10608: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_INV_CTP= ' || MSC_ATP_PVT.G_INV_CTP);
10609: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_HIERARCHY_PROFILE = '|| MSC_ATP_PVT.G_HIERARCHY_PROFILE );
10610: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_ALLOCATED_ATP = ' || MSC_ATP_PVT.G_ALLOCATED_ATP );
10611: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_ALLOCATION_METHOD = '|| MSC_ATP_PVT.G_ALLOCATION_METHOD );
10612: END IF;
10613:
10614: -- krajan : 2400676

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

10607: msc_sch_wb.atp_debug('View_Allocation: ' || 'P_DEMAND_CLASS ' || p_demand_class);
10608: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_INV_CTP= ' || MSC_ATP_PVT.G_INV_CTP);
10609: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_HIERARCHY_PROFILE = '|| MSC_ATP_PVT.G_HIERARCHY_PROFILE );
10610: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_ALLOCATED_ATP = ' || MSC_ATP_PVT.G_ALLOCATED_ATP );
10611: msc_sch_wb.atp_debug('View_Allocation: ' || 'G_ALLOCATION_METHOD = '|| MSC_ATP_PVT.G_ALLOCATION_METHOD );
10612: END IF;
10613:
10614: -- krajan : 2400676
10615: IF PG_DEBUG in ('Y', 'C') THEN

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

10612: END IF;
10613:
10614: -- krajan : 2400676
10615: IF PG_DEBUG in ('Y', 'C') THEN
10616: msc_sch_wb.atp_debug('View_Allocation: ' || 'Resetting Global Error Code');
10617: END IF;
10618: MSC_SCH_WB.G_ATP_ERROR_CODE := 0;
10619:
10620: -- As part of ship_rec_cal. No need for SQL here. Just call the function straight.

Line 10618: MSC_SCH_WB.G_ATP_ERROR_CODE := 0;

10614: -- krajan : 2400676
10615: IF PG_DEBUG in ('Y', 'C') THEN
10616: msc_sch_wb.atp_debug('View_Allocation: ' || 'Resetting Global Error Code');
10617: END IF;
10618: MSC_SCH_WB.G_ATP_ERROR_CODE := 0;
10619:
10620: -- As part of ship_rec_cal. No need for SQL here. Just call the function straight.
10621: /*
10622: --Get sysdate to later pass on to the procedure.

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

10629:
10630: l_request_date := MSC_CALENDAR.NEXT_WORK_DAY(p_organization_id, p_instance_id, 1, sysdate);
10631:
10632: IF PG_DEBUG in ('Y', 'C') THEN
10633: msc_sch_wb.atp_debug('View_Allocation: ' || 'Request Date : '||to_char(l_request_date, 'DD-MON-YYYY'));
10634: END IF;
10635: -- krajan : 2400676
10636: IF (l_request_date = NULL) THEN
10637: IF PG_DEBUG in ('Y', 'C') THEN

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

10634: END IF;
10635: -- krajan : 2400676
10636: IF (l_request_date = NULL) THEN
10637: IF PG_DEBUG in ('Y', 'C') THEN
10638: msc_sch_wb.atp_debug('View_Allocation: ' || 'Request date is null');
10639: END IF;
10640: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.NO_MATCHING_CAL_DATE;
10641: RAISE FND_API.G_EXC_ERROR;
10642: END IF;

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

10636: IF (l_request_date = NULL) THEN
10637: IF PG_DEBUG in ('Y', 'C') THEN
10638: msc_sch_wb.atp_debug('View_Allocation: ' || 'Request date is null');
10639: END IF;
10640: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.NO_MATCHING_CAL_DATE;
10641: RAISE FND_API.G_EXC_ERROR;
10642: END IF;
10643:
10644: --Check if the request is for Item or Department-Resource.

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

10664: l_assign_set_id := l_plan_info_rec.assignment_set_id;
10665: -- changes for bug 2392456 ends
10666:
10667: IF PG_DEBUG in ('Y', 'C') THEN
10668: msc_sch_wb.atp_debug('View_Allocation: ' || 'Plan Id : '||to_char(l_plan_id));
10669: msc_sch_wb.atp_debug('View_Allocation: ' || 'Assignment Set Id : '||to_char(l_assign_set_id));
10670: END IF;
10671:
10672: -- krajan : 2400676

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

10665: -- changes for bug 2392456 ends
10666:
10667: IF PG_DEBUG in ('Y', 'C') THEN
10668: msc_sch_wb.atp_debug('View_Allocation: ' || 'Plan Id : '||to_char(l_plan_id));
10669: msc_sch_wb.atp_debug('View_Allocation: ' || 'Assignment Set Id : '||to_char(l_assign_set_id));
10670: END IF;
10671:
10672: -- krajan : 2400676
10673: IF (l_plan_id IS NULL) OR (l_plan_id = -1) THEN

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

10671:
10672: -- krajan : 2400676
10673: IF (l_plan_id IS NULL) OR (l_plan_id = -1) THEN
10674: IF PG_DEBUG in ('Y', 'C') THEN
10675: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Plan_ID is null or -1');
10676: END IF;
10677: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.PLAN_NOT_FOUND;
10678: RAISE FND_API.G_EXC_ERROR;
10679: END IF;

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

10673: IF (l_plan_id IS NULL) OR (l_plan_id = -1) THEN
10674: IF PG_DEBUG in ('Y', 'C') THEN
10675: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Plan_ID is null or -1');
10676: END IF;
10677: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.PLAN_NOT_FOUND;
10678: RAISE FND_API.G_EXC_ERROR;
10679: END IF;
10680:
10681: IF (l_plan_id = -100) THEN

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

10679: END IF;
10680:
10681: IF (l_plan_id = -100) THEN
10682: IF PG_DEBUG in ('Y', 'C') THEN
10683: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Plan_ID is -100 : Summary Running');
10684: END IF;
10685: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.SUMM_CONC_PROG_RUNNING;
10686: RAISE FND_API.G_EXC_ERROR;
10687: END IF;

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

10681: IF (l_plan_id = -100) THEN
10682: IF PG_DEBUG in ('Y', 'C') THEN
10683: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Plan_ID is -100 : Summary Running');
10684: END IF;
10685: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.SUMM_CONC_PROG_RUNNING;
10686: RAISE FND_API.G_EXC_ERROR;
10687: END IF;
10688:
10689: IF (l_plan_id = -200) THEN

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

10687: END IF;
10688:
10689: IF (l_plan_id = -200) THEN
10690: IF PG_DEBUG in ('Y', 'C') THEN
10691: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Plan_ID is -200 : Summary Running');
10692: END IF;
10693: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.RUN_POST_PLAN_ALLOC;
10694: RAISE FND_API.G_EXC_ERROR;
10695: END IF;

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

10689: IF (l_plan_id = -200) THEN
10690: IF PG_DEBUG in ('Y', 'C') THEN
10691: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Plan_ID is -200 : Summary Running');
10692: END IF;
10693: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.RUN_POST_PLAN_ALLOC;
10694: RAISE FND_API.G_EXC_ERROR;
10695: END IF;
10696:
10697:

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

10738: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
10739: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN
10740:
10741: IF PG_DEBUG in ('Y', 'C') THEN
10742: msc_sch_wb.atp_debug('View_Allocation: before '||
10743: 'calling Item_Pre_Allocated_Atp for Totals');
10744: END IF;
10745: -- Set demand_class to NULL to obtain totals.
10746:

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

10781: (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND
10782: (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN
10783:
10784: IF PG_DEBUG in ('Y', 'C') THEN
10785: msc_sch_wb.atp_debug('View_Allocation: before calling '||
10786: 'Get_Hierarchy_Demand_Class for Demand Class');
10787: END IF;
10788: -- Code for Get_Hierarchy_Demand_Class
10789:

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

10890: mdr.resource_id, mdr.department_id;--, desig.demand_class;
10891: EXCEPTION
10892: WHEN NO_DATA_FOUND THEN
10893: IF PG_DEBUG in ('Y', 'C') THEN
10894: msc_sch_wb.atp_debug('View_Allocation: ' || 'Plan not found ');
10895: END IF;
10896: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.PLAN_NOT_FOUND;
10897: RAISE FND_API.G_EXC_ERROR;
10898: WHEN others THEN

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

10892: WHEN NO_DATA_FOUND THEN
10893: IF PG_DEBUG in ('Y', 'C') THEN
10894: msc_sch_wb.atp_debug('View_Allocation: ' || 'Plan not found ');
10895: END IF;
10896: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.PLAN_NOT_FOUND;
10897: RAISE FND_API.G_EXC_ERROR;
10898: WHEN others THEN
10899: IF PG_DEBUG in ('Y', 'C') THEN
10900: msc_sch_wb.atp_debug('View_Allocation: ' || 'Error getting plan id :'||sqlcode);

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

10896: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.PLAN_NOT_FOUND;
10897: RAISE FND_API.G_EXC_ERROR;
10898: WHEN others THEN
10899: IF PG_DEBUG in ('Y', 'C') THEN
10900: msc_sch_wb.atp_debug('View_Allocation: ' || 'Error getting plan id :'||sqlcode);
10901: END IF;
10902: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;
10903: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
10904: END;

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

10898: WHEN others THEN
10899: IF PG_DEBUG in ('Y', 'C') THEN
10900: msc_sch_wb.atp_debug('View_Allocation: ' || 'Error getting plan id :'||sqlcode);
10901: END IF;
10902: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;
10903: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
10904: END;
10905:
10906: IF PG_DEBUG in ('Y', 'C') THEN

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

10903: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
10904: END;
10905:
10906: IF PG_DEBUG in ('Y', 'C') THEN
10907: msc_sch_wb.atp_debug('View_Allocation: ' || 'Plan Id : '||to_char(l_plan_id));
10908: END IF;
10909:
10910: --Call Res_Alloc_Cum_Atp to get the period ATP info
10911: --for the department/resource. Set insert_flag = 1, for period atp details.

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

10926: l_batchable_flag := 0;
10927: l_max_capacity := 0;
10928: END;
10929: IF PG_DEBUG in ('Y', 'C') THEN
10930: msc_sch_wb.atp_debug('View_Allocation: ' || 'Convert res_item UOM');
10931: END IF;
10932: IF (l_batchable_flag = 1) THEN
10933: BEGIN
10934: SELECT conversion_rate

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

10943: END;
10944:
10945: END IF;
10946: IF PG_DEBUG in ('Y', 'C') THEN
10947: msc_sch_wb.atp_debug('View_Allocation: ' || 'l_res_conversion_rate := ' || l_res_conversion_rate);
10948: END IF;
10949:
10950: -- Agilent Allocated ATP Based on Planning Details changes Begin
10951:

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

11021:
11022: END IF;
11023:
11024: IF PG_DEBUG in ('Y', 'C') THEN
11025: msc_sch_wb.atp_debug('Supplier_Alloc_Cum_Atp: ');
11026: Print_Period_Qty('l_atp_info.atp_period:atp_qty = ',
11027: l_atp_info);
11028: END IF;
11029:

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

11029:
11030: -- krajan : 2400676
11031: IF (l_atp_period.period_quantity.COUNT = 0) THEN
11032: -- rajjain bug 2951786 05/13/2003
11033: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.NO_SUPPLY_DEMAND;
11034: -- MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;
11035: IF PG_DEBUG in ('Y', 'C') THEN
11036: msc_sch_wb.atp_debug ('View_Allocation: ' || 'l_atp_period is NULL');
11037: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Error Code: ' || MSC_SCH_WB.G_ATP_ERROR_CODE);

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

11030: -- krajan : 2400676
11031: IF (l_atp_period.period_quantity.COUNT = 0) THEN
11032: -- rajjain bug 2951786 05/13/2003
11033: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.NO_SUPPLY_DEMAND;
11034: -- MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;
11035: IF PG_DEBUG in ('Y', 'C') THEN
11036: msc_sch_wb.atp_debug ('View_Allocation: ' || 'l_atp_period is NULL');
11037: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Error Code: ' || MSC_SCH_WB.G_ATP_ERROR_CODE);
11038: END IF;

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

11032: -- rajjain bug 2951786 05/13/2003
11033: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.NO_SUPPLY_DEMAND;
11034: -- MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;
11035: IF PG_DEBUG in ('Y', 'C') THEN
11036: msc_sch_wb.atp_debug ('View_Allocation: ' || 'l_atp_period is NULL');
11037: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Error Code: ' || MSC_SCH_WB.G_ATP_ERROR_CODE);
11038: END IF;
11039: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
11040: END IF;

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

11033: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.NO_SUPPLY_DEMAND;
11034: -- MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;
11035: IF PG_DEBUG in ('Y', 'C') THEN
11036: msc_sch_wb.atp_debug ('View_Allocation: ' || 'l_atp_period is NULL');
11037: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Error Code: ' || MSC_SCH_WB.G_ATP_ERROR_CODE);
11038: END IF;
11039: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
11040: END IF;
11041:

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

11042: IF PG_DEBUG in ('Y', 'C') THEN
11043: mm := l_atp_period.Period_Quantity.FIRST;
11044:
11045: WHILE mm is not null LOOP
11046: msc_sch_wb.atp_debug('View_Allocation: ' || 'l_atp_period.period_start_date and Period_Quantity = '||
11047: l_atp_period.period_start_date(mm) ||' : '|| l_atp_period.Period_Quantity(mm));
11048: mm := l_atp_period.Period_Quantity.Next(mm);
11049: END LOOP;
11050: END IF;

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

11069: l_msg_count);
11070:
11071: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
11072: IF PG_DEBUG in ('Y', 'C') THEN
11073: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Something wrong in call to PUT_INTO_TEMP_TABLE');
11074: END IF;
11075: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;
11076: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
11077: END IF;*/

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

11071: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
11072: IF PG_DEBUG in ('Y', 'C') THEN
11073: msc_sch_wb.atp_debug ('View_Allocation: ' || 'Something wrong in call to PUT_INTO_TEMP_TABLE');
11074: END IF;
11075: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;
11076: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
11077: END IF;*/
11078:
11079: -- rajjain 01/29/2003 begin Bug 2737596

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

11077: END IF;*/
11078:
11079: -- rajjain 01/29/2003 begin Bug 2737596
11080: IF PG_DEBUG in ('Y', 'C') THEN
11081: msc_sch_wb.atp_debug('View_Allocation: ' || 'l_atp_supply_demand.level.COUNT: ' || l_atp_supply_demand.level.COUNT);
11082: END IF;
11083:
11084: MSC_ATP_UTILS.PUT_SD_DATA(l_atp_supply_demand, NULL, p_session_id);
11085:

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

11083:
11084: MSC_ATP_UTILS.PUT_SD_DATA(l_atp_supply_demand, NULL, p_session_id);
11085:
11086: IF PG_DEBUG in ('Y', 'C') THEN
11087: msc_sch_wb.atp_debug('View_Allocation: ' || ' Inserted supply demand records ');
11088: END IF;
11089:
11090: IF PG_DEBUG in ('Y', 'C') THEN
11091: msc_sch_wb.atp_debug('View_Allocation: ' || 'l_atp_period.level.count: ' || l_atp_period.level.count);

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

11087: msc_sch_wb.atp_debug('View_Allocation: ' || ' Inserted supply demand records ');
11088: END IF;
11089:
11090: IF PG_DEBUG in ('Y', 'C') THEN
11091: msc_sch_wb.atp_debug('View_Allocation: ' || 'l_atp_period.level.count: ' || l_atp_period.level.count);
11092: END IF;
11093:
11094: MSC_ATP_UTILS.PUT_PERIOD_DATA(l_atp_period, NULL, p_session_id);
11095:

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

11093:
11094: MSC_ATP_UTILS.PUT_PERIOD_DATA(l_atp_period, NULL, p_session_id);
11095:
11096: IF PG_DEBUG in ('Y', 'C') THEN
11097: msc_sch_wb.atp_debug('View_Allocation: ' || ' Inserted period records ');
11098: END IF;
11099: -- rajjain 01/29/2003 end Bug 2737596
11100:
11101: -- krajan : 2400614

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

11103:
11104: WHEN FND_API.G_EXC_ERROR THEN
11105: -- ATP ERROR CODE WILL BE SET before this exception is raised
11106: IF PG_DEBUG in ('Y', 'C') THEN
11107: msc_sch_wb.atp_debug ('Error in View_Allocation: Expected Error Raised');
11108: END IF;
11109: x_return_status := FND_API.G_RET_STS_ERROR;
11110: IF (MSC_SCH_WB.G_ATP_ERROR_CODE = 0) THEN
11111: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;

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

11106: IF PG_DEBUG in ('Y', 'C') THEN
11107: msc_sch_wb.atp_debug ('Error in View_Allocation: Expected Error Raised');
11108: END IF;
11109: x_return_status := FND_API.G_RET_STS_ERROR;
11110: IF (MSC_SCH_WB.G_ATP_ERROR_CODE = 0) THEN
11111: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;
11112: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
11113: END IF;
11114:

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

11107: msc_sch_wb.atp_debug ('Error in View_Allocation: Expected Error Raised');
11108: END IF;
11109: x_return_status := FND_API.G_RET_STS_ERROR;
11110: IF (MSC_SCH_WB.G_ATP_ERROR_CODE = 0) THEN
11111: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;
11112: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
11113: END IF;
11114:
11115: WHEN MSC_ATP_PUB.ATP_INVALID_OBJECTS_FOUND THEN

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

11113: END IF;
11114:
11115: WHEN MSC_ATP_PUB.ATP_INVALID_OBJECTS_FOUND THEN
11116: IF PG_DEBUG in ('Y', 'C') THEN
11117: msc_sch_wb.atp_debug ('Error in View_Allocation: Invalid Objects Found');
11118: END IF;
11119: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_INVALID_OBJECTS;
11120: x_return_status := FND_API.G_RET_STS_ERROR;
11121:

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

11115: WHEN MSC_ATP_PUB.ATP_INVALID_OBJECTS_FOUND THEN
11116: IF PG_DEBUG in ('Y', 'C') THEN
11117: msc_sch_wb.atp_debug ('Error in View_Allocation: Invalid Objects Found');
11118: END IF;
11119: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_INVALID_OBJECTS;
11120: x_return_status := FND_API.G_RET_STS_ERROR;
11121:
11122: WHEN OTHERS THEN
11123: IF PG_DEBUG in ('Y', 'C') THEN

Line 11124: msc_sch_wb.atp_debug ('Error in View_Allocation');

11120: x_return_status := FND_API.G_RET_STS_ERROR;
11121:
11122: WHEN OTHERS THEN
11123: IF PG_DEBUG in ('Y', 'C') THEN
11124: msc_sch_wb.atp_debug ('Error in View_Allocation');
11125: END IF;
11126: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
11127: IF (MSC_SCH_WB.G_ATP_ERROR_CODE = 0) THEN
11128: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;

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

11123: IF PG_DEBUG in ('Y', 'C') THEN
11124: msc_sch_wb.atp_debug ('Error in View_Allocation');
11125: END IF;
11126: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
11127: IF (MSC_SCH_WB.G_ATP_ERROR_CODE = 0) THEN
11128: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;
11129: END IF;
11130:
11131: END View_allocation;

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

11124: msc_sch_wb.atp_debug ('Error in View_Allocation');
11125: END IF;
11126: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
11127: IF (MSC_SCH_WB.G_ATP_ERROR_CODE = 0) THEN
11128: MSC_SCH_WB.G_ATP_ERROR_CODE := MSC_ATP_PVT.ATP_PROCESSING_ERROR;
11129: END IF;
11130:
11131: END View_allocation;
11132:

Line 11208: msc_sch_wb.atp_debug('********* Begin Stealing ************');

11204: -- Keep decrementing the net_demand and exit if it is <= 0
11205: -- If the net_demand is still > 0, pass that back to the calling routing
11206:
11207: IF PG_DEBUG in ('Y', 'C') THEN
11208: msc_sch_wb.atp_debug('********* Begin Stealing ************');
11209: END IF;
11210:
11211: /* time_phased_atp changes begin
11212: initialize variables*/

Line 11222: msc_sch_wb.atp_debug('Stealing: ' || 'Time Phased ATP = ' || l_time_phased_atp);

11218: l_time_phased_atp := 'Y';
11219: l_process_item_id := p_atp_record.request_item_id;
11220: l_pf_item_id := MSC_ATP_PVT.G_ITEM_INFO_REC.product_family_id;
11221: IF PG_DEBUG in ('Y', 'C') THEN
11222: msc_sch_wb.atp_debug('Stealing: ' || 'Time Phased ATP = ' || l_time_phased_atp);
11223: msc_sch_wb.atp_debug('Stealing: ' || 'ATF Date = ' || p_atp_record.atf_date);
11224: msc_sch_wb.atp_debug('Stealing: ' || 'l_pf_item_id = ' || l_pf_item_id);
11225: END IF;
11226: ELSE

Line 11223: msc_sch_wb.atp_debug('Stealing: ' || 'ATF Date = ' || p_atp_record.atf_date);

11219: l_process_item_id := p_atp_record.request_item_id;
11220: l_pf_item_id := MSC_ATP_PVT.G_ITEM_INFO_REC.product_family_id;
11221: IF PG_DEBUG in ('Y', 'C') THEN
11222: msc_sch_wb.atp_debug('Stealing: ' || 'Time Phased ATP = ' || l_time_phased_atp);
11223: msc_sch_wb.atp_debug('Stealing: ' || 'ATF Date = ' || p_atp_record.atf_date);
11224: msc_sch_wb.atp_debug('Stealing: ' || 'l_pf_item_id = ' || l_pf_item_id);
11225: END IF;
11226: ELSE
11227: l_process_item_id := p_atp_record.inventory_item_id;

Line 11224: msc_sch_wb.atp_debug('Stealing: ' || 'l_pf_item_id = ' || l_pf_item_id);

11220: l_pf_item_id := MSC_ATP_PVT.G_ITEM_INFO_REC.product_family_id;
11221: IF PG_DEBUG in ('Y', 'C') THEN
11222: msc_sch_wb.atp_debug('Stealing: ' || 'Time Phased ATP = ' || l_time_phased_atp);
11223: msc_sch_wb.atp_debug('Stealing: ' || 'ATF Date = ' || p_atp_record.atf_date);
11224: msc_sch_wb.atp_debug('Stealing: ' || 'l_pf_item_id = ' || l_pf_item_id);
11225: END IF;
11226: ELSE
11227: l_process_item_id := p_atp_record.inventory_item_id;
11228: END IF;

Line 11265: msc_sch_wb.atp_debug('ATP_Check: ' || 'p_atp_record.requested_ship_date = '||p_atp_record.requested_ship_date);

11261: ELSE
11262: l_item_to_use := l_inv_item_id;
11263: END IF;
11264: IF PG_DEBUG in ('Y', 'C') THEN
11265: msc_sch_wb.atp_debug('ATP_Check: ' || 'p_atp_record.requested_ship_date = '||p_atp_record.requested_ship_date);
11266: msc_sch_wb.atp_debug('ATP_Check: ' || 'Item to be used = '||l_item_to_use);
11267: END IF;
11268: /* New allocation logic for time_phased_atp changes end */
11269:

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

11262: l_item_to_use := l_inv_item_id;
11263: END IF;
11264: IF PG_DEBUG in ('Y', 'C') THEN
11265: msc_sch_wb.atp_debug('ATP_Check: ' || 'p_atp_record.requested_ship_date = '||p_atp_record.requested_ship_date);
11266: msc_sch_wb.atp_debug('ATP_Check: ' || 'Item to be used = '||l_item_to_use);
11267: END IF;
11268: /* New allocation logic for time_phased_atp changes end */
11269:
11270: BEGIN

Line 11305: msc_sch_wb.atp_debug('Stealing: ' || 'No Data found ');

11301:
11302: EXCEPTION
11303: WHEN NO_DATA_FOUND THEN
11304: IF PG_DEBUG in ('Y', 'C') THEN
11305: msc_sch_wb.atp_debug('Stealing: ' || 'No Data found ');
11306: END IF;
11307: l_priority := NULL;
11308: l_level_id := NULL;
11309: l_partner_id := NULL;

Line 11314: msc_sch_wb.atp_debug('Stealing: ' || 'l_priority = '||l_priority);

11310: l_class := NULL;
11311: END ;
11312:
11313: IF PG_DEBUG in ('Y', 'C') THEN
11314: msc_sch_wb.atp_debug('Stealing: ' || 'l_priority = '||l_priority);
11315: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);
11316: msc_sch_wb.atp_debug('Stealing: ' || 'l_partner_id = '||l_partner_id);
11317: msc_sch_wb.atp_debug('Stealing: ' || 'l_class = '||l_class);
11318: msc_sch_wb.atp_debug('Stealing: ' || 'before finding the lower priority dc ');

Line 11315: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);

11311: END ;
11312:
11313: IF PG_DEBUG in ('Y', 'C') THEN
11314: msc_sch_wb.atp_debug('Stealing: ' || 'l_priority = '||l_priority);
11315: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);
11316: msc_sch_wb.atp_debug('Stealing: ' || 'l_partner_id = '||l_partner_id);
11317: msc_sch_wb.atp_debug('Stealing: ' || 'l_class = '||l_class);
11318: msc_sch_wb.atp_debug('Stealing: ' || 'before finding the lower priority dc ');
11319: END IF;

Line 11316: msc_sch_wb.atp_debug('Stealing: ' || 'l_partner_id = '||l_partner_id);

11312:
11313: IF PG_DEBUG in ('Y', 'C') THEN
11314: msc_sch_wb.atp_debug('Stealing: ' || 'l_priority = '||l_priority);
11315: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);
11316: msc_sch_wb.atp_debug('Stealing: ' || 'l_partner_id = '||l_partner_id);
11317: msc_sch_wb.atp_debug('Stealing: ' || 'l_class = '||l_class);
11318: msc_sch_wb.atp_debug('Stealing: ' || 'before finding the lower priority dc ');
11319: END IF;
11320:

Line 11317: msc_sch_wb.atp_debug('Stealing: ' || 'l_class = '||l_class);

11313: IF PG_DEBUG in ('Y', 'C') THEN
11314: msc_sch_wb.atp_debug('Stealing: ' || 'l_priority = '||l_priority);
11315: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);
11316: msc_sch_wb.atp_debug('Stealing: ' || 'l_partner_id = '||l_partner_id);
11317: msc_sch_wb.atp_debug('Stealing: ' || 'l_class = '||l_class);
11318: msc_sch_wb.atp_debug('Stealing: ' || 'before finding the lower priority dc ');
11319: END IF;
11320:
11321: IF l_level_id = -1 THEN

Line 11318: msc_sch_wb.atp_debug('Stealing: ' || 'before finding the lower priority dc ');

11314: msc_sch_wb.atp_debug('Stealing: ' || 'l_priority = '||l_priority);
11315: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);
11316: msc_sch_wb.atp_debug('Stealing: ' || 'l_partner_id = '||l_partner_id);
11317: msc_sch_wb.atp_debug('Stealing: ' || 'l_class = '||l_class);
11318: msc_sch_wb.atp_debug('Stealing: ' || 'before finding the lower priority dc ');
11319: END IF;
11320:
11321: IF l_level_id = -1 THEN
11322: IF PG_DEBUG in ('Y', 'C') THEN

Line 11323: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);

11319: END IF;
11320:
11321: IF l_level_id = -1 THEN
11322: IF PG_DEBUG in ('Y', 'C') THEN
11323: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);
11324: END IF;
11325:
11326: SELECT mv.demand_class, mv.priority, mv.allocation_percent
11327: BULK COLLECT INTO l_demand_class_tab_new, l_dmd_class_priority_tab_new, l_allocation_percent_tab --6359986

Line 11340: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);

11336: ORDER BY mv.priority asc , mv.allocation_percent desc ;
11337:
11338: ELSIF l_level_id = 1 THEN
11339: IF PG_DEBUG in ('Y', 'C') THEN
11340: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);
11341: END IF;
11342:
11343: SELECT mv.demand_class, mv.priority, mv.allocation_percent
11344: BULK COLLECT INTO l_demand_class_tab_new, l_dmd_class_priority_tab_new, l_allocation_percent_tab --6359986

Line 11358: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);

11354:
11355: ELSIF l_level_id = 2 THEN
11356:
11357: IF PG_DEBUG in ('Y', 'C') THEN
11358: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);
11359: END IF;
11360: SELECT mv1.demand_class, mv1.priority, mv1.allocation_percent
11361: BULK COLLECT INTO l_demand_class_tab_new, l_dmd_class_priority_tab_new,l_allocation_percent_tab --6359986
11362: FROM msc_item_hierarchy_mv mv1

Line 11379: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);

11375:
11376: ELSIF l_level_id = 3 THEN
11377:
11378: IF PG_DEBUG in ('Y', 'C') THEN
11379: msc_sch_wb.atp_debug('Stealing: ' || 'l_level_id = '||l_level_id);
11380: END IF;
11381: SELECT mv1.demand_class, mv1.priority, mv1.allocation_percent
11382: BULK COLLECT INTO l_demand_class_tab_new, l_dmd_class_priority_tab_new,l_allocation_percent_tab --6359986
11383: FROM msc_item_hierarchy_mv mv1

Line 11404: msc_sch_wb.atp_debug('Stealing: ' || 'l_demand_class_tab_new.count = '||l_demand_class_tab_new.count);--6359986

11400:
11401: END IF;
11402:
11403: IF PG_DEBUG in ('Y', 'C') THEN
11404: msc_sch_wb.atp_debug('Stealing: ' || 'l_demand_class_tab_new.count = '||l_demand_class_tab_new.count);--6359986
11405: END IF;
11406: --diag_atp
11407: l_get_mat_in_rec.rounding_control_flag := MSC_ATP_PVT.G_ITEM_INFO_REC.rounding_control_type;
11408: l_get_mat_in_rec.dest_inv_item_id := l_inv_item_id;

Line 11444: msc_sch_wb.atp_debug('Stealing: ' || 'Inside the loop of demand class');

11440:
11441: FOR i in 1..l_demand_class_tab.COUNT LOOP
11442: l_demand_class := l_demand_class_tab(i);
11443: IF PG_DEBUG in ('Y', 'C') THEN
11444: msc_sch_wb.atp_debug('Stealing: ' || 'Inside the loop of demand class');
11445: msc_sch_wb.atp_debug('Stealing: ' || 'l_demand_class'||l_demand_class);
11446: END IF;
11447:
11448: -- time_phased_atp changes begin

Line 11445: msc_sch_wb.atp_debug('Stealing: ' || 'l_demand_class'||l_demand_class);

11441: FOR i in 1..l_demand_class_tab.COUNT LOOP
11442: l_demand_class := l_demand_class_tab(i);
11443: IF PG_DEBUG in ('Y', 'C') THEN
11444: msc_sch_wb.atp_debug('Stealing: ' || 'Inside the loop of demand class');
11445: msc_sch_wb.atp_debug('Stealing: ' || 'l_demand_class'||l_demand_class);
11446: END IF;
11447:
11448: -- time_phased_atp changes begin
11449: l_mat_atp_info_rec.instance_id := p_atp_record.instance_id;

Line 11488: msc_sch_wb.atp_debug('Back in Stealing');

11484: l_get_mat_out_rec.infinite_time_fence_date := l_mat_atp_info_rec.infinite_time_fence_date;
11485: p_atp_record.requested_date_quantity := l_mat_atp_info_rec.requested_date_quantity;
11486:
11487: IF PG_DEBUG in ('Y', 'C') THEN
11488: msc_sch_wb.atp_debug('Back in Stealing');
11489: END IF;
11490: -- time_phased_atp changes end
11491:
11492: -- 1430561: move the p_net_demand calculation to the end so that

Line 11497: msc_sch_wb.atp_debug('Stealing: ' || 'p_net_demand = '||to_char(p_net_demand));

11493: -- we insert the right demand quantity
11494: -- p_net_demand := (p_net_demand - greatest(l_requested_date_quantity, 0)) ;
11495:
11496: IF PG_DEBUG in ('Y', 'C') THEN
11497: msc_sch_wb.atp_debug('Stealing: ' || 'p_net_demand = '||to_char(p_net_demand));
11498: END IF;
11499: -- if we don't have atp for this demand class , don't bother
11500: -- generate pegging tree, demand record.
11501:

Line 11503: msc_sch_wb.atp_debug('Stealing: ' || 'p_atp_record.requested_date_quantity = '||

11499: -- if we don't have atp for this demand class , don't bother
11500: -- generate pegging tree, demand record.
11501:
11502: IF PG_DEBUG in ('Y', 'C') THEN
11503: msc_sch_wb.atp_debug('Stealing: ' || 'p_atp_record.requested_date_quantity = '||
11504: p_atp_record.requested_date_quantity);
11505: END IF;
11506:
11507: IF p_atp_record.requested_date_quantity > 0 THEN

Line 11585: msc_sch_wb.atp_debug('Stealing: ' || 'Error occured in procedure Add_PF_Stealing_Supply_Details');

11581: p_atp_record.order_number,
11582: l_return_status);
11583: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
11584: IF PG_DEBUG in ('Y', 'C') THEN
11585: msc_sch_wb.atp_debug('Stealing: ' || 'Error occured in procedure Add_PF_Stealing_Supply_Details');
11586: END IF;
11587: RAISE FND_API.G_EXC_ERROR;
11588: END IF;
11589: END IF;

Line 11593: msc_sch_wb.atp_debug('Stealing Supply Id : ' || l_demand_id);

11589: END IF;
11590: -- time_phased_atp changes end
11591:
11592: IF PG_DEBUG in ('Y', 'C') THEN
11593: msc_sch_wb.atp_debug('Stealing Supply Id : ' || l_demand_id);
11594: END IF;
11595:
11596: ELSIF l_time_phased_atp = 'Y' THEN
11597: IF p_atp_record.requested_ship_date <= p_atp_record.atf_date THEN

Line 11611: msc_sch_wb.atp_debug('Stealing: l_mem_stealing_qty = ' || l_mem_stealing_qty);

11607: l_mem_stealing_qty := LEAST(NVL(l_atf_date_qty, 0), (p_net_demand - l_pf_stealing_qty));
11608: END IF;
11609: END IF;
11610: IF PG_DEBUG in ('Y', 'C') THEN
11611: msc_sch_wb.atp_debug('Stealing: l_mem_stealing_qty = ' || l_mem_stealing_qty);
11612: msc_sch_wb.atp_debug('Stealing: l_pf_stealing_qty = ' || l_pf_stealing_qty);
11613: END IF;
11614: END IF;
11615:

Line 11612: msc_sch_wb.atp_debug('Stealing: l_pf_stealing_qty = ' || l_pf_stealing_qty);

11608: END IF;
11609: END IF;
11610: IF PG_DEBUG in ('Y', 'C') THEN
11611: msc_sch_wb.atp_debug('Stealing: l_mem_stealing_qty = ' || l_mem_stealing_qty);
11612: msc_sch_wb.atp_debug('Stealing: l_pf_stealing_qty = ' || l_pf_stealing_qty);
11613: END IF;
11614: END IF;
11615:
11616: x_total_mem_stealing_qty := x_total_mem_stealing_qty + l_mem_stealing_qty;

Line 11619: msc_sch_wb.atp_debug('Stealing: x_total_mem_stealing_qty = ' || x_total_mem_stealing_qty);

11615:
11616: x_total_mem_stealing_qty := x_total_mem_stealing_qty + l_mem_stealing_qty;
11617: x_total_pf_stealing_qty := x_total_pf_stealing_qty + l_pf_stealing_qty;
11618: IF PG_DEBUG in ('Y', 'C') THEN
11619: msc_sch_wb.atp_debug('Stealing: x_total_mem_stealing_qty = ' || x_total_mem_stealing_qty);
11620: msc_sch_wb.atp_debug('Stealing: x_total_pf_stealing_qty = ' || x_total_pf_stealing_qty);
11621: END IF;
11622: -- time_phased_atp changes end
11623:

Line 11620: msc_sch_wb.atp_debug('Stealing: x_total_pf_stealing_qty = ' || x_total_pf_stealing_qty);

11616: x_total_mem_stealing_qty := x_total_mem_stealing_qty + l_mem_stealing_qty;
11617: x_total_pf_stealing_qty := x_total_pf_stealing_qty + l_pf_stealing_qty;
11618: IF PG_DEBUG in ('Y', 'C') THEN
11619: msc_sch_wb.atp_debug('Stealing: x_total_mem_stealing_qty = ' || x_total_mem_stealing_qty);
11620: msc_sch_wb.atp_debug('Stealing: x_total_pf_stealing_qty = ' || x_total_pf_stealing_qty);
11621: END IF;
11622: -- time_phased_atp changes end
11623:
11624: -- populate insert rec to pegging tree for this demand

Line 11640: msc_sch_wb.atp_debug('Stealing: ' || 'Modular Use Org_code : '||l_org_code);

11636: MSC_ATP_PROC.get_global_org_info (p_atp_record.instance_id,
11637: p_atp_record.organization_id );
11638: l_org_code := MSC_ATP_PVT.G_ORG_INFO_REC.org_code;
11639: IF PG_DEBUG in ('Y', 'C') THEN
11640: msc_sch_wb.atp_debug('Stealing: ' || 'Modular Use Org_code : '||l_org_code);
11641: END IF;
11642: /*l_org_code := MSC_ATP_FUNC.get_org_code(p_atp_record.instance_id,
11643: p_atp_record.organization_id);
11644: Modularize Item and Org Info */

Line 11711: msc_sch_wb.atp_debug('Stealing: l_pegging_rec.allocated_quantity = ' ||l_pegging_rec.allocated_quantity);

11707: p_net_demand);
11708: END IF;
11709:
11710: IF PG_DEBUG in ('Y', 'C') THEN
11711: msc_sch_wb.atp_debug('Stealing: l_pegging_rec.allocated_quantity = ' ||l_pegging_rec.allocated_quantity);
11712: END IF;
11713: l_pegging_rec.component_identifier :=
11714: NVL(p_atp_record.component_identifier, MSC_ATP_PVT.G_COMP_LINE_ID);
11715:

Line 11751: msc_sch_wb.atp_debug('ATP_Check: ' || '----------- Calendars passed to Pegging -----------------');

11747: l_pegging_rec.summary_flag := MSC_ATP_PVT.G_SUMMARY_FLAG; -- for summary enhancement
11748: l_pegging_rec.demand_class := l_demand_class;
11749: -- Bug 3826234 start
11750: IF PG_DEBUG in ('Y', 'C') THEN
11751: msc_sch_wb.atp_debug('ATP_Check: ' || '----------- Calendars passed to Pegging -----------------');
11752: msc_sch_wb.atp_debug('ATP_Check: ' || 'shipping_cal_code = ' ||p_atp_record.shipping_cal_code);
11753: msc_sch_wb.atp_debug('ATP_Check: ' || 'receiving_cal_code = ' ||p_atp_record.receiving_cal_code);
11754: msc_sch_wb.atp_debug('ATP_Check: ' || 'intransit_cal_code = ' ||p_atp_record.intransit_cal_code);
11755: msc_sch_wb.atp_debug('ATP_Check: ' || 'manufacturing_cal_code = ' ||p_atp_record.manufacturing_cal_code);

Line 11752: msc_sch_wb.atp_debug('ATP_Check: ' || 'shipping_cal_code = ' ||p_atp_record.shipping_cal_code);

11748: l_pegging_rec.demand_class := l_demand_class;
11749: -- Bug 3826234 start
11750: IF PG_DEBUG in ('Y', 'C') THEN
11751: msc_sch_wb.atp_debug('ATP_Check: ' || '----------- Calendars passed to Pegging -----------------');
11752: msc_sch_wb.atp_debug('ATP_Check: ' || 'shipping_cal_code = ' ||p_atp_record.shipping_cal_code);
11753: msc_sch_wb.atp_debug('ATP_Check: ' || 'receiving_cal_code = ' ||p_atp_record.receiving_cal_code);
11754: msc_sch_wb.atp_debug('ATP_Check: ' || 'intransit_cal_code = ' ||p_atp_record.intransit_cal_code);
11755: msc_sch_wb.atp_debug('ATP_Check: ' || 'manufacturing_cal_code = ' ||p_atp_record.manufacturing_cal_code);
11756: msc_sch_wb.atp_debug('ATP_Check: ' || 'to_organization_id = ' ||p_atp_record.to_organization_id);

Line 11753: msc_sch_wb.atp_debug('ATP_Check: ' || 'receiving_cal_code = ' ||p_atp_record.receiving_cal_code);

11749: -- Bug 3826234 start
11750: IF PG_DEBUG in ('Y', 'C') THEN
11751: msc_sch_wb.atp_debug('ATP_Check: ' || '----------- Calendars passed to Pegging -----------------');
11752: msc_sch_wb.atp_debug('ATP_Check: ' || 'shipping_cal_code = ' ||p_atp_record.shipping_cal_code);
11753: msc_sch_wb.atp_debug('ATP_Check: ' || 'receiving_cal_code = ' ||p_atp_record.receiving_cal_code);
11754: msc_sch_wb.atp_debug('ATP_Check: ' || 'intransit_cal_code = ' ||p_atp_record.intransit_cal_code);
11755: msc_sch_wb.atp_debug('ATP_Check: ' || 'manufacturing_cal_code = ' ||p_atp_record.manufacturing_cal_code);
11756: msc_sch_wb.atp_debug('ATP_Check: ' || 'to_organization_id = ' ||p_atp_record.to_organization_id);
11757: END IF;

Line 11754: msc_sch_wb.atp_debug('ATP_Check: ' || 'intransit_cal_code = ' ||p_atp_record.intransit_cal_code);

11750: IF PG_DEBUG in ('Y', 'C') THEN
11751: msc_sch_wb.atp_debug('ATP_Check: ' || '----------- Calendars passed to Pegging -----------------');
11752: msc_sch_wb.atp_debug('ATP_Check: ' || 'shipping_cal_code = ' ||p_atp_record.shipping_cal_code);
11753: msc_sch_wb.atp_debug('ATP_Check: ' || 'receiving_cal_code = ' ||p_atp_record.receiving_cal_code);
11754: msc_sch_wb.atp_debug('ATP_Check: ' || 'intransit_cal_code = ' ||p_atp_record.intransit_cal_code);
11755: msc_sch_wb.atp_debug('ATP_Check: ' || 'manufacturing_cal_code = ' ||p_atp_record.manufacturing_cal_code);
11756: msc_sch_wb.atp_debug('ATP_Check: ' || 'to_organization_id = ' ||p_atp_record.to_organization_id);
11757: END IF;
11758: IF p_parent_pegging_id = MSC_ATP_PVT.G_DEMAND_PEGGING_ID THEN

Line 11755: msc_sch_wb.atp_debug('ATP_Check: ' || 'manufacturing_cal_code = ' ||p_atp_record.manufacturing_cal_code);

11751: msc_sch_wb.atp_debug('ATP_Check: ' || '----------- Calendars passed to Pegging -----------------');
11752: msc_sch_wb.atp_debug('ATP_Check: ' || 'shipping_cal_code = ' ||p_atp_record.shipping_cal_code);
11753: msc_sch_wb.atp_debug('ATP_Check: ' || 'receiving_cal_code = ' ||p_atp_record.receiving_cal_code);
11754: msc_sch_wb.atp_debug('ATP_Check: ' || 'intransit_cal_code = ' ||p_atp_record.intransit_cal_code);
11755: msc_sch_wb.atp_debug('ATP_Check: ' || 'manufacturing_cal_code = ' ||p_atp_record.manufacturing_cal_code);
11756: msc_sch_wb.atp_debug('ATP_Check: ' || 'to_organization_id = ' ||p_atp_record.to_organization_id);
11757: END IF;
11758: IF p_parent_pegging_id = MSC_ATP_PVT.G_DEMAND_PEGGING_ID THEN
11759: l_pegging_rec.shipping_cal_code := p_atp_record.shipping_cal_code;

Line 11756: msc_sch_wb.atp_debug('ATP_Check: ' || 'to_organization_id = ' ||p_atp_record.to_organization_id);

11752: msc_sch_wb.atp_debug('ATP_Check: ' || 'shipping_cal_code = ' ||p_atp_record.shipping_cal_code);
11753: msc_sch_wb.atp_debug('ATP_Check: ' || 'receiving_cal_code = ' ||p_atp_record.receiving_cal_code);
11754: msc_sch_wb.atp_debug('ATP_Check: ' || 'intransit_cal_code = ' ||p_atp_record.intransit_cal_code);
11755: msc_sch_wb.atp_debug('ATP_Check: ' || 'manufacturing_cal_code = ' ||p_atp_record.manufacturing_cal_code);
11756: msc_sch_wb.atp_debug('ATP_Check: ' || 'to_organization_id = ' ||p_atp_record.to_organization_id);
11757: END IF;
11758: IF p_parent_pegging_id = MSC_ATP_PVT.G_DEMAND_PEGGING_ID THEN
11759: l_pegging_rec.shipping_cal_code := p_atp_record.shipping_cal_code;
11760: l_pegging_rec.receiving_cal_code := p_atp_record.receiving_cal_code;

Line 11764: msc_sch_wb.atp_debug('ATP_Check: ' || 'Inside IF');

11760: l_pegging_rec.receiving_cal_code := p_atp_record.receiving_cal_code;
11761: l_pegging_rec.intransit_cal_code := p_atp_record.intransit_cal_code;
11762: l_pegging_rec.manufacturing_cal_code := p_atp_record.manufacturing_cal_code;
11763: IF PG_DEBUG in ('Y', 'C') THEN
11764: msc_sch_wb.atp_debug('ATP_Check: ' || 'Inside IF');
11765: END IF;
11766: ELSIF NVL(p_atp_record.to_organization_id,p_atp_record.organization_id)
11767: <> p_atp_record.organization_id THEN
11768: l_pegging_rec.shipping_cal_code := p_atp_record.shipping_cal_code;

Line 11773: msc_sch_wb.atp_debug('ATP_Check: ' || 'Inside ELSIF');

11769: l_pegging_rec.receiving_cal_code := p_atp_record.receiving_cal_code;
11770: l_pegging_rec.intransit_cal_code := p_atp_record.intransit_cal_code;
11771: l_pegging_rec.manufacturing_cal_code := NULL;
11772: IF PG_DEBUG in ('Y', 'C') THEN
11773: msc_sch_wb.atp_debug('ATP_Check: ' || 'Inside ELSIF');
11774: END IF;
11775: ELSE
11776: l_pegging_rec.manufacturing_cal_code := p_atp_record.manufacturing_cal_code;
11777: l_pegging_rec.shipping_cal_code := NULL;

Line 11781: msc_sch_wb.atp_debug('ATP_Check: ' || 'Inside ELSE');

11777: l_pegging_rec.shipping_cal_code := NULL;
11778: l_pegging_rec.receiving_cal_code := NULL;
11779: l_pegging_rec.intransit_cal_code := NULL;
11780: IF PG_DEBUG in ('Y', 'C') THEN
11781: msc_sch_wb.atp_debug('ATP_Check: ' || 'Inside ELSE');
11782: END IF;
11783: END IF;
11784: -- Bug 3826234 end
11785: MSC_ATP_DB_UTILS.Add_Pegging(l_pegging_rec, l_atp_pegging_id);

Line 11791: msc_sch_wb.atp_debug('ATP_Check: ' || 'MSC_ATP_PVT.G_FW_STEAL_PEGGING_ID := '

11787: IF MSC_ATP_PVT.G_OPTIONAL_FW is not null AND MSC_ATP_PVT.G_FORWARD_ATP = 'Y' THEN
11788: MSC_ATP_PVT.G_FW_STEAL_PEGGING_ID.EXTEND;
11789: MSC_ATP_PVT.G_FW_STEAL_PEGGING_ID(MSC_ATP_PVT.G_FW_STEAL_PEGGING_ID.COUNT) := l_atp_pegging_id;
11790: IF PG_DEBUG in ('Y', 'C') THEN
11791: msc_sch_wb.atp_debug('ATP_Check: ' || 'MSC_ATP_PVT.G_FW_STEAL_PEGGING_ID := '
11792: || MSC_ATP_PVT.G_FW_STEAL_PEGGING_ID(MSC_ATP_PVT.G_FW_STEAL_PEGGING_ID.COUNT));
11793: END IF;
11794: END IF;
11795: -- Add pegging_id to the l_atp_period and l_atp_supply_demand

Line 11831: msc_sch_wb.atp_debug('********* END Stealing ************');

11827: END IF;
11828:
11829: END LOOP;
11830: IF PG_DEBUG in ('Y', 'C') THEN
11831: msc_sch_wb.atp_debug('********* END Stealing ************');
11832: END IF;
11833: END Stealing;
11834: END MSC_AATP_PVT;