Jigsaw Blog

12

Nov
2010
0 comments

Delete a rogue Conur Expense Report

Concur Expense Reports

Delete a rogue report

Sometimes you end up with a Concur Expense Report you can't delete. The user and administrator receive an error message.
So the user recreates the report and you process it. But how do you get rid of the rogue report?

This is the script I have used for some clients. Use it at your own risk.

  1. Get the Employees key
  2. Get the Report Key (of the report you want to remove)
  3. Change "SET @RPT = " to reflect the report ID to remove and then run the delete statements

-- (1) Get employee EMP_KEY
select *
from CT_EMPLOYEE
where FIRST_NAME = 'Cassandra'

-- (2) find report RPT_KEY
select *
from CT_REPORT
where EMP_KEY = 125177

-- (3) delete the entries in this order

DECLARE @RPT int

SET @RPT = 16170

delete CT_REPORT_EXCEPTION where RPT_KEY = @RPT

delete CT_REPORT_ENTRY_TAX_ALLOC where RPE_KEY in (select RPE_KEY from CT_REPORT_ENTRY where RPT_KEY = @RPT)

delete CT_REPORT_ENTRY_TAX where RPE_KEY in (select RPE_KEY from CT_REPORT_ENTRY where RPT_KEY = @RPT)

delete CT_ALLOCATION where RPE_KEY in (select RPE_KEY from CT_REPORT_ENTRY where RPT_KEY = @RPT)

delete CT_JOURNAL where RPE_KEY in (select RPE_KEY from CT_REPORT_ENTRY where RPT_KEY = @RPT)

delete CT_REPORT_ENTRY where RPT_KEY = @RPT

delete CT_EXPENSE_COMMENT where RPT_KEY = @RPT

delete CT_REPORT where RPT_KEY = @RPT