Skip to main content

Oracle Approvals Management Engine (AME) Extensions for iExpenses


Oracle Approvals Management (AME) Header-Level Approver Client Extension

Use the predefined AP_WEB_CUST_AME_PKG.getHeaderLevelApprover function to set the first approver for approvals routing for the entire expense report. You can also use this function to change the order of precedence for approvals and route expense reports to the cost center owner, cost center business manager, project manager, or award manager. If you do not configure the order of precedence, the approvals are routed in the following order: awards approvers, projects approvers, cost center approvers. The AP_WEB_CUST_AME_PKG.getHeaderLevelApprover function returns the person ID.

Cost Center Approvers

When the approval is set to be routed to the cost center approvers, the system will return:
  • The person ID of the approver that is entered in the Approver field on the General Information page.
  • Null if no value is entered in the Approver field and the cost center entered on the General Information page is the same as the employee's default cost center.
  • The cost center business manager's person ID, if no value is entered in the Approver field and the header cost center is different from the employee's default cost center. If the business manager is not defined, then the cost center owner ID is returned.

Project Approvers

When the approval is set to be routed to the project approvers, the system will return:
  • The person ID of the approver that is entered in the Approver field on the General Information page.
  • The project manager's person ID if no value is entered in the Approver field and all the expenses in the expense report are charged to the same project number.
  • Null if there is no value entered in the Approver field, and there are multiple project numbers in the expense report.

Awards Approvers

When the approval is set to be routed to the awards approvers, the system will return:
  • The person ID of the approver that is entered in the Approver field on the General Information page.
  • The award manager's person ID if no value is entered in the Approver field and all the expenses in the expense report are charged to the same award number.
  • Null if there is no value entered in the Approver field, and there are multiple award numbers in the expense report.
The AP_WEB_CUST_AME_PKG.getHeaderLevelApprover function resides in the apwamecb.pls file in the directory: /apdev/ap/11.5/patch/115/sql.
See: Integrating with Oracle Approvals Management.

The query for the applicable AME attribute is:
 
SELECT ap_web_cust_ame_pkg.Getheaderlevelapprover(:transactionId)FROM   ap_expense_report_headers_allWHERE  report_header_id = :transactionId 
 
Note: The JOB_LEVEL_NON_DEFAULT_STARTING_POINT_PERSON_ID attribute in AME is seeded with a query to get the value for the Approver field. Therefore, to use this client extension, you should update this attribute with the query provided above.

AME Cost Center Approver Client Extension

Use the predefined AP_WEB_CUST_AME_PKG.getCostCenterApprover function to route an expense report for approval to cost center owners. This API is only supported when you use Oracle Approvals Management for expense report approvals.
You can only use the call to this API with an AME dynamic approval group. The AP_WEB_CUST_AME_PKG.getCostCenterApprover function returns the person ID.
To use the AME Cost Center Approver Client Extension:
  1. Create a cost center approval group with this dynamic query:
     
    SELECT 'person_id:'
           || ap_web_cust_ame_pkg.Getcostcenterapprover(:transactionId) person_id
    FROM   ap_expense_report_headers_all
    WHERE  report_header_id = :transactionId

     The AP_WEB_CUST_AME_PKG.getCostCenterApprover function resides in the apwamecb.pls file in the directory: /apdev/ap/11.5/patch/115/sql. The file name is apwamecb.pls.
  2. According to your business requirements, set up a rule with Approval Type pre-chain-of-authority approvals or post-chain-of-authority approvals, then select "Require pre/post-approval from Cost Center Approval Group" for Approval.
  3. Before you enable the new rule, test the Approval Group using the AME Test tab.
    This table describes the different expenses entry scenarios and the value returned by the function for each scenario. The Cost Center default value refers to the value defined in the employee's HR setup.

    Cost Center Approver Field Value Returned
    Default Null Null
    Default Employee's supervisor Null
    Default Not employee's supervisor, but approver belongs to employee's cost center Null
    Default Not employee's supervisor, and approver does not belong to employee's cost center Cost center business manager ID or, if business manager is not defined, cost center owner ID
    Changed Null Cost center business manager ID or, if business manager is not defined, cost center owner ID
    Changed Employee's supervisor Cost center business manager ID or, if business manager is not defined, cost center owner ID
    Changed Not employee's supervisor, but approver belongs to employee's cost center Cost center business manager ID or, if business manager is not defined, cost center owner ID
    Changed Not employee's supervisor, approver not in employee's cost center, and approver's default cost center is different from the cost center entered Cost center business manager ID or, if business manager is not defined, cost center owner ID
    Changed Not employee's supervisor, but approver's default cost center is the same as the cost center entered Nu

Source : iExpenses Client Extensions
   https://docs.oracle.com/cd/E18727_01/doc.121/e13454/T214904T214911.htm

Comments

Popular posts from this blog

SQL Query to extract Oracle Purchase Order Information

SELECT   poh.po_header_id,    poh.type_lookup_code PO_TYPE,   poh.authorization_status PO_STATUS,   poh.segment1 PO_NUMBER,   pov.vendor_name SUPPLIER_NAME,   povs.vendor_site_code Location,   hrls.location_code Ship_To,   hrlb.location_code Bill_to,   pol.line_num ,   msib.segment1 Item,   pol.unit_price,   pol.quantity,   pod.amount_billed Amount,   pod.destination_subinventory,   ppf.full_name Buyer_Name,   poh.closed_Code  FROM   PO_HEADERS_ALL poh,   PO_LINES_ALL pol,   mtl_system_items_b msib,   PO_LINE_LOCATIONS_ALL poll,   PO_DISTRIBUTIONS_ALL pod,   po_vendors pov,   po_vendor_sites_All povs,   hr_locations_all hrls,   hr_locations_all hrlb,   per_all_people_f ppf,   po_line_types polt WHERE   1                         =1 AND polt.line_type_id    = pol.line_type_id AND povs.vendor_site_id     = poh.vendor_site_id AND pov.vendor_id           = poh.vendor_id AND pol.item_id             = msib.inventory_item_id AND msib.organization_id  

Query to find Operating Unit, Business Group and Legal Entity Information

SELECT   DISTINCT   hrl . country ,                  hroutl_bg . name              bg ,                  hroutl_bg . organization_id ,                  lep . legal_entity_id ,                  lep . name                    legal_entity ,                  hroutl_ou . name              ou_name ,                  hroutl_ou . organization_id   org_id ,                  hrl . location_id ,                  hrl . location_code ,                  glev . flex_segment_value FROM     apps . xle_entity_profiles   lep ,         apps . xle_registrations   reg ,         apps . hr_locations_all   hrl ,         apps . hz_parties   hzp ,         apps . fnd_territories_vl   ter ,         apps . hr_operating_units   hro ,         apps . hr_all_organization_units_tl   hroutl_bg ,         apps . hr_all_organization_units_tl   hroutl_ou ,         hr_organization_units   gloperatingunitseo ,         apps . gl_legal_entities_bsvs   glev WHERE    lep . transacting_entity_flag   =   'Y'         AND   l

List of iExpenses Tables

List of iExpenses Tables  Table Name Description AP_EXPENSE_REPORT_HEADERS_ALL Expense report header information AP_EXPENSE_REPORT_LINES_ALL Expense report lines information AP_EXP_REPORT_DISTS_ALL Expense report distribution information. It contains the accounts against each expense report line. AP_CREDIT_CARD_TRXNS_ALL Table to store the corporate credit card transactions that are sent by the banks. These lines are saved as expense lines when the user creates the expense lines for credit cards AP_NOTES Table to store the comments entered by approvers and auditors     Setup tables   AP_EXPENSE_REPORTS_ALL This table contains the header level information about the expense templates AP_EXPENSE_REPORT_PARAMS_ALL This table contains the detail level information about the expense templates AP_POL_CAT_OPTIONS_ALL Table to store the policy options AP_POL_CONTEXT Table to store the policy context     AP_POL_LOCATIONS_TL Table