DBA Data[Home] [Help]

APPS.MSC_ATP_ALLOC dependencies on FND_API

Line 141: l_return_status VARCHAR2(10) := FND_API.G_RET_STS_SUCCESS;

137: l_plan_info_rec MSC_ATP_PVT.plan_info_rec;
138: l_infinite_time_fence_date DATE;
139: l_atp_period MRP_ATP_PUB.ATP_Period_Typ;
140: l_counter PLS_INTEGER;
141: l_return_status VARCHAR2(10) := FND_API.G_RET_STS_SUCCESS;
142:
143: -- For new allocation logic for time phased ATP
144: l_dest_inv_item_id NUMBER;
145: l_dest_family_item_id NUMBER;

Line 161: x_return_status := FND_API.G_RET_STS_SUCCESS;

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.
165: SELECT MSC_CALENDAR.NEXT_WORK_DAY(p_organization_id, p_instance_id, 1, TRUNC(sysdate))

Line 173: x_return_status := FND_API.G_RET_STS_ERROR;

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;
176: END IF;
177: IF PG_DEBUG in ('Y', 'C') THEN

Line 189: x_return_status := FND_API.G_RET_STS_ERROR;

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;
191: END IF;
192:
193: IF (MSC_ATP_PVT.G_ALLOCATED_ATP <> 'Y') THEN

Line 198: x_return_status := FND_API.G_RET_STS_ERROR;

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;
200: END IF;
201:
202: -- Trap preliminary plan related errors

Line 209: x_return_status := FND_API.G_RET_STS_ERROR;

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;
212: ELSIF (l_plan_info_rec.plan_id = -100) THEN
213: IF PG_DEBUG in ('Y', 'C') THEN

Line 216: x_return_status := FND_API.G_RET_STS_ERROR;

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;
219: ELSIF (l_plan_info_rec.plan_id = -200) THEN
220: IF PG_DEBUG in ('Y', 'C') THEN

Line 223: x_return_status := FND_API.G_RET_STS_ERROR;

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;
226: ELSIF (l_plan_info_rec.plan_id = -300) THEN
227: IF PG_DEBUG in ('Y', 'C') THEN

Line 230: x_return_status := FND_API.G_RET_STS_ERROR;

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;
233: END IF;
234:

Line 252: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

248: p_organization_id, l_plan_info_rec.plan_id, l_request_date, l_infinite_time_fence_date, l_atp_period,
249: l_dest_inv_item_id, l_dest_family_item_id, -- For new allocation logic for time phased ATP
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;

Line 256: x_return_status := FND_API.G_RET_STS_ERROR;

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;
259: END IF;
260:

Line 269: x_return_status := FND_API.G_RET_STS_ERROR;

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);
269: x_return_status := FND_API.G_RET_STS_ERROR;
270: Commit;
271: return;
272: END IF;
273:

Line 297: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

293: l_dest_inv_item_id, l_dest_family_item_id, -- For new allocation logic for time phased ATP
294: l_return_status);
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;

Line 301: x_return_status := FND_API.G_RET_STS_ERROR;

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:
304: IF PG_DEBUG in ('Y', 'C') THEN
305: msc_sch_wb.atp_debug('View_Allocation_Details: ' || '*********End of procedure View_Allocation_Details ********');

Line 311: WHEN FND_API.G_EXC_ERROR THEN

307:
308: Commit;
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;

Line 315: x_return_status := FND_API.G_RET_STS_ERROR;

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:
318: WHEN MSC_ATP_PUB.ATP_INVALID_OBJECTS_FOUND THEN
319: IF PG_DEBUG in ('Y', 'C') THEN

Line 322: x_return_status := FND_API.G_RET_STS_ERROR;

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:
325: WHEN OTHERS THEN
326: IF PG_DEBUG in ('Y', 'C') THEN

Line 329: x_return_status := FND_API.G_RET_STS_ERROR;

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:
332: END View_allocation_Details;
333:

Line 411: x_return_status := FND_API.G_RET_STS_SUCCESS;

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;
412: l_scenario_id := 0;
413: l_record_type := 2;
414: /* To support new logic for dependent demands allocation in time phased PF rule based AATP scenarios
415: Reset global variable*/

Line 447: x_return_status := FND_API.G_RET_STS_ERROR;

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;
449: END;
450:
451: -- time_phased_atp

Line 464: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

460: --bug3700564
461: l_family_name,
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;

Line 468: RAISE FND_API.G_EXC_ERROR;

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:
471: IF (l_inv_item_id <> l_pf_dest_id) and (l_atf_date is not null) THEN
472: l_time_phased_atp := 'Y';

Line 493: x_return_status := FND_API.G_RET_STS_ERROR;

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;
495: END IF;
496:
497: IF PG_DEBUG in ('Y', 'C') THEN

Line 516: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

512: '-1',
513: l_atf_date,
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;

Line 520: RAISE FND_API.G_EXC_ERROR;

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:
523: IF p_request_date <= l_atf_date THEN
524: IF MSC_ATP_PVT.G_MEM_RULE_WITHIN_ATF = 'Y' THEN

Line 576: x_return_status := FND_API.G_RET_STS_ERROR;

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;
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');

Line 621: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

617: l_uom_code,
618: l_insert_count,
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;

Line 625: RAISE FND_API.G_EXC_ERROR;

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
628: ELSE
629: INSERT INTO MRP_ATP_DETAILS_TEMP

Line 742: --x_return_status := FND_API.G_RET_STS_ERROR;

738:
739: -- bug 2763784 (ssurendr)
740: -- Should not error out if no s/d record found
741: --Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
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.');

Line 770: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

766: p_session_id,
767: x_atp_period,
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;

Line 774: RAISE FND_API.G_EXC_ERROR;

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
777: ELSE
778: SELECT

Line 847: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

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);
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;

Line 851: x_return_status := FND_API.G_RET_STS_ERROR;

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;
854:
855: IF PG_DEBUG in ('Y', 'C') THEN

Line 864: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

860: x_atp_period.Cumulative_Quantity := x_atp_period.Backward_Forward_Quantity;
861:
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;

Line 868: x_return_status := FND_API.G_RET_STS_ERROR;

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;
871: END IF;
872:

Line 966: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

962: NULL,
963: l_return_status
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;

Line 970: x_return_status := FND_API.G_RET_STS_ERROR;

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;
973: IF PG_DEBUG in ('Y', 'C') THEN
974: msc_sch_wb.atp_debug('Compute_Allocation_Details: ' || 'After populating original demand qty in MADT');

Line 1008: x_return_status := FND_API.G_RET_STS_ERROR;

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;
1010: END IF;
1011:
1012:

Line 1071: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

1067: l_uom_code,
1068: l_insert_count,
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;

Line 1075: RAISE FND_API.G_EXC_ERROR;

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
1078: ELSE
1079:

Line 1750: --x_return_status := FND_API.G_RET_STS_ERROR;

1746:
1747: -- bug 2763784 (ssurendr)
1748: -- Should not error out if no s/d record found
1749: --Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
1750: --x_return_status := FND_API.G_RET_STS_ERROR;
1751: --return;
1752: SELECT demand_class
1753: BULK COLLECT INTO l_dc_list_tab
1754: FROM MSC_ALLOC_TEMP;

Line 1795: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

1791: p_session_id,
1792: x_atp_period,
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;

Line 1799: RAISE FND_API.G_EXC_ERROR;

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
1802: ELSE
1803: SELECT

Line 1873: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

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);
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;

Line 1877: x_return_status := FND_API.G_RET_STS_ERROR;

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;
1880: END IF;
1881:

Line 2014: x_return_status := FND_API.G_RET_STS_ERROR;

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;
2016: END IF;
2017:
2018:

Line 2056: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

2052: l_uom_code,
2053: l_insert_count,
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;

Line 2060: RAISE FND_API.G_EXC_ERROR;

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
2063: IF (MSC_ATP_PVT.G_OPTIMIZED_PLAN = 1) THEN
2064: -- Bug 3823042: optimized plan, donot use msc_calendar_dates

Line 2741: --x_return_status := FND_API.G_RET_STS_ERROR;

2737:
2738: -- bug 2763784 (ssurendr)
2739: -- Should not error out if no s/d record found
2740: --Set_Error(MSC_ATP_PVT.ATP_PROCESSING_ERROR);
2741: --x_return_status := FND_API.G_RET_STS_ERROR;
2742: --return;
2743: SELECT LEVEL_3_DEMAND_CLASS, LEVEL_1_DEMAND_CLASS, PARTNER_ID, PARTNER_SITE_ID
2744: BULK COLLECT INTO l_dc_list_tab, l_class_tab, l_customer_id_tab, l_customer_site_id_tab
2745: FROM MSC_ALLOC_HIERARCHY_TEMP;

Line 2789: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

2785: p_session_id,
2786: x_atp_period,
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;

Line 2793: RAISE FND_API.G_EXC_ERROR;

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
2796: ELSE
2797: SELECT

Line 2880: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

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);
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;

Line 2884: x_return_status := FND_API.G_RET_STS_ERROR;

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;
2887: END IF;
2888:

Line 2971: x_return_status := FND_API.G_RET_STS_ERROR;

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;
2974:
2975: END IF;

Line 2987: x_return_status := FND_API.G_RET_STS_ERROR;

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:
2990: WHEN OTHERS THEN
2991: IF PG_DEBUG in ('Y', 'C') THEN

Line 2994: x_return_status := FND_API.G_RET_STS_ERROR;

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:
2997: END Compute_allocation_Details;
2998:

Line 3031: x_return_status := FND_API.G_RET_STS_SUCCESS;

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;
3032: l_record_type := 1;
3033: l_scenario_id := 0;
3034:
3035: IF ((MSC_ATP_PVT.G_HIERARCHY_PROFILE = 1) AND (MSC_ATP_PVT.G_ALLOCATION_METHOD = 1)) THEN

Line 4017: x_return_status := FND_API.G_RET_STS_ERROR;

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;
4019: END IF;
4020:
4021: IF PG_DEBUG in ('Y', 'C') THEN

Line 4143: x_return_status := FND_API.G_RET_STS_ERROR;

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;
4145: END IF;
4146:
4147: IF PG_DEBUG in ('Y', 'C') THEN

Line 4266: x_return_status := FND_API.G_RET_STS_ERROR;

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;
4268: END IF;
4269:
4270: IF PG_DEBUG in ('Y', 'C') THEN

Line 4332: x_return_status := FND_API.G_RET_STS_ERROR;

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:
4335: END Insert_allocation_Details;
4336:

Line 4381: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN

4377: p_instance_id,
4378: p_organization_id,
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:

Line 4441: x_return_status := FND_API.G_RET_STS_SUCCESS;

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;
4442:
4443: x_dc_list_tab := MRP_ATP_PUB.Char80_Arr();
4444: x_dc_start_index := MRP_ATP_PUB.Number_Arr();
4445: x_dc_end_index := MRP_ATP_PUB.Number_Arr();

Line 4524: x_return_status := FND_API.G_RET_STS_ERROR;

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:
4527: END Backward_Consume;
4528:

Line 4550: x_return_status := FND_API.G_RET_STS_SUCCESS;

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;
4551:
4552: -- this procedure will add p_steal_atp's negatives in p_atp_period.
4553: -- It is assumed here that the dates in p_steal_atp is always a subset of dates in p_atp_period
4554:

Line 4632: x_return_status := FND_API.G_RET_STS_ERROR;

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:
4635: END Forward_Consume;
4636:

Line 4661: x_return_status := FND_API.G_RET_STS_SUCCESS;

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;
4662:
4663: x_dc_list_tab := MRP_ATP_PUB.Char80_Arr();
4664: x_dc_start_index := MRP_ATP_PUB.Number_Arr();
4665: x_dc_end_index := MRP_ATP_PUB.Number_Arr();

Line 4814: x_return_status := FND_API.G_RET_STS_ERROR;

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:
4817: END Backward_Forward_Consume;
4818:

Line 4840: x_return_status := FND_API.G_RET_STS_SUCCESS;

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;
4841:
4842: -- this for loop will do the acculumation
4843: FOR j in 1..p_dc_list_tab.COUNT LOOP
4844:

Line 4860: x_return_status := FND_API.G_RET_STS_ERROR;

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;
4863:
4864:

Line 4885: x_return_status := FND_API.G_RET_STS_SUCCESS;

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;
4886:
4887: -- this for loop will do the acculumation for one demand class
4888: -- this will also convert negatives to zero
4889:

Line 4910: x_return_status := FND_API.G_RET_STS_ERROR;

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;
4913:
4914:

Line 4954: x_return_status := FND_API.G_RET_STS_SUCCESS;

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;
4955:
4956: -- IF G_ATP_FW_CONSUME_METHOD = 2 THEN
4957: -- if condition removed for bug 2763784 (ssurendr)
4958: -- always get unallocated figures

Line 4985: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

4981: END LOOP;
4982: -- END IF;
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;

Line 4989: x_return_status := FND_API.G_RET_STS_ERROR;

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;
4992:
4993: IF PG_DEBUG in ('Y', 'C') THEN

Line 5011: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

5007: -- Do f/w consumption and accumulation for unallocated records
5008: l_start_index := x_dc_start_index(x_dc_list_tab.COUNT);
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;

Line 5015: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5018:
5019: /* rajjain 02/12/2003

Line 5024: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

5020: * Call to Compute_Cum_Individual procedure is not required in Method1
5021: * as Unallocated Cum will be calculated as part of Compute_Cum procedure*/
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;

Line 5028: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5031: END IF;
5032: p_atp_period.Adjusted_Cum_Quantity := p_atp_period.Cumulative_Quantity;

Line 5096: IF l_return_status <> FND_API.G_RET_STS_SUCCESS 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
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;

Line 5100: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5103: IF PG_DEBUG in ('Y', 'C') THEN
5104: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'After doing DC consumption.');

Line 5123: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

5119: -- "not equal to lowest priority". What this means is that DCs lower than
5120: -- l_lowest_priority will do f/w consumtion for at least itself.
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;

Line 5127: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5130: ELSIF G_ATP_FW_CONSUME_METHOD = 1 THEN
5131: -- Forward consumption is required only if G_ATP_FW_CONSUME_METHOD = 1

Line 5137: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

5133: -- Last demand class. Need to consider l_next_steal_atp's
5134: -- negatives before forward consumption
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;

Line 5141: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5144: END IF;
5145:

Line 5147: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

5143: END IF;
5144: END IF;
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;

Line 5151: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5154:
5155: Remove_Negatives(p_atp_period, l_start_index, l_end_index, l_return_status);

Line 5156: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

5152: return;
5153: END IF;
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;

Line 5160: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5163: END IF;
5164:

Line 5174: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

5170: END IF;
5171:
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;

Line 5178: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5181:
5182: Adjust_Cum(p_atp_period, l_start_index, l_end_index,

Line 5184: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

5180: END IF;
5181:
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;

Line 5188: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5191:
5192: IF PG_DEBUG in ('Y', 'C') THEN

Line 5377: IF l_return_status <> FND_API.G_RET_STS_SUCCESS 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
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;

Line 5381: x_return_status := FND_API.G_RET_STS_ERROR;

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;
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.');

Line 5400: IF l_return_status <> FND_API.G_RET_STS_SUCCESS 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
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;

Line 5404: x_return_status := FND_API.G_RET_STS_ERROR;

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;
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.');

Line 5420: IF l_return_status <> FND_API.G_RET_STS_SUCCESS 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
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;

Line 5424: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5427: IF PG_DEBUG in ('Y', 'C') THEN
5428: msc_sch_wb.atp_debug('Adjust_Allocation_Details: ' || 'After doing DC consumption.');

Line 5437: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

5433: -- steal from lower priority
5434: IF l_fw_consume_tab(j) = 0 THEN
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;

Line 5441: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5444: ELSIF l_fw_consume_tab(j) = 1 THEN
5445: -- Do f/w consumption for only one's own negatives

Line 5447: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

5443: END IF;
5444: ELSIF l_fw_consume_tab(j) = 1 THEN
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;

Line 5451: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5454: ELSIF l_fw_consume_tab(j) = 2 THEN
5455: -- Do f/w consumption for only one's own negatives + negatives from higher

Line 5458: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

5454: ELSIF l_fw_consume_tab(j) = 2 THEN
5455: -- Do f/w consumption for only one's own negatives + negatives from higher
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;

Line 5462: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5465:
5466: l_current_steal_atp := l_null_steal_atp;

Line 5469: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

5465:
5466: l_current_steal_atp := l_null_steal_atp;
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;

Line 5473: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5476: ELSIF l_fw_consume_tab(j) = 3 THEN
5477: -- Do f/w consumption for only one's own negatives + negatives from higher

Line 5481: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

5477: -- Do f/w consumption for only one's own negatives + negatives from higher
5478: -- priority customer sites under the same customer + negatives from higher
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;

Line 5485: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5488:
5489: Add_to_Current_Atp(p_atp_period, l_start_index, l_end_index, l_partner_curr_steal_atp, l_return_status);

Line 5490: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

5486: return;
5487: END IF;
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;

Line 5494: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5497:
5498: l_current_steal_atp := l_null_steal_atp;

Line 5502: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

5498: l_current_steal_atp := l_null_steal_atp;
5499: l_partner_curr_steal_atp := l_null_steal_atp;
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;

Line 5506: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5509: ELSE
5510: -- Do f/w consumption for only one's own negatives + negatives from higher

Line 5515: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

5511: -- priority customer sites under the same customer + negatives from higher
5512: -- priority customers under the same customer class + negatives from higher
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;

Line 5519: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5522:
5523: Add_to_Current_Atp(p_atp_period, l_start_index, l_end_index, l_partner_curr_steal_atp, l_return_status);

Line 5524: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

5520: return;
5521: END IF;
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;

Line 5528: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5531:
5532: Add_to_Current_Atp(p_atp_period, l_start_index, l_end_index, l_class_curr_steal_atp, l_return_status);

Line 5533: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

5529: return;
5530: END IF;
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;

Line 5537: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5540:
5541: l_current_steal_atp := l_null_steal_atp;

Line 5546: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

5542: l_partner_curr_steal_atp := l_null_steal_atp;
5543: l_class_curr_steal_atp := l_null_steal_atp;
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;

Line 5550: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5553: END IF;
5554: Remove_Negatives(p_atp_period, l_start_index, l_end_index, l_return_status);

Line 5555: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

5551: return;
5552: END IF;
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;

Line 5559: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5562: ELSE -- IF G_ATP_FW_CONSUME_METHOD = 1 THEN
5563: -- steal from any priority

Line 5574: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

5570: -- This is not the lowest priority DC.
5571: -- Need to 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;

Line 5578: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5581: ELSE
5582: Remove_Negatives(p_atp_period, l_start_index, l_end_index, l_return_status);

Line 5583: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

5579: return;
5580: END IF;
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;

Line 5587: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5590: END IF;
5591:

Line 5593: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

5589: END IF;
5590: END IF;
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;

Line 5597: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5600:
5601: Adjust_Cum(p_atp_period, l_start_index, l_end_index,

Line 5603: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

5599: END IF;
5600:
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;

Line 5607: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5610:
5611: IF PG_DEBUG in ('Y', 'C') THEN

Line 5637: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN

5633: p_atp_period.Cumulative_Quantity := p_atp_period.Adjusted_Availability_Quantity;
5634:
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;

Line 5641: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5644:
5645: END IF;

Line 5656: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5659:
5660:

Line 5698: x_return_status := FND_API.G_RET_STS_SUCCESS;

5694: END LOOP;
5695: END IF;
5696:
5697: -- Initializing API return code
5698: x_return_status := FND_API.G_RET_STS_SUCCESS;
5699:
5700: k := p_start_index;
5701:
5702: -- i is the index for steal_atp

Line 5812: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5815:
5816:

Line 5842: x_return_status := FND_API.G_RET_STS_SUCCESS;

5838: -- The only difference between this version of the procedure and the one in MSCAATPB is that
5839: -- this accepts start/end indices to restrict the operation
5840:
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:

Line 5969: x_return_status := FND_API.G_RET_STS_ERROR;

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;
5972:
5973:

Line 5994: x_return_status := FND_API.G_RET_STS_SUCCESS;

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;
5995:
5996: -- this procedure will add p_steal_atp's negatives in p_atp_period.
5997: -- It is assumed here that the dates in p_steal_atp is always a subset of dates in p_atp_period
5998:

Line 6041: x_return_status := FND_API.G_RET_STS_ERROR;

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;
6044:
6045:

Line 6063: x_return_status := FND_API.G_RET_STS_SUCCESS;

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;
6064:
6065: -- this procedure will remove negatives
6066:
6067: FOR i IN p_start_index..p_end_index LOOP

Line 6082: x_return_status := FND_API.G_RET_STS_ERROR;

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;
6085:
6086:

Line 6104: x_return_status := FND_API.G_RET_STS_SUCCESS;

6100: j PLS_INTEGER;
6101: BEGIN
6102:
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;

Line 6161: x_return_status := FND_API.G_RET_STS_ERROR;

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;
6164:
6165: