The following lines contain the word 'select', 'insert', 'update' or 'delete':
| 06-MAI-2003 K.Boussema Added the update of event status, bug2936071 |
| 07-MAI-2003 K.Boussema Changed the call to cache API, bug 2945359 |
| 16-MAI-2003 K.Boussema Changed the call of InsertJournalEntries, |
| bug 2963366 |
| 03-JUN-2003 K.Boussema Capture the uncompiled PADs, bug 2963448 |
| 13-JUN-2003 K.Boussema Changed the error message, bug 2963448 |
| 17-JUL-2003 K.Boussema Modified the update of events, bug 3051978 |
| Updated the call to accounting cache, 3055039|
| 21-JUL-2003 K.Boussema Reviewed the call to GetSessionValueChar API |
| 22-JUL-2003 K.Boussema Added the update of journal entries |
| 29-JAN-2003 K.Boussema Reviewed the code to solve bug 3072881 |
| 01-AUG-2003 K.Boussema Modified according to recommendation in bug |
| 3076645 |
| 27-AUG-2003 K.Boussema Reviewed the code according to bug 3084324 |
| 03-SEP-2003 K.Boussema Changed to fix bug 3125028 |
| 23-OCT-2003 K.Boussema Changed to fix issue raise in bug 3209099 |
| 17-NOV-2003 K.Boussema Changed the call to validation routine |
| xla_je_validation_pkg.balance_amounts,3233969|
| 21-NOV-2003 K.Boussema Revised message XLA_AP_PAD_INACTIVE,bg3266350|
| 01-DEC-2003 K.Boussema Added InitExtractErrors, CacheExtractErrors, |
| BuildExtractErrors to validate the extract |
| 03-FEB-2004 K.Boussema Added the extract object name and level in |
| extract error message. |
| Added CacheExtractObject proc. and changed |
| CacheExtractErrors procedure |
| 04-FEB-2004 K.Boussema Removed the token LEDGER_NAME from message |
| XLA_AP_INV_PAD_SETUP, bug 3320707 |
| 12-FEB-2004 K.Boussema Made changes for the FND_LOG. |
| 22-MAR-2004 K.Boussema Added a parameter p_module to the TRACE calls|
| and the procedure. |
| 11-MAY-2004 K.Boussema Removed the call to XLA trace routine from |
| trace() procedure |
| 17-MAY-2004 W.Shen change SubmitAccountingEngine for accounting |
| attribute enhancement project |
| 26-Jul-2004 W. Shen Add a new parameter to CacheExtractErrors |
| if it is called from transaction reversal |
| The line count is 0 or null is not treated |
| as an error. |
| bug 3786968. |
| 23-Sep-2004 S.Singhania Made changes for the bulk peroformance.It has|
| changed the code at number of places. |
| 05-Oct-2004 S.Singhania Bug 3931752: Added code to remove dummy rows |
| from XLA_AE_LINES_GT and XLA_AE_HEADERS_GT |
| (rows with balance_type_code = 'X') in |
| PostAccountingEngine |
| 08-Oct-2004 S.Singhania Bug 3928357: Made changes to make sure the |
| following cases are handled: |
| - Mark events in error when AAD is invalid |
| - Mark events in error when AAD is missing |
| Following routines are modified: |
| - SubmitAccountingEngine |
| - CatchErr_UncompliedAAD |
| - PostAccountingEngine |
| Following new routine is added: |
| - CatchErr_MissingAAD |
| 21-Oct-2004 S.Singhania Bug 3962951. Modified PostAccounting. Update |
| statement to update event status in |
| xla_events_gt is modified. |
| Added one update statement on xla_events_gt |
| to update the event status to ERROR for the|
| case where validation in AccoutningRevesal |
| fails. |
| 02-Nov-2004 K.Boussema Changed for Diagnostic Framework. Included |
| the set of gobal variable g_diagnostics_mode|
| 16-Dec-2004 S.Singhania Bug 4056420. Performance changes made in: |
| - PostAccounting |
| Fixed GSCC warning File.Sql.35 in TRACE. |
| 9-Mar-2005 W. SHen Ledger Currency Project |
| add call to |
| XLA_AE_LINES_PKG.CalculateUnroundedAmounts |
| XLA_AE_LINES_PKG.CalculateGainLossAmounts |
| XLA_AE_LINES_PKG.adjust_display_line_num |
| 14-Mar-2005 K.Boussema Changed for ADR-enhancements. |
| 25-May-2005 W. SHen remove call |
| XLA_AE_LINES_PKG.adjust_display_line_num|
| 17-Jun-2005 W. SHen add call UpdateRelatedErrorsStatus back |
| bug 4155511 |
| 24-Jun-2005 W. Chan Fix bug4092230 - Add ValidateCompleteAADDefn |
| 11-Jul-2005 A. Wan Changed for MPA. 4262811 |
| 12-Jul-2005 W. Chan Fix bug 4480650 - fix ValidateCompleteAADDefn |
| 01-Aug-2005 W. Chan 4458381 - Public Sector Enhancement |
| 27-Dec-2005 A.Wan 4669308 - DeleteIncompleteMPA |
| 20-Jan-2006 W.Chan 4946123 - BC changes for prior entry |
| 24-Jan-2006 A.Wan 4884853 - modify PostAccountingEngine when |
| rollover MPA/Accrual Reversal date. |
| 27-Apr-2006 A.Wan 5095554 - performance fix for non-mergable view|
| xla_subledger_options_v |
| 02-May-2006 A.Wan 5054831 Moved check CatchErr_UncompliedAAD to |
| xla_accounting_pkg.ValidateAAD |
| 28-Jul-2006 A.Wan 5357406 - add p_ledger_id in PostAcctingEngine |
| when calling bflow prior entry API. |
+===========================================================================*/
--
/*======================================================================+
| |
| CONSTANTS |
| |
| |
+======================================================================*/
--
C_FINAL CONSTANT VARCHAR2(1) := 'F';
PROCEDURE UpdateRelatedErrorsStatus
;
PROCEDURE UpdateRelatedErrorsStatus
IS
l_log_module VARCHAR2(240);
SELECT xeg.entity_id, xeg.event_id
FROM xla_events_gt xeg
WHERE xeg.process_status_code = C_EVT_RELATED;
SELECT xe.event_id, xah.ae_header_id, xah.ledger_id
FROM xla_ae_headers xah
,xla_events_gt xe
WHERE xah.event_id = xe.event_id
AND xah.application_id = xe.application_id
AND xe.process_status_code = C_EVT_RELATED;
l_log_module := C_DEFAULT_MODULE||'.UpdateRelatedErrorsStatus';
(p_msg => 'BEGIN of UpdateRelatedErrorsStatus'
,p_level => C_LEVEL_PROCEDURE
,p_module => l_log_module);
UPDATE xla_events_gt xeg
SET xeg.process_status_code = C_EVT_RELATED
WHERE xeg.process_status_code in (C_DRAFT, C_PROCESSED)
AND EXISTS (SELECT /*+ HASH_SJ */ 1
FROM xla_events_gt xeg2
WHERE xeg2.entity_id = xeg.entity_id
AND xeg2.process_status_code in (C_INVALID,
C_ERROR));
/* we decide not to insert the error message for the event
OPEN c_related_events;
/* update related entry status */
UPDATE xla_ae_headers xah
SET xah.accounting_entry_status_code = C_AE_EVT_RELATED
-- Bug 5056632. update group_id to NULL if entry is in error
,group_id = NULL
WHERE xah.event_id in
(SELECT xe.event_id
FROM xla_events_gt xe
WHERE xe.process_status_code = C_EVT_RELATED );
(p_msg => 'END of UpdateRelatedErrorsStatus'
,p_level => C_LEVEL_PROCEDURE
,p_module => l_log_module);
(p_location => 'xla_accounting_engine_pkg.UpdateRelatedErrorsStatus');
END UpdateRelatedErrorsStatus;
| DeleteIncompleteMPA - 4669308 |
| |
| Delete incomplete MPA after all the validation checks taken place, |
| and the deletion should take place only for FINAL mode. |
| Since the reversal of the original entry could result in invalid |
| status after various validation (eg CCID, GL period). So do not |
| delete the incomplete entries unless it is FINAL. This way we can |
| allow user to correct any error before deleting the incomplete MPA. |
| And also, once the incomplete MPA is deleted, it cannot be recreated.|
| |
+======================================================================*/
PROCEDURE DeleteIncompleteMPA(p_application_id IN NUMBER)
IS
l_log_module VARCHAR2(240);
l_log_module := C_DEFAULT_MODULE||'.DeleteIncompleteMPA';
(p_msg => 'BEGIN of DeleteIncompleteMPA'
,p_level => C_LEVEL_PROCEDURE
,p_module => l_log_module);
SELECT distinct xeh3.ae_header_id, xeh3.ledger_id, xeh3.entity_id
BULK COLLECT INTO l_array_LR_incomplete_mpa, l_array_LR_ledger_id, l_array_LR_entity_id
FROM xla_ae_headers xeh1 -- reversal of original entry
,xla_distribution_links xdl2 -- reversal of original entry
,xla_ae_headers xeh3 -- incomplete MPA entries
,xla_ae_headers xeh4 -- original entries
--------------------------------------------------------------
-- Find the original/parent
--------------------------------------------------------------
WHERE xeh4.ae_header_id = xla_ae_lines_pkg.g_incomplete_mpa_acc_LR.l_array_parent_ae_header(i) -- 5108415
AND xeh4.application_id = p_application_id
AND xdl2.application_id = p_application_id
AND xdl2.ref_ae_header_id = xeh4.ae_header_id -- original's ae_header_id
AND xdl2.ref_event_id = xeh4.event_id
--------------------------------------------------------------
-- Check this is a reversal of original entry
--------------------------------------------------------------
AND xeh1.application_id = p_application_id
AND xeh1.ae_header_id = xdl2.ae_header_id
AND xeh1.event_id = xdl2.event_id
AND xdl2.ref_temp_line_num is not null
AND xdl2.ref_temp_line_num = -1 * xdl2.temp_line_num
AND xeh1.accounting_entry_status_code = 'F' -- FINAL and without errors !!!!!
--------------------------------------------------------------
-- Determine this is a incomplete MPA with same orginal/parent
--------------------------------------------------------------
AND xeh3.application_id = p_application_id
AND xeh3.ae_header_id = xla_ae_lines_pkg.g_incomplete_mpa_acc_LR.l_array_ae_header_id(i) -- 5108415
AND xeh3.parent_ae_header_id = xeh4.ae_header_id
AND xeh3.event_id = xeh4.event_id
AND xeh3.accounting_entry_status_code <> 'F'
ORDER by xeh3.ledger_id, xeh3.entity_id, xeh3.ae_header_id;
DELETE xla_ae_lines WHERE application_id = p_application_id AND ae_header_id = l_array_LR_incomplete_mpa(k);
DELETE xla_ae_headers WHERE application_id = p_application_id AND ae_header_id = l_array_LR_incomplete_mpa(l);
DELETE xla_distribution_links WHERE application_id = p_application_id AND ae_header_id = l_array_LR_incomplete_mpa(m);
SELECT distinct xeh3.ae_header_id, xeh3.ledger_id, xeh3.entity_id
BULK COLLECT INTO l_array_TR_incomplete_mpa, l_array_TR_ledger_id, l_array_TR_entity_id
FROM xla_ae_headers xeh1 -- reversal of original entry
,xla_distribution_links xdl2 -- reversal of original entry
,xla_ae_headers xeh3 -- incomplete MPA entries
,xla_ae_headers xeh4 -- original entries
--------------------------------------------------------------
-- Find the original/parent
--------------------------------------------------------------
WHERE xeh4.ae_header_id = xla_ae_lines_pkg.g_incomplete_mpa_acc_TR.l_array_parent_ae_header(i) -- 5108415
AND xeh4.application_id = p_application_id
AND xdl2.application_id = p_application_id
AND xdl2.ref_ae_header_id = xeh4.ae_header_id -- original's ae_header_id
AND xdl2.ref_event_id = xeh4.event_id
--------------------------------------------------------------
-- Check this is a reversal of original entry
--------------------------------------------------------------
AND xeh1.application_id = p_application_id
AND xeh1.ae_header_id = xdl2.ae_header_id
AND xeh1.event_id = xdl2.event_id
AND xdl2.ref_temp_line_num is not null
AND xdl2.ref_temp_line_num = -1 * xdl2.temp_line_num
AND xeh1.accounting_entry_status_code = 'F' -- FINAL and without errors !!!!!
--------------------------------------------------------------
-- Determine this is a incomplete MPA with same orginal/parent
--------------------------------------------------------------
AND xeh3.application_id = p_application_id
AND xeh3.ae_header_id = xla_ae_lines_pkg.g_incomplete_mpa_acc_TR.l_array_ae_header_id(i) -- 5108415
AND xeh3.parent_ae_header_id = xeh4.ae_header_id
AND xeh3.event_id = xeh4.event_id
AND xeh3.accounting_entry_status_code <> 'F'
ORDER by xeh3.ledger_id, xeh3.entity_id, xeh3.ae_header_id;
DELETE xla_ae_lines WHERE application_id = p_application_id AND ae_header_id = l_array_TR_incomplete_mpa(k);
DELETE xla_ae_headers WHERE application_id = p_application_id AND ae_header_id = l_array_TR_incomplete_mpa(l);
DELETE xla_distribution_links WHERE application_id = p_application_id AND ae_header_id = l_array_TR_incomplete_mpa(m);
(p_msg => 'END of DeleteIncompleteMPA'
,p_level => C_LEVEL_PROCEDURE
,p_module => l_log_module);
(p_location => 'xla_accounting_engine_pkg.DeleteIncompleteMPA');
END DeleteIncompleteMPA;
SELECT xpa.event_type_code
FROM xla_prod_acct_headers xpa,
(SELECT t1.product_rule_type_code
, t1.product_rule_code
, sum(1) over (partition by 1) aad_count
FROM (SELECT acd.product_rule_type_code
, acd.product_rule_code
, sum(1) over (partition by subl.application_id) aad_count
-- FROM xla_subledger_options_v xso -- 5095554
FROM gl_ledgers ledg -- (1)
, gl_ledger_relationships glr -- (2)
, xla_ledger_options lopt -- (4)
, xla_subledgers subl -- (5)
-- , xla_acctg_methods_b acm
, xla_acctg_method_rules acd
, gl_ledgers led
WHERE subl.application_id = p_application_id
--
AND ledg.ledger_id = glr.target_ledger_id
AND ledg.ledger_id = lopt.ledger_id
AND subl.application_id = lopt.application_id
AND ledg.object_type_code = 'L' /* only ledgers (not ledger sets) */
AND ledg.le_ledger_type_code = 'L' /* only legal ledgers */
AND ledg.ledger_category_code in ('PRIMARY', 'SECONDARY')
AND glr.application_id = 101
AND ( (glr.relationship_type_code = 'SUBLEDGER') OR
(glr.target_ledger_category_code = 'PRIMARY'
AND glr.relationship_type_code = 'NONE'))
--
AND DECODE(led.ledger_category_code
,'PRIMARY',glr.primary_ledger_id
,ledg.ledger_id) = p_ledger_id
AND DECODE(led.ledger_category_code
,'PRIMARY',DECODE(ledg.ledger_category_code
,'PRIMARY','Y'
,'N')
,'Y') = lopt.capture_event_flag
AND lopt.enabled_flag = 'Y'
AND glr.relationship_enabled_flag = 'Y'
AND led.ledger_id = p_ledger_id
AND ledg.sla_accounting_method_code = acd.accounting_method_code
AND ledg.sla_accounting_method_type = acd.accounting_method_type_code
-- AND acm.accounting_method_code = acd.accounting_method_code
-- AND acm.accounting_method_type_code = acd.accounting_method_type_code
AND acd.application_id = p_application_id
AND acd.amb_context_code = NVL(fnd_profile.value('XLA_AMB_CONTEXT'),'DEFAULT')
AND nvl(acd.start_date_active,p_min_event_date) <= p_min_event_date
AND nvl(acd.end_date_active,p_max_event_date) >= p_max_event_date) t1
GROUP BY t1.product_rule_type_code, t1.product_rule_code) t
WHERE xpa.product_rule_type_code = t.product_rule_type_code
AND xpa.product_rule_code = t.product_rule_code
AND xpa.amb_context_code = NVL(fnd_profile.value('XLA_AMB_CONTEXT'),'DEFAULT')
AND xpa.application_id = p_application_id
GROUP BY xpa.event_type_code, aad_count
HAVING count(*) < aad_count;
SELECT entity_id, event_id
FROM xla_ae_headers_gt
WHERE event_type_code = x_event_type;
UPDATE xla_ae_headers_gt
SET accounting_entry_status_code = xla_ae_journal_entry_pkg.C_RELATED_INVALID
,event_status_code = 'I'
WHERE event_type_code = l_array_event_type(i);
(p_msg => '# rows updated in xla_ae_headers_gt ='||l_count
,p_level => C_LEVEL_STATEMENT
,p_module => l_log_module);
(p_msg => 'SQL- update xla_events_gt'
,p_level => C_LEVEL_STATEMENT
,p_module => l_log_module);
SELECT DISTINCT event_id BULK COLLECT
INTO l_array_temp_events
FROM xla_ae_lines_gt
WHERE reversal_code = 'DUMMY_LR_ERROR';
UPDATE xla_events_gt
SET process_status_code = 'E'
WHERE event_id = l_array_temp_events(i);
(p_msg => '# rows updated in xla_events_gt ='||SQL%ROWCOUNT
,p_level => C_LEVEL_STATEMENT
,p_module => l_log_module);
DELETE FROM xla_ae_lines_gt
WHERE balance_type_code = 'X'
OR (unrounded_accounted_cr is null AND unrounded_accounted_dr is null AND gain_or_loss_flag = 'Y' AND calculate_g_l_amts_flag= 'Y');
DELETE FROM xla_ae_headers_gt
WHERE balance_type_code = 'X';
(p_msg => 'SQL- update xla_ae_headers_gt (1)'
,p_level => C_LEVEL_STATEMENT
,p_module => l_log_module);
UPDATE xla_ae_headers_gt aeh
SET ae_header_id = xla_ae_headers_s.nextval
,(period_name
, period_year
, period_closing_status
, period_start_date
, period_end_date) = -- 4262811
(SELECT period_name
, period_year
, closing_status
, start_date
, end_date -- 4262811
FROM gl_period_statuses gps
WHERE gps.application_id = 101
AND gps.ledger_id = aeh.ledger_id
AND gps.adjustment_period_flag = 'N'
AND aeh.ACCOUNTING_DATE BETWEEN gps.start_date AND gps.end_date)
RETURNING event_id, ledger_id, balance_type_code, header_num, ae_header_id BULK COLLECT -- 4262811
INTO xla_ae_journal_entry_pkg.g_array_event_id
,xla_ae_journal_entry_pkg.g_array_ledger_id
,xla_ae_journal_entry_pkg.g_array_balance_type
,xla_ae_journal_entry_pkg.g_array_header_num -- 4262811
,xla_ae_journal_entry_pkg.g_array_ae_header_id;
(p_msg => '# rows updated in xla_ae_headers_gt(1) ='||SQL%ROWCOUNT
,p_level => C_LEVEL_STATEMENT
,p_module => l_log_module);
UPDATE xla_ae_headers_gt xah
SET first_day_next_gl_period =
(SELECT min(gps.start_date)
FROM gl_period_statuses gps
WHERE gps.application_id = 101
AND gps.ledger_id = xah.ledger_id
AND gps.adjustment_period_flag = 'N'
AND gps.closing_status = 'O'
AND gps.start_date > xah.accounting_date)
WHERE xah.acc_rev_gl_date_option = 'XLA_FIRST_DAY_NEXT_GL_PERIOD'
OR xah.acc_rev_gl_date_option = 'XLA_LAST_DAY_NEXT_GL_PERIOD'
-- 4262811a Rollover MPA Gl Date
OR (xah.acc_rev_gl_date_option in ('XLA_NEXT_DAY','FIRST_DAY_GL_PERIOD','LAST_DAY_GL_PERIOD','ORIGINATING_DAY') AND
xah.period_closing_status IN ('P', 'C'))
OR (xah.acc_rev_gl_date_option in ('XLA_NEXT_DAY','FIRST_DAY_GL_PERIOD','LAST_DAY_GL_PERIOD','ORIGINATING_DAY') AND
xah.period_closing_status = 'N' and xah.accounting_date <= p_end_date);
UPDATE xla_ae_headers_gt xah
SET (accounting_date
,period_name
,period_year
,period_closing_status
,period_start_date
,period_end_date) =
--(SELECT DECODE(xah.acc_rev_gl_date_option, 'XLA_LAST_DAY_NEXT_GL_PERIOD'
-- ,NVL(gps.end_date, xah.accounting_date)
-- ,NVL(gps.start_date, xah.accounting_date))
(SELECT NVL(gps.start_date, xah.accounting_date) -- 4884853 rollover to the first day of next open period
, NVL(gps.period_name, xah.period_name)
, NVL(gps.period_year, xah.period_year)
, NVL(gps.closing_status, xah.period_closing_status)
, NVL(gps.start_date, xah.period_start_date)
, NVL(gps.end_date, xah.period_end_date)
FROM xla_ae_headers_gt xah2
, gl_period_statuses gps
WHERE xah.ae_header_id = xah2.ae_header_id
AND gps.application_id (+) = 101
AND gps.ledger_id (+) = xah2.ledger_id
AND gps.adjustment_period_flag (+) = 'N'
AND gps.closing_status (+) = 'O'
AND gps.start_date (+) = xah2.first_day_next_gl_period)
-- 4884853
WHERE xah.acc_rev_gl_date_option IN ('XLA_FIRST_DAY_NEXT_GL_PERIOD','XLA_LAST_DAY_NEXT_GL_PERIOD','XLA_NEXT_DAY',
'FIRST_DAY_GL_PERIOD','LAST_DAY_GL_PERIOD','ORIGINATING_DAY')
AND (xah.period_closing_status IN ('P', 'C') OR (xah.period_closing_status = 'N' AND xah.accounting_date <= p_end_date));
(p_msg => 'SQL- update xla_ae_headers_gt (2)'
,p_level => C_LEVEL_STATEMENT
,p_module => l_log_module);
UPDATE xla_ae_headers_gt a
SET accounting_entry_status_code = xla_ae_journal_entry_pkg.C_RELATED_INVALID
,event_status_code = 'I'
WHERE accounting_entry_status_code = xla_ae_journal_entry_pkg.C_VALID
AND EXISTS
(SELECT /*+ HASH_SJ */ '1'
FROM xla_ae_headers_gt
WHERE event_id = a.event_id
AND accounting_entry_status_code = xla_ae_journal_entry_pkg.C_INVALID);
(p_msg => '# rows updated in xla_ae_headers_gt(2) ='||SQL%ROWCOUNT
,p_level => C_LEVEL_STATEMENT
,p_module => l_log_module);
(p_msg => '--> CALL xla_ae_journal_entry_pkg.InsertJournalEntries'
,p_level => C_LEVEL_STATEMENT
,p_module => l_log_module);
l_result := xla_ae_journal_entry_pkg.InsertJournalEntries
(p_application_id => p_application_id
,p_accounting_batch_id => p_accounting_batch_id
,p_end_date => p_end_date -- 4262811
,p_accounting_mode => p_accounting_mode
,p_budgetary_control_mode => p_budgetary_control_mode);
SELECT DISTINCT event_id, event_status_code BULK COLLECT
INTO l_array_temp_events, l_array_temp_status
FROM xla_ae_headers_gt;
UPDATE xla_events_gt
SET process_status_code = DECODE(l_array_temp_status(i)
,'X', DECODE(process_status_code
,'E','I'
,DECODE(p_accounting_mode
,'F','P'
,'D'
)
)
,NULL,'U'
,l_array_temp_status(i)
)
WHERE event_id = l_array_temp_events(i);
xla_ae_journal_entry_pkg.UpdateResult(
p_old_status => l_result
, p_new_status => xla_je_validation_pkg.balance_amounts
(p_application_id => p_application_id
,p_end_date => p_end_date -- 4262811
,p_mode => 'CREATE_ACCOUNTING' -- 4262811
,p_ledger_id => p_ledger_id
,p_budgetary_control_mode => p_budgetary_control_mode
,p_accounting_mode => p_accounting_mode));
UpdateRelatedErrorsStatus;
DeleteIncompleteMPA (p_application_id => p_application_id);
SELECT ledger_category_code,enable_budgetary_control_flag
INTO l_ledger_category_code,l_enable_bc_flag
FROM gl_ledgers
WHERE ledger_id = p_base_ledger_id;
SELECT MIN(event_date), MAX(event_date)
INTO p_min_event_date, p_max_event_date
FROM xla_events_gt;
SELECT ledger_category_code,enable_budgetary_control_flag
INTO l_ledger_category_code,l_enable_bc_flag
FROM gl_ledgers
WHERE ledger_id = l_array_base_ledgers(Jdx);
UPDATE xla_events_gt
SET process_status_code = DECODE(process_status_code, 'U', 'E', process_status_code)
WHERE event_date BETWEEN p_min_date AND p_max_date
RETURNING entity_id, event_id
BULK COLLECT INTO
l_array_entity_id
,l_array_event_id;
UPDATE xla_events_gt
SET process_status_code = DECODE(process_status_code, 'U', 'E', process_status_code)
WHERE event_date BETWEEN p_min_event_date AND (p_min_aad_start_date -1)
OR event_date BETWEEN (p_max_aad_end_date +1) AND p_max_event_date
RETURNING entity_id, event_id
BULK COLLECT INTO
l_array_entity_id
,l_array_event_id;
UPDATE xla_events_gt
SET process_status_code = DECODE(process_status_code, 'U', 'E', process_status_code)
WHERE event_date BETWEEN p_min_event_date AND (p_min_aad_start_date -1)
RETURNING entity_id, event_id
BULK COLLECT INTO
l_array_entity_id
,l_array_event_id;
UPDATE xla_events_gt
SET process_status_code = DECODE(process_status_code, 'U', 'E', process_status_code)
WHERE event_date BETWEEN (p_max_aad_end_date +1) AND p_max_event_date
RETURNING entity_id, event_id
BULK COLLECT INTO
l_array_entity_id
,l_array_event_id;