140: *********************************************************************/
141:
142: PROCEDURE Insert_Row
143: ( p_eam_op_rec IN EAM_PROCESS_WO_PUB.eam_op_rec_type
144: , x_mesg_token_Tbl OUT NOCOPY EAM_ERROR_MESSAGE_PVT.Mesg_Token_Tbl_Type
145: , x_return_Status OUT NOCOPY VARCHAR2
146: )
147: IS
148: l_count number;
149: l_min_op_seq_num number;
150: l_department_id number;
151: BEGIN
152:
153: IF EAM_PROCESS_WO_PVT.Get_Debug = 'Y' THEN EAM_ERROR_MESSAGE_PVT.Write_Debug('Writing OP rec for ' || p_eam_op_rec.operation_seq_num); END IF;
154:
155: -- bug no 3444091
156: if p_eam_op_rec.start_date > p_eam_op_rec.completion_date then
157: x_return_status := fnd_api.g_ret_sts_error;
345: and organization_id = p_eam_op_rec.organization_id
346: and wip_entity_id = p_eam_op_rec.wip_entity_id ;
347: END IF;
348:
349: IF EAM_PROCESS_WO_PVT.Get_Debug = 'Y' THEN EAM_ERROR_MESSAGE_PVT.Write_Debug ('Creating new operation') ; END IF;
350:
351: x_return_status := FND_API.G_RET_STS_SUCCESS;
352:
353: EXCEPTION
351: x_return_status := FND_API.G_RET_STS_SUCCESS;
352:
353: EXCEPTION
354: WHEN OTHERS THEN
355: EAM_ERROR_MESSAGE_PVT.Add_Error_Token
356: ( p_message_name => NULL
357: , p_message_text => G_PKG_NAME ||' :Inserting Record ' || SQLERRM
358: , x_mesg_token_Tbl => x_mesg_token_tbl
359: );
372: *********************************************************************/
373:
374: PROCEDURE Update_Row
375: ( p_eam_op_rec IN EAM_PROCESS_WO_PUB.eam_op_rec_type
376: , x_mesg_token_Tbl OUT NOCOPY EAM_ERROR_MESSAGE_PVT.Mesg_Token_Tbl_Type
377: , x_return_Status OUT NOCOPY VARCHAR2
378: )
379: IS
380:
380:
381: l_old_dept_id NUMBER;
382: BEGIN
383:
384: IF EAM_PROCESS_WO_PVT.Get_Debug = 'Y' THEN EAM_ERROR_MESSAGE_PVT.Write_Debug('Updating OP '|| p_eam_op_rec.operation_seq_num); END IF;
385:
386: -- bug no 3444091
387: if p_eam_op_rec.start_date > p_eam_op_rec.completion_date then
388: x_return_status := fnd_api.g_ret_sts_error;
462:
463:
464: PROCEDURE Delete_Row
465: ( p_eam_op_rec IN EAM_PROCESS_WO_PUB.eam_op_rec_type
466: , x_mesg_token_Tbl OUT NOCOPY EAM_ERROR_MESSAGE_PVT.Mesg_Token_Tbl_Type
467: , x_return_Status OUT NOCOPY VARCHAR2
468: )
469: IS
470: BEGIN
468: )
469: IS
470: BEGIN
471:
472: IF EAM_PROCESS_WO_PVT.Get_Debug = 'Y' THEN EAM_ERROR_MESSAGE_PVT.Write_Debug('Deleting Operation: '|| p_eam_op_rec.operation_seq_num); END IF;
473:
474: DELETE FROM WIP_OPERATIONS
475: WHERE wip_entity_id = p_eam_op_rec.wip_entity_id
476: AND organization_id = p_eam_op_rec.organization_id
504: *********************************************************************/
505:
506: PROCEDURE Perform_Writes
507: ( p_eam_op_rec IN EAM_PROCESS_WO_PUB.eam_op_rec_type
508: , x_mesg_token_tbl OUT NOCOPY EAM_ERROR_MESSAGE_PVT.Mesg_Token_Tbl_Type
509: , x_return_status OUT NOCOPY VARCHAR2
510: )
511: IS
512: l_Mesg_Token_tbl EAM_ERROR_MESSAGE_PVT.Mesg_Token_Tbl_Type;
508: , x_mesg_token_tbl OUT NOCOPY EAM_ERROR_MESSAGE_PVT.Mesg_Token_Tbl_Type
509: , x_return_status OUT NOCOPY VARCHAR2
510: )
511: IS
512: l_Mesg_Token_tbl EAM_ERROR_MESSAGE_PVT.Mesg_Token_Tbl_Type;
513: l_return_status VARCHAR2(1):= FND_API.G_RET_STS_SUCCESS;
514: BEGIN
515:
516: IF p_eam_op_rec.transaction_type = EAM_PROCESS_WO_PVT.G_OPR_CREATE