Professional Documents
Culture Documents
Sweep Transacttions
Sweep Transacttions
+==================================================================================
=============+
REM |
|
REM | File Name : sweep_transactions_Fix.txt
|
REM |
|
REM | Desc : Datafix finds all transactions accounted in a closed period for an
|
REM | application and sweeps them to next period as input provided by user.
|
REM | Related Subledger teams like AP/AR should first update their
tables ,then |
REM | only Xla tables can be modified.Else there would be serious
reconciliation issues |
|
REM | CodeFix: | Script modified by MJOSHI2 on 08-May-17 to include MPA
|
REM | Sweep data fix needs a correction to upate the xla_events:
|
REM | event_date only for the headers from back tables when the
|
REM | parent_ae_header_id is NULL .
|
REM | It is not null for period end accruals and MPA accounting,
|
REM | in which case ONE event would have multiple headers
|
REM | across multiperiods in which case we should be updating
the event. |
REM | Script modified by MJOSHI2 on 17-May-17 to remove
|
REM | xah.accounting_entry_status_code='F' condition as per mail
communication. |
REM | USAGE :
|
REM | Supply the following when prompted:
|
REM | 1) new_accounting_date
|
REM | 2) ledger_id
|
REM | 3) application_id
|
REM |
|
REM
*==================================================================================
===========*/
--The script can be used when Transfer to GL fails because transactions are in
closed/permanently closed periods.
--After applying datafix when Transfer to GL is run again ,it should go fine.
--The script can be hardcoded for specific transaction also if subledgers like
AP/AR want to sweep a draft/final accounted
--transaction Or if they are having an issue sweeping a transaction.
--1)
Drop table xla_ae_headers_7234498;
--3) Update transactions period and gl date in xla ae headers which are in closed
period
--4) Update transactions event date in xla event which are in closed period
Update xla_events xe
set xe.event_date = to_date('&new_accounting_date','DD-MON-YYYY'),
xe.last_updated_by = -169
where exists
( select 1 from xla_ae_headers_7234498 xah1
where xah1.event_id = xe.event_id
and xah.parent_ae_header_id IS NULL )
and xe.application_id=&application_id
and xe.event_status_code='P'
and xe.process_status_code ='P'
and xe.upg_batch_id is NULL;
--5) Update transactions gl date in xla ae lines which are in closed period