428: -- Standard begin of API savepoint
429: SAVEPOINT Complete_Work_Order_PVT;
430: -- Check p_init_msg_list
431: IF FND_API.to_Boolean(p_init_msg_list) THEN
432: FND_MSG_PUB.initialize;
433: END IF;
434:
435: -- Initialize API return status to success
436: x_return_status := FND_API.G_RET_STS_SUCCESS;
602: end if;
603: end if;
604:
605: if (x_return_status = FND_API.G_RET_STS_ERROR) then
606: FND_MSG_PUB.Add;
607: FND_MSG_PUB.Count_And_Get(
608: p_count => x_msg_count,
609: p_data => x_msg_data);
610: end if;
603: end if;
604:
605: if (x_return_status = FND_API.G_RET_STS_ERROR) then
606: FND_MSG_PUB.Add;
607: FND_MSG_PUB.Count_And_Get(
608: p_count => x_msg_count,
609: p_data => x_msg_data);
610: end if;
611: EXCEPTION
609: p_data => x_msg_data);
610: end if;
611: EXCEPTION
612: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
613: -- dbms_output.put_line('unexpected error :'||FND_MSG_PUB.Get);
614: -- dbms_output.put_line('unexpected error :'||FND_MESSAGE.get);
615: ROLLBACK TO Complete_Work_Order_PVT;
616: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
617: FND_MSG_PUB.Count_And_Get(
613: -- dbms_output.put_line('unexpected error :'||FND_MSG_PUB.Get);
614: -- dbms_output.put_line('unexpected error :'||FND_MESSAGE.get);
615: ROLLBACK TO Complete_Work_Order_PVT;
616: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
617: FND_MSG_PUB.Count_And_Get(
618: p_count => x_msg_count,
619: p_data => x_msg_data);
620: WHEN NO_DATA_FOUND THEN
621: -- dbms_output.put_line('unexpected error :'||FND_MSG_PUB.Get);
617: FND_MSG_PUB.Count_And_Get(
618: p_count => x_msg_count,
619: p_data => x_msg_data);
620: WHEN NO_DATA_FOUND THEN
621: -- dbms_output.put_line('unexpected error :'||FND_MSG_PUB.Get);
622: -- dbms_output.put_line('unexpected error :'||FND_MESSAGE.get);
623: -- dbms_output.put_line('no data found');
624: ROLLBACK TO Complete_Work_Order_PVT;
625: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
622: -- dbms_output.put_line('unexpected error :'||FND_MESSAGE.get);
623: -- dbms_output.put_line('no data found');
624: ROLLBACK TO Complete_Work_Order_PVT;
625: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
626: FND_MSG_PUB.Count_And_Get(
627: p_count => x_msg_count,
628: p_data => x_msg_data);
629: WHEN OTHERS THEN
630: -- dbms_output.put_line('unexpected error :'||FND_MSG_PUB.Get);
626: FND_MSG_PUB.Count_And_Get(
627: p_count => x_msg_count,
628: p_data => x_msg_data);
629: WHEN OTHERS THEN
630: -- dbms_output.put_line('unexpected error :'||FND_MSG_PUB.Get);
631: -- dbms_output.put_line('unexpected error :'||FND_MESSAGE.get);
632: ROLLBACK TO Complete_Work_Order_PVT;
633: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
634: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
630: -- dbms_output.put_line('unexpected error :'||FND_MSG_PUB.Get);
631: -- dbms_output.put_line('unexpected error :'||FND_MESSAGE.get);
632: ROLLBACK TO Complete_Work_Order_PVT;
633: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
634: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
635: FND_MSG_PUB.Add_Exc_Msg(
636: G_PKG_NAME,
637: l_api_name
638: );
631: -- dbms_output.put_line('unexpected error :'||FND_MESSAGE.get);
632: ROLLBACK TO Complete_Work_Order_PVT;
633: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
634: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
635: FND_MSG_PUB.Add_Exc_Msg(
636: G_PKG_NAME,
637: l_api_name
638: );
639: END IF;
636: G_PKG_NAME,
637: l_api_name
638: );
639: END IF;
640: FND_MSG_PUB.Count_And_Get(
641: p_count => x_msg_count,
642: p_data => x_msg_data);
643: END Complete_Work_Order;
644:
703: SAVEPOINT Complete_Operation_PVT;
704:
705: -- Check p_init_msg_list
706: IF FND_API.to_Boolean(p_init_msg_list) THEN
707: FND_MSG_PUB.initialize;
708: END IF;
709:
710: x_return_status := FND_API.G_RET_STS_SUCCESS;
711:
715:
716: if p_transaction_date > sysdate then
717:
718: FND_MESSAGE.set_name('EAM', 'EAM_TXN_LATER_THAN_TODAY');
719: FND_MSG_PUB.Add;
720: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_TXN_LATER_THAN_TODAY');
721: x_return_status := FND_API.G_RET_STS_ERROR;
722: end if;
723: end if;
766:
767: if (l_operation_completed='Y') and (p_transaction_type =1) then
768:
769: FND_MESSAGE.set_name('EAM', 'EAM_INVALID_TXN_TYPE');
770: FND_MSG_PUB.Add;
771: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_INVALID_TXN_TYPE') ;
772: x_return_status := FND_API.G_RET_STS_ERROR;
773:
774: elsif ((l_operation_completed <> 'Y') and (p_transaction_type =2)) then
773:
774: elsif ((l_operation_completed <> 'Y') and (p_transaction_type =2)) then
775:
776: FND_MESSAGE.set_name('EAM', 'EAM_INVALID_TXN_TYPE');
777: FND_MSG_PUB.Add;
778: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_INVALID_TXN_TYPE') ;
779: x_return_status := FND_API.G_RET_STS_ERROR;
780:
781: end if;
815: -- to_date(to_char(l_actual_end_date, 'DD-MON-YY HH24:MI:SS'),'DD-MON-YY HH24:MI:SS')
816: -- - to_date(to_char(l_actual_start_date, 'DD-MON-YY HH24:MI:SS'),'DD-MON-YY HH24:MI:SS')), 3);
817: if (p_actual_duration is not null) and (p_actual_duration <> l_actual_duration ) then
818: FND_MESSAGE.set_name('EAM', 'EAM_INCORRECT_DURATION');
819: FND_MSG_PUB.Add;
820: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_INCORRECT_DURATION') ;
821: x_return_status := FND_API.G_RET_STS_ERROR;
822:
823: end if;
833:
834: if (l_actual_duration is not null) then
835: if l_actual_duration < 0 then
836: FND_MESSAGE.set_name('EAM', 'EAM_NEGATIVE_DURATION');
837: FND_MSG_PUB.Add;
838: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_NEGATIVE_DURATION') ;
839: x_return_status := FND_API.G_RET_STS_ERROR;
840:
841: end if;
852: if (l_actual_start_date is not null) then
853:
854: if l_actual_end_date > sysdate then
855: FND_MESSAGE.set_name('EAM', 'EAM_END_LATER_THAN_TODAY');
856: FND_MSG_PUB.Add;
857: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_END_LATER_THAN_TODAY ') ;
858: x_return_status := FND_API.G_RET_STS_ERROR;
859: end if;
860:
859: end if;
860:
861: if (p_transaction_date < l_open_acct_per_date) then
862: FND_MESSAGE.set_name('EAM', 'EAM_MIN_OP_ACTUAL_START_DATE');
863: FND_MSG_PUB.Add;
864: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_MIN_OP_ACTUAL_START_DATE') ;
865: x_return_status := FND_API.G_RET_STS_ERROR;
866:
867: end if;
888: -- to_date(to_char(l_actual_end_date, 'DD-MON-YY HH24:MI:SS'),'DD-MON-YY HH24:MI:SS')
889: -- - to_date(to_char(l_actual_start_date, 'DD-MON-YY HH24:MI:SS'),'DD-MON-YY HH24:MI:SS')), 3);
890: if (p_shutdown_duration is not null) and (p_shutdown_duration <> l_shutdown_duration ) then
891: FND_MESSAGE.set_name('EAM', 'EAM_INCORRECT_SHUT_DUR');
892: FND_MSG_PUB.Add;
893: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_INCORRECT_SHUT_DUR') ;
894: x_return_status := FND_API.G_RET_STS_ERROR;
895:
896: end if;
907:
908: if (l_shutdown_duration is not null) then
909: if l_shutdown_duration < 0 then
910: FND_MESSAGE.set_name('EAM', 'EAM_SHUTDOWN_DUR_NEGATIVE');
911: FND_MSG_PUB.Add;
912: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_SHUTDOWN_DUR_NEGATIVE') ;
913: x_return_status := FND_API.G_RET_STS_ERROR;
914:
915: end if;
918: if (l_shutdown_end_date is not null) then
919:
920: if l_shutdown_end_date > sysdate then
921: FND_MESSAGE.set_name('EAM', 'EAM_SHUT_GREATER_SYSDATE');
922: FND_MSG_PUB.Add;
923: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_SHUT_GREATER_SYSDATE ') ;
924: x_return_status := FND_API.G_RET_STS_ERROR;
925: end if;
926:
935:
936: if ((l_shutdown_start_date is not null) and (l_shutdown_end_date is not null)
937: and (l_shutdown_end_date < l_shutdown_start_date)) then
938: FND_MESSAGE.set_name('EAM', 'EAM_SHUT_END_BEFORE_START');
939: FND_MSG_PUB.Add;
940: eam_execution_jsp.add_message(p_app_short_name => 'EAM', p_msg_name => 'EAM_SHUT_END_BEFORE_START ') ;
941:
942:
943: x_return_status := FND_API.G_RET_STS_ERROR;
997: -- insert into eam_op_completion_txns, update wip_operations
998:
999: if l_err_code = 1 then -- there was an error
1000: x_return_status := FND_API.G_RET_STS_ERROR;
1001: FND_MSG_PUB.Add;
1002: end if;
1003: end if;
1004:
1005: if (x_return_status = FND_API.G_RET_STS_ERROR) then
1002: end if;
1003: end if;
1004:
1005: if (x_return_status = FND_API.G_RET_STS_ERROR) then
1006: FND_MSG_PUB.Count_And_Get(
1007: p_count => x_msg_count,
1008: p_data => x_msg_data);
1009: end if;
1010: EXCEPTION
1010: EXCEPTION
1011: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1012: ROLLBACK TO Complete_Operation_PVT;
1013: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1014: FND_MSG_PUB.Count_And_Get(
1015: p_count => x_msg_count,
1016: p_data => x_msg_data);
1017: WHEN OTHERS THEN
1018: ROLLBACK TO Complete_Operation_PVT;
1016: p_data => x_msg_data);
1017: WHEN OTHERS THEN
1018: ROLLBACK TO Complete_Operation_PVT;
1019: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1020: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1021: FND_MSG_PUB.Add_Exc_Msg(
1022: G_PKG_NAME,
1023: l_api_name
1024: );
1017: WHEN OTHERS THEN
1018: ROLLBACK TO Complete_Operation_PVT;
1019: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1020: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
1021: FND_MSG_PUB.Add_Exc_Msg(
1022: G_PKG_NAME,
1023: l_api_name
1024: );
1025: END IF;
1022: G_PKG_NAME,
1023: l_api_name
1024: );
1025: END IF;
1026: FND_MSG_PUB.Count_And_Get(
1027: p_count => x_msg_count,
1028: p_data => x_msg_data);
1029:
1030: