DBA Data[Home] [Help]

APPS.XLA_ACCOUNTING_ENGINE_PKG dependencies on XLA_AE_HEADERS

Line 64: | from XLA_AE_LINES_GT and XLA_AE_HEADERS_GT |

60: | bug 3786968. |
61: | 23-Sep-2004 S.Singhania Made changes for the bulk peroformance.It has|
62: | changed the code at number of places. |
63: | 05-Oct-2004 S.Singhania Bug 3931752: Added code to remove dummy rows |
64: | from XLA_AE_LINES_GT and XLA_AE_HEADERS_GT |
65: | (rows with balance_type_code = 'X') in |
66: | PostAccountingEngine |
67: | 08-Oct-2004 S.Singhania Bug 3928357: Made changes to make sure the |
68: | following cases are handled: |

Line 507: FROM xla_ae_headers xah

503: WHERE xeg.process_status_code = C_EVT_RELATED;
504:
505: CURSOR c_related_headers is
506: SELECT xe.event_id, xah.ae_header_id, xah.ledger_id
507: FROM xla_ae_headers xah
508: ,xla_events_gt xe
509: WHERE xah.event_id = xe.event_id
510: AND xah.application_id = xe.application_id
511: AND xe.process_status_code = C_EVT_RELATED;

Line 566: UPDATE xla_ae_headers xah

562: close c_related_events;
563: */
564:
565: /* update related entry status */
566: UPDATE xla_ae_headers xah
567: SET xah.accounting_entry_status_code = C_AE_EVT_RELATED
568: -- Bug 5056632. update group_id to NULL if entry is in error
569: ,group_id = NULL
570: WHERE xah.event_id in

Line 673: FROM xla_ae_headers xeh1 -- reversal of original entry

669: ------------------------------------------------------------------------------------
670:
671: SELECT distinct xeh3.ae_header_id, xeh3.ledger_id, xeh3.entity_id
672: BULK COLLECT INTO l_array_LR_incomplete_mpa, l_array_LR_ledger_id, l_array_LR_entity_id
673: FROM xla_ae_headers xeh1 -- reversal of original entry
674: ,xla_distribution_links xdl2 -- reversal of original entry
675: ,xla_ae_headers xeh3 -- incomplete MPA entries
676: ,xla_ae_headers xeh4 -- original entries
677: --------------------------------------------------------------

Line 675: ,xla_ae_headers xeh3 -- incomplete MPA entries

671: SELECT distinct xeh3.ae_header_id, xeh3.ledger_id, xeh3.entity_id
672: BULK COLLECT INTO l_array_LR_incomplete_mpa, l_array_LR_ledger_id, l_array_LR_entity_id
673: FROM xla_ae_headers xeh1 -- reversal of original entry
674: ,xla_distribution_links xdl2 -- reversal of original entry
675: ,xla_ae_headers xeh3 -- incomplete MPA entries
676: ,xla_ae_headers xeh4 -- original entries
677: --------------------------------------------------------------
678: -- Find the original/parent
679: --------------------------------------------------------------

Line 676: ,xla_ae_headers xeh4 -- original entries

672: BULK COLLECT INTO l_array_LR_incomplete_mpa, l_array_LR_ledger_id, l_array_LR_entity_id
673: FROM xla_ae_headers xeh1 -- reversal of original entry
674: ,xla_distribution_links xdl2 -- reversal of original entry
675: ,xla_ae_headers xeh3 -- incomplete MPA entries
676: ,xla_ae_headers xeh4 -- original entries
677: --------------------------------------------------------------
678: -- Find the original/parent
679: --------------------------------------------------------------
680: WHERE xeh4.ae_header_id = xla_ae_lines_pkg.g_incomplete_mpa_acc_LR.l_array_parent_ae_header(i) -- 5108415

Line 707: (p_msg => '# LR rows incomplete MPA in xla_ae_headers ='||l_array_LR_incomplete_mpa.COUNT

703:
704: /*
705: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
706: trace
707: (p_msg => '# LR rows incomplete MPA in xla_ae_headers ='||l_array_LR_incomplete_mpa.COUNT
708: ,p_level => C_LEVEL_STATEMENT
709: ,p_module => l_log_module);
710: FOR j in 1..l_array_LR_incomplete_mpa.COUNT LOOP
711: trace

Line 727: DELETE xla_ae_headers WHERE application_id = p_application_id AND ae_header_id = l_array_LR_incomplete_mpa(l);

723: ---------------------------------------------------------------
724: FORALL k in 1..l_array_LR_incomplete_mpa.COUNT
725: DELETE xla_ae_lines WHERE application_id = p_application_id AND ae_header_id = l_array_LR_incomplete_mpa(k);
726: FORALL l in 1..l_array_LR_incomplete_mpa.COUNT
727: DELETE xla_ae_headers WHERE application_id = p_application_id AND ae_header_id = l_array_LR_incomplete_mpa(l);
728: FORALL m in 1..l_array_LR_incomplete_mpa.COUNT
729: DELETE xla_distribution_links WHERE application_id = p_application_id AND ae_header_id = l_array_LR_incomplete_mpa(m);
730:
731: END LOOP;

Line 743: FROM xla_ae_headers xeh1 -- reversal of original entry

739: -- Find incomplete MPA entries whose original/parent has been reversed
740: ------------------------------------------------------------------------------------
741: SELECT distinct xeh3.ae_header_id, xeh3.ledger_id, xeh3.entity_id
742: BULK COLLECT INTO l_array_TR_incomplete_mpa, l_array_TR_ledger_id, l_array_TR_entity_id
743: FROM xla_ae_headers xeh1 -- reversal of original entry
744: ,xla_distribution_links xdl2 -- reversal of original entry
745: ,xla_ae_headers xeh3 -- incomplete MPA entries
746: ,xla_ae_headers xeh4 -- original entries
747: --------------------------------------------------------------

Line 745: ,xla_ae_headers xeh3 -- incomplete MPA entries

741: SELECT distinct xeh3.ae_header_id, xeh3.ledger_id, xeh3.entity_id
742: BULK COLLECT INTO l_array_TR_incomplete_mpa, l_array_TR_ledger_id, l_array_TR_entity_id
743: FROM xla_ae_headers xeh1 -- reversal of original entry
744: ,xla_distribution_links xdl2 -- reversal of original entry
745: ,xla_ae_headers xeh3 -- incomplete MPA entries
746: ,xla_ae_headers xeh4 -- original entries
747: --------------------------------------------------------------
748: -- Find the original/parent
749: --------------------------------------------------------------

Line 746: ,xla_ae_headers xeh4 -- original entries

742: BULK COLLECT INTO l_array_TR_incomplete_mpa, l_array_TR_ledger_id, l_array_TR_entity_id
743: FROM xla_ae_headers xeh1 -- reversal of original entry
744: ,xla_distribution_links xdl2 -- reversal of original entry
745: ,xla_ae_headers xeh3 -- incomplete MPA entries
746: ,xla_ae_headers xeh4 -- original entries
747: --------------------------------------------------------------
748: -- Find the original/parent
749: --------------------------------------------------------------
750: WHERE xeh4.ae_header_id = xla_ae_lines_pkg.g_incomplete_mpa_acc_TR.l_array_parent_ae_header(i) -- 5108415

Line 777: (p_msg => '# TR rows incomplete MPA in xla_ae_headers ='||l_array_TR_incomplete_mpa.COUNT

773:
774: /*
775: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
776: trace
777: (p_msg => '# TR rows incomplete MPA in xla_ae_headers ='||l_array_TR_incomplete_mpa.COUNT
778: ,p_level => C_LEVEL_STATEMENT
779: ,p_module => l_log_module);
780: FOR j in 1..l_array_TR_incomplete_mpa.COUNT LOOP
781: trace

Line 797: DELETE xla_ae_headers WHERE application_id = p_application_id AND ae_header_id = l_array_TR_incomplete_mpa(l);

793: ---------------------------------------------------------------
794: FORALL k in 1..l_array_TR_incomplete_mpa.COUNT
795: DELETE xla_ae_lines WHERE application_id = p_application_id AND ae_header_id = l_array_TR_incomplete_mpa(k);
796: FORALL l in 1..l_array_TR_incomplete_mpa.COUNT
797: DELETE xla_ae_headers WHERE application_id = p_application_id AND ae_header_id = l_array_TR_incomplete_mpa(l);
798: FORALL m in 1..l_array_TR_incomplete_mpa.COUNT
799: DELETE xla_distribution_links WHERE application_id = p_application_id AND ae_header_id = l_array_TR_incomplete_mpa(m);
800:
801: END LOOP;

Line 910: FROM xla_ae_headers_gt

906: HAVING count(*) < aad_count;
907:
908: CURSOR c_je(x_event_type VARCHAR2) IS
909: SELECT entity_id, event_id
910: FROM xla_ae_headers_gt
911: WHERE event_type_code = x_event_type;
912:
913: l_array_event_type xla_ae_journal_entry_pkg.t_array_V30L;
914: l_count INTEGER;

Line 938: UPDATE xla_ae_headers_gt

934:
935: IF (l_array_event_type.COUNT > 0) THEN
936:
937: FORALL i IN 1..l_array_event_type.COUNT
938: UPDATE xla_ae_headers_gt
939: SET accounting_entry_status_code = xla_ae_journal_entry_pkg.C_RELATED_INVALID
940: ,event_status_code = 'I'
941: WHERE event_type_code = l_array_event_type(i);
942:

Line 947: (p_msg => '# rows updated in xla_ae_headers_gt ='||l_count

943: l_count := SQL%ROWCOUNT;
944:
945: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
946: trace
947: (p_msg => '# rows updated in xla_ae_headers_gt ='||l_count
948: ,p_level => C_LEVEL_STATEMENT
949: ,p_module => l_log_module);
950: END IF;
951:

Line 1137: DELETE FROM xla_ae_headers_gt

1133: DELETE FROM xla_ae_lines_gt
1134: WHERE balance_type_code = 'X'
1135: 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');
1136:
1137: DELETE FROM xla_ae_headers_gt
1138: WHERE balance_type_code = 'X';
1139:
1140: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
1141: trace

Line 1142: (p_msg => 'SQL- update xla_ae_headers_gt (1)'

1138: WHERE balance_type_code = 'X';
1139:
1140: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
1141: trace
1142: (p_msg => 'SQL- update xla_ae_headers_gt (1)'
1143: ,p_level => C_LEVEL_STATEMENT
1144: ,p_module => l_log_module);
1145: END IF;
1146:

Line 1148: UPDATE xla_ae_headers_gt aeh

1144: ,p_module => l_log_module);
1145: END IF;
1146:
1147:
1148: UPDATE xla_ae_headers_gt aeh
1149: SET ae_header_id = xla_ae_headers_s.nextval
1150: ,(period_name
1151: , period_year
1152: , period_closing_status

Line 1149: SET ae_header_id = xla_ae_headers_s.nextval

1145: END IF;
1146:
1147:
1148: UPDATE xla_ae_headers_gt aeh
1149: SET ae_header_id = xla_ae_headers_s.nextval
1150: ,(period_name
1151: , period_year
1152: , period_closing_status
1153: , period_start_date

Line 1174: (p_msg => '# rows updated in xla_ae_headers_gt(1) ='||SQL%ROWCOUNT

1170: ,xla_ae_journal_entry_pkg.g_array_ae_header_id;
1171:
1172: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
1173: trace
1174: (p_msg => '# rows updated in xla_ae_headers_gt(1) ='||SQL%ROWCOUNT
1175: ,p_level => C_LEVEL_STATEMENT
1176: ,p_module => l_log_module);
1177: END IF;
1178:

Line 1188: UPDATE xla_ae_headers_gt xah

1184: -- in a closed or permentently closed period
1185: -- 3. the accrual reversal gl date mode is Next Day but currenly the next day is
1186: -- in a future open period and the gl date is before the End GL date parameter
1187: --
1188: UPDATE xla_ae_headers_gt xah
1189: SET first_day_next_gl_period =
1190: (SELECT min(gps.start_date)
1191: FROM gl_period_statuses gps
1192: WHERE gps.application_id = 101

Line 1215: UPDATE xla_ae_headers_gt xah

1211: -- open GL period. Update the GL Date to the first day next GL period.
1212: --
1213: IF (SQL%ROWCOUNT > 0) THEN
1214:
1215: UPDATE xla_ae_headers_gt xah
1216: SET (accounting_date
1217: ,period_name
1218: ,period_year
1219: ,period_closing_status

Line 1231: FROM xla_ae_headers_gt xah2

1227: , NVL(gps.period_year, xah.period_year)
1228: , NVL(gps.closing_status, xah.period_closing_status)
1229: , NVL(gps.start_date, xah.period_start_date)
1230: , NVL(gps.end_date, xah.period_end_date)
1231: FROM xla_ae_headers_gt xah2
1232: , gl_period_statuses gps
1233: WHERE xah.ae_header_id = xah2.ae_header_id
1234: AND gps.application_id (+) = 101
1235: AND gps.ledger_id (+) = xah2.ledger_id

Line 1256: (p_msg => 'SQL- update xla_ae_headers_gt (2)'

1252: (p_ledger_id => p_ledger_id);
1253:
1254: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
1255: trace
1256: (p_msg => 'SQL- update xla_ae_headers_gt (2)'
1257: ,p_level => C_LEVEL_STATEMENT
1258: ,p_module => l_log_module);
1259: END IF;
1260:

Line 1268: UPDATE xla_ae_headers_gt a

1264: ,p_min_event_date => p_min_event_date
1265: ,p_max_event_date => p_max_event_date);
1266:
1267:
1268: UPDATE xla_ae_headers_gt a
1269: SET accounting_entry_status_code = xla_ae_journal_entry_pkg.C_RELATED_INVALID
1270: ,event_status_code = 'I'
1271: WHERE accounting_entry_status_code = xla_ae_journal_entry_pkg.C_VALID
1272: AND EXISTS

Line 1274: FROM xla_ae_headers_gt

1270: ,event_status_code = 'I'
1271: WHERE accounting_entry_status_code = xla_ae_journal_entry_pkg.C_VALID
1272: AND EXISTS
1273: (SELECT /*+ HASH_SJ */ '1'
1274: FROM xla_ae_headers_gt
1275: WHERE event_id = a.event_id
1276: AND accounting_entry_status_code = xla_ae_journal_entry_pkg.C_INVALID);
1277:
1278:

Line 1281: (p_msg => '# rows updated in xla_ae_headers_gt(2) ='||SQL%ROWCOUNT

1277:
1278:
1279: IF (C_LEVEL_STATEMENT >= g_log_level) THEN
1280: trace
1281: (p_msg => '# rows updated in xla_ae_headers_gt(2) ='||SQL%ROWCOUNT
1282: ,p_level => C_LEVEL_STATEMENT
1283: ,p_module => l_log_module);
1284: END IF;
1285:

Line 1322: FROM xla_ae_headers_gt

1318: */
1319:
1320: SELECT DISTINCT event_id, event_status_code BULK COLLECT
1321: INTO l_array_temp_events, l_array_temp_status
1322: FROM xla_ae_headers_gt
1323: order by event_id , event_status_code desc -- added for bug#9086275
1324: ;
1325:
1326: FORALL i IN 1..l_array_temp_events.COUNT