Delete Expense Report From Interface Tables

Delete Expense Report From Interface Tables

In this article, we will talk about how to delete the Oracle expenses.

  1. The workflow(Expenses – APEXP) will delete the Rejected Expenses from the system after certain days.
  2. Manually delete the expenses from Oracle using API.

Auto Delete/System Delete:
If the user submits expense and approver rejected that expense.
User/submitter will get notified to once the expense got rejected and expense will sit in users queue for 31 days.
If the user doesn’t respond to an expense within 31 days, Oracle workflow will delete this expense from the system by calling “Delete Expense Report From Interface Tables
Workflow function is AP_WEB_EXPENSE_WF.DELETEEXPENSEREPORT

If we would like to customize the workflow(APEXP) follow below the steps according to the Note: 1332819.1

1. Open Oracle Workflow Builder
2. Connect to the database and open the Expenses workflow
3. Double click on the ‘AP Standard Expense Report Process’
4. If the expense report was Rejected during Manager Approval, then double click on the ‘Rejection Process’
5. Right click on the ‘Wait For Resubmission’ function
6. Click on the Node tab.

Under Timeout, the default value is 32 days. Which means the expense report will be deleted from the tables after this time and no action is taken on the expense report.

You can increase/decrease this value here and save changes to the database.

Manual Delete:
We might need to delete the expenses manually in some cases like user-created expenses wrongly and the approver approved expense by accident.
Now the expense status will be in Ready for Payment, now we have to delete these expenses manually.
We can use either of below API’s based on our need.

BEGIN
Mo_Global.set_policy_context('S', 'Operating Unit');
SELECT REPORT_HEADER_ID FROM AP_EXPENSE_REPORT_HEADERS_ALL WHERE INVOICE_NUM = 'Expense Report Number';
AP_WEB_EXPENSE_WF.WithdrawExpenseRep('Report Header Id');
END;
BEGIN
Mo_Global.set_policy_context('S', 'Operating Unit');
SELECT REPORT_HEADER_ID FROM AP_EXPENSE_REPORT_HEADERS_ALL WHERE INVOICE_NUM = 'Expense Report Number';
AP_WEB_OA_MAINFLOW_PKG.WITHDRAWEXPENSEREPORT(P_REPORT_HEADER_ID => 'Report Header Id');
END;

 

Comments are closed.