DBA Data[Home] [Help]

APPS.MSC_AATP_REQ dependencies on MSC_SCH_WB

Line 51: msc_sch_wb.atp_debug('******* Item_Pre_Allocated_Atp *******');

47:
48: BEGIN
49:
50: IF PG_DEBUG in ('Y', 'C') THEN
51: msc_sch_wb.atp_debug('******* Item_Pre_Allocated_Atp *******');
52: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_plan_id =' || p_plan_id );
53: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_level =' || p_level );
54: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_identifier =' || p_identifier);
55: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_scenario_id =' || p_scenario_id);

Line 52: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_plan_id =' || p_plan_id );

48: BEGIN
49:
50: IF PG_DEBUG in ('Y', 'C') THEN
51: msc_sch_wb.atp_debug('******* Item_Pre_Allocated_Atp *******');
52: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_plan_id =' || p_plan_id );
53: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_level =' || p_level );
54: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_identifier =' || p_identifier);
55: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_scenario_id =' || p_scenario_id);
56: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);

Line 53: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_level =' || p_level );

49:
50: IF PG_DEBUG in ('Y', 'C') THEN
51: msc_sch_wb.atp_debug('******* Item_Pre_Allocated_Atp *******');
52: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_plan_id =' || p_plan_id );
53: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_level =' || p_level );
54: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_identifier =' || p_identifier);
55: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_scenario_id =' || p_scenario_id);
56: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);
57: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_organization_id =' || p_organization_id);

Line 54: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_identifier =' || p_identifier);

50: IF PG_DEBUG in ('Y', 'C') THEN
51: msc_sch_wb.atp_debug('******* Item_Pre_Allocated_Atp *******');
52: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_plan_id =' || p_plan_id );
53: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_level =' || p_level );
54: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_identifier =' || p_identifier);
55: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_scenario_id =' || p_scenario_id);
56: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);
57: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_organization_id =' || p_organization_id);
58: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_instance_id =' || p_instance_id);

Line 55: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_scenario_id =' || p_scenario_id);

51: msc_sch_wb.atp_debug('******* Item_Pre_Allocated_Atp *******');
52: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_plan_id =' || p_plan_id );
53: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_level =' || p_level );
54: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_identifier =' || p_identifier);
55: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_scenario_id =' || p_scenario_id);
56: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);
57: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_organization_id =' || p_organization_id);
58: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_instance_id =' || p_instance_id);
59: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_demand_class =' || p_demand_class);

Line 56: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);

52: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_plan_id =' || p_plan_id );
53: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_level =' || p_level );
54: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_identifier =' || p_identifier);
55: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_scenario_id =' || p_scenario_id);
56: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);
57: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_organization_id =' || p_organization_id);
58: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_instance_id =' || p_instance_id);
59: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_demand_class =' || p_demand_class);
60: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_request_date =' || p_request_date );

Line 57: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_organization_id =' || p_organization_id);

53: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_level =' || p_level );
54: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_identifier =' || p_identifier);
55: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_scenario_id =' || p_scenario_id);
56: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);
57: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_organization_id =' || p_organization_id);
58: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_instance_id =' || p_instance_id);
59: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_demand_class =' || p_demand_class);
60: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_request_date =' || p_request_date );
61: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_insert_flag =' || p_insert_flag );

Line 58: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_instance_id =' || p_instance_id);

54: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_identifier =' || p_identifier);
55: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_scenario_id =' || p_scenario_id);
56: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);
57: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_organization_id =' || p_organization_id);
58: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_instance_id =' || p_instance_id);
59: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_demand_class =' || p_demand_class);
60: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_request_date =' || p_request_date );
61: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_insert_flag =' || p_insert_flag );
62: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_request_item_id =' || p_request_item_id );

Line 59: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_demand_class =' || p_demand_class);

55: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_scenario_id =' || p_scenario_id);
56: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);
57: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_organization_id =' || p_organization_id);
58: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_instance_id =' || p_instance_id);
59: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_demand_class =' || p_demand_class);
60: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_request_date =' || p_request_date );
61: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_insert_flag =' || p_insert_flag );
62: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_request_item_id =' || p_request_item_id );
63: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_atf_date =' || p_atf_date );

Line 60: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_request_date =' || p_request_date );

56: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_inventory_item_id =' || p_inventory_item_id);
57: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_organization_id =' || p_organization_id);
58: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_instance_id =' || p_instance_id);
59: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_demand_class =' || p_demand_class);
60: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_request_date =' || p_request_date );
61: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_insert_flag =' || p_insert_flag );
62: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_request_item_id =' || p_request_item_id );
63: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_atf_date =' || p_atf_date );
64: END IF;

Line 61: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_insert_flag =' || p_insert_flag );

57: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_organization_id =' || p_organization_id);
58: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_instance_id =' || p_instance_id);
59: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_demand_class =' || p_demand_class);
60: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_request_date =' || p_request_date );
61: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_insert_flag =' || p_insert_flag );
62: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_request_item_id =' || p_request_item_id );
63: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_atf_date =' || p_atf_date );
64: END IF;
65:

Line 62: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_request_item_id =' || p_request_item_id );

58: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_instance_id =' || p_instance_id);
59: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_demand_class =' || p_demand_class);
60: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_request_date =' || p_request_date );
61: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_insert_flag =' || p_insert_flag );
62: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_request_item_id =' || p_request_item_id );
63: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_atf_date =' || p_atf_date );
64: END IF;
65:
66: -- This procedure will only deal with the requested demand class.

Line 63: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_atf_date =' || p_atf_date );

59: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_demand_class =' || p_demand_class);
60: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_request_date =' || p_request_date );
61: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_insert_flag =' || p_insert_flag );
62: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_request_item_id =' || p_request_item_id );
63: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_atf_date =' || p_atf_date );
64: END IF;
65:
66: -- This procedure will only deal with the requested demand class.
67:

Line 87: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'Time Phased ATP = ' || l_time_phased_atp );

83: l_pf_item_id := MSC_ATP_PVT.G_ITEM_INFO_REC.product_family_id;
84: END IF;
85:
86: IF PG_DEBUG in ('Y', 'C') THEN
87: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'Time Phased ATP = ' || l_time_phased_atp );
88: END IF;
89:
90: /*
91: BEGIN

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

98: AND sr_inventory_item_id = p_inventory_item_id;
99: EXCEPTION
100: WHEN OTHERS THEN
101: IF PG_DEBUG in ('Y', 'C') THEN
102: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'Error selecting uom_code for the item');
103: END IF;
104: END;*/
105: l_inv_item_id := MSC_ATP_PVT.G_ITEM_INFO_REC.inventory_item_id;
106: l_uom_code := MSC_ATP_PVT.G_ITEM_INFO_REC.uom_code;

Line 119: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'infinite fence : ' || l_infinite_time_fence_date);

115: ELSE
116: l_infinite_time_fence_date := p_get_mat_in_rec.infinite_time_fence_date;
117: END IF;
118: IF PG_DEBUG in ('Y', 'C') THEN
119: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'infinite fence : ' || l_infinite_time_fence_date);
120: END IF;
121:
122: -- get the daily net availability for DCi
123: IF (NVL(p_insert_flag, 0) = 0 ) THEN

Line 126: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_insert_flag : 0');

122: -- get the daily net availability for DCi
123: IF (NVL(p_insert_flag, 0) = 0 ) THEN
124: -- we don't want details
125: IF PG_DEBUG in ('Y', 'C') THEN
126: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'p_insert_flag : 0');
127: END IF;
128:
129: IF MSC_ATP_PVT.G_SUMMARY_SQL = 'Y' THEN -- For summary enhancement
130: IF PG_DEBUG in ('Y', 'C') THEN

Line 131: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'MSC_ATP_PVT.G_SUMMARY_SQL := ' || MSC_ATP_PVT.G_SUMMARY_SQL);

127: END IF;
128:
129: IF MSC_ATP_PVT.G_SUMMARY_SQL = 'Y' THEN -- For summary enhancement
130: IF PG_DEBUG in ('Y', 'C') THEN
131: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'MSC_ATP_PVT.G_SUMMARY_SQL := ' || MSC_ATP_PVT.G_SUMMARY_SQL);
132: END IF;
133:
134: -- time_phased_atp
135: IF l_time_phased_atp = 'N' THEN

Line 137: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'l_time_phased_atp := ' || l_time_phased_atp);

133:
134: -- time_phased_atp
135: IF l_time_phased_atp = 'N' THEN
136: IF PG_DEBUG in ('Y', 'C') THEN
137: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'l_time_phased_atp := ' || l_time_phased_atp);
138: END IF;
139:
140: -- SQL changed for summary enhancement
141: SELECT SD_DATE,

Line 202: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'l_time_phased_atp := ' || l_time_phased_atp);

198:
199: ELSE -- IF Not_PF_Case THEN
200:
201: IF PG_DEBUG in ('Y', 'C') THEN
202: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'l_time_phased_atp := ' || l_time_phased_atp);
203: END IF;
204:
205: MSC_ATP_PF.Item_Prealloc_Avail_Pf_Summ(
206: l_inv_item_id,

Line 220: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'Error occured in procedure Item_Prealloc_Avail_Pf_Summ');

216: l_return_status
217: );
218: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
219: IF PG_DEBUG in ('Y', 'C') THEN
220: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'Error occured in procedure Item_Prealloc_Avail_Pf_Summ');
221: END IF;
222: RAISE FND_API.G_EXC_ERROR;
223: END IF;
224:

Line 231: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'MSC_ATP_PVT.G_SUMMARY_SQL := ' || MSC_ATP_PVT.G_SUMMARY_SQL);

227:
228: ELSE -- IF MSC_ATP_PVT.G_SUMMARY_FLAG = 'Y' THEN -- For summary enhancement
229:
230: IF PG_DEBUG in ('Y', 'C') THEN
231: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'MSC_ATP_PVT.G_SUMMARY_SQL := ' || MSC_ATP_PVT.G_SUMMARY_SQL);
232: END IF;
233:
234: -- time_phased_atp
235: IF l_time_phased_atp = 'N' THEN

Line 287: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'Error occured in procedure Item_Prealloc_Avail_Pf');

283: l_return_status
284: );
285: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
286: IF PG_DEBUG in ('Y', 'C') THEN
287: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'Error occured in procedure Item_Prealloc_Avail_Pf');
288: END IF;
289: RAISE FND_API.G_EXC_ERROR;
290: END IF;
291: END IF; -- IF Not_PF_Case THEN

Line 322: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'Error occured in procedure Item_Prealloc_Avail_Pf_Dtls');

318: l_return_status
319: );
320: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
321: IF PG_DEBUG in ('Y', 'C') THEN
322: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'Error occured in procedure Item_Prealloc_Avail_Pf_Dtls');
323: END IF;
324: RAISE FND_API.G_EXC_ERROR;
325: END IF;
326: ELSE -- IF Not_PF_Case THEN

Line 506: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'after selecting sd data into msc_atp_sd_details_temp');

502: END IF; -- IF Not_PF_Case THEN
503:
504: -- for period ATP
505: IF PG_DEBUG in ('Y', 'C') THEN
506: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'after selecting sd data into msc_atp_sd_details_temp');
507: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'count : ' || SQL%ROWCOUNT);
508: END IF;
509:
510: -- time_phased_atp

Line 507: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'count : ' || SQL%ROWCOUNT);

503:
504: -- for period ATP
505: IF PG_DEBUG in ('Y', 'C') THEN
506: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'after selecting sd data into msc_atp_sd_details_temp');
507: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'count : ' || SQL%ROWCOUNT);
508: END IF;
509:
510: -- time_phased_atp
511: IF l_time_phased_atp='Y' THEN

Line 515: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'Error occured in procedure Get_Period_Data_From_Sd_Temp');

511: IF l_time_phased_atp='Y' THEN
512: MSC_ATP_PF.Get_Period_Data_From_Sd_Temp(x_atp_period, l_return_status);
513: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
514: IF PG_DEBUG in ('Y', 'C') THEN
515: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'Error occured in procedure Get_Period_Data_From_Sd_Temp');
516: END IF;
517: RAISE FND_API.G_EXC_ERROR;
518: END IF;
519: ELSE

Line 527: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'Error occured in procedure Get_Alloc_Data_From_Sd_Temp');

523: user opens ATP SD window from ATP pegging in allocated scenarios*/
524: MSC_ATP_PROC.Get_Alloc_Data_From_Sd_Temp(x_atp_period, l_return_status);
525: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
526: IF PG_DEBUG in ('Y', 'C') THEN
527: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'Error occured in procedure Get_Alloc_Data_From_Sd_Temp');
528: END IF;
529: RAISE FND_API.G_EXC_ERROR;
530: END IF;
531: END IF;

Line 539: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'right after the big query');

535:
536: END IF; -- NVL(p_insert_flag, 0) = 0
537:
538: IF PG_DEBUG in ('Y', 'C') THEN
539: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'right after the big query');
540: mm := l_current_atp.atp_qty.FIRST;
541:
542: WHILE mm is not null LOOP
543: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'l_current_atp.atp_period:atp_qty = '||

Line 543: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'l_current_atp.atp_period:atp_qty = '||

539: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'right after the big query');
540: mm := l_current_atp.atp_qty.FIRST;
541:
542: WHILE mm is not null LOOP
543: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'l_current_atp.atp_period:atp_qty = '||
544: l_current_atp.atp_period(mm) ||' : '|| l_current_atp.atp_qty(mm));
545: mm := l_current_atp.atp_qty.Next(mm);
546: END LOOP;
547: END IF;

Line 561: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'Error occured in procedure Pf_Atp_Consume');

557: MSC_ATP_PF.Bw_Fw_Cum, --b/w, f/w consumption and accumulation
558: p_atf_date);
559: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
560: IF PG_DEBUG in ('Y', 'C') THEN
561: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'Error occured in procedure Pf_Atp_Consume');
562: END IF;
563: RAISE FND_API.G_EXC_ERROR;
564: END IF;
565: ELSE

Line 573: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'Error occured in procedure Atp_Remove_Negatives');

569: /* Cum drop issue changes begin*/
570: MSC_AATP_PROC.Atp_Remove_Negatives(l_current_atp.atp_qty, l_return_status);
571: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
572: IF PG_DEBUG in ('Y', 'C') THEN
573: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'Error occured in procedure Atp_Remove_Negatives');
574: END IF;
575: RAISE FND_API.G_EXC_ERROR;
576: END IF;
577: /* Cum drop issue changes end*/

Line 580: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'right after the ATP consume');

576: END IF;
577: /* Cum drop issue changes end*/
578:
579: IF PG_DEBUG in ('Y', 'C') THEN
580: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'right after the ATP consume');
581: mm := l_current_atp.atp_qty.FIRST;
582:
583: WHILE mm is not null LOOP
584: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'l_current_atp.atp_period and atp_qty = '||

Line 584: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'l_current_atp.atp_period and atp_qty = '||

580: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'right after the ATP consume');
581: mm := l_current_atp.atp_qty.FIRST;
582:
583: WHILE mm is not null LOOP
584: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'l_current_atp.atp_period and atp_qty = '||
585: l_current_atp.atp_period(mm) ||' : '|| l_current_atp.atp_qty(mm));
586: mm := l_current_atp.atp_qty.Next(mm);
587: END LOOP;
588: END IF;

Line 638: msc_sch_wb.atp_debug('**********Begin Atp_Alloc_Consume Procedure************');

634:
635: BEGIN
636:
637: IF PG_DEBUG in ('Y', 'C') THEN
638: msc_sch_wb.atp_debug('**********Begin Atp_Alloc_Consume Procedure************');
639: END IF;
640:
641: x_dc_list_tab := MRP_ATP_PUB.Char80_Arr();
642: x_dc_start_index := MRP_ATP_PUB.Number_Arr();

Line 650: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'after extend : ' || p_atp_dc_tab(p_atp_dc_tab.FIRST));

646: x_dc_start_index.EXTEND;
647: x_dc_end_index.EXTEND;
648:
649: IF PG_DEBUG in ('Y', 'C') THEN
650: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'after extend : ' || p_atp_dc_tab(p_atp_dc_tab.FIRST));
651: END IF;
652:
653: x_dc_list_tab(1) := p_atp_dc_tab(p_atp_dc_tab.FIRST);
654: x_dc_start_index(1) := 1;

Line 656: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'after assign : ' || x_dc_list_tab(1));

652:
653: x_dc_list_tab(1) := p_atp_dc_tab(p_atp_dc_tab.FIRST);
654: x_dc_start_index(1) := 1;
655: IF PG_DEBUG in ('Y', 'C') THEN
656: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'after assign : ' || x_dc_list_tab(1));
657: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'start index : ' || x_dc_start_index(1));
658: END IF;
659:
660: -- 2970405 rework break up demand classes

Line 657: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'start index : ' || x_dc_start_index(1));

653: x_dc_list_tab(1) := p_atp_dc_tab(p_atp_dc_tab.FIRST);
654: x_dc_start_index(1) := 1;
655: IF PG_DEBUG in ('Y', 'C') THEN
656: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'after assign : ' || x_dc_list_tab(1));
657: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'start index : ' || x_dc_start_index(1));
658: END IF;
659:
660: -- 2970405 rework break up demand classes
661: -- this for loop will do backward consumption

Line 665: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'index : ' || i);

661: -- this for loop will do backward consumption
662: FOR i in 1..(p_atp_dc_tab.COUNT-1) LOOP -- 1490473: i starts from 1, not 2
663:
664: IF PG_DEBUG in ('Y', 'C') THEN
665: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'index : ' || i);
666: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'x_dc_list_tab : ' || x_dc_list_tab(x_dc_list_tab.COUNT));
667: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'p_atp_dc_tab : ' || p_atp_dc_tab(i));
668: END IF;
669:

Line 666: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'x_dc_list_tab : ' || x_dc_list_tab(x_dc_list_tab.COUNT));

662: FOR i in 1..(p_atp_dc_tab.COUNT-1) LOOP -- 1490473: i starts from 1, not 2
663:
664: IF PG_DEBUG in ('Y', 'C') THEN
665: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'index : ' || i);
666: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'x_dc_list_tab : ' || x_dc_list_tab(x_dc_list_tab.COUNT));
667: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'p_atp_dc_tab : ' || p_atp_dc_tab(i));
668: END IF;
669:
670: -- If demand class changes, re-initialize these variables.

Line 667: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'p_atp_dc_tab : ' || p_atp_dc_tab(i));

663:
664: IF PG_DEBUG in ('Y', 'C') THEN
665: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'index : ' || i);
666: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'x_dc_list_tab : ' || x_dc_list_tab(x_dc_list_tab.COUNT));
667: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'p_atp_dc_tab : ' || p_atp_dc_tab(i));
668: END IF;
669:
670: -- If demand class changes, re-initialize these variables.
671: IF p_atp_dc_tab(i+1) <> x_dc_list_tab(x_dc_list_tab.COUNT) THEN

Line 676: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'inside IF');

672:
673: x_dc_end_index(x_dc_end_index.COUNT) := i;
674:
675: IF PG_DEBUG in ('Y', 'C') THEN
676: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'inside IF');
677: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'end index : ' || x_dc_end_index(x_dc_end_index.COUNT));
678: END IF;
679:
680: x_dc_list_tab.EXTEND;

Line 677: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'end index : ' || x_dc_end_index(x_dc_end_index.COUNT));

673: x_dc_end_index(x_dc_end_index.COUNT) := i;
674:
675: IF PG_DEBUG in ('Y', 'C') THEN
676: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'inside IF');
677: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'end index : ' || x_dc_end_index(x_dc_end_index.COUNT));
678: END IF;
679:
680: x_dc_list_tab.EXTEND;
681: x_dc_start_index.EXTEND;

Line 688: -- msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'inside else');

684: x_dc_start_index(x_dc_start_index.COUNT) := i+1;
685: -- x_dc_end_index(x_dc_end_index.COUNT) := i;
686: --ELSE
687: --IF PG_DEBUG in ('Y', 'C') THEN
688: -- msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'inside else');
689: --END IF;
690: --x_dc_end_index(x_dc_end_index.COUNT) := i;
691: END IF;
692:

Line 694: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'start index : ' || x_dc_start_index(x_dc_start_index.COUNT));

690: --x_dc_end_index(x_dc_end_index.COUNT) := i;
691: END IF;
692:
693: IF PG_DEBUG in ('Y', 'C') THEN
694: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'start index : ' || x_dc_start_index(x_dc_start_index.COUNT));
695: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'end index : ' || x_dc_end_index(x_dc_end_index.COUNT));
696: END IF;
697:
698: /* 2970405 just calculate the start and end of the dc's

Line 695: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'end index : ' || x_dc_end_index(x_dc_end_index.COUNT));

691: END IF;
692:
693: IF PG_DEBUG in ('Y', 'C') THEN
694: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'start index : ' || x_dc_start_index(x_dc_start_index.COUNT));
695: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'end index : ' || x_dc_end_index(x_dc_end_index.COUNT));
696: END IF;
697:
698: /* 2970405 just calculate the start and end of the dc's
699: -- backward consumption when neg atp quantity occurs

Line 723: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'before forward consumption');

719: END LOOP;
720: END IF;
721:
722: IF PG_DEBUG in ('Y', 'C') THEN
723: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'before forward consumption');
724: END IF;
725:
726: -- 1490473: forward consumption
727: -- this for loop will do forward consumption

Line 735: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'in forward consumption : ' || i || ':' || j);

731:
732: j := i + 1;
733:
734: IF PG_DEBUG in ('Y', 'C') THEN
735: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'in forward consumption : ' || i || ':' || j);
736: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'in forward : ' || p_atp_dc_tab.COUNT);
737: END IF;
738:
739: IF j < p_atp_dc_tab.COUNT THEN

Line 736: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'in forward : ' || p_atp_dc_tab.COUNT);

732: j := i + 1;
733:
734: IF PG_DEBUG in ('Y', 'C') THEN
735: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'in forward consumption : ' || i || ':' || j);
736: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'in forward : ' || p_atp_dc_tab.COUNT);
737: END IF;
738:
739: IF j < p_atp_dc_tab.COUNT THEN
740:

Line 742: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'in j : ' || p_atp_dc_tab.COUNT);

738:
739: IF j < p_atp_dc_tab.COUNT THEN
740:
741: IF PG_DEBUG in ('Y', 'C') THEN
742: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'in j : ' || p_atp_dc_tab.COUNT);
743: END IF;
744:
745: WHILE (p_atp_dc_tab(j) = x_dc_list_tab(x_dc_list_tab.COUNT)) LOOP
746: IF (p_atp_qty(j) <= 0) THEN

Line 777: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'x_dc_list_tab : ' || x_dc_list_tab.COUNT);

773: -- 2970405
774: x_dc_end_index(x_dc_end_index.count) := p_atp_dc_tab.count;
775:
776: IF PG_DEBUG in ('Y', 'C') THEN
777: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'x_dc_list_tab : ' || x_dc_list_tab.COUNT);
778: END IF;
779:
780: -- this for loop will do atp consume on each dc
781: FOR j in 1..x_dc_list_tab.COUNT LOOP

Line 784: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'inside atp consume : ' || j);

780: -- this for loop will do atp consume on each dc
781: FOR j in 1..x_dc_list_tab.COUNT LOOP
782:
783: IF PG_DEBUG in ('Y', 'C') THEN
784: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'inside atp consume : ' || j);
785: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'x_dc_start_index : ' || x_dc_start_index(j));
786: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'x_dc_end_index : ' || x_dc_end_index(j));
787: END IF;
788:

Line 785: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'x_dc_start_index : ' || x_dc_start_index(j));

781: FOR j in 1..x_dc_list_tab.COUNT LOOP
782:
783: IF PG_DEBUG in ('Y', 'C') THEN
784: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'inside atp consume : ' || j);
785: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'x_dc_start_index : ' || x_dc_start_index(j));
786: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'x_dc_end_index : ' || x_dc_end_index(j));
787: END IF;
788:
789: MSC_ATP_PROC.atp_consume_range(p_atp_qty, x_dc_start_index(j), x_dc_end_index(j));

Line 786: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'x_dc_end_index : ' || x_dc_end_index(j));

782:
783: IF PG_DEBUG in ('Y', 'C') THEN
784: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'inside atp consume : ' || j);
785: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'x_dc_start_index : ' || x_dc_start_index(j));
786: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'x_dc_end_index : ' || x_dc_end_index(j));
787: END IF;
788:
789: MSC_ATP_PROC.atp_consume_range(p_atp_qty, x_dc_start_index(j), x_dc_end_index(j));
790: /* 2970405

Line 794: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'inside accumulation : ' || i);

790: /* 2970405
791: FOR i in (x_dc_start_index(j) + 1)..x_dc_end_index(j) LOOP
792:
793: IF PG_DEBUG in ('Y', 'C') THEN
794: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'inside accumulation : ' || i);
795: END IF;
796: -- 1956037: do accumulation for neg quantity as well
797: p_atp_qty(i) := p_atp_qty(i) + p_atp_qty(i-1);
798: END LOOP;

Line 803: msc_sch_wb.atp_debug('**********End Atp_Alloc_Consume Procedure************');

799: */
800: END LOOP; --FOR i in 1..x_dc_list_tab.COUNT LOOP
801:
802: IF PG_DEBUG in ('Y', 'C') THEN
803: msc_sch_wb.atp_debug('**********End Atp_Alloc_Consume Procedure************');
804: END IF;
805:
806: EXCEPTION
807: WHEN others THEN

Line 809: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'in Exception : ' || i || ':' || j);

805:
806: EXCEPTION
807: WHEN others THEN
808: IF PG_DEBUG in ('Y', 'C') THEN
809: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'in Exception : ' || i || ':' || j);
810: msc_sch_wb.atp_debug('Exception in Atp_Alloc_Consume : ' || sqlcode);
811: END IF;
812: END Atp_Alloc_Consume;
813:

Line 810: msc_sch_wb.atp_debug('Exception in Atp_Alloc_Consume : ' || sqlcode);

806: EXCEPTION
807: WHEN others THEN
808: IF PG_DEBUG in ('Y', 'C') THEN
809: msc_sch_wb.atp_debug('Atp_Alloc_Consume: ' || 'in Exception : ' || i || ':' || j);
810: msc_sch_wb.atp_debug('Exception in Atp_Alloc_Consume : ' || sqlcode);
811: END IF;
812: END Atp_Alloc_Consume;
813:
814:

Line 911: msc_sch_wb.atp_debug('**********Begin Get_Forward_Material_Atp Procedure************');

907: m_atf PLS_INTEGER;
908:
909: BEGIN
910: IF PG_DEBUG in ('Y', 'C') THEN
911: msc_sch_wb.atp_debug('**********Begin Get_Forward_Material_Atp Procedure************');
912: END IF;
913: -- initialize API return status to success
914: x_return_status := FND_API.G_RET_STS_SUCCESS;
915: x_atp_pegging_tab := MRP_ATP_PUB.Number_Arr();

Line 918: msc_sch_wb.atp_debug('********** INPUT DATA:Get_Forward_Material_Atp **********');

914: x_return_status := FND_API.G_RET_STS_SUCCESS;
915: x_atp_pegging_tab := MRP_ATP_PUB.Number_Arr();
916:
917: IF PG_DEBUG in ('Y', 'C') THEN
918: msc_sch_wb.atp_debug('********** INPUT DATA:Get_Forward_Material_Atp **********');
919: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_inventory_item_id: '|| to_char(p_inventory_item_id));
920: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_organization_id: '|| to_char(p_organization_id));
921: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_requested_date: '|| to_char(p_requested_date));
922: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_instance_id: '|| to_char(p_instance_id));

Line 919: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_inventory_item_id: '|| to_char(p_inventory_item_id));

915: x_atp_pegging_tab := MRP_ATP_PUB.Number_Arr();
916:
917: IF PG_DEBUG in ('Y', 'C') THEN
918: msc_sch_wb.atp_debug('********** INPUT DATA:Get_Forward_Material_Atp **********');
919: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_inventory_item_id: '|| to_char(p_inventory_item_id));
920: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_organization_id: '|| to_char(p_organization_id));
921: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_requested_date: '|| to_char(p_requested_date));
922: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_instance_id: '|| to_char(p_instance_id));
923: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_plan_id: '|| to_char(p_plan_id));

Line 920: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_organization_id: '|| to_char(p_organization_id));

916:
917: IF PG_DEBUG in ('Y', 'C') THEN
918: msc_sch_wb.atp_debug('********** INPUT DATA:Get_Forward_Material_Atp **********');
919: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_inventory_item_id: '|| to_char(p_inventory_item_id));
920: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_organization_id: '|| to_char(p_organization_id));
921: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_requested_date: '|| to_char(p_requested_date));
922: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_instance_id: '|| to_char(p_instance_id));
923: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_plan_id: '|| to_char(p_plan_id));
924: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_quantity_ordered: '|| to_char(p_quantity_ordered));

Line 921: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_requested_date: '|| to_char(p_requested_date));

917: IF PG_DEBUG in ('Y', 'C') THEN
918: msc_sch_wb.atp_debug('********** INPUT DATA:Get_Forward_Material_Atp **********');
919: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_inventory_item_id: '|| to_char(p_inventory_item_id));
920: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_organization_id: '|| to_char(p_organization_id));
921: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_requested_date: '|| to_char(p_requested_date));
922: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_instance_id: '|| to_char(p_instance_id));
923: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_plan_id: '|| to_char(p_plan_id));
924: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_quantity_ordered: '|| to_char(p_quantity_ordered));
925: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_demand_class: '|| p_demand_class);

Line 922: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_instance_id: '|| to_char(p_instance_id));

918: msc_sch_wb.atp_debug('********** INPUT DATA:Get_Forward_Material_Atp **********');
919: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_inventory_item_id: '|| to_char(p_inventory_item_id));
920: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_organization_id: '|| to_char(p_organization_id));
921: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_requested_date: '|| to_char(p_requested_date));
922: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_instance_id: '|| to_char(p_instance_id));
923: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_plan_id: '|| to_char(p_plan_id));
924: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_quantity_ordered: '|| to_char(p_quantity_ordered));
925: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_demand_class: '|| p_demand_class);
926: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_substitution_window:= ' || p_substitution_window);

Line 923: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_plan_id: '|| to_char(p_plan_id));

919: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_inventory_item_id: '|| to_char(p_inventory_item_id));
920: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_organization_id: '|| to_char(p_organization_id));
921: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_requested_date: '|| to_char(p_requested_date));
922: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_instance_id: '|| to_char(p_instance_id));
923: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_plan_id: '|| to_char(p_plan_id));
924: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_quantity_ordered: '|| to_char(p_quantity_ordered));
925: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_demand_class: '|| p_demand_class);
926: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_substitution_window:= ' || p_substitution_window);
927: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_parent_pegging_id:= ' || p_parent_pegging_id);

Line 924: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_quantity_ordered: '|| to_char(p_quantity_ordered));

920: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_organization_id: '|| to_char(p_organization_id));
921: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_requested_date: '|| to_char(p_requested_date));
922: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_instance_id: '|| to_char(p_instance_id));
923: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_plan_id: '|| to_char(p_plan_id));
924: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_quantity_ordered: '|| to_char(p_quantity_ordered));
925: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_demand_class: '|| p_demand_class);
926: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_substitution_window:= ' || p_substitution_window);
927: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_parent_pegging_id:= ' || p_parent_pegging_id);
928: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_order_number:= ' || p_order_number);

Line 925: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_demand_class: '|| p_demand_class);

921: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_requested_date: '|| to_char(p_requested_date));
922: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_instance_id: '|| to_char(p_instance_id));
923: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_plan_id: '|| to_char(p_plan_id));
924: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_quantity_ordered: '|| to_char(p_quantity_ordered));
925: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_demand_class: '|| p_demand_class);
926: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_substitution_window:= ' || p_substitution_window);
927: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_parent_pegging_id:= ' || p_parent_pegging_id);
928: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_order_number:= ' || p_order_number);
929: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_get_mat_in_rec.shipping_cal_code:= ' || p_get_mat_in_rec.shipping_cal_code);

Line 926: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_substitution_window:= ' || p_substitution_window);

922: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_instance_id: '|| to_char(p_instance_id));
923: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_plan_id: '|| to_char(p_plan_id));
924: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_quantity_ordered: '|| to_char(p_quantity_ordered));
925: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_demand_class: '|| p_demand_class);
926: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_substitution_window:= ' || p_substitution_window);
927: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_parent_pegging_id:= ' || p_parent_pegging_id);
928: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_order_number:= ' || p_order_number);
929: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_get_mat_in_rec.shipping_cal_code:= ' || p_get_mat_in_rec.shipping_cal_code);
930: END IF;

Line 927: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_parent_pegging_id:= ' || p_parent_pegging_id);

923: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_plan_id: '|| to_char(p_plan_id));
924: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_quantity_ordered: '|| to_char(p_quantity_ordered));
925: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_demand_class: '|| p_demand_class);
926: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_substitution_window:= ' || p_substitution_window);
927: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_parent_pegging_id:= ' || p_parent_pegging_id);
928: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_order_number:= ' || p_order_number);
929: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_get_mat_in_rec.shipping_cal_code:= ' || p_get_mat_in_rec.shipping_cal_code);
930: END IF;
931:

Line 928: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_order_number:= ' || p_order_number);

924: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_quantity_ordered: '|| to_char(p_quantity_ordered));
925: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_demand_class: '|| p_demand_class);
926: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_substitution_window:= ' || p_substitution_window);
927: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_parent_pegging_id:= ' || p_parent_pegging_id);
928: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_order_number:= ' || p_order_number);
929: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_get_mat_in_rec.shipping_cal_code:= ' || p_get_mat_in_rec.shipping_cal_code);
930: END IF;
931:
932: -- time_phased_atp changes begin

Line 929: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_get_mat_in_rec.shipping_cal_code:= ' || p_get_mat_in_rec.shipping_cal_code);

925: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_demand_class: '|| p_demand_class);
926: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_substitution_window:= ' || p_substitution_window);
927: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_parent_pegging_id:= ' || p_parent_pegging_id);
928: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_order_number:= ' || p_order_number);
929: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_get_mat_in_rec.shipping_cal_code:= ' || p_get_mat_in_rec.shipping_cal_code);
930: END IF;
931:
932: -- time_phased_atp changes begin
933: IF (p_inventory_item_id <> p_request_item_id) and p_atf_date is not null THEN

Line 936: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'Time Phased ATP = ' || l_time_phased_atp);

932: -- time_phased_atp changes begin
933: IF (p_inventory_item_id <> p_request_item_id) and p_atf_date is not null THEN
934: l_time_phased_atp := 'Y';
935: IF PG_DEBUG in ('Y', 'C') THEN
936: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'Time Phased ATP = ' || l_time_phased_atp);
937: END IF;
938: END IF;
939: -- time_phased_atp changes end
940:

Line 957: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_infinite_time_fence_date: '|| to_char(l_infinite_time_fence_date));

953:
954: x_get_mat_out_rec.infinite_time_fence_date := l_infinite_time_fence_date;
955:
956: IF PG_DEBUG in ('Y', 'C') THEN
957: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_infinite_time_fence_date: '|| to_char(l_infinite_time_fence_date));
958: END IF;
959: --diag_atp
960: /*
961: BEGIN

Line 972: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'Excpetion in Round Flag : ' || sqlcode || ':' || sqlerrm);

968: AND I.organization_id = p_organization_id;
969: EXCEPTION
970: WHEN OTHERS THEN
971: IF PG_DEBUG in ('Y', 'C') THEN
972: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'Excpetion in Round Flag : ' || sqlcode || ':' || sqlerrm);
973: END IF;
974: l_round_flag := 2; -- do not round
975: END;
976: */

Line 983: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_round_flag = '|| l_round_flag);

979: -- time_phased_atp
980: l_pf_item_id := MSC_ATP_PVT.G_ITEM_INFO_REC.product_family_id;
981:
982: IF PG_DEBUG in ('Y', 'C') THEN
983: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_round_flag = '|| l_round_flag);
984: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_inv_item_id = ' || l_inv_item_id);
985: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_pf_item_id = ' || l_pf_item_id);
986: END IF;
987:

Line 984: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_inv_item_id = ' || l_inv_item_id);

980: l_pf_item_id := MSC_ATP_PVT.G_ITEM_INFO_REC.product_family_id;
981:
982: IF PG_DEBUG in ('Y', 'C') THEN
983: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_round_flag = '|| l_round_flag);
984: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_inv_item_id = ' || l_inv_item_id);
985: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_pf_item_id = ' || l_pf_item_id);
986: END IF;
987:
988: MSC_ATP_PROC.get_org_default_info(p_instance_id, p_organization_id,

Line 985: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_pf_item_id = ' || l_pf_item_id);

981:
982: IF PG_DEBUG in ('Y', 'C') THEN
983: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_round_flag = '|| l_round_flag);
984: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_inv_item_id = ' || l_inv_item_id);
985: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_pf_item_id = ' || l_pf_item_id);
986: END IF;
987:
988: MSC_ATP_PROC.get_org_default_info(p_instance_id, p_organization_id,
989: l_default_atp_rule_id, l_calendar_code, l_calendar_exception_set_id,

Line 1012: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_sys_next_date = ' || l_sys_next_date);

1008: END;
1009: -- Bug 3371817 - Changes end.
1010: */
1011: IF PG_DEBUG in ('Y', 'C') THEN
1012: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_sys_next_date = ' || l_sys_next_date);
1013: END IF;
1014:
1015: ---forward steal:subst
1016: IF NVL(p_substitution_window, 0) = 0 THEN

Line 1030: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_substitution_end_date := ' || l_substitution_end_date);

1026:
1027: END IF;
1028:
1029: IF PG_DEBUG in ('Y', 'C') THEN
1030: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_substitution_end_date := ' || l_substitution_end_date);
1031: END IF;
1032:
1033: -- in case we want to support flex date
1034: l_requested_date := p_requested_date;

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

1052: l_item_to_use := l_inv_item_id;
1053: END IF;
1054:
1055: IF PG_DEBUG in ('Y', 'C') THEN
1056: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'Item to be used = ' || l_item_to_use);
1057: END IF;
1058: /* New allocation logic for time_phased_atp changes end */
1059:
1060: BEGIN

Line 1099: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'before lower priority dc for : ' || l_priority || ':'|| l_class);

1095: l_class := NULL;
1096: END ;
1097:
1098: IF PG_DEBUG in ('Y', 'C') THEN
1099: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'before lower priority dc for : ' || l_priority || ':'|| l_class);
1100: END IF;
1101:
1102: -- Order by clause reversed as we'll add request demand class at the end and acces the list bottom-up.
1103:

Line 1125: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'No. of DC : ' || l_demand_class_tab.Count);

1121: l_demand_class_tab(l_demand_class_tab.Count) := p_demand_class;
1122: l_demand_class_priority_tab(l_demand_class_priority_tab.Count) := l_priority;
1123:
1124: IF PG_DEBUG in ('Y', 'C') THEN
1125: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'No. of DC : ' || l_demand_class_tab.Count);
1126: END IF;
1127:
1128: -- Insert these demand classes in Global Temp Table to use in SELECT clause.
1129:

Line 1145: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'right before the huge select statement');

1141: FROM msc_plans plans
1142: WHERE plans.plan_id = p_plan_id;
1143:
1144: IF PG_DEBUG in ('Y', 'C') THEN
1145: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'right before the huge select statement');
1146: END IF;
1147:
1148: -- Check if full summary has been run - for summary enhancement
1149: IF MSC_ATP_PVT.G_SUMMARY_FLAG = 'Y' AND

Line 1156: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_time_phased_atp := ' || l_time_phased_atp);

1152:
1153: -- time_phased_atp
1154: IF l_time_phased_atp = 'N' THEN
1155: IF PG_DEBUG in ('Y', 'C') THEN
1156: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_time_phased_atp := ' || l_time_phased_atp);
1157: END IF;
1158:
1159: -- Summary SQL can be used
1160: SELECT SD_DATE,

Line 1234: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_time_phased_atp := ' || l_time_phased_atp);

1230:
1231: ELSE -- IF Not_PF_Case THEN
1232:
1233: IF PG_DEBUG in ('Y', 'C') THEN
1234: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_time_phased_atp := ' || l_time_phased_atp);
1235: END IF;
1236:
1237: MSC_ATP_PF.Get_Forward_Mat_Pf_Summ(
1238: l_inv_item_id,

Line 1252: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'Error occured in procedure Get_Forward_Mat_Pf_Summ');

1248: l_return_status
1249: );
1250: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1251: IF PG_DEBUG in ('Y', 'C') THEN
1252: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'Error occured in procedure Get_Forward_Mat_Pf_Summ');
1253: END IF;
1254: RAISE FND_API.G_EXC_ERROR;
1255: END IF;
1256:

Line 1263: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_time_phased_atp := ' || l_time_phased_atp);

1259: ELSE
1260: -- time_phased_atp
1261: IF l_time_phased_atp = 'N' THEN
1262: IF PG_DEBUG in ('Y', 'C') THEN
1263: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_time_phased_atp := ' || l_time_phased_atp);
1264: END IF;
1265:
1266: -- Use the SQL for non summary case
1267: SELECT SD_DATE,

Line 1321: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_time_phased_atp := ' || l_time_phased_atp);

1317:
1318: ELSE -- IF Not_PF_Case THEN
1319:
1320: IF PG_DEBUG in ('Y', 'C') THEN
1321: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_time_phased_atp := ' || l_time_phased_atp);
1322: END IF;
1323:
1324: MSC_ATP_PF.Get_Forward_Mat_Pf(
1325: l_inv_item_id,

Line 1338: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'Error occured in procedure Get_Forward_Mat_Pf');

1334: l_return_status
1335: );
1336: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1337: IF PG_DEBUG in ('Y', 'C') THEN
1338: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'Error occured in procedure Get_Forward_Mat_Pf');
1339: END IF;
1340: RAISE FND_API.G_EXC_ERROR;
1341: END IF;
1342:

Line 1349: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after huge select, l_atp_period_tab.COUNT : ' || l_atp_period_tab.COUNT);

1345: END IF;
1346:
1347:
1348: IF PG_DEBUG in ('Y', 'C') THEN
1349: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after huge select, l_atp_period_tab.COUNT : ' || l_atp_period_tab.COUNT);
1350: END IF;
1351:
1352: IF l_atp_period_tab.COUNT = 0 THEN
1353: -- need to add error message

Line 1362: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'before the atp_alloc_consume');

1358: -- Bug 3344138 initialize x_requested_date_quantity
1359: x_requested_date_quantity := 0;
1360:
1361: IF PG_DEBUG in ('Y', 'C') THEN
1362: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'before the atp_alloc_consume');
1363: END IF;
1364:
1365: -- do the backward consumption and accumulation
1366:

Line 1371: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || l_atp_period_tab(i) ||':'||l_atp_dc_tab(i) ||':' || l_atp_qty_tab(i));

1367: IF l_atp_period_tab.COUNT > 0 THEN
1368:
1369: FOR i IN 1..l_atp_period_tab.COUNT LOOP
1370: IF PG_DEBUG in ('Y', 'C') THEN
1371: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || l_atp_period_tab(i) ||':'||l_atp_dc_tab(i) ||':' || l_atp_qty_tab(i));
1372: END IF;
1373: END LOOP;
1374:
1375: -- time_phased_atp

Line 1389: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'Error occured in procedure Pf_Atp_Alloc_Consume');

1385: l_return_status
1386: );
1387: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1388: IF PG_DEBUG in ('Y', 'C') THEN
1389: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'Error occured in procedure Pf_Atp_Alloc_Consume');
1390: END IF;
1391: RAISE FND_API.G_EXC_ERROR;
1392: END IF;
1393: ELSE

Line 1398: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after the atp_alloc_consume');

1394: atp_alloc_consume(l_atp_qty_tab, l_atp_dc_tab, l_dc_list_tab, l_dc_start_index, l_dc_end_index);
1395: END IF;
1396:
1397: IF PG_DEBUG in ('Y', 'C') THEN
1398: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after the atp_alloc_consume');
1399: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_dc_list_tab.count = '||l_dc_list_tab.COUNT);
1400:
1401: FOR i IN 1..l_atp_period_tab.COUNT LOOP
1402: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || l_atp_period_tab(i) ||':'

Line 1399: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_dc_list_tab.count = '||l_dc_list_tab.COUNT);

1395: END IF;
1396:
1397: IF PG_DEBUG in ('Y', 'C') THEN
1398: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after the atp_alloc_consume');
1399: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_dc_list_tab.count = '||l_dc_list_tab.COUNT);
1400:
1401: FOR i IN 1..l_atp_period_tab.COUNT LOOP
1402: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || l_atp_period_tab(i) ||':'
1403: ||l_atp_dc_tab(i) ||':' || l_atp_qty_tab(i));

Line 1402: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || l_atp_period_tab(i) ||':'

1398: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after the atp_alloc_consume');
1399: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_dc_list_tab.count = '||l_dc_list_tab.COUNT);
1400:
1401: FOR i IN 1..l_atp_period_tab.COUNT LOOP
1402: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || l_atp_period_tab(i) ||':'
1403: ||l_atp_dc_tab(i) ||':' || l_atp_qty_tab(i));
1404: END LOOP;
1405: END IF;
1406:

Line 1411: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'Error occured in procedure Atp_Remove_Negatives');

1407: /* Cum drop issue changes begin*/
1408: MSC_AATP_PROC.Atp_Remove_Negatives(l_atp_qty_tab, l_return_status);
1409: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1410: IF PG_DEBUG in ('Y', 'C') THEN
1411: msc_sch_wb.atp_debug('Item_Pre_Allocated_Atp: ' || 'Error occured in procedure Atp_Remove_Negatives');
1412: END IF;
1413: RAISE FND_API.G_EXC_ERROR;
1414: END IF;
1415: /* Cum drop issue changes end*/

Line 1442: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || l_period_tab(i));

1438: );
1439:
1440: IF PG_DEBUG in ('Y', 'C') THEN
1441: FOR i IN 1..l_period_tab.COUNT LOOP
1442: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || l_period_tab(i));
1443: END LOOP;
1444: END IF;
1445:
1446: -- if requested date is eariler than sysdate, we have an issue here.

Line 1456: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'G_PTF_DATE:= ' || MSC_ATP_PVT.G_PTF_DATE);

1452: -- we use this l_atp_requested_date to do the search
1453: l_atp_requested_date := GREATEST(l_requested_date, trunc(l_sys_next_date));
1454:
1455: IF PG_DEBUG in ('Y', 'C') THEN
1456: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'G_PTF_DATE:= ' || MSC_ATP_PVT.G_PTF_DATE);
1457: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atp_requested_date = ' || l_atp_requested_date);
1458: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_level = ' || p_level);
1459: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab = ' || l_period_tab.COUNT);
1460: END IF;

Line 1457: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atp_requested_date = ' || l_atp_requested_date);

1453: l_atp_requested_date := GREATEST(l_requested_date, trunc(l_sys_next_date));
1454:
1455: IF PG_DEBUG in ('Y', 'C') THEN
1456: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'G_PTF_DATE:= ' || MSC_ATP_PVT.G_PTF_DATE);
1457: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atp_requested_date = ' || l_atp_requested_date);
1458: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_level = ' || p_level);
1459: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab = ' || l_period_tab.COUNT);
1460: END IF;
1461:

Line 1458: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_level = ' || p_level);

1454:
1455: IF PG_DEBUG in ('Y', 'C') THEN
1456: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'G_PTF_DATE:= ' || MSC_ATP_PVT.G_PTF_DATE);
1457: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atp_requested_date = ' || l_atp_requested_date);
1458: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_level = ' || p_level);
1459: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab = ' || l_period_tab.COUNT);
1460: END IF;
1461:
1462: l_atp_quantity := 0;

Line 1459: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab = ' || l_period_tab.COUNT);

1455: IF PG_DEBUG in ('Y', 'C') THEN
1456: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'G_PTF_DATE:= ' || MSC_ATP_PVT.G_PTF_DATE);
1457: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atp_requested_date = ' || l_atp_requested_date);
1458: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_level = ' || p_level);
1459: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab = ' || l_period_tab.COUNT);
1460: END IF;
1461:
1462: l_atp_quantity := 0;
1463: --x_requested_date_quantity := 0; -- Bug 3344138

Line 1482: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ============================');

1478: ELSIF (k = 1) and (l_period_tab(k) > p_atf_date) THEN
1479: k_atf := 0;
1480: END IF;
1481: IF PG_DEBUG in ('Y', 'C') THEN
1482: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ============================');
1483: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k : ' || k);
1484: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab(k) : ' || l_period_tab(k));
1485: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_atf_date : ' || p_atf_date);
1486: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k_atf : ' || k_atf);

Line 1483: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k : ' || k);

1479: k_atf := 0;
1480: END IF;
1481: IF PG_DEBUG in ('Y', 'C') THEN
1482: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ============================');
1483: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k : ' || k);
1484: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab(k) : ' || l_period_tab(k));
1485: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_atf_date : ' || p_atf_date);
1486: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k_atf : ' || k_atf);
1487: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ============================');

Line 1484: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab(k) : ' || l_period_tab(k));

1480: END IF;
1481: IF PG_DEBUG in ('Y', 'C') THEN
1482: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ============================');
1483: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k : ' || k);
1484: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab(k) : ' || l_period_tab(k));
1485: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_atf_date : ' || p_atf_date);
1486: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k_atf : ' || k_atf);
1487: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ============================');
1488: END IF;

Line 1485: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_atf_date : ' || p_atf_date);

1481: IF PG_DEBUG in ('Y', 'C') THEN
1482: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ============================');
1483: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k : ' || k);
1484: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab(k) : ' || l_period_tab(k));
1485: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_atf_date : ' || p_atf_date);
1486: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k_atf : ' || k_atf);
1487: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ============================');
1488: END IF;
1489: END IF;

Line 1486: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k_atf : ' || k_atf);

1482: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ============================');
1483: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k : ' || k);
1484: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab(k) : ' || l_period_tab(k));
1485: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_atf_date : ' || p_atf_date);
1486: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k_atf : ' || k_atf);
1487: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ============================');
1488: END IF;
1489: END IF;
1490: -- time_phased_atp changes end

Line 1487: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ============================');

1483: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k : ' || k);
1484: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab(k) : ' || l_period_tab(k));
1485: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'p_atf_date : ' || p_atf_date);
1486: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k_atf : ' || k_atf);
1487: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ============================');
1488: END IF;
1489: END IF;
1490: -- time_phased_atp changes end
1491:

Line 1498: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'before trim = ' || l_used_dc_tab.COUNT);

1494: --l_used_dc_tab.TRIM(l_used_dc_tab(l_used_dc_tab.COUNT));
1495: --l_used_dc_qty.TRIM(l_used_dc_qty(l_used_dc_qty.COUNT));
1496:
1497: IF PG_DEBUG in ('Y', 'C') THEN
1498: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'before trim = ' || l_used_dc_tab.COUNT);
1499: END IF;
1500: l_used_dc_tab.TRIM(l_used_dc_tab.COUNT);
1501: l_used_dc_qty.TRIM(l_used_dc_qty.COUNT);
1502: -- time_phased_atp

Line 1507: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after trim = ' || l_used_dc_tab.COUNT);

1503: IF l_time_phased_atp = 'Y' THEN
1504: l_used_dc_mem_qty.TRIM(l_used_dc_mem_qty.COUNT);
1505: END IF;
1506: IF PG_DEBUG in ('Y', 'C') THEN
1507: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after trim = ' || l_used_dc_tab.COUNT);
1508: END IF;
1509:
1510: FOR i in REVERSE 1..l_demand_class_tab.COUNT LOOP
1511: IF PG_DEBUG in ('Y', 'C') THEN

Line 1512: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'before j = ' || l_demand_class_tab(i));

1508: END IF;
1509:
1510: FOR i in REVERSE 1..l_demand_class_tab.COUNT LOOP
1511: IF PG_DEBUG in ('Y', 'C') THEN
1512: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'before j = ' || l_demand_class_tab(i));
1513: END IF;
1514: n := 0;
1515: FOR j IN 1..l_dc_list_tab.COUNT LOOP
1516: IF PG_DEBUG in ('Y', 'C') THEN

Line 1517: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'inside j = ' || l_dc_list_tab(j));

1513: END IF;
1514: n := 0;
1515: FOR j IN 1..l_dc_list_tab.COUNT LOOP
1516: IF PG_DEBUG in ('Y', 'C') THEN
1517: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'inside j = ' || l_dc_list_tab(j));
1518: END IF;
1519:
1520: IF l_dc_list_tab(j) = l_demand_class_tab(i) THEN
1521: IF PG_DEBUG in ('Y', 'C') THEN

Line 1522: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'inside IF = ' || j);

1518: END IF;
1519:
1520: IF l_dc_list_tab(j) = l_demand_class_tab(i) THEN
1521: IF PG_DEBUG in ('Y', 'C') THEN
1522: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'inside IF = ' || j);
1523: END IF;
1524: n := j;
1525: EXIT;
1526: END IF;

Line 1530: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after loop = ' || j);

1526: END IF;
1527: END LOOP; --FOR j IN 1..l_dc_list_tab.COUNT LOOP
1528:
1529: IF PG_DEBUG in ('Y', 'C') THEN
1530: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after loop = ' || j);
1531: END IF;
1532: IF NVL(n, 0) > 0 THEN
1533:
1534: j := n;

Line 1536: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'before m = ' || l_dc_list_tab(j));

1532: IF NVL(n, 0) > 0 THEN
1533:
1534: j := n;
1535: IF PG_DEBUG in ('Y', 'C') THEN
1536: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'before m = ' || l_dc_list_tab(j));
1537: END IF;
1538:
1539: -- Reset m_atf
1540: m_atf := NULL;

Line 1585: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: <<<<<<<<<<<<< >>>>>>>>>>>>>');

1581: /* we are using qty within and outside ATF*/
1582: l_used_dc_mem_qty(l_used_dc_mem_qty.COUNT) := l_atp_qty_tab(m_atf);
1583: END IF;
1584: IF PG_DEBUG in ('Y', 'C') THEN
1585: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: <<<<<<<<<<<<< >>>>>>>>>>>>>');
1586: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k_atf = ' || k_atf);
1587: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_used_dc_mem_qty('
1588: || l_used_dc_mem_qty.COUNT || ') = ' || l_used_dc_mem_qty(l_used_dc_mem_qty.COUNT));
1589: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: <<<<<<<<<<<<< >>>>>>>>>>>>>');

Line 1586: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k_atf = ' || k_atf);

1582: l_used_dc_mem_qty(l_used_dc_mem_qty.COUNT) := l_atp_qty_tab(m_atf);
1583: END IF;
1584: IF PG_DEBUG in ('Y', 'C') THEN
1585: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: <<<<<<<<<<<<< >>>>>>>>>>>>>');
1586: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k_atf = ' || k_atf);
1587: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_used_dc_mem_qty('
1588: || l_used_dc_mem_qty.COUNT || ') = ' || l_used_dc_mem_qty(l_used_dc_mem_qty.COUNT));
1589: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: <<<<<<<<<<<<< >>>>>>>>>>>>>');
1590: END IF;

Line 1587: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_used_dc_mem_qty('

1583: END IF;
1584: IF PG_DEBUG in ('Y', 'C') THEN
1585: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: <<<<<<<<<<<<< >>>>>>>>>>>>>');
1586: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k_atf = ' || k_atf);
1587: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_used_dc_mem_qty('
1588: || l_used_dc_mem_qty.COUNT || ') = ' || l_used_dc_mem_qty(l_used_dc_mem_qty.COUNT));
1589: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: <<<<<<<<<<<<< >>>>>>>>>>>>>');
1590: END IF;
1591: END IF;

Line 1589: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: <<<<<<<<<<<<< >>>>>>>>>>>>>');

1585: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: <<<<<<<<<<<<< >>>>>>>>>>>>>');
1586: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k_atf = ' || k_atf);
1587: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_used_dc_mem_qty('
1588: || l_used_dc_mem_qty.COUNT || ') = ' || l_used_dc_mem_qty(l_used_dc_mem_qty.COUNT));
1589: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: <<<<<<<<<<<<< >>>>>>>>>>>>>');
1590: END IF;
1591: END IF;
1592: -- time_phased_atp changes end
1593:

Line 1599: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'before l_atp_quantity = ' || l_atp_quantity);

1595: l_stealing_flag := 'Y';
1596: END IF; --IF l_used_dc_tab(l_used_dc_tab.COUNT) <> p_demand_class THEN
1597:
1598: IF PG_DEBUG in ('Y', 'C') THEN
1599: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'before l_atp_quantity = ' || l_atp_quantity);
1600: msc_sch_wb.atp_debug('Used DC qty := ' || l_used_dc_qty(l_used_dc_qty.COUNT));
1601: END IF;
1602:
1603: IF l_atp_quantity + l_used_dc_qty(l_used_dc_qty.COUNT) >= p_quantity_ordered THEN

Line 1600: msc_sch_wb.atp_debug('Used DC qty := ' || l_used_dc_qty(l_used_dc_qty.COUNT));

1596: END IF; --IF l_used_dc_tab(l_used_dc_tab.COUNT) <> p_demand_class THEN
1597:
1598: IF PG_DEBUG in ('Y', 'C') THEN
1599: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'before l_atp_quantity = ' || l_atp_quantity);
1600: msc_sch_wb.atp_debug('Used DC qty := ' || l_used_dc_qty(l_used_dc_qty.COUNT));
1601: END IF;
1602:
1603: IF l_atp_quantity + l_used_dc_qty(l_used_dc_qty.COUNT) >= p_quantity_ordered THEN
1604:

Line 1634: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || x_atp_date_quantity_this_level);

1630: */
1631: --3443276: we need to return date > req date
1632: x_atp_date_this_level := GREATEST(l_period_tab(k),MSC_ATP_PVT.G_PTF_DATE, l_atp_requested_date);
1633: IF PG_DEBUG in ('Y', 'C') THEN
1634: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || x_atp_date_quantity_this_level);
1635: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || x_atp_date_this_level);
1636: END IF;
1637:
1638: EXIT;

Line 1635: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || x_atp_date_this_level);

1631: --3443276: we need to return date > req date
1632: x_atp_date_this_level := GREATEST(l_period_tab(k),MSC_ATP_PVT.G_PTF_DATE, l_atp_requested_date);
1633: IF PG_DEBUG in ('Y', 'C') THEN
1634: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || x_atp_date_quantity_this_level);
1635: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || x_atp_date_this_level);
1636: END IF;
1637:
1638: EXIT;
1639: --END IF;

Line 1651: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after l_atp_quantity = ' || l_atp_quantity);

1647: -- time_phased_atp changes end
1648: END IF;
1649:
1650: IF PG_DEBUG in ('Y', 'C') THEN
1651: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after l_atp_quantity = ' || l_atp_quantity);
1652: END IF;
1653:
1654: ELSIF (m_atf is null) AND (k_atf is not null) AND (k_atf <> 0)
1655: AND ((l_atp_period_tab(m) = l_period_tab(k_atf))

Line 1683: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab : ' || l_period_tab(k));

1679: -- x_atf_date_quantity := l_atf_quantity;
1680: -- let say the next period is on Day5 but our request in on Day2.
1681:
1682: IF PG_DEBUG in ('Y', 'C') THEN
1683: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab : ' || l_period_tab(k));
1684: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab.count : ' || l_period_tab.COUNT);
1685: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k : ' || k);
1686: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atp_requested_date : ' || l_atp_requested_date);
1687: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atp_quantity : ' || l_atp_quantity);

Line 1684: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab.count : ' || l_period_tab.COUNT);

1680: -- let say the next period is on Day5 but our request in on Day2.
1681:
1682: IF PG_DEBUG in ('Y', 'C') THEN
1683: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab : ' || l_period_tab(k));
1684: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab.count : ' || l_period_tab.COUNT);
1685: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k : ' || k);
1686: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atp_requested_date : ' || l_atp_requested_date);
1687: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atp_quantity : ' || l_atp_quantity);
1688: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atf_quantity : ' || l_atf_quantity);

Line 1685: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k : ' || k);

1681:
1682: IF PG_DEBUG in ('Y', 'C') THEN
1683: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab : ' || l_period_tab(k));
1684: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab.count : ' || l_period_tab.COUNT);
1685: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k : ' || k);
1686: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atp_requested_date : ' || l_atp_requested_date);
1687: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atp_quantity : ' || l_atp_quantity);
1688: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atf_quantity : ' || l_atf_quantity);
1689: END IF;

Line 1686: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atp_requested_date : ' || l_atp_requested_date);

1682: IF PG_DEBUG in ('Y', 'C') THEN
1683: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab : ' || l_period_tab(k));
1684: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab.count : ' || l_period_tab.COUNT);
1685: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k : ' || k);
1686: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atp_requested_date : ' || l_atp_requested_date);
1687: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atp_quantity : ' || l_atp_quantity);
1688: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atf_quantity : ' || l_atf_quantity);
1689: END IF;
1690:

Line 1687: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atp_quantity : ' || l_atp_quantity);

1683: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab : ' || l_period_tab(k));
1684: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab.count : ' || l_period_tab.COUNT);
1685: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k : ' || k);
1686: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atp_requested_date : ' || l_atp_requested_date);
1687: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atp_quantity : ' || l_atp_quantity);
1688: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atf_quantity : ' || l_atf_quantity);
1689: END IF;
1690:
1691: IF k < l_period_tab.COUNT THEN

Line 1688: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atf_quantity : ' || l_atf_quantity);

1684: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab.count : ' || l_period_tab.COUNT);
1685: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'k : ' || k);
1686: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atp_requested_date : ' || l_atp_requested_date);
1687: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atp_quantity : ' || l_atp_quantity);
1688: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atf_quantity : ' || l_atf_quantity);
1689: END IF;
1690:
1691: IF k < l_period_tab.COUNT THEN
1692: IF PG_DEBUG in ('Y', 'C') THEN

Line 1693: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab (k+1) : ' || l_period_tab(k+1));

1689: END IF;
1690:
1691: IF k < l_period_tab.COUNT THEN
1692: IF PG_DEBUG in ('Y', 'C') THEN
1693: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_period_tab (k+1) : ' || l_period_tab(k+1));
1694: END IF;
1695: IF (l_atp_requested_date >= l_period_tab(k)) AND
1696: (l_atp_requested_date < l_period_tab(k + 1)) THEN
1697: x_requested_date_quantity := l_atp_quantity;

Line 1708: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: l_requested_date < l_atp_requested_date');

1704:
1705: -- dsting 2807614
1706: IF l_atp_requested_date > l_requested_date THEN
1707: IF PG_DEBUG in ('Y', 'C') THEN
1708: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: l_requested_date < l_atp_requested_date');
1709: END IF;
1710: x_requested_date_quantity := 0;
1711: END IF;
1712:

Line 1714: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'x_requested_date_quantity : ' || x_requested_date_quantity);

1710: x_requested_date_quantity := 0;
1711: END IF;
1712:
1713: IF PG_DEBUG in ('Y', 'C') THEN
1714: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'x_requested_date_quantity : ' || x_requested_date_quantity);
1715: END IF;
1716:
1717: IF x_atp_date_this_level IS NOT NULL THEN
1718: EXIT;

Line 1731: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_used_dc_qty(i) : ' || l_used_dc_qty(i));

1727: l_stealing_quantity := LEAST(l_used_dc_qty(i), (p_quantity_ordered - NVL(l_total_atp_qty, 0)));
1728: l_total_atp_qty := NVL(l_total_atp_qty, 0) + l_stealing_quantity;
1729:
1730: IF PG_DEBUG in ('Y', 'C') THEN
1731: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_used_dc_qty(i) : ' || l_used_dc_qty(i));
1732: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_stealing_quantity : ' || l_stealing_quantity);
1733: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_total_atp_qty : ' || l_total_atp_qty);
1734: END IF;
1735:

Line 1732: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_stealing_quantity : ' || l_stealing_quantity);

1728: l_total_atp_qty := NVL(l_total_atp_qty, 0) + l_stealing_quantity;
1729:
1730: IF PG_DEBUG in ('Y', 'C') THEN
1731: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_used_dc_qty(i) : ' || l_used_dc_qty(i));
1732: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_stealing_quantity : ' || l_stealing_quantity);
1733: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_total_atp_qty : ' || l_total_atp_qty);
1734: END IF;
1735:
1736: IF p_demand_class <> l_used_dc_tab(i) THEN

Line 1733: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_total_atp_qty : ' || l_total_atp_qty);

1729:
1730: IF PG_DEBUG in ('Y', 'C') THEN
1731: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_used_dc_qty(i) : ' || l_used_dc_qty(i));
1732: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_stealing_quantity : ' || l_stealing_quantity);
1733: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_total_atp_qty : ' || l_total_atp_qty);
1734: END IF;
1735:
1736: IF p_demand_class <> l_used_dc_tab(i) THEN
1737:

Line 1744: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_pf_stealing_qty : ' || l_pf_stealing_qty);

1740: x_atf_date_quantity := x_atf_date_quantity + l_mem_stealing_qty ;
1741: x_used_available_quantity := x_used_available_quantity + l_stealing_quantity;
1742:
1743: IF PG_DEBUG in ('Y', 'C') THEN
1744: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_pf_stealing_qty : ' || l_pf_stealing_qty);
1745: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_mem_stealing_qty : ' || l_mem_stealing_qty);
1746: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'x_atf_date_quantity : ' || x_atf_date_quantity);
1747: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'x_used_available_quantity : ' || x_used_available_quantity);
1748: END IF;

Line 1745: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_mem_stealing_qty : ' || l_mem_stealing_qty);

1741: x_used_available_quantity := x_used_available_quantity + l_stealing_quantity;
1742:
1743: IF PG_DEBUG in ('Y', 'C') THEN
1744: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_pf_stealing_qty : ' || l_pf_stealing_qty);
1745: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_mem_stealing_qty : ' || l_mem_stealing_qty);
1746: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'x_atf_date_quantity : ' || x_atf_date_quantity);
1747: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'x_used_available_quantity : ' || x_used_available_quantity);
1748: END IF;
1749:

Line 1746: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'x_atf_date_quantity : ' || x_atf_date_quantity);

1742:
1743: IF PG_DEBUG in ('Y', 'C') THEN
1744: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_pf_stealing_qty : ' || l_pf_stealing_qty);
1745: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_mem_stealing_qty : ' || l_mem_stealing_qty);
1746: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'x_atf_date_quantity : ' || x_atf_date_quantity);
1747: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'x_used_available_quantity : ' || x_used_available_quantity);
1748: END IF;
1749:
1750: ELSE

Line 1747: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'x_used_available_quantity : ' || x_used_available_quantity);

1743: IF PG_DEBUG in ('Y', 'C') THEN
1744: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_pf_stealing_qty : ' || l_pf_stealing_qty);
1745: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_mem_stealing_qty : ' || l_mem_stealing_qty);
1746: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'x_atf_date_quantity : ' || x_atf_date_quantity);
1747: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'x_used_available_quantity : ' || x_used_available_quantity);
1748: END IF;
1749:
1750: ELSE
1751: x_atf_date_quantity := x_atf_date_quantity + NVL(l_used_dc_mem_qty(i), 0);

Line 1755: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'x_atf_date_quantity :Else ' || x_atf_date_quantity);

1751: x_atf_date_quantity := x_atf_date_quantity + NVL(l_used_dc_mem_qty(i), 0);
1752: x_used_available_quantity := x_used_available_quantity + NVL(l_used_dc_qty(i),0);
1753:
1754: IF PG_DEBUG in ('Y', 'C') THEN
1755: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'x_atf_date_quantity :Else ' || x_atf_date_quantity);
1756: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'x_used_available_quantity :Else ' || x_used_available_quantity );
1757: END IF;
1758: END IF;
1759: END LOOP; --FOR i IN 1..l_used_dc_qty.COUNT LOOP

Line 1756: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'x_used_available_quantity :Else ' || x_used_available_quantity );

1752: x_used_available_quantity := x_used_available_quantity + NVL(l_used_dc_qty(i),0);
1753:
1754: IF PG_DEBUG in ('Y', 'C') THEN
1755: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'x_atf_date_quantity :Else ' || x_atf_date_quantity);
1756: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'x_used_available_quantity :Else ' || x_used_available_quantity );
1757: END IF;
1758: END IF;
1759: END LOOP; --FOR i IN 1..l_used_dc_qty.COUNT LOOP
1760: END IF;

Line 1769: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'before setting pegging for : ' || p_item_name);

1765:
1766: DELETE msc_alloc_temp;
1767:
1768: IF PG_DEBUG in ('Y', 'C') THEN
1769: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'before setting pegging for : ' || p_item_name);
1770: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'x_atf_date_quantity : ' || x_atf_date_quantity);
1771: END IF;
1772: -- Insert pegging record for Supply/ Stealing.
1773:

Line 1770: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'x_atf_date_quantity : ' || x_atf_date_quantity);

1766: DELETE msc_alloc_temp;
1767:
1768: IF PG_DEBUG in ('Y', 'C') THEN
1769: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'before setting pegging for : ' || p_item_name);
1770: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'x_atf_date_quantity : ' || x_atf_date_quantity);
1771: END IF;
1772: -- Insert pegging record for Supply/ Stealing.
1773:
1774: l_pegging_rec.session_id:= MSC_ATP_PVT.G_SESSION_ID;

Line 1815: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atp_rec.quantity_ordered ='|| p_quantity_ordered);

1811: l_atp_rec.quantity_ordered := p_quantity_ordered;
1812: l_atp_rec.requested_ship_date := p_requested_date;
1813:
1814: IF PG_DEBUG in ('Y', 'C') THEN
1815: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atp_rec.quantity_ordered ='|| p_quantity_ordered);
1816: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atp_rec.requested_ship_date ='|| p_requested_date);
1817: END IF;
1818: --S-Cto_rearch: all demands are now dependent demand
1819: --l_atp_rec.origination_type := 30;

Line 1816: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atp_rec.requested_ship_date ='|| p_requested_date);

1812: l_atp_rec.requested_ship_date := p_requested_date;
1813:
1814: IF PG_DEBUG in ('Y', 'C') THEN
1815: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atp_rec.quantity_ordered ='|| p_quantity_ordered);
1816: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_atp_rec.requested_ship_date ='|| p_requested_date);
1817: END IF;
1818: --S-Cto_rearch: all demands are now dependent demand
1819: --l_atp_rec.origination_type := 30;
1820: l_atp_rec.origination_type := 1;

Line 1850: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after calling Add_Mat_Demand, l_demand_id ='||

1846: 1, -- Demand Class True for forward stealing.
1847: l_demand_id);
1848:
1849: IF PG_DEBUG in ('Y', 'C') THEN
1850: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after calling Add_Mat_Demand, l_demand_id ='||
1851: l_demand_id);
1852: END IF;
1853:
1854: --bug 3432341: pass demand id back to calling module

Line 1859: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'Before Adding Demand Pegging for '|| p_item_name);

1855: x_get_mat_out_rec.demand_id := l_demand_id;
1856:
1857: -- For component forward stealing need to add demand pegging.
1858: IF PG_DEBUG in ('Y', 'C') THEN
1859: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'Before Adding Demand Pegging for '|| p_item_name);
1860: END IF;
1861:
1862: l_pegging_rec.parent_pegging_id:= p_parent_pegging_id;
1863: l_pegging_rec.atp_level:= p_level + 1;

Line 1878: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_pegging_rec.supply_demand_quantity:= : ' || p_quantity_ordered);

1874: --l_pegging_rec.request_item_id := p_inventory_item_id;
1875: l_pegging_rec.request_item_id := p_request_item_id; -- time_phased_atp
1876:
1877: IF PG_DEBUG in ('Y', 'C') THEN
1878: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_pegging_rec.supply_demand_quantity:= : ' || p_quantity_ordered);
1879: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_pegging_rec.supply_demand_date:= : ' || p_requested_date);
1880: END IF;
1881:
1882: --diag_atp

Line 1879: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_pegging_rec.supply_demand_date:= : ' || p_requested_date);

1875: l_pegging_rec.request_item_id := p_request_item_id; -- time_phased_atp
1876:
1877: IF PG_DEBUG in ('Y', 'C') THEN
1878: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_pegging_rec.supply_demand_quantity:= : ' || p_quantity_ordered);
1879: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'l_pegging_rec.supply_demand_date:= : ' || p_requested_date);
1880: END IF;
1881:
1882: --diag_atp
1883: l_pegging_rec.pegging_type := MSC_ATP_PVT.ORG_DEMAND;

Line 1903: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after Add_Pegging : ' || l_demand_pegging_id);

1899: x_get_mat_out_rec.demand_pegging_id := l_demand_pegging_id;
1900:
1901: MSC_ATP_PVT.G_CTO_FORWARD_DMD_PEG := l_demand_pegging_id;
1902: IF PG_DEBUG in ('Y', 'C') THEN
1903: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after Add_Pegging : ' || l_demand_pegging_id);
1904: END IF;
1905:
1906: END IF;
1907: --- End Enhance CTO Phase 1 Req #17

Line 1911: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'before setting pegging for : ' || p_item_name);

1907: --- End Enhance CTO Phase 1 Req #17
1908:
1909:
1910: IF PG_DEBUG in ('Y', 'C') THEN
1911: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'before setting pegging for : ' || p_item_name);
1912: END IF;
1913: -- Insert pegging record for Supply/ Stealing.
1914:
1915: --- Enhance CTO Phase 1 Req #17

Line 1937: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'x_atp_date_this_level null for : ' || p_item_name);

1933:
1934: IF x_atp_date_this_level IS NULL THEN
1935:
1936: IF PG_DEBUG in ('Y', 'C') THEN
1937: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'x_atp_date_this_level null for : ' || p_item_name);
1938: END IF;
1939:
1940: l_stealing_flag := 'N';
1941: --x_requested_date_quantity := 0;

Line 1946: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'before IF');

1942: x_atp_date_this_level := TRUNC(l_infinite_time_fence_date);
1943: x_atp_date_quantity_this_level := MSC_ATP_PVT.INFINITE_NUMBER;
1944:
1945: IF PG_DEBUG in ('Y', 'C') THEN
1946: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'before IF');
1947: END IF;
1948:
1949: IF l_used_dc_tab.COUNT > 0 THEN
1950: l_used_dc_tab.TRIM(l_used_dc_tab.COUNT);

Line 1955: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after IF : ' || l_used_dc_tab.COUNT);

1951: l_used_dc_qty.TRIM(l_used_dc_qty.COUNT);
1952: END IF;
1953:
1954: IF PG_DEBUG in ('Y', 'C') THEN
1955: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after IF : ' || l_used_dc_tab.COUNT);
1956: END IF;
1957:
1958: l_used_dc_tab.EXTEND;
1959: l_used_dc_qty.EXTEND;

Line 1961: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after extend : ' || l_used_dc_tab.COUNT);

1957:
1958: l_used_dc_tab.EXTEND;
1959: l_used_dc_qty.EXTEND;
1960: IF PG_DEBUG in ('Y', 'C') THEN
1961: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after extend : ' || l_used_dc_tab.COUNT);
1962: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'before x_atp_pegging_tab : ' || x_atp_pegging_tab.COUNT);
1963: END IF;
1964: x_atp_pegging_tab.EXTEND;
1965:

Line 1962: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'before x_atp_pegging_tab : ' || x_atp_pegging_tab.COUNT);

1958: l_used_dc_tab.EXTEND;
1959: l_used_dc_qty.EXTEND;
1960: IF PG_DEBUG in ('Y', 'C') THEN
1961: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after extend : ' || l_used_dc_tab.COUNT);
1962: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'before x_atp_pegging_tab : ' || x_atp_pegging_tab.COUNT);
1963: END IF;
1964: x_atp_pegging_tab.EXTEND;
1965:
1966: IF PG_DEBUG in ('Y', 'C') THEN

Line 1967: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after x_atp_pegging_tab : ' || x_atp_pegging_tab.COUNT);

1963: END IF;
1964: x_atp_pegging_tab.EXTEND;
1965:
1966: IF PG_DEBUG in ('Y', 'C') THEN
1967: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after x_atp_pegging_tab : ' || x_atp_pegging_tab.COUNT);
1968: END IF;
1969:
1970: l_used_dc_tab(1) := p_demand_class;
1971:

Line 1973: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after dc : ' || l_used_dc_tab.COUNT);

1969:
1970: l_used_dc_tab(1) := p_demand_class;
1971:
1972: IF PG_DEBUG in ('Y', 'C') THEN
1973: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after dc : ' || l_used_dc_tab.COUNT);
1974: END IF;
1975:
1976: l_used_dc_qty(1) := x_atp_date_quantity_this_level;
1977: l_pegging_rec.supply_demand_quantity:= x_atp_date_quantity_this_level;

Line 1998: msc_sch_wb.atp_debug('ATP_Check: ' || '----------- Calendars passed to Pegging -----------------');

1994: l_pegging_rec.constraint_type := 1;
1995: l_pegging_rec.model_sd_flag := 2;
1996: -- Bug 3826234 start
1997: IF PG_DEBUG in ('Y', 'C') THEN
1998: msc_sch_wb.atp_debug('ATP_Check: ' || '----------- Calendars passed to Pegging -----------------');
1999: msc_sch_wb.atp_debug('ATP_Check: ' || 'shipping_cal_code = ' ||p_get_mat_in_rec.shipping_cal_code);
2000: msc_sch_wb.atp_debug('ATP_Check: ' || 'receiving_cal_code = ' ||p_get_mat_in_rec.receiving_cal_code);
2001: msc_sch_wb.atp_debug('ATP_Check: ' || 'intransit_cal_code = ' ||p_get_mat_in_rec.intransit_cal_code);
2002: msc_sch_wb.atp_debug('ATP_Check: ' || 'manufacturing_cal_code = ' ||p_get_mat_in_rec.manufacturing_cal_code);

Line 1999: msc_sch_wb.atp_debug('ATP_Check: ' || 'shipping_cal_code = ' ||p_get_mat_in_rec.shipping_cal_code);

1995: l_pegging_rec.model_sd_flag := 2;
1996: -- Bug 3826234 start
1997: IF PG_DEBUG in ('Y', 'C') THEN
1998: msc_sch_wb.atp_debug('ATP_Check: ' || '----------- Calendars passed to Pegging -----------------');
1999: msc_sch_wb.atp_debug('ATP_Check: ' || 'shipping_cal_code = ' ||p_get_mat_in_rec.shipping_cal_code);
2000: msc_sch_wb.atp_debug('ATP_Check: ' || 'receiving_cal_code = ' ||p_get_mat_in_rec.receiving_cal_code);
2001: msc_sch_wb.atp_debug('ATP_Check: ' || 'intransit_cal_code = ' ||p_get_mat_in_rec.intransit_cal_code);
2002: msc_sch_wb.atp_debug('ATP_Check: ' || 'manufacturing_cal_code = ' ||p_get_mat_in_rec.manufacturing_cal_code);
2003: msc_sch_wb.atp_debug('ATP_Check: ' || 'to_organization_id = ' ||p_get_mat_in_rec.to_organization_id);

Line 2000: msc_sch_wb.atp_debug('ATP_Check: ' || 'receiving_cal_code = ' ||p_get_mat_in_rec.receiving_cal_code);

1996: -- Bug 3826234 start
1997: IF PG_DEBUG in ('Y', 'C') THEN
1998: msc_sch_wb.atp_debug('ATP_Check: ' || '----------- Calendars passed to Pegging -----------------');
1999: msc_sch_wb.atp_debug('ATP_Check: ' || 'shipping_cal_code = ' ||p_get_mat_in_rec.shipping_cal_code);
2000: msc_sch_wb.atp_debug('ATP_Check: ' || 'receiving_cal_code = ' ||p_get_mat_in_rec.receiving_cal_code);
2001: msc_sch_wb.atp_debug('ATP_Check: ' || 'intransit_cal_code = ' ||p_get_mat_in_rec.intransit_cal_code);
2002: msc_sch_wb.atp_debug('ATP_Check: ' || 'manufacturing_cal_code = ' ||p_get_mat_in_rec.manufacturing_cal_code);
2003: msc_sch_wb.atp_debug('ATP_Check: ' || 'to_organization_id = ' ||p_get_mat_in_rec.to_organization_id);
2004: END IF;

Line 2001: msc_sch_wb.atp_debug('ATP_Check: ' || 'intransit_cal_code = ' ||p_get_mat_in_rec.intransit_cal_code);

1997: IF PG_DEBUG in ('Y', 'C') THEN
1998: msc_sch_wb.atp_debug('ATP_Check: ' || '----------- Calendars passed to Pegging -----------------');
1999: msc_sch_wb.atp_debug('ATP_Check: ' || 'shipping_cal_code = ' ||p_get_mat_in_rec.shipping_cal_code);
2000: msc_sch_wb.atp_debug('ATP_Check: ' || 'receiving_cal_code = ' ||p_get_mat_in_rec.receiving_cal_code);
2001: msc_sch_wb.atp_debug('ATP_Check: ' || 'intransit_cal_code = ' ||p_get_mat_in_rec.intransit_cal_code);
2002: msc_sch_wb.atp_debug('ATP_Check: ' || 'manufacturing_cal_code = ' ||p_get_mat_in_rec.manufacturing_cal_code);
2003: msc_sch_wb.atp_debug('ATP_Check: ' || 'to_organization_id = ' ||p_get_mat_in_rec.to_organization_id);
2004: END IF;
2005: IF p_parent_pegging_id is null then

Line 2002: msc_sch_wb.atp_debug('ATP_Check: ' || 'manufacturing_cal_code = ' ||p_get_mat_in_rec.manufacturing_cal_code);

1998: msc_sch_wb.atp_debug('ATP_Check: ' || '----------- Calendars passed to Pegging -----------------');
1999: msc_sch_wb.atp_debug('ATP_Check: ' || 'shipping_cal_code = ' ||p_get_mat_in_rec.shipping_cal_code);
2000: msc_sch_wb.atp_debug('ATP_Check: ' || 'receiving_cal_code = ' ||p_get_mat_in_rec.receiving_cal_code);
2001: msc_sch_wb.atp_debug('ATP_Check: ' || 'intransit_cal_code = ' ||p_get_mat_in_rec.intransit_cal_code);
2002: msc_sch_wb.atp_debug('ATP_Check: ' || 'manufacturing_cal_code = ' ||p_get_mat_in_rec.manufacturing_cal_code);
2003: msc_sch_wb.atp_debug('ATP_Check: ' || 'to_organization_id = ' ||p_get_mat_in_rec.to_organization_id);
2004: END IF;
2005: IF p_parent_pegging_id is null then
2006: l_pegging_rec.shipping_cal_code := p_get_mat_in_rec.shipping_cal_code;

Line 2003: msc_sch_wb.atp_debug('ATP_Check: ' || 'to_organization_id = ' ||p_get_mat_in_rec.to_organization_id);

1999: msc_sch_wb.atp_debug('ATP_Check: ' || 'shipping_cal_code = ' ||p_get_mat_in_rec.shipping_cal_code);
2000: msc_sch_wb.atp_debug('ATP_Check: ' || 'receiving_cal_code = ' ||p_get_mat_in_rec.receiving_cal_code);
2001: msc_sch_wb.atp_debug('ATP_Check: ' || 'intransit_cal_code = ' ||p_get_mat_in_rec.intransit_cal_code);
2002: msc_sch_wb.atp_debug('ATP_Check: ' || 'manufacturing_cal_code = ' ||p_get_mat_in_rec.manufacturing_cal_code);
2003: msc_sch_wb.atp_debug('ATP_Check: ' || 'to_organization_id = ' ||p_get_mat_in_rec.to_organization_id);
2004: END IF;
2005: IF p_parent_pegging_id is null then
2006: l_pegging_rec.shipping_cal_code := p_get_mat_in_rec.shipping_cal_code;
2007: l_pegging_rec.receiving_cal_code := p_get_mat_in_rec.receiving_cal_code;

Line 2011: msc_sch_wb.atp_debug('ATP_Check: ' || 'Inside IF');

2007: l_pegging_rec.receiving_cal_code := p_get_mat_in_rec.receiving_cal_code;
2008: l_pegging_rec.intransit_cal_code := p_get_mat_in_rec.intransit_cal_code;
2009: l_pegging_rec.manufacturing_cal_code := p_get_mat_in_rec.manufacturing_cal_code;
2010: IF PG_DEBUG in ('Y', 'C') THEN
2011: msc_sch_wb.atp_debug('ATP_Check: ' || 'Inside IF');
2012: END IF;
2013: ELSIF NVL(p_get_mat_in_rec.to_organization_id,p_get_mat_in_rec.organization_id)
2014: <> p_get_mat_in_rec.organization_id THEN
2015: l_pegging_rec.shipping_cal_code := p_get_mat_in_rec.shipping_cal_code;

Line 2020: msc_sch_wb.atp_debug('ATP_Check: ' || 'Inside ELSIF');

2016: l_pegging_rec.receiving_cal_code := p_get_mat_in_rec.receiving_cal_code;
2017: l_pegging_rec.intransit_cal_code := p_get_mat_in_rec.intransit_cal_code;
2018: l_pegging_rec.manufacturing_cal_code := NULL;
2019: IF PG_DEBUG in ('Y', 'C') THEN
2020: msc_sch_wb.atp_debug('ATP_Check: ' || 'Inside ELSIF');
2021: END IF;
2022: ELSE
2023: l_pegging_rec.manufacturing_cal_code := p_get_mat_in_rec.manufacturing_cal_code;
2024: l_pegging_rec.shipping_cal_code := NULL;

Line 2028: msc_sch_wb.atp_debug('ATP_Check: ' || 'Inside ELSE');

2024: l_pegging_rec.shipping_cal_code := NULL;
2025: l_pegging_rec.receiving_cal_code := NULL;
2026: l_pegging_rec.intransit_cal_code := NULL;
2027: IF PG_DEBUG in ('Y', 'C') THEN
2028: msc_sch_wb.atp_debug('ATP_Check: ' || 'Inside ELSE');
2029: END IF;
2030: END IF;
2031: -- Bug 3826234 end
2032: MSC_ATP_DB_UTILS.Add_Pegging(l_pegging_rec, x_atp_pegging_tab(1));

Line 2035: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after Add_Pegging : ' || x_atp_pegging_tab(1));

2031: -- Bug 3826234 end
2032: MSC_ATP_DB_UTILS.Add_Pegging(l_pegging_rec, x_atp_pegging_tab(1));
2033:
2034: IF PG_DEBUG in ('Y', 'C') THEN
2035: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after Add_Pegging : ' || x_atp_pegging_tab(1));
2036: END IF;
2037: ELSE
2038: l_stealing_quantity := 0;
2039: l_total_atp_qty := 0;

Line 2051: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'before inserting Stealing Info' || l_used_dc_tab(i));

2047: l_pegging_rec.supply_demand_quantity:= GREATEST(l_used_dc_qty(i), 0);
2048: l_pegging_rec.supply_demand_date:= x_atp_date_this_level;
2049:
2050: IF PG_DEBUG in ('Y', 'C') THEN
2051: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'before inserting Stealing Info' || l_used_dc_tab(i));
2052: END IF;
2053:
2054: IF p_demand_class <> l_used_dc_tab(i) THEN
2055: -- Add the Stealing Data.

Line 2075: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after insert into msc_alloc_supplies-Stealing Info' || l_transaction_id);

2071: p_demand_source_type,--cmro
2072: --bug3684383
2073: p_order_number);
2074: IF PG_DEBUG in ('Y', 'C') THEN
2075: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'after insert into msc_alloc_supplies-Stealing Info' || l_transaction_id);
2076: END IF;
2077: ELSE
2078: l_pf_stealing_qty := LEAST(l_used_dc_qty(i)-NVL(l_used_dc_mem_qty(i), 0), l_stealing_quantity);
2079: l_mem_stealing_qty := l_stealing_quantity - l_pf_stealing_qty;

Line 2103: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'Error occured in procedure Add_PF_Stealing_Supply_Details');

2099: p_order_number,
2100: l_return_status);
2101: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2102: IF PG_DEBUG in ('Y', 'C') THEN
2103: msc_sch_wb.atp_debug('Get_Forward_Material_Atp: ' || 'Error occured in procedure Add_PF_Stealing_Supply_Details');
2104: END IF;
2105: RAISE FND_API.G_EXC_ERROR;
2106: END IF;
2107: END IF;

Line 2164: msc_sch_wb.atp_debug('**********End Get_Forward_Material_Atp Procedure************');

2160: END LOOP; --FOR i IN 1..l_used_dc_qty.COUNT LOOP
2161: END IF; --IF NVL(l_stealing_flag, 'N') = 'Y' THEN
2162:
2163: IF PG_DEBUG in ('Y', 'C') THEN
2164: msc_sch_wb.atp_debug('**********End Get_Forward_Material_Atp Procedure************');
2165: END IF;
2166: EXCEPTION
2167: WHEN NO_DATA_FOUND THEN
2168: x_requested_date_quantity := 0.0;

Line 2173: msc_sch_wb.atp_debug('Get_Forward_Material_Atp, no data found');

2169: x_atp_date_this_level := TRUNC(l_infinite_time_fence_date);
2170: x_atp_date_quantity_this_level := MSC_ATP_PVT.INFINITE_NUMBER;
2171:
2172: IF PG_DEBUG in ('Y', 'C') THEN
2173: msc_sch_wb.atp_debug('Get_Forward_Material_Atp, no data found');
2174: END IF;
2175: WHEN MSC_ATP_PVT.NO_MATCHING_DATE_IN_CAL THEN --bug3583705
2176: x_requested_date_quantity := 0.0;
2177: x_atp_date_this_level := TRUNC(l_infinite_time_fence_date);

Line 2180: msc_sch_wb.atp_debug('MAtching cal date not found, in atp_check');

2176: x_requested_date_quantity := 0.0;
2177: x_atp_date_this_level := TRUNC(l_infinite_time_fence_date);
2178: x_atp_date_quantity_this_level := MSC_ATP_PVT.INFINITE_NUMBER;
2179: IF PG_DEBUG in ('Y', 'C') THEN
2180: msc_sch_wb.atp_debug('MAtching cal date not found, in atp_check');
2181: END IF;
2182: RAISE MSC_ATP_PVT.NO_MATCHING_DATE_IN_CAL;
2183: WHEN OTHERS THEN
2184: IF PG_DEBUG in ('Y', 'C') THEN

Line 2185: msc_sch_wb.atp_debug('Get_Forward_Material_Atp, sqlcode= '||sqlcode);

2181: END IF;
2182: RAISE MSC_ATP_PVT.NO_MATCHING_DATE_IN_CAL;
2183: WHEN OTHERS THEN
2184: IF PG_DEBUG in ('Y', 'C') THEN
2185: msc_sch_wb.atp_debug('Get_Forward_Material_Atp, sqlcode= '||sqlcode);
2186: msc_sch_wb.atp_debug('Get_Forward_Material_Atp, sqlerrm= '||sqlerrm);
2187: END IF;
2188: x_requested_date_quantity := 0.0;
2189: x_atp_date_this_level := TRUNC(l_infinite_time_fence_date);

Line 2186: msc_sch_wb.atp_debug('Get_Forward_Material_Atp, sqlerrm= '||sqlerrm);

2182: RAISE MSC_ATP_PVT.NO_MATCHING_DATE_IN_CAL;
2183: WHEN OTHERS THEN
2184: IF PG_DEBUG in ('Y', 'C') THEN
2185: msc_sch_wb.atp_debug('Get_Forward_Material_Atp, sqlcode= '||sqlcode);
2186: msc_sch_wb.atp_debug('Get_Forward_Material_Atp, sqlerrm= '||sqlerrm);
2187: END IF;
2188: x_requested_date_quantity := 0.0;
2189: x_atp_date_this_level := TRUNC(l_infinite_time_fence_date);
2190: x_atp_date_quantity_this_level := MSC_ATP_PVT.INFINITE_NUMBER;