222: /*=========================================================================== */
223:
224: PROCEDURE Process_MatCost(
225: p_api_version IN NUMBER,
226: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
227: p_commit IN VARCHAR2 := FND_API.G_FALSE,
228: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
229: x_return_status OUT NOCOPY VARCHAR2,
230: x_msg_count OUT NOCOPY NUMBER,
223:
224: PROCEDURE Process_MatCost(
225: p_api_version IN NUMBER,
226: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
227: p_commit IN VARCHAR2 := FND_API.G_FALSE,
228: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
229: x_return_status OUT NOCOPY VARCHAR2,
230: x_msg_count OUT NOCOPY NUMBER,
231: x_msg_data OUT NOCOPY VARCHAR2,
224: PROCEDURE Process_MatCost(
225: p_api_version IN NUMBER,
226: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
227: p_commit IN VARCHAR2 := FND_API.G_FALSE,
228: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
229: x_return_status OUT NOCOPY VARCHAR2,
230: x_msg_count OUT NOCOPY NUMBER,
231: x_msg_data OUT NOCOPY VARCHAR2,
232: p_txn_id IN NUMBER,
238: ) IS
239: l_api_name CONSTANT VARCHAR2(30) := 'Process_MatCost';
240: l_api_version CONSTANT NUMBER := 1.0;
241:
242: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
243: l_msg_count NUMBER := 0;
244: l_msg_data VARCHAR2(8000);
245: l_stmt_num NUMBER := 0;
246: l_api_message VARCHAR2(1000);
262: l_debug := fnd_profile.value('MRP_DEBUG');
263:
264:
265: -- Standard call to check for call compatibility
266: IF NOT FND_API.Compatible_API_Call (
267: l_api_version,
268: p_api_version,
269: l_api_name,
270: G_PKG_NAME ) THEN
267: l_api_version,
268: p_api_version,
269: l_api_name,
270: G_PKG_NAME ) THEN
271: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
272: END IF;
273:
274: -- Initialize message list if p_init_msg_list is set to TRUE
275: IF FND_API.to_Boolean(p_init_msg_list) THEN
271: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
272: END IF;
273:
274: -- Initialize message list if p_init_msg_list is set to TRUE
275: IF FND_API.to_Boolean(p_init_msg_list) THEN
276: FND_MSG_PUB.initialize;
277: END IF;
278:
279: -- Initialize API return status to success
276: FND_MSG_PUB.initialize;
277: END IF;
278:
279: -- Initialize API return status to success
280: x_return_status := FND_API.G_RET_STS_SUCCESS;
281:
282: -- Get MMT info
283: l_stmt_num := 10;
284: SELECT transaction_source_id,
331: p_prog_app_id => p_prog_app_id,
332: p_login_id => p_login_id,
333: p_txn_date => l_txn_date);
334:
335: IF l_return_status <> FND_API.g_ret_sts_success THEN
336: FND_FILE.put_line(FND_FILE.log, x_msg_data);
337: l_api_message := 'Update_eamCost returned error';
338: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
339: FND_MESSAGE.set_token('TEXT', l_api_message);
337: l_api_message := 'Update_eamCost returned error';
338: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
339: FND_MESSAGE.set_token('TEXT', l_api_message);
340: FND_MSG_pub.add;
341: RAISE FND_API.g_exc_error;
342: END IF;
343:
344: --- Standard check of p_commit
345: IF FND_API.to_Boolean(p_commit) THEN
341: RAISE FND_API.g_exc_error;
342: END IF;
343:
344: --- Standard check of p_commit
345: IF FND_API.to_Boolean(p_commit) THEN
346: COMMIT WORK;
347: END IF;
348:
349: -- Standard Call to get message count and if count = 1, get message info
352: p_data => x_msg_data );
353:
354:
355: EXCEPTION
356: WHEN FND_API.g_exc_error THEN
357: ROLLBACK TO Process_MatCost_PUB;
358: x_return_status := FND_API.g_ret_sts_error;
359:
360: -- Get message count and data
354:
355: EXCEPTION
356: WHEN FND_API.g_exc_error THEN
357: ROLLBACK TO Process_MatCost_PUB;
358: x_return_status := FND_API.g_ret_sts_error;
359:
360: -- Get message count and data
361: FND_MSG_PUB.count_and_get
362: ( p_count => x_msg_count
362: ( p_count => x_msg_count
363: , p_data => x_msg_data
364: );
365:
366: WHEN FND_API.g_exc_unexpected_error THEN
367: ROLLBACK TO Process_MatCost_PUB;
368: x_return_status := FND_API.g_ret_sts_unexp_error ;
369:
370: -- Get message count and data
364: );
365:
366: WHEN FND_API.g_exc_unexpected_error THEN
367: ROLLBACK TO Process_MatCost_PUB;
368: x_return_status := FND_API.g_ret_sts_unexp_error ;
369:
370: -- Get message count and data
371: FND_MSG_PUB.count_and_get
372: ( p_count => x_msg_count
374: );
375:
376: WHEN OTHERS THEN
377: ROLLBACK TO Process_MatCost_PUB;
378: x_return_status := fnd_api.g_ret_sts_unexp_error ;
379:
380: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
381: THEN
382: FND_MSG_PUB.add_exc_msg
410: /*=========================================================================== */
411:
412: PROCEDURE Process_ResCost(
413: p_api_version IN NUMBER,
414: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
415: p_commit IN VARCHAR2 := FND_API.G_FALSE,
416: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
417: x_return_status OUT NOCOPY VARCHAR2,
418: x_msg_count OUT NOCOPY NUMBER,
411:
412: PROCEDURE Process_ResCost(
413: p_api_version IN NUMBER,
414: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
415: p_commit IN VARCHAR2 := FND_API.G_FALSE,
416: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
417: x_return_status OUT NOCOPY VARCHAR2,
418: x_msg_count OUT NOCOPY NUMBER,
419: x_msg_data OUT NOCOPY VARCHAR2,
412: PROCEDURE Process_ResCost(
413: p_api_version IN NUMBER,
414: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
415: p_commit IN VARCHAR2 := FND_API.G_FALSE,
416: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
417: x_return_status OUT NOCOPY VARCHAR2,
418: x_msg_count OUT NOCOPY NUMBER,
419: x_msg_data OUT NOCOPY VARCHAR2,
420: p_group_id IN NUMBER,
426: ) IS
427: l_api_name CONSTANT VARCHAR2(30) := 'Process_ResCost';
428: l_api_version CONSTANT NUMBER := 1.0;
429:
430: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
431: l_msg_count NUMBER := 0;
432: l_msg_data VARCHAR2(8000);
433: l_stmt_num NUMBER := 0;
434: l_api_message VARCHAR2(1000);
479: end if;
480:
481:
482: -- Standard call to check for call compatibility
483: IF NOT FND_API.Compatible_API_Call (
484: l_api_version,
485: p_api_version,
486: l_api_name,
487: G_PKG_NAME ) THEN
484: l_api_version,
485: p_api_version,
486: l_api_name,
487: G_PKG_NAME ) THEN
488: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
489: END IF;
490:
491: -- Initialize message list if p_init_msg_list is set to TRUE
492: IF FND_API.to_Boolean(p_init_msg_list) THEN
488: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
489: END IF;
490:
491: -- Initialize message list if p_init_msg_list is set to TRUE
492: IF FND_API.to_Boolean(p_init_msg_list) THEN
493: FND_MSG_PUB.initialize;
494: END IF;
495:
496: -- Initialize API return status to success
493: FND_MSG_PUB.initialize;
494: END IF;
495:
496: -- Initialize API return status to success
497: x_return_status := FND_API.G_RET_STS_SUCCESS;
498:
499: -- Loop thru cursor to process the fetched resource transactions
500: FOR l_resourcetxn_rec IN l_resourcetxn_csr LOOP
501: l_stmt_num := 40;
546: p_prog_app_id => p_prog_app_id,
547: p_login_id => p_login_id,
548: p_txn_date => l_resourcetxn_rec.txn_date);
549:
550: IF l_return_status <> FND_API.g_ret_sts_success THEN
551: FND_FILE.put_line(FND_FILE.log, x_msg_data);
552: l_api_message := 'Update_eamCost returned error';
553: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
554: FND_MESSAGE.set_token('TEXT', l_api_message);
552: l_api_message := 'Update_eamCost returned error';
553: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
554: FND_MESSAGE.set_token('TEXT', l_api_message);
555: FND_MSG_pub.add;
556: RAISE FND_API.g_exc_error;
557: END IF;
558:
559: END LOOP;
560:
558:
559: END LOOP;
560:
561: --- Standard check of p_commit
562: IF FND_API.to_Boolean(p_commit) THEN
563: COMMIT WORK;
564: END IF;
565:
566: -- Standard Call to get message count and if count = 1, get message info
569: p_data => x_msg_data );
570:
571:
572: EXCEPTION
573: WHEN FND_API.g_exc_error THEN
574: ROLLBACK TO Process_ResCost_PUB;
575: x_return_status := FND_API.g_ret_sts_error;
576:
577: -- Get message count and data
571:
572: EXCEPTION
573: WHEN FND_API.g_exc_error THEN
574: ROLLBACK TO Process_ResCost_PUB;
575: x_return_status := FND_API.g_ret_sts_error;
576:
577: -- Get message count and data
578: FND_MSG_PUB.count_and_get
579: ( p_count => x_msg_count
579: ( p_count => x_msg_count
580: , p_data => x_msg_data
581: );
582:
583: WHEN FND_API.g_exc_unexpected_error THEN
584: ROLLBACK TO Process_ResCost_PUB;
585: x_return_status := FND_API.g_ret_sts_unexp_error ;
586:
587: -- Get message count and data
581: );
582:
583: WHEN FND_API.g_exc_unexpected_error THEN
584: ROLLBACK TO Process_ResCost_PUB;
585: x_return_status := FND_API.g_ret_sts_unexp_error ;
586:
587: -- Get message count and data
588: FND_MSG_PUB.count_and_get
589: ( p_count => x_msg_count
591: );
592:
593: WHEN OTHERS THEN
594: ROLLBACK TO Process_ResCost_PUB;
595: x_return_status := fnd_api.g_ret_sts_unexp_error ;
596:
597: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
598: THEN
599: FND_MSG_PUB.add_exc_msg
658: /* =============================================================================== */
659:
660: PROCEDURE Update_eamCost (
661: p_api_version IN NUMBER,
662: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
663: p_commit IN VARCHAR2 := FND_API.G_FALSE,
664: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
665: x_return_status OUT NOCOPY VARCHAR2,
666: x_msg_count OUT NOCOPY NUMBER,
659:
660: PROCEDURE Update_eamCost (
661: p_api_version IN NUMBER,
662: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
663: p_commit IN VARCHAR2 := FND_API.G_FALSE,
664: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
665: x_return_status OUT NOCOPY VARCHAR2,
666: x_msg_count OUT NOCOPY NUMBER,
667: x_msg_data OUT NOCOPY VARCHAR2,
660: PROCEDURE Update_eamCost (
661: p_api_version IN NUMBER,
662: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
663: p_commit IN VARCHAR2 := FND_API.G_FALSE,
664: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
665: x_return_status OUT NOCOPY VARCHAR2,
666: x_msg_count OUT NOCOPY NUMBER,
667: x_msg_data OUT NOCOPY VARCHAR2,
668: p_txn_mode IN NUMBER, -- 1=material, 2=resource, 4=direct item
687:
688: l_api_name CONSTANT VARCHAR2(30) := 'Update_eamCost';
689: l_api_version CONSTANT NUMBER := 1.0;
690:
691: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
692: l_msg_count NUMBER := 0;
693: l_msg_data VARCHAR2(8000);
694: l_stmt_num NUMBER := 0;
695: l_api_message VARCHAR2(1000);
720: fnd_file.put_line(fnd_file.log, 'In Update_eamCost');
721: end if;
722:
723: -- Standard call to check for call compatibility
724: IF NOT FND_API.Compatible_API_Call (
725: l_api_version,
726: p_api_version,
727: l_api_name,
728: G_PKG_NAME ) THEN
725: l_api_version,
726: p_api_version,
727: l_api_name,
728: G_PKG_NAME ) THEN
729: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
730: END IF;
731:
732: -- Initialize message list if p_init_msg_list is set to TRUE
733: IF FND_API.to_Boolean(p_init_msg_list) THEN
729: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
730: END IF;
731:
732: -- Initialize message list if p_init_msg_list is set to TRUE
733: IF FND_API.to_Boolean(p_init_msg_list) THEN
734: FND_MSG_PUB.initialize;
735: END IF;
736:
737: -- Initialize API return status to success
734: FND_MSG_PUB.initialize;
735: END IF;
736:
737: -- Initialize API return status to success
738: x_return_status := FND_API.G_RET_STS_SUCCESS;
739:
740: IF (p_txn_mode not in (1,2,3,4) OR
741: p_value_type not in (1,2) OR
742: (p_resource_id is not null AND
746: p_period_name is null))) THEN
747: FND_MESSAGE.set_name('BOM', 'CST_INVALID_PARAMS');
748: FND_MESSAGE.set_token('JOB', p_wip_entity_id);
749: FND_MSG_PUB.ADD;
750: RAISE FND_API.g_exc_error;
751: END IF;
752:
753: FND_FILE.PUT_LINE(FND_FILE.LOG, 'Processing job '
754: || to_char(p_wip_entity_id));
767: l_api_message := l_api_message ||'Job id: '|| TO_CHAR(p_wip_entity_id);
768: FND_MESSAGE.set_name('BOM', 'CST_API_MESSAGE');
769: FND_MESSAGE.set_token('TEXT', l_api_message);
770: FND_MSG_PUB.ADD;
771: RAISE fnd_api.g_exc_error;
772: END IF;
773:
774: l_stmt_num := 62;
775: -- Get charge asset using API
782: x_return_status => l_return_status,
783: x_msg_count => l_msg_count,
784: x_msg_data => l_msg_data);
785:
786: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) then
787: FND_MESSAGE.set_token('TEXT', l_api_message);
788: FND_MSG_PUB.ADD;
789: RAISE fnd_api.g_exc_error;
790: END IF;
785:
786: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) then
787: FND_MESSAGE.set_token('TEXT', l_api_message);
788: FND_MSG_PUB.ADD;
789: RAISE fnd_api.g_exc_error;
790: END IF;
791:
792: ------------------------------------------------------------
793: -- Get eam cost element
808: p_mnt_or_mfg => 1,
809: x_cost_element_id => l_eam_cost_element
810: );
811:
812: if (l_return_status <> fnd_api.g_ret_sts_success) then
813: FND_FILE.put_line(FND_FILE.log, x_msg_data);
814: l_api_message := 'get_CostElement_for_DirectItem returned unexpected error';
815: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
816: FND_MESSAGE.set_token('TEXT', l_api_message);
814: l_api_message := 'get_CostElement_for_DirectItem returned unexpected error';
815: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
816: FND_MESSAGE.set_token('TEXT', l_api_message);
817: FND_MSG_pub.add;
818: raise fnd_api.g_exc_unexpected_error;
819: end if;
820:
821: if (l_debug = 'Y') then
822: FND_FILE.PUT_LINE(FND_FILE.LOG,'eam_cost_element_id: '|| to_char(l_eam_cost_element));
829: l_api_message := 'Get_eamCostElement returned error';
830: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
831: FND_MESSAGE.set_token('TEXT', l_api_message);
832: FND_MSG_pub.add;
833: RAISE FND_API.g_exc_error;
834: END IF;
835: end if; /* p_txn_mode */
836:
837: --------------------------------------------------------------
875: AND organization_id = p_org_id;
876:
877: ELSE
878: l_stmt_num := 80;
879: l_return_status := FND_API.G_RET_STS_SUCCESS;
880:
881: if (l_debug = 'Y') then
882: fnd_file.put_line(fnd_file.log, 'Getting maint Cost_category');
883: end if;
892: x_operation_dept => l_dept_id,
893: x_owning_dept => l_owning_dept_id,
894: x_maint_cost_cat => l_maint_cost_category);
895:
896: IF l_return_status <> FND_API.g_ret_sts_success THEN
897: FND_FILE.put_line(FND_FILE.log, x_msg_data);
898: l_api_message := 'Get_MaintCostCat returned error';
899: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
900: FND_MESSAGE.set_token('TEXT', l_api_message);
898: l_api_message := 'Get_MaintCostCat returned error';
899: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
900: FND_MESSAGE.set_token('TEXT', l_api_message);
901: FND_MSG_pub.add;
902: RAISE FND_API.g_exc_error;
903: END IF;
904:
905: END IF; -- end checking p_txn_mode
906:
935: p_prog_app_id => p_prog_app_id,
936: p_login_id => p_login_id,
937: p_txn_date => p_txn_date);
938:
939: IF l_return_status <> FND_API.g_ret_sts_success THEN
940: FND_FILE.put_line(FND_FILE.log, x_msg_data);
941: l_api_message := 'InsertUpdate_eamPerBal returned error';
942: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
943: FND_MESSAGE.set_token('TEXT', l_api_message);
941: l_api_message := 'InsertUpdate_eamPerBal returned error';
942: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
943: FND_MESSAGE.set_token('TEXT', l_api_message);
944: FND_MSG_pub.add;
945: RAISE FND_API.g_exc_error;
946: END IF;
947:
948: --- Standard check of p_commit
949: IF FND_API.to_Boolean(p_commit) THEN
945: RAISE FND_API.g_exc_error;
946: END IF;
947:
948: --- Standard check of p_commit
949: IF FND_API.to_Boolean(p_commit) THEN
950: COMMIT WORK;
951: END IF;
952:
953: -- Standard Call to get message count and if count = 1, get message info
956: p_data => x_msg_data );
957:
958:
959: EXCEPTION
960: WHEN FND_API.g_exc_error THEN
961: FND_FILE.PUT_LINE(fnd_file.log,'1 exception ' || SQLERRM );
962: ROLLBACK TO Update_eamCost_PUB;
963: x_return_status := FND_API.g_ret_sts_error;
964:
959: EXCEPTION
960: WHEN FND_API.g_exc_error THEN
961: FND_FILE.PUT_LINE(fnd_file.log,'1 exception ' || SQLERRM );
962: ROLLBACK TO Update_eamCost_PUB;
963: x_return_status := FND_API.g_ret_sts_error;
964:
965: -- Get message count and data
966: FND_MSG_PUB.count_and_get
967: ( p_count => x_msg_count
967: ( p_count => x_msg_count
968: , p_data => x_msg_data
969: );
970:
971: WHEN FND_API.g_exc_unexpected_error THEN
972: FND_FILE.PUT_LINE(fnd_file.log,'1 exception ' || SQLERRM );
973: ROLLBACK TO Update_eamCost_PUB;
974: x_return_status := FND_API.g_ret_sts_unexp_error ;
975:
970:
971: WHEN FND_API.g_exc_unexpected_error THEN
972: FND_FILE.PUT_LINE(fnd_file.log,'1 exception ' || SQLERRM );
973: ROLLBACK TO Update_eamCost_PUB;
974: x_return_status := FND_API.g_ret_sts_unexp_error ;
975:
976: -- Get message count and data
977: FND_MSG_PUB.count_and_get
978: ( p_count => x_msg_count
981:
982: WHEN OTHERS THEN
983: fnd_file.put_line(fnd_file.log, 'Exception in Update_eamcost'|| SQLERRM);
984: ROLLBACK TO Update_eamCost_PUB;
985: x_return_status := fnd_api.g_ret_sts_unexp_error ;
986:
987: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
988: THEN
989: FND_MSG_PUB.add_exc_msg
1037: ------------------------------------------------------------------------------
1038:
1039: PROCEDURE InsertUpdate_eamPerBal (
1040: p_api_version IN NUMBER,
1041: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1042: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1043: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
1044: x_return_status OUT NOCOPY VARCHAR2,
1045: x_msg_count OUT NOCOPY NUMBER,
1038:
1039: PROCEDURE InsertUpdate_eamPerBal (
1040: p_api_version IN NUMBER,
1041: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1042: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1043: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
1044: x_return_status OUT NOCOPY VARCHAR2,
1045: x_msg_count OUT NOCOPY NUMBER,
1046: x_msg_data OUT NOCOPY VARCHAR2,
1039: PROCEDURE InsertUpdate_eamPerBal (
1040: p_api_version IN NUMBER,
1041: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1042: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1043: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
1044: x_return_status OUT NOCOPY VARCHAR2,
1045: x_msg_count OUT NOCOPY NUMBER,
1046: x_msg_data OUT NOCOPY VARCHAR2,
1047: p_period_id IN NUMBER := null,
1068:
1069: l_api_name CONSTANT VARCHAR2(30) := 'InsertUpdate_eamPerBal';
1070: l_api_version CONSTANT NUMBER := 1.0;
1071:
1072: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
1073: l_msg_count NUMBER := 0;
1074: l_msg_data VARCHAR2(8000);
1075: l_stmt_num NUMBER := 0;
1076: l_api_message VARCHAR2(1000);
1137: FND_FILE.PUT_LINE(fnd_file.log,'p_asset_group_id: ' || to_char( p_asset_group_id ));
1138: end if;
1139:
1140: -- Standard call to check for call compatibility
1141: IF NOT FND_API.Compatible_API_Call (
1142: l_api_version,
1143: p_api_version,
1144: l_api_name,
1145: G_PKG_NAME ) THEN
1142: l_api_version,
1143: p_api_version,
1144: l_api_name,
1145: G_PKG_NAME ) THEN
1146: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1147: END IF;
1148:
1149: -- Initialize message list if p_init_msg_list is set to TRUE
1150: IF FND_API.to_Boolean(p_init_msg_list) THEN
1146: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1147: END IF;
1148:
1149: -- Initialize message list if p_init_msg_list is set to TRUE
1150: IF FND_API.to_Boolean(p_init_msg_list) THEN
1151: FND_MSG_PUB.initialize;
1152: END IF;
1153:
1154: -- Initialize API return status to success
1151: FND_MSG_PUB.initialize;
1152: END IF;
1153:
1154: -- Initialize API return status to success
1155: x_return_status := FND_API.G_RET_STS_SUCCESS;
1156:
1157: -------------------------------------------------------------
1158: -- Get period id if period set name and period name is passed
1159: -- and vice versa
1168: l_api_message := 'Job id: ' || TO_CHAR(p_wip_entity_id);
1169: FND_MESSAGE.set_name('BOM', 'CST_API_MESSAGE');
1170: FND_MESSAGE.set_token('TEXT', l_api_message);
1171: FND_MSG_PUB.ADD;
1172: RAISE FND_API.g_exc_error;
1173: END IF;
1174:
1175: -- Get data from org_acct_periods if it is an open period.
1176: BEGIN
1496:
1497:
1498: --BUG#5985039 FP BUG#5984909
1499: -- If return status is not success, raise error
1500: IF l_return_status <> FND_API.g_ret_sts_success THEN
1501: l_api_message := 'InsertUpdate_assetPerBal error';
1502: FND_MSG_PUB.add_exc_msg
1503: ( 'CST_eamCost_PUB',
1504: 'InsertUpdate_eamPerBal('||to_char(l_stmt_num) || ')', l_api_message);
1501: l_api_message := 'InsertUpdate_assetPerBal error';
1502: FND_MSG_PUB.add_exc_msg
1503: ( 'CST_eamCost_PUB',
1504: 'InsertUpdate_eamPerBal('||to_char(l_stmt_num) || ')', l_api_message);
1505: RAISE FND_API.g_exc_error;
1506: END IF;
1507:
1508: END LOOP;
1509:
1535: );
1536:
1537: --BUG#5985039 - FPBUG 5984909
1538: -- If return status is not success, raise error
1539: IF l_return_status <> FND_API.g_ret_sts_success THEN
1540: l_api_message := 'InsertUpdate_assetPerBal error';
1541: FND_MSG_PUB.add_exc_msg
1542: ( 'CST_eamCost_PUB',
1543: 'InsertUpdate_eamPerBal('||to_char(l_stmt_num) || ')', l_api_message);
1540: l_api_message := 'InsertUpdate_assetPerBal error';
1541: FND_MSG_PUB.add_exc_msg
1542: ( 'CST_eamCost_PUB',
1543: 'InsertUpdate_eamPerBal('||to_char(l_stmt_num) || ')', l_api_message);
1544: RAISE FND_API.g_exc_error;
1545: END IF;
1546:
1547:
1548:
1552: FND_FILE.PUT_LINE(fnd_file.log,'inserted into cst_eam_asset_per_balances' );
1553: end if;
1554:
1555: -- Standard check of p_commit
1556: IF FND_API.to_Boolean(p_commit) THEN
1557: COMMIT WORK;
1558: END IF;
1559:
1560: -- Standard Call to get message count and if count = 1, get message info
1563: p_data => x_msg_data );
1564:
1565: EXCEPTION
1566:
1567: WHEN FND_API.g_exc_error THEN
1568: FND_FILE.PUT_LINE(fnd_file.log,' exception' || SQLERRM );
1569: ROLLBACK TO InsertUpdate_eamPerBal_PUB;
1570: x_return_status := FND_API.g_ret_sts_error;
1571:
1566:
1567: WHEN FND_API.g_exc_error THEN
1568: FND_FILE.PUT_LINE(fnd_file.log,' exception' || SQLERRM );
1569: ROLLBACK TO InsertUpdate_eamPerBal_PUB;
1570: x_return_status := FND_API.g_ret_sts_error;
1571:
1572: -- Get message count and data
1573: FND_MSG_PUB.count_and_get
1574: ( p_count => x_msg_count
1574: ( p_count => x_msg_count
1575: , p_data => x_msg_data
1576: );
1577:
1578: WHEN FND_API.g_exc_unexpected_error THEN
1579: FND_FILE.PUT_LINE(fnd_file.log,' exception' || SQLERRM );
1580: ROLLBACK TO InsertUpdate_eamPerBal_PUB;
1581: x_return_status := FND_API.g_ret_sts_unexp_error ;
1582:
1577:
1578: WHEN FND_API.g_exc_unexpected_error THEN
1579: FND_FILE.PUT_LINE(fnd_file.log,' exception' || SQLERRM );
1580: ROLLBACK TO InsertUpdate_eamPerBal_PUB;
1581: x_return_status := FND_API.g_ret_sts_unexp_error ;
1582:
1583: -- Get message count and data
1584: FND_MSG_PUB.count_and_get
1585: ( p_count => x_msg_count
1588:
1589: WHEN OTHERS THEN
1590: FND_FILE.PUT_LINE(fnd_file.log,'exception' || SQLERRM );
1591: ROLLBACK TO InsertUpdate_eamPerBal_PUB;
1592: x_return_status := fnd_api.g_ret_sts_unexp_error ;
1593:
1594: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
1595: THEN
1596: FND_MSG_PUB.add_exc_msg
1648: ------------------------------------------------------------------------------
1649:
1650: PROCEDURE InsertUpdate_assetPerBal (
1651: p_api_version IN NUMBER,
1652: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1653: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1654: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
1655: x_return_status OUT NOCOPY VARCHAR2,
1656: x_msg_count OUT NOCOPY NUMBER,
1649:
1650: PROCEDURE InsertUpdate_assetPerBal (
1651: p_api_version IN NUMBER,
1652: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1653: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1654: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
1655: x_return_status OUT NOCOPY VARCHAR2,
1656: x_msg_count OUT NOCOPY NUMBER,
1657: x_msg_data OUT NOCOPY VARCHAR2,
1650: PROCEDURE InsertUpdate_assetPerBal (
1651: p_api_version IN NUMBER,
1652: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
1653: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1654: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
1655: x_return_status OUT NOCOPY VARCHAR2,
1656: x_msg_count OUT NOCOPY NUMBER,
1657: x_msg_data OUT NOCOPY VARCHAR2,
1658: p_period_id IN NUMBER := null,
1677:
1678: l_api_name CONSTANT VARCHAR2(30) := 'InsertUpdate_assetPerBal';
1679: l_api_version CONSTANT NUMBER := 1.0;
1680:
1681: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
1682: l_msg_count NUMBER := 0;
1683: l_msg_data VARCHAR2(8000);
1684: l_api_message VARCHAR2(1000);
1685:
1704: FND_FILE.PUT_LINE(fnd_file.log,'p_asset_group_id: ' || to_char( p_asset_group_id ));
1705: end if;
1706:
1707: -- Standard call to check for call compatibility
1708: IF NOT FND_API.Compatible_API_Call (
1709: l_api_version,
1710: p_api_version,
1711: l_api_name,
1712: G_PKG_NAME ) THEN
1709: l_api_version,
1710: p_api_version,
1711: l_api_name,
1712: G_PKG_NAME ) THEN
1713: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1714: END IF;
1715:
1716: -- Initialize message list if p_init_msg_list is set to TRUE
1717: IF FND_API.to_Boolean(p_init_msg_list) THEN
1713: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1714: END IF;
1715:
1716: -- Initialize message list if p_init_msg_list is set to TRUE
1717: IF FND_API.to_Boolean(p_init_msg_list) THEN
1718: FND_MSG_PUB.initialize;
1719: END IF;
1720:
1721: -- Initialize API return status to success
1718: FND_MSG_PUB.initialize;
1719: END IF;
1720:
1721: -- Initialize API return status to success
1722: x_return_status := FND_API.G_RET_STS_SUCCESS;
1723:
1724: l_count := 0;
1725:
1726: SELECT count(*)
1813: END IF; -- end checking asset balance rowcount
1814:
1815:
1816: -- Standard check of p_commit
1817: IF FND_API.to_Boolean(p_commit) THEN
1818: COMMIT WORK;
1819: END IF;
1820:
1821: -- Standard Call to get message count and if count = 1, get message info
1824: p_data => x_msg_data );
1825:
1826: EXCEPTION
1827:
1828: WHEN FND_API.g_exc_error THEN
1829: FND_FILE.PUT_LINE(fnd_file.log,' exception' || SQLERRM );
1830: ROLLBACK TO InsertUpdate_assetPerBal_PUB;
1831: x_return_status := FND_API.g_ret_sts_error;
1832: -- Get message count and data
1827:
1828: WHEN FND_API.g_exc_error THEN
1829: FND_FILE.PUT_LINE(fnd_file.log,' exception' || SQLERRM );
1830: ROLLBACK TO InsertUpdate_assetPerBal_PUB;
1831: x_return_status := FND_API.g_ret_sts_error;
1832: -- Get message count and data
1833: FND_MSG_PUB.count_and_get
1834: ( p_count => x_msg_count
1835: , p_data => x_msg_data
1834: ( p_count => x_msg_count
1835: , p_data => x_msg_data
1836: );
1837:
1838: WHEN FND_API.g_exc_unexpected_error THEN
1839: FND_FILE.PUT_LINE(fnd_file.log,' exception' || SQLERRM );
1840: ROLLBACK TO InsertUpdate_assetPerBal_PUB;
1841: x_return_status := FND_API.g_ret_sts_unexp_error ;
1842:
1837:
1838: WHEN FND_API.g_exc_unexpected_error THEN
1839: FND_FILE.PUT_LINE(fnd_file.log,' exception' || SQLERRM );
1840: ROLLBACK TO InsertUpdate_assetPerBal_PUB;
1841: x_return_status := FND_API.g_ret_sts_unexp_error ;
1842:
1843: -- Get message count and data
1844: FND_MSG_PUB.count_and_get
1845: ( p_count => x_msg_count
1848:
1849: WHEN OTHERS THEN
1850: FND_FILE.PUT_LINE(fnd_file.log,'exception' || SQLERRM );
1851: ROLLBACK TO InsertUpdate_assetPerBal_PUB;
1852: x_return_status := fnd_api.g_ret_sts_unexp_error ;
1853:
1854: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
1855: THEN
1856: FND_MSG_PUB.add_exc_msg
2026: -- use the Work order owning dept for costing
2027:
2028: ------------------------------------------------------------------------
2029: -- Initialize return status to success.
2030: x_return_status := FND_API.G_RET_STS_SUCCESS;
2031:
2032: -- Get organization id, just in case we need to get default cost
2033: -- category from wip_eam_parameters later on.
2034: l_stmt_num := 215;
2148: WHEN OTHERS THEN
2149: FND_FILE.PUT_LINE(FND_FILE.LOG,'Get_MaintCostCat - statement '
2150: || l_stmt_num || ': '
2151: || substr(SQLERRM,1,200));
2152: x_return_status := FND_API.g_ret_sts_unexp_error ;
2153:
2154: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
2155: THEN
2156: FND_MSG_PUB.add_exc_msg
2182: /* ======================================================================= */
2183:
2184: PROCEDURE Delete_eamPerBal (
2185: p_api_version IN NUMBER,
2186: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
2187: p_commit IN VARCHAR2 := FND_API.G_FALSE,
2188: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
2189: x_return_status OUT NOCOPY VARCHAR2,
2190: x_msg_count OUT NOCOPY NUMBER,
2183:
2184: PROCEDURE Delete_eamPerBal (
2185: p_api_version IN NUMBER,
2186: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
2187: p_commit IN VARCHAR2 := FND_API.G_FALSE,
2188: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
2189: x_return_status OUT NOCOPY VARCHAR2,
2190: x_msg_count OUT NOCOPY NUMBER,
2191: x_msg_data OUT NOCOPY VARCHAR2,
2184: PROCEDURE Delete_eamPerBal (
2185: p_api_version IN NUMBER,
2186: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
2187: p_commit IN VARCHAR2 := FND_API.G_FALSE,
2188: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
2189: x_return_status OUT NOCOPY VARCHAR2,
2190: x_msg_count OUT NOCOPY NUMBER,
2191: x_msg_data OUT NOCOPY VARCHAR2,
2192: p_entity_id_tab IN CSTPECEP.wip_entity_id_type,
2196:
2197: l_api_name CONSTANT VARCHAR2(30) := 'Delete_eamPerBal';
2198: l_api_version CONSTANT NUMBER := 1.0;
2199:
2200: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
2201: l_msg_count NUMBER := 0;
2202: l_msg_data VARCHAR2(8000);
2203: l_stmt_num NUMBER := 0;
2204: l_api_message VARCHAR2(1000);
2246: -- Standard Start of API savepoint
2247: SAVEPOINT Delete_eamPerBal_PUB;
2248:
2249: -- Standard call to check for call compatibility
2250: IF NOT FND_API.Compatible_API_Call (
2251: l_api_version,
2252: p_api_version,
2253: l_api_name,
2254: G_PKG_NAME ) THEN
2251: l_api_version,
2252: p_api_version,
2253: l_api_name,
2254: G_PKG_NAME ) THEN
2255: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2256: END IF;
2257:
2258: -- Initialize message list if p_init_msg_list is set to TRUE
2259: IF FND_API.to_Boolean(p_init_msg_list) THEN
2255: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2256: END IF;
2257:
2258: -- Initialize message list if p_init_msg_list is set to TRUE
2259: IF FND_API.to_Boolean(p_init_msg_list) THEN
2260: FND_MSG_PUB.initialize;
2261: END IF;
2262:
2263: -- Initialize API return status to success
2260: FND_MSG_PUB.initialize;
2261: END IF;
2262:
2263: -- Initialize API return status to success
2264: x_return_status := FND_API.G_RET_STS_SUCCESS;
2265:
2266: -- Since passing parameter is a PL/SQL table, check if it has any element.
2267: -- Then proceed. First loop thru all and update, then bulk delete
2268: IF p_entity_id_tab.COUNT > 0 THEN
2607:
2608: END IF;
2609:
2610: EXCEPTION
2611: WHEN FND_API.g_exc_error THEN
2612: ROLLBACK TO Delete_eamPerBal_PUB;
2613: x_return_status := FND_API.g_ret_sts_error;
2614:
2615: -- Get message count and data
2609:
2610: EXCEPTION
2611: WHEN FND_API.g_exc_error THEN
2612: ROLLBACK TO Delete_eamPerBal_PUB;
2613: x_return_status := FND_API.g_ret_sts_error;
2614:
2615: -- Get message count and data
2616: FND_MSG_PUB.count_and_get
2617: ( p_count => x_msg_count
2617: ( p_count => x_msg_count
2618: , p_data => x_msg_data
2619: );
2620:
2621: WHEN FND_API.g_exc_unexpected_error THEN
2622: ROLLBACK TO Delete_eamPerBal_PUB;
2623: x_return_status := FND_API.g_ret_sts_unexp_error ;
2624:
2625: -- Get message count and data
2619: );
2620:
2621: WHEN FND_API.g_exc_unexpected_error THEN
2622: ROLLBACK TO Delete_eamPerBal_PUB;
2623: x_return_status := FND_API.g_ret_sts_unexp_error ;
2624:
2625: -- Get message count and data
2626: FND_MSG_PUB.count_and_get
2627: ( p_count => x_msg_count
2629: );
2630:
2631: WHEN OTHERS THEN
2632: ROLLBACK TO Delete_eamPerBal_PUB;
2633: x_return_status := fnd_api.g_ret_sts_unexp_error ;
2634:
2635: FND_FILE.PUT_LINE(FND_FILE.LOG,'Delete_eamPerBal - statement '
2636: || l_stmt_num || ': '
2637: || substr(SQLERRM,1,200));
2676: ----------------------------------------------------------------------------
2677: PROCEDURE Compute_Job_Estimate (
2678: p_api_version IN NUMBER,
2679: p_init_msg_list IN VARCHAR2
2680: := FND_API.G_FALSE,
2681: p_commit IN VARCHAR2
2682: := FND_API.G_FALSE,
2683: p_validation_level IN NUMBER
2684: := FND_API.G_VALID_LEVEL_FULL,
2678: p_api_version IN NUMBER,
2679: p_init_msg_list IN VARCHAR2
2680: := FND_API.G_FALSE,
2681: p_commit IN VARCHAR2
2682: := FND_API.G_FALSE,
2683: p_validation_level IN NUMBER
2684: := FND_API.G_VALID_LEVEL_FULL,
2685: p_debug IN VARCHAR2 := 'N',
2686: p_wip_entity_id IN NUMBER,
2680: := FND_API.G_FALSE,
2681: p_commit IN VARCHAR2
2682: := FND_API.G_FALSE,
2683: p_validation_level IN NUMBER
2684: := FND_API.G_VALID_LEVEL_FULL,
2685: p_debug IN VARCHAR2 := 'N',
2686: p_wip_entity_id IN NUMBER,
2687:
2688: p_user_id IN NUMBER,
2716: l_operation_dept_id NUMBER := 0;
2717: l_owning_dept_id NUMBER := 0;
2718: l_maint_cost_category NUMBER := 0;
2719: l_eam_cost_element NUMBER := 0;
2720: l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
2721: l_api_message VARCHAR2(10000);
2722: l_stmt_num NUMBER;
2723: l_dept_id NUMBER := 0;
2724: l_period_set_name VARCHAR2(15) := NULL;
3132:
3133: -------------------------------------------------------------------------
3134: -- standard call to check for call compatibility
3135: -------------------------------------------------------------------------
3136: IF NOT fnd_api.compatible_api_call (
3137: l_api_version,
3138: p_api_version,
3139: l_api_name,
3140: G_PKG_NAME ) then
3138: p_api_version,
3139: l_api_name,
3140: G_PKG_NAME ) then
3141:
3142: RAISE fnd_api.g_exc_unexpected_error;
3143:
3144: END IF;
3145:
3146: -------------------------------------------------------------------------
3146: -------------------------------------------------------------------------
3147: -- Initialize message list if p_init_msg_list is set to TRUE
3148: -------------------------------------------------------------------------
3149:
3150: IF FND_API.to_Boolean(p_init_msg_list) THEN
3151: FND_MSG_PUB.initialize;
3152: END IF;
3153:
3154:
3154:
3155: -------------------------------------------------------------------------
3156: -- initialize api return status to success
3157: -------------------------------------------------------------------------
3158: x_return_status := fnd_api.g_ret_sts_success;
3159:
3160: -- assign to local variables
3161: l_stmt_num := 10;
3162:
3181:
3182: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3183: ||TO_CHAR(l_stmt_num)
3184: ||'): ', l_api_message);
3185: RAISE FND_API.g_exc_error;
3186:
3187: ELSE
3188:
3189: l_stmt_num := 15;
3208: x_return_status => l_return_status,
3209: x_msg_count => l_msg_count,
3210: x_msg_data => l_msg_data);
3211:
3212: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) then
3213: FND_MESSAGE.set_token('TEXT', l_api_message);
3214: FND_MSG_PUB.ADD;
3215: RAISE fnd_api.g_exc_error;
3216: END IF;
3211:
3212: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) then
3213: FND_MESSAGE.set_token('TEXT', l_api_message);
3214: FND_MSG_PUB.ADD;
3215: RAISE fnd_api.g_exc_error;
3216: END IF;
3217:
3218:
3219: END IF;
3242: ||TO_CHAR(l_organization_id);
3243: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3244: ||TO_CHAR(l_stmt_num)
3245: ||'): ', l_api_message);
3246: RAISE FND_API.g_exc_error;
3247:
3248: END IF;
3249:
3250: END IF; -- check for wip_project_id <> -1
3321: l_api_message := l_api_message||TO_CHAR(l_trunc_le_sched_comp_date);
3322: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3323: ||TO_CHAR(l_stmt_num)
3324: ||'): ', l_api_message);
3325: RAISE FND_API.g_exc_error;
3326:
3327: END IF;
3328:
3329: -------------------------------------------------------------------------
3359:
3360: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3361: ||TO_CHAR(l_stmt_num)
3362: ||'): ', l_api_message);
3363: RAISE FND_API.g_exc_error;
3364:
3365:
3366: END IF;
3367:
3445: x_operation_dept => l_operation_dept_id,
3446: x_owning_dept => l_owning_dept_id,
3447: x_maint_cost_cat => l_maint_cost_category);
3448:
3449: IF l_return_status <> FND_API.g_ret_sts_success THEN
3450:
3451: l_api_message := 'Get_MaintCostCat returned error';
3452: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3453: ||TO_CHAR(l_stmt_num)
3451: l_api_message := 'Get_MaintCostCat returned error';
3452: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3453: ||TO_CHAR(l_stmt_num)
3454: ||'): ', l_api_message);
3455: RAISE FND_API.g_exc_error;
3456:
3457: END IF;
3458:
3459: l_stmt_num := 65;
3468: l_api_message := 'Get_eamCostElement returned error';
3469: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3470: ||TO_CHAR(l_stmt_num)
3471: ||'): ', l_api_message);
3472: RAISE FND_API.g_exc_error;
3473:
3474: END IF;
3475:
3476: IF (p_debug = 'Y') THEN
3510: p_prog_id => p_prog_id,
3511: p_prog_app_id => p_prog_app_id,
3512: p_login_id => p_login_id);
3513:
3514: IF l_return_status <> FND_API.g_ret_sts_success THEN
3515:
3516: l_api_message := 'insertupdate_eamperbal error';
3517: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3518: ||TO_CHAR(l_stmt_num)
3516: l_api_message := 'insertupdate_eamperbal error';
3517: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3518: ||TO_CHAR(l_stmt_num)
3519: ||'): ', l_api_message);
3520: RAISE FND_API.g_exc_error;
3521:
3522: END IF;
3523:
3524:
3550: END IF;
3551:
3552: Insert_eamBalAcct(
3553: p_api_version => 1.0,
3554: p_init_msg_list => FND_API.G_FALSE,
3555: p_commit => FND_API.G_FALSE,
3556: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3557: x_return_status => l_return_status,
3558: x_msg_count => l_msg_count,
3551:
3552: Insert_eamBalAcct(
3553: p_api_version => 1.0,
3554: p_init_msg_list => FND_API.G_FALSE,
3555: p_commit => FND_API.G_FALSE,
3556: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3557: x_return_status => l_return_status,
3558: x_msg_count => l_msg_count,
3559: x_msg_data => l_msg_data,
3552: Insert_eamBalAcct(
3553: p_api_version => 1.0,
3554: p_init_msg_list => FND_API.G_FALSE,
3555: p_commit => FND_API.G_FALSE,
3556: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3557: x_return_status => l_return_status,
3558: x_msg_count => l_msg_count,
3559: x_msg_data => l_msg_data,
3560: p_period_id => l_acct_period_id,
3577: p_prog_id => p_prog_id,
3578: p_prog_app_id => p_prog_app_id,
3579: p_login_id => p_login_id);
3580:
3581: IF l_return_status <> FND_API.g_ret_sts_success THEN
3582:
3583: l_api_message := 'Insert_eamBalAcct error';
3584: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
3585: ||TO_CHAR(l_stmt_num)
3583: l_api_message := 'Insert_eamBalAcct error';
3584: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
3585: ||TO_CHAR(l_stmt_num)
3586: ||'): ', l_api_message);
3587: RAISE FND_API.g_exc_error;
3588:
3589: END IF;
3590: ELSE
3591:
3659:
3660: p_prog_app_id => p_prog_app_id,
3661: p_login_id => p_login_id);
3662:
3663: IF l_return_status <> FND_API.g_ret_sts_success THEN
3664:
3665: l_api_message := 'insertupdate_eamperbal error';
3666:
3667: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3666:
3667: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3668: ||TO_CHAR(l_stmt_num)
3669: ||'): ', l_api_message);
3670: RAISE FND_API.g_exc_error;
3671:
3672: END IF;
3673:
3674: END LOOP; -- c_rbo_rec
3693: END IF;
3694:
3695: Insert_eamBalAcct(
3696: p_api_version => 1.0,
3697: p_init_msg_list => FND_API.G_FALSE,
3698: p_commit => FND_API.G_FALSE,
3699: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3700: x_return_status => l_return_status,
3701: x_msg_count => l_msg_count,
3694:
3695: Insert_eamBalAcct(
3696: p_api_version => 1.0,
3697: p_init_msg_list => FND_API.G_FALSE,
3698: p_commit => FND_API.G_FALSE,
3699: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3700: x_return_status => l_return_status,
3701: x_msg_count => l_msg_count,
3702: x_msg_data => l_msg_data,
3695: Insert_eamBalAcct(
3696: p_api_version => 1.0,
3697: p_init_msg_list => FND_API.G_FALSE,
3698: p_commit => FND_API.G_FALSE,
3699: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3700: x_return_status => l_return_status,
3701: x_msg_count => l_msg_count,
3702: x_msg_data => l_msg_data,
3703: p_period_id => l_acct_period_id,
3720: p_prog_id => p_prog_id,
3721: p_prog_app_id => p_prog_app_id,
3722: p_login_id => p_login_id);
3723:
3724: IF l_return_status <> FND_API.g_ret_sts_success THEN
3725:
3726: l_api_message := 'Insert_eamBalAcct error';
3727: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
3728: ||TO_CHAR(l_stmt_num)
3726: l_api_message := 'Insert_eamBalAcct error';
3727: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
3728: ||TO_CHAR(l_stmt_num)
3729: ||'): ', l_api_message);
3730: RAISE FND_API.g_exc_error;
3731:
3732: END IF;
3733:
3734: ELSE
3829: x_operation_dept => l_operation_dept_id,
3830: x_owning_dept => l_owning_dept_id,
3831: x_maint_cost_cat => l_maint_cost_category);
3832:
3833: IF l_return_status <> FND_API.g_ret_sts_success THEN
3834:
3835: l_api_message := 'Get_MaintCostCat returned error';
3836: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3837: ||TO_CHAR(l_stmt_num)
3835: l_api_message := 'Get_MaintCostCat returned error';
3836: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3837: ||TO_CHAR(l_stmt_num)
3838: ||'): ', l_api_message);
3839: RAISE FND_API.g_exc_error;
3840:
3841: END IF;
3842:
3843: l_stmt_num := 95;
3851: l_api_message := 'Get_eamCostElement returned error';
3852: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3853: ||TO_CHAR(l_stmt_num)
3854: ||'): ', l_api_message);
3855: RAISE FND_API.g_exc_error;
3856:
3857: END IF;
3858:
3859: IF (p_debug = 'Y') THEN
3893: p_prog_id => p_prog_id,
3894: p_prog_app_id => p_prog_app_id,
3895: p_login_id => p_login_id);
3896:
3897: IF l_return_status <> FND_API.g_ret_sts_success THEN
3898:
3899: l_api_message := 'INSERTUPDATE_EAMPERBAL ERROR';
3900:
3901: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3900:
3901: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
3902: ||TO_CHAR(l_stmt_num)
3903: ||'): ', l_api_message);
3904: RAISE FND_API.g_exc_error;
3905:
3906: END IF;
3907:
3908:
3925: END IF;
3926:
3927: Insert_eamBalAcct(
3928: p_api_version => 1.0,
3929: p_init_msg_list => FND_API.G_FALSE,
3930: p_commit => FND_API.G_FALSE,
3931: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3932: x_return_status => l_return_status,
3933: x_msg_count => l_msg_count,
3926:
3927: Insert_eamBalAcct(
3928: p_api_version => 1.0,
3929: p_init_msg_list => FND_API.G_FALSE,
3930: p_commit => FND_API.G_FALSE,
3931: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3932: x_return_status => l_return_status,
3933: x_msg_count => l_msg_count,
3934: x_msg_data => l_msg_data,
3927: Insert_eamBalAcct(
3928: p_api_version => 1.0,
3929: p_init_msg_list => FND_API.G_FALSE,
3930: p_commit => FND_API.G_FALSE,
3931: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
3932: x_return_status => l_return_status,
3933: x_msg_count => l_msg_count,
3934: x_msg_data => l_msg_data,
3935: p_period_id => l_acct_period_id,
3952: p_prog_id => p_prog_id,
3953: p_prog_app_id => p_prog_app_id,
3954: p_login_id => p_login_id);
3955:
3956: IF l_return_status <> FND_API.g_ret_sts_success THEN
3957:
3958: l_api_message := 'Insert_eamBalAcct error';
3959: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
3960: ||TO_CHAR(l_stmt_num)
3958: l_api_message := 'Insert_eamBalAcct error';
3959: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
3960: ||TO_CHAR(l_stmt_num)
3961: ||'): ', l_api_message);
3962: RAISE FND_API.g_exc_error;
3963:
3964: END IF;
3965:
3966: ELSE
4005: x_operation_dept => l_operation_dept_id,
4006: x_owning_dept => l_owning_dept_id,
4007: x_maint_cost_cat => l_maint_cost_category);
4008:
4009: IF l_return_status <> FND_API.g_ret_sts_success THEN
4010:
4011: l_api_message := 'Get_MaintCostCat returned error';
4012:
4013: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4012:
4013: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4014: ||TO_CHAR(l_stmt_num)
4015: ||'): ', l_api_message);
4016: RAISE FND_API.g_exc_error;
4017:
4018: END IF;
4019:
4020: l_stmt_num := 115;
4029:
4030: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4031: ||TO_CHAR(l_stmt_num)
4032: ||'): ', l_api_message);
4033: RAISE FND_API.g_exc_error;
4034:
4035: END IF;
4036:
4037: IF (p_debug = 'Y') THEN
4071: p_prog_id => p_prog_id,
4072: p_prog_app_id => p_prog_app_id,
4073: p_login_id => p_login_id);
4074:
4075: IF l_return_status <> FND_API.g_ret_sts_success THEN
4076:
4077: l_api_message := 'insertupdate_eamperbal error';
4078:
4079: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4078:
4079: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4080: ||TO_CHAR(l_stmt_num)
4081: ||'): ', l_api_message);
4082: RAISE FND_API.g_exc_error;
4083:
4084: END IF;
4085:
4086:
4153:
4154: If (l_exec_flag = 1) then
4155: Insert_eamBalAcct(
4156: p_api_version => 1.0,
4157: p_init_msg_list => FND_API.G_FALSE,
4158: p_commit => FND_API.G_FALSE,
4159: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
4160: x_return_status => l_return_status,
4161: x_msg_count => l_msg_count,
4154: If (l_exec_flag = 1) then
4155: Insert_eamBalAcct(
4156: p_api_version => 1.0,
4157: p_init_msg_list => FND_API.G_FALSE,
4158: p_commit => FND_API.G_FALSE,
4159: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
4160: x_return_status => l_return_status,
4161: x_msg_count => l_msg_count,
4162: x_msg_data => l_msg_data,
4155: Insert_eamBalAcct(
4156: p_api_version => 1.0,
4157: p_init_msg_list => FND_API.G_FALSE,
4158: p_commit => FND_API.G_FALSE,
4159: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
4160: x_return_status => l_return_status,
4161: x_msg_count => l_msg_count,
4162: x_msg_data => l_msg_data,
4163: p_period_id => l_acct_period_id,
4180: p_prog_id => p_prog_id,
4181: p_prog_app_id => p_prog_app_id,
4182: p_login_id => p_login_id);
4183:
4184: IF l_return_status <> FND_API.g_ret_sts_success THEN
4185:
4186: l_api_message := 'Insert_eamBalAcct error';
4187: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
4188: ||TO_CHAR(l_stmt_num)
4186: l_api_message := 'Insert_eamBalAcct error';
4187: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
4188: ||TO_CHAR(l_stmt_num)
4189: ||'): ', l_api_message);
4190: RAISE FND_API.g_exc_error;
4191:
4192: END IF;
4193:
4194: IF (p_debug = 'Y') THEN
4299: x_operation_dept => l_operation_dept_id,
4300: x_owning_dept => l_owning_dept_id,
4301: x_maint_cost_cat => l_maint_cost_category);
4302:
4303: IF l_return_status <> FND_API.g_ret_sts_success THEN
4304:
4305: l_api_message := 'Get_MaintCostCat returned error';
4306:
4307: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4306:
4307: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4308: ||TO_CHAR(l_stmt_num)
4309: ||'): ', l_api_message);
4310: RAISE FND_API.g_exc_error;
4311:
4312: END IF;
4313:
4314: l_stmt_num := 145;
4363: p_prog_id => p_prog_id,
4364: p_prog_app_id => p_prog_app_id,
4365: p_login_id => p_login_id);
4366:
4367: IF l_return_status <> FND_API.g_ret_sts_success THEN
4368:
4369: l_api_message := 'insertupdate_eamperbal error';
4370:
4371: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4370:
4371: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4372: ||TO_CHAR(l_stmt_num)
4373: ||'): ', l_api_message);
4374: RAISE FND_API.g_exc_error;
4375:
4376: END IF;
4377:
4378:
4406: END IF;
4407:
4408: Insert_eamBalAcct(
4409: p_api_version => 1.0,
4410: p_init_msg_list => FND_API.G_FALSE,
4411: p_commit => FND_API.G_FALSE,
4412: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
4413: x_return_status => l_return_status,
4414: x_msg_count => l_msg_count,
4407:
4408: Insert_eamBalAcct(
4409: p_api_version => 1.0,
4410: p_init_msg_list => FND_API.G_FALSE,
4411: p_commit => FND_API.G_FALSE,
4412: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
4413: x_return_status => l_return_status,
4414: x_msg_count => l_msg_count,
4415: x_msg_data => l_msg_data,
4408: Insert_eamBalAcct(
4409: p_api_version => 1.0,
4410: p_init_msg_list => FND_API.G_FALSE,
4411: p_commit => FND_API.G_FALSE,
4412: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
4413: x_return_status => l_return_status,
4414: x_msg_count => l_msg_count,
4415: x_msg_data => l_msg_data,
4416: p_period_id => l_acct_period_id,
4433: p_prog_id => p_prog_id,
4434: p_prog_app_id => p_prog_app_id,
4435: p_login_id => p_login_id);
4436:
4437: IF l_return_status <> FND_API.g_ret_sts_success THEN
4438:
4439: l_api_message := 'Insert_eamBalAcct error';
4440: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
4441: ||TO_CHAR(l_stmt_num)
4439: l_api_message := 'Insert_eamBalAcct error';
4440: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
4441: ||TO_CHAR(l_stmt_num)
4442: ||'): ', l_api_message);
4443: RAISE FND_API.g_exc_error;
4444:
4445: END IF;
4446:
4447: ELSE
4573: x_operation_dept => l_operation_dept_id,
4574: x_owning_dept => l_owning_dept_id,
4575: x_maint_cost_cat => l_maint_cost_category);
4576:
4577: IF l_return_status <> FND_API.g_ret_sts_success THEN
4578:
4579: l_api_message := 'Get_MaintCostCat returned error';
4580:
4581: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4580:
4581: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4582: ||TO_CHAR(l_stmt_num)
4583: ||'): ', l_api_message);
4584: RAISE FND_API.g_exc_error;
4585:
4586: END IF;
4587:
4588: l_stmt_num := 165;
4636: p_prog_id => p_prog_id,
4637: p_prog_app_id => p_prog_app_id,
4638: p_login_id => p_login_id);
4639:
4640: IF l_return_status <> FND_API.g_ret_sts_success THEN
4641:
4642: l_api_message := 'insertupdate_eamperbal error';
4643:
4644: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4643:
4644: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4645: ||TO_CHAR(l_stmt_num)
4646: ||'): ', l_api_message);
4647: RAISE FND_API.g_exc_error;
4648:
4649: END IF;
4650:
4651: If c_wedi_rec.wedi_value <> 0 then
4678: END IF;
4679:
4680: Insert_eamBalAcct(
4681: p_api_version => 1.0,
4682: p_init_msg_list => FND_API.G_FALSE,
4683: p_commit => FND_API.G_FALSE,
4684: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
4685: x_return_status => l_return_status,
4686: x_msg_count => l_msg_count,
4679:
4680: Insert_eamBalAcct(
4681: p_api_version => 1.0,
4682: p_init_msg_list => FND_API.G_FALSE,
4683: p_commit => FND_API.G_FALSE,
4684: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
4685: x_return_status => l_return_status,
4686: x_msg_count => l_msg_count,
4687: x_msg_data => l_msg_data,
4680: Insert_eamBalAcct(
4681: p_api_version => 1.0,
4682: p_init_msg_list => FND_API.G_FALSE,
4683: p_commit => FND_API.G_FALSE,
4684: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
4685: x_return_status => l_return_status,
4686: x_msg_count => l_msg_count,
4687: x_msg_data => l_msg_data,
4688: p_period_id => l_acct_period_id,
4705: p_prog_id => p_prog_id,
4706: p_prog_app_id => p_prog_app_id,
4707: p_login_id => p_login_id);
4708:
4709: IF l_return_status <> FND_API.g_ret_sts_success THEN
4710:
4711: l_api_message := 'Insert_eamBalAcct error';
4712: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
4713: ||TO_CHAR(l_stmt_num)
4711: l_api_message := 'Insert_eamBalAcct error';
4712: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
4713: ||TO_CHAR(l_stmt_num)
4714: ||'): ', l_api_message);
4715: RAISE FND_API.g_exc_error;
4716:
4717: END IF;
4718:
4719: Else
4869: x_operation_dept => l_operation_dept_id,
4870: x_owning_dept => l_owning_dept_id,
4871: x_maint_cost_cat => l_maint_cost_category);
4872:
4873: IF l_return_status <> FND_API.g_ret_sts_success THEN
4874:
4875: l_api_message := 'Get_MaintCostCat returned error';
4876:
4877: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4876:
4877: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4878: ||TO_CHAR(l_stmt_num)
4879: ||'): ', l_api_message);
4880: RAISE FND_API.g_exc_error;
4881:
4882: END IF;
4883:
4884: l_stmt_num :=187;
4942: p_prog_id => p_prog_id,
4943: p_prog_app_id => p_prog_app_id,
4944: p_login_id => p_login_id);
4945:
4946: IF l_return_status <> FND_API.g_ret_sts_success THEN
4947:
4948: l_api_message := 'insertupdate_eamperbal error';
4949:
4950: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4949:
4950: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'COMPUTE_JOB_ESTIMATES('
4951: ||TO_CHAR(l_stmt_num)
4952: ||'): ', l_api_message);
4953: RAISE FND_API.g_exc_error;
4954:
4955: END IF;
4956:
4957: If c_pda_rec.pda_value <> 0 then
4984: END IF;
4985:
4986: Insert_eamBalAcct(
4987: p_api_version => 1.0,
4988: p_init_msg_list => FND_API.G_FALSE,
4989: p_commit => FND_API.G_FALSE,
4990: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
4991: x_return_status => l_return_status,
4992: x_msg_count => l_msg_count,
4985:
4986: Insert_eamBalAcct(
4987: p_api_version => 1.0,
4988: p_init_msg_list => FND_API.G_FALSE,
4989: p_commit => FND_API.G_FALSE,
4990: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
4991: x_return_status => l_return_status,
4992: x_msg_count => l_msg_count,
4993: x_msg_data => l_msg_data,
4986: Insert_eamBalAcct(
4987: p_api_version => 1.0,
4988: p_init_msg_list => FND_API.G_FALSE,
4989: p_commit => FND_API.G_FALSE,
4990: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
4991: x_return_status => l_return_status,
4992: x_msg_count => l_msg_count,
4993: x_msg_data => l_msg_data,
4994: p_period_id => l_acct_period_id,
5011: p_prog_id => p_prog_id,
5012: p_prog_app_id => p_prog_app_id,
5013: p_login_id => p_login_id);
5014:
5015: IF l_return_status <> FND_API.g_ret_sts_success THEN
5016:
5017: l_api_message := 'Insert_eamBalAcct error';
5018: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
5019: ||TO_CHAR(l_stmt_num)
5017: l_api_message := 'Insert_eamBalAcct error';
5018: FND_MSG_PUB.ADD_EXC_MSG('CST_EAMCOST_PUB', 'Insert_eamBalAcct('
5019: ||TO_CHAR(l_stmt_num)
5020: ||'): ', l_api_message);
5021: RAISE FND_API.g_exc_error;
5022:
5023: END IF;
5024: Else
5025: IF (p_debug = 'Y') THEN
5192: ---------------------------------------------------------------------------
5193: -- Standard check of p_commit
5194: ---------------------------------------------------------------------------
5195:
5196: IF FND_API.to_Boolean(p_commit) THEN
5197: COMMIT WORK;
5198: END IF;
5199:
5200: ---------------------------------------------------------------------------
5206: p_data => x_msg_data );
5207:
5208: EXCEPTION
5209:
5210: WHEN fnd_api.g_exc_error THEN
5211: x_return_status := fnd_api.g_ret_sts_error;
5212:
5213: -- Get message count and data
5214: fnd_msg_pub.count_and_get
5207:
5208: EXCEPTION
5209:
5210: WHEN fnd_api.g_exc_error THEN
5211: x_return_status := fnd_api.g_ret_sts_error;
5212:
5213: -- Get message count and data
5214: fnd_msg_pub.count_and_get
5215: ( p_count => x_msg_count
5215: ( p_count => x_msg_count
5216: , p_data => x_msg_data
5217: );
5218: --
5219: WHEN fnd_api.g_exc_unexpected_error THEN
5220: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5221:
5222: -- Get message count and data
5223: fnd_msg_pub.count_and_get
5216: , p_data => x_msg_data
5217: );
5218: --
5219: WHEN fnd_api.g_exc_unexpected_error THEN
5220: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5221:
5222: -- Get message count and data
5223: fnd_msg_pub.count_and_get
5224: ( p_count => x_msg_count
5225: , p_data => x_msg_data
5226: );
5227: --
5228: WHEN OTHERS THEN
5229: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5230: --
5231: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
5232: THEN
5233: fnd_msg_pub.add_exc_msg
5272: -- End of comments
5273:
5274: PROCEDURE Rollup_Cost (
5275: p_api_version IN NUMBER,
5276: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE ,
5277: p_commit IN VARCHAR2 := FND_API.G_FALSE ,
5278: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL ,
5279: x_return_status OUT NOCOPY VARCHAR2 ,
5280: x_msg_count OUT NOCOPY NUMBER ,
5273:
5274: PROCEDURE Rollup_Cost (
5275: p_api_version IN NUMBER,
5276: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE ,
5277: p_commit IN VARCHAR2 := FND_API.G_FALSE ,
5278: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL ,
5279: x_return_status OUT NOCOPY VARCHAR2 ,
5280: x_msg_count OUT NOCOPY NUMBER ,
5281: x_msg_data OUT NOCOPY VARCHAR2 ,
5274: PROCEDURE Rollup_Cost (
5275: p_api_version IN NUMBER,
5276: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE ,
5277: p_commit IN VARCHAR2 := FND_API.G_FALSE ,
5278: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL ,
5279: x_return_status OUT NOCOPY VARCHAR2 ,
5280: x_msg_count OUT NOCOPY NUMBER ,
5281: x_msg_data OUT NOCOPY VARCHAR2 ,
5282:
5310: ------------------------------------------------
5311: -- Standard call to check for API compatibility
5312: ------------------------------------------------
5313: l_statement := 10;
5314: IF not fnd_api.compatible_api_call (
5315: l_api_version,
5316: p_api_version,
5317: l_api_name,
5318: G_PKG_NAME ) then
5315: l_api_version,
5316: p_api_version,
5317: l_api_name,
5318: G_PKG_NAME ) then
5319: RAISE fnd_api.G_exc_unexpected_error;
5320: END IF;
5321:
5322: ------------------------------------------------------------
5323: -- Initialize message list if p_init_msg_list is set to TRUE
5322: ------------------------------------------------------------
5323: -- Initialize message list if p_init_msg_list is set to TRUE
5324: -------------------------------------------------------------
5325: l_statement := 20;
5326: IF fnd_api.to_Boolean(p_init_msg_list) then
5327: fnd_msg_pub.initialize;
5328: END IF;
5329:
5330: -------------------------------------------------------------
5330: -------------------------------------------------------------
5331: -- Initialize API return status to Success
5332: -------------------------------------------------------------
5333: l_statement := 30;
5334: x_return_status := fnd_api.g_ret_sts_success;
5335:
5336: ------------------------------------------------
5337: -- find out object_id from MTL_SERIAL_NUMBERS
5338: -- using inventory_item_id
5702: fnd_msg_pub.add_exc_msg
5703: ( G_PKG_NAME,
5704: l_api_name,
5705: l_api_message );
5706: RAISE fnd_api.g_exc_error;
5707: END IF;
5708:
5709: ---------------------------------------------------------------------------
5710: -- Standard check of p_commit
5709: ---------------------------------------------------------------------------
5710: -- Standard check of p_commit
5711: ---------------------------------------------------------------------------
5712: l_statement := 110;
5713: IF FND_API.to_Boolean(p_commit) THEN
5714: COMMIT WORK;
5715: END IF;
5716:
5717: ---------------------------------------------------------------------------
5722: p_data => x_msg_data );
5723:
5724:
5725: EXCEPTION
5726: WHEN fnd_api.g_exc_error then
5727: ROLLBACK TO Rollup_Cost_PUB;
5728: x_return_status := fnd_api.g_ret_sts_error;
5729: fnd_msg_pub.count_and_get ( p_count => x_msg_count,
5730: p_data => x_msg_data );
5724:
5725: EXCEPTION
5726: WHEN fnd_api.g_exc_error then
5727: ROLLBACK TO Rollup_Cost_PUB;
5728: x_return_status := fnd_api.g_ret_sts_error;
5729: fnd_msg_pub.count_and_get ( p_count => x_msg_count,
5730: p_data => x_msg_data );
5731:
5732: WHEN fnd_api.g_exc_unexpected_error then
5728: x_return_status := fnd_api.g_ret_sts_error;
5729: fnd_msg_pub.count_and_get ( p_count => x_msg_count,
5730: p_data => x_msg_data );
5731:
5732: WHEN fnd_api.g_exc_unexpected_error then
5733: ROLLBACK TO Rollup_Cost_PUB;
5734: x_return_status := fnd_api.g_ret_sts_unexp_error;
5735: fnd_msg_pub.count_and_get ( p_count => x_msg_count,
5736: p_data => x_msg_data );
5730: p_data => x_msg_data );
5731:
5732: WHEN fnd_api.g_exc_unexpected_error then
5733: ROLLBACK TO Rollup_Cost_PUB;
5734: x_return_status := fnd_api.g_ret_sts_unexp_error;
5735: fnd_msg_pub.count_and_get ( p_count => x_msg_count,
5736: p_data => x_msg_data );
5737:
5738: WHEN OTHERS THEN
5736: p_data => x_msg_data );
5737:
5738: WHEN OTHERS THEN
5739: ROLLBACK TO Rollup_Cost_PUB;
5740: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5741:
5742: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) then
5743: fnd_msg_pub.add_exc_msg
5744: ( G_PKG_NAME,l_api_name || ' : Statement - ' || to_char(l_statement));
5769: ----------------------------------------------------------------------------
5770: -- End of comments
5771: PROCEDURE Purge_Rollup_Cost (
5772: p_api_version IN NUMBER,
5773: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE ,
5774: p_commit IN VARCHAR2 := FND_API.G_FALSE ,
5775: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL ,
5776: x_return_status OUT NOCOPY VARCHAR2 ,
5777: x_msg_count OUT NOCOPY NUMBER ,
5770: -- End of comments
5771: PROCEDURE Purge_Rollup_Cost (
5772: p_api_version IN NUMBER,
5773: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE ,
5774: p_commit IN VARCHAR2 := FND_API.G_FALSE ,
5775: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL ,
5776: x_return_status OUT NOCOPY VARCHAR2 ,
5777: x_msg_count OUT NOCOPY NUMBER ,
5778: x_msg_data OUT NOCOPY VARCHAR2 ,
5771: PROCEDURE Purge_Rollup_Cost (
5772: p_api_version IN NUMBER,
5773: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE ,
5774: p_commit IN VARCHAR2 := FND_API.G_FALSE ,
5775: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL ,
5776: x_return_status OUT NOCOPY VARCHAR2 ,
5777: x_msg_count OUT NOCOPY NUMBER ,
5778: x_msg_data OUT NOCOPY VARCHAR2 ,
5779:
5796: ------------------------------------------------
5797: -- Standard call to check for API compatibility
5798: ------------------------------------------------
5799: l_statement := 10;
5800: IF not fnd_api.compatible_api_call (
5801: l_api_version,
5802: p_api_version,
5803: l_api_name,
5804: G_PKG_NAME ) then
5801: l_api_version,
5802: p_api_version,
5803: l_api_name,
5804: G_PKG_NAME ) then
5805: RAISE fnd_api.G_exc_unexpected_error;
5806: END IF;
5807:
5808: ------------------------------------------------------------
5809: -- Initialize message list if p_init_msg_list is set to TRUE
5808: ------------------------------------------------------------
5809: -- Initialize message list if p_init_msg_list is set to TRUE
5810: -------------------------------------------------------------
5811: l_statement := 20;
5812: IF fnd_api.to_Boolean(p_init_msg_list) then
5813: fnd_msg_pub.initialize;
5814: END IF;
5815:
5816: -------------------------------------------------------------
5816: -------------------------------------------------------------
5817: -- Initialize API return status to Success
5818: -------------------------------------------------------------
5819: l_statement := 30;
5820: x_return_status := fnd_api.g_ret_sts_success;
5821:
5822: -------------------------------------------------------------
5823: -- Purge cst_am_hierarchy_snapshot
5824: -------------------------------------------------------------
5836: ---------------------------------------------------------------------------
5837: -- Standard check of p_commit
5838: ---------------------------------------------------------------------------
5839: l_statement := 60;
5840: IF FND_API.to_Boolean(p_commit) THEN
5841: COMMIT WORK;
5842: END IF;
5843:
5844: ---------------------------------------------------------------------------
5850:
5851:
5852: EXCEPTION
5853:
5854: WHEN fnd_api.g_exc_error then
5855: ROLLBACK TO Purge_Rollup_Cost_PUB;
5856: x_return_status := fnd_api.g_ret_sts_error;
5857: fnd_msg_pub.count_and_get ( p_count => x_msg_count,
5858: p_data => x_msg_data );
5852: EXCEPTION
5853:
5854: WHEN fnd_api.g_exc_error then
5855: ROLLBACK TO Purge_Rollup_Cost_PUB;
5856: x_return_status := fnd_api.g_ret_sts_error;
5857: fnd_msg_pub.count_and_get ( p_count => x_msg_count,
5858: p_data => x_msg_data );
5859:
5860: WHEN fnd_api.g_exc_unexpected_error then
5856: x_return_status := fnd_api.g_ret_sts_error;
5857: fnd_msg_pub.count_and_get ( p_count => x_msg_count,
5858: p_data => x_msg_data );
5859:
5860: WHEN fnd_api.g_exc_unexpected_error then
5861: ROLLBACK TO Purge_Rollup_Cost_PUB;
5862: x_return_status := fnd_api.g_ret_sts_unexp_error;
5863: fnd_msg_pub.count_and_get ( p_count => x_msg_count,
5864: p_data => x_msg_data );
5858: p_data => x_msg_data );
5859:
5860: WHEN fnd_api.g_exc_unexpected_error then
5861: ROLLBACK TO Purge_Rollup_Cost_PUB;
5862: x_return_status := fnd_api.g_ret_sts_unexp_error;
5863: fnd_msg_pub.count_and_get ( p_count => x_msg_count,
5864: p_data => x_msg_data );
5865:
5866: WHEN OTHERS THEN
5864: p_data => x_msg_data );
5865:
5866: WHEN OTHERS THEN
5867: ROLLBACK TO Purge_Rollup_Cost_PUB;
5868: x_return_status := fnd_api.g_ret_sts_unexp_error ;
5869: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) then
5870: fnd_msg_pub.add_exc_msg
5871: ( G_PKG_NAME,l_api_name || ' : Statement - ' || to_char(l_statement));
5872: END IF;
5893: ----------------------------------------------------------------------------
5894:
5895: PROCEDURE check_if_direct_item (
5896: p_api_version IN NUMBER,
5897: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
5898: p_commit IN VARCHAR2 := FND_API.G_FALSE,
5899: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
5900:
5901: p_interface_txn_id IN NUMBER,
5894:
5895: PROCEDURE check_if_direct_item (
5896: p_api_version IN NUMBER,
5897: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
5898: p_commit IN VARCHAR2 := FND_API.G_FALSE,
5899: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
5900:
5901: p_interface_txn_id IN NUMBER,
5902:
5895: PROCEDURE check_if_direct_item (
5896: p_api_version IN NUMBER,
5897: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
5898: p_commit IN VARCHAR2 := FND_API.G_FALSE,
5899: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
5900:
5901: p_interface_txn_id IN NUMBER,
5902:
5903: x_direct_item_flag OUT NOCOPY NUMBER,
5908:
5909: l_api_name CONSTANT VARCHAR2(30) := 'check_if_direct_item';
5910: l_api_version CONSTANT NUMBER := 1.0;
5911:
5912: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
5913: l_msg_count NUMBER := 0;
5914: l_msg_data VARCHAR2(8000);
5915: l_stmt_num NUMBER := 0;
5916:
5935: FND_FILE.PUT_LINE(fnd_file.log,'Check if direct item');
5936: end if;
5937:
5938: -- Standard call to check for call compatibility
5939: IF NOT FND_API.Compatible_API_Call (
5940: l_api_version,
5941: p_api_version,
5942: l_api_name,
5943: G_PKG_NAME ) THEN
5940: l_api_version,
5941: p_api_version,
5942: l_api_name,
5943: G_PKG_NAME ) THEN
5944: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5945: END IF;
5946:
5947: -- Initialize message list if p_init_msg_list is set to TRUE
5948: IF FND_API.to_Boolean(p_init_msg_list) THEN
5944: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
5945: END IF;
5946:
5947: -- Initialize message list if p_init_msg_list is set to TRUE
5948: IF FND_API.to_Boolean(p_init_msg_list) THEN
5949: FND_MSG_PUB.initialize;
5950: END IF;
5951:
5952: -- Initialize API return status to success
5950: END IF;
5951:
5952: -- Initialize API return status to success
5953: l_stmt_num := 0;
5954: x_return_status := FND_API.G_RET_STS_SUCCESS;
5955: x_direct_item_flag := 0;
5956:
5957: -- Validate IN parameters
5958: l_stmt_num := 20;
5956:
5957: -- Validate IN parameters
5958: l_stmt_num := 20;
5959: IF (p_interface_txn_id IS NULL) THEN
5960: RAISE fnd_api.g_exc_error;
5961: END IF;
5962:
5963: -- Due to changes in Bug #1926731, p_interface_txn_id now contains the rcv_transaction_id
5964: -- instead of interface_transaction_id. Get the interface_transaction_id from rcv_transactions.
5973: FROM rcv_transactions
5974: WHERE transaction_id = p_interface_txn_id;
5975:
5976: IF (l_interface_txn_id IS NULL) THEN
5977: RAISE fnd_api.g_exc_error;
5978: END IF;
5979:
5980: if(l_debug = 'Y') then
5981: fnd_file.put_line(fnd_file.log,'Interface Txn ID : '||l_interface_txn_id);
6057: fnd_file.put_line(fnd_file.log,'Direct item flag : ' || to_char(x_direct_item_flag));
6058: end if;
6059:
6060: -- Standard check of p_commit
6061: IF FND_API.to_Boolean(p_commit) THEN
6062: COMMIT WORK;
6063: END IF;
6064:
6065: -- Standard Call to get message count and if count = 1, get message info
6070: -- Print messages to log file
6071:
6072:
6073: EXCEPTION
6074: WHEN fnd_api.g_exc_error THEN
6075: ROLLBACK TO check_if_direct_item_PUB;
6076: x_return_status := fnd_api.g_ret_sts_error;
6077:
6078: -- Get message count and data
6072:
6073: EXCEPTION
6074: WHEN fnd_api.g_exc_error THEN
6075: ROLLBACK TO check_if_direct_item_PUB;
6076: x_return_status := fnd_api.g_ret_sts_error;
6077:
6078: -- Get message count and data
6079: fnd_msg_pub.count_and_get
6080: ( p_count => x_msg_count
6080: ( p_count => x_msg_count
6081: , p_data => x_msg_data
6082: );
6083:
6084: WHEN fnd_api.g_exc_unexpected_error THEN
6085: ROLLBACK TO check_if_direct_item_PUB;
6086: x_return_status := fnd_api.g_ret_sts_unexp_error ;
6087:
6088: -- Get message count and data
6082: );
6083:
6084: WHEN fnd_api.g_exc_unexpected_error THEN
6085: ROLLBACK TO check_if_direct_item_PUB;
6086: x_return_status := fnd_api.g_ret_sts_unexp_error ;
6087:
6088: -- Get message count and data
6089: fnd_msg_pub.count_and_get
6090: ( p_count => x_msg_count
6092: );
6093: --
6094: WHEN OTHERS THEN
6095: ROLLBACK TO check_if_direct_item_PUB;
6096: x_return_status := fnd_api.g_ret_sts_unexp_error ;
6097: --
6098: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
6099: THEN
6100: fnd_msg_pub.add_exc_msg
6125: ----------------------------------------------------------------------------
6126:
6127: PROCEDURE process_direct_item_txn (
6128: p_api_version IN NUMBER,
6129: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
6130: p_commit IN VARCHAR2 := FND_API.G_FALSE,
6131: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
6132:
6133: p_directItem_rec IN WIP_Transaction_PUB.Res_Rec_Type,
6126:
6127: PROCEDURE process_direct_item_txn (
6128: p_api_version IN NUMBER,
6129: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
6130: p_commit IN VARCHAR2 := FND_API.G_FALSE,
6131: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
6132:
6133: p_directItem_rec IN WIP_Transaction_PUB.Res_Rec_Type,
6134:
6127: PROCEDURE process_direct_item_txn (
6128: p_api_version IN NUMBER,
6129: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
6130: p_commit IN VARCHAR2 := FND_API.G_FALSE,
6131: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
6132:
6133: p_directItem_rec IN WIP_Transaction_PUB.Res_Rec_Type,
6134:
6135: x_directItem_rec IN OUT NOCOPY WIP_Transaction_PUB.Res_Rec_Type,
6140:
6141: l_api_name CONSTANT VARCHAR2(30) := 'process_direct_item_txn';
6142: l_api_version CONSTANT NUMBER := 1.0;
6143:
6144: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
6145: l_msg_count NUMBER := 0;
6146: l_msg_data VARCHAR2(8000);
6147: l_stmt_num NUMBER := 0;
6148:
6197:
6198: l_debug := fnd_profile.value('MRP_DEBUG');
6199:
6200: -- Standard call to check for call compatibility
6201: IF NOT FND_API.Compatible_API_Call (
6202: l_api_version,
6203: p_api_version,
6204: l_api_name,
6205: G_PKG_NAME ) THEN
6202: l_api_version,
6203: p_api_version,
6204: l_api_name,
6205: G_PKG_NAME ) THEN
6206: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6207: END IF;
6208:
6209: -- Initialize message list if p_init_msg_list is set to TRUE
6210: IF FND_API.to_Boolean(p_init_msg_list) THEN
6206: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6207: END IF;
6208:
6209: -- Initialize message list if p_init_msg_list is set to TRUE
6210: IF FND_API.to_Boolean(p_init_msg_list) THEN
6211: FND_MSG_PUB.initialize;
6212: END IF;
6213:
6214: -- Initialize API return status to success
6212: END IF;
6213:
6214: -- Initialize API return status to success
6215: l_stmt_num := 10;
6216: x_return_status := FND_API.G_RET_STS_SUCCESS;
6217:
6218: -- Initialize direct item record
6219: l_stmt_num := 20;
6220: l_directItem_rec := p_directItem_rec;
6237: FROM rcv_transactions
6238: WHERE transaction_id = l_txn_id;
6239:
6240: IF (l_interface_txn_id IS NULL) THEN
6241: RAISE fnd_api.g_exc_error;
6242: END IF;
6243:
6244: -- Bug #2144236. Interface_txn_id was getting inserted into WCTI
6245: -- instead of rcv_transaction_id
6683: x_msg_count => l_msg_count,
6684: x_msg_data => l_msg_data
6685: );
6686:
6687: IF l_return_status <> FND_API.g_ret_sts_success THEN
6688: FND_FILE.put_line(FND_FILE.log, l_msg_data);
6689: l_api_message := 'WIP_EAM_RESOURCE_TRANSACTION.WIP_EAMRCVDIRECTITEM_HOOK returned error';
6690: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
6691: FND_MESSAGE.set_token('TEXT', l_api_message);
6689: l_api_message := 'WIP_EAM_RESOURCE_TRANSACTION.WIP_EAMRCVDIRECTITEM_HOOK returned error';
6690: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
6691: FND_MESSAGE.set_token('TEXT', l_api_message);
6692: FND_MSG_pub.add;
6693: RAISE FND_API.g_exc_error;
6694: END IF;
6695:
6696: -- Standard check of p_commit
6697: IF FND_API.to_Boolean(p_commit) THEN
6693: RAISE FND_API.g_exc_error;
6694: END IF;
6695:
6696: -- Standard check of p_commit
6697: IF FND_API.to_Boolean(p_commit) THEN
6698: COMMIT WORK;
6699: END IF;
6700:
6701: -- Standard Call to get message count and if count = 1, get message info
6706: -- Print messages to log file
6707:
6708:
6709: EXCEPTION
6710: WHEN fnd_api.g_exc_error THEN
6711: ROLLBACK TO process_direct_item_txn_PUB;
6712: x_return_status := fnd_api.g_ret_sts_error;
6713:
6714: -- Get message count and data
6708:
6709: EXCEPTION
6710: WHEN fnd_api.g_exc_error THEN
6711: ROLLBACK TO process_direct_item_txn_PUB;
6712: x_return_status := fnd_api.g_ret_sts_error;
6713:
6714: -- Get message count and data
6715: fnd_msg_pub.count_and_get
6716: ( p_count => x_msg_count
6716: ( p_count => x_msg_count
6717: , p_data => x_msg_data
6718: );
6719:
6720: WHEN fnd_api.g_exc_unexpected_error THEN
6721: ROLLBACK TO process_direct_item_txn_PUB;
6722: x_return_status := fnd_api.g_ret_sts_unexp_error ;
6723:
6724: -- Get message count and data
6718: );
6719:
6720: WHEN fnd_api.g_exc_unexpected_error THEN
6721: ROLLBACK TO process_direct_item_txn_PUB;
6722: x_return_status := fnd_api.g_ret_sts_unexp_error ;
6723:
6724: -- Get message count and data
6725: fnd_msg_pub.count_and_get
6726: ( p_count => x_msg_count
6728: );
6729: --
6730: WHEN OTHERS THEN
6731: ROLLBACK TO process_direct_item_txn_PUB;
6732: x_return_status := fnd_api.g_ret_sts_unexp_error ;
6733: --
6734: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
6735: THEN
6736: fnd_msg_pub.add_exc_msg
6764: -- 05/01/01 Anitha Dixit Created --
6765: ----------------------------------------------------------------------------
6766: PROCEDURE cost_direct_item_txn (
6767: p_api_version IN NUMBER,
6768: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
6769: p_commit IN VARCHAR2 := FND_API.G_FALSE,
6770: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
6771:
6772: p_group_id IN NUMBER,
6765: ----------------------------------------------------------------------------
6766: PROCEDURE cost_direct_item_txn (
6767: p_api_version IN NUMBER,
6768: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
6769: p_commit IN VARCHAR2 := FND_API.G_FALSE,
6770: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
6771:
6772: p_group_id IN NUMBER,
6773: p_prg_appl_id IN NUMBER,
6766: PROCEDURE cost_direct_item_txn (
6767: p_api_version IN NUMBER,
6768: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
6769: p_commit IN VARCHAR2 := FND_API.G_FALSE,
6770: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
6771:
6772: p_group_id IN NUMBER,
6773: p_prg_appl_id IN NUMBER,
6774: p_prg_id IN NUMBER,
6783:
6784: l_api_name CONSTANT VARCHAR2(30) := 'cost_direct_item_txn';
6785: l_api_version CONSTANT NUMBER := 1.0;
6786:
6787: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
6788: l_msg_count NUMBER := 0;
6789: l_msg_data VARCHAR2(8000);
6790: l_stmt_num NUMBER := 0;
6791:
6841:
6842: l_debug := fnd_profile.value('MRP_DEBUG');
6843:
6844: -- Standard call to check for call compatibility
6845: IF NOT FND_API.Compatible_API_Call (
6846: l_api_version,
6847: p_api_version,
6848: l_api_name,
6849: G_PKG_NAME ) THEN
6846: l_api_version,
6847: p_api_version,
6848: l_api_name,
6849: G_PKG_NAME ) THEN
6850: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6851: END IF;
6852:
6853: -- Initialize message list if p_init_msg_list is set to TRUE
6854: IF FND_API.to_Boolean(p_init_msg_list) THEN
6850: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
6851: END IF;
6852:
6853: -- Initialize message list if p_init_msg_list is set to TRUE
6854: IF FND_API.to_Boolean(p_init_msg_list) THEN
6855: FND_MSG_PUB.initialize;
6856: END IF;
6857:
6858: -- Initialize API return status to success
6856: END IF;
6857:
6858: -- Initialize API return status to success
6859: l_stmt_num := 10;
6860: x_return_status := FND_API.G_RET_STS_SUCCESS;
6861:
6862: l_stmt_num := 50;
6863: -- Loop through all direct item transactions
6864: FOR direct_item_txn_rec IN direct_item_txn_cur LOOP
6949: x_msg_data => x_msg_data
6950: ,p_enc_insert_flag => direct_item_txn_rec.encumbrance_reversal_flag
6951: );
6952:
6953: if (x_return_status <> fnd_api.g_ret_sts_success) then
6954: raise fnd_api.g_exc_unexpected_error;
6955: end if;
6956:
6957:
6950: ,p_enc_insert_flag => direct_item_txn_rec.encumbrance_reversal_flag
6951: );
6952:
6953: if (x_return_status <> fnd_api.g_ret_sts_success) then
6954: raise fnd_api.g_exc_unexpected_error;
6955: end if;
6956:
6957:
6958:
6987: x_msg_data => x_msg_data
6988: ,p_enc_insert_flag => direct_item_txn_rec.encumbrance_reversal_flag
6989: );
6990:
6991: IF (x_return_status <> fnd_api.g_ret_sts_success) then
6992: raise fnd_api.g_exc_unexpected_error;
6993: END IF;
6994:
6995: END IF;
6988: ,p_enc_insert_flag => direct_item_txn_rec.encumbrance_reversal_flag
6989: );
6990:
6991: IF (x_return_status <> fnd_api.g_ret_sts_success) then
6992: raise fnd_api.g_exc_unexpected_error;
6993: END IF;
6994:
6995: END IF;
6996:
7011: p_mnt_or_mfg => 2,
7012: x_cost_element_id => l_cost_element
7013: );
7014:
7015: if (l_return_status <> fnd_api.g_ret_sts_success) then
7016: FND_FILE.put_line(FND_FILE.log, x_msg_data);
7017: l_api_message := 'get_CostEle_for_DirectItem returned unexpected error';
7018: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
7019: FND_MESSAGE.set_token('TEXT', l_api_message);
7017: l_api_message := 'get_CostEle_for_DirectItem returned unexpected error';
7018: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
7019: FND_MESSAGE.set_token('TEXT', l_api_message);
7020: FND_MSG_pub.add;
7021: raise fnd_api.g_exc_unexpected_error;
7022: end if;
7023:
7024: if (l_debug = 'Y') then
7025: FND_FILE.PUT_LINE(FND_FILE.LOG, 'mfg cost_element_id: '|| to_char(l_cost_element));
7057: x_msg_data => x_msg_data
7058: ,p_enc_insert_flag => direct_item_txn_rec.encumbrance_reversal_flag
7059: );
7060:
7061: if (x_return_status <> fnd_api.g_ret_sts_success) then
7062: raise fnd_api.g_exc_unexpected_error;
7063: end if;
7064:
7065:
7058: ,p_enc_insert_flag => direct_item_txn_rec.encumbrance_reversal_flag
7059: );
7060:
7061: if (x_return_status <> fnd_api.g_ret_sts_success) then
7062: raise fnd_api.g_exc_unexpected_error;
7063: end if;
7064:
7065:
7066: -- Update wip period balances , pl_material_in
7083: x_msg_count => x_msg_count,
7084: x_msg_data => x_msg_data
7085: );
7086:
7087: if (x_return_status <> fnd_api.g_ret_sts_success) then
7088: raise fnd_api.g_exc_unexpected_error;
7089: end if;
7090:
7091: -- update wip_eam_asset_per_balances material cost
7084: x_msg_data => x_msg_data
7085: );
7086:
7087: if (x_return_status <> fnd_api.g_ret_sts_success) then
7088: raise fnd_api.g_exc_unexpected_error;
7089: end if;
7090:
7091: -- update wip_eam_asset_per_balances material cost
7092: l_stmt_num := 120;
7116: p_txn_date => direct_item_txn_rec.txn_date,
7117: p_txn_id => direct_item_txn_rec.transaction_id
7118: );
7119:
7120: if (x_return_status <> fnd_api.g_ret_sts_success) then
7121: raise fnd_api.g_exc_unexpected_error;
7122: end if;
7123: END LOOP; /* for transactions */
7124:
7117: p_txn_id => direct_item_txn_rec.transaction_id
7118: );
7119:
7120: if (x_return_status <> fnd_api.g_ret_sts_success) then
7121: raise fnd_api.g_exc_unexpected_error;
7122: end if;
7123: END LOOP; /* for transactions */
7124:
7125: /* insert_direct_item_txn */
7139: x_msg_count => x_msg_count,
7140: x_msg_data => x_msg_data
7141: );
7142:
7143: if (x_return_status <> fnd_api.g_ret_sts_success) then
7144: raise fnd_api.g_exc_unexpected_error;
7145: end if;
7146:
7147: l_stmt_num := 135;
7140: x_msg_data => x_msg_data
7141: );
7142:
7143: if (x_return_status <> fnd_api.g_ret_sts_success) then
7144: raise fnd_api.g_exc_unexpected_error;
7145: end if;
7146:
7147: l_stmt_num := 135;
7148: /* Create the Events for the transactions in the WCTI group */
7148: /* Create the Events for the transactions in the WCTI group */
7149:
7150: CST_XLA_PVT.CreateBulk_WIPXLAEvent(
7151: p_api_version => 1.0,
7152: p_init_msg_list => FND_API.G_FALSE,
7153: p_commit => FND_API.G_FALSE,
7154: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
7155: x_return_status => l_return_status,
7156: x_msg_count => x_msg_count,
7149:
7150: CST_XLA_PVT.CreateBulk_WIPXLAEvent(
7151: p_api_version => 1.0,
7152: p_init_msg_list => FND_API.G_FALSE,
7153: p_commit => FND_API.G_FALSE,
7154: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
7155: x_return_status => l_return_status,
7156: x_msg_count => x_msg_count,
7157: x_msg_data => x_msg_data,
7150: CST_XLA_PVT.CreateBulk_WIPXLAEvent(
7151: p_api_version => 1.0,
7152: p_init_msg_list => FND_API.G_FALSE,
7153: p_commit => FND_API.G_FALSE,
7154: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
7155: x_return_status => l_return_status,
7156: x_msg_count => x_msg_count,
7157: x_msg_data => x_msg_data,
7158: p_wcti_group_id => p_group_id,
7157: x_msg_data => x_msg_data,
7158: p_wcti_group_id => p_group_id,
7159: p_organization_id => l_organization_id );
7160:
7161: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
7162: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
7163: END IF;
7164:
7165: l_stmt_num := 140;
7158: p_wcti_group_id => p_group_id,
7159: p_organization_id => l_organization_id );
7160:
7161: IF l_return_status <> FND_API.G_RET_STS_SUCCESS THEN
7162: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
7163: END IF;
7164:
7165: l_stmt_num := 140;
7166: if (l_debug = 'Y') then
7170: where group_id = p_group_id
7171: and process_status = 2;
7172:
7173: -- Standard check of p_commit
7174: IF FND_API.to_Boolean(p_commit) THEN
7175: COMMIT WORK;
7176: END IF;
7177:
7178: -- Standard Call to get message count and if count = 1, get message info
7183: -- Print messages to log file
7184:
7185:
7186: EXCEPTION
7187: WHEN fnd_api.g_exc_error THEN
7188: ROLLBACK TO cost_direct_item_txn_PUB;
7189: x_return_status := fnd_api.g_ret_sts_error;
7190:
7191: -- Get message count and data
7185:
7186: EXCEPTION
7187: WHEN fnd_api.g_exc_error THEN
7188: ROLLBACK TO cost_direct_item_txn_PUB;
7189: x_return_status := fnd_api.g_ret_sts_error;
7190:
7191: -- Get message count and data
7192: fnd_msg_pub.count_and_get
7193: ( p_count => x_msg_count
7193: ( p_count => x_msg_count
7194: , p_data => x_msg_data
7195: );
7196:
7197: WHEN fnd_api.g_exc_unexpected_error THEN
7198: ROLLBACK TO cost_direct_item_txn_PUB;
7199: x_return_status := fnd_api.g_ret_sts_unexp_error ;
7200:
7201: -- Get message count and data
7195: );
7196:
7197: WHEN fnd_api.g_exc_unexpected_error THEN
7198: ROLLBACK TO cost_direct_item_txn_PUB;
7199: x_return_status := fnd_api.g_ret_sts_unexp_error ;
7200:
7201: -- Get message count and data
7202: fnd_msg_pub.count_and_get
7203: ( p_count => x_msg_count
7205: );
7206: --
7207: WHEN OTHERS THEN
7208: ROLLBACK TO cost_direct_item_txn_PUB;
7209: x_return_status := fnd_api.g_ret_sts_unexp_error ;
7210: fnd_file.put_line(fnd_file.log,'CST_eamCost_PUB.cost_direct_item_txn: Statement(' || to_char(l_stmt_num) || '): ' || substr(SQLERRM,1,240));
7211: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
7212: THEN
7213: fnd_msg_pub.add_exc_msg
7241: ----------------------------------------------------------------------------
7242:
7243: PROCEDURE insert_direct_item_distr (
7244: p_api_version IN NUMBER,
7245: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
7246: p_commit IN VARCHAR2 := FND_API.G_FALSE,
7247: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
7248:
7249: p_txn_id IN NUMBER,
7242:
7243: PROCEDURE insert_direct_item_distr (
7244: p_api_version IN NUMBER,
7245: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
7246: p_commit IN VARCHAR2 := FND_API.G_FALSE,
7247: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
7248:
7249: p_txn_id IN NUMBER,
7250: p_ref_acct IN NUMBER,
7243: PROCEDURE insert_direct_item_distr (
7244: p_api_version IN NUMBER,
7245: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
7246: p_commit IN VARCHAR2 := FND_API.G_FALSE,
7247: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
7248:
7249: p_txn_id IN NUMBER,
7250: p_ref_acct IN NUMBER,
7251: p_txn_value IN NUMBER,
7266:
7267: l_api_name CONSTANT VARCHAR2(30) := 'insert_direct_item_distr';
7268: l_api_version CONSTANT NUMBER := 1.0;
7269:
7270: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
7271: l_msg_count NUMBER := 0;
7272: l_msg_data VARCHAR2(8000);
7273: l_stmt_num NUMBER := 0;
7274:
7293:
7294: l_debug := fnd_profile.value('MRP_DEBUG');
7295:
7296: -- Standard call to check for call compatibility
7297: IF NOT FND_API.Compatible_API_Call (
7298: l_api_version,
7299: p_api_version,
7300: l_api_name,
7301: G_PKG_NAME ) THEN
7298: l_api_version,
7299: p_api_version,
7300: l_api_name,
7301: G_PKG_NAME ) THEN
7302: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
7303: END IF;
7304:
7305: -- Initialize message list if p_init_msg_list is set to TRUE
7306: IF FND_API.to_Boolean(p_init_msg_list) THEN
7302: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
7303: END IF;
7304:
7305: -- Initialize message list if p_init_msg_list is set to TRUE
7306: IF FND_API.to_Boolean(p_init_msg_list) THEN
7307: FND_MSG_PUB.initialize;
7308: END IF;
7309:
7310: -- Initialize API return status to success
7308: END IF;
7309:
7310: -- Initialize API return status to success
7311: l_stmt_num := 10;
7312: x_return_status := FND_API.G_RET_STS_SUCCESS;
7313:
7314:
7315: -- Verify account
7316: l_stmt_num := 20;
7314:
7315: -- Verify account
7316: l_stmt_num := 20;
7317: if (p_ref_acct = -1) then
7318: RAISE fnd_api.g_exc_error;
7319: end if;
7320:
7321: -- Get transaction details
7322: l_stmt_num := 30;
7420: p_mnt_or_mfg => 2,
7421: x_cost_element_id => l_cost_element
7422: );
7423:
7424: if (l_return_status <> fnd_api.g_ret_sts_success) then
7425: FND_FILE.put_line(FND_FILE.log, x_msg_data);
7426: l_api_message := 'get_CostEle_for_DirectItem returned unexpected error';
7427: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
7428: FND_MESSAGE.set_token('TEXT', l_api_message);
7426: l_api_message := 'get_CostEle_for_DirectItem returned unexpected error';
7427: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
7428: FND_MESSAGE.set_token('TEXT', l_api_message);
7429: FND_MSG_pub.add;
7430: raise fnd_api.g_exc_unexpected_error;
7431: end if;
7432:
7433: if (l_debug = 'Y') then
7434: FND_FILE.PUT_LINE(FND_FILE.LOG,'mfg cost_element_id: '|| to_char(l_cost_element));
7601: WHERE wcti.transaction_id = p_txn_id;
7602: END IF;
7603:
7604: -- Standard check of p_commit
7605: IF FND_API.to_Boolean(p_commit) THEN
7606: COMMIT WORK;
7607: END IF;
7608:
7609: -- Standard Call to get message count and if count = 1, get message info
7614: -- Print messages to log file
7615:
7616:
7617: EXCEPTION
7618: WHEN fnd_api.g_exc_error THEN
7619: ROLLBACK TO insert_direct_item_distr_PUB;
7620: x_return_status := fnd_api.g_ret_sts_error;
7621:
7622: -- Get message count and data
7616:
7617: EXCEPTION
7618: WHEN fnd_api.g_exc_error THEN
7619: ROLLBACK TO insert_direct_item_distr_PUB;
7620: x_return_status := fnd_api.g_ret_sts_error;
7621:
7622: -- Get message count and data
7623: fnd_msg_pub.count_and_get
7624: ( p_count => x_msg_count
7624: ( p_count => x_msg_count
7625: , p_data => x_msg_data
7626: );
7627:
7628: WHEN fnd_api.g_exc_unexpected_error THEN
7629: ROLLBACK TO insert_direct_item_distr_PUB;
7630: x_return_status := fnd_api.g_ret_sts_unexp_error ;
7631:
7632: -- Get message count and data
7626: );
7627:
7628: WHEN fnd_api.g_exc_unexpected_error THEN
7629: ROLLBACK TO insert_direct_item_distr_PUB;
7630: x_return_status := fnd_api.g_ret_sts_unexp_error ;
7631:
7632: -- Get message count and data
7633: fnd_msg_pub.count_and_get
7634: ( p_count => x_msg_count
7636: );
7637: --
7638: WHEN OTHERS THEN
7639: ROLLBACK TO insert_direct_item_distr_PUB;
7640: x_return_status := fnd_api.g_ret_sts_unexp_error ;
7641: fnd_file.put_line(fnd_file.log,'CST_eamCost_PUB.insert_direct_item_distr(' || to_char(l_stmt_num) || '): ' || substr(SQLERRM,1,240));
7642: --
7643: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
7644: THEN
7671: -- 07/18/01 Anitha Dixit Created --
7672: ----------------------------------------------------------------------------
7673: PROCEDURE update_wip_period_balances (
7674: p_api_version IN NUMBER,
7675: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
7676: p_commit IN VARCHAR2 := FND_API.G_FALSE,
7677: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
7678:
7679: p_wip_entity_id IN NUMBER,
7672: ----------------------------------------------------------------------------
7673: PROCEDURE update_wip_period_balances (
7674: p_api_version IN NUMBER,
7675: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
7676: p_commit IN VARCHAR2 := FND_API.G_FALSE,
7677: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
7678:
7679: p_wip_entity_id IN NUMBER,
7680: p_acct_period_id IN NUMBER,
7673: PROCEDURE update_wip_period_balances (
7674: p_api_version IN NUMBER,
7675: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
7676: p_commit IN VARCHAR2 := FND_API.G_FALSE,
7677: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
7678:
7679: p_wip_entity_id IN NUMBER,
7680: p_acct_period_id IN NUMBER,
7681: p_txn_id IN NUMBER,
7711: ------------------------------------------------
7712: -- Standard call to check for API compatibility
7713: ------------------------------------------------
7714: l_statement := 10;
7715: IF not fnd_api.compatible_api_call (
7716: l_api_version,
7717: p_api_version,
7718: l_api_name,
7719: G_PKG_NAME ) then
7716: l_api_version,
7717: p_api_version,
7718: l_api_name,
7719: G_PKG_NAME ) then
7720: RAISE fnd_api.G_exc_unexpected_error;
7721: END IF;
7722:
7723: ------------------------------------------------------------
7724: -- Initialize message list if p_init_msg_list is set to TRUE
7723: ------------------------------------------------------------
7724: -- Initialize message list if p_init_msg_list is set to TRUE
7725: -------------------------------------------------------------
7726: l_statement := 20;
7727: IF fnd_api.to_Boolean(p_init_msg_list) then
7728: fnd_msg_pub.initialize;
7729: end if;
7730:
7731: -------------------------------------------------------------
7731: -------------------------------------------------------------
7732: -- Initialize API return status to Success
7733: -------------------------------------------------------------
7734: l_statement := 30;
7735: x_return_status := fnd_api.g_ret_sts_success;
7736:
7737: ----------------------------------------------------
7738: -- Validate Account Period ID
7739: ----------------------------------------------------
7738: -- Validate Account Period ID
7739: ----------------------------------------------------
7740: l_statement := 40;
7741: if ((nvl(p_acct_period_id,-1) = -1) OR (p_txn_id IS NULL)) then
7742: raise fnd_api.g_exc_unexpected_error;
7743: end if;
7744:
7745: -----------------------------------
7746: -- Obtain transaction value
7770: p_mnt_or_mfg => 2,
7771: x_cost_element_id => l_cost_element
7772: );
7773:
7774: if (x_return_status <> fnd_api.g_ret_sts_success) then
7775: FND_FILE.put_line(FND_FILE.log, x_msg_data);
7776: l_api_message := 'get_CostEle_for_DirectItem returned unexpected error';
7777: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
7778: FND_MESSAGE.set_token('TEXT', l_api_message);
7776: l_api_message := 'get_CostEle_for_DirectItem returned unexpected error';
7777: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
7778: FND_MESSAGE.set_token('TEXT', l_api_message);
7779: FND_MSG_pub.add;
7780: raise fnd_api.g_exc_unexpected_error;
7781: end if;
7782:
7783: if (l_debug = 'Y') then
7784: FND_FILE.PUT_LINE(FND_FILE.LOG,'mfg cost_element: '|| to_char(l_cost_element));
7839: l_txn_value, p_user_id, p_login_id, p_request_id, p_prg_appl_id, p_prg_id,
7840: p_wip_entity_id, p_acct_period_id;
7841:
7842: -- Standard check of p_commit
7843: IF FND_API.to_Boolean(p_commit) THEN
7844: COMMIT WORK;
7845: END IF;
7846:
7847: -- Standard Call to get message count and if count = 1, get message info
7852: -- Print messages to log file
7853:
7854:
7855: EXCEPTION
7856: WHEN fnd_api.g_exc_error then
7857: ROLLBACK TO update_wip_period_balances_PUB;
7858: x_return_status := fnd_api.g_ret_sts_error;
7859:
7860: fnd_msg_pub.count_and_get
7854:
7855: EXCEPTION
7856: WHEN fnd_api.g_exc_error then
7857: ROLLBACK TO update_wip_period_balances_PUB;
7858: x_return_status := fnd_api.g_ret_sts_error;
7859:
7860: fnd_msg_pub.count_and_get
7861: ( p_count => x_msg_count,
7862: p_data => x_msg_data );
7860: fnd_msg_pub.count_and_get
7861: ( p_count => x_msg_count,
7862: p_data => x_msg_data );
7863:
7864: WHEN fnd_api.g_exc_unexpected_error then
7865: ROLLBACK TO update_wip_period_balances_PUB;
7866: x_return_status := fnd_api.g_ret_sts_unexp_error;
7867:
7868: fnd_msg_pub.count_and_get
7862: p_data => x_msg_data );
7863:
7864: WHEN fnd_api.g_exc_unexpected_error then
7865: ROLLBACK TO update_wip_period_balances_PUB;
7866: x_return_status := fnd_api.g_ret_sts_unexp_error;
7867:
7868: fnd_msg_pub.count_and_get
7869: ( p_count => x_msg_count,
7870: p_data => x_msg_data );
7870: p_data => x_msg_data );
7871:
7872: WHEN OTHERS THEN
7873: ROLLBACK TO update_wip_period_balances_PUB;
7874: x_return_status := fnd_api.g_ret_sts_unexp_error ;
7875: If fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) then
7876: fnd_msg_pub.add_exc_msg
7877: ( 'CST_eamCost_PUB',' update_wip_period_balances : Statement - ' || to_char(l_statement));
7878: end if;
7895: -- 05/01/01 Anitha Dixit Created --
7896: ----------------------------------------------------------------------------
7897: PROCEDURE insert_direct_item_txn (
7898: p_api_version IN NUMBER,
7899: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
7900: p_commit IN VARCHAR2 := FND_API.G_FALSE,
7901: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
7902:
7903: p_group_id IN NUMBER,
7896: ----------------------------------------------------------------------------
7897: PROCEDURE insert_direct_item_txn (
7898: p_api_version IN NUMBER,
7899: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
7900: p_commit IN VARCHAR2 := FND_API.G_FALSE,
7901: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
7902:
7903: p_group_id IN NUMBER,
7904: p_prg_appl_id IN NUMBER,
7897: PROCEDURE insert_direct_item_txn (
7898: p_api_version IN NUMBER,
7899: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
7900: p_commit IN VARCHAR2 := FND_API.G_FALSE,
7901: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
7902:
7903: p_group_id IN NUMBER,
7904: p_prg_appl_id IN NUMBER,
7905: p_prg_id IN NUMBER,
7914:
7915: l_api_name CONSTANT VARCHAR2(30) := 'insert_direct_item_txn';
7916: l_api_version CONSTANT NUMBER := 1.0;
7917:
7918: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
7919: l_msg_count NUMBER := 0;
7920: l_msg_data VARCHAR2(8000);
7921: l_stmt_num NUMBER := 0;
7922:
7930:
7931: l_debug := fnd_profile.value('MRP_DEBUG');
7932:
7933: -- Standard call to check for call compatibility
7934: IF NOT FND_API.Compatible_API_Call (
7935: l_api_version,
7936: p_api_version,
7937: l_api_name,
7938: G_PKG_NAME ) THEN
7935: l_api_version,
7936: p_api_version,
7937: l_api_name,
7938: G_PKG_NAME ) THEN
7939: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
7940: END IF;
7941:
7942: -- Initialize message list if p_init_msg_list is set to TRUE
7943: IF FND_API.to_Boolean(p_init_msg_list) THEN
7939: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
7940: END IF;
7941:
7942: -- Initialize message list if p_init_msg_list is set to TRUE
7943: IF FND_API.to_Boolean(p_init_msg_list) THEN
7944: FND_MSG_PUB.initialize;
7945: END IF;
7946:
7947: -- Initialize API return status to success
7944: FND_MSG_PUB.initialize;
7945: END IF;
7946:
7947: -- Initialize API return status to success
7948: x_return_status := FND_API.G_RET_STS_SUCCESS;
7949:
7950:
7951: -- Insert into Wip_transactions
7952: l_stmt_num := 20;
8063: where group_id = p_group_id
8064: and process_status = 2;
8065:
8066: -- Standard check of p_commit
8067: IF FND_API.to_Boolean(p_commit) THEN
8068: COMMIT WORK;
8069: END IF;
8070:
8071: -- Standard Call to get message count and if count = 1, get message info
8076: -- Print messages to log file
8077:
8078:
8079: EXCEPTION
8080: WHEN fnd_api.g_exc_error THEN
8081: ROLLBACK TO insert_direct_item_txn_PUB;
8082: x_return_status := fnd_api.g_ret_sts_error;
8083:
8084: -- Get message count and data
8078:
8079: EXCEPTION
8080: WHEN fnd_api.g_exc_error THEN
8081: ROLLBACK TO insert_direct_item_txn_PUB;
8082: x_return_status := fnd_api.g_ret_sts_error;
8083:
8084: -- Get message count and data
8085: fnd_msg_pub.count_and_get
8086: ( p_count => x_msg_count
8086: ( p_count => x_msg_count
8087: , p_data => x_msg_data
8088: );
8089:
8090: WHEN fnd_api.g_exc_unexpected_error THEN
8091: ROLLBACK TO insert_direct_item_txn_PUB;
8092: x_return_status := fnd_api.g_ret_sts_unexp_error ;
8093:
8094: -- Get message count and data
8088: );
8089:
8090: WHEN fnd_api.g_exc_unexpected_error THEN
8091: ROLLBACK TO insert_direct_item_txn_PUB;
8092: x_return_status := fnd_api.g_ret_sts_unexp_error ;
8093:
8094: -- Get message count and data
8095: fnd_msg_pub.count_and_get
8096: ( p_count => x_msg_count
8098: );
8099: --
8100: WHEN OTHERS THEN
8101: ROLLBACK TO insert_direct_item_txn_PUB;
8102: x_return_status := fnd_api.g_ret_sts_unexp_error ;
8103: fnd_file.put_line(fnd_file.log,'CST_eamCost_PUB.insert_direct_item_txn: Statement(' || to_char(l_stmt_num) || '): ' || substr(SQLERRM,1,240));
8104: --
8105: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
8106: THEN
8146:
8147: PROCEDURE get_Direct_Item_Charge_Acct (
8148: p_api_version IN NUMBER,
8149: p_init_msg_list IN VARCHAR2
8150: := FND_API.G_FALSE,
8151: p_commit IN VARCHAR2
8152: := FND_API.G_FALSE,
8153: p_validation_level IN NUMBER
8154: := FND_API.G_VALID_LEVEL_FULL,
8148: p_api_version IN NUMBER,
8149: p_init_msg_list IN VARCHAR2
8150: := FND_API.G_FALSE,
8151: p_commit IN VARCHAR2
8152: := FND_API.G_FALSE,
8153: p_validation_level IN NUMBER
8154: := FND_API.G_VALID_LEVEL_FULL,
8155: p_wip_entity_id IN NUMBER := NULL,
8156: x_material_acct OUT NOCOPY NUMBER,
8150: := FND_API.G_FALSE,
8151: p_commit IN VARCHAR2
8152: := FND_API.G_FALSE,
8153: p_validation_level IN NUMBER
8154: := FND_API.G_VALID_LEVEL_FULL,
8155: p_wip_entity_id IN NUMBER := NULL,
8156: x_material_acct OUT NOCOPY NUMBER,
8157: x_return_status OUT NOCOPY VARCHAR2,
8158: x_msg_count OUT NOCOPY NUMBER,
8176: ------------------------------------------------
8177: -- Standard call to check for API compatibility
8178: ------------------------------------------------
8179: l_statement := 10;
8180: IF not fnd_api.compatible_api_call (
8181: l_api_version,
8182: p_api_version,
8183: l_api_name,
8184: G_PKG_NAME ) then
8181: l_api_version,
8182: p_api_version,
8183: l_api_name,
8184: G_PKG_NAME ) then
8185: RAISE fnd_api.G_exc_unexpected_error;
8186: END IF;
8187:
8188: ------------------------------------------------------------
8189: -- Initialize message list if p_init_msg_list is set to TRUE
8188: ------------------------------------------------------------
8189: -- Initialize message list if p_init_msg_list is set to TRUE
8190: -------------------------------------------------------------
8191: l_statement := 20;
8192: IF fnd_api.to_Boolean(p_init_msg_list) then
8193: fnd_msg_pub.initialize;
8194: end if;
8195:
8196: -------------------------------------------------------------
8196: -------------------------------------------------------------
8197: -- Initialize API return status to Success
8198: -------------------------------------------------------------
8199: l_statement := 30;
8200: x_return_status := fnd_api.g_ret_sts_success;
8201:
8202:
8203: -------------------------------------------------
8204: -- Validate input parameters
8209: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
8210: FND_MESSAGE.set_token('TEXT', l_api_message);
8211: FND_MSG_PUB.add;
8212:
8213: RAISE fnd_api.g_exc_error;
8214: end if;
8215:
8216: ---------------------------------------------
8217: -- Verify if EAM job
8235:
8236: x_material_acct := l_material_account;
8237:
8238: EXCEPTION
8239: WHEN fnd_api.g_exc_error then
8240: x_return_status := fnd_api.g_ret_sts_error;
8241: x_material_acct := -1;
8242:
8243: fnd_msg_pub.count_and_get
8236: x_material_acct := l_material_account;
8237:
8238: EXCEPTION
8239: WHEN fnd_api.g_exc_error then
8240: x_return_status := fnd_api.g_ret_sts_error;
8241: x_material_acct := -1;
8242:
8243: fnd_msg_pub.count_and_get
8244: ( p_count => x_msg_count,
8243: fnd_msg_pub.count_and_get
8244: ( p_count => x_msg_count,
8245: p_data => x_msg_data );
8246:
8247: WHEN fnd_api.g_exc_unexpected_error then
8248: x_return_status := fnd_api.g_ret_sts_unexp_error;
8249: x_material_acct := -1;
8250:
8251: fnd_msg_pub.count_and_get
8244: ( p_count => x_msg_count,
8245: p_data => x_msg_data );
8246:
8247: WHEN fnd_api.g_exc_unexpected_error then
8248: x_return_status := fnd_api.g_ret_sts_unexp_error;
8249: x_material_acct := -1;
8250:
8251: fnd_msg_pub.count_and_get
8252: ( p_count => x_msg_count,
8252: ( p_count => x_msg_count,
8253: p_data => x_msg_data );
8254:
8255: WHEN OTHERS THEN
8256: x_return_status := fnd_api.g_ret_sts_unexp_error ;
8257: x_material_acct := -1;
8258: If fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) then
8259: fnd_msg_pub.add_exc_msg
8260: ( 'CST_eamCost_PUB',' get_Direct_Item_Charge_Acct : Statement - ' || to_char(l_statement));
8283: -- 08/26/01 Anitha Dixit Created --
8284: ----------------------------------------------------------------------------
8285: PROCEDURE validate_for_reestimation (
8286: p_api_version IN NUMBER,
8287: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
8288: p_commit IN VARCHAR2 := fnd_api.g_false,
8289: p_validation_level IN VARCHAR2 := fnd_api.g_valid_level_full,
8290:
8291: p_wip_entity_id IN NUMBER,
8284: ----------------------------------------------------------------------------
8285: PROCEDURE validate_for_reestimation (
8286: p_api_version IN NUMBER,
8287: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
8288: p_commit IN VARCHAR2 := fnd_api.g_false,
8289: p_validation_level IN VARCHAR2 := fnd_api.g_valid_level_full,
8290:
8291: p_wip_entity_id IN NUMBER,
8292: p_job_status IN NUMBER,
8285: PROCEDURE validate_for_reestimation (
8286: p_api_version IN NUMBER,
8287: p_init_msg_list IN VARCHAR2 := fnd_api.g_false,
8288: p_commit IN VARCHAR2 := fnd_api.g_false,
8289: p_validation_level IN VARCHAR2 := fnd_api.g_valid_level_full,
8290:
8291: p_wip_entity_id IN NUMBER,
8292: p_job_status IN NUMBER,
8293: p_curr_est_status IN NUMBER,
8299: ) IS
8300: l_api_name CONSTANT VARCHAR2(30) := 'validate_for_reestimation';
8301: l_api_version CONSTANT NUMBER := 1.0;
8302:
8303: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
8304: l_msg_count NUMBER := 0;
8305: l_msg_data VARCHAR2(8000);
8306: l_stmt_num NUMBER := 0;
8307:
8316: -- Standard start of API savepoint
8317: SAVEPOINT validate_for_reestimation_PUB;
8318:
8319: -- Standard call to check for call compatibility
8320: IF NOT FND_API.Compatible_API_Call (
8321: l_api_version,
8322: p_api_version,
8323: l_api_name,
8324: G_PKG_NAME ) THEN
8321: l_api_version,
8322: p_api_version,
8323: l_api_name,
8324: G_PKG_NAME ) THEN
8325: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
8326: END IF;
8327:
8328: -- Initialize message list if p_init_msg_list is set to TRUE
8329: IF FND_API.to_Boolean(p_init_msg_list) THEN
8325: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
8326: END IF;
8327:
8328: -- Initialize message list if p_init_msg_list is set to TRUE
8329: IF FND_API.to_Boolean(p_init_msg_list) THEN
8330: FND_MSG_PUB.initialize;
8331: END IF;
8332:
8333:
8332:
8333:
8334: -- Initialize API return status to success
8335: l_stmt_num := 0;
8336: x_return_status := FND_API.G_RET_STS_SUCCESS;
8337:
8338: -- Call validation hook
8339: l_stmt_num := 10;
8340: l_hook := CSTPACHK.validate_job_est_status_hook (
8346: o_err_code => l_err_code,
8347: o_err_msg => l_err_msg );
8348:
8349: if (l_err_num <> 0) then
8350: raise fnd_api.g_exc_unexpected_error;
8351: end if;
8352:
8353:
8354: l_stmt_num := 20;
8375: x_validate_flag := 0;
8376: end if;
8377:
8378: -- Standard check of p_commit
8379: IF FND_API.to_Boolean(p_commit) THEN
8380: COMMIT WORK;
8381: END IF;
8382:
8383: -- Standard Call to get message count and if count = 1, get message info
8385: p_count => x_msg_count,
8386: p_data => x_msg_data );
8387:
8388: EXCEPTION
8389: WHEN fnd_api.g_exc_error THEN
8390: ROLLBACK TO validate_for_reestimation_PUB;
8391: x_return_status := fnd_api.g_ret_sts_error;
8392:
8393: -- Get message count and data
8387:
8388: EXCEPTION
8389: WHEN fnd_api.g_exc_error THEN
8390: ROLLBACK TO validate_for_reestimation_PUB;
8391: x_return_status := fnd_api.g_ret_sts_error;
8392:
8393: -- Get message count and data
8394: fnd_msg_pub.count_and_get
8395: ( p_count => x_msg_count
8395: ( p_count => x_msg_count
8396: , p_data => x_msg_data
8397: );
8398:
8399: WHEN fnd_api.g_exc_unexpected_error THEN
8400: ROLLBACK TO validate_for_reestimation_PUB;
8401: x_return_status := fnd_api.g_ret_sts_unexp_error ;
8402:
8403: -- Get message count and data
8397: );
8398:
8399: WHEN fnd_api.g_exc_unexpected_error THEN
8400: ROLLBACK TO validate_for_reestimation_PUB;
8401: x_return_status := fnd_api.g_ret_sts_unexp_error ;
8402:
8403: -- Get message count and data
8404: fnd_msg_pub.count_and_get
8405: ( p_count => x_msg_count
8407: );
8408:
8409: WHEN OTHERS THEN
8410: ROLLBACK TO validate_for_reestimation_PUB;
8411: x_return_status := fnd_api.g_ret_sts_unexp_error ;
8412: --
8413: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
8414: THEN
8415: fnd_msg_pub.add_exc_msg
8450: -- 09/07/07 Veeresha Javli Bug: 5767070 fix: use round --
8451: ----------------------------------------------------------------------------
8452: PROCEDURE Redistribute_WIP_Accounts (
8453: p_api_version IN NUMBER,
8454: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
8455: p_commit IN VARCHAR2 := FND_API.G_FALSE,
8456: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
8457: p_wcti_group_id IN NUMBER,
8458:
8451: ----------------------------------------------------------------------------
8452: PROCEDURE Redistribute_WIP_Accounts (
8453: p_api_version IN NUMBER,
8454: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
8455: p_commit IN VARCHAR2 := FND_API.G_FALSE,
8456: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
8457: p_wcti_group_id IN NUMBER,
8458:
8459: p_user_id IN NUMBER,
8452: PROCEDURE Redistribute_WIP_Accounts (
8453: p_api_version IN NUMBER,
8454: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
8455: p_commit IN VARCHAR2 := FND_API.G_FALSE,
8456: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
8457: p_wcti_group_id IN NUMBER,
8458:
8459: p_user_id IN NUMBER,
8460: p_request_id IN NUMBER,
8495: l_res_var_acct NUMBER;
8496: l_osp_var_acct NUMBER;
8497: l_ovh_var_acct NUMBER;
8498:
8499: l_return_status VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
8500: l_api_message VARCHAR2(10000);
8501: l_stmt_num NUMBER;
8502:
8503: l_dummy NUMBER := 0;
8563:
8564: -------------------------------------------------------------------------
8565: -- standard call to check for call compatibility
8566: -------------------------------------------------------------------------
8567: IF NOT fnd_api.compatible_api_call (
8568: l_api_version,
8569: p_api_version,
8570: l_api_name,
8571: G_PKG_NAME ) then
8569: p_api_version,
8570: l_api_name,
8571: G_PKG_NAME ) then
8572:
8573: RAISE fnd_api.g_exc_unexpected_error;
8574:
8575: END IF;
8576:
8577: -------------------------------------------------------------------------
8576:
8577: -------------------------------------------------------------------------
8578: -- Initialize message list if p_init_msg_list is set to TRUE
8579: -------------------------------------------------------------------------
8580: IF FND_API.to_Boolean(p_init_msg_list) THEN
8581: FND_MSG_PUB.initialize;
8582: END IF;
8583:
8584:
8584:
8585: -------------------------------------------------------------------------
8586: -- initialize api return status to success
8587: -------------------------------------------------------------------------
8588: x_return_status := fnd_api.g_ret_sts_success;
8589:
8590: -- assign to local variables
8591: l_stmt_num := 10;
8592:
8728: x_return_status => l_return_status,
8729: x_msg_data => l_msg_data
8730: );
8731:
8732: if (l_return_status <> fnd_api.g_ret_sts_success) then
8733: raise fnd_api.g_exc_unexpected_error;
8734: end if;
8735:
8736:
8729: x_msg_data => l_msg_data
8730: );
8731:
8732: if (l_return_status <> fnd_api.g_ret_sts_success) then
8733: raise fnd_api.g_exc_unexpected_error;
8734: end if;
8735:
8736:
8737: l_stmt_num := 45;
8885: ---------------------------------------------------------------------------
8886: -- Standard check of p_commit
8887: ---------------------------------------------------------------------------
8888:
8889: IF FND_API.to_Boolean(p_commit) THEN
8890: COMMIT WORK;
8891: END IF;
8892:
8893: ---------------------------------------------------------------------------
8899: p_data => x_msg_data );
8900:
8901: EXCEPTION
8902:
8903: WHEN fnd_api.g_exc_error THEN
8904: x_return_status := fnd_api.g_ret_sts_error;
8905:
8906: -- Get message count and data
8907: fnd_msg_pub.count_and_get
8900:
8901: EXCEPTION
8902:
8903: WHEN fnd_api.g_exc_error THEN
8904: x_return_status := fnd_api.g_ret_sts_error;
8905:
8906: -- Get message count and data
8907: fnd_msg_pub.count_and_get
8908: ( p_count => x_msg_count
8908: ( p_count => x_msg_count
8909: , p_data => x_msg_data
8910: );
8911: --
8912: WHEN fnd_api.g_exc_unexpected_error THEN
8913: x_return_status := fnd_api.g_ret_sts_unexp_error ;
8914: fnd_file.put_line(fnd_file.log,l_msg_data);
8915:
8916: -- Get message count and data
8909: , p_data => x_msg_data
8910: );
8911: --
8912: WHEN fnd_api.g_exc_unexpected_error THEN
8913: x_return_status := fnd_api.g_ret_sts_unexp_error ;
8914: fnd_file.put_line(fnd_file.log,l_msg_data);
8915:
8916: -- Get message count and data
8917: fnd_msg_pub.count_and_get
8919: , p_data => x_msg_data
8920: );
8921: --
8922: WHEN OTHERS THEN
8923: x_return_status := fnd_api.g_ret_sts_unexp_error ;
8924: --
8925: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error)
8926: THEN
8927: fnd_msg_pub.add_exc_msg
8961: -- 11/26/02 Ray Thng Created --
8962: ----------------------------------------------------------------------------
8963: PROCEDURE get_charge_asset (
8964: p_api_version IN NUMBER,
8965: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
8966: p_wip_entity_id IN NUMBER,
8967: x_inventory_item_id OUT NOCOPY csi_item_instances.inventory_item_id%TYPE,
8968: x_serial_number OUT NOCOPY csi_item_instances.serial_number%TYPE,
8969: x_maintenance_object_id OUT NOCOPY mtl_serial_numbers.gen_object_id%TYPE,
8973: IS
8974: l_api_name CONSTANT VARCHAR2(30) := 'get_asset';
8975: l_api_version CONSTANT NUMBER := 1.0;
8976: l_stmt_num NUMBER := 0;
8977: l_return_status VARCHAR2(1) := fnd_api.g_ret_sts_success;
8978:
8979: l_parent_wip_entity_id wip_discrete_jobs.parent_wip_entity_id%TYPE;
8980: l_parent_maint_object_type wip_discrete_jobs.maintenance_object_type%TYPE;
8981: l_parent_maint_object_id wip_discrete_jobs.maintenance_object_source%TYPE;
8987: l_inventory_item_id csi_item_instances.inventory_item_id%TYPE;
8988: l_serial_number csi_item_instances.serial_number%TYPE;
8989: BEGIN
8990: -- Standard call to check for call compatibility
8991: IF NOT FND_API.Compatible_API_Call(l_api_version,p_api_version,l_api_name,G_PKG_NAME) THEN
8992: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
8993: END IF;
8994:
8995: -- Initialize message list if p_init_msg_list is set to TRUE
8988: l_serial_number csi_item_instances.serial_number%TYPE;
8989: BEGIN
8990: -- Standard call to check for call compatibility
8991: IF NOT FND_API.Compatible_API_Call(l_api_version,p_api_version,l_api_name,G_PKG_NAME) THEN
8992: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
8993: END IF;
8994:
8995: -- Initialize message list if p_init_msg_list is set to TRUE
8996: IF FND_API.to_Boolean(p_init_msg_list) THEN
8992: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
8993: END IF;
8994:
8995: -- Initialize message list if p_init_msg_list is set to TRUE
8996: IF FND_API.to_Boolean(p_init_msg_list) THEN
8997: FND_MSG_PUB.initialize;
8998: END IF;
8999:
9000: -- Initialize API return status to success
8998: END IF;
8999:
9000: -- Initialize API return status to success
9001: l_stmt_num := 0;
9002: x_return_status := FND_API.G_RET_STS_SUCCESS;
9003:
9004:
9005: -- Retrieve information about the current work order and its parent
9006: /* Changed the following SQL statement to refer to CII
9069: p_count => x_msg_count,
9070: p_data => x_msg_data);
9071:
9072: EXCEPTION
9073: WHEN fnd_api.g_exc_error THEN
9074: x_return_status := fnd_api.g_ret_sts_error;
9075:
9076: -- Get message count and data
9077: fnd_msg_pub.count_and_get(
9070: p_data => x_msg_data);
9071:
9072: EXCEPTION
9073: WHEN fnd_api.g_exc_error THEN
9074: x_return_status := fnd_api.g_ret_sts_error;
9075:
9076: -- Get message count and data
9077: fnd_msg_pub.count_and_get(
9078: p_count => x_msg_count,
9077: fnd_msg_pub.count_and_get(
9078: p_count => x_msg_count,
9079: p_data => x_msg_data);
9080:
9081: WHEN fnd_api.g_exc_unexpected_error THEN
9082: x_return_status := fnd_api.g_ret_sts_unexp_error ;
9083:
9084: -- Get message count and data
9085: fnd_msg_pub.count_and_get(
9078: p_count => x_msg_count,
9079: p_data => x_msg_data);
9080:
9081: WHEN fnd_api.g_exc_unexpected_error THEN
9082: x_return_status := fnd_api.g_ret_sts_unexp_error ;
9083:
9084: -- Get message count and data
9085: fnd_msg_pub.count_and_get(
9086: p_count => x_msg_count,
9086: p_count => x_msg_count,
9087: p_data => x_msg_data);
9088:
9089: WHEN OTHERS THEN
9090: x_return_status := fnd_api.g_ret_sts_unexp_error ;
9091:
9092: IF fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) THEN
9093: fnd_msg_pub.add_exc_msg(
9094: 'CST_eamCost_PUB',
9115: -- 06/26/03 Linda Soo Created --
9116: ----------------------------------------------------------------------------
9117: PROCEDURE get_CostEle_for_DirectItem (
9118: p_api_version IN NUMBER,
9119: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
9120: p_commit IN VARCHAR2 := FND_API.G_FALSE,
9121: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
9122: p_txn_id IN NUMBER,
9123: p_mnt_or_mfg IN NUMBER, -- 1: eam cost element,
9116: ----------------------------------------------------------------------------
9117: PROCEDURE get_CostEle_for_DirectItem (
9118: p_api_version IN NUMBER,
9119: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
9120: p_commit IN VARCHAR2 := FND_API.G_FALSE,
9121: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
9122: p_txn_id IN NUMBER,
9123: p_mnt_or_mfg IN NUMBER, -- 1: eam cost element,
9124: -- 2: manufacturing cost ele
9117: PROCEDURE get_CostEle_for_DirectItem (
9118: p_api_version IN NUMBER,
9119: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
9120: p_commit IN VARCHAR2 := FND_API.G_FALSE,
9121: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
9122: p_txn_id IN NUMBER,
9123: p_mnt_or_mfg IN NUMBER, -- 1: eam cost element,
9124: -- 2: manufacturing cost ele
9125: p_pac_or_perp IN NUMBER, -- 1 for PAC, 0 (default) for Perpetual
9163: ------------------------------------------------
9164: -- Standard call to check for API compatibility
9165: ------------------------------------------------
9166: l_statement := 10;
9167: IF not fnd_api.compatible_api_call( l_api_version,
9168: p_api_version,
9169: l_api_name,
9170: G_PKG_NAME ) then
9171: RAISE fnd_api.G_exc_unexpected_error;
9167: IF not fnd_api.compatible_api_call( l_api_version,
9168: p_api_version,
9169: l_api_name,
9170: G_PKG_NAME ) then
9171: RAISE fnd_api.G_exc_unexpected_error;
9172: END IF;
9173:
9174: -------------------------------------------------------------
9175: -- Initialize message list if p_init_msg_list is set to TRUE
9174: -------------------------------------------------------------
9175: -- Initialize message list if p_init_msg_list is set to TRUE
9176: -------------------------------------------------------------
9177: l_statement := 20;
9178: IF fnd_api.to_Boolean(p_init_msg_list) then
9179: fnd_msg_pub.initialize;
9180: end if;
9181:
9182: -------------------------------------------
9182: -------------------------------------------
9183: -- Initialize API return status to Success
9184: -------------------------------------------
9185: l_statement := 30;
9186: x_return_status := fnd_api.g_ret_sts_success;
9187:
9188: -----------------------------
9189: -- Validate input parameters
9190: -----------------------------
9193: l_api_message := 'One of the IN parameter is null';
9194: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
9195: FND_MESSAGE.set_token('TEXT', l_api_message);
9196: FND_MSG_PUB.add;
9197: RAISE fnd_api.g_exc_error;
9198: end if;
9199:
9200: ----------------------------------------------------------------------
9201: -- Verify if transaction ID exists, Obtain po_header_id and po_line_id
9221: l_api_message := 'Transaction ID does not exist in WIP_COST_TXN_INTERFACE table. ';
9222: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
9223: FND_MESSAGE.set_token('TEXT', l_api_message);
9224: FND_MSG_PUB.add;
9225: RAISE fnd_api.g_exc_error;
9226: end;
9227: ELSE -- Done to support eAM in PAC, get data from WT as WCTI contains nothing at this moment
9228: l_statement := 55;
9229: begin
9244: l_api_message := 'Transaction ID does not exist in WIP_TRANSACTIONS table. ';
9245: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
9246: FND_MESSAGE.set_token('TEXT', l_api_message);
9247: FND_MSG_PUB.add;
9248: RAISE fnd_api.g_exc_error;
9249: end;
9250: END IF;
9251: ----------------------------------------
9252: -- Obtain approved_date, po doc type
9264: l_api_message := l_api_message || ' wip_cost_txn_interface ';
9265: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
9266: FND_MESSAGE.set_token('TEXT', l_api_message);
9267: FND_MSG_pub.add;
9268: RAISE FND_API.g_exc_error;
9269: end if;
9270:
9271: -----------------------
9272: -- Obtain category_id
9282: l_api_message := l_api_message || ' wip_cost_txn_interface ';
9283: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
9284: FND_MESSAGE.set_token('TEXT', l_api_message);
9285: FND_MSG_pub.add;
9286: RAISE FND_API.g_exc_error;
9287: end if;
9288:
9289: ------------------------
9290: -- Obtain cost element
9309: l_api_message := l_api_message || ' wip_cost_txn_interface ';
9310: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
9311: FND_MESSAGE.set_token('TEXT', l_api_message);
9312: FND_MSG_pub.add;
9313: RAISE FND_API.g_exc_error;
9314: End if;
9315:
9316: ELSE
9317:
9325: l_api_message := l_api_message || ' wip_cost_txn_interface ';
9326: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
9327: FND_MESSAGE.set_token('TEXT', l_api_message);
9328: FND_MSG_pub.add;
9329: RAISE FND_API.g_exc_error;
9330: End if;
9331:
9332: END IF;
9333:
9341: l_api_message := l_api_message || ' wip_cost_txn_interface ';
9342: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
9343: FND_MESSAGE.set_token('TEXT', l_api_message);
9344: FND_MSG_pub.add;
9345: RAISE FND_API.g_exc_error;
9346: End if;
9347:
9348: end if;
9349:
9376: l_api_message := 'No category_id exist for PO Line ID: ' || TO_CHAR(l_po_line_id);
9377: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
9378: FND_MESSAGE.set_token('TEXT', l_api_message);
9379: FND_MSG_pub.add;
9380: RAISE FND_API.g_exc_error;
9381: else
9382: l_api_message := 'PO Header ID ' || TO_CHAR(l_po_header_id);
9383: l_api_message := l_api_message || ' has not been approved';
9384: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
9383: l_api_message := l_api_message || ' has not been approved';
9384: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
9385: FND_MESSAGE.set_token('TEXT', l_api_message);
9386: FND_MSG_pub.add;
9387: RAISE FND_API.g_exc_error;
9388: end if;
9389:
9390: x_cost_element_id := l_cost_element_id;
9391:
9394: p_count => x_msg_count,
9395: p_data => x_msg_data );
9396:
9397: EXCEPTION
9398: WHEN fnd_api.g_exc_error then
9399: x_return_status := fnd_api.g_ret_sts_error;
9400: x_cost_element_id := -1;
9401:
9402: fnd_msg_pub.count_and_get(
9395: p_data => x_msg_data );
9396:
9397: EXCEPTION
9398: WHEN fnd_api.g_exc_error then
9399: x_return_status := fnd_api.g_ret_sts_error;
9400: x_cost_element_id := -1;
9401:
9402: fnd_msg_pub.count_and_get(
9403: p_count => x_msg_count,
9402: fnd_msg_pub.count_and_get(
9403: p_count => x_msg_count,
9404: p_data => x_msg_data );
9405:
9406: WHEN fnd_api.g_exc_unexpected_error then
9407: x_return_status := fnd_api.g_ret_sts_unexp_error;
9408: x_cost_element_id := -1;
9409:
9410: fnd_msg_pub.count_and_get(
9403: p_count => x_msg_count,
9404: p_data => x_msg_data );
9405:
9406: WHEN fnd_api.g_exc_unexpected_error then
9407: x_return_status := fnd_api.g_ret_sts_unexp_error;
9408: x_cost_element_id := -1;
9409:
9410: fnd_msg_pub.count_and_get(
9411: p_count => x_msg_count,
9411: p_count => x_msg_count,
9412: p_data => x_msg_data );
9413:
9414: WHEN OTHERS THEN
9415: x_return_status := fnd_api.g_ret_sts_unexp_error ;
9416: x_cost_element_id:= -1;
9417: If fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) then
9418: fnd_msg_pub.add_exc_msg ( 'CST_eamCost_PUB',
9419: ' get_CostElement_for_DirectItem: Statement - ' || to_char(l_statement));
9442: | To support Cost Collection Transfer to Projects of Direct Items for EAM |
9443: | work orders |
9444: | PARAMETERS: |
9445: | p_api_version IN NUMBER |
9446: | p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE |
9447: | p_commit IN VARCHAR2 := FND_API.G_FALSE |
9448: | p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL |
9449: | p_txn_id IN NUMBER |
9450: | x_expenditure_type OUT NOCOPY VARCHAR2 |
9443: | work orders |
9444: | PARAMETERS: |
9445: | p_api_version IN NUMBER |
9446: | p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE |
9447: | p_commit IN VARCHAR2 := FND_API.G_FALSE |
9448: | p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL |
9449: | p_txn_id IN NUMBER |
9450: | x_expenditure_type OUT NOCOPY VARCHAR2 |
9451: | x_return_status OUT NOCOPY VARCHAR2 |
9444: | PARAMETERS: |
9445: | p_api_version IN NUMBER |
9446: | p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE |
9447: | p_commit IN VARCHAR2 := FND_API.G_FALSE |
9448: | p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL |
9449: | p_txn_id IN NUMBER |
9450: | x_expenditure_type OUT NOCOPY VARCHAR2 |
9451: | x_return_status OUT NOCOPY VARCHAR2 |
9452: | x_msg_count OUT NOCOPY NUMBER |
9461: | in the category associations |
9462: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
9463: PROCEDURE get_ExpType_for_DirectItem (
9464: p_api_version IN NUMBER,
9465: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
9466: p_commit IN VARCHAR2 := FND_API.G_FALSE,
9467: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
9468: p_txn_id IN NUMBER,
9469: x_expenditure_type OUT NOCOPY VARCHAR2,
9462: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
9463: PROCEDURE get_ExpType_for_DirectItem (
9464: p_api_version IN NUMBER,
9465: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
9466: p_commit IN VARCHAR2 := FND_API.G_FALSE,
9467: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
9468: p_txn_id IN NUMBER,
9469: x_expenditure_type OUT NOCOPY VARCHAR2,
9470: x_return_status OUT NOCOPY VARCHAR2,
9463: PROCEDURE get_ExpType_for_DirectItem (
9464: p_api_version IN NUMBER,
9465: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
9466: p_commit IN VARCHAR2 := FND_API.G_FALSE,
9467: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
9468: p_txn_id IN NUMBER,
9469: x_expenditure_type OUT NOCOPY VARCHAR2,
9470: x_return_status OUT NOCOPY VARCHAR2,
9471: x_msg_count OUT NOCOPY NUMBER,
9509: ------------------------------------------------
9510: -- Standard call to check for API compatibility
9511: ------------------------------------------------
9512: l_statement := 10;
9513: IF not fnd_api.compatible_api_call( l_api_version,
9514: p_api_version,
9515: l_api_name,
9516: G_PKG_NAME ) then
9517: RAISE fnd_api.G_exc_unexpected_error;
9513: IF not fnd_api.compatible_api_call( l_api_version,
9514: p_api_version,
9515: l_api_name,
9516: G_PKG_NAME ) then
9517: RAISE fnd_api.G_exc_unexpected_error;
9518: END IF;
9519:
9520: -------------------------------------------------------------
9521: -- Initialize message list if p_init_msg_list is set to TRUE
9520: -------------------------------------------------------------
9521: -- Initialize message list if p_init_msg_list is set to TRUE
9522: -------------------------------------------------------------
9523: l_statement := 20;
9524: IF fnd_api.to_Boolean(p_init_msg_list) then
9525: fnd_msg_pub.initialize;
9526: end if;
9527:
9528: -------------------------------------------
9528: -------------------------------------------
9529: -- Initialize API return status to Success
9530: -------------------------------------------
9531: l_statement := 30;
9532: x_return_status := fnd_api.g_ret_sts_success;
9533:
9534: -----------------------------
9535: -- Validate input parameters
9536: -----------------------------
9539: l_api_message := 'IN parameter is null';
9540: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
9541: FND_MESSAGE.set_token('TEXT', l_api_message);
9542: FND_MSG_PUB.add;
9543: RAISE fnd_api.g_exc_error;
9544: end if;
9545:
9546: -----------------------------------------------------------------------
9547: -- Verify if transaction ID exists and Obtain po_header_id, po_line_id
9564: l_api_message := 'Transaction ID does not exist in WIP_TRANSACTIONS table.';
9565: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
9566: FND_MESSAGE.set_token('TEXT', l_api_message);
9567: FND_MSG_PUB.add;
9568: RAISE fnd_api.g_exc_error;
9569: end;
9570:
9571: -------------------------
9572: -- Obtain approved_date
9582: l_api_message := l_api_message || ' wip_transactions ';
9583: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
9584: FND_MESSAGE.set_token('TEXT', l_api_message);
9585: FND_MSG_pub.add;
9586: RAISE FND_API.g_exc_error;
9587: end if;
9588:
9589: -----------------------
9590: -- Obtain category_id
9600: l_api_message := l_api_message || ' wip_transactions ';
9601: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
9602: FND_MESSAGE.set_token('TEXT', l_api_message);
9603: FND_MSG_pub.add;
9604: RAISE FND_API.g_exc_error;
9605: end if;
9606:
9607: /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9608: The following logic will be used to derive the expenditure
9641: l_api_message := 'No category_id exist for PO Line ID: ' || TO_CHAR(l_po_line_id);
9642: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
9643: FND_MESSAGE.set_token('TEXT', l_api_message);
9644: FND_MSG_pub.add;
9645: RAISE FND_API.g_exc_error;
9646: else
9647: l_api_message := 'PO Header ID ' || TO_CHAR(l_po_header_id);
9648: l_api_message := l_api_message || ' has not been approved';
9649: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
9648: l_api_message := l_api_message || ' has not been approved';
9649: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
9650: FND_MESSAGE.set_token('TEXT', l_api_message);
9651: FND_MSG_pub.add;
9652: RAISE FND_API.g_exc_error;
9653: end if;
9654:
9655: /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++
9656: | Check if the expenditure type was not defined in the |
9701: l_api_message := l_api_message || ' or project organization parameters';
9702: FND_MESSAGE.set_name('BOM','CST_API_MESSAGE');
9703: FND_MESSAGE.set_token('TEXT', l_api_message);
9704: FND_MSG_pub.add;
9705: RAISE FND_API.g_exc_error;
9706: end;
9707: end if;
9708:
9709: x_expenditure_type := l_expenditure_type;
9713: p_count => x_msg_count,
9714: p_data => x_msg_data );
9715:
9716: EXCEPTION
9717: WHEN fnd_api.g_exc_error then
9718: x_return_status := fnd_api.g_ret_sts_error;
9719: x_expenditure_type := to_char(-1);
9720:
9721: fnd_msg_pub.count_and_get(
9714: p_data => x_msg_data );
9715:
9716: EXCEPTION
9717: WHEN fnd_api.g_exc_error then
9718: x_return_status := fnd_api.g_ret_sts_error;
9719: x_expenditure_type := to_char(-1);
9720:
9721: fnd_msg_pub.count_and_get(
9722: p_count => x_msg_count,
9721: fnd_msg_pub.count_and_get(
9722: p_count => x_msg_count,
9723: p_data => x_msg_data );
9724:
9725: WHEN fnd_api.g_exc_unexpected_error then
9726: x_return_status := fnd_api.g_ret_sts_unexp_error;
9727: x_expenditure_type := to_char(-1);
9728:
9729: fnd_msg_pub.count_and_get(
9722: p_count => x_msg_count,
9723: p_data => x_msg_data );
9724:
9725: WHEN fnd_api.g_exc_unexpected_error then
9726: x_return_status := fnd_api.g_ret_sts_unexp_error;
9727: x_expenditure_type := to_char(-1);
9728:
9729: fnd_msg_pub.count_and_get(
9730: p_count => x_msg_count,
9730: p_count => x_msg_count,
9731: p_data => x_msg_data );
9732:
9733: WHEN OTHERS THEN
9734: x_return_status := fnd_api.g_ret_sts_unexp_error ;
9735: x_expenditure_type := to_char(-1);
9736: If fnd_msg_pub.check_msg_level(fnd_msg_pub.g_msg_lvl_unexp_error) then
9737: fnd_msg_pub.add_exc_msg ( 'CST_eamCost_PUB',
9738: ' get_ExpType_for_DirectItem: Statement - ' || to_char(l_statement));
9765: -- Standard Start of API savepoint
9766: SAVEPOINT Rollup_WorkOrderCost_PUB;
9767:
9768: -- Initialize message list if p_init_msg_list is set to TRUE
9769: IF FND_API.to_Boolean(p_init_msg_list) THEN
9770: FND_MSG_PUB.initialize;
9771: END IF;
9772:
9773: -- Check for call compatibility
9770: FND_MSG_PUB.initialize;
9771: END IF;
9772:
9773: -- Check for call compatibility
9774: IF NOT FND_API.Compatible_API_Call
9775: ( p_current_version_number => l_api_version,
9776: p_caller_version_number => p_api_version,
9777: p_api_name => l_api_name,
9778: p_pkg_name => G_PKG_NAME
9777: p_api_name => l_api_name,
9778: p_pkg_name => G_PKG_NAME
9779: )
9780: THEN
9781: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
9782: END IF;
9783:
9784: -- Check for message level threshold
9785: l_msg_level_threshold := FND_PROFILE.Value('FND_AS_MSG_LEVEL_THRESHOLD');
9826: p_procedure_name => l_api_name,
9827: p_error_text => 'There is no matching record in CST_EAM_HIERARCHY_SNAPSHOT ' ||
9828: 'for group id ' || p_group_id
9829: );
9830: x_return_status := FND_API.G_RET_STS_SUCCESS;
9831: RETURN;
9832: END IF;
9833:
9834: -- Delete existing calculations for this group id
9966: p_group_id
9967: );
9968: END IF;
9969:
9970: x_return_status := FND_API.G_RET_STS_SUCCESS;
9971: EXCEPTION
9972: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9973: ROLLBACK TO Rollup_WorkOrderCost_PUB;
9974: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9968: END IF;
9969:
9970: x_return_status := FND_API.G_RET_STS_SUCCESS;
9971: EXCEPTION
9972: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9973: ROLLBACK TO Rollup_WorkOrderCost_PUB;
9974: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9975: WHEN l_object_type_exc THEN
9976: ROLLBACK TO Rollup_WorkOrderCost_PUB;
9970: x_return_status := FND_API.G_RET_STS_SUCCESS;
9971: EXCEPTION
9972: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
9973: ROLLBACK TO Rollup_WorkOrderCost_PUB;
9974: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9975: WHEN l_object_type_exc THEN
9976: ROLLBACK TO Rollup_WorkOrderCost_PUB;
9977: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9978: IF l_msg_level_threshold <= FND_MSG_PUB.G_MSG_LVL_ERROR
9973: ROLLBACK TO Rollup_WorkOrderCost_PUB;
9974: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9975: WHEN l_object_type_exc THEN
9976: ROLLBACK TO Rollup_WorkOrderCost_PUB;
9977: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9978: IF l_msg_level_threshold <= FND_MSG_PUB.G_MSG_LVL_ERROR
9979: THEN
9980: FND_MSG_PUB.Add_Exc_Msg(
9981: p_pkg_name => G_PKG_NAME,
9985: );
9986: END IF;
9987: WHEN OTHERS THEN
9988: ROLLBACK TO Rollup_WorkOrderCost_PUB;
9989: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
9990: IF l_msg_level_threshold <= FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR
9991: THEN
9992: FND_MSG_PUB.Add_Exc_Msg(
9993: p_pkg_name => G_PKG_NAME,
10015: -- Standard Start of API savepoint
10016: SAVEPOINT Purge_RollupCost_PUB;
10017:
10018: -- Initialize message list if p_init_msg_list is set to TRUE
10019: IF FND_API.to_Boolean(p_init_msg_list) THEN
10020: FND_MSG_PUB.initialize;
10021: END IF;
10022:
10023: -- Check for call compatibility
10020: FND_MSG_PUB.initialize;
10021: END IF;
10022:
10023: -- Check for call compatibility
10024: IF NOT FND_API.Compatible_API_Call
10025: ( p_current_version_number => l_api_version,
10026: p_caller_version_number => p_api_version,
10027: p_api_name => l_api_name,
10028: p_pkg_name => G_PKG_NAME
10027: p_api_name => l_api_name,
10028: p_pkg_name => G_PKG_NAME
10029: )
10030: THEN
10031: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
10032: END IF;
10033:
10034: -- Check for message level threshold
10035: l_msg_level_threshold := FND_PROFILE.Value('FND_AS_MSG_LEVEL_THRESHOLD');
10086: ' from CST_EAM_ROLLUP_COSTS'
10087: );
10088: END IF;
10089:
10090: x_return_status := FND_API.G_RET_STS_SUCCESS;
10091: EXCEPTION
10092: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
10093: ROLLBACK TO Purge_RollupCost_PUB;
10094: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
10088: END IF;
10089:
10090: x_return_status := FND_API.G_RET_STS_SUCCESS;
10091: EXCEPTION
10092: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
10093: ROLLBACK TO Purge_RollupCost_PUB;
10094: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
10095: WHEN OTHERS THEN
10096: ROLLBACK TO Purge_RollupCost_PUB;
10090: x_return_status := FND_API.G_RET_STS_SUCCESS;
10091: EXCEPTION
10092: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
10093: ROLLBACK TO Purge_RollupCost_PUB;
10094: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
10095: WHEN OTHERS THEN
10096: ROLLBACK TO Purge_RollupCost_PUB;
10097: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
10098: IF l_msg_level_threshold <= FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR
10093: ROLLBACK TO Purge_RollupCost_PUB;
10094: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
10095: WHEN OTHERS THEN
10096: ROLLBACK TO Purge_RollupCost_PUB;
10097: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
10098: IF l_msg_level_threshold <= FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR
10099: THEN
10100: FND_MSG_PUB.Add_Exc_Msg(
10101: p_pkg_name => G_PKG_NAME,
10194: ')');
10195: end if;
10196:
10197: -- Standard call to check for call compatibility.
10198: IF NOT FND_API.Compatible_API_Call ( l_api_version,
10199: p_api_version,
10200: l_api_name ,
10201: 'CST_eamCost_PUB')
10202: THEN
10199: p_api_version,
10200: l_api_name ,
10201: 'CST_eamCost_PUB')
10202: THEN
10203: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
10204: END IF;
10205: -- Initialize message list if p_init_msg_list is set to TRUE.
10206: IF FND_API.to_Boolean( p_init_msg_list ) THEN
10207: FND_MSG_PUB.initialize;
10202: THEN
10203: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
10204: END IF;
10205: -- Initialize message list if p_init_msg_list is set to TRUE.
10206: IF FND_API.to_Boolean( p_init_msg_list ) THEN
10207: FND_MSG_PUB.initialize;
10208: END IF;
10209:
10210: l_stmt_num := 10;
10209:
10210: l_stmt_num := 10;
10211:
10212: -- Initialize API return status to success
10213: x_return_status := FND_API.G_RET_STS_SUCCESS;
10214:
10215: /* Update the record if already exists else insert a new one */
10216:
10217: MERGE INTO CST_EAM_BALANCE_BY_ACCOUNTS cebba
10288: );
10289:
10290:
10291: -- Standard check of p_commit.
10292: IF FND_API.To_Boolean( p_commit ) THEN
10293: COMMIT WORK;
10294: END IF;
10295:
10296:
10309: p_data => x_msg_data
10310: );
10311:
10312: EXCEPTION
10313: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
10314: ROLLBACK TO Insert_eamBalAcct_PUB;
10315: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
10316:
10317: IF (l_uLog) THEN
10311:
10312: EXCEPTION
10313: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
10314: ROLLBACK TO Insert_eamBalAcct_PUB;
10315: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
10316:
10317: IF (l_uLog) THEN
10318: FND_LOG.STRING(
10319: FND_LOG.LEVEL_UNEXPECTED,
10327: p_data => x_msg_data
10328: );
10329: WHEN OTHERS THEN
10330: ROLLBACK TO Insert_eamBalAcct_PUB;
10331: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
10332:
10333: IF (l_uLog) THEN
10334: FND_LOG.STRING(
10335: FND_LOG.LEVEL_UNEXPECTED,
10389: BEGIN
10390: -- Standard Start of API savepoint
10391: SAVEPOINT Delete_eamBalAcct_PUB;
10392: -- Standard call to check for call compatibility.
10393: IF NOT FND_API.Compatible_API_Call ( l_api_version,
10394: p_api_version,
10395: l_api_name ,
10396: 'CST_eamCost_PUB')
10397: THEN
10394: p_api_version,
10395: l_api_name ,
10396: 'CST_eamCost_PUB')
10397: THEN
10398: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
10399: END IF;
10400: -- Initialize message list if p_init_msg_list is set to TRUE.
10401: IF FND_API.to_Boolean( p_init_msg_list ) THEN
10402: FND_MSG_PUB.initialize;
10397: THEN
10398: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
10399: END IF;
10400: -- Initialize message list if p_init_msg_list is set to TRUE.
10401: IF FND_API.to_Boolean( p_init_msg_list ) THEN
10402: FND_MSG_PUB.initialize;
10403: END IF;
10404:
10405: if( l_pLog ) then
10408: end if;
10409:
10410:
10411: -- Initialize API return status to success
10412: x_return_status := FND_API.G_RET_STS_SUCCESS;
10413:
10414: l_stmt_num := 10;
10415:
10416: /* Delete data from CST_EAM_BALANCE_BY_ACCOUNTS */
10419: where wip_entity_id = p_entity_id_tab(l_index)
10420: and organization_id=p_org_id;
10421:
10422: -- Standard check of p_commit.
10423: IF FND_API.To_Boolean( p_commit ) THEN
10424: COMMIT WORK;
10425: END IF;
10426:
10427: /* Procedure level log message for Exit point */
10439: p_data => x_msg_data
10440: );
10441:
10442: EXCEPTION
10443: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
10444: ROLLBACK TO Delete_eamBalAcct_PUB;
10445: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
10446:
10447: IF (l_uLog) THEN
10441:
10442: EXCEPTION
10443: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
10444: ROLLBACK TO Delete_eamBalAcct_PUB;
10445: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
10446:
10447: IF (l_uLog) THEN
10448: FND_LOG.STRING(
10449: FND_LOG.LEVEL_UNEXPECTED,
10456: p_data => x_msg_data
10457: );
10458: WHEN OTHERS THEN
10459: ROLLBACK TO Delete_eamBalAcct_PUB;
10460: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
10461:
10462: IF (l_uLog) THEN
10463: FND_LOG.STRING(
10464: FND_LOG.LEVEL_UNEXPECTED,
10483:
10484: PROCEDURE Insert_tempEstimateDetails
10485: (
10486: p_api_version IN NUMBER,
10487: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
10488: p_commit IN VARCHAR2 := FND_API.G_FALSE,
10489: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
10490: x_return_status OUT NOCOPY VARCHAR2,
10491: x_msg_count OUT NOCOPY NUMBER,
10484: PROCEDURE Insert_tempEstimateDetails
10485: (
10486: p_api_version IN NUMBER,
10487: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
10488: p_commit IN VARCHAR2 := FND_API.G_FALSE,
10489: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
10490: x_return_status OUT NOCOPY VARCHAR2,
10491: x_msg_count OUT NOCOPY NUMBER,
10492: x_msg_data OUT NOCOPY VARCHAR2,
10485: (
10486: p_api_version IN NUMBER,
10487: p_init_msg_list IN VARCHAR2 := FND_API.G_FALSE,
10488: p_commit IN VARCHAR2 := FND_API.G_FALSE,
10489: p_validation_level IN VARCHAR2 := FND_API.G_VALID_LEVEL_FULL,
10490: x_return_status OUT NOCOPY VARCHAR2,
10491: x_msg_count OUT NOCOPY NUMBER,
10492: x_msg_data OUT NOCOPY VARCHAR2,
10493: p_entity_id_tab IN CSTPECEP.wip_entity_id_type
10544: -- Standard Start of API savepoint
10545: SAVEPOINT Insert_tempEstimateDetails_PUB;
10546:
10547: -- Standard call to check for call compatibility.
10548: IF NOT FND_API.Compatible_API_Call (l_api_version,
10549: p_api_version,
10550: l_api_name ,
10551: 'CST_eamCost_PUB') THEN
10552:
10549: p_api_version,
10550: l_api_name ,
10551: 'CST_eamCost_PUB') THEN
10552:
10553: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
10554:
10555: END IF;
10556:
10557: -- Initialize message list if p_init_msg_list is set to TRUE.
10554:
10555: END IF;
10556:
10557: -- Initialize message list if p_init_msg_list is set to TRUE.
10558: IF FND_API.to_Boolean( p_init_msg_list ) THEN
10559: FND_MSG_PUB.initialize;
10560: END IF;
10561:
10562: IF( l_pLog ) THEN
10564: l_module || '.begin', 'Start of ' || l_full_name );
10565: END IF;
10566:
10567: -- Initialize API return status to success
10568: x_return_status := FND_API.G_RET_STS_SUCCESS;
10569:
10570: l_stmt_num := 10;
10571:
10572: /* Insert rows for POs for Direct Items */
10837:
10838: PO_SHARED_PROC_GRP.check_shared_proc_scenario
10839: (
10840: p_api_version => 1.0,
10841: p_init_msg_list => FND_API.G_FALSE,
10842: x_return_status => l_return_status,
10843: p_destination_type_code => 'SHOP FLOOR',
10844: p_document_type_code => c_cedi_rec.document_type,
10845: p_project_id => c_cedi_rec.project_id,
10910: x_return_status => x_return_status,
10911: x_msg_count => x_msg_count,
10912: x_msg_data => x_msg_data
10913: );
10914: IF l_return_status <> FND_API.G_RET_STS_SUCCESS
10915: THEN
10916: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
10917: END IF;
10918:
10912: x_msg_data => x_msg_data
10913: );
10914: IF l_return_status <> FND_API.G_RET_STS_SUCCESS
10915: THEN
10916: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
10917: END IF;
10918:
10919: IF l_gather_stats = 1
10920: THEN
10920: THEN
10921: l_stmt_num := 37;
10922: IF NOT FND_INSTALLATION.GET_APP_INFO('BOM', l_status, l_industry, l_schema)
10923: THEN
10924: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
10925: END IF;
10926:
10927: IF l_schema IS NOT NULL
10928: THEN
10936:
10937: l_stmt_num := 40;
10938:
10939: -- Standard check of p_commit.
10940: IF FND_API.To_Boolean( p_commit ) THEN
10941: COMMIT WORK;
10942: END IF;
10943:
10944: /* Procedure level log message for Exit point */
10956: p_data => x_msg_data
10957: );
10958:
10959: EXCEPTION
10960: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
10961: ROLLBACK TO Insert_tempEstimateDetails_PUB;
10962: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
10963:
10964: IF (l_uLog) THEN
10958:
10959: EXCEPTION
10960: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
10961: ROLLBACK TO Insert_tempEstimateDetails_PUB;
10962: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
10963:
10964: IF (l_uLog) THEN
10965: FND_LOG.STRING(
10966: FND_LOG.LEVEL_UNEXPECTED,
10974: );
10975:
10976: WHEN OTHERS THEN
10977: ROLLBACK TO Insert_tempEstimateDetails_PUB;
10978: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
10979:
10980: IF (l_uLog) THEN
10981: FND_LOG.STRING(
10982: FND_LOG.LEVEL_UNEXPECTED,
11086: SAVEPOINT GET_ENCUMBRANCE_DATA_PVT;
11087: l_stmt_num := 10 ;
11088:
11089: -- Initialize API return status to success
11090: x_return_status := FND_API.G_RET_STS_SUCCESS;
11091: x_msg_count := 0;
11092:
11093:
11094: -- Unlike for Receive transactions, for Deliver transactions, the po_distribution_id
11241:
11242: -- In the case of encumbrance reversals, the quantity to unencumber
11243: -- may turn out to be zero if the quantity delivered is greater than the quantity
11244: -- ordered. In such a situation, we should not error out the event.
11245: IF x_return_status = FND_API.g_ret_sts_success THEN
11246: NULL;
11247: ELSIF x_return_status <> 'W' THEN
11248: l_api_message := 'EXCEPTION:'||lstr;
11249: debug(l_api_message );
11248: l_api_message := 'EXCEPTION:'||lstr;
11249: debug(l_api_message );
11250: x_msg_data := l_api_message;
11251: x_msg_count := x_msg_count + 1;
11252: RAISE FND_API.g_exc_unexpected_error;
11253: END IF;
11254: ELSE
11255: l_stmt_num := 55 ;
11256: debug(l_stmt_num);
11276: WHEN OTHERS THEN
11277: l_api_message := 'EXCEPTION '||SQLERRM;
11278: debug(l_stmt_num||':'||l_api_message);
11279: x_msg_data := l_api_message;
11280: RAISE FND_API.g_exc_unexpected_error;
11281: END;
11282:
11283: /*******************************************************
11284: Step 3 Encumbrance Amount Computation Logic
11304: l_api_message := l_stmt_num||':EXCEPTION: CURRENCY ISSUE l_rcv_event.currency_code:'||l_rcv_event.currency_code;
11305: debug(l_api_message);
11306: x_msg_data := l_api_message;
11307: x_msg_count := x_msg_count + 1;
11308: RAISE FND_API.g_exc_unexpected_error;
11309: END;
11310:
11311: -- Functional Currency
11312: BEGIN
11340: l_api_message := l_stmt_num||'EXCEPTION base currency issue';
11341: debug(l_api_message);
11342: x_msg_data := l_api_message;
11343: x_msg_count := x_msg_count + 1;
11344: RAISE FND_API.g_exc_unexpected_error;
11345: END;
11346:
11347: -- Populate the Accounting Structure
11348: -- Entered_Cr
11436: debug(' x_msg_data :'||x_msg_data);
11437: debug('Get_Encumbrance_Data -');
11438:
11439: EXCEPTION
11440: WHEN FND_API.g_exc_unexpected_error THEN
11441: ROLLBACK TO GET_ENCUMBRANCE_DATA_PVT;
11442: x_return_status := FND_API.g_ret_sts_unexp_error ;
11443: FND_MSG_PUB.count_and_get
11444: ( p_count => x_msg_count
11438:
11439: EXCEPTION
11440: WHEN FND_API.g_exc_unexpected_error THEN
11441: ROLLBACK TO GET_ENCUMBRANCE_DATA_PVT;
11442: x_return_status := FND_API.g_ret_sts_unexp_error ;
11443: FND_MSG_PUB.count_and_get
11444: ( p_count => x_msg_count
11445: , p_data => x_msg_data
11446: );
11446: );
11447: debug('UNEXPECTED EXCEPTION GET_ENCUMBRANCE_DATA : '||l_stmt_num||' : '||x_msg_data);
11448: WHEN OTHERS THEN
11449: ROLLBACK TO GET_ENCUMBRANCE_DATA_PVT;
11450: x_return_status := fnd_api.g_ret_sts_unexp_error ;
11451: FND_MSG_PUB.count_and_get
11452: ( p_count => x_msg_count
11453: , p_data => x_msg_data
11454: );
11501: debug(' p_account_name : '||p_account_name );
11502: debug(' p_item_id : '||p_item_id );
11503:
11504: fnd_msg_pub.initialize;
11505: x_return_status := FND_API.G_RET_STS_SUCCESS;
11506: x_msg_count := 0;
11507:
11508: IF p_wip_entity_id IS NULL THEN
11509: RAISE no_input;
11575: WHEN no_input THEN
11576: x_msg_data := 'EXCEPTION NO_INPUTS in GET_ACCOUNT p_wip_entity_id :'||p_wip_entity_id;
11577: x_msg_count:= x_msg_count + 1;
11578: debug(x_msg_data);
11579: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
11580: x_acct := NULL;
11581: WHEN account_name THEN
11582: FND_MESSAGE.SET_NAME( 'BOM', 'CST_ACCOUNT_UNDEFINED' );
11583: FND_MESSAGE.SET_TOKEN( 'ACCOUNT', p_account_name);
11582: FND_MESSAGE.SET_NAME( 'BOM', 'CST_ACCOUNT_UNDEFINED' );
11583: FND_MESSAGE.SET_TOKEN( 'ACCOUNT', p_account_name);
11584: FND_MSG_PUB.ADD;
11585: fnd_msg_pub.count_and_get(
11586: p_encoded => fnd_api.g_false,
11587: p_count => x_msg_count,
11588: p_data => x_msg_data);
11589: x_return_status := FND_API.G_RET_STS_ERROR;
11590: x_acct := NULL;
11585: fnd_msg_pub.count_and_get(
11586: p_encoded => fnd_api.g_false,
11587: p_count => x_msg_count,
11588: p_data => x_msg_data);
11589: x_return_status := FND_API.G_RET_STS_ERROR;
11590: x_acct := NULL;
11591: debug('EXCEPTION account_name '||p_account_name||' in GET_ACCOUNT');
11592: WHEN c_no_row THEN
11593: x_msg_data := 'EXCEPTION c_no_row in GET_ACCOUNT p_wip_entity_id :'||p_wip_entity_id;
11591: debug('EXCEPTION account_name '||p_account_name||' in GET_ACCOUNT');
11592: WHEN c_no_row THEN
11593: x_msg_data := 'EXCEPTION c_no_row in GET_ACCOUNT p_wip_entity_id :'||p_wip_entity_id;
11594: x_msg_count:= x_msg_count + 1;
11595: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
11596: x_acct := NULL;
11597: debug(x_msg_data);
11598: WHEN acct_null THEN
11599: FND_MESSAGE.SET_NAME( 'BOM' , 'CST_NO_ACCOUNT_FOUND' );
11600: FND_MESSAGE.SET_TOKEN( 'ID' , p_wip_entity_id);
11601: FND_MESSAGE.SET_TOKEN( 'ACCOUNT', p_account_name);
11602: FND_MSG_PUB.ADD;
11603: fnd_msg_pub.count_and_get(
11604: p_encoded => fnd_api.g_false,
11605: p_count => x_msg_count,
11606: p_data => x_msg_data);
11607: x_return_status := FND_API.G_RET_STS_ERROR;
11608: x_acct := NULL;
11603: fnd_msg_pub.count_and_get(
11604: p_encoded => fnd_api.g_false,
11605: p_count => x_msg_count,
11606: p_data => x_msg_data);
11607: x_return_status := FND_API.G_RET_STS_ERROR;
11608: x_acct := NULL;
11609: debug('EXCEPTION CST_NO_ACCOUNT_FOUND in GET_ACCOUNT p_account_name ' || p_account_name ||' - p_wip_entity_id :'||p_wip_entity_id);
11610: WHEN OTHERS THEN
11611: x_msg_data := 'EXCEPTION OTHERS IN get_account '||SQLERRM;
11610: WHEN OTHERS THEN
11611: x_msg_data := 'EXCEPTION OTHERS IN get_account '||SQLERRM;
11612: x_msg_count:= x_msg_count + 1;
11613: debug(x_msg_data);
11614: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
11615: x_acct := NULL;
11616: END;
11617:
11618:
11633: BEGIN
11634: debug('check_enc_rev_flag +');
11635: debug(' p_organization_id : '||p_organization_id );
11636:
11637: x_return_status := FND_API.G_RET_STS_SUCCESS;
11638: x_msg_count := 0;
11639:
11640: OPEN c(p_organization_id);
11641: FETCH c INTO l_encumbrance_reversal_flag;
11658: ELSE
11659: x_msg_data := 'Error encumbrance_reversal_flag should be 1 or 2. Current value:'||
11660: l_encumbrance_reversal_flag;
11661: debug(x_msg_data);
11662: x_return_status := FND_API.G_RET_STS_ERROR;
11663: x_msg_count := x_msg_count + 1;
11664: x_enc_rev_flag := 'N';
11665: END IF;
11666: debug(x_enc_rev_flag);
11668:
11669: EXCEPTION
11670: WHEN l_no_org_exc THEN
11671: x_enc_rev_flag := 'N';
11672: x_return_status := FND_API.G_RET_STS_ERROR;
11673: x_msg_data := 'EXCEPTION l_no_org_exc: No inventory organization :'||p_organization_id;
11674: debug(x_msg_data);
11675: x_msg_count := x_msg_count + 1;
11676: WHEN OTHERS THEN
11674: debug(x_msg_data);
11675: x_msg_count := x_msg_count + 1;
11676: WHEN OTHERS THEN
11677: x_enc_rev_flag := 'N';
11678: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
11679: x_msg_data := 'EXCEPTION OTHERS IN check_enc_rev_flag '||SQLERRM;
11680: debug(x_msg_data);
11681: x_msg_count:= x_msg_count + 1;
11682: END;