21: /*=========================================================================== */
22:
23: PROCEDURE Process_MatCost(
24: p_api_version IN NUMBER,
25: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
26: p_commit IN VARCHAR2 := FND_API.G_FALSE,
27: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
28: x_return_status OUT NOCOPY VARCHAR2,
29: x_msg_count OUT NOCOPY NUMBER,
22:
23: PROCEDURE Process_MatCost(
24: p_api_version IN NUMBER,
25: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
26: p_commit IN VARCHAR2 := FND_API.G_FALSE,
27: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
28: x_return_status OUT NOCOPY VARCHAR2,
29: x_msg_count OUT NOCOPY NUMBER,
30: x_msg_data OUT NOCOPY VARCHAR2,
23: PROCEDURE Process_MatCost(
24: p_api_version IN NUMBER,
25: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
26: p_commit IN VARCHAR2 := FND_API.G_FALSE,
27: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
28: x_return_status OUT NOCOPY VARCHAR2,
29: x_msg_count OUT NOCOPY NUMBER,
30: x_msg_data OUT NOCOPY VARCHAR2,
31: p_txn_id IN NUMBER,
37: ) IS
38: l_api_name CONSTANT VARCHAR2(30) := 'Process_MatCost';
39: l_api_version CONSTANT NUMBER := 1.0;
40:
41: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
42: l_msg_count NUMBER := 0;
43: l_msg_data VARCHAR2(8000);
44: l_stmt_num NUMBER := 0;
45: l_api_message VARCHAR2(1000);
61: l_debug := fnd_profile.value('MRP_DEBUG');
62:
63:
64: -- Standard call to check for call compatibility
65: IF NOT FND_API.Compatible_API_Call (
66: l_api_version,
67: p_api_version,
68: l_api_name,
69: G_PKG_NAME ) THEN
66: l_api_version,
67: p_api_version,
68: l_api_name,
69: G_PKG_NAME ) THEN
70: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
71: END IF;
72:
73: -- Initialize message list if p_init_msg_list is set to TRUE
74: IF FND_API.to_Boolean(p_init_msg_list) THEN
70: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
71: END IF;
72:
73: -- Initialize message list if p_init_msg_list is set to TRUE
74: IF FND_API.to_Boolean(p_init_msg_list) THEN
75: FND_MSG_PUB.initialize;
76: END IF;
77:
78: -- Initialize API return status to success
75: FND_MSG_PUB.initialize;
76: END IF;
77:
78: -- Initialize API return status to success
79: x_return_status := FND_API.G_RET_STS_SUCCESS;
80:
81: -- Get MMT info
82: l_stmt_num := 10;
83: SELECT transaction_source_id,
130: p_prog_app_id => p_prog_app_id,
131: p_login_id => p_login_id,
132: p_txn_date => l_txn_date);
133:
134: IF l_return_status <> FND_API.g_ret_sts_success THEN
135: FND_FILE.put_line(FND_FILE.log, x_msg_data);
136: l_api_message := 'Update_eamCost returned error';
137: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
138: FND_MESSAGE.set_token('TEXT', l_api_message);
136: l_api_message := 'Update_eamCost returned error';
137: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
138: FND_MESSAGE.set_token('TEXT', l_api_message);
139: FND_MSG_pub.add;
140: RAISE FND_API.g_exc_error;
141: END IF;
142:
143: --- Standard check of p_commit
144: IF FND_API.to_Boolean(p_commit) THEN
140: RAISE FND_API.g_exc_error;
141: END IF;
142:
143: --- Standard check of p_commit
144: IF FND_API.to_Boolean(p_commit) THEN
145: COMMIT WORK;
146: END IF;
147:
148: -- Standard Call to get message count and if count = 1, get message info
151: p_data => x_msg_data );
152:
153:
154: EXCEPTION
155: WHEN FND_API.g_exc_error THEN
156: ROLLBACK TO Process_MatCost_PUB;
157: x_return_status := FND_API.g_ret_sts_error;
158:
159: -- Get message count and data
153:
154: EXCEPTION
155: WHEN FND_API.g_exc_error THEN
156: ROLLBACK TO Process_MatCost_PUB;
157: x_return_status := FND_API.g_ret_sts_error;
158:
159: -- Get message count and data
160: FND_MSG_PUB.count_and_get
161: ( p_count => x_msg_count
161: ( p_count => x_msg_count
162: , p_data => x_msg_data
163: );
164:
165: WHEN FND_API.g_exc_unexpected_error THEN
166: ROLLBACK TO Process_MatCost_PUB;
167: x_return_status := FND_API.g_ret_sts_unexp_error ;
168:
169: -- Get message count and data
163: );
164:
165: WHEN FND_API.g_exc_unexpected_error THEN
166: ROLLBACK TO Process_MatCost_PUB;
167: x_return_status := FND_API.g_ret_sts_unexp_error ;
168:
169: -- Get message count and data
170: FND_MSG_PUB.count_and_get
171: ( p_count => x_msg_count
173: );
174:
175: WHEN OTHERS THEN
176: ROLLBACK TO Process_MatCost_PUB;
177: x_return_status := fnd_api.g_ret_sts_unexp_error ;
178:
179: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
180: THEN
181: FND_MSG_PUB.add_exc_msg
209: /*=========================================================================== */
210:
211: PROCEDURE Process_ResCost(
212: p_api_version IN NUMBER,
213: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
214: p_commit IN VARCHAR2 := FND_API.G_FALSE,
215: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
216: x_return_status OUT NOCOPY VARCHAR2,
217: x_msg_count OUT NOCOPY NUMBER,
210:
211: PROCEDURE Process_ResCost(
212: p_api_version IN NUMBER,
213: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
214: p_commit IN VARCHAR2 := FND_API.G_FALSE,
215: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
216: x_return_status OUT NOCOPY VARCHAR2,
217: x_msg_count OUT NOCOPY NUMBER,
218: x_msg_data OUT NOCOPY VARCHAR2,
211: PROCEDURE Process_ResCost(
212: p_api_version IN NUMBER,
213: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
214: p_commit IN VARCHAR2 := FND_API.G_FALSE,
215: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
216: x_return_status OUT NOCOPY VARCHAR2,
217: x_msg_count OUT NOCOPY NUMBER,
218: x_msg_data OUT NOCOPY VARCHAR2,
219: p_group_id IN NUMBER,
225: ) IS
226: l_api_name CONSTANT VARCHAR2(30) := 'Process_ResCost';
227: l_api_version CONSTANT NUMBER := 1.0;
228:
229: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
230: l_msg_count NUMBER := 0;
231: l_msg_data VARCHAR2(8000);
232: l_stmt_num NUMBER := 0;
233: l_api_message VARCHAR2(1000);
278: end if;
279:
280:
281: -- Standard call to check for call compatibility
282: IF NOT FND_API.Compatible_API_Call (
283: l_api_version,
284: p_api_version,
285: l_api_name,
286: G_PKG_NAME ) THEN
283: l_api_version,
284: p_api_version,
285: l_api_name,
286: G_PKG_NAME ) THEN
287: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
288: END IF;
289:
290: -- Initialize message list if p_init_msg_list is set to TRUE
291: IF FND_API.to_Boolean(p_init_msg_list) THEN
287: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
288: END IF;
289:
290: -- Initialize message list if p_init_msg_list is set to TRUE
291: IF FND_API.to_Boolean(p_init_msg_list) THEN
292: FND_MSG_PUB.initialize;
293: END IF;
294:
295: -- Initialize API return status to success
292: FND_MSG_PUB.initialize;
293: END IF;
294:
295: -- Initialize API return status to success
296: x_return_status := FND_API.G_RET_STS_SUCCESS;
297:
298: -- Loop thru cursor to process the fetched resource transactions
299: FOR l_resourcetxn_rec IN l_resourcetxn_csr LOOP
300: l_stmt_num := 40;
345: p_prog_app_id => p_prog_app_id,
346: p_login_id => p_login_id,
347: p_txn_date => l_resourcetxn_rec.txn_date);
348:
349: IF l_return_status <> FND_API.g_ret_sts_success THEN
350: FND_FILE.put_line(FND_FILE.log, x_msg_data);
351: l_api_message := 'Update_eamCost returned error';
352: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
353: FND_MESSAGE.set_token('TEXT', l_api_message);
351: l_api_message := 'Update_eamCost returned error';
352: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
353: FND_MESSAGE.set_token('TEXT', l_api_message);
354: FND_MSG_pub.add;
355: RAISE FND_API.g_exc_error;
356: END IF;
357:
358: END LOOP;
359:
357:
358: END LOOP;
359:
360: --- Standard check of p_commit
361: IF FND_API.to_Boolean(p_commit) THEN
362: COMMIT WORK;
363: END IF;
364:
365: -- Standard Call to get message count and if count = 1, get message info
368: p_data => x_msg_data );
369:
370:
371: EXCEPTION
372: WHEN FND_API.g_exc_error THEN
373: ROLLBACK TO Process_ResCost_PUB;
374: x_return_status := FND_API.g_ret_sts_error;
375:
376: -- Get message count and data
370:
371: EXCEPTION
372: WHEN FND_API.g_exc_error THEN
373: ROLLBACK TO Process_ResCost_PUB;
374: x_return_status := FND_API.g_ret_sts_error;
375:
376: -- Get message count and data
377: FND_MSG_PUB.count_and_get
378: ( p_count => x_msg_count
378: ( p_count => x_msg_count
379: , p_data => x_msg_data
380: );
381:
382: WHEN FND_API.g_exc_unexpected_error THEN
383: ROLLBACK TO Process_ResCost_PUB;
384: x_return_status := FND_API.g_ret_sts_unexp_error ;
385:
386: -- Get message count and data
380: );
381:
382: WHEN FND_API.g_exc_unexpected_error THEN
383: ROLLBACK TO Process_ResCost_PUB;
384: x_return_status := FND_API.g_ret_sts_unexp_error ;
385:
386: -- Get message count and data
387: FND_MSG_PUB.count_and_get
388: ( p_count => x_msg_count
390: );
391:
392: WHEN OTHERS THEN
393: ROLLBACK TO Process_ResCost_PUB;
394: x_return_status := fnd_api.g_ret_sts_unexp_error ;
395:
396: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
397: THEN
398: FND_MSG_PUB.add_exc_msg
457: /* =============================================================================== */
458:
459: PROCEDURE Update_eamCost (
460: p_api_version IN NUMBER,
461: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
462: p_commit IN VARCHAR2 := FND_API.G_FALSE,
463: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
464: x_return_status OUT NOCOPY VARCHAR2,
465: x_msg_count OUT NOCOPY NUMBER,
458:
459: PROCEDURE Update_eamCost (
460: p_api_version IN NUMBER,
461: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
462: p_commit IN VARCHAR2 := FND_API.G_FALSE,
463: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
464: x_return_status OUT NOCOPY VARCHAR2,
465: x_msg_count OUT NOCOPY NUMBER,
466: x_msg_data OUT NOCOPY VARCHAR2,
459: PROCEDURE Update_eamCost (
460: p_api_version IN NUMBER,
461: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
462: p_commit IN VARCHAR2 := FND_API.G_FALSE,
463: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
464: x_return_status OUT NOCOPY VARCHAR2,
465: x_msg_count OUT NOCOPY NUMBER,
466: x_msg_data OUT NOCOPY VARCHAR2,
467: p_txn_mode IN NUMBER, -- 1=material, 2=resource, 4=direct item
486:
487: l_api_name CONSTANT VARCHAR2(30) := 'Update_eamCost';
488: l_api_version CONSTANT NUMBER := 1.0;
489:
490: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
491: l_msg_count NUMBER := 0;
492: l_msg_data VARCHAR2(8000);
493: l_stmt_num NUMBER := 0;
494: l_api_message VARCHAR2(1000);
518: fnd_file.put_line(fnd_file.log, 'In Update_eamCost');
519: end if;
520:
521: -- Standard call to check for call compatibility
522: IF NOT FND_API.Compatible_API_Call (
523: l_api_version,
524: p_api_version,
525: l_api_name,
526: G_PKG_NAME ) THEN
523: l_api_version,
524: p_api_version,
525: l_api_name,
526: G_PKG_NAME ) THEN
527: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
528: END IF;
529:
530: -- Initialize message list if p_init_msg_list is set to TRUE
531: IF FND_API.to_Boolean(p_init_msg_list) THEN
527: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
528: END IF;
529:
530: -- Initialize message list if p_init_msg_list is set to TRUE
531: IF FND_API.to_Boolean(p_init_msg_list) THEN
532: FND_MSG_PUB.initialize;
533: END IF;
534:
535: -- Initialize API return status to success
532: FND_MSG_PUB.initialize;
533: END IF;
534:
535: -- Initialize API return status to success
536: x_return_status := FND_API.G_RET_STS_SUCCESS;
537:
538: IF (p_txn_mode not in (1,2,3,4) OR
539: p_value_type not in (1,2) OR
540: (p_resource_id is not null AND
544: p_period_name is null))) THEN
545: FND_MESSAGE.set_name('BOM', 'CST_INVALID_PARAMS');
546: FND_MESSAGE.set_token('JOB', p_wip_entity_id);
547: FND_MSG_PUB.ADD;
548: RAISE FND_API.g_exc_error;
549: END IF;
550:
551: FND_FILE.PUT_LINE(FND_FILE.LOG, 'Processing job '
552: || to_char(p_wip_entity_id));
565: l_api_message := l_api_message ||'Job id: '|| TO_CHAR(p_wip_entity_id);
566: FND_MESSAGE.set_name('BOM', 'CST_API_MESSAGE');
567: FND_MESSAGE.set_token('TEXT', l_api_message);
568: FND_MSG_PUB.ADD;
569: RAISE fnd_api.g_exc_error;
570: END IF;
571:
572: l_stmt_num := 62;
573: -- Get charge asset using API
580: x_return_status => l_return_status,
581: x_msg_count => l_msg_count,
582: x_msg_data => l_msg_data);
583:
584: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) then
585: FND_MESSAGE.set_token('TEXT', l_api_message);
586: FND_MSG_PUB.ADD;
587: RAISE fnd_api.g_exc_error;
588: END IF;
583:
584: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) then
585: FND_MESSAGE.set_token('TEXT', l_api_message);
586: FND_MSG_PUB.ADD;
587: RAISE fnd_api.g_exc_error;
588: END IF;
589:
590: ------------------------------------------------------------
591: -- Get eam cost element
606: p_mnt_or_mfg => 1,
607: x_cost_element_id => l_eam_cost_element
608: );
609:
610: if (l_return_status <> fnd_api.g_ret_sts_success) then
611: FND_FILE.put_line(FND_FILE.log, x_msg_data);
612: l_api_message := 'get_CostElement_for_DirectItem returned unexpected error';
613: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
614: FND_MESSAGE.set_token('TEXT', l_api_message);
612: l_api_message := 'get_CostElement_for_DirectItem returned unexpected error';
613: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
614: FND_MESSAGE.set_token('TEXT', l_api_message);
615: FND_MSG_pub.add;
616: raise fnd_api.g_exc_unexpected_error;
617: end if;
618:
619: if (l_debug = 'Y') then
620: FND_FILE.PUT_LINE(FND_FILE.LOG,'eam_cost_element_id: '|| to_char(l_eam_cost_element));
627: l_api_message := 'Get_eamCostElement returned error';
628: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
629: FND_MESSAGE.set_token('TEXT', l_api_message);
630: FND_MSG_pub.add;
631: RAISE FND_API.g_exc_error;
632: END IF;
633: end if; /* p_txn_mode */
634:
635: --------------------------------------------------------------
653: AND organization_id = p_org_id;
654:
655: ELSE
656: l_stmt_num := 80;
657: l_return_status := FND_API.G_RET_STS_SUCCESS;
658:
659: if (l_debug = 'Y') then
660: fnd_file.put_line(fnd_file.log, 'Getting maint Cost_category');
661: end if;
670: x_operation_dept => l_dept_id,
671: x_owning_dept => l_owning_dept_id,
672: x_maint_cost_cat => l_maint_cost_category);
673:
674: IF l_return_status <> FND_API.g_ret_sts_success THEN
675: FND_FILE.put_line(FND_FILE.log, x_msg_data);
676: l_api_message := 'Get_MaintCostCat returned error';
677: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
678: FND_MESSAGE.set_token('TEXT', l_api_message);
676: l_api_message := 'Get_MaintCostCat returned error';
677: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
678: FND_MESSAGE.set_token('TEXT', l_api_message);
679: FND_MSG_pub.add;
680: RAISE FND_API.g_exc_error;
681: END IF;
682:
683: END IF; -- end checking p_txn_mode
684:
713: p_prog_app_id => p_prog_app_id,
714: p_login_id => p_login_id,
715: p_txn_date => p_txn_date);
716:
717: IF l_return_status <> FND_API.g_ret_sts_success THEN
718: FND_FILE.put_line(FND_FILE.log, x_msg_data);
719: l_api_message := 'InsertUpdate_eamPerBal returned error';
720: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
721: FND_MESSAGE.set_token('TEXT', l_api_message);
719: l_api_message := 'InsertUpdate_eamPerBal returned error';
720: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
721: FND_MESSAGE.set_token('TEXT', l_api_message);
722: FND_MSG_pub.add;
723: RAISE FND_API.g_exc_error;
724: END IF;
725:
726: --- Standard check of p_commit
727: IF FND_API.to_Boolean(p_commit) THEN
723: RAISE FND_API.g_exc_error;
724: END IF;
725:
726: --- Standard check of p_commit
727: IF FND_API.to_Boolean(p_commit) THEN
728: COMMIT WORK;
729: END IF;
730:
731: -- Standard Call to get message count and if count = 1, get message info
734: p_data => x_msg_data );
735:
736:
737: EXCEPTION
738: WHEN FND_API.g_exc_error THEN
739: FND_FILE.PUT_LINE(fnd_file.log,'1 exception ' || SQLERRM );
740: ROLLBACK TO Update_eamCost_PUB;
741: x_return_status := FND_API.g_ret_sts_error;
742:
737: EXCEPTION
738: WHEN FND_API.g_exc_error THEN
739: FND_FILE.PUT_LINE(fnd_file.log,'1 exception ' || SQLERRM );
740: ROLLBACK TO Update_eamCost_PUB;
741: x_return_status := FND_API.g_ret_sts_error;
742:
743: -- Get message count and data
744: FND_MSG_PUB.count_and_get
745: ( p_count => x_msg_count
745: ( p_count => x_msg_count
746: , p_data => x_msg_data
747: );
748:
749: WHEN FND_API.g_exc_unexpected_error THEN
750: FND_FILE.PUT_LINE(fnd_file.log,'1 exception ' || SQLERRM );
751: ROLLBACK TO Update_eamCost_PUB;
752: x_return_status := FND_API.g_ret_sts_unexp_error ;
753:
748:
749: WHEN FND_API.g_exc_unexpected_error THEN
750: FND_FILE.PUT_LINE(fnd_file.log,'1 exception ' || SQLERRM );
751: ROLLBACK TO Update_eamCost_PUB;
752: x_return_status := FND_API.g_ret_sts_unexp_error ;
753:
754: -- Get message count and data
755: FND_MSG_PUB.count_and_get
756: ( p_count => x_msg_count
759:
760: WHEN OTHERS THEN
761: fnd_file.put_line(fnd_file.log, 'Exception in Update_eamcost'|| SQLERRM);
762: ROLLBACK TO Update_eamCost_PUB;
763: x_return_status := fnd_api.g_ret_sts_unexp_error ;
764:
765: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
766: THEN
767: FND_MSG_PUB.add_exc_msg
815: ------------------------------------------------------------------------------
816:
817: PROCEDURE InsertUpdate_eamPerBal (
818: p_api_version IN NUMBER,
819: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
820: p_commit IN VARCHAR2 := FND_API.G_FALSE,
821: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
822: x_return_status OUT NOCOPY VARCHAR2,
823: x_msg_count OUT NOCOPY NUMBER,
816:
817: PROCEDURE InsertUpdate_eamPerBal (
818: p_api_version IN NUMBER,
819: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
820: p_commit IN VARCHAR2 := FND_API.G_FALSE,
821: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
822: x_return_status OUT NOCOPY VARCHAR2,
823: x_msg_count OUT NOCOPY NUMBER,
824: x_msg_data OUT NOCOPY VARCHAR2,
817: PROCEDURE InsertUpdate_eamPerBal (
818: p_api_version IN NUMBER,
819: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
820: p_commit IN VARCHAR2 := FND_API.G_FALSE,
821: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
822: x_return_status OUT NOCOPY VARCHAR2,
823: x_msg_count OUT NOCOPY NUMBER,
824: x_msg_data OUT NOCOPY VARCHAR2,
825: p_period_id IN NUMBER := null,
846:
847: l_api_name CONSTANT VARCHAR2(30) := 'InsertUpdate_eamPerBal';
848: l_api_version CONSTANT NUMBER := 1.0;
849:
850: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
851: l_msg_count NUMBER := 0;
852: l_msg_data VARCHAR2(8000);
853: l_stmt_num NUMBER := 0;
854: l_api_message VARCHAR2(1000);
915: FND_FILE.PUT_LINE(fnd_file.log,'p_asset_group_id: ' || to_char( p_asset_group_id ));
916: end if;
917:
918: -- Standard call to check for call compatibility
919: IF NOT FND_API.Compatible_API_Call (
920: l_api_version,
921: p_api_version,
922: l_api_name,
923: G_PKG_NAME ) THEN
920: l_api_version,
921: p_api_version,
922: l_api_name,
923: G_PKG_NAME ) THEN
924: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
925: END IF;
926:
927: -- Initialize message list if p_init_msg_list is set to TRUE
928: IF FND_API.to_Boolean(p_init_msg_list) THEN
924: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
925: END IF;
926:
927: -- Initialize message list if p_init_msg_list is set to TRUE
928: IF FND_API.to_Boolean(p_init_msg_list) THEN
929: FND_MSG_PUB.initialize;
930: END IF;
931:
932: -- Initialize API return status to success
929: FND_MSG_PUB.initialize;
930: END IF;
931:
932: -- Initialize API return status to success
933: x_return_status := FND_API.G_RET_STS_SUCCESS;
934:
935: -------------------------------------------------------------
936: -- Get period id if period set name and period name is passed
937: -- and vice versa
946: l_api_message := 'Job id: ' || TO_CHAR(p_wip_entity_id);
947: FND_MESSAGE.set_name('BOM', 'CST_API_MESSAGE');
948: FND_MESSAGE.set_token('TEXT', l_api_message);
949: FND_MSG_PUB.ADD;
950: RAISE FND_API.g_exc_error;
951: END IF;
952:
953: -- Get data from org_acct_periods if it is an open period.
954: BEGIN
1274:
1275:
1276: --BUG#5985039 FP BUG#5984909
1277: -- If return status is not success, raise error
1278: IF l_return_status <> FND_API.g_ret_sts_success THEN
1279: l_api_message := 'InsertUpdate_assetPerBal error';
1280: FND_MSG_PUB.add_exc_msg
1281: ( 'CST_eamCost_PUB',
1282: 'InsertUpdate_eamPerBal('||to_char(l_stmt_num) || ')', l_api_message);
1279: l_api_message := 'InsertUpdate_assetPerBal error';
1280: FND_MSG_PUB.add_exc_msg
1281: ( 'CST_eamCost_PUB',
1282: 'InsertUpdate_eamPerBal('||to_char(l_stmt_num) || ')', l_api_message);
1283: RAISE FND_API.g_exc_error;
1284: END IF;
1285:
1286: END LOOP;
1287:
1313: );
1314:
1315: --BUG#5985039 - FPBUG 5984909
1316: -- If return status is not success, raise error
1317: IF l_return_status <> FND_API.g_ret_sts_success THEN
1318: l_api_message := 'InsertUpdate_assetPerBal error';
1319: FND_MSG_PUB.add_exc_msg
1320: ( 'CST_eamCost_PUB',
1321: 'InsertUpdate_eamPerBal('||to_char(l_stmt_num) || ')', l_api_message);
1318: l_api_message := 'InsertUpdate_assetPerBal error';
1319: FND_MSG_PUB.add_exc_msg
1320: ( 'CST_eamCost_PUB',
1321: 'InsertUpdate_eamPerBal('||to_char(l_stmt_num) || ')', l_api_message);
1322: RAISE FND_API.g_exc_error;
1323: END IF;
1324:
1325:
1326:
1330: FND_FILE.PUT_LINE(fnd_file.log,'inserted into cst_eam_asset_per_balances' );
1331: end if;
1332:
1333: -- Standard check of p_commit
1334: IF FND_API.to_Boolean(p_commit) THEN
1335: COMMIT WORK;
1336: END IF;
1337:
1338: -- Standard Call to get message count and if count = 1, get message info
1341: p_data => x_msg_data );
1342:
1343: EXCEPTION
1344:
1345: WHEN FND_API.g_exc_error THEN
1346: FND_FILE.PUT_LINE(fnd_file.log,' exception' || SQLERRM );
1347: ROLLBACK TO InsertUpdate_eamPerBal_PUB;
1348: x_return_status := FND_API.g_ret_sts_error;
1349:
1344:
1345: WHEN FND_API.g_exc_error THEN
1346: FND_FILE.PUT_LINE(fnd_file.log,' exception' || SQLERRM );
1347: ROLLBACK TO InsertUpdate_eamPerBal_PUB;
1348: x_return_status := FND_API.g_ret_sts_error;
1349:
1350: -- Get message count and data
1351: FND_MSG_PUB.count_and_get
1352: ( p_count => x_msg_count
1352: ( p_count => x_msg_count
1353: , p_data => x_msg_data
1354: );
1355:
1356: WHEN FND_API.g_exc_unexpected_error THEN
1357: FND_FILE.PUT_LINE(fnd_file.log,' exception' || SQLERRM );
1358: ROLLBACK TO InsertUpdate_eamPerBal_PUB;
1359: x_return_status := FND_API.g_ret_sts_unexp_error ;
1360:
1355:
1356: WHEN FND_API.g_exc_unexpected_error THEN
1357: FND_FILE.PUT_LINE(fnd_file.log,' exception' || SQLERRM );
1358: ROLLBACK TO InsertUpdate_eamPerBal_PUB;
1359: x_return_status := FND_API.g_ret_sts_unexp_error ;
1360:
1361: -- Get message count and data
1362: FND_MSG_PUB.count_and_get
1363: ( p_count => x_msg_count
1366:
1367: WHEN OTHERS THEN
1368: FND_FILE.PUT_LINE(fnd_file.log,'exception' || SQLERRM );
1369: ROLLBACK TO InsertUpdate_eamPerBal_PUB;
1370: x_return_status := fnd_api.g_ret_sts_unexp_error ;
1371:
1372: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
1373: THEN
1374: FND_MSG_PUB.add_exc_msg
1426: ------------------------------------------------------------------------------
1427:
1428: PROCEDURE InsertUpdate_assetPerBal (
1429: p_api_version IN NUMBER,
1430: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1431: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1432: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
1433: x_return_status OUT NOCOPY VARCHAR2,
1434: x_msg_count OUT NOCOPY NUMBER,
1427:
1428: PROCEDURE InsertUpdate_assetPerBal (
1429: p_api_version IN NUMBER,
1430: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1431: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1432: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
1433: x_return_status OUT NOCOPY VARCHAR2,
1434: x_msg_count OUT NOCOPY NUMBER,
1435: x_msg_data OUT NOCOPY VARCHAR2,
1428: PROCEDURE InsertUpdate_assetPerBal (
1429: p_api_version IN NUMBER,
1430: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1431: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1432: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
1433: x_return_status OUT NOCOPY VARCHAR2,
1434: x_msg_count OUT NOCOPY NUMBER,
1435: x_msg_data OUT NOCOPY VARCHAR2,
1436: p_period_id IN NUMBER := null,
1455:
1456: l_api_name CONSTANT VARCHAR2(30) := 'InsertUpdate_assetPerBal';
1457: l_api_version CONSTANT NUMBER := 1.0;
1458:
1459: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
1460: l_msg_count NUMBER := 0;
1461: l_msg_data VARCHAR2(8000);
1462: l_api_message VARCHAR2(1000);
1463:
1482: FND_FILE.PUT_LINE(fnd_file.log,'p_asset_group_id: ' || to_char( p_asset_group_id ));
1483: end if;
1484:
1485: -- Standard call to check for call compatibility
1486: IF NOT FND_API.Compatible_API_Call (
1487: l_api_version,
1488: p_api_version,
1489: l_api_name,
1490: G_PKG_NAME ) THEN
1487: l_api_version,
1488: p_api_version,
1489: l_api_name,
1490: G_PKG_NAME ) THEN
1491: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1492: END IF;
1493:
1494: -- Initialize message list if p_init_msg_list is set to TRUE
1495: IF FND_API.to_Boolean(p_init_msg_list) THEN
1491: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1492: END IF;
1493:
1494: -- Initialize message list if p_init_msg_list is set to TRUE
1495: IF FND_API.to_Boolean(p_init_msg_list) THEN
1496: FND_MSG_PUB.initialize;
1497: END IF;
1498:
1499: -- Initialize API return status to success
1496: FND_MSG_PUB.initialize;
1497: END IF;
1498:
1499: -- Initialize API return status to success
1500: x_return_status := FND_API.G_RET_STS_SUCCESS;
1501:
1502: l_count := 0;
1503:
1504: SELECT count(*)
1591: END IF; -- end checking asset balance rowcount
1592:
1593:
1594: -- Standard check of p_commit
1595: IF FND_API.to_Boolean(p_commit) THEN
1596: COMMIT WORK;
1597: END IF;
1598:
1599: -- Standard Call to get message count and if count = 1, get message info
1602: p_data => x_msg_data );
1603:
1604: EXCEPTION
1605:
1606: WHEN FND_API.g_exc_error THEN
1607: FND_FILE.PUT_LINE(fnd_file.log,' exception' || SQLERRM );
1608: ROLLBACK TO InsertUpdate_assetPerBal_PUB;
1609: x_return_status := FND_API.g_ret_sts_error;
1610: -- Get message count and data
1605:
1606: WHEN FND_API.g_exc_error THEN
1607: FND_FILE.PUT_LINE(fnd_file.log,' exception' || SQLERRM );
1608: ROLLBACK TO InsertUpdate_assetPerBal_PUB;
1609: x_return_status := FND_API.g_ret_sts_error;
1610: -- Get message count and data
1611: FND_MSG_PUB.count_and_get
1612: ( p_count => x_msg_count
1613: , p_data => x_msg_data
1612: ( p_count => x_msg_count
1613: , p_data => x_msg_data
1614: );
1615:
1616: WHEN FND_API.g_exc_unexpected_error THEN
1617: FND_FILE.PUT_LINE(fnd_file.log,' exception' || SQLERRM );
1618: ROLLBACK TO InsertUpdate_assetPerBal_PUB;
1619: x_return_status := FND_API.g_ret_sts_unexp_error ;
1620:
1615:
1616: WHEN FND_API.g_exc_unexpected_error THEN
1617: FND_FILE.PUT_LINE(fnd_file.log,' exception' || SQLERRM );
1618: ROLLBACK TO InsertUpdate_assetPerBal_PUB;
1619: x_return_status := FND_API.g_ret_sts_unexp_error ;
1620:
1621: -- Get message count and data
1622: FND_MSG_PUB.count_and_get
1623: ( p_count => x_msg_count
1626:
1627: WHEN OTHERS THEN
1628: FND_FILE.PUT_LINE(fnd_file.log,'exception' || SQLERRM );
1629: ROLLBACK TO InsertUpdate_assetPerBal_PUB;
1630: x_return_status := fnd_api.g_ret_sts_unexp_error ;
1631:
1632: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
1633: THEN
1634: FND_MSG_PUB.add_exc_msg
1804: -- use the Work order owning dept for costing
1805:
1806: ------------------------------------------------------------------------
1807: -- Initialize return status to success.
1808: x_return_status := FND_API.G_RET_STS_SUCCESS;
1809:
1810: -- Get organization id, just in case we need to get default cost
1811: -- category from wip_eam_parameters later on.
1812: l_stmt_num := 215;
1926: WHEN OTHERS THEN
1927: FND_FILE.PUT_LINE(FND_FILE.LOG,'Get_MaintCostCat - statement '
1928: || l_stmt_num || ': '
1929: || substr(SQLERRM,1,200));
1930: x_return_status := FND_API.g_ret_sts_unexp_error ;
1931:
1932: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
1933: THEN
1934: FND_MSG_PUB.add_exc_msg
1960: /* ======================================================================= */
1961:
1962: PROCEDURE Delete_eamPerBal (
1963: p_api_version IN NUMBER,
1964: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1965: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1966: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
1967: x_return_status OUT NOCOPY VARCHAR2,
1968: x_msg_count OUT NOCOPY NUMBER,
1961:
1962: PROCEDURE Delete_eamPerBal (
1963: p_api_version IN NUMBER,
1964: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1965: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1966: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
1967: x_return_status OUT NOCOPY VARCHAR2,
1968: x_msg_count OUT NOCOPY NUMBER,
1969: x_msg_data OUT NOCOPY VARCHAR2,
1962: PROCEDURE Delete_eamPerBal (
1963: p_api_version IN NUMBER,
1964: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1965: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1966: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
1967: x_return_status OUT NOCOPY VARCHAR2,
1968: x_msg_count OUT NOCOPY NUMBER,
1969: x_msg_data OUT NOCOPY VARCHAR2,
1970: p_entity_id_tab IN CSTPECEP.wip_entity_id_type,
1974:
1975: l_api_name CONSTANT VARCHAR2(30) := 'Delete_eamPerBal';
1976: l_api_version CONSTANT NUMBER := 1.0;
1977:
1978: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
1979: l_msg_count NUMBER := 0;
1980: l_msg_data VARCHAR2(8000);
1981: l_stmt_num NUMBER := 0;
1982: l_api_message VARCHAR2(1000);
2024: -- Standard Start of API savepoint
2025: SAVEPOINT Delete_eamPerBal_PUB;
2026:
2027: -- Standard call to check for call compatibility
2028: IF NOT FND_API.Compatible_API_Call (
2029: l_api_version,
2030: p_api_version,
2031: l_api_name,
2032: G_PKG_NAME ) THEN
2029: l_api_version,
2030: p_api_version,
2031: l_api_name,
2032: G_PKG_NAME ) THEN
2033: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2034: END IF;
2035:
2036: -- Initialize message list if p_init_msg_list is set to TRUE
2037: IF FND_API.to_Boolean(p_init_msg_list) THEN
2033: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2034: END IF;
2035:
2036: -- Initialize message list if p_init_msg_list is set to TRUE
2037: IF FND_API.to_Boolean(p_init_msg_list) THEN
2038: FND_MSG_PUB.initialize;
2039: END IF;
2040:
2041: -- Initialize API return status to success
2038: FND_MSG_PUB.initialize;
2039: END IF;
2040:
2041: -- Initialize API return status to success
2042: x_return_status := FND_API.G_RET_STS_SUCCESS;
2043:
2044: -- Since passing parameter is a PL/SQL table, check if it has any element.
2045: -- Then proceed. First loop thru all and update, then bulk delete
2046: IF p_entity_id_tab.COUNT > 0 THEN
2385:
2386: END IF;
2387:
2388: EXCEPTION
2389: WHEN FND_API.g_exc_error THEN
2390: ROLLBACK TO Delete_eamPerBal_PUB;
2391: x_return_status := FND_API.g_ret_sts_error;
2392:
2393: -- Get message count and data
2387:
2388: EXCEPTION
2389: WHEN FND_API.g_exc_error THEN
2390: ROLLBACK TO Delete_eamPerBal_PUB;
2391: x_return_status := FND_API.g_ret_sts_error;
2392:
2393: -- Get message count and data
2394: FND_MSG_PUB.count_and_get
2395: ( p_count => x_msg_count
2395: ( p_count => x_msg_count
2396: , p_data => x_msg_data
2397: );
2398:
2399: WHEN FND_API.g_exc_unexpected_error THEN
2400: ROLLBACK TO Delete_eamPerBal_PUB;
2401: x_return_status := FND_API.g_ret_sts_unexp_error ;
2402:
2403: -- Get message count and data
2397: );
2398:
2399: WHEN FND_API.g_exc_unexpected_error THEN
2400: ROLLBACK TO Delete_eamPerBal_PUB;
2401: x_return_status := FND_API.g_ret_sts_unexp_error ;
2402:
2403: -- Get message count and data
2404: FND_MSG_PUB.count_and_get
2405: ( p_count => x_msg_count
2407: );
2408:
2409: WHEN OTHERS THEN
2410: ROLLBACK TO Delete_eamPerBal_PUB;
2411: x_return_status := fnd_api.g_ret_sts_unexp_error ;
2412:
2413: FND_FILE.PUT_LINE(FND_FILE.LOG,'Delete_eamPerBal - statement '
2414: || l_stmt_num || ': '
2415: || substr(SQLERRM,1,200));
2454: ----------------------------------------------------------------------------
2455: PROCEDURE Compute_Job_Estimate (
2456: p_api_version IN NUMBER,
2457: p_init_msg_list IN VARCHAR2
2458: := FND_API.G_FALSE,
2459: p_commit IN VARCHAR2
2460: := FND_API.G_FALSE,
2461: p_validation_level IN NUMBER
2462: := FND_API.G_VALID_LEVEL_FULL,
2456: p_api_version IN NUMBER,
2457: p_init_msg_list IN VARCHAR2
2458: := FND_API.G_FALSE,
2459: p_commit IN VARCHAR2
2460: := FND_API.G_FALSE,
2461: p_validation_level IN NUMBER
2462: := FND_API.G_VALID_LEVEL_FULL,
2463: p_debug IN VARCHAR2 := 'N',
2464: p_wip_entity_id IN NUMBER,
2458: := FND_API.G_FALSE,
2459: p_commit IN VARCHAR2
2460: := FND_API.G_FALSE,
2461: p_validation_level IN NUMBER
2462: := FND_API.G_VALID_LEVEL_FULL,
2463: p_debug IN VARCHAR2 := 'N',
2464: p_wip_entity_id IN NUMBER,
2465:
2466: p_user_id IN NUMBER,
2494: l_operation_dept_id NUMBER := 0;
2495: l_owning_dept_id NUMBER := 0;
2496: l_maint_cost_category NUMBER := 0;
2497: l_eam_cost_element NUMBER := 0;
2498: l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
2499: l_api_message VARCHAR2(10000);
2500: l_stmt_num NUMBER;
2501: l_dept_id NUMBER := 0;
2502: l_period_set_name VARCHAR2(15) := NULL;
2910:
2911: -------------------------------------------------------------------------
2912: -- standard call to check for call compatibility
2913: -------------------------------------------------------------------------
2914: IF NOT fnd_api.compatible_api_call (
2915: l_api_version,
2916: p_api_version,
2917: l_api_name,
2918: G_PKG_NAME ) then
2916: p_api_version,
2917: l_api_name,
2918: G_PKG_NAME ) then
2919:
2920: RAISE fnd_api.g_exc_unexpected_error;
2921:
2922: END IF;
2923:
2924: -------------------------------------------------------------------------
2924: -------------------------------------------------------------------------
2925: -- Initialize message list if p_init_msg_list is set to TRUE
2926: -------------------------------------------------------------------------
2927:
2928: IF FND_API.to_Boolean(p_init_msg_list) THEN
2929: FND_MSG_PUB.initialize;
2930: END IF;
2931:
2932:
2932:
2933: -------------------------------------------------------------------------
2934: -- initialize api return status to success
2935: -------------------------------------------------------------------------
2936: x_return_status := fnd_api.g_ret_sts_success;
2937:
2938: -- assign to local variables
2939: l_stmt_num := 10;
2940:
2959:
2960: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
2961: ||TO_CHAR(l_stmt_num)
2962: ||'): ', l_api_message);
2963: RAISE FND_API.g_exc_error;
2964:
2965: ELSE
2966:
2967: l_stmt_num := 15;
2986: x_return_status => l_return_status,
2987: x_msg_count => l_msg_count,
2988: x_msg_data => l_msg_data);
2989:
2990: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) then
2991: FND_MESSAGE.set_token('TEXT', l_api_message);
2992: FND_MSG_PUB.ADD;
2993: RAISE fnd_api.g_exc_error;
2994: END IF;
2989:
2990: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) then
2991: FND_MESSAGE.set_token('TEXT', l_api_message);
2992: FND_MSG_PUB.ADD;
2993: RAISE fnd_api.g_exc_error;
2994: END IF;
2995:
2996:
2997: END IF;
3020: ||TO_CHAR(l_organization_id);
3021: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3022: ||TO_CHAR(l_stmt_num)
3023: ||'): ', l_api_message);
3024: RAISE FND_API.g_exc_error;
3025:
3026: END IF;
3027:
3028: END IF; -- check for wip_project_id <> -1
3099: l_api_message := l_api_message||TO_CHAR(l_trunc_le_sched_comp_date);
3100: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3101: ||TO_CHAR(l_stmt_num)
3102: ||'): ', l_api_message);
3103: RAISE FND_API.g_exc_error;
3104:
3105: END IF;
3106:
3107: -------------------------------------------------------------------------
3137:
3138: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3139: ||TO_CHAR(l_stmt_num)
3140: ||'): ', l_api_message);
3141: RAISE FND_API.g_exc_error;
3142:
3143:
3144: END IF;
3145:
3223: x_operation_dept => l_operation_dept_id,
3224: x_owning_dept => l_owning_dept_id,
3225: x_maint_cost_cat => l_maint_cost_category);
3226:
3227: IF l_return_status <> FND_API.g_ret_sts_success THEN
3228:
3229: l_api_message := 'Get_MaintCostCat returned error';
3230: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3231: ||TO_CHAR(l_stmt_num)
3229: l_api_message := 'Get_MaintCostCat returned error';
3230: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3231: ||TO_CHAR(l_stmt_num)
3232: ||'): ', l_api_message);
3233: RAISE FND_API.g_exc_error;
3234:
3235: END IF;
3236:
3237: l_stmt_num := 65;
3246: l_api_message := 'Get_eamCostElement returned error';
3247: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3248: ||TO_CHAR(l_stmt_num)
3249: ||'): ', l_api_message);
3250: RAISE FND_API.g_exc_error;
3251:
3252: END IF;
3253:
3254: IF (p_debug = 'Y') THEN
3288: p_prog_id => p_prog_id,
3289: p_prog_app_id => p_prog_app_id,
3290: p_login_id => p_login_id);
3291:
3292: IF l_return_status <> FND_API.g_ret_sts_success THEN
3293:
3294: l_api_message := 'insertupdate_eamperbal error';
3295: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3296: ||TO_CHAR(l_stmt_num)
3294: l_api_message := 'insertupdate_eamperbal error';
3295: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3296: ||TO_CHAR(l_stmt_num)
3297: ||'): ', l_api_message);
3298: RAISE FND_API.g_exc_error;
3299:
3300: END IF;
3301:
3302:
3328: END IF;
3329:
3330: Insert_eamBalAcct(
3331: p_api_version => 1.0,
3332: p_init_msg_list => FND_API.G_FALSE,
3333: p_commit => FND_API.G_FALSE,
3334: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3335: x_return_status => l_return_status,
3336: x_msg_count => l_msg_count,
3329:
3330: Insert_eamBalAcct(
3331: p_api_version => 1.0,
3332: p_init_msg_list => FND_API.G_FALSE,
3333: p_commit => FND_API.G_FALSE,
3334: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3335: x_return_status => l_return_status,
3336: x_msg_count => l_msg_count,
3337: x_msg_data => l_msg_data,
3330: Insert_eamBalAcct(
3331: p_api_version => 1.0,
3332: p_init_msg_list => FND_API.G_FALSE,
3333: p_commit => FND_API.G_FALSE,
3334: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3335: x_return_status => l_return_status,
3336: x_msg_count => l_msg_count,
3337: x_msg_data => l_msg_data,
3338: p_period_id => l_acct_period_id,
3355: p_prog_id => p_prog_id,
3356: p_prog_app_id => p_prog_app_id,
3357: p_login_id => p_login_id);
3358:
3359: IF l_return_status <> FND_API.g_ret_sts_success THEN
3360:
3361: l_api_message := 'Insert_eamBalAcct error';
3362: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
3363: ||TO_CHAR(l_stmt_num)
3361: l_api_message := 'Insert_eamBalAcct error';
3362: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
3363: ||TO_CHAR(l_stmt_num)
3364: ||'): ', l_api_message);
3365: RAISE FND_API.g_exc_error;
3366:
3367: END IF;
3368: ELSE
3369:
3437:
3438: p_prog_app_id => p_prog_app_id,
3439: p_login_id => p_login_id);
3440:
3441: IF l_return_status <> FND_API.g_ret_sts_success THEN
3442:
3443: l_api_message := 'insertupdate_eamperbal error';
3444:
3445: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3444:
3445: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3446: ||TO_CHAR(l_stmt_num)
3447: ||'): ', l_api_message);
3448: RAISE FND_API.g_exc_error;
3449:
3450: END IF;
3451:
3452: END LOOP; -- c_rbo_rec
3471: END IF;
3472:
3473: Insert_eamBalAcct(
3474: p_api_version => 1.0,
3475: p_init_msg_list => FND_API.G_FALSE,
3476: p_commit => FND_API.G_FALSE,
3477: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3478: x_return_status => l_return_status,
3479: x_msg_count => l_msg_count,
3472:
3473: Insert_eamBalAcct(
3474: p_api_version => 1.0,
3475: p_init_msg_list => FND_API.G_FALSE,
3476: p_commit => FND_API.G_FALSE,
3477: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3478: x_return_status => l_return_status,
3479: x_msg_count => l_msg_count,
3480: x_msg_data => l_msg_data,
3473: Insert_eamBalAcct(
3474: p_api_version => 1.0,
3475: p_init_msg_list => FND_API.G_FALSE,
3476: p_commit => FND_API.G_FALSE,
3477: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3478: x_return_status => l_return_status,
3479: x_msg_count => l_msg_count,
3480: x_msg_data => l_msg_data,
3481: p_period_id => l_acct_period_id,
3498: p_prog_id => p_prog_id,
3499: p_prog_app_id => p_prog_app_id,
3500: p_login_id => p_login_id);
3501:
3502: IF l_return_status <> FND_API.g_ret_sts_success THEN
3503:
3504: l_api_message := 'Insert_eamBalAcct error';
3505: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
3506: ||TO_CHAR(l_stmt_num)
3504: l_api_message := 'Insert_eamBalAcct error';
3505: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
3506: ||TO_CHAR(l_stmt_num)
3507: ||'): ', l_api_message);
3508: RAISE FND_API.g_exc_error;
3509:
3510: END IF;
3511:
3512: ELSE
3607: x_operation_dept => l_operation_dept_id,
3608: x_owning_dept => l_owning_dept_id,
3609: x_maint_cost_cat => l_maint_cost_category);
3610:
3611: IF l_return_status <> FND_API.g_ret_sts_success THEN
3612:
3613: l_api_message := 'Get_MaintCostCat returned error';
3614: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3615: ||TO_CHAR(l_stmt_num)
3613: l_api_message := 'Get_MaintCostCat returned error';
3614: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3615: ||TO_CHAR(l_stmt_num)
3616: ||'): ', l_api_message);
3617: RAISE FND_API.g_exc_error;
3618:
3619: END IF;
3620:
3621: l_stmt_num := 95;
3629: l_api_message := 'Get_eamCostElement returned error';
3630: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3631: ||TO_CHAR(l_stmt_num)
3632: ||'): ', l_api_message);
3633: RAISE FND_API.g_exc_error;
3634:
3635: END IF;
3636:
3637: IF (p_debug = 'Y') THEN
3671: p_prog_id => p_prog_id,
3672: p_prog_app_id => p_prog_app_id,
3673: p_login_id => p_login_id);
3674:
3675: IF l_return_status <> FND_API.g_ret_sts_success THEN
3676:
3677: l_api_message := 'INSERTUPDATE_EAMPERBAL ERROR';
3678:
3679: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3678:
3679: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3680: ||TO_CHAR(l_stmt_num)
3681: ||'): ', l_api_message);
3682: RAISE FND_API.g_exc_error;
3683:
3684: END IF;
3685:
3686:
3703: END IF;
3704:
3705: Insert_eamBalAcct(
3706: p_api_version => 1.0,
3707: p_init_msg_list => FND_API.G_FALSE,
3708: p_commit => FND_API.G_FALSE,
3709: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3710: x_return_status => l_return_status,
3711: x_msg_count => l_msg_count,
3704:
3705: Insert_eamBalAcct(
3706: p_api_version => 1.0,
3707: p_init_msg_list => FND_API.G_FALSE,
3708: p_commit => FND_API.G_FALSE,
3709: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3710: x_return_status => l_return_status,
3711: x_msg_count => l_msg_count,
3712: x_msg_data => l_msg_data,
3705: Insert_eamBalAcct(
3706: p_api_version => 1.0,
3707: p_init_msg_list => FND_API.G_FALSE,
3708: p_commit => FND_API.G_FALSE,
3709: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3710: x_return_status => l_return_status,
3711: x_msg_count => l_msg_count,
3712: x_msg_data => l_msg_data,
3713: p_period_id => l_acct_period_id,
3730: p_prog_id => p_prog_id,
3731: p_prog_app_id => p_prog_app_id,
3732: p_login_id => p_login_id);
3733:
3734: IF l_return_status <> FND_API.g_ret_sts_success THEN
3735:
3736: l_api_message := 'Insert_eamBalAcct error';
3737: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
3738: ||TO_CHAR(l_stmt_num)
3736: l_api_message := 'Insert_eamBalAcct error';
3737: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
3738: ||TO_CHAR(l_stmt_num)
3739: ||'): ', l_api_message);
3740: RAISE FND_API.g_exc_error;
3741:
3742: END IF;
3743:
3744: ELSE
3783: x_operation_dept => l_operation_dept_id,
3784: x_owning_dept => l_owning_dept_id,
3785: x_maint_cost_cat => l_maint_cost_category);
3786:
3787: IF l_return_status <> FND_API.g_ret_sts_success THEN
3788:
3789: l_api_message := 'Get_MaintCostCat returned error';
3790:
3791: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3790:
3791: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3792: ||TO_CHAR(l_stmt_num)
3793: ||'): ', l_api_message);
3794: RAISE FND_API.g_exc_error;
3795:
3796: END IF;
3797:
3798: l_stmt_num := 115;
3807:
3808: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3809: ||TO_CHAR(l_stmt_num)
3810: ||'): ', l_api_message);
3811: RAISE FND_API.g_exc_error;
3812:
3813: END IF;
3814:
3815: IF (p_debug = 'Y') THEN
3849: p_prog_id => p_prog_id,
3850: p_prog_app_id => p_prog_app_id,
3851: p_login_id => p_login_id);
3852:
3853: IF l_return_status <> FND_API.g_ret_sts_success THEN
3854:
3855: l_api_message := 'insertupdate_eamperbal error';
3856:
3857: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3856:
3857: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3858: ||TO_CHAR(l_stmt_num)
3859: ||'): ', l_api_message);
3860: RAISE FND_API.g_exc_error;
3861:
3862: END IF;
3863:
3864:
3931:
3932: If (l_exec_flag = 1) then
3933: Insert_eamBalAcct(
3934: p_api_version => 1.0,
3935: p_init_msg_list => FND_API.G_FALSE,
3936: p_commit => FND_API.G_FALSE,
3937: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3938: x_return_status => l_return_status,
3939: x_msg_count => l_msg_count,
3932: If (l_exec_flag = 1) then
3933: Insert_eamBalAcct(
3934: p_api_version => 1.0,
3935: p_init_msg_list => FND_API.G_FALSE,
3936: p_commit => FND_API.G_FALSE,
3937: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3938: x_return_status => l_return_status,
3939: x_msg_count => l_msg_count,
3940: x_msg_data => l_msg_data,
3933: Insert_eamBalAcct(
3934: p_api_version => 1.0,
3935: p_init_msg_list => FND_API.G_FALSE,
3936: p_commit => FND_API.G_FALSE,
3937: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3938: x_return_status => l_return_status,
3939: x_msg_count => l_msg_count,
3940: x_msg_data => l_msg_data,
3941: p_period_id => l_acct_period_id,
3958: p_prog_id => p_prog_id,
3959: p_prog_app_id => p_prog_app_id,
3960: p_login_id => p_login_id);
3961:
3962: IF l_return_status <> FND_API.g_ret_sts_success THEN
3963:
3964: l_api_message := 'Insert_eamBalAcct error';
3965: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
3966: ||TO_CHAR(l_stmt_num)
3964: l_api_message := 'Insert_eamBalAcct error';
3965: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
3966: ||TO_CHAR(l_stmt_num)
3967: ||'): ', l_api_message);
3968: RAISE FND_API.g_exc_error;
3969:
3970: END IF;
3971:
3972: IF (p_debug = 'Y') THEN
4077: x_operation_dept => l_operation_dept_id,
4078: x_owning_dept => l_owning_dept_id,
4079: x_maint_cost_cat => l_maint_cost_category);
4080:
4081: IF l_return_status <> FND_API.g_ret_sts_success THEN
4082:
4083: l_api_message := 'Get_MaintCostCat returned error';
4084:
4085: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4084:
4085: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4086: ||TO_CHAR(l_stmt_num)
4087: ||'): ', l_api_message);
4088: RAISE FND_API.g_exc_error;
4089:
4090: END IF;
4091:
4092: l_stmt_num := 145;
4141: p_prog_id => p_prog_id,
4142: p_prog_app_id => p_prog_app_id,
4143: p_login_id => p_login_id);
4144:
4145: IF l_return_status <> FND_API.g_ret_sts_success THEN
4146:
4147: l_api_message := 'insertupdate_eamperbal error';
4148:
4149: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4148:
4149: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4150: ||TO_CHAR(l_stmt_num)
4151: ||'): ', l_api_message);
4152: RAISE FND_API.g_exc_error;
4153:
4154: END IF;
4155:
4156:
4184: END IF;
4185:
4186: Insert_eamBalAcct(
4187: p_api_version => 1.0,
4188: p_init_msg_list => FND_API.G_FALSE,
4189: p_commit => FND_API.G_FALSE,
4190: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
4191: x_return_status => l_return_status,
4192: x_msg_count => l_msg_count,
4185:
4186: Insert_eamBalAcct(
4187: p_api_version => 1.0,
4188: p_init_msg_list => FND_API.G_FALSE,
4189: p_commit => FND_API.G_FALSE,
4190: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
4191: x_return_status => l_return_status,
4192: x_msg_count => l_msg_count,
4193: x_msg_data => l_msg_data,
4186: Insert_eamBalAcct(
4187: p_api_version => 1.0,
4188: p_init_msg_list => FND_API.G_FALSE,
4189: p_commit => FND_API.G_FALSE,
4190: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
4191: x_return_status => l_return_status,
4192: x_msg_count => l_msg_count,
4193: x_msg_data => l_msg_data,
4194: p_period_id => l_acct_period_id,
4211: p_prog_id => p_prog_id,
4212: p_prog_app_id => p_prog_app_id,
4213: p_login_id => p_login_id);
4214:
4215: IF l_return_status <> FND_API.g_ret_sts_success THEN
4216:
4217: l_api_message := 'Insert_eamBalAcct error';
4218: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
4219: ||TO_CHAR(l_stmt_num)
4217: l_api_message := 'Insert_eamBalAcct error';
4218: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
4219: ||TO_CHAR(l_stmt_num)
4220: ||'): ', l_api_message);
4221: RAISE FND_API.g_exc_error;
4222:
4223: END IF;
4224:
4225: ELSE
4351: x_operation_dept => l_operation_dept_id,
4352: x_owning_dept => l_owning_dept_id,
4353: x_maint_cost_cat => l_maint_cost_category);
4354:
4355: IF l_return_status <> FND_API.g_ret_sts_success THEN
4356:
4357: l_api_message := 'Get_MaintCostCat returned error';
4358:
4359: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4358:
4359: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4360: ||TO_CHAR(l_stmt_num)
4361: ||'): ', l_api_message);
4362: RAISE FND_API.g_exc_error;
4363:
4364: END IF;
4365:
4366: l_stmt_num := 165;
4414: p_prog_id => p_prog_id,
4415: p_prog_app_id => p_prog_app_id,
4416: p_login_id => p_login_id);
4417:
4418: IF l_return_status <> FND_API.g_ret_sts_success THEN
4419:
4420: l_api_message := 'insertupdate_eamperbal error';
4421:
4422: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4421:
4422: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4423: ||TO_CHAR(l_stmt_num)
4424: ||'): ', l_api_message);
4425: RAISE FND_API.g_exc_error;
4426:
4427: END IF;
4428:
4429: If c_wedi_rec.wedi_value <> 0 then
4456: END IF;
4457:
4458: Insert_eamBalAcct(
4459: p_api_version => 1.0,
4460: p_init_msg_list => FND_API.G_FALSE,
4461: p_commit => FND_API.G_FALSE,
4462: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
4463: x_return_status => l_return_status,
4464: x_msg_count => l_msg_count,
4457:
4458: Insert_eamBalAcct(
4459: p_api_version => 1.0,
4460: p_init_msg_list => FND_API.G_FALSE,
4461: p_commit => FND_API.G_FALSE,
4462: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
4463: x_return_status => l_return_status,
4464: x_msg_count => l_msg_count,
4465: x_msg_data => l_msg_data,
4458: Insert_eamBalAcct(
4459: p_api_version => 1.0,
4460: p_init_msg_list => FND_API.G_FALSE,
4461: p_commit => FND_API.G_FALSE,
4462: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
4463: x_return_status => l_return_status,
4464: x_msg_count => l_msg_count,
4465: x_msg_data => l_msg_data,
4466: p_period_id => l_acct_period_id,
4483: p_prog_id => p_prog_id,
4484: p_prog_app_id => p_prog_app_id,
4485: p_login_id => p_login_id);
4486:
4487: IF l_return_status <> FND_API.g_ret_sts_success THEN
4488:
4489: l_api_message := 'Insert_eamBalAcct error';
4490: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
4491: ||TO_CHAR(l_stmt_num)
4489: l_api_message := 'Insert_eamBalAcct error';
4490: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
4491: ||TO_CHAR(l_stmt_num)
4492: ||'): ', l_api_message);
4493: RAISE FND_API.g_exc_error;
4494:
4495: END IF;
4496:
4497: Else
4647: x_operation_dept => l_operation_dept_id,
4648: x_owning_dept => l_owning_dept_id,
4649: x_maint_cost_cat => l_maint_cost_category);
4650:
4651: IF l_return_status <> FND_API.g_ret_sts_success THEN
4652:
4653: l_api_message := 'Get_MaintCostCat returned error';
4654:
4655: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4654:
4655: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4656: ||TO_CHAR(l_stmt_num)
4657: ||'): ', l_api_message);
4658: RAISE FND_API.g_exc_error;
4659:
4660: END IF;
4661:
4662: l_stmt_num :=187;
4720: p_prog_id => p_prog_id,
4721: p_prog_app_id => p_prog_app_id,
4722: p_login_id => p_login_id);
4723:
4724: IF l_return_status <> FND_API.g_ret_sts_success THEN
4725:
4726: l_api_message := 'insertupdate_eamperbal error';
4727:
4728: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4727:
4728: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4729: ||TO_CHAR(l_stmt_num)
4730: ||'): ', l_api_message);
4731: RAISE FND_API.g_exc_error;
4732:
4733: END IF;
4734:
4735: If c_pda_rec.pda_value <> 0 then
4762: END IF;
4763:
4764: Insert_eamBalAcct(
4765: p_api_version => 1.0,
4766: p_init_msg_list => FND_API.G_FALSE,
4767: p_commit => FND_API.G_FALSE,
4768: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
4769: x_return_status => l_return_status,
4770: x_msg_count => l_msg_count,
4763:
4764: Insert_eamBalAcct(
4765: p_api_version => 1.0,
4766: p_init_msg_list => FND_API.G_FALSE,
4767: p_commit => FND_API.G_FALSE,
4768: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
4769: x_return_status => l_return_status,
4770: x_msg_count => l_msg_count,
4771: x_msg_data => l_msg_data,
4764: Insert_eamBalAcct(
4765: p_api_version => 1.0,
4766: p_init_msg_list => FND_API.G_FALSE,
4767: p_commit => FND_API.G_FALSE,
4768: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
4769: x_return_status => l_return_status,
4770: x_msg_count => l_msg_count,
4771: x_msg_data => l_msg_data,
4772: p_period_id => l_acct_period_id,
4789: p_prog_id => p_prog_id,
4790: p_prog_app_id => p_prog_app_id,
4791: p_login_id => p_login_id);
4792:
4793: IF l_return_status <> FND_API.g_ret_sts_success THEN
4794:
4795: l_api_message := 'Insert_eamBalAcct error';
4796: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
4797: ||TO_CHAR(l_stmt_num)
4795: l_api_message := 'Insert_eamBalAcct error';
4796: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
4797: ||TO_CHAR(l_stmt_num)
4798: ||'): ', l_api_message);
4799: RAISE FND_API.g_exc_error;
4800:
4801: END IF;
4802: Else
4803: IF (p_debug = 'Y') THEN
4970: ---------------------------------------------------------------------------
4971: -- Standard check of p_commit
4972: ---------------------------------------------------------------------------
4973:
4974: IF FND_API.to_Boolean(p_commit) THEN
4975: COMMIT WORK;
4976: END IF;
4977:
4978: ---------------------------------------------------------------------------
4984: p_data => x_msg_data );
4985:
4986: EXCEPTION
4987:
4988: WHEN fnd_api.g_exc_error THEN
4989: x_return_status := fnd_api.g_ret_sts_error;
4990:
4991: -- Get message count and data
4992: fnd_msg_pub.count_and_get
4985:
4986: EXCEPTION
4987:
4988: WHEN fnd_api.g_exc_error THEN
4989: x_return_status := fnd_api.g_ret_sts_error;
4990:
4991: -- Get message count and data
4992: fnd_msg_pub.count_and_get
4993: ( p_count => x_msg_count
4993: ( p_count => x_msg_count
4994: , p_data => x_msg_data
4995: );
4996: --
4997: WHEN fnd_api.g_exc_unexpected_error THEN
4998: x_return_status := fnd_api.g_ret_sts_unexp_error ;
4999:
5000: -- Get message count and data
5001: fnd_msg_pub.count_and_get
4994: , p_data => x_msg_data
4995: );
4996: --
4997: WHEN fnd_api.g_exc_unexpected_error THEN
4998: x_return_status := fnd_api.g_ret_sts_unexp_error ;
4999:
5000: -- Get message count and data
5001: fnd_msg_pub.count_and_get
5002: ( p_count => x_msg_count
5003: , p_data => x_msg_data
5004: );
5005: --
5006: WHEN OTHERS THEN
5007: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5008: --
5009: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
5010: THEN
5011: fnd_msg_pub.add_exc_msg
5050: -- End of comments
5051:
5052: PROCEDURE Rollup_Cost (
5053: p_api_version IN NUMBER,
5054: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE ,
5055: p_commit IN VARCHAR2 := FND_API.G_FALSE ,
5056: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL ,
5057: x_return_status OUT NOCOPY VARCHAR2 ,
5058: x_msg_count OUT NOCOPY NUMBER ,
5051:
5052: PROCEDURE Rollup_Cost (
5053: p_api_version IN NUMBER,
5054: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE ,
5055: p_commit IN VARCHAR2 := FND_API.G_FALSE ,
5056: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL ,
5057: x_return_status OUT NOCOPY VARCHAR2 ,
5058: x_msg_count OUT NOCOPY NUMBER ,
5059: x_msg_data OUT NOCOPY VARCHAR2 ,
5052: PROCEDURE Rollup_Cost (
5053: p_api_version IN NUMBER,
5054: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE ,
5055: p_commit IN VARCHAR2 := FND_API.G_FALSE ,
5056: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL ,
5057: x_return_status OUT NOCOPY VARCHAR2 ,
5058: x_msg_count OUT NOCOPY NUMBER ,
5059: x_msg_data OUT NOCOPY VARCHAR2 ,
5060:
5087: ------------------------------------------------
5088: -- Standard call to check for API compatibility
5089: ------------------------------------------------
5090: l_statement := 10;
5091: IF not fnd_api.compatible_api_call (
5092: l_api_version,
5093: p_api_version,
5094: l_api_name,
5095: G_PKG_NAME ) then
5092: l_api_version,
5093: p_api_version,
5094: l_api_name,
5095: G_PKG_NAME ) then
5096: RAISE fnd_api.G_exc_unexpected_error;
5097: END IF;
5098:
5099: ------------------------------------------------------------
5100: -- Initialize message list if p_init_msg_list is set to TRUE
5099: ------------------------------------------------------------
5100: -- Initialize message list if p_init_msg_list is set to TRUE
5101: -------------------------------------------------------------
5102: l_statement := 20;
5103: IF fnd_api.to_Boolean(p_init_msg_list) then
5104: fnd_msg_pub.initialize;
5105: END IF;
5106:
5107: -------------------------------------------------------------
5107: -------------------------------------------------------------
5108: -- Initialize API return status to Success
5109: -------------------------------------------------------------
5110: l_statement := 30;
5111: x_return_status := fnd_api.g_ret_sts_success;
5112:
5113: ------------------------------------------------
5114: -- find out object_id from MTL_SERIAL_NUMBERS
5115: -- using inventory_item_id
5406: fnd_msg_pub.add_exc_msg
5407: ( G_PKG_NAME,
5408: l_api_name,
5409: l_api_message );
5410: RAISE fnd_api.g_exc_error;
5411: END IF;
5412:
5413: ---------------------------------------------------------------------------
5414: -- Standard check of p_commit
5413: ---------------------------------------------------------------------------
5414: -- Standard check of p_commit
5415: ---------------------------------------------------------------------------
5416: l_statement := 110;
5417: IF FND_API.to_Boolean(p_commit) THEN
5418: COMMIT WORK;
5419: END IF;
5420:
5421: ---------------------------------------------------------------------------
5426: p_data => x_msg_data );
5427:
5428:
5429: EXCEPTION
5430: WHEN fnd_api.g_exc_error then
5431: ROLLBACK TO Rollup_Cost_PUB;
5432: x_return_status := fnd_api.g_ret_sts_error;
5433: fnd_msg_pub.count_and_get ( p_count => x_msg_count,
5434: p_data => x_msg_data );
5428:
5429: EXCEPTION
5430: WHEN fnd_api.g_exc_error then
5431: ROLLBACK TO Rollup_Cost_PUB;
5432: x_return_status := fnd_api.g_ret_sts_error;
5433: fnd_msg_pub.count_and_get ( p_count => x_msg_count,
5434: p_data => x_msg_data );
5435:
5436: WHEN fnd_api.g_exc_unexpected_error then
5432: x_return_status := fnd_api.g_ret_sts_error;
5433: fnd_msg_pub.count_and_get ( p_count => x_msg_count,
5434: p_data => x_msg_data );
5435:
5436: WHEN fnd_api.g_exc_unexpected_error then
5437: ROLLBACK TO Rollup_Cost_PUB;
5438: x_return_status := fnd_api.g_ret_sts_unexp_error;
5439: fnd_msg_pub.count_and_get ( p_count => x_msg_count,
5440: p_data => x_msg_data );
5434: p_data => x_msg_data );
5435:
5436: WHEN fnd_api.g_exc_unexpected_error then
5437: ROLLBACK TO Rollup_Cost_PUB;
5438: x_return_status := fnd_api.g_ret_sts_unexp_error;
5439: fnd_msg_pub.count_and_get ( p_count => x_msg_count,
5440: p_data => x_msg_data );
5441:
5442: WHEN OTHERS THEN
5440: p_data => x_msg_data );
5441:
5442: WHEN OTHERS THEN
5443: ROLLBACK TO Rollup_Cost_PUB;
5444: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5445:
5446: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) then
5447: fnd_msg_pub.add_exc_msg
5448: ( G_PKG_NAME,l_api_name || ' : Statement - ' || to_char(l_statement));
5473: ----------------------------------------------------------------------------
5474: -- End of comments
5475: PROCEDURE Purge_Rollup_Cost (
5476: p_api_version IN NUMBER,
5477: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE ,
5478: p_commit IN VARCHAR2 := FND_API.G_FALSE ,
5479: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL ,
5480: x_return_status OUT NOCOPY VARCHAR2 ,
5481: x_msg_count OUT NOCOPY NUMBER ,
5474: -- End of comments
5475: PROCEDURE Purge_Rollup_Cost (
5476: p_api_version IN NUMBER,
5477: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE ,
5478: p_commit IN VARCHAR2 := FND_API.G_FALSE ,
5479: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL ,
5480: x_return_status OUT NOCOPY VARCHAR2 ,
5481: x_msg_count OUT NOCOPY NUMBER ,
5482: x_msg_data OUT NOCOPY VARCHAR2 ,
5475: PROCEDURE Purge_Rollup_Cost (
5476: p_api_version IN NUMBER,
5477: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE ,
5478: p_commit IN VARCHAR2 := FND_API.G_FALSE ,
5479: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL ,
5480: x_return_status OUT NOCOPY VARCHAR2 ,
5481: x_msg_count OUT NOCOPY NUMBER ,
5482: x_msg_data OUT NOCOPY VARCHAR2 ,
5483:
5500: ------------------------------------------------
5501: -- Standard call to check for API compatibility
5502: ------------------------------------------------
5503: l_statement := 10;
5504: IF not fnd_api.compatible_api_call (
5505: l_api_version,
5506: p_api_version,
5507: l_api_name,
5508: G_PKG_NAME ) then
5505: l_api_version,
5506: p_api_version,
5507: l_api_name,
5508: G_PKG_NAME ) then
5509: RAISE fnd_api.G_exc_unexpected_error;
5510: END IF;
5511:
5512: ------------------------------------------------------------
5513: -- Initialize message list if p_init_msg_list is set to TRUE
5512: ------------------------------------------------------------
5513: -- Initialize message list if p_init_msg_list is set to TRUE
5514: -------------------------------------------------------------
5515: l_statement := 20;
5516: IF fnd_api.to_Boolean(p_init_msg_list) then
5517: fnd_msg_pub.initialize;
5518: END IF;
5519:
5520: -------------------------------------------------------------
5520: -------------------------------------------------------------
5521: -- Initialize API return status to Success
5522: -------------------------------------------------------------
5523: l_statement := 30;
5524: x_return_status := fnd_api.g_ret_sts_success;
5525:
5526: -------------------------------------------------------------
5527: -- Purge cst_am_hierarchy_snapshot
5528: -------------------------------------------------------------
5540: ---------------------------------------------------------------------------
5541: -- Standard check of p_commit
5542: ---------------------------------------------------------------------------
5543: l_statement := 60;
5544: IF FND_API.to_Boolean(p_commit) THEN
5545: COMMIT WORK;
5546: END IF;
5547:
5548: ---------------------------------------------------------------------------
5554:
5555:
5556: EXCEPTION
5557:
5558: WHEN fnd_api.g_exc_error then
5559: ROLLBACK TO Purge_Rollup_Cost_PUB;
5560: x_return_status := fnd_api.g_ret_sts_error;
5561: fnd_msg_pub.count_and_get ( p_count => x_msg_count,
5562: p_data => x_msg_data );
5556: EXCEPTION
5557:
5558: WHEN fnd_api.g_exc_error then
5559: ROLLBACK TO Purge_Rollup_Cost_PUB;
5560: x_return_status := fnd_api.g_ret_sts_error;
5561: fnd_msg_pub.count_and_get ( p_count => x_msg_count,
5562: p_data => x_msg_data );
5563:
5564: WHEN fnd_api.g_exc_unexpected_error then
5560: x_return_status := fnd_api.g_ret_sts_error;
5561: fnd_msg_pub.count_and_get ( p_count => x_msg_count,
5562: p_data => x_msg_data );
5563:
5564: WHEN fnd_api.g_exc_unexpected_error then
5565: ROLLBACK TO Purge_Rollup_Cost_PUB;
5566: x_return_status := fnd_api.g_ret_sts_unexp_error;
5567: fnd_msg_pub.count_and_get ( p_count => x_msg_count,
5568: p_data => x_msg_data );
5562: p_data => x_msg_data );
5563:
5564: WHEN fnd_api.g_exc_unexpected_error then
5565: ROLLBACK TO Purge_Rollup_Cost_PUB;
5566: x_return_status := fnd_api.g_ret_sts_unexp_error;
5567: fnd_msg_pub.count_and_get ( p_count => x_msg_count,
5568: p_data => x_msg_data );
5569:
5570: WHEN OTHERS THEN
5568: p_data => x_msg_data );
5569:
5570: WHEN OTHERS THEN
5571: ROLLBACK TO Purge_Rollup_Cost_PUB;
5572: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5573: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) then
5574: fnd_msg_pub.add_exc_msg
5575: ( G_PKG_NAME,l_api_name || ' : Statement - ' || to_char(l_statement));
5576: END IF;
5597: ----------------------------------------------------------------------------
5598:
5599: PROCEDURE check_if_direct_item (
5600: p_api_version IN NUMBER,
5601: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
5602: p_commit IN VARCHAR2 := FND_API.G_FALSE,
5603: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
5604:
5605: p_interface_txn_id IN NUMBER,
5598:
5599: PROCEDURE check_if_direct_item (
5600: p_api_version IN NUMBER,
5601: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
5602: p_commit IN VARCHAR2 := FND_API.G_FALSE,
5603: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
5604:
5605: p_interface_txn_id IN NUMBER,
5606:
5599: PROCEDURE check_if_direct_item (
5600: p_api_version IN NUMBER,
5601: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
5602: p_commit IN VARCHAR2 := FND_API.G_FALSE,
5603: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
5604:
5605: p_interface_txn_id IN NUMBER,
5606:
5607: x_direct_item_flag OUT NOCOPY NUMBER,
5612:
5613: l_api_name CONSTANT VARCHAR2(30) := 'check_if_direct_item';
5614: l_api_version CONSTANT NUMBER := 1.0;
5615:
5616: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
5617: l_msg_count NUMBER := 0;
5618: l_msg_data VARCHAR2(8000);
5619: l_stmt_num NUMBER := 0;
5620:
5639: FND_FILE.PUT_LINE(fnd_file.log,'Check if direct item');
5640: end if;
5641:
5642: -- Standard call to check for call compatibility
5643: IF NOT FND_API.Compatible_API_Call (
5644: l_api_version,
5645: p_api_version,
5646: l_api_name,
5647: G_PKG_NAME ) THEN
5644: l_api_version,
5645: p_api_version,
5646: l_api_name,
5647: G_PKG_NAME ) THEN
5648: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5649: END IF;
5650:
5651: -- Initialize message list if p_init_msg_list is set to TRUE
5652: IF FND_API.to_Boolean(p_init_msg_list) THEN
5648: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5649: END IF;
5650:
5651: -- Initialize message list if p_init_msg_list is set to TRUE
5652: IF FND_API.to_Boolean(p_init_msg_list) THEN
5653: FND_MSG_PUB.initialize;
5654: END IF;
5655:
5656: -- Initialize API return status to success
5654: END IF;
5655:
5656: -- Initialize API return status to success
5657: l_stmt_num := 0;
5658: x_return_status := FND_API.G_RET_STS_SUCCESS;
5659: x_direct_item_flag := 0;
5660:
5661: -- Validate IN parameters
5662: l_stmt_num := 20;
5660:
5661: -- Validate IN parameters
5662: l_stmt_num := 20;
5663: IF (p_interface_txn_id IS NULL) THEN
5664: RAISE fnd_api.g_exc_error;
5665: END IF;
5666:
5667: -- Due to changes in Bug #1926731, p_interface_txn_id now contains the rcv_transaction_id
5668: -- instead of interface_transaction_id. Get the interface_transaction_id from rcv_transactions.
5677: FROM rcv_transactions
5678: WHERE transaction_id = p_interface_txn_id;
5679:
5680: IF (l_interface_txn_id IS NULL) THEN
5681: RAISE fnd_api.g_exc_error;
5682: END IF;
5683:
5684: if(l_debug = 'Y') then
5685: fnd_file.put_line(fnd_file.log,'Interface Txn ID : '||l_interface_txn_id);
5761: fnd_file.put_line(fnd_file.log,'Direct item flag : ' || to_char(x_direct_item_flag));
5762: end if;
5763:
5764: -- Standard check of p_commit
5765: IF FND_API.to_Boolean(p_commit) THEN
5766: COMMIT WORK;
5767: END IF;
5768:
5769: -- Standard Call to get message count and if count = 1, get message info
5774: -- Print messages to log file
5775:
5776:
5777: EXCEPTION
5778: WHEN fnd_api.g_exc_error THEN
5779: ROLLBACK TO check_if_direct_item_PUB;
5780: x_return_status := fnd_api.g_ret_sts_error;
5781:
5782: -- Get message count and data
5776:
5777: EXCEPTION
5778: WHEN fnd_api.g_exc_error THEN
5779: ROLLBACK TO check_if_direct_item_PUB;
5780: x_return_status := fnd_api.g_ret_sts_error;
5781:
5782: -- Get message count and data
5783: fnd_msg_pub.count_and_get
5784: ( p_count => x_msg_count
5784: ( p_count => x_msg_count
5785: , p_data => x_msg_data
5786: );
5787:
5788: WHEN fnd_api.g_exc_unexpected_error THEN
5789: ROLLBACK TO check_if_direct_item_PUB;
5790: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5791:
5792: -- Get message count and data
5786: );
5787:
5788: WHEN fnd_api.g_exc_unexpected_error THEN
5789: ROLLBACK TO check_if_direct_item_PUB;
5790: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5791:
5792: -- Get message count and data
5793: fnd_msg_pub.count_and_get
5794: ( p_count => x_msg_count
5796: );
5797: --
5798: WHEN OTHERS THEN
5799: ROLLBACK TO check_if_direct_item_PUB;
5800: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5801: --
5802: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
5803: THEN
5804: fnd_msg_pub.add_exc_msg
5829: ----------------------------------------------------------------------------
5830:
5831: PROCEDURE process_direct_item_txn (
5832: p_api_version IN NUMBER,
5833: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
5834: p_commit IN VARCHAR2 := FND_API.G_FALSE,
5835: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
5836:
5837: p_directItem_rec IN WIP_Transaction_PUB.Res_Rec_Type,
5830:
5831: PROCEDURE process_direct_item_txn (
5832: p_api_version IN NUMBER,
5833: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
5834: p_commit IN VARCHAR2 := FND_API.G_FALSE,
5835: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
5836:
5837: p_directItem_rec IN WIP_Transaction_PUB.Res_Rec_Type,
5838:
5831: PROCEDURE process_direct_item_txn (
5832: p_api_version IN NUMBER,
5833: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
5834: p_commit IN VARCHAR2 := FND_API.G_FALSE,
5835: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
5836:
5837: p_directItem_rec IN WIP_Transaction_PUB.Res_Rec_Type,
5838:
5839: x_directItem_rec IN OUT NOCOPY WIP_Transaction_PUB.Res_Rec_Type,
5844:
5845: l_api_name CONSTANT VARCHAR2(30) := 'process_direct_item_txn';
5846: l_api_version CONSTANT NUMBER := 1.0;
5847:
5848: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
5849: l_msg_count NUMBER := 0;
5850: l_msg_data VARCHAR2(8000);
5851: l_stmt_num NUMBER := 0;
5852:
5892:
5893: l_debug := fnd_profile.value('MRP_DEBUG');
5894:
5895: -- Standard call to check for call compatibility
5896: IF NOT FND_API.Compatible_API_Call (
5897: l_api_version,
5898: p_api_version,
5899: l_api_name,
5900: G_PKG_NAME ) THEN
5897: l_api_version,
5898: p_api_version,
5899: l_api_name,
5900: G_PKG_NAME ) THEN
5901: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5902: END IF;
5903:
5904: -- Initialize message list if p_init_msg_list is set to TRUE
5905: IF FND_API.to_Boolean(p_init_msg_list) THEN
5901: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5902: END IF;
5903:
5904: -- Initialize message list if p_init_msg_list is set to TRUE
5905: IF FND_API.to_Boolean(p_init_msg_list) THEN
5906: FND_MSG_PUB.initialize;
5907: END IF;
5908:
5909: -- Initialize API return status to success
5907: END IF;
5908:
5909: -- Initialize API return status to success
5910: l_stmt_num := 10;
5911: x_return_status := FND_API.G_RET_STS_SUCCESS;
5912:
5913: -- Initialize direct item record
5914: l_stmt_num := 20;
5915: l_directItem_rec := p_directItem_rec;
5932: FROM rcv_transactions
5933: WHERE transaction_id = l_txn_id;
5934:
5935: IF (l_interface_txn_id IS NULL) THEN
5936: RAISE fnd_api.g_exc_error;
5937: END IF;
5938:
5939: -- Bug #2144236. Interface_txn_id was getting inserted into WCTI
5940: -- instead of rcv_transaction_id
6329: x_msg_count => l_msg_count,
6330: x_msg_data => l_msg_data
6331: );
6332:
6333: IF l_return_status <> FND_API.g_ret_sts_success THEN
6334: FND_FILE.put_line(FND_FILE.log, l_msg_data);
6335: l_api_message := 'WIP_EAM_RESOURCE_TRANSACTION.WIP_EAMRCVDIRECTITEM_HOOK returned error';
6336: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
6337: FND_MESSAGE.set_token('TEXT', l_api_message);
6335: l_api_message := 'WIP_EAM_RESOURCE_TRANSACTION.WIP_EAMRCVDIRECTITEM_HOOK returned error';
6336: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
6337: FND_MESSAGE.set_token('TEXT', l_api_message);
6338: FND_MSG_pub.add;
6339: RAISE FND_API.g_exc_error;
6340: END IF;
6341:
6342: -- Standard check of p_commit
6343: IF FND_API.to_Boolean(p_commit) THEN
6339: RAISE FND_API.g_exc_error;
6340: END IF;
6341:
6342: -- Standard check of p_commit
6343: IF FND_API.to_Boolean(p_commit) THEN
6344: COMMIT WORK;
6345: END IF;
6346:
6347: -- Standard Call to get message count and if count = 1, get message info
6352: -- Print messages to log file
6353:
6354:
6355: EXCEPTION
6356: WHEN fnd_api.g_exc_error THEN
6357: ROLLBACK TO process_direct_item_txn_PUB;
6358: x_return_status := fnd_api.g_ret_sts_error;
6359:
6360: -- Get message count and data
6354:
6355: EXCEPTION
6356: WHEN fnd_api.g_exc_error THEN
6357: ROLLBACK TO process_direct_item_txn_PUB;
6358: x_return_status := fnd_api.g_ret_sts_error;
6359:
6360: -- Get message count and data
6361: fnd_msg_pub.count_and_get
6362: ( p_count => x_msg_count
6362: ( p_count => x_msg_count
6363: , p_data => x_msg_data
6364: );
6365:
6366: WHEN fnd_api.g_exc_unexpected_error THEN
6367: ROLLBACK TO process_direct_item_txn_PUB;
6368: x_return_status := fnd_api.g_ret_sts_unexp_error ;
6369:
6370: -- Get message count and data
6364: );
6365:
6366: WHEN fnd_api.g_exc_unexpected_error THEN
6367: ROLLBACK TO process_direct_item_txn_PUB;
6368: x_return_status := fnd_api.g_ret_sts_unexp_error ;
6369:
6370: -- Get message count and data
6371: fnd_msg_pub.count_and_get
6372: ( p_count => x_msg_count
6374: );
6375: --
6376: WHEN OTHERS THEN
6377: ROLLBACK TO process_direct_item_txn_PUB;
6378: x_return_status := fnd_api.g_ret_sts_unexp_error ;
6379: --
6380: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
6381: THEN
6382: fnd_msg_pub.add_exc_msg
6410: -- 05/01/01 Anitha Dixit Created --
6411: ----------------------------------------------------------------------------
6412: PROCEDURE cost_direct_item_txn (
6413: p_api_version IN NUMBER,
6414: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
6415: p_commit IN VARCHAR2 := FND_API.G_FALSE,
6416: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
6417:
6418: p_group_id IN NUMBER,
6411: ----------------------------------------------------------------------------
6412: PROCEDURE cost_direct_item_txn (
6413: p_api_version IN NUMBER,
6414: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
6415: p_commit IN VARCHAR2 := FND_API.G_FALSE,
6416: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
6417:
6418: p_group_id IN NUMBER,
6419: p_prg_appl_id IN NUMBER,
6412: PROCEDURE cost_direct_item_txn (
6413: p_api_version IN NUMBER,
6414: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
6415: p_commit IN VARCHAR2 := FND_API.G_FALSE,
6416: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
6417:
6418: p_group_id IN NUMBER,
6419: p_prg_appl_id IN NUMBER,
6420: p_prg_id IN NUMBER,
6429:
6430: l_api_name CONSTANT VARCHAR2(30) := 'cost_direct_item_txn';
6431: l_api_version CONSTANT NUMBER := 1.0;
6432:
6433: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
6434: l_msg_count NUMBER := 0;
6435: l_msg_data VARCHAR2(8000);
6436: l_stmt_num NUMBER := 0;
6437:
6477:
6478: l_debug := fnd_profile.value('MRP_DEBUG');
6479:
6480: -- Standard call to check for call compatibility
6481: IF NOT FND_API.Compatible_API_Call (
6482: l_api_version,
6483: p_api_version,
6484: l_api_name,
6485: G_PKG_NAME ) THEN
6482: l_api_version,
6483: p_api_version,
6484: l_api_name,
6485: G_PKG_NAME ) THEN
6486: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6487: END IF;
6488:
6489: -- Initialize message list if p_init_msg_list is set to TRUE
6490: IF FND_API.to_Boolean(p_init_msg_list) THEN
6486: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6487: END IF;
6488:
6489: -- Initialize message list if p_init_msg_list is set to TRUE
6490: IF FND_API.to_Boolean(p_init_msg_list) THEN
6491: FND_MSG_PUB.initialize;
6492: END IF;
6493:
6494: -- Initialize API return status to success
6492: END IF;
6493:
6494: -- Initialize API return status to success
6495: l_stmt_num := 10;
6496: x_return_status := FND_API.G_RET_STS_SUCCESS;
6497:
6498: l_stmt_num := 50;
6499: -- Loop through all direct item transactions
6500: FOR direct_item_txn_rec IN direct_item_txn_cur LOOP
6584: x_msg_count => x_msg_count,
6585: x_msg_data => x_msg_data
6586: );
6587:
6588: if (x_return_status <> fnd_api.g_ret_sts_success) then
6589: raise fnd_api.g_exc_unexpected_error;
6590: end if;
6591:
6592: l_stmt_num := 90;
6585: x_msg_data => x_msg_data
6586: );
6587:
6588: if (x_return_status <> fnd_api.g_ret_sts_success) then
6589: raise fnd_api.g_exc_unexpected_error;
6590: end if;
6591:
6592: l_stmt_num := 90;
6593: -- Obtain material account for the job
6603: p_mnt_or_mfg => 2,
6604: x_cost_element_id => l_cost_element
6605: );
6606:
6607: if (l_return_status <> fnd_api.g_ret_sts_success) then
6608: FND_FILE.put_line(FND_FILE.log, x_msg_data);
6609: l_api_message := 'get_CostEle_for_DirectItem returned unexpected error';
6610: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
6611: FND_MESSAGE.set_token('TEXT', l_api_message);
6609: l_api_message := 'get_CostEle_for_DirectItem returned unexpected error';
6610: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
6611: FND_MESSAGE.set_token('TEXT', l_api_message);
6612: FND_MSG_pub.add;
6613: raise fnd_api.g_exc_unexpected_error;
6614: end if;
6615:
6616: if (l_debug = 'Y') then
6617: FND_FILE.PUT_LINE(FND_FILE.LOG, 'mfg cost_element_id: '|| to_char(l_cost_element));
6648: x_msg_count => x_msg_count,
6649: x_msg_data => x_msg_data
6650: );
6651:
6652: if (x_return_status <> fnd_api.g_ret_sts_success) then
6653: raise fnd_api.g_exc_unexpected_error;
6654: end if;
6655:
6656:
6649: x_msg_data => x_msg_data
6650: );
6651:
6652: if (x_return_status <> fnd_api.g_ret_sts_success) then
6653: raise fnd_api.g_exc_unexpected_error;
6654: end if;
6655:
6656:
6657: -- Update wip period balances , pl_material_in
6674: x_msg_count => x_msg_count,
6675: x_msg_data => x_msg_data
6676: );
6677:
6678: if (x_return_status <> fnd_api.g_ret_sts_success) then
6679: raise fnd_api.g_exc_unexpected_error;
6680: end if;
6681:
6682: -- update wip_eam_asset_per_balances material cost
6675: x_msg_data => x_msg_data
6676: );
6677:
6678: if (x_return_status <> fnd_api.g_ret_sts_success) then
6679: raise fnd_api.g_exc_unexpected_error;
6680: end if;
6681:
6682: -- update wip_eam_asset_per_balances material cost
6683: l_stmt_num := 120;
6707: p_txn_date => direct_item_txn_rec.txn_date,
6708: p_txn_id => direct_item_txn_rec.transaction_id
6709: );
6710:
6711: if (x_return_status <> fnd_api.g_ret_sts_success) then
6712: raise fnd_api.g_exc_unexpected_error;
6713: end if;
6714: END LOOP; /* for transactions */
6715:
6708: p_txn_id => direct_item_txn_rec.transaction_id
6709: );
6710:
6711: if (x_return_status <> fnd_api.g_ret_sts_success) then
6712: raise fnd_api.g_exc_unexpected_error;
6713: end if;
6714: END LOOP; /* for transactions */
6715:
6716: /* insert_direct_item_txn */
6730: x_msg_count => x_msg_count,
6731: x_msg_data => x_msg_data
6732: );
6733:
6734: if (x_return_status <> fnd_api.g_ret_sts_success) then
6735: raise fnd_api.g_exc_unexpected_error;
6736: end if;
6737:
6738: l_stmt_num := 135;
6731: x_msg_data => x_msg_data
6732: );
6733:
6734: if (x_return_status <> fnd_api.g_ret_sts_success) then
6735: raise fnd_api.g_exc_unexpected_error;
6736: end if;
6737:
6738: l_stmt_num := 135;
6739: /* Create the Events for the transactions in the WCTI group */
6739: /* Create the Events for the transactions in the WCTI group */
6740:
6741: CST_XLA_PVT.CreateBulk_WIPXLAEvent(
6742: p_api_version => 1.0,
6743: p_init_msg_list => FND_API.G_FALSE,
6744: p_commit => FND_API.G_FALSE,
6745: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
6746: x_return_status => l_return_status,
6747: x_msg_count => x_msg_count,
6740:
6741: CST_XLA_PVT.CreateBulk_WIPXLAEvent(
6742: p_api_version => 1.0,
6743: p_init_msg_list => FND_API.G_FALSE,
6744: p_commit => FND_API.G_FALSE,
6745: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
6746: x_return_status => l_return_status,
6747: x_msg_count => x_msg_count,
6748: x_msg_data => x_msg_data,
6741: CST_XLA_PVT.CreateBulk_WIPXLAEvent(
6742: p_api_version => 1.0,
6743: p_init_msg_list => FND_API.G_FALSE,
6744: p_commit => FND_API.G_FALSE,
6745: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
6746: x_return_status => l_return_status,
6747: x_msg_count => x_msg_count,
6748: x_msg_data => x_msg_data,
6749: p_wcti_group_id => p_group_id,
6748: x_msg_data => x_msg_data,
6749: p_wcti_group_id => p_group_id,
6750: p_organization_id => l_organization_id );
6751:
6752: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
6753: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6754: END IF;
6755:
6756: l_stmt_num := 140;
6749: p_wcti_group_id => p_group_id,
6750: p_organization_id => l_organization_id );
6751:
6752: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
6753: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6754: END IF;
6755:
6756: l_stmt_num := 140;
6757: if (l_debug = 'Y') then
6761: where group_id = p_group_id
6762: and process_status = 2;
6763:
6764: -- Standard check of p_commit
6765: IF FND_API.to_Boolean(p_commit) THEN
6766: COMMIT WORK;
6767: END IF;
6768:
6769: -- Standard Call to get message count and if count = 1, get message info
6774: -- Print messages to log file
6775:
6776:
6777: EXCEPTION
6778: WHEN fnd_api.g_exc_error THEN
6779: ROLLBACK TO cost_direct_item_txn_PUB;
6780: x_return_status := fnd_api.g_ret_sts_error;
6781:
6782: -- Get message count and data
6776:
6777: EXCEPTION
6778: WHEN fnd_api.g_exc_error THEN
6779: ROLLBACK TO cost_direct_item_txn_PUB;
6780: x_return_status := fnd_api.g_ret_sts_error;
6781:
6782: -- Get message count and data
6783: fnd_msg_pub.count_and_get
6784: ( p_count => x_msg_count
6784: ( p_count => x_msg_count
6785: , p_data => x_msg_data
6786: );
6787:
6788: WHEN fnd_api.g_exc_unexpected_error THEN
6789: ROLLBACK TO cost_direct_item_txn_PUB;
6790: x_return_status := fnd_api.g_ret_sts_unexp_error ;
6791:
6792: -- Get message count and data
6786: );
6787:
6788: WHEN fnd_api.g_exc_unexpected_error THEN
6789: ROLLBACK TO cost_direct_item_txn_PUB;
6790: x_return_status := fnd_api.g_ret_sts_unexp_error ;
6791:
6792: -- Get message count and data
6793: fnd_msg_pub.count_and_get
6794: ( p_count => x_msg_count
6796: );
6797: --
6798: WHEN OTHERS THEN
6799: ROLLBACK TO cost_direct_item_txn_PUB;
6800: x_return_status := fnd_api.g_ret_sts_unexp_error ;
6801: fnd_file.put_line(fnd_file.log,'CST_eamCost_PUB.cost_direct_item_txn: Statement(' || to_char(l_stmt_num) || '): ' || substr(SQLERRM,1,240));
6802: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
6803: THEN
6804: fnd_msg_pub.add_exc_msg
6832: ----------------------------------------------------------------------------
6833:
6834: PROCEDURE insert_direct_item_distr (
6835: p_api_version IN NUMBER,
6836: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
6837: p_commit IN VARCHAR2 := FND_API.G_FALSE,
6838: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
6839:
6840: p_txn_id IN NUMBER,
6833:
6834: PROCEDURE insert_direct_item_distr (
6835: p_api_version IN NUMBER,
6836: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
6837: p_commit IN VARCHAR2 := FND_API.G_FALSE,
6838: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
6839:
6840: p_txn_id IN NUMBER,
6841: p_ref_acct IN NUMBER,
6834: PROCEDURE insert_direct_item_distr (
6835: p_api_version IN NUMBER,
6836: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
6837: p_commit IN VARCHAR2 := FND_API.G_FALSE,
6838: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
6839:
6840: p_txn_id IN NUMBER,
6841: p_ref_acct IN NUMBER,
6842: p_txn_value IN NUMBER,
6856:
6857: l_api_name CONSTANT VARCHAR2(30) := 'insert_direct_item_distr';
6858: l_api_version CONSTANT NUMBER := 1.0;
6859:
6860: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
6861: l_msg_count NUMBER := 0;
6862: l_msg_data VARCHAR2(8000);
6863: l_stmt_num NUMBER := 0;
6864:
6879:
6880: l_debug := fnd_profile.value('MRP_DEBUG');
6881:
6882: -- Standard call to check for call compatibility
6883: IF NOT FND_API.Compatible_API_Call (
6884: l_api_version,
6885: p_api_version,
6886: l_api_name,
6887: G_PKG_NAME ) THEN
6884: l_api_version,
6885: p_api_version,
6886: l_api_name,
6887: G_PKG_NAME ) THEN
6888: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6889: END IF;
6890:
6891: -- Initialize message list if p_init_msg_list is set to TRUE
6892: IF FND_API.to_Boolean(p_init_msg_list) THEN
6888: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6889: END IF;
6890:
6891: -- Initialize message list if p_init_msg_list is set to TRUE
6892: IF FND_API.to_Boolean(p_init_msg_list) THEN
6893: FND_MSG_PUB.initialize;
6894: END IF;
6895:
6896: -- Initialize API return status to success
6894: END IF;
6895:
6896: -- Initialize API return status to success
6897: l_stmt_num := 10;
6898: x_return_status := FND_API.G_RET_STS_SUCCESS;
6899:
6900:
6901: -- Verify account
6902: l_stmt_num := 20;
6900:
6901: -- Verify account
6902: l_stmt_num := 20;
6903: if (p_ref_acct = -1) then
6904: RAISE fnd_api.g_exc_error;
6905: end if;
6906:
6907: -- Get transaction details
6908: l_stmt_num := 30;
6976: p_mnt_or_mfg => 2,
6977: x_cost_element_id => l_cost_element
6978: );
6979:
6980: if (l_return_status <> fnd_api.g_ret_sts_success) then
6981: FND_FILE.put_line(FND_FILE.log, x_msg_data);
6982: l_api_message := 'get_CostEle_for_DirectItem returned unexpected error';
6983: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
6984: FND_MESSAGE.set_token('TEXT', l_api_message);
6982: l_api_message := 'get_CostEle_for_DirectItem returned unexpected error';
6983: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
6984: FND_MESSAGE.set_token('TEXT', l_api_message);
6985: FND_MSG_pub.add;
6986: raise fnd_api.g_exc_unexpected_error;
6987: end if;
6988:
6989: if (l_debug = 'Y') then
6990: FND_FILE.PUT_LINE(FND_FILE.LOG,'mfg cost_element_id: '|| to_char(l_cost_element));
7048: FROM wip_cost_txn_interface wcti
7049: WHERE wcti.transaction_id = p_txn_id;
7050:
7051: -- Standard check of p_commit
7052: IF FND_API.to_Boolean(p_commit) THEN
7053: COMMIT WORK;
7054: END IF;
7055:
7056: -- Standard Call to get message count and if count = 1, get message info
7061: -- Print messages to log file
7062:
7063:
7064: EXCEPTION
7065: WHEN fnd_api.g_exc_error THEN
7066: ROLLBACK TO insert_direct_item_distr_PUB;
7067: x_return_status := fnd_api.g_ret_sts_error;
7068:
7069: -- Get message count and data
7063:
7064: EXCEPTION
7065: WHEN fnd_api.g_exc_error THEN
7066: ROLLBACK TO insert_direct_item_distr_PUB;
7067: x_return_status := fnd_api.g_ret_sts_error;
7068:
7069: -- Get message count and data
7070: fnd_msg_pub.count_and_get
7071: ( p_count => x_msg_count
7071: ( p_count => x_msg_count
7072: , p_data => x_msg_data
7073: );
7074:
7075: WHEN fnd_api.g_exc_unexpected_error THEN
7076: ROLLBACK TO insert_direct_item_distr_PUB;
7077: x_return_status := fnd_api.g_ret_sts_unexp_error ;
7078:
7079: -- Get message count and data
7073: );
7074:
7075: WHEN fnd_api.g_exc_unexpected_error THEN
7076: ROLLBACK TO insert_direct_item_distr_PUB;
7077: x_return_status := fnd_api.g_ret_sts_unexp_error ;
7078:
7079: -- Get message count and data
7080: fnd_msg_pub.count_and_get
7081: ( p_count => x_msg_count
7083: );
7084: --
7085: WHEN OTHERS THEN
7086: ROLLBACK TO insert_direct_item_distr_PUB;
7087: x_return_status := fnd_api.g_ret_sts_unexp_error ;
7088: fnd_file.put_line(fnd_file.log,'CST_eamCost_PUB.insert_direct_item_distr(' || to_char(l_stmt_num) || '): ' || substr(SQLERRM,1,240));
7089: --
7090: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
7091: THEN
7118: -- 07/18/01 Anitha Dixit Created --
7119: ----------------------------------------------------------------------------
7120: PROCEDURE update_wip_period_balances (
7121: p_api_version IN NUMBER,
7122: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
7123: p_commit IN VARCHAR2 := FND_API.G_FALSE,
7124: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
7125:
7126: p_wip_entity_id IN NUMBER,
7119: ----------------------------------------------------------------------------
7120: PROCEDURE update_wip_period_balances (
7121: p_api_version IN NUMBER,
7122: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
7123: p_commit IN VARCHAR2 := FND_API.G_FALSE,
7124: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
7125:
7126: p_wip_entity_id IN NUMBER,
7127: p_acct_period_id IN NUMBER,
7120: PROCEDURE update_wip_period_balances (
7121: p_api_version IN NUMBER,
7122: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
7123: p_commit IN VARCHAR2 := FND_API.G_FALSE,
7124: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
7125:
7126: p_wip_entity_id IN NUMBER,
7127: p_acct_period_id IN NUMBER,
7128: p_txn_id IN NUMBER,
7158: ------------------------------------------------
7159: -- Standard call to check for API compatibility
7160: ------------------------------------------------
7161: l_statement := 10;
7162: IF not fnd_api.compatible_api_call (
7163: l_api_version,
7164: p_api_version,
7165: l_api_name,
7166: G_PKG_NAME ) then
7163: l_api_version,
7164: p_api_version,
7165: l_api_name,
7166: G_PKG_NAME ) then
7167: RAISE fnd_api.G_exc_unexpected_error;
7168: END IF;
7169:
7170: ------------------------------------------------------------
7171: -- Initialize message list if p_init_msg_list is set to TRUE
7170: ------------------------------------------------------------
7171: -- Initialize message list if p_init_msg_list is set to TRUE
7172: -------------------------------------------------------------
7173: l_statement := 20;
7174: IF fnd_api.to_Boolean(p_init_msg_list) then
7175: fnd_msg_pub.initialize;
7176: end if;
7177:
7178: -------------------------------------------------------------
7178: -------------------------------------------------------------
7179: -- Initialize API return status to Success
7180: -------------------------------------------------------------
7181: l_statement := 30;
7182: x_return_status := fnd_api.g_ret_sts_success;
7183:
7184: ----------------------------------------------------
7185: -- Validate Account Period ID
7186: ----------------------------------------------------
7185: -- Validate Account Period ID
7186: ----------------------------------------------------
7187: l_statement := 40;
7188: if ((nvl(p_acct_period_id,-1) = -1) OR (p_txn_id IS NULL)) then
7189: raise fnd_api.g_exc_unexpected_error;
7190: end if;
7191:
7192: -----------------------------------
7193: -- Obtain transaction value
7217: p_mnt_or_mfg => 2,
7218: x_cost_element_id => l_cost_element
7219: );
7220:
7221: if (x_return_status <> fnd_api.g_ret_sts_success) then
7222: FND_FILE.put_line(FND_FILE.log, x_msg_data);
7223: l_api_message := 'get_CostEle_for_DirectItem returned unexpected error';
7224: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
7225: FND_MESSAGE.set_token('TEXT', l_api_message);
7223: l_api_message := 'get_CostEle_for_DirectItem returned unexpected error';
7224: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
7225: FND_MESSAGE.set_token('TEXT', l_api_message);
7226: FND_MSG_pub.add;
7227: raise fnd_api.g_exc_unexpected_error;
7228: end if;
7229:
7230: if (l_debug = 'Y') then
7231: FND_FILE.PUT_LINE(FND_FILE.LOG,'mfg cost_element: '|| to_char(l_cost_element));
7286: l_txn_value, p_user_id, p_login_id, p_request_id, p_prg_appl_id, p_prg_id,
7287: p_wip_entity_id, p_acct_period_id;
7288:
7289: -- Standard check of p_commit
7290: IF FND_API.to_Boolean(p_commit) THEN
7291: COMMIT WORK;
7292: END IF;
7293:
7294: -- Standard Call to get message count and if count = 1, get message info
7299: -- Print messages to log file
7300:
7301:
7302: EXCEPTION
7303: WHEN fnd_api.g_exc_error then
7304: ROLLBACK TO update_wip_period_balances_PUB;
7305: x_return_status := fnd_api.g_ret_sts_error;
7306:
7307: fnd_msg_pub.count_and_get
7301:
7302: EXCEPTION
7303: WHEN fnd_api.g_exc_error then
7304: ROLLBACK TO update_wip_period_balances_PUB;
7305: x_return_status := fnd_api.g_ret_sts_error;
7306:
7307: fnd_msg_pub.count_and_get
7308: ( p_count => x_msg_count,
7309: p_data => x_msg_data );
7307: fnd_msg_pub.count_and_get
7308: ( p_count => x_msg_count,
7309: p_data => x_msg_data );
7310:
7311: WHEN fnd_api.g_exc_unexpected_error then
7312: ROLLBACK TO update_wip_period_balances_PUB;
7313: x_return_status := fnd_api.g_ret_sts_unexp_error;
7314:
7315: fnd_msg_pub.count_and_get
7309: p_data => x_msg_data );
7310:
7311: WHEN fnd_api.g_exc_unexpected_error then
7312: ROLLBACK TO update_wip_period_balances_PUB;
7313: x_return_status := fnd_api.g_ret_sts_unexp_error;
7314:
7315: fnd_msg_pub.count_and_get
7316: ( p_count => x_msg_count,
7317: p_data => x_msg_data );
7317: p_data => x_msg_data );
7318:
7319: WHEN OTHERS THEN
7320: ROLLBACK TO update_wip_period_balances_PUB;
7321: x_return_status := fnd_api.g_ret_sts_unexp_error ;
7322: If fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) then
7323: fnd_msg_pub.add_exc_msg
7324: ( 'CST_eamCost_PUB',' update_wip_period_balances : Statement - ' || to_char(l_statement));
7325: end if;
7342: -- 05/01/01 Anitha Dixit Created --
7343: ----------------------------------------------------------------------------
7344: PROCEDURE insert_direct_item_txn (
7345: p_api_version IN NUMBER,
7346: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
7347: p_commit IN VARCHAR2 := FND_API.G_FALSE,
7348: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
7349:
7350: p_group_id IN NUMBER,
7343: ----------------------------------------------------------------------------
7344: PROCEDURE insert_direct_item_txn (
7345: p_api_version IN NUMBER,
7346: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
7347: p_commit IN VARCHAR2 := FND_API.G_FALSE,
7348: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
7349:
7350: p_group_id IN NUMBER,
7351: p_prg_appl_id IN NUMBER,
7344: PROCEDURE insert_direct_item_txn (
7345: p_api_version IN NUMBER,
7346: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
7347: p_commit IN VARCHAR2 := FND_API.G_FALSE,
7348: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
7349:
7350: p_group_id IN NUMBER,
7351: p_prg_appl_id IN NUMBER,
7352: p_prg_id IN NUMBER,
7361:
7362: l_api_name CONSTANT VARCHAR2(30) := 'insert_direct_item_txn';
7363: l_api_version CONSTANT NUMBER := 1.0;
7364:
7365: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
7366: l_msg_count NUMBER := 0;
7367: l_msg_data VARCHAR2(8000);
7368: l_stmt_num NUMBER := 0;
7369:
7377:
7378: l_debug := fnd_profile.value('MRP_DEBUG');
7379:
7380: -- Standard call to check for call compatibility
7381: IF NOT FND_API.Compatible_API_Call (
7382: l_api_version,
7383: p_api_version,
7384: l_api_name,
7385: G_PKG_NAME ) THEN
7382: l_api_version,
7383: p_api_version,
7384: l_api_name,
7385: G_PKG_NAME ) THEN
7386: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
7387: END IF;
7388:
7389: -- Initialize message list if p_init_msg_list is set to TRUE
7390: IF FND_API.to_Boolean(p_init_msg_list) THEN
7386: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
7387: END IF;
7388:
7389: -- Initialize message list if p_init_msg_list is set to TRUE
7390: IF FND_API.to_Boolean(p_init_msg_list) THEN
7391: FND_MSG_PUB.initialize;
7392: END IF;
7393:
7394: -- Initialize API return status to success
7391: FND_MSG_PUB.initialize;
7392: END IF;
7393:
7394: -- Initialize API return status to success
7395: x_return_status := FND_API.G_RET_STS_SUCCESS;
7396:
7397:
7398: -- Insert into Wip_transactions
7399: l_stmt_num := 20;
7490: where group_id = p_group_id
7491: and process_status = 2;
7492:
7493: -- Standard check of p_commit
7494: IF FND_API.to_Boolean(p_commit) THEN
7495: COMMIT WORK;
7496: END IF;
7497:
7498: -- Standard Call to get message count and if count = 1, get message info
7503: -- Print messages to log file
7504:
7505:
7506: EXCEPTION
7507: WHEN fnd_api.g_exc_error THEN
7508: ROLLBACK TO insert_direct_item_txn_PUB;
7509: x_return_status := fnd_api.g_ret_sts_error;
7510:
7511: -- Get message count and data
7505:
7506: EXCEPTION
7507: WHEN fnd_api.g_exc_error THEN
7508: ROLLBACK TO insert_direct_item_txn_PUB;
7509: x_return_status := fnd_api.g_ret_sts_error;
7510:
7511: -- Get message count and data
7512: fnd_msg_pub.count_and_get
7513: ( p_count => x_msg_count
7513: ( p_count => x_msg_count
7514: , p_data => x_msg_data
7515: );
7516:
7517: WHEN fnd_api.g_exc_unexpected_error THEN
7518: ROLLBACK TO insert_direct_item_txn_PUB;
7519: x_return_status := fnd_api.g_ret_sts_unexp_error ;
7520:
7521: -- Get message count and data
7515: );
7516:
7517: WHEN fnd_api.g_exc_unexpected_error THEN
7518: ROLLBACK TO insert_direct_item_txn_PUB;
7519: x_return_status := fnd_api.g_ret_sts_unexp_error ;
7520:
7521: -- Get message count and data
7522: fnd_msg_pub.count_and_get
7523: ( p_count => x_msg_count
7525: );
7526: --
7527: WHEN OTHERS THEN
7528: ROLLBACK TO insert_direct_item_txn_PUB;
7529: x_return_status := fnd_api.g_ret_sts_unexp_error ;
7530: fnd_file.put_line(fnd_file.log,'CST_eamCost_PUB.insert_direct_item_txn: Statement(' || to_char(l_stmt_num) || '): ' || substr(SQLERRM,1,240));
7531: --
7532: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
7533: THEN
7573:
7574: PROCEDURE get_Direct_Item_Charge_Acct (
7575: p_api_version IN NUMBER,
7576: p_init_msg_list IN VARCHAR2
7577: := FND_API.G_FALSE,
7578: p_commit IN VARCHAR2
7579: := FND_API.G_FALSE,
7580: p_validation_level IN NUMBER
7581: := FND_API.G_VALID_LEVEL_FULL,
7575: p_api_version IN NUMBER,
7576: p_init_msg_list IN VARCHAR2
7577: := FND_API.G_FALSE,
7578: p_commit IN VARCHAR2
7579: := FND_API.G_FALSE,
7580: p_validation_level IN NUMBER
7581: := FND_API.G_VALID_LEVEL_FULL,
7582: p_wip_entity_id IN NUMBER := NULL,
7583: x_material_acct OUT NOCOPY NUMBER,
7577: := FND_API.G_FALSE,
7578: p_commit IN VARCHAR2
7579: := FND_API.G_FALSE,
7580: p_validation_level IN NUMBER
7581: := FND_API.G_VALID_LEVEL_FULL,
7582: p_wip_entity_id IN NUMBER := NULL,
7583: x_material_acct OUT NOCOPY NUMBER,
7584: x_return_status OUT NOCOPY VARCHAR2,
7585: x_msg_count OUT NOCOPY NUMBER,
7603: ------------------------------------------------
7604: -- Standard call to check for API compatibility
7605: ------------------------------------------------
7606: l_statement := 10;
7607: IF not fnd_api.compatible_api_call (
7608: l_api_version,
7609: p_api_version,
7610: l_api_name,
7611: G_PKG_NAME ) then
7608: l_api_version,
7609: p_api_version,
7610: l_api_name,
7611: G_PKG_NAME ) then
7612: RAISE fnd_api.G_exc_unexpected_error;
7613: END IF;
7614:
7615: ------------------------------------------------------------
7616: -- Initialize message list if p_init_msg_list is set to TRUE
7615: ------------------------------------------------------------
7616: -- Initialize message list if p_init_msg_list is set to TRUE
7617: -------------------------------------------------------------
7618: l_statement := 20;
7619: IF fnd_api.to_Boolean(p_init_msg_list) then
7620: fnd_msg_pub.initialize;
7621: end if;
7622:
7623: -------------------------------------------------------------
7623: -------------------------------------------------------------
7624: -- Initialize API return status to Success
7625: -------------------------------------------------------------
7626: l_statement := 30;
7627: x_return_status := fnd_api.g_ret_sts_success;
7628:
7629:
7630: -------------------------------------------------
7631: -- Validate input parameters
7636: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
7637: FND_MESSAGE.set_token('TEXT', l_api_message);
7638: FND_MSG_PUB.add;
7639:
7640: RAISE fnd_api.g_exc_error;
7641: end if;
7642:
7643: ---------------------------------------------
7644: -- Verify if EAM job
7662:
7663: x_material_acct := l_material_account;
7664:
7665: EXCEPTION
7666: WHEN fnd_api.g_exc_error then
7667: x_return_status := fnd_api.g_ret_sts_error;
7668: x_material_acct := -1;
7669:
7670: fnd_msg_pub.count_and_get
7663: x_material_acct := l_material_account;
7664:
7665: EXCEPTION
7666: WHEN fnd_api.g_exc_error then
7667: x_return_status := fnd_api.g_ret_sts_error;
7668: x_material_acct := -1;
7669:
7670: fnd_msg_pub.count_and_get
7671: ( p_count => x_msg_count,
7670: fnd_msg_pub.count_and_get
7671: ( p_count => x_msg_count,
7672: p_data => x_msg_data );
7673:
7674: WHEN fnd_api.g_exc_unexpected_error then
7675: x_return_status := fnd_api.g_ret_sts_unexp_error;
7676: x_material_acct := -1;
7677:
7678: fnd_msg_pub.count_and_get
7671: ( p_count => x_msg_count,
7672: p_data => x_msg_data );
7673:
7674: WHEN fnd_api.g_exc_unexpected_error then
7675: x_return_status := fnd_api.g_ret_sts_unexp_error;
7676: x_material_acct := -1;
7677:
7678: fnd_msg_pub.count_and_get
7679: ( p_count => x_msg_count,
7679: ( p_count => x_msg_count,
7680: p_data => x_msg_data );
7681:
7682: WHEN OTHERS THEN
7683: x_return_status := fnd_api.g_ret_sts_unexp_error ;
7684: x_material_acct := -1;
7685: If fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) then
7686: fnd_msg_pub.add_exc_msg
7687: ( 'CST_eamCost_PUB',' get_Direct_Item_Charge_Acct : Statement - ' || to_char(l_statement));
7710: -- 08/26/01 Anitha Dixit Created --
7711: ----------------------------------------------------------------------------
7712: PROCEDURE validate_for_reestimation (
7713: p_api_version IN NUMBER,
7714: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
7715: p_commit IN VARCHAR2 := fnd_api.g_false,
7716: p_validation_level IN VARCHAR2 := fnd_api.g_valid_level_full,
7717:
7718: p_wip_entity_id IN NUMBER,
7711: ----------------------------------------------------------------------------
7712: PROCEDURE validate_for_reestimation (
7713: p_api_version IN NUMBER,
7714: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
7715: p_commit IN VARCHAR2 := fnd_api.g_false,
7716: p_validation_level IN VARCHAR2 := fnd_api.g_valid_level_full,
7717:
7718: p_wip_entity_id IN NUMBER,
7719: p_job_status IN NUMBER,
7712: PROCEDURE validate_for_reestimation (
7713: p_api_version IN NUMBER,
7714: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
7715: p_commit IN VARCHAR2 := fnd_api.g_false,
7716: p_validation_level IN VARCHAR2 := fnd_api.g_valid_level_full,
7717:
7718: p_wip_entity_id IN NUMBER,
7719: p_job_status IN NUMBER,
7720: p_curr_est_status IN NUMBER,
7726: ) IS
7727: l_api_name CONSTANT VARCHAR2(30) := 'validate_for_reestimation';
7728: l_api_version CONSTANT NUMBER := 1.0;
7729:
7730: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
7731: l_msg_count NUMBER := 0;
7732: l_msg_data VARCHAR2(8000);
7733: l_stmt_num NUMBER := 0;
7734:
7743: -- Standard start of API savepoint
7744: SAVEPOINT validate_for_reestimation_PUB;
7745:
7746: -- Standard call to check for call compatibility
7747: IF NOT FND_API.Compatible_API_Call (
7748: l_api_version,
7749: p_api_version,
7750: l_api_name,
7751: G_PKG_NAME ) THEN
7748: l_api_version,
7749: p_api_version,
7750: l_api_name,
7751: G_PKG_NAME ) THEN
7752: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
7753: END IF;
7754:
7755: -- Initialize message list if p_init_msg_list is set to TRUE
7756: IF FND_API.to_Boolean(p_init_msg_list) THEN
7752: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
7753: END IF;
7754:
7755: -- Initialize message list if p_init_msg_list is set to TRUE
7756: IF FND_API.to_Boolean(p_init_msg_list) THEN
7757: FND_MSG_PUB.initialize;
7758: END IF;
7759:
7760:
7759:
7760:
7761: -- Initialize API return status to success
7762: l_stmt_num := 0;
7763: x_return_status := FND_API.G_RET_STS_SUCCESS;
7764:
7765: -- Call validation hook
7766: l_stmt_num := 10;
7767: l_hook := CSTPACHK.validate_job_est_status_hook (
7773: o_err_code => l_err_code,
7774: o_err_msg => l_err_msg );
7775:
7776: if (l_err_num <> 0) then
7777: raise fnd_api.g_exc_unexpected_error;
7778: end if;
7779:
7780:
7781: l_stmt_num := 20;
7802: x_validate_flag := 0;
7803: end if;
7804:
7805: -- Standard check of p_commit
7806: IF FND_API.to_Boolean(p_commit) THEN
7807: COMMIT WORK;
7808: END IF;
7809:
7810: -- Standard Call to get message count and if count = 1, get message info
7812: p_count => x_msg_count,
7813: p_data => x_msg_data );
7814:
7815: EXCEPTION
7816: WHEN fnd_api.g_exc_error THEN
7817: ROLLBACK TO validate_for_reestimation_PUB;
7818: x_return_status := fnd_api.g_ret_sts_error;
7819:
7820: -- Get message count and data
7814:
7815: EXCEPTION
7816: WHEN fnd_api.g_exc_error THEN
7817: ROLLBACK TO validate_for_reestimation_PUB;
7818: x_return_status := fnd_api.g_ret_sts_error;
7819:
7820: -- Get message count and data
7821: fnd_msg_pub.count_and_get
7822: ( p_count => x_msg_count
7822: ( p_count => x_msg_count
7823: , p_data => x_msg_data
7824: );
7825:
7826: WHEN fnd_api.g_exc_unexpected_error THEN
7827: ROLLBACK TO validate_for_reestimation_PUB;
7828: x_return_status := fnd_api.g_ret_sts_unexp_error ;
7829:
7830: -- Get message count and data
7824: );
7825:
7826: WHEN fnd_api.g_exc_unexpected_error THEN
7827: ROLLBACK TO validate_for_reestimation_PUB;
7828: x_return_status := fnd_api.g_ret_sts_unexp_error ;
7829:
7830: -- Get message count and data
7831: fnd_msg_pub.count_and_get
7832: ( p_count => x_msg_count
7834: );
7835:
7836: WHEN OTHERS THEN
7837: ROLLBACK TO validate_for_reestimation_PUB;
7838: x_return_status := fnd_api.g_ret_sts_unexp_error ;
7839: --
7840: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
7841: THEN
7842: fnd_msg_pub.add_exc_msg
7877: -- 09/07/07 Veeresha Javli Bug: 5767070 fix: use round --
7878: ----------------------------------------------------------------------------
7879: PROCEDURE Redistribute_WIP_Accounts (
7880: p_api_version IN NUMBER,
7881: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
7882: p_commit IN VARCHAR2 := FND_API.G_FALSE,
7883: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
7884: p_wcti_group_id IN NUMBER,
7885:
7878: ----------------------------------------------------------------------------
7879: PROCEDURE Redistribute_WIP_Accounts (
7880: p_api_version IN NUMBER,
7881: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
7882: p_commit IN VARCHAR2 := FND_API.G_FALSE,
7883: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
7884: p_wcti_group_id IN NUMBER,
7885:
7886: p_user_id IN NUMBER,
7879: PROCEDURE Redistribute_WIP_Accounts (
7880: p_api_version IN NUMBER,
7881: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
7882: p_commit IN VARCHAR2 := FND_API.G_FALSE,
7883: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
7884: p_wcti_group_id IN NUMBER,
7885:
7886: p_user_id IN NUMBER,
7887: p_request_id IN NUMBER,
7922: l_res_var_acct NUMBER;
7923: l_osp_var_acct NUMBER;
7924: l_ovh_var_acct NUMBER;
7925:
7926: l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
7927: l_api_message VARCHAR2(10000);
7928: l_stmt_num NUMBER;
7929:
7930: l_dummy NUMBER := 0;
7990:
7991: -------------------------------------------------------------------------
7992: -- standard call to check for call compatibility
7993: -------------------------------------------------------------------------
7994: IF NOT fnd_api.compatible_api_call (
7995: l_api_version,
7996: p_api_version,
7997: l_api_name,
7998: G_PKG_NAME ) then
7996: p_api_version,
7997: l_api_name,
7998: G_PKG_NAME ) then
7999:
8000: RAISE fnd_api.g_exc_unexpected_error;
8001:
8002: END IF;
8003:
8004: -------------------------------------------------------------------------
8003:
8004: -------------------------------------------------------------------------
8005: -- Initialize message list if p_init_msg_list is set to TRUE
8006: -------------------------------------------------------------------------
8007: IF FND_API.to_Boolean(p_init_msg_list) THEN
8008: FND_MSG_PUB.initialize;
8009: END IF;
8010:
8011:
8011:
8012: -------------------------------------------------------------------------
8013: -- initialize api return status to success
8014: -------------------------------------------------------------------------
8015: x_return_status := fnd_api.g_ret_sts_success;
8016:
8017: -- assign to local variables
8018: l_stmt_num := 10;
8019:
8155: x_return_status => l_return_status,
8156: x_msg_data => l_msg_data
8157: );
8158:
8159: if (l_return_status <> fnd_api.g_ret_sts_success) then
8160: raise fnd_api.g_exc_unexpected_error;
8161: end if;
8162:
8163:
8156: x_msg_data => l_msg_data
8157: );
8158:
8159: if (l_return_status <> fnd_api.g_ret_sts_success) then
8160: raise fnd_api.g_exc_unexpected_error;
8161: end if;
8162:
8163:
8164: l_stmt_num := 45;
8312: ---------------------------------------------------------------------------
8313: -- Standard check of p_commit
8314: ---------------------------------------------------------------------------
8315:
8316: IF FND_API.to_Boolean(p_commit) THEN
8317: COMMIT WORK;
8318: END IF;
8319:
8320: ---------------------------------------------------------------------------
8326: p_data => x_msg_data );
8327:
8328: EXCEPTION
8329:
8330: WHEN fnd_api.g_exc_error THEN
8331: x_return_status := fnd_api.g_ret_sts_error;
8332:
8333: -- Get message count and data
8334: fnd_msg_pub.count_and_get
8327:
8328: EXCEPTION
8329:
8330: WHEN fnd_api.g_exc_error THEN
8331: x_return_status := fnd_api.g_ret_sts_error;
8332:
8333: -- Get message count and data
8334: fnd_msg_pub.count_and_get
8335: ( p_count => x_msg_count
8335: ( p_count => x_msg_count
8336: , p_data => x_msg_data
8337: );
8338: --
8339: WHEN fnd_api.g_exc_unexpected_error THEN
8340: x_return_status := fnd_api.g_ret_sts_unexp_error ;
8341: fnd_file.put_line(fnd_file.log,l_msg_data);
8342:
8343: -- Get message count and data
8336: , p_data => x_msg_data
8337: );
8338: --
8339: WHEN fnd_api.g_exc_unexpected_error THEN
8340: x_return_status := fnd_api.g_ret_sts_unexp_error ;
8341: fnd_file.put_line(fnd_file.log,l_msg_data);
8342:
8343: -- Get message count and data
8344: fnd_msg_pub.count_and_get
8346: , p_data => x_msg_data
8347: );
8348: --
8349: WHEN OTHERS THEN
8350: x_return_status := fnd_api.g_ret_sts_unexp_error ;
8351: --
8352: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
8353: THEN
8354: fnd_msg_pub.add_exc_msg
8388: -- 11/26/02 Ray Thng Created --
8389: ----------------------------------------------------------------------------
8390: PROCEDURE get_charge_asset (
8391: p_api_version IN NUMBER,
8392: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
8393: p_wip_entity_id IN NUMBER,
8394: x_inventory_item_id OUT NOCOPY csi_item_instances.inventory_item_id%TYPE,
8395: x_serial_number OUT NOCOPY csi_item_instances.serial_number%TYPE,
8396: x_maintenance_object_id OUT NOCOPY mtl_serial_numbers.gen_object_id%TYPE,
8400: IS
8401: l_api_name CONSTANT VARCHAR2(30) := 'get_asset';
8402: l_api_version CONSTANT NUMBER := 1.0;
8403: l_stmt_num NUMBER := 0;
8404: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
8405:
8406: l_parent_wip_entity_id wip_discrete_jobs.parent_wip_entity_id%TYPE;
8407: l_parent_maint_object_type wip_discrete_jobs.maintenance_object_type%TYPE;
8408: l_parent_maint_object_id wip_discrete_jobs.maintenance_object_source%TYPE;
8414: l_inventory_item_id csi_item_instances.inventory_item_id%TYPE;
8415: l_serial_number csi_item_instances.serial_number%TYPE;
8416: BEGIN
8417: -- Standard call to check for call compatibility
8418: IF NOT FND_API.Compatible_API_Call(l_api_version,p_api_version,l_api_name,G_PKG_NAME) THEN
8419: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
8420: END IF;
8421:
8422: -- Initialize message list if p_init_msg_list is set to TRUE
8415: l_serial_number csi_item_instances.serial_number%TYPE;
8416: BEGIN
8417: -- Standard call to check for call compatibility
8418: IF NOT FND_API.Compatible_API_Call(l_api_version,p_api_version,l_api_name,G_PKG_NAME) THEN
8419: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
8420: END IF;
8421:
8422: -- Initialize message list if p_init_msg_list is set to TRUE
8423: IF FND_API.to_Boolean(p_init_msg_list) THEN
8419: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
8420: END IF;
8421:
8422: -- Initialize message list if p_init_msg_list is set to TRUE
8423: IF FND_API.to_Boolean(p_init_msg_list) THEN
8424: FND_MSG_PUB.initialize;
8425: END IF;
8426:
8427: -- Initialize API return status to success
8425: END IF;
8426:
8427: -- Initialize API return status to success
8428: l_stmt_num := 0;
8429: x_return_status := FND_API.G_RET_STS_SUCCESS;
8430:
8431:
8432: -- Retrieve information about the current work order and its parent
8433: /* Changed the following SQL statement to refer to CII
8496: p_count => x_msg_count,
8497: p_data => x_msg_data);
8498:
8499: EXCEPTION
8500: WHEN fnd_api.g_exc_error THEN
8501: x_return_status := fnd_api.g_ret_sts_error;
8502:
8503: -- Get message count and data
8504: fnd_msg_pub.count_and_get(
8497: p_data => x_msg_data);
8498:
8499: EXCEPTION
8500: WHEN fnd_api.g_exc_error THEN
8501: x_return_status := fnd_api.g_ret_sts_error;
8502:
8503: -- Get message count and data
8504: fnd_msg_pub.count_and_get(
8505: p_count => x_msg_count,
8504: fnd_msg_pub.count_and_get(
8505: p_count => x_msg_count,
8506: p_data => x_msg_data);
8507:
8508: WHEN fnd_api.g_exc_unexpected_error THEN
8509: x_return_status := fnd_api.g_ret_sts_unexp_error ;
8510:
8511: -- Get message count and data
8512: fnd_msg_pub.count_and_get(
8505: p_count => x_msg_count,
8506: p_data => x_msg_data);
8507:
8508: WHEN fnd_api.g_exc_unexpected_error THEN
8509: x_return_status := fnd_api.g_ret_sts_unexp_error ;
8510:
8511: -- Get message count and data
8512: fnd_msg_pub.count_and_get(
8513: p_count => x_msg_count,
8513: p_count => x_msg_count,
8514: p_data => x_msg_data);
8515:
8516: WHEN OTHERS THEN
8517: x_return_status := fnd_api.g_ret_sts_unexp_error ;
8518:
8519: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
8520: fnd_msg_pub.add_exc_msg(
8521: 'CST_eamCost_PUB',
8542: -- 06/26/03 Linda Soo Created --
8543: ----------------------------------------------------------------------------
8544: PROCEDURE get_CostEle_for_DirectItem (
8545: p_api_version IN NUMBER,
8546: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
8547: p_commit IN VARCHAR2 := FND_API.G_FALSE,
8548: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
8549: p_txn_id IN NUMBER,
8550: p_mnt_or_mfg IN NUMBER, -- 1: eam cost element,
8543: ----------------------------------------------------------------------------
8544: PROCEDURE get_CostEle_for_DirectItem (
8545: p_api_version IN NUMBER,
8546: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
8547: p_commit IN VARCHAR2 := FND_API.G_FALSE,
8548: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
8549: p_txn_id IN NUMBER,
8550: p_mnt_or_mfg IN NUMBER, -- 1: eam cost element,
8551: -- 2: manufacturing cost ele
8544: PROCEDURE get_CostEle_for_DirectItem (
8545: p_api_version IN NUMBER,
8546: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
8547: p_commit IN VARCHAR2 := FND_API.G_FALSE,
8548: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
8549: p_txn_id IN NUMBER,
8550: p_mnt_or_mfg IN NUMBER, -- 1: eam cost element,
8551: -- 2: manufacturing cost ele
8552: p_pac_or_perp IN NUMBER, -- 1 for PAC, 0 (default) for Perpetual
8587: ------------------------------------------------
8588: -- Standard call to check for API compatibility
8589: ------------------------------------------------
8590: l_statement := 10;
8591: IF not fnd_api.compatible_api_call( l_api_version,
8592: p_api_version,
8593: l_api_name,
8594: G_PKG_NAME ) then
8595: RAISE fnd_api.G_exc_unexpected_error;
8591: IF not fnd_api.compatible_api_call( l_api_version,
8592: p_api_version,
8593: l_api_name,
8594: G_PKG_NAME ) then
8595: RAISE fnd_api.G_exc_unexpected_error;
8596: END IF;
8597:
8598: -------------------------------------------------------------
8599: -- Initialize message list if p_init_msg_list is set to TRUE
8598: -------------------------------------------------------------
8599: -- Initialize message list if p_init_msg_list is set to TRUE
8600: -------------------------------------------------------------
8601: l_statement := 20;
8602: IF fnd_api.to_Boolean(p_init_msg_list) then
8603: fnd_msg_pub.initialize;
8604: end if;
8605:
8606: -------------------------------------------
8606: -------------------------------------------
8607: -- Initialize API return status to Success
8608: -------------------------------------------
8609: l_statement := 30;
8610: x_return_status := fnd_api.g_ret_sts_success;
8611:
8612: -----------------------------
8613: -- Validate input parameters
8614: -----------------------------
8617: l_api_message := 'One of the IN parameter is null';
8618: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
8619: FND_MESSAGE.set_token('TEXT', l_api_message);
8620: FND_MSG_PUB.add;
8621: RAISE fnd_api.g_exc_error;
8622: end if;
8623:
8624: ----------------------------------------------------------------------
8625: -- Verify if transaction ID exists, Obtain po_header_id and po_line_id
8641: l_api_message := 'Transaction ID does not exist in WIP_COST_TXN_INTERFACE table. ';
8642: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
8643: FND_MESSAGE.set_token('TEXT', l_api_message);
8644: FND_MSG_PUB.add;
8645: RAISE fnd_api.g_exc_error;
8646: end;
8647: ELSE -- Done to support eAM in PAC, get data from WT as WCTI contains nothing at this moment
8648: l_statement := 55;
8649: begin
8660: l_api_message := 'Transaction ID does not exist in WIP_TRANSACTIONS table. ';
8661: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
8662: FND_MESSAGE.set_token('TEXT', l_api_message);
8663: FND_MSG_PUB.add;
8664: RAISE fnd_api.g_exc_error;
8665: end;
8666: END IF;
8667:
8668:
8682: l_api_message := l_api_message || ' wip_cost_txn_interface ';
8683: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
8684: FND_MESSAGE.set_token('TEXT', l_api_message);
8685: FND_MSG_pub.add;
8686: RAISE FND_API.g_exc_error;
8687: end if;
8688:
8689: -----------------------
8690: -- Obtain category_id
8700: l_api_message := l_api_message || ' wip_cost_txn_interface ';
8701: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
8702: FND_MESSAGE.set_token('TEXT', l_api_message);
8703: FND_MSG_pub.add;
8704: RAISE FND_API.g_exc_error;
8705: end if;
8706:
8707: ------------------------
8708: -- Obtain cost element
8722: l_api_message := l_api_message || ' wip_cost_txn_interface ';
8723: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
8724: FND_MESSAGE.set_token('TEXT', l_api_message);
8725: FND_MSG_pub.add;
8726: RAISE FND_API.g_exc_error;
8727: End if;
8728:
8729: If (l_po_release_id <> -1) then
8730: select approved_date
8736: l_api_message := l_api_message || ' wip_cost_txn_interface ';
8737: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
8738: FND_MESSAGE.set_token('TEXT', l_api_message);
8739: FND_MSG_pub.add;
8740: RAISE FND_API.g_exc_error;
8741: End if;
8742:
8743: end if;
8744:
8771: l_api_message := 'No category_id exist for PO Line ID: ' || TO_CHAR(l_po_line_id);
8772: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
8773: FND_MESSAGE.set_token('TEXT', l_api_message);
8774: FND_MSG_pub.add;
8775: RAISE FND_API.g_exc_error;
8776: else
8777: l_api_message := 'PO Header ID ' || TO_CHAR(l_po_header_id);
8778: l_api_message := l_api_message || ' has not been approved';
8779: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
8778: l_api_message := l_api_message || ' has not been approved';
8779: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
8780: FND_MESSAGE.set_token('TEXT', l_api_message);
8781: FND_MSG_pub.add;
8782: RAISE FND_API.g_exc_error;
8783: end if;
8784:
8785: x_cost_element_id := l_cost_element_id;
8786:
8789: p_count => x_msg_count,
8790: p_data => x_msg_data );
8791:
8792: EXCEPTION
8793: WHEN fnd_api.g_exc_error then
8794: x_return_status := fnd_api.g_ret_sts_error;
8795: x_cost_element_id := -1;
8796:
8797: fnd_msg_pub.count_and_get(
8790: p_data => x_msg_data );
8791:
8792: EXCEPTION
8793: WHEN fnd_api.g_exc_error then
8794: x_return_status := fnd_api.g_ret_sts_error;
8795: x_cost_element_id := -1;
8796:
8797: fnd_msg_pub.count_and_get(
8798: p_count => x_msg_count,
8797: fnd_msg_pub.count_and_get(
8798: p_count => x_msg_count,
8799: p_data => x_msg_data );
8800:
8801: WHEN fnd_api.g_exc_unexpected_error then
8802: x_return_status := fnd_api.g_ret_sts_unexp_error;
8803: x_cost_element_id := -1;
8804:
8805: fnd_msg_pub.count_and_get(
8798: p_count => x_msg_count,
8799: p_data => x_msg_data );
8800:
8801: WHEN fnd_api.g_exc_unexpected_error then
8802: x_return_status := fnd_api.g_ret_sts_unexp_error;
8803: x_cost_element_id := -1;
8804:
8805: fnd_msg_pub.count_and_get(
8806: p_count => x_msg_count,
8806: p_count => x_msg_count,
8807: p_data => x_msg_data );
8808:
8809: WHEN OTHERS THEN
8810: x_return_status := fnd_api.g_ret_sts_unexp_error ;
8811: x_cost_element_id:= -1;
8812: If fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) then
8813: fnd_msg_pub.add_exc_msg ( 'CST_eamCost_PUB',
8814: ' get_CostElement_for_DirectItem: Statement - ' || to_char(l_statement));
8832: -- 06/26/03 Linda Soo Created --
8833: ----------------------------------------------------------------------------
8834: PROCEDURE get_ExpType_for_DirectItem (
8835: p_api_version IN NUMBER,
8836: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
8837: p_commit IN VARCHAR2 := FND_API.G_FALSE,
8838: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
8839: p_txn_id IN NUMBER,
8840: x_expenditure_type OUT NOCOPY VARCHAR2,
8833: ----------------------------------------------------------------------------
8834: PROCEDURE get_ExpType_for_DirectItem (
8835: p_api_version IN NUMBER,
8836: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
8837: p_commit IN VARCHAR2 := FND_API.G_FALSE,
8838: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
8839: p_txn_id IN NUMBER,
8840: x_expenditure_type OUT NOCOPY VARCHAR2,
8841: x_return_status OUT NOCOPY VARCHAR2,
8834: PROCEDURE get_ExpType_for_DirectItem (
8835: p_api_version IN NUMBER,
8836: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
8837: p_commit IN VARCHAR2 := FND_API.G_FALSE,
8838: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
8839: p_txn_id IN NUMBER,
8840: x_expenditure_type OUT NOCOPY VARCHAR2,
8841: x_return_status OUT NOCOPY VARCHAR2,
8842: x_msg_count OUT NOCOPY NUMBER,
8870: ------------------------------------------------
8871: -- Standard call to check for API compatibility
8872: ------------------------------------------------
8873: l_statement := 10;
8874: IF not fnd_api.compatible_api_call( l_api_version,
8875: p_api_version,
8876: l_api_name,
8877: G_PKG_NAME ) then
8878: RAISE fnd_api.G_exc_unexpected_error;
8874: IF not fnd_api.compatible_api_call( l_api_version,
8875: p_api_version,
8876: l_api_name,
8877: G_PKG_NAME ) then
8878: RAISE fnd_api.G_exc_unexpected_error;
8879: END IF;
8880:
8881: -------------------------------------------------------------
8882: -- Initialize message list if p_init_msg_list is set to TRUE
8881: -------------------------------------------------------------
8882: -- Initialize message list if p_init_msg_list is set to TRUE
8883: -------------------------------------------------------------
8884: l_statement := 20;
8885: IF fnd_api.to_Boolean(p_init_msg_list) then
8886: fnd_msg_pub.initialize;
8887: end if;
8888:
8889: -------------------------------------------
8889: -------------------------------------------
8890: -- Initialize API return status to Success
8891: -------------------------------------------
8892: l_statement := 30;
8893: x_return_status := fnd_api.g_ret_sts_success;
8894:
8895: -----------------------------
8896: -- Validate input parameters
8897: -----------------------------
8900: l_api_message := 'IN parameter is null';
8901: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
8902: FND_MESSAGE.set_token('TEXT', l_api_message);
8903: FND_MSG_PUB.add;
8904: RAISE fnd_api.g_exc_error;
8905: end if;
8906:
8907: -------------------------------------------------------------------------
8908: -- Verify if transaction ID exists and Obtain po_header_id and po_line_id
8920: l_api_message := 'Transaction ID does not exist in WIP_TRANSACTIONS table.';
8921: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
8922: FND_MESSAGE.set_token('TEXT', l_api_message);
8923: FND_MSG_PUB.add;
8924: RAISE fnd_api.g_exc_error;
8925: end;
8926:
8927: -------------------------
8928: -- Obtain approved_date
8938: l_api_message := l_api_message || ' wip_transactions ';
8939: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
8940: FND_MESSAGE.set_token('TEXT', l_api_message);
8941: FND_MSG_pub.add;
8942: RAISE FND_API.g_exc_error;
8943: end if;
8944:
8945: -----------------------
8946: -- Obtain category_id
8956: l_api_message := l_api_message || ' wip_transactions ';
8957: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
8958: FND_MESSAGE.set_token('TEXT', l_api_message);
8959: FND_MSG_pub.add;
8960: RAISE FND_API.g_exc_error;
8961: end if;
8962:
8963: ----------------------------
8964: -- Obtain expenditure type
8982: l_api_message := 'No category_id exist for PO Line ID: ' || TO_CHAR(l_po_line_id);
8983: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
8984: FND_MESSAGE.set_token('TEXT', l_api_message);
8985: FND_MSG_pub.add;
8986: RAISE FND_API.g_exc_error;
8987: else
8988: l_api_message := 'PO Header ID ' || TO_CHAR(l_po_header_id);
8989: l_api_message := l_api_message || ' has not been approved';
8990: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
8989: l_api_message := l_api_message || ' has not been approved';
8990: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
8991: FND_MESSAGE.set_token('TEXT', l_api_message);
8992: FND_MSG_pub.add;
8993: RAISE FND_API.g_exc_error;
8994: end if;
8995:
8996: x_expenditure_type := l_expenditure_type;
8997:
9000: p_count => x_msg_count,
9001: p_data => x_msg_data );
9002:
9003: EXCEPTION
9004: WHEN fnd_api.g_exc_error then
9005: x_return_status := fnd_api.g_ret_sts_error;
9006: x_expenditure_type := to_char(-1);
9007:
9008: fnd_msg_pub.count_and_get(
9001: p_data => x_msg_data );
9002:
9003: EXCEPTION
9004: WHEN fnd_api.g_exc_error then
9005: x_return_status := fnd_api.g_ret_sts_error;
9006: x_expenditure_type := to_char(-1);
9007:
9008: fnd_msg_pub.count_and_get(
9009: p_count => x_msg_count,
9008: fnd_msg_pub.count_and_get(
9009: p_count => x_msg_count,
9010: p_data => x_msg_data );
9011:
9012: WHEN fnd_api.g_exc_unexpected_error then
9013: x_return_status := fnd_api.g_ret_sts_unexp_error;
9014: x_expenditure_type := to_char(-1);
9015:
9016: fnd_msg_pub.count_and_get(
9009: p_count => x_msg_count,
9010: p_data => x_msg_data );
9011:
9012: WHEN fnd_api.g_exc_unexpected_error then
9013: x_return_status := fnd_api.g_ret_sts_unexp_error;
9014: x_expenditure_type := to_char(-1);
9015:
9016: fnd_msg_pub.count_and_get(
9017: p_count => x_msg_count,
9017: p_count => x_msg_count,
9018: p_data => x_msg_data );
9019:
9020: WHEN OTHERS THEN
9021: x_return_status := fnd_api.g_ret_sts_unexp_error ;
9022: x_expenditure_type := to_char(-1);
9023: If fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) then
9024: fnd_msg_pub.add_exc_msg ( 'CST_eamCost_PUB',
9025: ' get_ExpType_for_DirectItem: Statement - ' || to_char(l_statement));
9052: -- Standard Start of API savepoint
9053: SAVEPOINT Rollup_WorkOrderCost_PUB;
9054:
9055: -- Initialize message list if p_init_msg_list is set to TRUE
9056: IF FND_API.to_Boolean(p_init_msg_list) THEN
9057: FND_MSG_PUB.initialize;
9058: END IF;
9059:
9060: -- Check for call compatibility
9057: FND_MSG_PUB.initialize;
9058: END IF;
9059:
9060: -- Check for call compatibility
9061: IF NOT FND_API.Compatible_API_Call
9062: ( p_current_version_number => l_api_version,
9063: p_caller_version_number => p_api_version,
9064: p_api_name => l_api_name,
9065: p_pkg_name => G_PKG_NAME
9064: p_api_name => l_api_name,
9065: p_pkg_name => G_PKG_NAME
9066: )
9067: THEN
9068: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9069: END IF;
9070:
9071: -- Check for message level threshold
9072: l_msg_level_threshold := FND_PROFILE.Value('FND_AS_MSG_LEVEL_THRESHOLD');
9113: p_procedure_name => l_api_name,
9114: p_error_text => 'There is no matching record in CST_EAM_HIERARCHY_SNAPSHOT ' ||
9115: 'for group id ' || p_group_id
9116: );
9117: x_return_status := FND_API.G_RET_STS_SUCCESS;
9118: RETURN;
9119: END IF;
9120:
9121: -- Delete existing calculations for this group id
9253: p_group_id
9254: );
9255: END IF;
9256:
9257: x_return_status := FND_API.G_RET_STS_SUCCESS;
9258: EXCEPTION
9259: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9260: ROLLBACK TO Rollup_WorkOrderCost_PUB;
9261: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9255: END IF;
9256:
9257: x_return_status := FND_API.G_RET_STS_SUCCESS;
9258: EXCEPTION
9259: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9260: ROLLBACK TO Rollup_WorkOrderCost_PUB;
9261: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9262: WHEN l_object_type_exc THEN
9263: ROLLBACK TO Rollup_WorkOrderCost_PUB;
9257: x_return_status := FND_API.G_RET_STS_SUCCESS;
9258: EXCEPTION
9259: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9260: ROLLBACK TO Rollup_WorkOrderCost_PUB;
9261: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9262: WHEN l_object_type_exc THEN
9263: ROLLBACK TO Rollup_WorkOrderCost_PUB;
9264: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9265: IF l_msg_level_threshold <= FND_MSG_PUB.G_MSG_LVL_ERROR
9260: ROLLBACK TO Rollup_WorkOrderCost_PUB;
9261: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9262: WHEN l_object_type_exc THEN
9263: ROLLBACK TO Rollup_WorkOrderCost_PUB;
9264: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9265: IF l_msg_level_threshold <= FND_MSG_PUB.G_MSG_LVL_ERROR
9266: THEN
9267: FND_MSG_PUB.Add_Exc_Msg(
9268: p_pkg_name => G_PKG_NAME,
9272: );
9273: END IF;
9274: WHEN OTHERS THEN
9275: ROLLBACK TO Rollup_WorkOrderCost_PUB;
9276: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9277: IF l_msg_level_threshold <= FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR
9278: THEN
9279: FND_MSG_PUB.Add_Exc_Msg(
9280: p_pkg_name => G_PKG_NAME,
9302: -- Standard Start of API savepoint
9303: SAVEPOINT Purge_RollupCost_PUB;
9304:
9305: -- Initialize message list if p_init_msg_list is set to TRUE
9306: IF FND_API.to_Boolean(p_init_msg_list) THEN
9307: FND_MSG_PUB.initialize;
9308: END IF;
9309:
9310: -- Check for call compatibility
9307: FND_MSG_PUB.initialize;
9308: END IF;
9309:
9310: -- Check for call compatibility
9311: IF NOT FND_API.Compatible_API_Call
9312: ( p_current_version_number => l_api_version,
9313: p_caller_version_number => p_api_version,
9314: p_api_name => l_api_name,
9315: p_pkg_name => G_PKG_NAME
9314: p_api_name => l_api_name,
9315: p_pkg_name => G_PKG_NAME
9316: )
9317: THEN
9318: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9319: END IF;
9320:
9321: -- Check for message level threshold
9322: l_msg_level_threshold := FND_PROFILE.Value('FND_AS_MSG_LEVEL_THRESHOLD');
9373: ' from CST_EAM_ROLLUP_COSTS'
9374: );
9375: END IF;
9376:
9377: x_return_status := FND_API.G_RET_STS_SUCCESS;
9378: EXCEPTION
9379: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9380: ROLLBACK TO Purge_RollupCost_PUB;
9381: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9375: END IF;
9376:
9377: x_return_status := FND_API.G_RET_STS_SUCCESS;
9378: EXCEPTION
9379: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9380: ROLLBACK TO Purge_RollupCost_PUB;
9381: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9382: WHEN OTHERS THEN
9383: ROLLBACK TO Purge_RollupCost_PUB;
9377: x_return_status := FND_API.G_RET_STS_SUCCESS;
9378: EXCEPTION
9379: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9380: ROLLBACK TO Purge_RollupCost_PUB;
9381: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9382: WHEN OTHERS THEN
9383: ROLLBACK TO Purge_RollupCost_PUB;
9384: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9385: IF l_msg_level_threshold <= FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR
9380: ROLLBACK TO Purge_RollupCost_PUB;
9381: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9382: WHEN OTHERS THEN
9383: ROLLBACK TO Purge_RollupCost_PUB;
9384: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9385: IF l_msg_level_threshold <= FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR
9386: THEN
9387: FND_MSG_PUB.Add_Exc_Msg(
9388: p_pkg_name => G_PKG_NAME,
9481: ')');
9482: end if;
9483:
9484: -- Standard call to check for call compatibility.
9485: IF NOT FND_API.Compatible_API_Call ( l_api_version,
9486: p_api_version,
9487: l_api_name ,
9488: 'CST_eamCost_PUB')
9489: THEN
9486: p_api_version,
9487: l_api_name ,
9488: 'CST_eamCost_PUB')
9489: THEN
9490: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9491: END IF;
9492: -- Initialize message list if p_init_msg_list is set to TRUE.
9493: IF FND_API.to_Boolean( p_init_msg_list ) THEN
9494: FND_MSG_PUB.initialize;
9489: THEN
9490: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9491: END IF;
9492: -- Initialize message list if p_init_msg_list is set to TRUE.
9493: IF FND_API.to_Boolean( p_init_msg_list ) THEN
9494: FND_MSG_PUB.initialize;
9495: END IF;
9496:
9497: l_stmt_num := 10;
9496:
9497: l_stmt_num := 10;
9498:
9499: -- Initialize API return status to success
9500: x_return_status := FND_API.G_RET_STS_SUCCESS;
9501:
9502: /* Update the record if already exists else insert a new one */
9503:
9504: MERGE INTO CST_EAM_BALANCE_BY_ACCOUNTS cebba
9575: );
9576:
9577:
9578: -- Standard check of p_commit.
9579: IF FND_API.To_Boolean( p_commit ) THEN
9580: COMMIT WORK;
9581: END IF;
9582:
9583:
9596: p_data => x_msg_data
9597: );
9598:
9599: EXCEPTION
9600: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9601: ROLLBACK TO Insert_eamBalAcct_PUB;
9602: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
9603:
9604: IF (l_uLog) THEN
9598:
9599: EXCEPTION
9600: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9601: ROLLBACK TO Insert_eamBalAcct_PUB;
9602: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
9603:
9604: IF (l_uLog) THEN
9605: FND_LOG.STRING(
9606: FND_LOG.LEVEL_UNEXPECTED,
9614: p_data => x_msg_data
9615: );
9616: WHEN OTHERS THEN
9617: ROLLBACK TO Insert_eamBalAcct_PUB;
9618: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
9619:
9620: IF (l_uLog) THEN
9621: FND_LOG.STRING(
9622: FND_LOG.LEVEL_UNEXPECTED,
9676: BEGIN
9677: -- Standard Start of API savepoint
9678: SAVEPOINT Delete_eamBalAcct_PUB;
9679: -- Standard call to check for call compatibility.
9680: IF NOT FND_API.Compatible_API_Call ( l_api_version,
9681: p_api_version,
9682: l_api_name ,
9683: 'CST_eamCost_PUB')
9684: THEN
9681: p_api_version,
9682: l_api_name ,
9683: 'CST_eamCost_PUB')
9684: THEN
9685: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9686: END IF;
9687: -- Initialize message list if p_init_msg_list is set to TRUE.
9688: IF FND_API.to_Boolean( p_init_msg_list ) THEN
9689: FND_MSG_PUB.initialize;
9684: THEN
9685: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9686: END IF;
9687: -- Initialize message list if p_init_msg_list is set to TRUE.
9688: IF FND_API.to_Boolean( p_init_msg_list ) THEN
9689: FND_MSG_PUB.initialize;
9690: END IF;
9691:
9692: if( l_pLog ) then
9695: end if;
9696:
9697:
9698: -- Initialize API return status to success
9699: x_return_status := FND_API.G_RET_STS_SUCCESS;
9700:
9701: l_stmt_num := 10;
9702:
9703: /* Delete data from CST_EAM_BALANCE_BY_ACCOUNTS */
9706: where wip_entity_id = p_entity_id_tab(l_index)
9707: and organization_id=p_org_id;
9708:
9709: -- Standard check of p_commit.
9710: IF FND_API.To_Boolean( p_commit ) THEN
9711: COMMIT WORK;
9712: END IF;
9713:
9714: /* Procedure level log message for Exit point */
9726: p_data => x_msg_data
9727: );
9728:
9729: EXCEPTION
9730: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9731: ROLLBACK TO Delete_eamBalAcct_PUB;
9732: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
9733:
9734: IF (l_uLog) THEN
9728:
9729: EXCEPTION
9730: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9731: ROLLBACK TO Delete_eamBalAcct_PUB;
9732: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
9733:
9734: IF (l_uLog) THEN
9735: FND_LOG.STRING(
9736: FND_LOG.LEVEL_UNEXPECTED,
9743: p_data => x_msg_data
9744: );
9745: WHEN OTHERS THEN
9746: ROLLBACK TO Delete_eamBalAcct_PUB;
9747: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
9748:
9749: IF (l_uLog) THEN
9750: FND_LOG.STRING(
9751: FND_LOG.LEVEL_UNEXPECTED,
9770:
9771: PROCEDURE Insert_tempEstimateDetails
9772: (
9773: p_api_version IN NUMBER,
9774: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
9775: p_commit IN VARCHAR2 := FND_API.G_FALSE,
9776: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
9777: x_return_status OUT NOCOPY VARCHAR2,
9778: x_msg_count OUT NOCOPY NUMBER,
9771: PROCEDURE Insert_tempEstimateDetails
9772: (
9773: p_api_version IN NUMBER,
9774: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
9775: p_commit IN VARCHAR2 := FND_API.G_FALSE,
9776: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
9777: x_return_status OUT NOCOPY VARCHAR2,
9778: x_msg_count OUT NOCOPY NUMBER,
9779: x_msg_data OUT NOCOPY VARCHAR2,
9772: (
9773: p_api_version IN NUMBER,
9774: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
9775: p_commit IN VARCHAR2 := FND_API.G_FALSE,
9776: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
9777: x_return_status OUT NOCOPY VARCHAR2,
9778: x_msg_count OUT NOCOPY NUMBER,
9779: x_msg_data OUT NOCOPY VARCHAR2,
9780: p_entity_id_tab IN CSTPECEP.wip_entity_id_type
9831: -- Standard Start of API savepoint
9832: SAVEPOINT Insert_tempEstimateDetails_PUB;
9833:
9834: -- Standard call to check for call compatibility.
9835: IF NOT FND_API.Compatible_API_Call (l_api_version,
9836: p_api_version,
9837: l_api_name ,
9838: 'CST_eamCost_PUB') THEN
9839:
9836: p_api_version,
9837: l_api_name ,
9838: 'CST_eamCost_PUB') THEN
9839:
9840: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9841:
9842: END IF;
9843:
9844: -- Initialize message list if p_init_msg_list is set to TRUE.
9841:
9842: END IF;
9843:
9844: -- Initialize message list if p_init_msg_list is set to TRUE.
9845: IF FND_API.to_Boolean( p_init_msg_list ) THEN
9846: FND_MSG_PUB.initialize;
9847: END IF;
9848:
9849: IF( l_pLog ) THEN
9851: l_module || '.begin', 'Start of ' || l_full_name );
9852: END IF;
9853:
9854: -- Initialize API return status to success
9855: x_return_status := FND_API.G_RET_STS_SUCCESS;
9856:
9857: l_stmt_num := 10;
9858:
9859: /* Insert rows for POs for Direct Items */
10124:
10125: PO_SHARED_PROC_GRP.check_shared_proc_scenario
10126: (
10127: p_api_version => 1.0,
10128: p_init_msg_list => FND_API.G_FALSE,
10129: x_return_status => l_return_status,
10130: p_destination_type_code => 'SHOP FLOOR',
10131: p_document_type_code => c_cedi_rec.document_type,
10132: p_project_id => c_cedi_rec.project_id,
10197: x_return_status => x_return_status,
10198: x_msg_count => x_msg_count,
10199: x_msg_data => x_msg_data
10200: );
10201: IF l_return_status <> FND_API.G_RET_STS_SUCCESS
10202: THEN
10203: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
10204: END IF;
10205:
10199: x_msg_data => x_msg_data
10200: );
10201: IF l_return_status <> FND_API.G_RET_STS_SUCCESS
10202: THEN
10203: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
10204: END IF;
10205:
10206: IF l_gather_stats = 1
10207: THEN
10207: THEN
10208: l_stmt_num := 37;
10209: IF NOT FND_INSTALLATION.GET_APP_INFO('BOM', l_status, l_industry, l_schema)
10210: THEN
10211: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
10212: END IF;
10213:
10214: IF l_schema IS NOT NULL
10215: THEN
10223:
10224: l_stmt_num := 40;
10225:
10226: -- Standard check of p_commit.
10227: IF FND_API.To_Boolean( p_commit ) THEN
10228: COMMIT WORK;
10229: END IF;
10230:
10231: /* Procedure level log message for Exit point */
10243: p_data => x_msg_data
10244: );
10245:
10246: EXCEPTION
10247: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
10248: ROLLBACK TO Insert_tempEstimateDetails_PUB;
10249: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
10250:
10251: IF (l_uLog) THEN
10245:
10246: EXCEPTION
10247: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
10248: ROLLBACK TO Insert_tempEstimateDetails_PUB;
10249: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
10250:
10251: IF (l_uLog) THEN
10252: FND_LOG.STRING(
10253: FND_LOG.LEVEL_UNEXPECTED,
10261: );
10262:
10263: WHEN OTHERS THEN
10264: ROLLBACK TO Insert_tempEstimateDetails_PUB;
10265: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
10266:
10267: IF (l_uLog) THEN
10268: FND_LOG.STRING(
10269: FND_LOG.LEVEL_UNEXPECTED,