Search 800 + Posts

May 5, 2011

Script to drive Approver name from Oracle Approval Management (AME)

Below is script to drive the APPROVER name that is associated with a Quote.

API in this example drive the approver name from the list that AME(Oracle Approval Management ) module generate based in the Rules that we define in AME.

Note - Rules in AME are based on
Attribute
Condition
Action Type
Action
Approval group based on 

Declare
l_complete              VARCHAR2(1);
l_next_approvers        ame_util.approversTable2;
l_next_approver         ame_util.approverRecord2;
l_index                 ame_util.idList;
l_ids                   ame_util.stringList;
l_class                 ame_util.stringList;
L_Source                Ame_Util.Longstringlist;
Begin
   Ame_Api2.Getnextapprovers1(Applicationidin => 880,  --for Oracle Quote
                        Transactiontypein => 'Quote', --for Oracle Quotes
                        transactionIdIn => '17356',   -- Quote ID for which you want to check Approval
                        flagApproversAsNotifiedIn => ame_util.booleanFalse,
                        approvalProcessCompleteYNOut => l_complete,
                        nextApproversOut => l_next_approvers,
                        itemIndexesOut => l_index,
                        itemIdsOut => l_ids,
                        itemClassesOut => l_class,
                        Itemsourcesout => L_Source
                        );
  dbms_output.put_line('nextApproversOut = '||l_next_approvers(1).name);                     
End;

1 comment:

  1. When i run your code i am getting this error
    ORA-01403: no data found
    ORA-06512: at line 21
    Why is that? I gave transactionid = requisition_header_id and applicationid = 201

    ReplyDelete