The following lines contain the word 'select', 'insert', 'update' or 'delete':
* The AME LOV API inserts the passed on parameters into iAssets LOV interim table named 'IA_AME_LOV_T' with a new sequence
* for unique identifier,'ame_lov_id' generated.
* The reason why we need this interim table and a unique identifier are as follows:
* Firstly, AME requires one single identifier to uniquely identify a record.
* There could be a workaround for this by having a combination of request_id, book_type_code, company_code and cost_center.
* This, however, will lead to too much complexity of implementing and maintaining the code in AME setups in the future.
* Secondly, FWK pages will not save a record of the request details table at the stage
* from which AME needs a value of unique identifier such as request_detail_id.
*
-----------------------------------------------------
debugInfo := 'Generate a new sequence id';
SELECT IA_AME_LOV_T_S.nextval
INTO newAmeLovId
FROM dual;
debugInfo := 'Insert parameters into IA_AME_LOV_T';
INSERT INTO IA_AME_LOV_T
(ame_lov_id,
requester_id,
book_type_code,
company_code,
cost_center,
created_by,
creation_date,
last_updated_by,
last_update_date)
VALUES (newAmeLovId,
RequesterId,
BookTypeCode,
CompanyCode,
CostCenter,
-1,
SYSDATE,
-1,
SYSDATE);
select book_type_code
,responsibility_id
,releasing_approver_id
,receiving_approver_id
into l_book_type_code
,l_responsibility_id
,l_releasing_approver_id
,l_receiving_approver_id
from ia_request_headers
where request_id=RequestId;
select responsibility_id
into l_dummy
from fnd_responsibility
where responsibility_id=l_responsibility_id
and application_id=IA_WF_UTIL_PKG.GetApplicationID;
select book_type_code
,responsibility_id
,releasing_approver_id
,receiving_approver_id
into l_book_type_code
,l_responsibility_id
,l_releasing_approver_id
,l_receiving_approver_id
from ia_request_headers
where request_id=RequestId;
select responsibility_id
into l_dummy
from fnd_responsibility
where responsibility_id=l_responsibility_id
and application_id=IA_WF_UTIL_PKG.GetApplicationID;
FUNCTION UpdateApprovalStatus
(RequestId IN NUMBER,
ChainPhase IN VARCHAR2,
Approver IN AME_UTIL.approverRecord DEFAULT AME_UTIL.emptyApproverRecord,
Forwardee IN AME_UTIL.approverRecord DEFAULT AME_UTIL.emptyApproverRecord)
return BOOLEAN
IS
l_transactionType VARCHAR2(255) := IA_WF_UTIL_PKG.AME_RELEASE_TransactionType;
callingProgram VARCHAR2(80) := 'UpdateApprovalStatus';
debugInfo := 'Calling AME_API.UpdateApprovalStatus';
AME_API.updateApprovalStatus(applicationIdIn => IA_WF_UTIL_PKG.GetApplicationID,
transactionTypeIn => l_transactionType,
transactionIdIn => RequestId,
approverIn => Approver,
forwardeeIn => Forwardee);
AME_API.updateApprovalStatus2(applicationIdIn => IA_WF_UTIL_PKG.GetApplicationID,
transactionIdIn => l_transactionType,
approvalStatusIn => ame_util.noResponseStatus,
approverPersonIdIn => l_forward_from_id,
approverUserIdIn => NULL,
transactionTypeIn => p_item_type,
forwardeeIn => l_recApprover);
END UpdateApprovalStatus;