DBA Data[Home] [Help]

APPS.MSC_ATP_ALLOC dependencies on MSC_SCH_WB

Line 149: msc_sch_wb.set_session_id(p_session_id);

145: l_dest_family_item_id NUMBER;
146:
147: BEGIN
148: -- Setting the session_id
149: msc_sch_wb.set_session_id(p_session_id);
150:
151: -- Debug Messages
152: IF PG_DEBUG in ('Y', 'C') THEN
153: msc_sch_wb.atp_debug('View_Allocation_Details: ' || '*********Begin procedure View_Allocation_Details ********');

Line 153: msc_sch_wb.atp_debug('View_Allocation_Details: ' || '*********Begin procedure View_Allocation_Details ********');

149: msc_sch_wb.set_session_id(p_session_id);
150:
151: -- Debug Messages
152: IF PG_DEBUG in ('Y', 'C') THEN
153: msc_sch_wb.atp_debug('View_Allocation_Details: ' || '*********Begin procedure View_Allocation_Details ********');
154: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'p_inventory_item_id = ' ||to_char(p_inventory_item_id));
155: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'p_instance_id = ' ||to_char(p_instance_id));
156: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'p_organization_id = ' ||to_char(p_organization_id));
157: END IF;

Line 154: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'p_inventory_item_id = ' ||to_char(p_inventory_item_id));

150:
151: -- Debug Messages
152: IF PG_DEBUG in ('Y', 'C') THEN
153: msc_sch_wb.atp_debug('View_Allocation_Details: ' || '*********Begin procedure View_Allocation_Details ********');
154: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'p_inventory_item_id = ' ||to_char(p_inventory_item_id));
155: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'p_instance_id = ' ||to_char(p_instance_id));
156: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'p_organization_id = ' ||to_char(p_organization_id));
157: END IF;
158:

Line 155: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'p_instance_id = ' ||to_char(p_instance_id));

151: -- Debug Messages
152: IF PG_DEBUG in ('Y', 'C') THEN
153: msc_sch_wb.atp_debug('View_Allocation_Details: ' || '*********Begin procedure View_Allocation_Details ********');
154: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'p_inventory_item_id = ' ||to_char(p_inventory_item_id));
155: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'p_instance_id = ' ||to_char(p_instance_id));
156: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'p_organization_id = ' ||to_char(p_organization_id));
157: END IF;
158:
159: -- Initializing global error code, API return code

Line 156: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'p_organization_id = ' ||to_char(p_organization_id));

152: IF PG_DEBUG in ('Y', 'C') THEN
153: msc_sch_wb.atp_debug('View_Allocation_Details: ' || '*********Begin procedure View_Allocation_Details ********');
154: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'p_inventory_item_id = ' ||to_char(p_inventory_item_id));
155: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'p_instance_id = ' ||to_char(p_instance_id));
156: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'p_organization_id = ' ||to_char(p_organization_id));
157: END IF;
158:
159: -- Initializing global error code, API return code
160: MSC_SCH_WB.G_ATP_ERROR_CODE := 0;

Line 160: MSC_SCH_WB.G_ATP_ERROR_CODE := 0;

156: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'p_organization_id = ' ||to_char(p_organization_id));
157: END IF;
158:
159: -- Initializing global error code, API return code
160: MSC_SCH_WB.G_ATP_ERROR_CODE := 0;
161: x_return_status := FND_API.G_RET_STS_SUCCESS;
162:
163:
164: -- Get next working day from sysdate required for compute_allocation_details.

Line 171: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'There is no matching calander date');

167: FROM dual;
168:
169: IF (l_request_date = NULL) THEN
170: IF PG_DEBUG in ('Y', 'C') THEN
171: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'There is no matching calander date');
172: END IF;
173: x_return_status := FND_API.G_RET_STS_ERROR;
174: Set_Error(MSC_ATP_PVT.NO_MATCHING_CAL_DATE);
175: return;

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

174: Set_Error(MSC_ATP_PVT.NO_MATCHING_CAL_DATE);
175: return;
176: END IF;
177: IF PG_DEBUG in ('Y', 'C') THEN
178: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'Request Date : '||to_char(l_request_date, 'DD-MON-YYYY'));
179: END IF;
180:
181: -- Check the profile settings.
182: -- IF (MSC_ATP_PVT.G_INV_CTP <> 4 OR MSC_ATP_PVT.G_ALLOCATED_ATP <> 'Y') THEN

Line 186: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'INV_CTP is not 4');

182: -- IF (MSC_ATP_PVT.G_INV_CTP <> 4 OR MSC_ATP_PVT.G_ALLOCATED_ATP <> 'Y') THEN
183: -- bug 2813095 (ssurendr) breaking the validations into two
184: IF (MSC_ATP_PVT.G_INV_CTP <> 4) THEN
185: IF PG_DEBUG in ('Y', 'C') THEN
186: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'INV_CTP is not 4');
187: END IF;
188: Set_Error(MSC_ATP_PVT.INVALID_INV_CTP_PROFILE_SETUP);
189: x_return_status := FND_API.G_RET_STS_ERROR;
190: return;

Line 195: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'Enable Allocated ATP is not Yes');

191: END IF;
192:
193: IF (MSC_ATP_PVT.G_ALLOCATED_ATP <> 'Y') THEN
194: IF PG_DEBUG in ('Y', 'C') THEN
195: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'Enable Allocated ATP is not Yes');
196: END IF;
197: Set_Error(MSC_ATP_PVT.INVALID_ALLOC_ATP_OFF);
198: x_return_status := FND_API.G_RET_STS_ERROR;
199: return;

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

203: MSC_ATP_PROC.Get_plan_Info(p_instance_id, p_inventory_item_id, p_organization_id, null, l_plan_info_rec);
204:
205: IF (l_plan_info_rec.plan_id IS NULL) OR (l_plan_info_rec.plan_id = -1) THEN
206: IF PG_DEBUG in ('Y', 'C') THEN
207: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'Plan_ID is null or -1');
208: END IF;
209: x_return_status := FND_API.G_RET_STS_ERROR;
210: Set_Error(MSC_ATP_PVT.PLAN_NOT_FOUND);
211: return;

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

210: Set_Error(MSC_ATP_PVT.PLAN_NOT_FOUND);
211: return;
212: ELSIF (l_plan_info_rec.plan_id = -100) THEN
213: IF PG_DEBUG in ('Y', 'C') THEN
214: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'Plan_ID is -100 : Summary is Running');
215: END IF;
216: x_return_status := FND_API.G_RET_STS_ERROR;
217: Set_Error(MSC_ATP_PVT.SUMM_CONC_PROG_RUNNING);
218: return;

Line 221: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'Plan_ID is -200 : Post Plan Alloc progranm has not been run');

217: Set_Error(MSC_ATP_PVT.SUMM_CONC_PROG_RUNNING);
218: return;
219: ELSIF (l_plan_info_rec.plan_id = -200) THEN
220: IF PG_DEBUG in ('Y', 'C') THEN
221: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'Plan_ID is -200 : Post Plan Alloc progranm has not been run');
222: END IF;
223: x_return_status := FND_API.G_RET_STS_ERROR;
224: Set_Error(MSC_ATP_PVT.RUN_POST_PLAN_ALLOC);
225: return;

Line 228: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'Plan_ID is -300 : ATP Downtime');

224: Set_Error(MSC_ATP_PVT.RUN_POST_PLAN_ALLOC);
225: return;
226: ELSIF (l_plan_info_rec.plan_id = -300) THEN
227: IF PG_DEBUG in ('Y', 'C') THEN
228: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'Plan_ID is -300 : ATP Downtime');
229: END IF;
230: x_return_status := FND_API.G_RET_STS_ERROR;
231: Set_Error(MSC_ATP_PVT.TRY_ATP_LATER);
232: return;

Line 240: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'Plan Id : '||to_char(l_plan_info_rec.plan_id));

236: l_infinite_time_fence_date := MSC_ATP_FUNC.get_infinite_time_fence_date(p_instance_id,
237: p_inventory_item_id, p_organization_id, l_plan_info_rec.plan_id);
238:
239: IF PG_DEBUG in ('Y', 'C') THEN
240: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'Plan Id : '||to_char(l_plan_info_rec.plan_id));
241: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'infinite time fence date : ' || l_infinite_time_fence_date);
242: END IF;
243:
244:

Line 241: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'infinite time fence date : ' || l_infinite_time_fence_date);

237: p_inventory_item_id, p_organization_id, l_plan_info_rec.plan_id);
238:
239: IF PG_DEBUG in ('Y', 'C') THEN
240: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'Plan Id : '||to_char(l_plan_info_rec.plan_id));
241: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'infinite time fence date : ' || l_infinite_time_fence_date);
242: END IF;
243:
244:
245: /* Call Compute_Allocation_Details to get horizontal period information. */

Line 254: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'Error occured in procedure Compute_Allocation_Details');

250: l_return_status);
251:
252: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
253: IF PG_DEBUG in ('Y', 'C') THEN
254: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'Error occured in procedure Compute_Allocation_Details');
255: END IF;
256: x_return_status := FND_API.G_RET_STS_ERROR;
257: Commit;
258: return;

Line 264: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'l_atp_period is NULL');

260:
261: -- Debug messages
262: IF (l_atp_period.period_quantity.COUNT = 0) THEN
263: IF PG_DEBUG in ('Y', 'C') THEN
264: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'l_atp_period is NULL');
265: END IF;
266: -- rajjain bug 2951786 05/13/2003
267: Set_Error(MSC_ATP_PVT.NO_SUPPLY_DEMAND);
268: --Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);

Line 277: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'demand_class, period_start_date, End date, Period_Qty, Cum_Qty = '||

273:
274: IF PG_DEBUG in ('Y', 'C') THEN
275: l_counter := l_atp_period.Period_Quantity.FIRST;
276: WHILE l_counter is not null LOOP
277: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'demand_class, period_start_date, End date, Period_Qty, Cum_Qty = '||
278: l_atp_period.demand_class(l_counter) ||' : '||
279: l_atp_period.period_start_date(l_counter) ||' : '||
280: l_atp_period.period_end_date(l_counter) ||' : '||
281: l_atp_period.Period_Quantity(l_counter) ||' : '||

Line 299: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'Error occured in procedure Insert_Allocation_Details');

295: -- plan_name added for bug 2771192
296:
297: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
298: IF PG_DEBUG in ('Y', 'C') THEN
299: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'Error occured in procedure Insert_Allocation_Details');
300: END IF;
301: x_return_status := FND_API.G_RET_STS_ERROR;
302: END IF;
303:

Line 305: msc_sch_wb.atp_debug('View_Allocation_Details: ' || '*********End of procedure View_Allocation_Details ********');

301: x_return_status := FND_API.G_RET_STS_ERROR;
302: END IF;
303:
304: IF PG_DEBUG in ('Y', 'C') THEN
305: msc_sch_wb.atp_debug('View_Allocation_Details: ' || '*********End of procedure View_Allocation_Details ********');
306: END IF;
307:
308: Commit;
309:

Line 313: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'Error in View_Allocation_Details: Expected Error Raised' || to_char(sqlcode) || ':' || SQLERRM);

309:
310: EXCEPTION
311: WHEN FND_API.G_EXC_ERROR THEN
312: IF PG_DEBUG in ('Y', 'C') THEN
313: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'Error in View_Allocation_Details: Expected Error Raised' || to_char(sqlcode) || ':' || SQLERRM);
314: END IF;
315: x_return_status := FND_API.G_RET_STS_ERROR;
316: Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
317:

Line 320: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'Error in View_Allocation_Details: Invalid Objects Found');

316: Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
317:
318: WHEN MSC_ATP_PUB.ATP_INVALID_OBJECTS_FOUND THEN
319: IF PG_DEBUG in ('Y', 'C') THEN
320: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'Error in View_Allocation_Details: Invalid Objects Found');
321: END IF;
322: x_return_status := FND_API.G_RET_STS_ERROR;
323: Set_Error(MSC_ATP_PVT.ATP_INVALID_OBJECTS);
324:

Line 327: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'Error in View_Allocation_Details: Unexpected Error Raised: ' || to_char(sqlcode) || ':' || SQLERRM);

323: Set_Error(MSC_ATP_PVT.ATP_INVALID_OBJECTS);
324:
325: WHEN OTHERS THEN
326: IF PG_DEBUG in ('Y', 'C') THEN
327: msc_sch_wb.atp_debug('View_Allocation_Details: ' || 'Error in View_Allocation_Details: Unexpected Error Raised: ' || to_char(sqlcode) || ':' || SQLERRM);
328: END IF;
329: x_return_status := FND_API.G_RET_STS_ERROR;
330: Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
331:

Line 403: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || '*********Inside procedure Compute_Allocation_Details ********');

399:
400: BEGIN
401: -- Debug Messages
402: IF PG_DEBUG in ('Y', 'C') THEN
403: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || '*********Inside procedure Compute_Allocation_Details ********');
404: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_INV_CTP= ' || MSC_ATP_PVT.G_INV_CTP);
405: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_HIERARCHY_PROFILE = '|| MSC_ATP_PVT.G_HIERARCHY_PROFILE );
406: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_ALLOCATED_ATP = ' || MSC_ATP_PVT.G_ALLOCATED_ATP );
407: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_ALLOCATION_METHOD = '|| MSC_ATP_PVT.G_ALLOCATION_METHOD );

Line 404: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_INV_CTP= ' || MSC_ATP_PVT.G_INV_CTP);

400: BEGIN
401: -- Debug Messages
402: IF PG_DEBUG in ('Y', 'C') THEN
403: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || '*********Inside procedure Compute_Allocation_Details ********');
404: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_INV_CTP= ' || MSC_ATP_PVT.G_INV_CTP);
405: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_HIERARCHY_PROFILE = '|| MSC_ATP_PVT.G_HIERARCHY_PROFILE );
406: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_ALLOCATED_ATP = ' || MSC_ATP_PVT.G_ALLOCATED_ATP );
407: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_ALLOCATION_METHOD = '|| MSC_ATP_PVT.G_ALLOCATION_METHOD );
408: END IF;

Line 405: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_HIERARCHY_PROFILE = '|| MSC_ATP_PVT.G_HIERARCHY_PROFILE );

401: -- Debug Messages
402: IF PG_DEBUG in ('Y', 'C') THEN
403: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || '*********Inside procedure Compute_Allocation_Details ********');
404: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_INV_CTP= ' || MSC_ATP_PVT.G_INV_CTP);
405: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_HIERARCHY_PROFILE = '|| MSC_ATP_PVT.G_HIERARCHY_PROFILE );
406: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_ALLOCATED_ATP = ' || MSC_ATP_PVT.G_ALLOCATED_ATP );
407: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_ALLOCATION_METHOD = '|| MSC_ATP_PVT.G_ALLOCATION_METHOD );
408: END IF;
409:

Line 406: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_ALLOCATED_ATP = ' || MSC_ATP_PVT.G_ALLOCATED_ATP );

402: IF PG_DEBUG in ('Y', 'C') THEN
403: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || '*********Inside procedure Compute_Allocation_Details ********');
404: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_INV_CTP= ' || MSC_ATP_PVT.G_INV_CTP);
405: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_HIERARCHY_PROFILE = '|| MSC_ATP_PVT.G_HIERARCHY_PROFILE );
406: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_ALLOCATED_ATP = ' || MSC_ATP_PVT.G_ALLOCATED_ATP );
407: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_ALLOCATION_METHOD = '|| MSC_ATP_PVT.G_ALLOCATION_METHOD );
408: END IF;
409:
410: -- Initialization section.

Line 407: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_ALLOCATION_METHOD = '|| MSC_ATP_PVT.G_ALLOCATION_METHOD );

403: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || '*********Inside procedure Compute_Allocation_Details ********');
404: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_INV_CTP= ' || MSC_ATP_PVT.G_INV_CTP);
405: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_HIERARCHY_PROFILE = '|| MSC_ATP_PVT.G_HIERARCHY_PROFILE );
406: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_ALLOCATED_ATP = ' || MSC_ATP_PVT.G_ALLOCATED_ATP );
407: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_ALLOCATION_METHOD = '|| MSC_ATP_PVT.G_ALLOCATION_METHOD );
408: END IF;
409:
410: -- Initialization section.
411: x_return_status := FND_API.G_RET_STS_SUCCESS;

Line 444: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error selecting inventory item id from msc_system_items: ' || to_char(sqlcode) || ':' || SQLERRM);

440: AND mtp.partner_type=3;
441: EXCEPTION
442: WHEN OTHERS THEN
443: IF PG_DEBUG in ('Y', 'C') THEN
444: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error selecting inventory item id from msc_system_items: ' || to_char(sqlcode) || ':' || SQLERRM);
445: END IF;
446: Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
447: x_return_status := FND_API.G_RET_STS_ERROR;
448: return;

Line 466: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error occured in procedure Get_Family_Item_Info');

462: l_return_status
463: );
464: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
465: IF PG_DEBUG in ('Y', 'C') THEN
466: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error occured in procedure Get_Family_Item_Info');
467: END IF;
468: RAISE FND_API.G_EXC_ERROR;
469: END IF;
470:

Line 478: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Time phased atp = ' || l_time_phased_atp);

474: /* To support new logic for dependent demands allocation in time phased PF rule based AATP scenarios
475: Set global variable too. This is used in Get_Item_Demand_Alloc_Percent function*/
476: MSC_ATP_PVT.G_TIME_PHASED_PF_ENABLED := 'Y';
477: IF PG_DEBUG in ('Y', 'C') THEN
478: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Time phased atp = ' || l_time_phased_atp);
479: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_TIME_PHASED_PF_ENABLED = ' || MSC_ATP_PVT.G_TIME_PHASED_PF_ENABLED);
480: END IF;
481: END IF;
482:

Line 479: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_TIME_PHASED_PF_ENABLED = ' || MSC_ATP_PVT.G_TIME_PHASED_PF_ENABLED);

475: Set global variable too. This is used in Get_Item_Demand_Alloc_Percent function*/
476: MSC_ATP_PVT.G_TIME_PHASED_PF_ENABLED := 'Y';
477: IF PG_DEBUG in ('Y', 'C') THEN
478: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Time phased atp = ' || l_time_phased_atp);
479: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_TIME_PHASED_PF_ENABLED = ' || MSC_ATP_PVT.G_TIME_PHASED_PF_ENABLED);
480: END IF;
481: END IF;
482:
483: -- For new allocation logic for time phased ATP

Line 490: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Item not ATPable');

486:
487: -- bug 2813095 (ssurendr) error out if not atpable
488: IF l_atp_flag <> 'Y' THEN
489: IF PG_DEBUG in ('Y', 'C') THEN
490: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Item not ATPable');
491: END IF;
492: Set_Error(MSC_ATP_PVT.ATP_NOT_APPL);
493: x_return_status := FND_API.G_RET_STS_ERROR;
494: return;

Line 498: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_inv_item_id: ' || l_inv_item_id);

494: return;
495: END IF;
496:
497: IF PG_DEBUG in ('Y', 'C') THEN
498: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_inv_item_id: ' || l_inv_item_id);
499: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'p_organization_id: ' || p_organization_id);
500: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'p_instance_id: ' || p_instance_id);
501: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'p_plan_id: ' || p_plan_id);
502: --msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_ROUNDING_CONTROL_FLAG: ' || G_ROUNDING_CONTROL_FLAG);

Line 499: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'p_organization_id: ' || p_organization_id);

495: END IF;
496:
497: IF PG_DEBUG in ('Y', 'C') THEN
498: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_inv_item_id: ' || l_inv_item_id);
499: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'p_organization_id: ' || p_organization_id);
500: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'p_instance_id: ' || p_instance_id);
501: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'p_plan_id: ' || p_plan_id);
502: --msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_ROUNDING_CONTROL_FLAG: ' || G_ROUNDING_CONTROL_FLAG);
503: END IF;

Line 500: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'p_instance_id: ' || p_instance_id);

496:
497: IF PG_DEBUG in ('Y', 'C') THEN
498: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_inv_item_id: ' || l_inv_item_id);
499: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'p_organization_id: ' || p_organization_id);
500: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'p_instance_id: ' || p_instance_id);
501: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'p_plan_id: ' || p_plan_id);
502: --msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_ROUNDING_CONTROL_FLAG: ' || G_ROUNDING_CONTROL_FLAG);
503: END IF;
504:

Line 501: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'p_plan_id: ' || p_plan_id);

497: IF PG_DEBUG in ('Y', 'C') THEN
498: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_inv_item_id: ' || l_inv_item_id);
499: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'p_organization_id: ' || p_organization_id);
500: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'p_instance_id: ' || p_instance_id);
501: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'p_plan_id: ' || p_plan_id);
502: --msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_ROUNDING_CONTROL_FLAG: ' || G_ROUNDING_CONTROL_FLAG);
503: END IF;
504:
505: /* New allocation logic for time_phased_atp changes begin */

Line 502: --msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_ROUNDING_CONTROL_FLAG: ' || G_ROUNDING_CONTROL_FLAG);

498: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_inv_item_id: ' || l_inv_item_id);
499: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'p_organization_id: ' || p_organization_id);
500: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'p_instance_id: ' || p_instance_id);
501: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'p_plan_id: ' || p_plan_id);
502: --msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'G_ROUNDING_CONTROL_FLAG: ' || G_ROUNDING_CONTROL_FLAG);
503: END IF;
504:
505: /* New allocation logic for time_phased_atp changes begin */
506: IF l_time_phased_atp = 'Y' THEN

Line 518: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error occured in procedure Set_Alloc_Rule_Variables');

514: l_return_status
515: );
516: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
517: IF PG_DEBUG in ('Y', 'C') THEN
518: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error occured in procedure Set_Alloc_Rule_Variables');
519: END IF;
520: RAISE FND_API.G_EXC_ERROR;
521: END IF;
522:

Line 541: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'p_request_date = '||p_request_date);

537: l_item_to_use := l_pf_dest_id;
538: l_item_name_to_use := l_family_name; -- Bug 3823042
539: END IF;
540: IF PG_DEBUG in ('Y', 'C') THEN
541: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'p_request_date = '||p_request_date);
542: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Item to be used = '||l_item_to_use);
543: END IF;
544: /* New allocation logic for time_phased_atp changes end */
545:

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

538: l_item_name_to_use := l_family_name; -- Bug 3823042
539: END IF;
540: IF PG_DEBUG in ('Y', 'C') THEN
541: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'p_request_date = '||p_request_date);
542: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Item to be used = '||l_item_to_use);
543: END IF;
544: /* New allocation logic for time_phased_atp changes end */
545:
546: IF (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1 AND MSC_ATP_PVT.G_ALLOCATION_METHOD = 1) THEN

Line 549: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'We are in Demand Priority Allocation');

545:
546: IF (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1 AND MSC_ATP_PVT.G_ALLOCATION_METHOD = 1) THEN
547: -- Demand Priority
548: IF PG_DEBUG in ('Y', 'C') THEN
549: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'We are in Demand Priority Allocation');
550: END IF;
551:
552: -- initialize l_level_id. level_id remains -1 for demand priority
553: l_level_id := -1;

Line 559: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Checking the demand classes on p_request_date.');

555: /* Find all the demand classes on the request date = next working day from SYSDATE
556: from materialized view and store them in msc_alloc_temp table.
557: If no demand class found on request date, dont proceed any further, flag an error. */
558: IF PG_DEBUG in ('Y', 'C') THEN
559: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Checking the demand classes on p_request_date.');
560: END IF;
561:
562: INSERT INTO MSC_ALLOC_TEMP(DEMAND_CLASS)
563: SELECT mv.demand_class

Line 573: msc_sch_wb.atp_debug('No Demand Class found');

569: AND mv.level_id = l_level_id;
570:
571: IF (SQL%ROWCOUNT = 0) THEN
572: IF PG_DEBUG in ('Y', 'C') THEN
573: msc_sch_wb.atp_debug('No Demand Class found');
574: END IF;
575: Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
576: x_return_status := FND_API.G_RET_STS_ERROR;
577: return;

Line 580: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Demand classes found and stored in msc_alloc_temp table');

576: x_return_status := FND_API.G_RET_STS_ERROR;
577: return;
578: END IF;
579: IF PG_DEBUG in ('Y', 'C') THEN
580: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Demand classes found and stored in msc_alloc_temp table');
581: END IF;
582:
583: /*
584: 1. Copy the supply demand records from msc_alloc_supplies and msc_alloc_demands

Line 595: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before copying supply/demand records from alloc into temp tables.');

591: This is required only for MSC_ALLOC_SUPPLIES.
592: */
593:
594: IF PG_DEBUG in ('Y', 'C') THEN
595: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before copying supply/demand records from alloc into temp tables.');
596: END IF;
597:
598: -- time_phased_atp changes begin
599: IF l_time_phased_atp = 'Y' THEN

Line 623: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error occured in procedure Insert_SD_Into_Details_Temp');

619: l_return_status
620: );
621: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
622: IF PG_DEBUG in ('Y', 'C') THEN
623: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error occured in procedure Insert_SD_Into_Details_Temp');
624: END IF;
625: RAISE FND_API.G_EXC_ERROR;
626: END IF;
627: -- time_phased_atp changes end

Line 736: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'No s/d records could be inserted from msc_alloc tables into temp table');

732: END IF;
733:
734: IF (l_insert_count = 0) THEN
735: IF PG_DEBUG in ('Y', 'C') THEN
736: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'No s/d records could be inserted from msc_alloc tables into temp table');
737: END IF;
738:
739: -- bug 2763784 (ssurendr)
740: -- Should not error out if no s/d record found

Line 746: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'After copying supply/demand records from alloc into temp tables.');

742: --x_return_status := FND_API.G_RET_STS_ERROR;
743: --return;
744: ELSE
745: IF PG_DEBUG in ('Y', 'C') THEN
746: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'After copying supply/demand records from alloc into temp tables.');
747: END IF;
748:
749: /* Bulk Collect Allocated Supply, Stolen Supply, Total Supply,
750: Allocated Demand, Stolen Demand, Total Demand and Net into PL/SQL Period table.

Line 753: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before selecting supply/demand records from temp table into PL/SQL period table.');

749: /* Bulk Collect Allocated Supply, Stolen Supply, Total Supply,
750: Allocated Demand, Stolen Demand, Total Demand and Net into PL/SQL Period table.
751: Cum is calculated after b/w, f/w consumption and accumulation. */
752: IF PG_DEBUG in ('Y', 'C') THEN
753: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before selecting supply/demand records from temp table into PL/SQL period table.');
754: END IF;
755:
756: -- time_phased_atp changes begin
757: IF l_time_phased_atp = 'Y' THEN

Line 772: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error occured in procedure Get_Period_From_Details_Temp');

768: l_return_status
769: );
770: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
771: IF PG_DEBUG in ('Y', 'C') THEN
772: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error occured in procedure Get_Period_From_Details_Temp');
773: END IF;
774: RAISE FND_API.G_EXC_ERROR;
775: END IF;
776: -- time_phased_atp changes end

Line 841: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'After selecting supply/demand records from temp table into PL/SQL period table.');

837: ) final;
838: END IF;
839:
840: IF PG_DEBUG in ('Y', 'C') THEN
841: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'After selecting supply/demand records from temp table into PL/SQL period table.');
842: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before backward and forward consumption for each demand class');
843: END IF;
844:
845: -- Call procedure Backward_Forward_Consume to do backward and forward consumption

Line 842: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before backward and forward consumption for each demand class');

838: END IF;
839:
840: IF PG_DEBUG in ('Y', 'C') THEN
841: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'After selecting supply/demand records from temp table into PL/SQL period table.');
842: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before backward and forward consumption for each demand class');
843: END IF;
844:
845: -- Call procedure Backward_Forward_Consume to do backward and forward consumption
846: Backward_Forward_Consume(x_atp_period, l_dc_list_tab, l_dc_start_index, l_dc_end_index, l_return_status);

Line 849: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error occured in procedure Backward_Forward_Consume');

845: -- Call procedure Backward_Forward_Consume to do backward and forward consumption
846: Backward_Forward_Consume(x_atp_period, l_dc_list_tab, l_dc_start_index, l_dc_end_index, l_return_status);
847: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
848: IF PG_DEBUG in ('Y', 'C') THEN
849: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error occured in procedure Backward_Forward_Consume');
850: END IF;
851: x_return_status := FND_API.G_RET_STS_ERROR;
852: return;
853: END IF;

Line 856: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before accumulation for each demand class');

852: return;
853: END IF;
854:
855: IF PG_DEBUG in ('Y', 'C') THEN
856: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before accumulation for each demand class');
857: END IF;
858:
859: -- Copy Cumulative Quantity from Backward_Forward_Quantity
860: x_atp_period.Cumulative_Quantity := x_atp_period.Backward_Forward_Quantity;

Line 866: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error occured in procedure Compute_Cum');

862: -- Call procedure Compute_Cum to do accumulation
863: Compute_Cum(x_atp_period, l_dc_list_tab, l_dc_start_index, l_dc_end_index, l_return_status);
864: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
865: IF PG_DEBUG in ('Y', 'C') THEN
866: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error occured in procedure Compute_Cum');
867: END IF;
868: x_return_status := FND_API.G_RET_STS_ERROR;
869: return;
870: END IF;

Line 875: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before computing period_end_date');

871: END IF;
872:
873: /* Compute Period_End_Date for all demand classes */
874: IF PG_DEBUG in ('Y', 'C') THEN
875: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before computing period_end_date');
876: END IF;
877: -- bug 2763784 (ssurendr)
878: -- Should not error out if no s/d record found
879: -- rajjain 03/20/2003 Bug 2860891

Line 904: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'After computing period_end_date');

900: END LOOP;
901: END LOOP;
902: END IF;
903: IF PG_DEBUG in ('Y', 'C') THEN
904: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'After computing period_end_date');
905: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before appending infinite time fence date records');
906: END IF;
907: /* rajjain 02/19/2003 Bug 2806076
908: * Add infinite time fence record for all the demand classes in demand class hierarchy*/

Line 905: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before appending infinite time fence date records');

901: END LOOP;
902: END IF;
903: IF PG_DEBUG in ('Y', 'C') THEN
904: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'After computing period_end_date');
905: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before appending infinite time fence date records');
906: END IF;
907: /* rajjain 02/19/2003 Bug 2806076
908: * Add infinite time fence record for all the demand classes in demand class hierarchy*/
909:

Line 917: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_all_dc_list_tab.COUNT: ' || l_all_dc_list_tab.COUNT);

913: BULK COLLECT INTO l_all_dc_list_tab
914: FROM MSC_ALLOC_TEMP;
915:
916: IF PG_DEBUG in ('Y', 'C') THEN
917: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_all_dc_list_tab.COUNT: ' || l_all_dc_list_tab.COUNT);
918: END IF;
919:
920: FOR l_index_counter IN 1..l_all_dc_list_tab.COUNT LOOP
921:

Line 923: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Adding infinite time fence date for demand class '|| l_all_dc_list_tab(l_index_counter));

919:
920: FOR l_index_counter IN 1..l_all_dc_list_tab.COUNT LOOP
921:
922: IF PG_DEBUG in ('Y', 'C') THEN
923: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Adding infinite time fence date for demand class '|| l_all_dc_list_tab(l_index_counter));
924: END IF;
925: MSC_SATP_FUNC.Extend_Atp_Period(x_atp_period, l_return_status);
926:
927: l_count := x_atp_period.Period_Start_Date.COUNT;

Line 949: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'After appending infinite time fence records');

945: END LOOP;
946:
947: -- END IF;
948: IF PG_DEBUG in ('Y', 'C') THEN
949: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'After appending infinite time fence records');
950: END IF;
951:
952: -- time_phased_atp changes begin
953: IF l_time_phased_atp = 'Y' THEN

Line 955: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before populating original demand qty in MADT');

951:
952: -- time_phased_atp changes begin
953: IF l_time_phased_atp = 'Y' THEN
954: IF PG_DEBUG in ('Y', 'C') THEN
955: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before populating original demand qty in MADT');
956: END IF;
957: /* Now populate Original_Demand_Qty*/
958: MSC_ATP_PF.Populate_Original_Demand_Qty(
959: MSC_ATP_PF.MADT,

Line 968: msc_sch_wb.atp_debug('Insert_SD_Into_Details_Temp: ' || 'Error occured in procedure Populate_Original_Demand_Qty');

964: );
965:
966: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
967: IF PG_DEBUG in ('Y', 'C') THEN
968: msc_sch_wb.atp_debug('Insert_SD_Into_Details_Temp: ' || 'Error occured in procedure Populate_Original_Demand_Qty');
969: END IF;
970: x_return_status := FND_API.G_RET_STS_ERROR;
971: return;
972: END IF;

Line 974: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'After populating original demand qty in MADT');

970: x_return_status := FND_API.G_RET_STS_ERROR;
971: return;
972: END IF;
973: IF PG_DEBUG in ('Y', 'C') THEN
974: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'After populating original demand qty in MADT');
975: END IF;
976: END IF;
977: -- time_phased_atp changes end
978:

Line 987: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'We are in demand class allocation.');

983: -- initialize l_level_id. level_id remains -1 for demand class allocation
984: l_level_id := -1;
985:
986: IF PG_DEBUG in ('Y', 'C') THEN
987: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'We are in demand class allocation.');
988: END IF;
989:
990: /* Store all the demand classes on the request date = next working day from SYSDATE
991: and store them in msc_alloc_temp table.

Line 1005: msc_sch_wb.atp_debug('No Demand Class found');

1001: AND mv.level_id = l_level_id;
1002:
1003: IF (SQL%ROWCOUNT = 0) THEN
1004: IF PG_DEBUG in ('Y', 'C') THEN
1005: msc_sch_wb.atp_debug('No Demand Class found');
1006: END IF;
1007: Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
1008: x_return_status := FND_API.G_RET_STS_ERROR;
1009: return;

Line 1029: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);

1025: TRUNC(sysdate));
1026:
1027: -- Debug info
1028: IF PG_DEBUG in ('Y', 'C') THEN
1029: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
1030: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_calendar_code='||l_calendar_code);
1031: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
1032: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_default_demand_class'|| l_default_demand_class);
1033: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_org_code'|| l_org_code);

Line 1030: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_calendar_code='||l_calendar_code);

1026:
1027: -- Debug info
1028: IF PG_DEBUG in ('Y', 'C') THEN
1029: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
1030: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_calendar_code='||l_calendar_code);
1031: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
1032: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_default_demand_class'|| l_default_demand_class);
1033: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_org_code'|| l_org_code);
1034: END IF;

Line 1031: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);

1027: -- Debug info
1028: IF PG_DEBUG in ('Y', 'C') THEN
1029: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
1030: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_calendar_code='||l_calendar_code);
1031: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
1032: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_default_demand_class'|| l_default_demand_class);
1033: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_org_code'|| l_org_code);
1034: END IF;
1035:

Line 1032: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_default_demand_class'|| l_default_demand_class);

1028: IF PG_DEBUG in ('Y', 'C') THEN
1029: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
1030: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_calendar_code='||l_calendar_code);
1031: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
1032: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_default_demand_class'|| l_default_demand_class);
1033: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_org_code'|| l_org_code);
1034: END IF;
1035:
1036: /*

Line 1033: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_org_code'|| l_org_code);

1029: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
1030: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_calendar_code='||l_calendar_code);
1031: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
1032: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_default_demand_class'|| l_default_demand_class);
1033: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_org_code'|| l_org_code);
1034: END IF;
1035:
1036: /*
1037: 1. Copy the supply demand records from msc_supplies and msc_demands

Line 1045: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before copying supply/demand records from msc_supplies/msc_demands into temp tables.');

1041: 3. MSC_ALLOC_TEMP here stores allocation demand classes. We make a cartesian to split the supplies/demands
1042: 4. Finally we put only those records where allocated_quantity <> 0
1043: */
1044: IF PG_DEBUG in ('Y', 'C') THEN
1045: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before copying supply/demand records from msc_supplies/msc_demands into temp tables.');
1046: END IF;
1047:
1048: -- time_phased_atp changes begin
1049: IF l_time_phased_atp = 'Y' THEN

Line 1073: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error occured in procedure Insert_SD_Into_Details_Temp');

1069: l_return_status
1070: );
1071: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1072: IF PG_DEBUG in ('Y', 'C') THEN
1073: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error occured in procedure Insert_SD_Into_Details_Temp');
1074: END IF;
1075: RAISE FND_API.G_EXC_ERROR;
1076: END IF;
1077: -- time_phased_atp changes end

Line 1084: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'User defined demand class, Optimized plan');

1080: IF ( MSC_ATP_PVT.G_OPTIMIZED_PLAN = 1) THEN
1081: -- Bug 3823042: optimized plan, donot use msc_calendar_dates
1082:
1083: IF PG_DEBUG in ('Y', 'C') THEN
1084: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'User defined demand class, Optimized plan');
1085: END IF;
1086:
1087: INSERT INTO MRP_ATP_DETAILS_TEMP
1088: (session_id, atp_level, inventory_item_id, organization_id, identifier1, identifier3,

Line 1457: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'User defined demand class, Unoptimized plan');

1453: ELSE -- Else of Optimized plan
1454: -- Bug 3823042: Unoptimized Plan, Use msc_calendar_dates
1455:
1456: IF PG_DEBUG in ('Y', 'C') THEN
1457: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'User defined demand class, Unoptimized plan');
1458: END IF;
1459:
1460: INSERT INTO MRP_ATP_DETAILS_TEMP
1461: (session_id, atp_level, inventory_item_id, organization_id, identifier1, identifier3,

Line 1744: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'No s/d records could be inserted from msc_supplies/demands tables into temp table');

1740: END IF;
1741:
1742: IF (l_insert_count = 0) THEN
1743: IF PG_DEBUG in ('Y', 'C') THEN
1744: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'No s/d records could be inserted from msc_supplies/demands tables into temp table');
1745: END IF;
1746:
1747: -- bug 2763784 (ssurendr)
1748: -- Should not error out if no s/d record found

Line 1760: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_dc_list_tab.COUNT: ' || l_dc_list_tab.COUNT);

1756: l_dc_list_tab.Extend();
1757: l_dc_list_tab(l_dc_list_tab.COUNT) := G_UNALLOCATED_DC;
1758:
1759: IF PG_DEBUG in ('Y', 'C') THEN
1760: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_dc_list_tab.COUNT: ' || l_dc_list_tab.COUNT);
1761: END IF;
1762: ELSE
1763:
1764: IF PG_DEBUG in ('Y', 'C') THEN

Line 1765: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'After copying supply/demand records from msc_supplies/msc_demands into temp tables.');

1761: END IF;
1762: ELSE
1763:
1764: IF PG_DEBUG in ('Y', 'C') THEN
1765: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'After copying supply/demand records from msc_supplies/msc_demands into temp tables.');
1766: END IF;
1767:
1768: /* Bulk Collect Allocated Supply, Total Supply,
1769: Allocated Demand, Stolen Demand, Total Demand, Net into PL/SQL Period table. */

Line 1771: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before selecting supply/demand records from temp table into PL/SQL period table.');

1767:
1768: /* Bulk Collect Allocated Supply, Total Supply,
1769: Allocated Demand, Stolen Demand, Total Demand, Net into PL/SQL Period table. */
1770: IF PG_DEBUG in ('Y', 'C') THEN
1771: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before selecting supply/demand records from temp table into PL/SQL period table.');
1772: END IF;
1773:
1774: -- IF G_ATP_FW_CONSUME_METHOD = 1 THEN
1775: -- here was the same query without the unallocated columns

Line 1797: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error occured in procedure Get_Period_From_Details_Temp');

1793: l_return_status
1794: );
1795: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1796: IF PG_DEBUG in ('Y', 'C') THEN
1797: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error occured in procedure Get_Period_From_Details_Temp');
1798: END IF;
1799: RAISE FND_API.G_EXC_ERROR;
1800: END IF;
1801: -- time_phased_atp changes end

Line 1868: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'After selecting supply/demand records from temp table into PL/SQL period table.');

1864: DEMAND_CLASS ASC, SUPPLY_DEMAND_DATE) final;
1865: END IF;
1866:
1867: IF PG_DEBUG in ('Y', 'C') THEN
1868: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'After selecting supply/demand records from temp table into PL/SQL period table.');
1869: END IF;
1870:
1871: -- Call Adjust_Allocation_Details to compute everything except Infinite time fence records
1872: Adjust_Allocation_Details(x_atp_period, l_dc_list_tab, l_dc_start_index, l_dc_end_index, l_return_status);

Line 1875: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error occured in procedure Adjust_Allocation_Details');

1871: -- Call Adjust_Allocation_Details to compute everything except Infinite time fence records
1872: Adjust_Allocation_Details(x_atp_period, l_dc_list_tab, l_dc_start_index, l_dc_end_index, l_return_status);
1873: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1874: IF PG_DEBUG in ('Y', 'C') THEN
1875: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error occured in procedure Adjust_Allocation_Details');
1876: END IF;
1877: x_return_status := FND_API.G_RET_STS_ERROR;
1878: return;
1879: END IF;

Line 1885: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before computing period_end_date');

1881:
1882:
1883: /* Compute Period_End_Date for all demand classes and add infinite time fence records*/
1884: IF PG_DEBUG in ('Y', 'C') THEN
1885: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before computing period_end_date');
1886: END IF;
1887: FOR l_index_counter IN 1..l_dc_list_tab.COUNT LOOP
1888: -- bug 2763784 (ssurendr)
1889: -- Should not error out if no s/d record found

Line 1915: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Adding infinite time fence date for demand class '|| l_dc_list_tab(l_index_counter));

1911: -- Add Inifinite time fence date records for each demand class at the end.
1912: -- Bug 3823042, as in PDS, p_infinite_time_fence_date is never NULL
1913: -- IF p_infinite_time_fence_date IS NOT NULL THEN
1914: IF PG_DEBUG in ('Y', 'C') THEN
1915: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Adding infinite time fence date for demand class '|| l_dc_list_tab(l_index_counter));
1916: END IF;
1917:
1918: MSC_SATP_FUNC.Extend_Atp_Period(x_atp_period, l_return_status);
1919: l_count := x_atp_period.Period_Start_Date.COUNT;

Line 1945: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'After computing period_end_date and appending infinite time fence records');

1941: --END IF;
1942:
1943: END LOOP;
1944: IF PG_DEBUG in ('Y', 'C') THEN
1945: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'After computing period_end_date and appending infinite time fence records');
1946: END IF;
1947:
1948: ELSIF (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 2 AND MSC_ATP_PVT.G_ALLOCATION_METHOD = 2) THEN
1949: -- ELSIF (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1 AND MSC_ATP_PVT.G_ALLOCATION_METHOD = 2) THEN

Line 1955: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'We are in customer class allocation.');

1951: -- initialize l_level_id. We first select all leaf node records
1952: l_level_id := 3;
1953:
1954: IF PG_DEBUG in ('Y', 'C') THEN
1955: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'We are in customer class allocation.');
1956: END IF;
1957:
1958: /* Modularize Item and Org Info */
1959: MSC_ATP_PROC.get_global_org_info(p_instance_id, p_organization_id);

Line 1974: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);

1970: TRUNC(sysdate));
1971:
1972: -- Debug info
1973: IF PG_DEBUG in ('Y', 'C') THEN
1974: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
1975: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_calendar_code='||l_calendar_code);
1976: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
1977: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_default_demand_class'|| l_default_demand_class);
1978: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_org_code'|| l_org_code);

Line 1975: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_calendar_code='||l_calendar_code);

1971:
1972: -- Debug info
1973: IF PG_DEBUG in ('Y', 'C') THEN
1974: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
1975: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_calendar_code='||l_calendar_code);
1976: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
1977: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_default_demand_class'|| l_default_demand_class);
1978: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_org_code'|| l_org_code);
1979: END IF;

Line 1976: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);

1972: -- Debug info
1973: IF PG_DEBUG in ('Y', 'C') THEN
1974: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
1975: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_calendar_code='||l_calendar_code);
1976: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
1977: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_default_demand_class'|| l_default_demand_class);
1978: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_org_code'|| l_org_code);
1979: END IF;
1980:

Line 1977: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_default_demand_class'|| l_default_demand_class);

1973: IF PG_DEBUG in ('Y', 'C') THEN
1974: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
1975: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_calendar_code='||l_calendar_code);
1976: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
1977: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_default_demand_class'|| l_default_demand_class);
1978: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_org_code'|| l_org_code);
1979: END IF;
1980:
1981: /* 1. Find all the level 3 nodes for given item/inst/org/on p_request_date

Line 1978: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_org_code'|| l_org_code);

1974: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_default_atp_rule_id='|| l_default_atp_rule_id);
1975: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_calendar_code='||l_calendar_code);
1976: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_calendar_exception_set_id'|| l_calendar_exception_set_id);
1977: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_default_demand_class'|| l_default_demand_class);
1978: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_org_code'|| l_org_code);
1979: END IF;
1980:
1981: /* 1. Find all the level 3 nodes for given item/inst/org/on p_request_date
1982: 2. For each level 3 record, find parent demand class and grandparent demand class

Line 2011: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'No Demand Class found');

2007:
2008: IF (SQL%ROWCOUNT = 0) THEN
2009: -- Need an appropriate error message.
2010: IF PG_DEBUG in ('Y', 'C') THEN
2011: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'No Demand Class found');
2012: END IF;
2013: Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
2014: x_return_status := FND_API.G_RET_STS_ERROR;
2015: return;

Line 2030: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before copying supply/demand records from msc_supplies/msc_demands into temp tables.');

2026: */
2027:
2028:
2029: IF PG_DEBUG in ('Y', 'C') THEN
2030: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before copying supply/demand records from msc_supplies/msc_demands into temp tables.');
2031: END IF;
2032:
2033: /* time_phased_atp changes begin */
2034: IF l_time_phased_atp = 'Y' THEN

Line 2058: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error occured in procedure Insert_SD_Into_Details_Temp');

2054: l_return_status
2055: );
2056: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2057: IF PG_DEBUG in ('Y', 'C') THEN
2058: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error occured in procedure Insert_SD_Into_Details_Temp');
2059: END IF;
2060: RAISE FND_API.G_EXC_ERROR;
2061: END IF;
2062: ELSE

Line 2067: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'User defined customer class, Optimized plan');

2063: IF (MSC_ATP_PVT.G_OPTIMIZED_PLAN = 1) THEN
2064: -- Bug 3823042: optimized plan, donot use msc_calendar_dates
2065:
2066: IF PG_DEBUG in ('Y', 'C') THEN
2067: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'User defined customer class, Optimized plan');
2068: END IF;
2069:
2070: INSERT INTO MRP_ATP_DETAILS_TEMP
2071: (session_id, atp_level, inventory_item_id, organization_id, identifier1, identifier3,

Line 2440: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'User defined customer class, Unoptimized plan');

2436: ELSE -- Else of Optimized Plan
2437: -- Bug 3823042: Unoptimized plan
2438:
2439: IF PG_DEBUG in ('Y', 'C') THEN
2440: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'User defined customer class, Unoptimized plan');
2441: END IF;
2442:
2443: INSERT INTO MRP_ATP_DETAILS_TEMP
2444: (session_id, atp_level, inventory_item_id, organization_id, identifier1, identifier3,

Line 2735: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'No s/d records inserted into temp table');

2731: END IF;
2732:
2733: IF (l_insert_count = 0) THEN
2734: IF PG_DEBUG in ('Y', 'C') THEN
2735: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'No s/d records inserted into temp table');
2736: END IF;
2737:
2738: -- bug 2763784 (ssurendr)
2739: -- Should not error out if no s/d record found

Line 2754: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_dc_list_tab.COUNT: ' || l_dc_list_tab.COUNT);

2750: l_customer_site_id_tab.Extend();
2751: l_dc_list_tab(l_dc_list_tab.COUNT) := G_UNALLOCATED_DC;
2752:
2753: IF PG_DEBUG in ('Y', 'C') THEN
2754: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'l_dc_list_tab.COUNT: ' || l_dc_list_tab.COUNT);
2755: END IF;
2756: ELSE
2757:
2758: IF PG_DEBUG in ('Y', 'C') THEN

Line 2759: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'After copying supply/demand records from msc_supplies/msc_demands into temp tables.');

2755: END IF;
2756: ELSE
2757:
2758: IF PG_DEBUG in ('Y', 'C') THEN
2759: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'After copying supply/demand records from msc_supplies/msc_demands into temp tables.');
2760: END IF;
2761:
2762: /* Bulk Collect Allocated Supply, Total Supply,
2763: Allocated Demand, Stolen Demand, Total Demand, Net into PL/SQL Period table. */

Line 2765: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before selecting supply/demand records from temp table into PL/SQL period table.');

2761:
2762: /* Bulk Collect Allocated Supply, Total Supply,
2763: Allocated Demand, Stolen Demand, Total Demand, Net into PL/SQL Period table. */
2764: IF PG_DEBUG in ('Y', 'C') THEN
2765: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before selecting supply/demand records from temp table into PL/SQL period table.');
2766: END IF;
2767:
2768: -- IF G_ATP_FW_CONSUME_METHOD = 1 THEN
2769: -- here was the same query without the unallocated columns

Line 2791: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error occured in procedure Get_Period_From_Details_Temp');

2787: l_return_status
2788: );
2789: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2790: IF PG_DEBUG in ('Y', 'C') THEN
2791: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error occured in procedure Get_Period_From_Details_Temp');
2792: END IF;
2793: RAISE FND_API.G_EXC_ERROR;
2794: END IF;
2795: -- time_phased_atp changes end

Line 2875: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'After selecting supply/demand records from temp table into PL/SQL period table.');

2871:
2872: -- END IF; -- IF G_ATP_FW_CONSUME_METHOD = 1 THEN
2873:
2874: IF PG_DEBUG in ('Y', 'C') THEN
2875: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'After selecting supply/demand records from temp table into PL/SQL period table.');
2876: END IF;
2877:
2878: -- Call Adjust_Allocation_Details to compute everything except Infinite time fence records
2879: Adjust_Allocation_Details(x_atp_period, l_dc_list_tab, l_dc_start_index, l_dc_end_index, l_return_status);

Line 2882: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error occured in procedure Adjust_Allocation_Details');

2878: -- Call Adjust_Allocation_Details to compute everything except Infinite time fence records
2879: Adjust_Allocation_Details(x_atp_period, l_dc_list_tab, l_dc_start_index, l_dc_end_index, l_return_status);
2880: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
2881: IF PG_DEBUG in ('Y', 'C') THEN
2882: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error occured in procedure Adjust_Allocation_Details');
2883: END IF;
2884: x_return_status := FND_API.G_RET_STS_ERROR;
2885: return;
2886: END IF;

Line 2891: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before computing period_end_date');

2887: END IF;
2888:
2889: /* Compute Period_End_Date for all demand classes and add infinite time fence records*/
2890: IF PG_DEBUG in ('Y', 'C') THEN
2891: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Before computing period_end_date');
2892: END IF;
2893: FOR l_index_counter IN 1..l_dc_list_tab.COUNT LOOP
2894: -- bug 2763784 (ssurendr)
2895: -- Should not error out if no s/d record found

Line 2923: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Adding infinite time fence date for demand class '|| l_dc_list_tab(l_index_counter));

2919: -- Add Inifinite time fence date records for each demand class at the end.
2920: -- Bug 3823042, In PDS cases, p_infinite_time_fence_date is never NULL
2921: -- IF p_infinite_time_fence_date IS NOT NULL THEN
2922: IF PG_DEBUG in ('Y', 'C') THEN
2923: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Adding infinite time fence date for demand class '|| l_dc_list_tab(l_index_counter));
2924: END IF;
2925: MSC_SATP_FUNC.Extend_Atp_Period(x_atp_period, l_return_status);
2926:
2927: l_count := x_atp_period.Period_Start_Date.COUNT;

Line 2963: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'After computing period_end_date and appending infinite time fence records');

2959: --END IF; -- Bug 3823042
2960:
2961: END LOOP;
2962: IF PG_DEBUG in ('Y', 'C') THEN
2963: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'After computing period_end_date and appending infinite time fence records');
2964: END IF;
2965:
2966: ELSE -- Customer Class Allocation ends
2967: -- bug 2813095 (ssurendr) Profiles ALLOCATION_METHOD and CLASS_HIERARCHY are not set properly

Line 2969: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Profiles ALLOCATION_METHOD and CLASS_HIERARCHY are not set properly');

2965:
2966: ELSE -- Customer Class Allocation ends
2967: -- bug 2813095 (ssurendr) Profiles ALLOCATION_METHOD and CLASS_HIERARCHY are not set properly
2968: IF PG_DEBUG in ('Y', 'C') THEN
2969: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Profiles ALLOCATION_METHOD and CLASS_HIERARCHY are not set properly');
2970: END IF;
2971: x_return_status := FND_API.G_RET_STS_ERROR;
2972: Set_Error(MSC_ATP_PVT.INVALID_ALLOC_PROFILE_SETUP);
2973: return;

Line 2979: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || '*********End of procedure Compute_Allocation_Details ********');

2975: END IF;
2976: /* We have computed horizontal period. */
2977:
2978: IF PG_DEBUG in ('Y', 'C') THEN
2979: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || '*********End of procedure Compute_Allocation_Details ********');
2980: END IF;
2981:
2982: EXCEPTION
2983: WHEN MSC_ATP_PUB.ATP_INVALID_OBJECTS_FOUND THEN

Line 2985: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error in Compute_Allocation_Details: Invalid Objects Found');

2981:
2982: EXCEPTION
2983: WHEN MSC_ATP_PUB.ATP_INVALID_OBJECTS_FOUND THEN
2984: IF PG_DEBUG in ('Y', 'C') THEN
2985: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error in Compute_Allocation_Details: Invalid Objects Found');
2986: END IF;
2987: x_return_status := FND_API.G_RET_STS_ERROR;
2988: Set_Error(MSC_ATP_PVT.ATP_INVALID_OBJECTS);
2989:

Line 2992: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error in Compute_Allocation_Details: ' || to_char(sqlcode) || ':' || SQLERRM);

2988: Set_Error(MSC_ATP_PVT.ATP_INVALID_OBJECTS);
2989:
2990: WHEN OTHERS THEN
2991: IF PG_DEBUG in ('Y', 'C') THEN
2992: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'Error in Compute_Allocation_Details: ' || to_char(sqlcode) || ':' || SQLERRM);
2993: END IF;
2994: x_return_status := FND_API.G_RET_STS_ERROR;
2995: Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
2996:

Line 3027: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || '*********Inside procedure Insert_Allocation_Details ********');

3023:
3024:
3025: BEGIN
3026: IF PG_DEBUG in ('Y', 'C') THEN
3027: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || '*********Inside procedure Insert_Allocation_Details ********');
3028: END IF;
3029:
3030: -- Initialization section
3031: x_return_status := FND_API.G_RET_STS_SUCCESS;

Line 3041: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Before inserting period records into the temp table for demand priority');

3037: l_level_id := -1;
3038:
3039: /* Insert ATP Period Information */
3040: IF PG_DEBUG in ('Y', 'C') THEN
3041: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Before inserting period records into the temp table for demand priority');
3042: END IF;
3043:
3044: -- bug 2763784 (ssurendr)
3045: -- Honor the rounding control type

Line 3048: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will round off.');

3044: -- bug 2763784 (ssurendr)
3045: -- Honor the rounding control type
3046: /* rajjain 02/12/2003 bug 2795992
3047: IF G_ROUNDING_CONTROL_FLAG=1 THEN
3048: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will round off.');
3049: FORALL l_period_counter IN 1..p_atp_period.Period_Start_Date.COUNT
3050: INSERT INTO MRP_ATP_DETAILS_TEMP
3051: (
3052: session_id,

Line 3093: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will not round off.');*/

3089: FLOOR(p_atp_period.cumulative_quantity(l_period_counter)),
3090: p_plan_name -- bug 2771192
3091: );
3092: ELSE -- IF G_ROUNDING_CONTROL_FLAG=1 THEN
3093: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will not round off.');*/
3094: FORALL l_period_counter IN 1..p_atp_period.Period_Start_Date.COUNT
3095: INSERT INTO MRP_ATP_DETAILS_TEMP
3096: (
3097: session_id,

Line 3144: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'After inserting period records into the temp table');

3140: );
3141: --END IF;
3142:
3143: IF PG_DEBUG in ('Y', 'C') THEN
3144: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'After inserting period records into the temp table');
3145: END IF;
3146:
3147: /* Do Totaling. In case of Demand Priority, we do Total of all demand classes.
3148:

Line 3163: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Before the summing SQL for Total');

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

Line 3275: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'After the summing SQL for Total');

3271: mapt.period_start_date
3272: ) final;
3273:
3274: IF PG_DEBUG in ('Y', 'C') THEN
3275: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'After the summing SQL for Total');
3276: END IF;
3277:
3278: ELSIF ((MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND (MSC_ATP_PVT.G_ALLOCATION_METHOD = 2)) THEN
3279: -- IF ((MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN

Line 3287: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Before inserting period records into the temp table for demand class ATP');

3283: l_level_id := -1;
3284:
3285: /* Insert ATP Period Information */
3286: IF PG_DEBUG in ('Y', 'C') THEN
3287: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Before inserting period records into the temp table for demand class ATP');
3288: END IF;
3289:
3290: IF G_ATP_FW_CONSUME_METHOD = 1 THEN
3291:

Line 3296: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will round off.');

3292: -- bug 2763784 (ssurendr)
3293: -- Honor the rounding control type
3294: /* rajjain 02/12/2003 bug 2795992
3295: IF G_ROUNDING_CONTROL_FLAG=1 THEN
3296: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will round off.');
3297: FORALL l_period_counter IN 1..p_atp_period.Period_Start_Date.COUNT
3298: INSERT INTO MRP_ATP_DETAILS_TEMP
3299: (
3300: session_id,

Line 3341: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will not round off.');*/

3337: FLOOR(p_atp_period.Adjusted_Availability_Quantity(l_period_counter)),
3338: p_plan_name -- bug 2771192
3339: );
3340: ELSE -- IF G_ROUNDING_CONTROL_FLAG=1 THEN
3341: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will not round off.');*/
3342: FORALL l_period_counter IN 1..p_atp_period.Period_Start_Date.COUNT
3343: INSERT INTO MRP_ATP_DETAILS_TEMP
3344: (
3345: session_id,

Line 3397: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will round off.');

3393: -- bug 2763784 (ssurendr)
3394: -- Honor the rounding control type
3395: /* rajjain 02/12/2003 bug 2795992
3396: IF G_ROUNDING_CONTROL_FLAG=1 THEN
3397: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will round off.');
3398: FORALL l_period_counter IN 1..p_atp_period.Period_Start_Date.COUNT
3399: INSERT INTO MRP_ATP_DETAILS_TEMP
3400: (
3401: session_id,

Line 3444: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will not round off.');*/

3440: FLOOR(p_atp_period.Adjusted_Cum_Quantity(l_period_counter)),
3441: p_plan_name -- bug 2771192
3442: );
3443: ELSE -- IF G_ROUNDING_CONTROL_FLAG=1 THEN
3444: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will not round off.');*/
3445: FORALL l_period_counter IN 1..p_atp_period.Period_Start_Date.COUNT
3446: INSERT INTO MRP_ATP_DETAILS_TEMP
3447: (
3448: session_id,

Line 3498: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'After inserting period records into the temp table');

3494: --END IF;
3495: END IF;
3496:
3497: IF PG_DEBUG in ('Y', 'C') THEN
3498: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'After inserting period records into the temp table');
3499: END IF;
3500:
3501: /* Do Totaling.
3502: 1. We let the demand class remain null for Total.

Line 3512: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Before the summing SQL for Total');

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

Line 3647: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'After the summing SQL for Total');

3643: END IF;
3644: /* New allocation logic for time phased ATP changes end */
3645:
3646: IF PG_DEBUG in ('Y', 'C') THEN
3647: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'After the summing SQL for Total');
3648: END IF;
3649:
3650: ELSIF ((MSC_ATP_PVT.G_HIERARCHY_PROFILE = 2) AND (MSC_ATP_PVT.G_ALLOCATION_METHOD = 2)) THEN
3651: -- ELSIF ((MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND (MSC_ATP_PVT.G_ALLOCATION_METHOD = 2)) THEN

Line 3659: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Before inserting customer site level period records into the temp table');

3655: l_level_id := 3;
3656:
3657: /* Insert ATP Period Information */
3658: IF PG_DEBUG in ('Y', 'C') THEN
3659: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Before inserting customer site level period records into the temp table');
3660: END IF;
3661:
3662: IF G_ATP_FW_CONSUME_METHOD = 1 THEN
3663: -- bug 2763784 (ssurendr)

Line 3667: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will round off.');

3663: -- bug 2763784 (ssurendr)
3664: -- Honor the rounding control type
3665: /* rajjain 02/12/2003 bug 2795992
3666: IF G_ROUNDING_CONTROL_FLAG=1 THEN
3667: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will round off.');
3668: FORALL l_period_counter IN 1..p_atp_period.Period_Start_Date.COUNT
3669: INSERT INTO MRP_ATP_DETAILS_TEMP
3670: (
3671: session_id,

Line 3718: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will not round off.');*/

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

Line 3780: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will round off.');

3776: -- bug 2763784 (ssurendr)
3777: -- Honor the rounding control type
3778: /* rajjain 02/12/2003 bug 2795992
3779: IF G_ROUNDING_CONTROL_FLAG=1 THEN
3780: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will round off.');
3781: FORALL l_period_counter IN 1..p_atp_period.Period_Start_Date.COUNT
3782: INSERT INTO MRP_ATP_DETAILS_TEMP
3783: (
3784: session_id,

Line 3833: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Will not round off.');*/

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

Line 3894: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'After inserting customer site level period records into the temp table');

3890:
3891: END IF;
3892:
3893: IF PG_DEBUG in ('Y', 'C') THEN
3894: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'After inserting customer site level period records into the temp table');
3895: END IF;
3896:
3897: /* Do sub-Total for level 2 records.
3898: 1. We let demand_class be null.

Line 3907: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Before the summing SQL for customer level');

3903: 5. The grouping is done on class, customer_id, period_start_date and period_end_date
3904: */
3905:
3906: IF PG_DEBUG in ('Y', 'C') THEN
3907: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Before the summing SQL for customer level');
3908: END IF;
3909: INSERT INTO MRP_ATP_DETAILS_TEMP
3910: (
3911: session_id,

Line 4014: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Error occured while doing sub-Total for customer level');

4010: ) final;
4011:
4012: IF (SQL%ROWCOUNT = 0) THEN
4013: IF PG_DEBUG in ('Y', 'C') THEN
4014: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Error occured while doing sub-Total for customer level');
4015: END IF;
4016: Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
4017: x_return_status := FND_API.G_RET_STS_ERROR;
4018: return;

Line 4022: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'After the summing SQL for Customer level');

4018: return;
4019: END IF;
4020:
4021: IF PG_DEBUG in ('Y', 'C') THEN
4022: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'After the summing SQL for Customer level');
4023: END IF;
4024:
4025: /* Do sub-Total for level 1 records.
4026: 1. We let demand_class be null.

Line 4036: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Before the summing SQL for customer class level');

4032: 6. The grouping is done on class, period_start_date and period_end_date
4033: */
4034:
4035: IF PG_DEBUG in ('Y', 'C') THEN
4036: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Before the summing SQL for customer class level');
4037: END IF;
4038:
4039: INSERT INTO MRP_ATP_DETAILS_TEMP
4040: (

Line 4140: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Error occured while doing sub-Total for customer class level');

4136: ) final;
4137:
4138: IF (SQL%ROWCOUNT = 0) THEN
4139: IF PG_DEBUG in ('Y', 'C') THEN
4140: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Error occured while doing sub-Total for customer class level');
4141: END IF;
4142: Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
4143: x_return_status := FND_API.G_RET_STS_ERROR;
4144: return;

Line 4148: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'After the summing SQL for Customer class level');

4144: return;
4145: END IF;
4146:
4147: IF PG_DEBUG in ('Y', 'C') THEN
4148: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'After the summing SQL for Customer class level');
4149: END IF;
4150:
4151: /* Do Total for level -1 records (grand total).
4152: 1. We let demand_class be null.

Line 4162: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Before the summing SQL at grand total level');

4158: 6. The grouping is done on period_start_date and period_end_date
4159: */
4160:
4161: IF PG_DEBUG in ('Y', 'C') THEN
4162: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Before the summing SQL at grand total level');
4163: END IF;
4164:
4165: INSERT INTO MRP_ATP_DETAILS_TEMP
4166: (

Line 4263: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Error occured while doing grand-Total for customer class case');

4259: ) final;
4260:
4261: IF (SQL%ROWCOUNT = 0) THEN
4262: IF PG_DEBUG in ('Y', 'C') THEN
4263: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Error occured while doing grand-Total for customer class case');
4264: END IF;
4265: Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
4266: x_return_status := FND_API.G_RET_STS_ERROR;
4267: return;

Line 4271: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'After the summing SQL at grand total level level');

4267: return;
4268: END IF;
4269:
4270: IF PG_DEBUG in ('Y', 'C') THEN
4271: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'After the summing SQL at grand total level level');
4272: END IF;
4273:
4274: /* New allocation logic for time phased ATP changes begin */
4275: IF (p_dest_inv_item_id <> p_dest_family_item_id) and (G_ATF_Date is not null) THEN

Line 4318: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'After the summing for Total for customer class allocation');

4314: END IF;
4315: /* New allocation logic for time phased ATP changes end */
4316:
4317: IF PG_DEBUG in ('Y', 'C') THEN
4318: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'After the summing for Total for customer class allocation');
4319: END IF;
4320:
4321: END IF; -- Customer Class Allocated ATP
4322:

Line 4324: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || '*********End of procedure Insert_Allocation_Details ********');

4320:
4321: END IF; -- Customer Class Allocated ATP
4322:
4323: IF PG_DEBUG in ('Y', 'C') THEN
4324: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || '*********End of procedure Insert_Allocation_Details ********');
4325: END IF;
4326:
4327: EXCEPTION
4328: WHEN OTHERS THEN

Line 4330: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Error in Insert_Allocation_Details: ' || to_char(sqlcode) || ':' || SQLERRM);

4326:
4327: EXCEPTION
4328: WHEN OTHERS THEN
4329: IF PG_DEBUG in ('Y', 'C') THEN
4330: msc_sch_wb.atp_debug('Insert_Allocation_Details: ' || 'Error in Insert_Allocation_Details: ' || to_char(sqlcode) || ':' || SQLERRM);
4331: END IF;
4332: x_return_status := FND_API.G_RET_STS_ERROR;
4333: Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
4334:

Line 4370: msc_sch_wb.atp_debug('Refresh_Allocation_Details: ' || 'Begin Refresh_Allocation_Details');

4366:
4367: RETCODE:= G_SUCCESS;
4368:
4369: IF PG_DEBUG in ('Y', 'C') THEN
4370: msc_sch_wb.atp_debug('Refresh_Allocation_Details: ' || 'Begin Refresh_Allocation_Details');
4371: msc_sch_wb.atp_debug('Refresh_Allocation_Details: ' || 'PG_DEBUG := ' || PG_DEBUG);
4372: END IF;
4373:
4374: -- Call View_Allocation_Details

Line 4371: msc_sch_wb.atp_debug('Refresh_Allocation_Details: ' || 'PG_DEBUG := ' || PG_DEBUG);

4367: RETCODE:= G_SUCCESS;
4368:
4369: IF PG_DEBUG in ('Y', 'C') THEN
4370: msc_sch_wb.atp_debug('Refresh_Allocation_Details: ' || 'Begin Refresh_Allocation_Details');
4371: msc_sch_wb.atp_debug('Refresh_Allocation_Details: ' || 'PG_DEBUG := ' || PG_DEBUG);
4372: END IF;
4373:
4374: -- Call View_Allocation_Details
4375: MSC_ATP_ALLOC.View_Allocation_Details(p_session_id,

Line 4383: msc_sch_wb.atp_debug('Refresh_Allocation_Details: ' || 'Refresh_Allocation_Details could not complete successfully');

4379: l_return_status);
4380:
4381: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
4382: IF PG_DEBUG in ('Y', 'C') THEN
4383: msc_sch_wb.atp_debug('Refresh_Allocation_Details: ' || 'Refresh_Allocation_Details could not complete successfully');
4384: msc_sch_wb.atp_debug('Refresh_Allocation_Details: ' || 'MSC_SCH_WB.G_ATP_ERROR_CODE := ' || MSC_SCH_WB.G_ATP_ERROR_CODE);
4385:
4386: END IF;
4387: OPEN Error_Meaning(MSC_SCH_WB.G_ATP_ERROR_CODE);

Line 4384: msc_sch_wb.atp_debug('Refresh_Allocation_Details: ' || 'MSC_SCH_WB.G_ATP_ERROR_CODE := ' || MSC_SCH_WB.G_ATP_ERROR_CODE);

4380:
4381: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
4382: IF PG_DEBUG in ('Y', 'C') THEN
4383: msc_sch_wb.atp_debug('Refresh_Allocation_Details: ' || 'Refresh_Allocation_Details could not complete successfully');
4384: msc_sch_wb.atp_debug('Refresh_Allocation_Details: ' || 'MSC_SCH_WB.G_ATP_ERROR_CODE := ' || MSC_SCH_WB.G_ATP_ERROR_CODE);
4385:
4386: END IF;
4387: OPEN Error_Meaning(MSC_SCH_WB.G_ATP_ERROR_CODE);
4388: FETCH Error_Meaning INTO l_error_meaning;

Line 4387: OPEN Error_Meaning(MSC_SCH_WB.G_ATP_ERROR_CODE);

4383: msc_sch_wb.atp_debug('Refresh_Allocation_Details: ' || 'Refresh_Allocation_Details could not complete successfully');
4384: msc_sch_wb.atp_debug('Refresh_Allocation_Details: ' || 'MSC_SCH_WB.G_ATP_ERROR_CODE := ' || MSC_SCH_WB.G_ATP_ERROR_CODE);
4385:
4386: END IF;
4387: OPEN Error_Meaning(MSC_SCH_WB.G_ATP_ERROR_CODE);
4388: FETCH Error_Meaning INTO l_error_meaning;
4389: IF Error_Meaning%notfound THEN
4390: msc_util.msc_log('Error: ' || MSC_SCH_WB.G_ATP_ERROR_CODE);
4391: ELSE

Line 4390: msc_util.msc_log('Error: ' || MSC_SCH_WB.G_ATP_ERROR_CODE);

4386: END IF;
4387: OPEN Error_Meaning(MSC_SCH_WB.G_ATP_ERROR_CODE);
4388: FETCH Error_Meaning INTO l_error_meaning;
4389: IF Error_Meaning%notfound THEN
4390: msc_util.msc_log('Error: ' || MSC_SCH_WB.G_ATP_ERROR_CODE);
4391: ELSE
4392: msc_util.msc_log(l_error_meaning);
4393: IF PG_DEBUG in ('Y', 'C') THEN
4394: msc_sch_wb.atp_debug('Refresh_Allocation_Details: ' || l_error_meaning);

Line 4394: msc_sch_wb.atp_debug('Refresh_Allocation_Details: ' || l_error_meaning);

4390: msc_util.msc_log('Error: ' || MSC_SCH_WB.G_ATP_ERROR_CODE);
4391: ELSE
4392: msc_util.msc_log(l_error_meaning);
4393: IF PG_DEBUG in ('Y', 'C') THEN
4394: msc_sch_wb.atp_debug('Refresh_Allocation_Details: ' || l_error_meaning);
4395: END IF;
4396: END IF;
4397: CLOSE Error_Meaning;
4398: RETCODE:= G_ERROR;

Line 4401: msc_sch_wb.atp_debug('Refresh_Allocation_Details: ' || 'Refresh_Allocation_Details completed successfully');

4397: CLOSE Error_Meaning;
4398: RETCODE:= G_ERROR;
4399: ELSE
4400: IF PG_DEBUG in ('Y', 'C') THEN
4401: msc_sch_wb.atp_debug('Refresh_Allocation_Details: ' || 'Refresh_Allocation_Details completed successfully');
4402: END IF;
4403: END IF;
4404:
4405: IF PG_DEBUG in ('Y', 'C') THEN

Line 4406: msc_sch_wb.atp_debug('Refresh_Allocation_Details: ' || 'End Refresh_Allocation_Details');

4402: END IF;
4403: END IF;
4404:
4405: IF PG_DEBUG in ('Y', 'C') THEN
4406: msc_sch_wb.atp_debug('Refresh_Allocation_Details: ' || 'End Refresh_Allocation_Details');
4407: END IF;
4408:
4409: EXCEPTION
4410: WHEN OTHERS THEN

Line 4412: msc_sch_wb.atp_debug('Refresh_Allocation_Details: ' || to_char(sqlcode) || ':' || sqlerrm);

4408:
4409: EXCEPTION
4410: WHEN OTHERS THEN
4411: IF PG_DEBUG in ('Y', 'C') THEN
4412: msc_sch_wb.atp_debug('Refresh_Allocation_Details: ' || to_char(sqlcode) || ':' || sqlerrm);
4413: END IF;
4414: RETCODE:= G_ERROR;
4415: ERRBUF:= SQLERRM;
4416:

Line 4437: msc_sch_wb.atp_debug('Backward_Consume: ' || '**********Begin Backward_Consume Procedure************');

4433: l_atf_date DATE := MSC_ATP_ALLOC.G_ATF_Date;
4434: BEGIN
4435:
4436: IF PG_DEBUG in ('Y', 'C') THEN
4437: msc_sch_wb.atp_debug('Backward_Consume: ' || '**********Begin Backward_Consume Procedure************');
4438: END IF;
4439:
4440: -- Initializing API return code
4441: x_return_status := FND_API.G_RET_STS_SUCCESS;

Line 4510: msc_sch_wb.atp_debug('Backward_Consume: ' || 'DC:start:end:priority - ' || x_dc_list_tab(i) || ':' ||

4506: END LOOP;
4507:
4508: IF PG_DEBUG in ('Y', 'C') THEN
4509: FOR i in 1..x_dc_list_tab.COUNT LOOP
4510: msc_sch_wb.atp_debug('Backward_Consume: ' || 'DC:start:end:priority - ' || x_dc_list_tab(i) || ':' ||
4511: x_dc_start_index(i) || ':' ||
4512: x_dc_end_index(i) || ':' ||
4513: p_atp_period.Identifier2(x_dc_start_index(i)));
4514: END LOOP;

Line 4516: msc_sch_wb.atp_debug('Backward_Consume: ' || '**********End Backward_Consume Procedure************');

4512: x_dc_end_index(i) || ':' ||
4513: p_atp_period.Identifier2(x_dc_start_index(i)));
4514: END LOOP;
4515:
4516: msc_sch_wb.atp_debug('Backward_Consume: ' || '**********End Backward_Consume Procedure************');
4517: END IF;
4518:
4519: EXCEPTION
4520: WHEN OTHERS THEN

Line 4522: msc_sch_wb.atp_debug('Backward_Consume: ' || 'Error occurred: ' || to_char(sqlcode) || ':' || SQLERRM);

4518:
4519: EXCEPTION
4520: WHEN OTHERS THEN
4521: IF PG_DEBUG in ('Y', 'C') THEN
4522: msc_sch_wb.atp_debug('Backward_Consume: ' || 'Error occurred: ' || to_char(sqlcode) || ':' || SQLERRM);
4523: END IF;
4524: x_return_status := FND_API.G_RET_STS_ERROR;
4525: Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
4526:

Line 4546: msc_sch_wb.atp_debug('Forward_Consume: ' || '**********Begin Forward_Consume Procedure************');

4542: l_atf_date DATE := MSC_ATP_ALLOC.G_ATF_Date;
4543: l_fw_nullifying_bucket_index NUMBER := 1;
4544: BEGIN
4545: IF PG_DEBUG in ('Y', 'C') THEN
4546: msc_sch_wb.atp_debug('Forward_Consume: ' || '**********Begin Forward_Consume Procedure************');
4547: END IF;
4548:
4549: -- Initializing API return code
4550: x_return_status := FND_API.G_RET_STS_SUCCESS;

Line 4558: msc_sch_wb.atp_debug('Forward_Consume: ' || 'current date:qty - '||

4554:
4555: IF PG_DEBUG in ('Y', 'C') THEN
4556: i := p_start_index;
4557: WHILE (i is not null) AND (i <= p_end_index) LOOP
4558: msc_sch_wb.atp_debug('Forward_Consume: ' || 'current date:qty - '||
4559: p_atp_period.Period_Start_Date(i) ||' : '|| p_atp_period.Adjusted_Availability_Quantity(i) );
4560: i := p_atp_period.Period_Start_Date.Next(i);
4561: END LOOP;
4562: END IF;

Line 4573: msc_sch_wb.atp_debug('Forward_Consume: ' || 'shortage - qty,i:' || p_atp_period.Adjusted_Availability_Quantity(i) || ',' || i);

4569:
4570: j := i + 1;
4571:
4572: IF PG_DEBUG in ('Y', 'C') THEN
4573: msc_sch_wb.atp_debug('Forward_Consume: ' || 'shortage - qty,i:' || p_atp_period.Adjusted_Availability_Quantity(i) || ',' || i);
4574: END IF;
4575:
4576: WHILE (j <= p_end_index) LOOP
4577: -- time_phased_atp

Line 4594: msc_sch_wb.atp_debug('Forward_Consume: ' || 'consuming - qty,j:' ||

4590: IF (p_atp_period.Adjusted_Availability_Quantity(j) +
4591: p_atp_period.Adjusted_Availability_Quantity(i) < 0) THEN
4592: -- not enough to cover the shortage
4593: IF PG_DEBUG in ('Y', 'C') THEN
4594: msc_sch_wb.atp_debug('Forward_Consume: ' || 'consuming - qty,j:' ||
4595: p_atp_period.Adjusted_Availability_Quantity(j) || ',' || j);
4596: END IF;
4597: p_atp_period.Adjusted_Availability_Quantity(i) := p_atp_period.Adjusted_Availability_Quantity(i) +
4598: p_atp_period.Adjusted_Availability_Quantity(j);

Line 4604: msc_sch_wb.atp_debug('Forward_Consume: ' || 'consuming last - qty,j:' ||

4600: j := j + 1;
4601: ELSE
4602: -- enough to cover the shortage
4603: IF PG_DEBUG in ('Y', 'C') THEN
4604: msc_sch_wb.atp_debug('Forward_Consume: ' || 'consuming last - qty,j:' ||
4605: p_atp_period.Adjusted_Availability_Quantity(i) || ',' || j);
4606: END IF;
4607: p_atp_period.Adjusted_Availability_Quantity(j) := p_atp_period.Adjusted_Availability_Quantity(j) +
4608: p_atp_period.Adjusted_Availability_Quantity(i);

Line 4621: msc_sch_wb.atp_debug('Forward_Consume: ' || 'current date:qty - '||

4617:
4618: IF PG_DEBUG in ('Y', 'C') THEN
4619: i := p_start_index;
4620: WHILE (i is not null) AND (i <= p_end_index) LOOP
4621: msc_sch_wb.atp_debug('Forward_Consume: ' || 'current date:qty - '||
4622: p_atp_period.Period_Start_Date(i) ||' : '|| p_atp_period.Adjusted_Availability_Quantity(i) );
4623: i := p_atp_period.Period_Start_Date.Next(i);
4624: END LOOP;
4625: msc_sch_wb.atp_debug('Forward_Consume: ' || '**********End Forward_Consume Procedure************');

Line 4625: msc_sch_wb.atp_debug('Forward_Consume: ' || '**********End Forward_Consume Procedure************');

4621: msc_sch_wb.atp_debug('Forward_Consume: ' || 'current date:qty - '||
4622: p_atp_period.Period_Start_Date(i) ||' : '|| p_atp_period.Adjusted_Availability_Quantity(i) );
4623: i := p_atp_period.Period_Start_Date.Next(i);
4624: END LOOP;
4625: msc_sch_wb.atp_debug('Forward_Consume: ' || '**********End Forward_Consume Procedure************');
4626: END IF;
4627: EXCEPTION
4628: WHEN OTHERS THEN
4629: IF PG_DEBUG in ('Y', 'C') THEN

Line 4630: msc_sch_wb.atp_debug('Forward_Consume: ' || 'Error occurred: ' || to_char(sqlcode) || ':' || SQLERRM);

4626: END IF;
4627: EXCEPTION
4628: WHEN OTHERS THEN
4629: IF PG_DEBUG in ('Y', 'C') THEN
4630: msc_sch_wb.atp_debug('Forward_Consume: ' || 'Error occurred: ' || to_char(sqlcode) || ':' || SQLERRM);
4631: END IF;
4632: x_return_status := FND_API.G_RET_STS_ERROR;
4633: Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
4634:

Line 4657: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || '**********Begin Backward_Forward_Consume Procedure************');

4653: l_fw_nullifying_bucket_index NUMBER := 1;
4654: BEGIN
4655:
4656: IF PG_DEBUG in ('Y', 'C') THEN
4657: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || '**********Begin Backward_Forward_Consume Procedure************');
4658: END IF;
4659:
4660: -- Initializing API return code
4661: x_return_status := FND_API.G_RET_STS_SUCCESS;

Line 4682: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'index : ' || i);

4678: -- this for loop will do backward consumption
4679: FOR i in 1..p_atp_period.demand_class.COUNT LOOP
4680:
4681: IF PG_DEBUG in ('Y', 'C') THEN
4682: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'index : ' || i);
4683: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'x_dc_list_tab : ' || x_dc_list_tab(x_dc_list_tab.COUNT));
4684: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'p_atp_period.demand_class : ' || p_atp_period.demand_class(i));
4685: END IF;
4686:

Line 4683: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'x_dc_list_tab : ' || x_dc_list_tab(x_dc_list_tab.COUNT));

4679: FOR i in 1..p_atp_period.demand_class.COUNT LOOP
4680:
4681: IF PG_DEBUG in ('Y', 'C') THEN
4682: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'index : ' || i);
4683: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'x_dc_list_tab : ' || x_dc_list_tab(x_dc_list_tab.COUNT));
4684: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'p_atp_period.demand_class : ' || p_atp_period.demand_class(i));
4685: END IF;
4686:
4687: -- If demand class changes, re-initialize these variables.

Line 4684: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'p_atp_period.demand_class : ' || p_atp_period.demand_class(i));

4680:
4681: IF PG_DEBUG in ('Y', 'C') THEN
4682: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'index : ' || i);
4683: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'x_dc_list_tab : ' || x_dc_list_tab(x_dc_list_tab.COUNT));
4684: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'p_atp_period.demand_class : ' || p_atp_period.demand_class(i));
4685: END IF;
4686:
4687: -- If demand class changes, re-initialize these variables.
4688: IF p_atp_period.demand_class(i) <> x_dc_list_tab(x_dc_list_tab.COUNT) THEN

Line 4690: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'Demand class changing');

4686:
4687: -- If demand class changes, re-initialize these variables.
4688: IF p_atp_period.demand_class(i) <> x_dc_list_tab(x_dc_list_tab.COUNT) THEN
4689: IF PG_DEBUG in ('Y', 'C') THEN
4690: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'Demand class changing');
4691: END IF;
4692:
4693: x_dc_end_index(x_dc_end_index.COUNT) := i - 1;
4694:

Line 4696: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'demand class, end index : ' || x_dc_list_tab(x_dc_list_tab.COUNT)

4692:
4693: x_dc_end_index(x_dc_end_index.COUNT) := i - 1;
4694:
4695: IF PG_DEBUG in ('Y', 'C') THEN
4696: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'demand class, end index : ' || x_dc_list_tab(x_dc_list_tab.COUNT)
4697: || ', ' || x_dc_end_index(x_dc_end_index.COUNT));
4698: END IF;
4699:
4700: x_dc_list_tab.EXTEND;

Line 4708: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'demand class, start index : ' || x_dc_list_tab(x_dc_list_tab.COUNT)

4704: x_dc_start_index(x_dc_start_index.COUNT) := i;
4705: x_dc_end_index(x_dc_end_index.COUNT) := i;
4706:
4707: IF PG_DEBUG in ('Y', 'C') THEN
4708: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'demand class, start index : ' || x_dc_list_tab(x_dc_list_tab.COUNT)
4709: || ', ' || x_dc_start_index(x_dc_start_index.COUNT));
4710: END IF;
4711: ELSE
4712: x_dc_end_index(x_dc_end_index.COUNT) := i;

Line 4746: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'before forward consumption');

4742: END LOOP;
4743: END IF;
4744:
4745: IF PG_DEBUG in ('Y', 'C') THEN
4746: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'before forward consumption');
4747: END IF;
4748: -- this for loop will do forward consumption
4749:
4750: -- forward consumption when neg atp quantity occurs

Line 4756: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'in forward consumption : ' || i || ':' || j);

4752:
4753: j := i + 1;
4754:
4755: IF PG_DEBUG in ('Y', 'C') THEN
4756: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'in forward consumption : ' || i || ':' || j);
4757: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'in forward : ' || p_atp_period.demand_class.COUNT);
4758: END IF;
4759:
4760: IF j <= p_atp_period.demand_class.COUNT THEN

Line 4757: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'in forward : ' || p_atp_period.demand_class.COUNT);

4753: j := i + 1;
4754:
4755: IF PG_DEBUG in ('Y', 'C') THEN
4756: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'in forward consumption : ' || i || ':' || j);
4757: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'in forward : ' || p_atp_period.demand_class.COUNT);
4758: END IF;
4759:
4760: IF j <= p_atp_period.demand_class.COUNT THEN
4761:

Line 4763: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'in j : ' || p_atp_period.demand_class.COUNT);

4759:
4760: IF j <= p_atp_period.demand_class.COUNT THEN
4761:
4762: IF PG_DEBUG in ('Y', 'C') THEN
4763: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'in j : ' || p_atp_period.demand_class.COUNT);
4764: END IF;
4765:
4766: WHILE (p_atp_period.demand_class(j) = x_dc_list_tab(x_dc_list_tab.COUNT)) LOOP
4767: -- time_phased_atp

Line 4806: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || '**********End Backward_Forward_Consume Procedure************');

4802:
4803: END LOOP;
4804:
4805: IF PG_DEBUG in ('Y', 'C') THEN
4806: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || '**********End Backward_Forward_Consume Procedure************');
4807: END IF;
4808:
4809: EXCEPTION
4810: WHEN OTHERS THEN

Line 4812: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'Error occurred: ' || to_char(sqlcode) || ':' || SQLERRM);

4808:
4809: EXCEPTION
4810: WHEN OTHERS THEN
4811: IF PG_DEBUG in ('Y', 'C') THEN
4812: msc_sch_wb.atp_debug('Backward_Forward_Consume: ' || 'Error occurred: ' || to_char(sqlcode) || ':' || SQLERRM);
4813: END IF;
4814: x_return_status := FND_API.G_RET_STS_ERROR;
4815: Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
4816:

Line 4836: msc_sch_wb.atp_debug('Compute_Cum: ' || '**********Begin Compute_Cum Procedure************');

4832: j PLS_INTEGER;
4833: BEGIN
4834:
4835: IF PG_DEBUG in ('Y', 'C') THEN
4836: msc_sch_wb.atp_debug('Compute_Cum: ' || '**********Begin Compute_Cum Procedure************');
4837: END IF;
4838:
4839: -- Initializing API return code
4840: x_return_status := FND_API.G_RET_STS_SUCCESS;

Line 4853: msc_sch_wb.atp_debug('Compute_Cum: ' || '**********End Compute_Cum Procedure************');

4849:
4850: END LOOP;
4851:
4852: IF PG_DEBUG in ('Y', 'C') THEN
4853: msc_sch_wb.atp_debug('Compute_Cum: ' || '**********End Compute_Cum Procedure************');
4854: END IF;
4855: EXCEPTION
4856: WHEN OTHERS THEN
4857: IF PG_DEBUG in ('Y', 'C') THEN

Line 4858: msc_sch_wb.atp_debug('Compute_Cum: ' || 'Error occurred: ' || to_char(sqlcode) || ':' || SQLERRM);

4854: END IF;
4855: EXCEPTION
4856: WHEN OTHERS THEN
4857: IF PG_DEBUG in ('Y', 'C') THEN
4858: msc_sch_wb.atp_debug('Compute_Cum: ' || 'Error occurred: ' || to_char(sqlcode) || ':' || SQLERRM);
4859: END IF;
4860: x_return_status := FND_API.G_RET_STS_ERROR;
4861: Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
4862: END Compute_Cum;

Line 4879: msc_sch_wb.atp_debug('Compute_Cum_Individual: ' || '**********Begin Compute_Cum_Individual Procedure************');

4875: l_cumm NUMBER;
4876: BEGIN
4877:
4878: IF PG_DEBUG in ('Y', 'C') THEN
4879: msc_sch_wb.atp_debug('Compute_Cum_Individual: ' || '**********Begin Compute_Cum_Individual Procedure************');
4880: msc_sch_wb.atp_debug('Compute_Cum_Individual: ' || 'p_start_index : ' || p_start_index);
4881: msc_sch_wb.atp_debug('Compute_Cum_Individual: ' || 'p_end_index : ' || p_end_index);
4882: END IF;
4883:

Line 4880: msc_sch_wb.atp_debug('Compute_Cum_Individual: ' || 'p_start_index : ' || p_start_index);

4876: BEGIN
4877:
4878: IF PG_DEBUG in ('Y', 'C') THEN
4879: msc_sch_wb.atp_debug('Compute_Cum_Individual: ' || '**********Begin Compute_Cum_Individual Procedure************');
4880: msc_sch_wb.atp_debug('Compute_Cum_Individual: ' || 'p_start_index : ' || p_start_index);
4881: msc_sch_wb.atp_debug('Compute_Cum_Individual: ' || 'p_end_index : ' || p_end_index);
4882: END IF;
4883:
4884: -- Initializing API return code

Line 4881: msc_sch_wb.atp_debug('Compute_Cum_Individual: ' || 'p_end_index : ' || p_end_index);

4877:
4878: IF PG_DEBUG in ('Y', 'C') THEN
4879: msc_sch_wb.atp_debug('Compute_Cum_Individual: ' || '**********Begin Compute_Cum_Individual Procedure************');
4880: msc_sch_wb.atp_debug('Compute_Cum_Individual: ' || 'p_start_index : ' || p_start_index);
4881: msc_sch_wb.atp_debug('Compute_Cum_Individual: ' || 'p_end_index : ' || p_end_index);
4882: END IF;
4883:
4884: -- Initializing API return code
4885: x_return_status := FND_API.G_RET_STS_SUCCESS;

Line 4899: msc_sch_wb.atp_debug('Compute_Cum_Individual: ' || 'cum date:qty - '||

4895:
4896: IF PG_DEBUG in ('Y', 'C') THEN
4897: i := p_start_index;
4898: WHILE (i is not null) AND (i <= p_end_index) LOOP
4899: msc_sch_wb.atp_debug('Compute_Cum_Individual: ' || 'cum date:qty - '||
4900: p_atp_period.Period_Start_Date(i) ||' : '|| p_atp_period.cumulative_quantity(i) );
4901: i := p_atp_period.Period_Start_Date.Next(i);
4902: END LOOP;
4903: msc_sch_wb.atp_debug('Compute_Cum_Individual: ' || '**********End Compute_Cum_Individual Procedure************');

Line 4903: msc_sch_wb.atp_debug('Compute_Cum_Individual: ' || '**********End Compute_Cum_Individual Procedure************');

4899: msc_sch_wb.atp_debug('Compute_Cum_Individual: ' || 'cum date:qty - '||
4900: p_atp_period.Period_Start_Date(i) ||' : '|| p_atp_period.cumulative_quantity(i) );
4901: i := p_atp_period.Period_Start_Date.Next(i);
4902: END LOOP;
4903: msc_sch_wb.atp_debug('Compute_Cum_Individual: ' || '**********End Compute_Cum_Individual Procedure************');
4904: END IF;
4905: EXCEPTION
4906: WHEN OTHERS THEN
4907: IF PG_DEBUG in ('Y', 'C') THEN

Line 4908: msc_sch_wb.atp_debug('Compute_Cum_Individual: ' || 'Error occurred: ' || to_char(sqlcode) || ':' || SQLERRM);

4904: END IF;
4905: EXCEPTION
4906: WHEN OTHERS THEN
4907: IF PG_DEBUG in ('Y', 'C') THEN
4908: msc_sch_wb.atp_debug('Compute_Cum_Individual: ' || 'Error occurred: ' || to_char(sqlcode) || ':' || SQLERRM);
4909: END IF;
4910: x_return_status := FND_API.G_RET_STS_ERROR;
4911: Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
4912: END Compute_Cum_Individual;

Line 4950: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || '*********Begin procedure Adjust_Allocation_Details ********');

4946: j PLS_INTEGER;
4947: mm PLS_INTEGER;
4948: BEGIN
4949: IF PG_DEBUG in ('Y', 'C') THEN
4950: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || '*********Begin procedure Adjust_Allocation_Details ********');
4951: END IF;
4952:
4953: -- Initializing API return code
4954: x_return_status := FND_API.G_RET_STS_SUCCESS;

Line 4987: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Backward_Consume');

4983:
4984: Backward_Consume(p_atp_period, x_dc_list_tab, x_dc_start_index, x_dc_end_index, l_return_status);
4985: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
4986: IF PG_DEBUG in ('Y', 'C') THEN
4987: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Backward_Consume');
4988: END IF;
4989: x_return_status := FND_API.G_RET_STS_ERROR;
4990: return;
4991: END IF;

Line 4995: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'DC:Date:Qty - ' || p_atp_period.demand_class(mm) || ':' ||

4991: END IF;
4992:
4993: IF PG_DEBUG in ('Y', 'C') THEN
4994: FOR mm in 1..p_atp_period.demand_class.COUNT LOOP
4995: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'DC:Date:Qty - ' || p_atp_period.demand_class(mm) || ':' ||
4996: p_atp_period.Period_Start_Date(mm) || ':' ||
4997: p_atp_period.Backward_Quantity(mm));
4998: END LOOP;
4999: END IF;

Line 5013: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Forward_Consume');

5009: l_end_index := x_dc_end_index(x_dc_list_tab.COUNT);
5010: Forward_Consume(p_atp_period, l_start_index, l_end_index, l_return_status);
5011: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5012: IF PG_DEBUG in ('Y', 'C') THEN
5013: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Forward_Consume');
5014: END IF;
5015: x_return_status := FND_API.G_RET_STS_ERROR;
5016: return;
5017: END IF;

Line 5026: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Compute_Cum_Individual');

5022: IF G_ATP_FW_CONSUME_METHOD = 2 THEN
5023: Compute_Cum_Individual(p_atp_period, l_start_index, l_end_index, l_return_status);
5024: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5025: IF PG_DEBUG in ('Y', 'C') THEN
5026: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Compute_Cum_Individual');
5027: END IF;
5028: x_return_status := FND_API.G_RET_STS_ERROR;
5029: return;
5030: END IF;

Line 5043: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'l_dc_count: ' || l_dc_count);

5039: l_dc_count := x_dc_list_tab.Prior(l_dc_count);
5040: -- subtract 1 bacause of unallocated records
5041: -- END IF;
5042: IF PG_DEBUG in ('Y', 'C') THEN
5043: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'l_dc_count: ' || l_dc_count);
5044: END IF;
5045:
5046: IF (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) THEN
5047: -- Demand class case

Line 5050: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Demand class case.');

5046: IF (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) THEN
5047: -- Demand class case
5048:
5049: IF PG_DEBUG in ('Y', 'C') THEN
5050: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Demand class case.');
5051: END IF;
5052:
5053: j := l_dc_count;
5054: WHILE (j is not null) LOOP

Line 5064: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'l_lowest_priority_demand_class: ' || l_lowest_priority_demand_class);

5060: j := x_dc_list_tab.Prior(j);
5061: END LOOP;
5062:
5063: IF PG_DEBUG in ('Y', 'C') THEN
5064: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'l_lowest_priority_demand_class: ' || l_lowest_priority_demand_class);
5065: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'l_lowest_priority: ' || l_lowest_priority);
5066: END IF;
5067:
5068: -- this for loop will do the demand class consumption

Line 5065: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'l_lowest_priority: ' || l_lowest_priority);

5061: END LOOP;
5062:
5063: IF PG_DEBUG in ('Y', 'C') THEN
5064: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'l_lowest_priority_demand_class: ' || l_lowest_priority_demand_class);
5065: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'l_lowest_priority: ' || l_lowest_priority);
5066: END IF;
5067:
5068: -- this for loop will do the demand class consumption
5069: FOR j in 1..l_dc_count LOOP

Line 5075: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'DC changed. limits : ' || l_start_index || ',' || l_end_index);

5071: l_start_index := x_dc_start_index(j);
5072: l_end_index := x_dc_end_index(j);
5073:
5074: IF PG_DEBUG in ('Y', 'C') THEN
5075: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'DC changed. limits : ' || l_start_index || ',' || l_end_index);
5076: END IF;
5077:
5078: IF (j > 1) THEN
5079: IF p_atp_period.Identifier2(x_dc_start_index(j)) > p_atp_period.Identifier2(x_dc_start_index(j-1)) THEN

Line 5081: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Priority changing. Changing l_current_steal_atp');

5077:
5078: IF (j > 1) THEN
5079: IF p_atp_period.Identifier2(x_dc_start_index(j)) > p_atp_period.Identifier2(x_dc_start_index(j-1)) THEN
5080: IF PG_DEBUG in ('Y', 'C') THEN
5081: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Priority changing. Changing l_current_steal_atp');
5082: END IF;
5083: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_next_steal_atp, l_current_steal_atp);
5084: l_next_steal_atp := l_null_steal_atp;
5085: END IF;

Line 5092: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Before doing DC consumption.');

5088: IF p_atp_period.Identifier2(x_dc_start_index(j)) <> p_atp_period.Identifier2(1) THEN
5089: -- We need to do demand class consumption only if we are not in
5090: -- the highest priority
5091: IF PG_DEBUG in ('Y', 'C') THEN
5092: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Before doing DC consumption.');
5093: END IF;
5094: Demand_Class_Consumption(p_atp_period, l_start_index,
5095: l_end_index, l_current_steal_atp, l_return_status);
5096: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

Line 5098: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Demand_Class_Consumption(');

5094: Demand_Class_Consumption(p_atp_period, l_start_index,
5095: l_end_index, l_current_steal_atp, l_return_status);
5096: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5097: IF PG_DEBUG in ('Y', 'C') THEN
5098: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Demand_Class_Consumption(');
5099: END IF;
5100: x_return_status := FND_API.G_RET_STS_ERROR;
5101: return;
5102: END IF;

Line 5104: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'After doing DC consumption.');

5100: x_return_status := FND_API.G_RET_STS_ERROR;
5101: return;
5102: END IF;
5103: IF PG_DEBUG in ('Y', 'C') THEN
5104: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'After doing DC consumption.');
5105: END IF;
5106: END IF;
5107:
5108: IF p_atp_period.Identifier2(x_dc_start_index(j)) < l_lowest_priority OR

Line 5125: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Add_to_Next_Steal');

5121: Add_to_Next_Steal(p_atp_period, l_start_index,
5122: l_end_index, l_next_steal_atp, l_return_status);
5123: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5124: IF PG_DEBUG in ('Y', 'C') THEN
5125: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Add_to_Next_Steal');
5126: END IF;
5127: x_return_status := FND_API.G_RET_STS_ERROR;
5128: return;
5129: END IF;

Line 5139: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Add_to_Current_Atp');

5135: Add_to_Current_Atp(p_atp_period, l_start_index,
5136: l_end_index, l_current_steal_atp, l_return_status);
5137: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5138: IF PG_DEBUG in ('Y', 'C') THEN
5139: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Add_to_Current_Atp');
5140: END IF;
5141: x_return_status := FND_API.G_RET_STS_ERROR;
5142: return;
5143: END IF;

Line 5149: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Forward_Consume');

5145:
5146: Forward_Consume(p_atp_period, l_start_index, l_end_index, l_return_status);
5147: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5148: IF PG_DEBUG in ('Y', 'C') THEN
5149: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Forward_Consume');
5150: END IF;
5151: x_return_status := FND_API.G_RET_STS_ERROR;
5152: return;
5153: END IF;

Line 5158: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Remove_Negatives');

5154:
5155: Remove_Negatives(p_atp_period, l_start_index, l_end_index, l_return_status);
5156: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5157: IF PG_DEBUG in ('Y', 'C') THEN
5158: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Remove_Negatives');
5159: END IF;
5160: x_return_status := FND_API.G_RET_STS_ERROR;
5161: return;
5162: END IF;

Line 5167: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'adjusted date:qty - '||

5163: END IF;
5164:
5165: IF PG_DEBUG in ('Y', 'C') THEN
5166: FOR mm in l_start_index..l_end_index LOOP
5167: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'adjusted date:qty - '||
5168: p_atp_period.Period_Start_Date(mm) ||' : '|| p_atp_period.Adjusted_Availability_Quantity(mm) );
5169: END LOOP;
5170: END IF;
5171:

Line 5176: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Compute_Cum_Individual');

5172: IF G_ATP_FW_CONSUME_METHOD = 2 THEN
5173: Compute_Cum_Individual(p_atp_period, l_start_index, l_end_index, l_return_status);
5174: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5175: IF PG_DEBUG in ('Y', 'C') THEN
5176: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Compute_Cum_Individual');
5177: END IF;
5178: x_return_status := FND_API.G_RET_STS_ERROR;
5179: return;
5180: END IF;

Line 5186: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Adjust_Cum');

5182: Adjust_Cum(p_atp_period, l_start_index, l_end_index,
5183: x_dc_start_index(x_dc_list_tab.COUNT), x_dc_end_index(x_dc_list_tab.COUNT), l_return_status);
5184: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5185: IF PG_DEBUG in ('Y', 'C') THEN
5186: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Adjust_Cum');
5187: END IF;
5188: x_return_status := FND_API.G_RET_STS_ERROR;
5189: return;
5190: END IF;

Line 5194: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'adjusted cum date:qty - '||

5190: END IF;
5191:
5192: IF PG_DEBUG in ('Y', 'C') THEN
5193: FOR mm in l_start_index..l_end_index LOOP
5194: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'adjusted cum date:qty - '||
5195: p_atp_period.Period_Start_Date(mm) ||' : '|| p_atp_period.Adjusted_Cum_Quantity(mm) );
5196: END LOOP;
5197: END IF;
5198: END IF;

Line 5208: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Customer class case.');

5204: -- IF (MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) THEN
5205: -- Customer class heirarchy
5206:
5207: IF PG_DEBUG in ('Y', 'C') THEN
5208: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Customer class case.');
5209: END IF;
5210:
5211: IF G_ATP_FW_CONSUME_METHOD = 1 THEN
5212: -- steal from lower priority

Line 5290: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'priotity:l_fw_consume_tab(' || mm || ') = '

5286: END LOOP;
5287:
5288: IF PG_DEBUG in ('Y', 'C') THEN
5289: FOR mm in 1..l_fw_consume_tab.COUNT LOOP
5290: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'priotity:l_fw_consume_tab(' || mm || ') = '
5291: || p_atp_period.Identifier2(x_dc_start_index(mm)) || ':'
5292: || l_fw_consume_tab(mm));
5293: END LOOP;
5294: END IF;

Line 5311: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'DC changed. limits : ' || l_start_index || ',' || l_end_index);

5307: l_start_index := x_dc_start_index(j);
5308: l_end_index := x_dc_end_index(j);
5309:
5310: IF PG_DEBUG in ('Y', 'C') THEN
5311: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'DC changed. limits : ' || l_start_index || ',' || l_end_index);
5312: END IF;
5313:
5314: IF (j > 1) THEN
5315: IF p_atp_period.Class(x_dc_start_index(j)) <> p_atp_period.Class(x_dc_start_index(j-1)) THEN

Line 5317: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Class changing. Changing l_class_next_steal_atp');

5313:
5314: IF (j > 1) THEN
5315: IF p_atp_period.Class(x_dc_start_index(j)) <> p_atp_period.Class(x_dc_start_index(j-1)) THEN
5316: IF PG_DEBUG in ('Y', 'C') THEN
5317: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Class changing. Changing l_class_next_steal_atp');
5318: END IF;
5319: -- class_next += curr + next + partner_curr + partner_next
5320: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_steal_atp, l_class_next_steal_atp);
5321: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_next_steal_atp, l_class_next_steal_atp);

Line 5332: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Class priority changing. Changing l_class_curr_steal_atp');

5328: l_partner_next_steal_atp := l_null_steal_atp;
5329:
5330: IF trunc(p_atp_period.Identifier2(x_dc_start_index(j)),-3) > trunc(p_atp_period.Identifier2(x_dc_start_index(j-1)),-3) THEN
5331: IF PG_DEBUG in ('Y', 'C') THEN
5332: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Class priority changing. Changing l_class_curr_steal_atp');
5333: END IF;
5334: -- class_curr += class_next
5335: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_class_next_steal_atp, l_class_curr_steal_atp);
5336: l_class_next_steal_atp := l_null_steal_atp;

Line 5341: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Customer changing. Changing l_partner_next_steal_atp');

5337: END IF;
5338:
5339: ELSIF p_atp_period.Customer_Id(x_dc_start_index(j)) <> p_atp_period.Customer_Id(x_dc_start_index(j-1)) THEN
5340: IF PG_DEBUG in ('Y', 'C') THEN
5341: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Customer changing. Changing l_partner_next_steal_atp');
5342: END IF;
5343: -- partner_next += curr + next
5344: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_current_steal_atp, l_partner_next_steal_atp);
5345: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_next_steal_atp, l_partner_next_steal_atp);

Line 5352: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Customer priority changing. Changing l_partner_curr_steal_atp');

5348: l_next_steal_atp := l_null_steal_atp;
5349:
5350: IF trunc(p_atp_period.Identifier2(x_dc_start_index(j)),-2) > trunc(p_atp_period.Identifier2(x_dc_start_index(j-1)),-2) THEN
5351: IF PG_DEBUG in ('Y', 'C') THEN
5352: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Customer priority changing. Changing l_partner_curr_steal_atp');
5353: END IF;
5354: -- partner_curr += partner_next
5355: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_partner_next_steal_atp, l_partner_curr_steal_atp);
5356: l_partner_next_steal_atp := l_null_steal_atp;

Line 5361: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Priority changing. Changing l_current_steal_atp');

5357: END IF;
5358:
5359: ELSIF p_atp_period.Identifier2(x_dc_start_index(j)) > p_atp_period.Identifier2(x_dc_start_index(j-1)) THEN
5360: IF PG_DEBUG in ('Y', 'C') THEN
5361: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Priority changing. Changing l_current_steal_atp');
5362: END IF;
5363: -- curr += next
5364: MSC_AATP_PVT.Add_to_Next_Steal_Atp(l_next_steal_atp, l_current_steal_atp);
5365: l_next_steal_atp := l_null_steal_atp;

Line 5373: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Before doing DC consumption with l_class_curr_steal_atp.');

5369: IF p_atp_period.Class(x_dc_start_index(j)) <> p_atp_period.Class(1) THEN
5370: -- We need to do demand class consumption with l_class_curr_steal_atp only
5371: -- if we are not in the first demand class
5372: IF PG_DEBUG in ('Y', 'C') THEN
5373: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Before doing DC consumption with l_class_curr_steal_atp.');
5374: END IF;
5375: Demand_Class_Consumption(p_atp_period, l_start_index,
5376: l_end_index, l_class_curr_steal_atp, l_return_status);
5377: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

Line 5379: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Demand_Class_Consumption');

5375: Demand_Class_Consumption(p_atp_period, l_start_index,
5376: l_end_index, l_class_curr_steal_atp, l_return_status);
5377: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5378: IF PG_DEBUG in ('Y', 'C') THEN
5379: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Demand_Class_Consumption');
5380: END IF;
5381: x_return_status := FND_API.G_RET_STS_ERROR;
5382: return;
5383: END IF;

Line 5385: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'After doing DC consumption with l_class_curr_steal_atp.');

5381: x_return_status := FND_API.G_RET_STS_ERROR;
5382: return;
5383: END IF;
5384: IF PG_DEBUG in ('Y', 'C') THEN
5385: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'After doing DC consumption with l_class_curr_steal_atp.');
5386: END IF;
5387: END IF;
5388:
5389: -- Customer_Id is not unique because it is -1 for 'Other' at each level.

Line 5396: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Before doing DC consumption with l_partner_curr_steal_atp.');

5392: (p_atp_period.Customer_Id(x_dc_start_index(j)) <> p_atp_period.Customer_Id(1)) THEN
5393: -- We need to do demand class consumption with l_partner_curr_steal_atp only
5394: -- if we are not in the first customer
5395: IF PG_DEBUG in ('Y', 'C') THEN
5396: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Before doing DC consumption with l_partner_curr_steal_atp.');
5397: END IF;
5398: Demand_Class_Consumption(p_atp_period, l_start_index,
5399: l_end_index, l_partner_curr_steal_atp, l_return_status);
5400: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

Line 5402: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Demand_Class_Consumption');

5398: Demand_Class_Consumption(p_atp_period, l_start_index,
5399: l_end_index, l_partner_curr_steal_atp, l_return_status);
5400: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5401: IF PG_DEBUG in ('Y', 'C') THEN
5402: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Demand_Class_Consumption');
5403: END IF;
5404: x_return_status := FND_API.G_RET_STS_ERROR;
5405: return;
5406: END IF;

Line 5408: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'After doing DC consumption with l_partner_curr_steal_atp.');

5404: x_return_status := FND_API.G_RET_STS_ERROR;
5405: return;
5406: END IF;
5407: IF PG_DEBUG in ('Y', 'C') THEN
5408: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'After doing DC consumption with l_partner_curr_steal_atp.');
5409: END IF;
5410: END IF;
5411:
5412: IF p_atp_period.Identifier2(x_dc_start_index(j)) <> p_atp_period.Identifier2(1) THEN

Line 5416: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Before doing DC consumption.');

5412: IF p_atp_period.Identifier2(x_dc_start_index(j)) <> p_atp_period.Identifier2(1) THEN
5413: -- We need to do demand class consumption only if we are not in
5414: -- the highest priority
5415: IF PG_DEBUG in ('Y', 'C') THEN
5416: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Before doing DC consumption.');
5417: END IF;
5418: Demand_Class_Consumption(p_atp_period, l_start_index,
5419: l_end_index, l_current_steal_atp, l_return_status);
5420: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

Line 5422: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Demand_Class_Consumption');

5418: Demand_Class_Consumption(p_atp_period, l_start_index,
5419: l_end_index, l_current_steal_atp, l_return_status);
5420: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5421: IF PG_DEBUG in ('Y', 'C') THEN
5422: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Demand_Class_Consumption');
5423: END IF;
5424: x_return_status := FND_API.G_RET_STS_ERROR;
5425: return;
5426: END IF;

Line 5428: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'After doing DC consumption.');

5424: x_return_status := FND_API.G_RET_STS_ERROR;
5425: return;
5426: END IF;
5427: IF PG_DEBUG in ('Y', 'C') THEN
5428: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'After doing DC consumption.');
5429: END IF;
5430: END IF;
5431:
5432: IF G_ATP_FW_CONSUME_METHOD = 1 THEN

Line 5439: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Add_to_Next_Steal');

5435: -- No need to do f/w consumption, but we need to add to next steal
5436: Add_to_Next_Steal(p_atp_period, l_start_index, l_end_index, l_next_steal_atp, l_return_status);
5437: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5438: IF PG_DEBUG in ('Y', 'C') THEN
5439: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Add_to_Next_Steal');
5440: END IF;
5441: x_return_status := FND_API.G_RET_STS_ERROR;
5442: return;
5443: END IF;

Line 5449: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Forward_Consume');

5445: -- Do f/w consumption for only one's own negatives
5446: Forward_Consume(p_atp_period, l_start_index, l_end_index, l_return_status);
5447: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5448: IF PG_DEBUG in ('Y', 'C') THEN
5449: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Forward_Consume');
5450: END IF;
5451: x_return_status := FND_API.G_RET_STS_ERROR;
5452: return;
5453: END IF;

Line 5460: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Add_to_Current_Atp');

5456: -- priority customer sites under the same customer
5457: Add_to_Current_Atp(p_atp_period, l_start_index, l_end_index, l_current_steal_atp, l_return_status);
5458: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5459: IF PG_DEBUG in ('Y', 'C') THEN
5460: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Add_to_Current_Atp');
5461: END IF;
5462: x_return_status := FND_API.G_RET_STS_ERROR;
5463: return;
5464: END IF;

Line 5471: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Forward_Consume');

5467:
5468: Forward_Consume(p_atp_period, l_start_index, l_end_index, l_return_status);
5469: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5470: IF PG_DEBUG in ('Y', 'C') THEN
5471: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Forward_Consume');
5472: END IF;
5473: x_return_status := FND_API.G_RET_STS_ERROR;
5474: return;
5475: END IF;

Line 5483: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Add_to_Current_Atp');

5479: -- priority customers under the same customer class
5480: Add_to_Current_Atp(p_atp_period, l_start_index, l_end_index, l_current_steal_atp, l_return_status);
5481: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5482: IF PG_DEBUG in ('Y', 'C') THEN
5483: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Add_to_Current_Atp');
5484: END IF;
5485: x_return_status := FND_API.G_RET_STS_ERROR;
5486: return;
5487: END IF;

Line 5492: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Add_to_Current_Atp');

5488:
5489: Add_to_Current_Atp(p_atp_period, l_start_index, l_end_index, l_partner_curr_steal_atp, l_return_status);
5490: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5491: IF PG_DEBUG in ('Y', 'C') THEN
5492: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Add_to_Current_Atp');
5493: END IF;
5494: x_return_status := FND_API.G_RET_STS_ERROR;
5495: return;
5496: END IF;

Line 5504: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Forward_Consume');

5500:
5501: Forward_Consume(p_atp_period, l_start_index, l_end_index, l_return_status);
5502: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5503: IF PG_DEBUG in ('Y', 'C') THEN
5504: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Forward_Consume');
5505: END IF;
5506: x_return_status := FND_API.G_RET_STS_ERROR;
5507: return;
5508: END IF;

Line 5517: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Add_to_Current_Atp');

5513: -- priority customer classes
5514: Add_to_Current_Atp(p_atp_period, l_start_index, l_end_index, l_current_steal_atp, l_return_status);
5515: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5516: IF PG_DEBUG in ('Y', 'C') THEN
5517: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Add_to_Current_Atp');
5518: END IF;
5519: x_return_status := FND_API.G_RET_STS_ERROR;
5520: return;
5521: END IF;

Line 5526: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Add_to_Current_Atp');

5522:
5523: Add_to_Current_Atp(p_atp_period, l_start_index, l_end_index, l_partner_curr_steal_atp, l_return_status);
5524: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5525: IF PG_DEBUG in ('Y', 'C') THEN
5526: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Add_to_Current_Atp');
5527: END IF;
5528: x_return_status := FND_API.G_RET_STS_ERROR;
5529: return;
5530: END IF;

Line 5535: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Add_to_Current_Atp');

5531:
5532: Add_to_Current_Atp(p_atp_period, l_start_index, l_end_index, l_class_curr_steal_atp, l_return_status);
5533: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5534: IF PG_DEBUG in ('Y', 'C') THEN
5535: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Add_to_Current_Atp');
5536: END IF;
5537: x_return_status := FND_API.G_RET_STS_ERROR;
5538: return;
5539: END IF;

Line 5548: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Forward_Consume');

5544:
5545: Forward_Consume(p_atp_period, l_start_index, l_end_index, l_return_status);
5546: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5547: IF PG_DEBUG in ('Y', 'C') THEN
5548: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Forward_Consume');
5549: END IF;
5550: x_return_status := FND_API.G_RET_STS_ERROR;
5551: return;
5552: END IF;

Line 5557: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Remove_Negatives');

5553: END IF;
5554: Remove_Negatives(p_atp_period, l_start_index, l_end_index, l_return_status);
5555: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5556: IF PG_DEBUG in ('Y', 'C') THEN
5557: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Remove_Negatives');
5558: END IF;
5559: x_return_status := FND_API.G_RET_STS_ERROR;
5560: return;
5561: END IF;

Line 5576: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Add_to_Next_Steal');

5572: Add_to_Next_Steal(p_atp_period, l_start_index,
5573: l_end_index, l_next_steal_atp, l_return_status);
5574: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5575: IF PG_DEBUG in ('Y', 'C') THEN
5576: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Add_to_Next_Steal');
5577: END IF;
5578: x_return_status := FND_API.G_RET_STS_ERROR;
5579: return;
5580: END IF;

Line 5585: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Remove_Negatives');

5581: ELSE
5582: Remove_Negatives(p_atp_period, l_start_index, l_end_index, l_return_status);
5583: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5584: IF PG_DEBUG in ('Y', 'C') THEN
5585: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Remove_Negatives');
5586: END IF;
5587: x_return_status := FND_API.G_RET_STS_ERROR;
5588: return;
5589: END IF;

Line 5595: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Compute_Cum_Individual');

5591:
5592: Compute_Cum_Individual(p_atp_period, l_start_index, l_end_index, l_return_status);
5593: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5594: IF PG_DEBUG in ('Y', 'C') THEN
5595: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Compute_Cum_Individual');
5596: END IF;
5597: x_return_status := FND_API.G_RET_STS_ERROR;
5598: return;
5599: END IF;

Line 5605: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Adjust_Cum');

5601: Adjust_Cum(p_atp_period, l_start_index, l_end_index,
5602: x_dc_start_index(x_dc_list_tab.COUNT), x_dc_end_index(x_dc_list_tab.COUNT), l_return_status);
5603: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5604: IF PG_DEBUG in ('Y', 'C') THEN
5605: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Adjust_Cum');
5606: END IF;
5607: x_return_status := FND_API.G_RET_STS_ERROR;
5608: return;
5609: END IF;

Line 5613: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'adjusted cum date:qty - '||

5609: END IF;
5610:
5611: IF PG_DEBUG in ('Y', 'C') THEN
5612: FOR mm in l_start_index..l_end_index LOOP
5613: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'adjusted cum date:qty - '||
5614: p_atp_period.Period_Start_Date(mm) ||' : '|| p_atp_period.Adjusted_Cum_Quantity(mm) );
5615: END LOOP;
5616: END IF;
5617: END IF;

Line 5621: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'adjusted date:qty - '||

5617: END IF;
5618:
5619: IF PG_DEBUG in ('Y', 'C') THEN
5620: FOR mm in l_start_index..l_end_index LOOP
5621: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'adjusted date:qty - '||
5622: p_atp_period.Period_Start_Date(mm) ||' : '|| p_atp_period.Adjusted_Availability_Quantity(mm) );
5623: END LOOP;
5624: END IF;
5625: END LOOP;

Line 5639: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Compute_Cum');

5635: -- Call procedure Compute_Cum to do accumulation
5636: Compute_Cum(p_atp_period, x_dc_list_tab, x_dc_start_index, x_dc_end_index, l_return_status);
5637: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
5638: IF PG_DEBUG in ('Y', 'C') THEN
5639: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occured in procedure Compute_Cum');
5640: END IF;
5641: x_return_status := FND_API.G_RET_STS_ERROR;
5642: return;
5643: END IF;

Line 5648: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || '**********End Adjust_Allocation_Details Procedure************');

5644:
5645: END IF;
5646:
5647: IF PG_DEBUG in ('Y', 'C') THEN
5648: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || '**********End Adjust_Allocation_Details Procedure************');
5649: END IF;
5650:
5651: EXCEPTION
5652: WHEN OTHERS THEN

Line 5654: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occurred: ' || to_char(sqlcode) || ':' || SQLERRM);

5650:
5651: EXCEPTION
5652: WHEN OTHERS THEN
5653: IF PG_DEBUG in ('Y', 'C') THEN
5654: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'Error occurred: ' || to_char(sqlcode) || ':' || SQLERRM);
5655: END IF;
5656: x_return_status := FND_API.G_RET_STS_ERROR;
5657: Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
5658: END Adjust_Allocation_Details;

Line 5681: msc_sch_wb.atp_debug('Demand_Class_Consumption: ' || '*********Begin procedure Demand_Class_Consumption ********');

5677: -- time_phased_atp
5678: l_atf_date DATE := MSC_ATP_ALLOC.G_ATF_Date;
5679: BEGIN
5680: IF PG_DEBUG in ('Y', 'C') THEN
5681: msc_sch_wb.atp_debug('Demand_Class_Consumption: ' || '*********Begin procedure Demand_Class_Consumption ********');
5682: m := p_start_index;
5683: WHILE (m is not null) AND (m <= p_end_index) LOOP
5684: msc_sch_wb.atp_debug('Demand_Class_Consumption: ' || 'current date:qty - '||
5685: p_atp_period.Period_Start_Date(m) ||' : '|| p_atp_period.Adjusted_Availability_Quantity(m) );

Line 5684: msc_sch_wb.atp_debug('Demand_Class_Consumption: ' || 'current date:qty - '||

5680: IF PG_DEBUG in ('Y', 'C') THEN
5681: msc_sch_wb.atp_debug('Demand_Class_Consumption: ' || '*********Begin procedure Demand_Class_Consumption ********');
5682: m := p_start_index;
5683: WHILE (m is not null) AND (m <= p_end_index) LOOP
5684: msc_sch_wb.atp_debug('Demand_Class_Consumption: ' || 'current date:qty - '||
5685: p_atp_period.Period_Start_Date(m) ||' : '|| p_atp_period.Adjusted_Availability_Quantity(m) );
5686: m := p_atp_period.Period_Start_Date.Next(m);
5687: END LOOP;
5688:

Line 5691: msc_sch_wb.atp_debug('Demand_Class_Consumption: ' || 'steal date:qty '||

5687: END LOOP;
5688:
5689: m := p_steal_atp.atp_period.FIRST;
5690: WHILE m is not null LOOP
5691: msc_sch_wb.atp_debug('Demand_Class_Consumption: ' || 'steal date:qty '||
5692: p_steal_atp.atp_period(m) ||' : '|| p_steal_atp.atp_qty(m));
5693: m := p_steal_atp.atp_period.Next(m);
5694: END LOOP;
5695: END IF;

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

5723: IF ((p_atp_period.Period_Start_Date(k) <= p_steal_atp.atp_period(i))
5724: AND (p_atp_period.Period_Start_Date(k+1) > p_steal_atp.atp_period(i))) THEN
5725: -- this is the starting point, we can exit now
5726: IF PG_DEBUG in ('Y', 'C') THEN
5727: msc_sch_wb.atp_debug('Demand_Class_Consumption: ' || 'exit at k = ' ||to_char(k)||' and i = ' ||to_char(i));
5728: END IF;
5729: EXIT;
5730: ELSE
5731: k := p_atp_period.Period_Start_Date.NEXT(k);

Line 5792: msc_sch_wb.atp_debug('Demand_Class_Consumption: ' || 'current date:qty - '||

5788:
5789: IF PG_DEBUG in ('Y', 'C') THEN
5790: m := p_start_index;
5791: WHILE (m is not null) AND (m <= p_end_index) LOOP
5792: msc_sch_wb.atp_debug('Demand_Class_Consumption: ' || 'current date:qty - '||
5793: p_atp_period.Period_Start_Date(m) ||' : '|| p_atp_period.Adjusted_Availability_Quantity(m) );
5794: m := p_atp_period.Period_Start_Date.Next(m);
5795: END LOOP;
5796:

Line 5799: msc_sch_wb.atp_debug('Demand_Class_Consumption: ' || 'steal date:qty '||

5795: END LOOP;
5796:
5797: m := p_steal_atp.atp_period.FIRST;
5798: WHILE m is not null LOOP
5799: msc_sch_wb.atp_debug('Demand_Class_Consumption: ' || 'steal date:qty '||
5800: p_steal_atp.atp_period(m) ||' : '|| p_steal_atp.atp_qty(m));
5801: m := p_steal_atp.atp_period.Next(m);
5802: END LOOP;
5803:

Line 5804: msc_sch_wb.atp_debug('Demand_Class_Consumption: ' || '*********End procedure Demand_Class_Consumption ********');

5800: p_steal_atp.atp_period(m) ||' : '|| p_steal_atp.atp_qty(m));
5801: m := p_steal_atp.atp_period.Next(m);
5802: END LOOP;
5803:
5804: msc_sch_wb.atp_debug('Demand_Class_Consumption: ' || '*********End procedure Demand_Class_Consumption ********');
5805: END IF;
5806:
5807: EXCEPTION
5808: WHEN OTHERS THEN

Line 5810: msc_sch_wb.atp_debug('Demand_Class_Consumption: ' || 'Error occurred: ' || to_char(sqlcode) || ':' || SQLERRM);

5806:
5807: EXCEPTION
5808: WHEN OTHERS THEN
5809: IF PG_DEBUG in ('Y', 'C') THEN
5810: msc_sch_wb.atp_debug('Demand_Class_Consumption: ' || 'Error occurred: ' || to_char(sqlcode) || ':' || SQLERRM);
5811: END IF;
5812: x_return_status := FND_API.G_RET_STS_ERROR;
5813: Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
5814: END Demand_Class_Consumption;

Line 5845: msc_sch_wb.atp_debug('Add_to_Next_Steal: ' || '*********Begin procedure Add_to_Next_Steal ********');

5841: -- Initializing API return code
5842: x_return_status := FND_API.G_RET_STS_SUCCESS;
5843:
5844: IF PG_DEBUG in ('Y', 'C') THEN
5845: msc_sch_wb.atp_debug('Add_to_Next_Steal: ' || '*********Begin procedure Add_to_Next_Steal ********');
5846:
5847: i := p_start_index;
5848: WHILE (i is not null) AND (i <= p_end_index) LOOP
5849: msc_sch_wb.atp_debug('Add_to_Next_Steal: ' || 'current date:qty - '||

Line 5849: msc_sch_wb.atp_debug('Add_to_Next_Steal: ' || 'current date:qty - '||

5845: msc_sch_wb.atp_debug('Add_to_Next_Steal: ' || '*********Begin procedure Add_to_Next_Steal ********');
5846:
5847: i := p_start_index;
5848: WHILE (i is not null) AND (i <= p_end_index) LOOP
5849: msc_sch_wb.atp_debug('Add_to_Next_Steal: ' || 'current date:qty - '||
5850: p_atp_period.Period_Start_Date(i) ||' : '|| p_atp_period.Adjusted_Availability_Quantity(i) );
5851: i := p_atp_period.Period_Start_Date.Next(i);
5852: END LOOP;
5853:

Line 5856: msc_sch_wb.atp_debug('Add_to_Next_Steal: ' || 'steal date:qty '||

5852: END LOOP;
5853:
5854: i := p_next_steal_atp.atp_period.FIRST;
5855: WHILE i is not null LOOP
5856: msc_sch_wb.atp_debug('Add_to_Next_Steal: ' || 'steal date:qty '||
5857: p_next_steal_atp.atp_period(i) ||' : '|| p_next_steal_atp.atp_qty(i));
5858: i := p_next_steal_atp.atp_period.Next(i);
5859: END LOOP;
5860: END IF;

Line 5949: msc_sch_wb.atp_debug('Add_to_Next_Steal: ' || 'current date:qty - '||

5945:
5946: IF PG_DEBUG in ('Y', 'C') THEN
5947: i := p_start_index;
5948: WHILE (i is not null) AND (i <= p_end_index) LOOP
5949: msc_sch_wb.atp_debug('Add_to_Next_Steal: ' || 'current date:qty - '||
5950: p_atp_period.Period_Start_Date(i) ||' : '|| p_atp_period.Adjusted_Availability_Quantity(i) );
5951: i := p_atp_period.Period_Start_Date.Next(i);
5952: END LOOP;
5953:

Line 5956: msc_sch_wb.atp_debug('Add_to_Next_Steal: ' || 'steal date:qty '||

5952: END LOOP;
5953:
5954: i := p_next_steal_atp.atp_period.FIRST;
5955: WHILE i is not null LOOP
5956: msc_sch_wb.atp_debug('Add_to_Next_Steal: ' || 'steal date:qty '||
5957: p_next_steal_atp.atp_period(i) ||' : '|| p_next_steal_atp.atp_qty(i));
5958: i := p_next_steal_atp.atp_period.Next(i);
5959: END LOOP;
5960:

Line 5961: msc_sch_wb.atp_debug('Add_to_Next_Steal: ' || '*********End procedure Add_to_Next_Steal ********');

5957: p_next_steal_atp.atp_period(i) ||' : '|| p_next_steal_atp.atp_qty(i));
5958: i := p_next_steal_atp.atp_period.Next(i);
5959: END LOOP;
5960:
5961: msc_sch_wb.atp_debug('Add_to_Next_Steal: ' || '*********End procedure Add_to_Next_Steal ********');
5962: END IF;
5963:
5964: EXCEPTION
5965: WHEN OTHERS THEN

Line 5967: msc_sch_wb.atp_debug('Add_to_Next_Steal: ' || 'Error occurred: ' || to_char(sqlcode) || ':' || SQLERRM);

5963:
5964: EXCEPTION
5965: WHEN OTHERS THEN
5966: IF PG_DEBUG in ('Y', 'C') THEN
5967: msc_sch_wb.atp_debug('Add_to_Next_Steal: ' || 'Error occurred: ' || to_char(sqlcode) || ':' || SQLERRM);
5968: END IF;
5969: x_return_status := FND_API.G_RET_STS_ERROR;
5970: Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
5971: END Add_to_Next_Steal;

Line 5990: msc_sch_wb.atp_debug('Add_to_Current_Atp: ' || '*********Begin procedure Add_to_Current_Atp ********');

5986: i PLS_INTEGER; -- index for p_atp_period
5987: j PLS_INTEGER; -- index for p_steal_atp
5988: BEGIN
5989: IF PG_DEBUG in ('Y', 'C') THEN
5990: msc_sch_wb.atp_debug('Add_to_Current_Atp: ' || '*********Begin procedure Add_to_Current_Atp ********');
5991: END IF;
5992:
5993: -- Initializing API return code
5994: x_return_status := FND_API.G_RET_STS_SUCCESS;

Line 6021: msc_sch_wb.atp_debug('Add_to_Current_Atp: ' || 'current date:qty - '||

6017:
6018: IF PG_DEBUG in ('Y', 'C') THEN
6019: i := p_start_index;
6020: WHILE (i is not null) AND (i <= p_end_index) LOOP
6021: msc_sch_wb.atp_debug('Add_to_Current_Atp: ' || 'current date:qty - '||
6022: p_atp_period.Period_Start_Date(i) ||' : '|| p_atp_period.Adjusted_Availability_Quantity(i) );
6023: i := p_atp_period.Period_Start_Date.Next(i);
6024: END LOOP;
6025:

Line 6028: msc_sch_wb.atp_debug('Add_to_Current_Atp: ' || 'steal date:qty '||

6024: END LOOP;
6025:
6026: i := p_steal_atp.atp_period.FIRST;
6027: WHILE i is not null LOOP
6028: msc_sch_wb.atp_debug('Add_to_Current_Atp: ' || 'steal date:qty '||
6029: p_steal_atp.atp_period(i) ||' : '|| p_steal_atp.atp_qty(i));
6030: i := p_steal_atp.atp_period.Next(i);
6031: END LOOP;
6032:

Line 6033: msc_sch_wb.atp_debug('Add_to_Current_Atp: ' || '*********End procedure Add_to_Current_Atp ********');

6029: p_steal_atp.atp_period(i) ||' : '|| p_steal_atp.atp_qty(i));
6030: i := p_steal_atp.atp_period.Next(i);
6031: END LOOP;
6032:
6033: msc_sch_wb.atp_debug('Add_to_Current_Atp: ' || '*********End procedure Add_to_Current_Atp ********');
6034: END IF;
6035:
6036: EXCEPTION
6037: WHEN OTHERS THEN

Line 6039: msc_sch_wb.atp_debug('Add_to_Current_Atp: ' || 'Error occurred: ' || to_char(sqlcode) || ':' || SQLERRM);

6035:
6036: EXCEPTION
6037: WHEN OTHERS THEN
6038: IF PG_DEBUG in ('Y', 'C') THEN
6039: msc_sch_wb.atp_debug('Add_to_Current_Atp: ' || 'Error occurred: ' || to_char(sqlcode) || ':' || SQLERRM);
6040: END IF;
6041: x_return_status := FND_API.G_RET_STS_ERROR;
6042: Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
6043: END Add_to_Current_Atp;

Line 6059: msc_sch_wb.atp_debug('Remove_Negatives: ' || '*********Begin procedure Remove_Negatives ********');

6055: IS
6056: i PLS_INTEGER; -- index for p_atp_period
6057: BEGIN
6058: IF PG_DEBUG in ('Y', 'C') THEN
6059: msc_sch_wb.atp_debug('Remove_Negatives: ' || '*********Begin procedure Remove_Negatives ********');
6060: END IF;
6061:
6062: -- Initializing API return code
6063: x_return_status := FND_API.G_RET_STS_SUCCESS;

Line 6074: msc_sch_wb.atp_debug('Remove_Negatives: ' || '*********End procedure Remove_Negatives ********');

6070: END IF;
6071: END LOOP;
6072:
6073: IF PG_DEBUG in ('Y', 'C') THEN
6074: msc_sch_wb.atp_debug('Remove_Negatives: ' || '*********End procedure Remove_Negatives ********');
6075: END IF;
6076:
6077: EXCEPTION
6078: WHEN OTHERS THEN

Line 6080: msc_sch_wb.atp_debug('Remove_Negatives: ' || 'Error occurred: ' || to_char(sqlcode) || ':' || SQLERRM);

6076:
6077: EXCEPTION
6078: WHEN OTHERS THEN
6079: IF PG_DEBUG in ('Y', 'C') THEN
6080: msc_sch_wb.atp_debug('Remove_Negatives: ' || 'Error occurred: ' || to_char(sqlcode) || ':' || SQLERRM);
6081: END IF;
6082: x_return_status := FND_API.G_RET_STS_ERROR;
6083: Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
6084: END Remove_Negatives;

Line 6107: msc_sch_wb.atp_debug('Adjust_Cum: ' || '**********Begin Adjust_Cum Procedure************');

6103: -- Initializing API return code
6104: x_return_status := FND_API.G_RET_STS_SUCCESS;
6105:
6106: IF PG_DEBUG in ('Y', 'C') THEN
6107: msc_sch_wb.atp_debug('Adjust_Cum: ' || '**********Begin Adjust_Cum Procedure************');
6108: END IF;
6109:
6110: --rajjain 02/11/2003 Bug 2793336 Begin
6111: i := p_unalloc_end_index;

Line 6124: msc_sch_wb.atp_debug ('Adjust_Cum: ' || 'Unallocated Cum date:qty - '||

6120: IF i <> p_unalloc_end_index
6121: AND p_atp_period.Adjusted_Cum_Quantity(i) > p_atp_period.Adjusted_Cum_Quantity(i+1)
6122: THEN
6123: IF PG_DEBUG in ('Y', 'C') THEN
6124: msc_sch_wb.atp_debug ('Adjust_Cum: ' || 'Unallocated Cum date:qty - '||
6125: p_atp_period.Period_Start_Date(i) ||' : '|| p_atp_period.Adjusted_Cum_Quantity(i) );
6126: END IF;
6127: p_atp_period.Adjusted_Cum_Quantity(i) := p_atp_period.Adjusted_Cum_Quantity(i+1);
6128: IF PG_DEBUG in ('Y', 'C') THEN

Line 6129: msc_sch_wb.atp_debug ('Adjust_Cum: ' || 'Updated Unallocated Cum date:qty - '||

6125: p_atp_period.Period_Start_Date(i) ||' : '|| p_atp_period.Adjusted_Cum_Quantity(i) );
6126: END IF;
6127: p_atp_period.Adjusted_Cum_Quantity(i) := p_atp_period.Adjusted_Cum_Quantity(i+1);
6128: IF PG_DEBUG in ('Y', 'C') THEN
6129: msc_sch_wb.atp_debug ('Adjust_Cum: ' || 'Updated Unallocated Cum date:qty - '||
6130: p_atp_period.Period_Start_Date(i) ||' : '|| p_atp_period.Adjusted_Cum_Quantity(i) );
6131: END IF;
6132: END IF;
6133: i := p_atp_period.Period_Start_Date.PRIOR(i);

Line 6141: msc_sch_wb.atp_debug('Adjust_Cum: ' || 'cur adjusted cum date:qty - '||

6137:
6138: IF PG_DEBUG in ('Y', 'C') THEN
6139: i := p_cur_start_index;
6140: WHILE (i is not null) AND (i <= p_cur_end_index) LOOP
6141: msc_sch_wb.atp_debug('Adjust_Cum: ' || 'cur adjusted cum date:qty - '||
6142: p_atp_period.Period_Start_Date(i) ||' : '|| p_atp_period.Adjusted_Cum_Quantity(i) );
6143: i := p_atp_period.Period_Start_Date.Next(i);
6144: END LOOP;
6145:

Line 6148: msc_sch_wb.atp_debug('Adjust_Cum: ' || 'unalloc cum date:qty - '||

6144: END LOOP;
6145:
6146: i := p_unalloc_start_index;
6147: WHILE (i is not null) AND (i <= p_unalloc_end_index) LOOP
6148: msc_sch_wb.atp_debug('Adjust_Cum: ' || 'unalloc cum date:qty - '||
6149: p_atp_period.Period_Start_Date(i) ||' : '|| p_atp_period.Adjusted_Cum_Quantity(i) );
6150: i := p_atp_period.Period_Start_Date.Next(i);
6151: END LOOP;
6152:

Line 6153: msc_sch_wb.atp_debug('Adjust_Cum: ' || '**********End Adjust_Cum Procedure************');

6149: p_atp_period.Period_Start_Date(i) ||' : '|| p_atp_period.Adjusted_Cum_Quantity(i) );
6150: i := p_atp_period.Period_Start_Date.Next(i);
6151: END LOOP;
6152:
6153: msc_sch_wb.atp_debug('Adjust_Cum: ' || '**********End Adjust_Cum Procedure************');
6154: END IF;
6155:
6156: EXCEPTION
6157: WHEN OTHERS THEN

Line 6159: msc_sch_wb.atp_debug('Adjust_Cum: ' || 'Error occurred: ' || to_char(sqlcode) || ':' || SQLERRM);

6155:
6156: EXCEPTION
6157: WHEN OTHERS THEN
6158: IF PG_DEBUG in ('Y', 'C') THEN
6159: msc_sch_wb.atp_debug('Adjust_Cum: ' || 'Error occurred: ' || to_char(sqlcode) || ':' || SQLERRM);
6160: END IF;
6161: x_return_status := FND_API.G_RET_STS_ERROR;
6162: Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
6163: END Adjust_Cum;

Line 6174: msc_sch_wb.atp_debug('Set_Error: ' || 'Old Error: ' || to_char(MSC_SCH_WB.G_ATP_ERROR_CODE));

6170: p_error_code IN INTEGER)
6171: IS
6172: BEGIN
6173: IF PG_DEBUG in ('Y', 'C') THEN
6174: msc_sch_wb.atp_debug('Set_Error: ' || 'Old Error: ' || to_char(MSC_SCH_WB.G_ATP_ERROR_CODE));
6175: msc_sch_wb.atp_debug('Set_Error: ' || 'New Error: ' || to_char(p_error_code));
6176: END IF;
6177: -- Setting API return code
6178: IF MSC_SCH_WB.G_ATP_ERROR_CODE = 0 THEN

Line 6175: msc_sch_wb.atp_debug('Set_Error: ' || 'New Error: ' || to_char(p_error_code));

6171: IS
6172: BEGIN
6173: IF PG_DEBUG in ('Y', 'C') THEN
6174: msc_sch_wb.atp_debug('Set_Error: ' || 'Old Error: ' || to_char(MSC_SCH_WB.G_ATP_ERROR_CODE));
6175: msc_sch_wb.atp_debug('Set_Error: ' || 'New Error: ' || to_char(p_error_code));
6176: END IF;
6177: -- Setting API return code
6178: IF MSC_SCH_WB.G_ATP_ERROR_CODE = 0 THEN
6179: MSC_SCH_WB.G_ATP_ERROR_CODE := p_error_code;

Line 6178: IF MSC_SCH_WB.G_ATP_ERROR_CODE = 0 THEN

6174: msc_sch_wb.atp_debug('Set_Error: ' || 'Old Error: ' || to_char(MSC_SCH_WB.G_ATP_ERROR_CODE));
6175: msc_sch_wb.atp_debug('Set_Error: ' || 'New Error: ' || to_char(p_error_code));
6176: END IF;
6177: -- Setting API return code
6178: IF MSC_SCH_WB.G_ATP_ERROR_CODE = 0 THEN
6179: MSC_SCH_WB.G_ATP_ERROR_CODE := p_error_code;
6180: END IF;
6181:
6182: END Set_Error;

Line 6179: MSC_SCH_WB.G_ATP_ERROR_CODE := p_error_code;

6175: msc_sch_wb.atp_debug('Set_Error: ' || 'New Error: ' || to_char(p_error_code));
6176: END IF;
6177: -- Setting API return code
6178: IF MSC_SCH_WB.G_ATP_ERROR_CODE = 0 THEN
6179: MSC_SCH_WB.G_ATP_ERROR_CODE := p_error_code;
6180: END IF;
6181:
6182: END Set_Error;
6183: