DBA Data[Home] [Help]

APPS.XLA_FSAH_INT_PVT SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 12

|    procedures which required to update and reprocess the successfull and        |
|    non-succesfull transactions                                                  |
|    and tranfermations to people soft General Ledger.                            |
|                                                                                 |
|    Also API Return The new group_id for the further Successfull Update          |
|                                                                                 |
|                                                                                 |
|    Note:                                                                        |
|       - the APIs do not execute any COMMIT or ROLLBACK.                         |
|                                                                                 |
| HISTORY                                                                         |
| -------                                                                         |
| 26-Jun-08    JAGAN KODURI                                                       |
| 30-Dec-08    JAGAN KODURI Updating the Original Event status to 'I' and 'U'     |                                                                        |                                                                                 |
|                                                                                 |
| PARAMETER DESCRIPTION                                                           |
| ---------------------                                                           |
|                                                                                 |
| SET_GROUP_ID                                                                    |
| ------------                                                                    |
| p_ledger_short_name         :in parameter                                       |
|                                                                                 |
| SET_TRANSFER_STATUS                                                             |
| --------------------                                                            |
| p_group_id         :in parameter (xla_fsah_int_pvt.group_id)                    |
| p_batch_status     :in parameter (F/S)                                          |
| p_api_version      :in parameter (Default API version 1.0)                      |
| p_return_status    :out parameter (Use to Return Process Successfull Status)    |
| p_msg_data         :out parameter (Default API out to Error count)              |
| p_msg_count        :out parameter (return New Group Id for New Process Update)  |
|                                                                                 |
+================================================================================*/

   --==================================================================================
-- global declaration
--==================================================================================
      TYPE t_je_info IS RECORD (
      header_id                        INTEGER,
      ledger_id                        INTEGER,
      legal_entity_id                  INTEGER,
      application_id                   INTEGER,
      entity_id                        INTEGER,
      event_id                         INTEGER,
      gl_date                          DATE,
      status_code                      VARCHAR2 (30),
      type_code                        VARCHAR2 (30),
      description                      VARCHAR2 (2400),
      balance_type_code                VARCHAR2 (30),
      budget_version_id                INTEGER,
      reference_date                   DATE,
      funds_status_code                VARCHAR2 (30),
      je_category_name                 VARCHAR2 (80),
      packet_id                        INTEGER,
      amb_context_code                 VARCHAR2 (30),
      event_type_code                  VARCHAR2 (30),
      completed_date                   DATE,
      gl_transfer_status_code          VARCHAR2 (30),
      accounting_batch_id              INTEGER,
      period_name                      VARCHAR2 (15),
      product_rule_code                VARCHAR2 (30),
      product_rule_type_code           VARCHAR2 (30),
      product_rule_version             VARCHAR2 (30),
      gl_transfer_date                 DATE,
      doc_sequence_id                  INTEGER,
      doc_sequence_value               VARCHAR2 (240),
      close_acct_seq_version_id        INTEGER,
      close_acct_seq_value             VARCHAR2 (240),
      close_acct_seq_assign_id         INTEGER,
      completion_acct_seq_version_id   INTEGER,
      completion_acct_seq_value        VARCHAR2 (240),
      completion_acct_seq_assign_id    INTEGER,
      accrual_reversal_flag            VARCHAR2 (1),
      budgetary_control_flag           VARCHAR2 (1),
      attribute_category               VARCHAR2 (30),
      attribute1                       VARCHAR2 (150),
      attribute2                       VARCHAR2 (150),
      attribute3                       VARCHAR2 (150),
      attribute4                       VARCHAR2 (150),
      attribute5                       VARCHAR2 (150),
      attribute6                       VARCHAR2 (150),
      attribute7                       VARCHAR2 (150),
      attribute8                       VARCHAR2 (150),
      attribute9                       VARCHAR2 (150),
      attribute10                      VARCHAR2 (150),
      attribute11                      VARCHAR2 (150),
      attribute12                      VARCHAR2 (150),
      attribute13                      VARCHAR2 (150),
      attribute14                      VARCHAR2 (150),
      attribute15                      VARCHAR2 (150)
   );
Line: 179

         SELECT     xah.ae_header_id, xah.ledger_id, xte.legal_entity_id,
                    xah.application_id, xah.entity_id, xah.event_id,
                    xah.accounting_date, xah.accounting_entry_status_code,
                    xah.accounting_entry_type_code, xah.description,
                    xah.balance_type_code, xah.budget_version_id,
                    xah.reference_date, xah.funds_status_code,
                    xah.je_category_name, xah.packet_id,
                    xah.amb_context_code, xah.event_type_code,
                    xah.completed_date, xah.gl_transfer_status_code,
                    xah.accounting_batch_id, xah.period_name,
                    xah.product_rule_code, xah.product_rule_type_code,
                    xah.product_rule_version, xah.gl_transfer_date,
                    xah.doc_sequence_id, xah.doc_sequence_value,
                    xah.close_acct_seq_version_id, xah.close_acct_seq_value,
                    xah.close_acct_seq_assign_id,
                    xah.completion_acct_seq_version_id,
                    xah.completion_acct_seq_value,
                    xah.completion_acct_seq_assign_id,
                    NVL (xah.accrual_reversal_flag, 'N'),
                    xe.budgetary_control_flag, xah.attribute_category,
                    xah.attribute1, xah.attribute2, xah.attribute3,
                    xah.attribute4, xah.attribute5, xah.attribute6,
                    xah.attribute7, xah.attribute8, xah.attribute9,
                    xah.attribute10, xah.attribute11, xah.attribute12,
                    xah.attribute13, xah.attribute14, xah.attribute15
               FROM xla_ae_headers xah,
                    xla_events xe,
                    xla_transaction_entities xte
              WHERE xte.entity_id = xah.entity_id
                AND xte.application_id = xah.application_id
                AND xe.event_id = xah.event_id
                AND xe.application_id = xah.application_id
                AND xah.ae_header_id = p_ae_header_id
                AND xah.application_id = p_application_id
         FOR UPDATE NOWAIT;
Line: 361

         SELECT event_id
           INTO l_ref_event_id
           FROM xla_ae_headers
          WHERE application_id = p_application_id
            AND ae_header_id = p_ref_ae_header_id;
Line: 368

      INSERT INTO xla_distribution_links
                  (application_id, event_id, ae_header_id, ae_line_num,
                   source_distribution_type, statistical_amount,
                   ref_ae_header_id, ref_temp_line_num, merge_duplicate_code,
                   temp_line_num, ref_event_id, event_class_code,
                   event_type_code, unrounded_entered_dr,
                   unrounded_entered_cr, unrounded_accounted_dr,
                   unrounded_accounted_cr)
         SELECT p_application_id, xah.event_id, p_ae_header_id, ae_line_num,
                'XLA_REVERSAL' -- SOURCE DISTRIBUTION TYPE
                               ,
                xal.statistical_amount -- STATISTICAL AMOUNT
                                       ,
                p_ref_ae_header_id -- REF AE HEADER ID
                                   ,
                ae_line_num -- REF TEMP LINE NUM
                            , 'N' -- MERGE DUPLICATE CODE
                                  ,
                -1 * ae_line_num -- TEMP LINE NUM
                                 ,
                l_ref_event_id -- REF EVENT ID
                               ,
                c_event_class_code_manual -- EVENT CLASS CODE
                                          ,
                c_event_type_code_manual -- EVENT TYPE CODE
                                         ,
                xal.unrounded_entered_dr, xal.unrounded_entered_cr,
                xal.unrounded_accounted_dr, xal.unrounded_accounted_cr
           FROM xla_ae_headers xah, xla_ae_lines xal
          WHERE xah.application_id = p_application_id
            AND xah.ae_header_id = p_ae_header_id
            AND xal.application_id = xah.application_id
            AND xal.ae_header_id = xah.ae_header_id;
Line: 438

         SELECT closing_status, period_name, period_type
           FROM gl_period_statuses
          WHERE application_id = c_gl_application_id
            AND ledger_id = p_ledger_id
            AND adjustment_period_flag = 'N'
            AND TRUNC (p_accounting_date) BETWEEN start_date AND end_date;
Line: 521

      l_last_updated_by     INTEGER;
Line: 522

      l_last_update_login   INTEGER;
Line: 613

         SELECT entity_id
           INTO l_entity_id
           FROM xla_events
          WHERE event_id = p_rev_event_id;
Line: 634

      l_last_updated_by := NVL (xla_environment_pkg.g_usr_id, -1);
Line: 635

      l_last_update_login := NVL (xla_environment_pkg.g_login_id, -1);
Line: 641

         SELECT ae_header_id
         BULK COLLECT INTO l_ae_header_id
           FROM xla_ae_headers
          WHERE event_id = p_info.event_id;
Line: 668

         INSERT INTO xla_ae_headers
                     (ae_header_id, application_id,
                      ledger_id, entity_id, event_id,
                      event_type_code, accounting_date, period_name,
                      reference_date, balance_type_code,
                      budget_version_id, gl_transfer_status_code,
                      je_category_name, accounting_entry_status_code,
                      accounting_entry_type_code,
                      description,
                      creation_date, created_by, last_update_date,
                      last_updated_by, last_update_login,
                      accrual_reversal_flag
                     )
              VALUES (xla_ae_headers_s.NEXTVAL, l_info.application_id,
                      l_info.ledger_id, l_entity_id, p_rev_event_id,
                      c_event_type_code_manual,trunc(p_gl_date), l_period_name,
                      l_info.reference_date, l_info.balance_type_code,
                      l_info.budget_version_id, c_gl_transfer_mode_no,
                      l_info.je_category_name, c_status_final_code,
                      l_info.type_code,
                      'DATA FIX REVERSAL ENTRY: AE_HEADER_ID OF '||l_info.header_id,
                      SYSDATE, l_last_updated_by, SYSDATE,
                      l_last_updated_by, l_last_update_login,
                      NVL (l_info.accrual_reversal_flag, 'N')
                     ) -- 4262811 ACCRUAL_REVERSAL_FLAG
           RETURNING ae_header_id
                INTO p_rev_header_id;
Line: 699

         INSERT INTO xla_ae_header_acs
                     (ae_header_id, analytical_criterion_code,
                      analytical_criterion_type_code, amb_context_code, ac1,
                      ac2, ac3, ac4, ac5, object_version_number)
            SELECT p_rev_header_id, analytical_criterion_code,
                   analytical_criterion_type_code, amb_context_code, ac1, ac2,
                   ac3, ac4, ac5, 1
              FROM xla_ae_header_acs
             WHERE ae_header_id = l_info.header_id;
Line: 712

         INSERT INTO xla_ae_lines
                     (application_id, ae_header_id, ae_line_num,
                      displayed_line_number, code_combination_id,
                      gl_transfer_mode_code, creation_date, created_by,
                      last_update_date, last_updated_by, last_update_login,
                      party_id, party_site_id, party_type_code, entered_dr,
                      entered_cr, accounted_dr, accounted_cr,
                      unrounded_entered_dr, unrounded_entered_cr,
                      unrounded_accounted_dr, unrounded_accounted_cr,
                      description, statistical_amount, currency_code,
                      currency_conversion_type, currency_conversion_date,
                      currency_conversion_rate, accounting_class_code,
                      jgzz_recon_ref, gl_sl_link_id,gl_sl_link_table, attribute_category,
                      encumbrance_type_id, attribute1, attribute2, attribute3,
                      attribute4, attribute5, attribute6, attribute7,
                      attribute8, attribute9, attribute10, attribute11,
                      attribute12, attribute13, attribute14, attribute15,
                      gain_or_loss_flag, ledger_id, accounting_date,
                      mpa_accrual_entry_flag)
            SELECT application_id, p_rev_header_id, ae_line_num,
                   displayed_line_number, code_combination_id,
                   gl_transfer_mode_code, SYSDATE, l_last_updated_by, SYSDATE,
                   l_last_updated_by, l_last_update_login, party_id,
                   party_site_id, party_type_code,
                   DECODE (p_reversal_method,
                           c_reversal_switch_dr_cr, entered_cr,
                           -entered_dr
                          ),
                   DECODE (p_reversal_method,
                           c_reversal_switch_dr_cr, entered_dr,
                           -entered_cr
                          ),
                   DECODE (p_reversal_method,
                           c_reversal_switch_dr_cr, accounted_cr,
                           -accounted_dr
                          ),
                   DECODE (p_reversal_method,
                           c_reversal_switch_dr_cr, accounted_dr,
                           -accounted_cr
                          ) -- 5109240 UNROUNDED AMOUNTS
                            ,
                   DECODE (p_reversal_method,
                           c_reversal_switch_dr_cr, unrounded_entered_cr,
                           -unrounded_entered_dr
                          ),
                   DECODE (p_reversal_method,
                           c_reversal_switch_dr_cr, unrounded_entered_dr,
                           -unrounded_entered_cr
                          ),
                   DECODE (p_reversal_method,
                           c_reversal_switch_dr_cr, unrounded_accounted_cr,
                           -unrounded_accounted_dr
                          ),
                   DECODE (p_reversal_method,
                           c_reversal_switch_dr_cr, unrounded_accounted_dr,
                           -unrounded_accounted_cr
                          ),
                   'DATA FIX REVERSAL ENTRY: AE_HEADER_ID OF '||l_info.header_id, statistical_amount, currency_code,
                   currency_conversion_type, currency_conversion_date,
                   currency_conversion_rate, accounting_class_code,
                   jgzz_recon_ref,xla_gl_sl_link_id_s.NEXTVAL, 'XLAJEL', attribute_category,
                   encumbrance_type_id, attribute1, attribute2, attribute3,
                   attribute4, attribute5, attribute6, attribute7, attribute8,
                   attribute9, attribute10, attribute11, attribute12,
                   attribute13, attribute14, attribute15, gain_or_loss_flag,
                   l_info.ledger_id,trunc(p_gl_date),
                   NVL (mpa_accrual_entry_flag, 'N')
              -- 4262811 MPA_ACCRUAL_ENTRY_FLAG
            FROM   xla_ae_lines
             WHERE application_id = l_info.application_id
               AND ae_header_id = l_info.header_id;
Line: 795

         INSERT INTO xla_ae_line_acs
                     (ae_header_id, ae_line_num, analytical_criterion_code,
                      analytical_criterion_type_code, amb_context_code, ac1,
                      ac2, ac3, ac4, ac5, object_version_number)
            SELECT p_rev_header_id, ae_line_num, analytical_criterion_code,
                   analytical_criterion_type_code, amb_context_code, ac1, ac2,
                   ac3, ac4, ac5, 1
              FROM xla_ae_line_acs
             WHERE ae_header_id = l_info.header_id;
Line: 831

   A) DELETE THE INCOMPLETE MPA
   B) CREATE A NEW EVENT AND ENTITY, AND MAP THE ORIGINAL ENTRY TO THE NEW
      EVENT ID AND ENTITY ID.
   C) CALLS CREATE_REVERSAL_ENTRY OF THE AE_HEADER_ID TO CREATE THE REVERSAL OF
      THE ORIGINAL ENTRY, RETURNING THE NEW REV_AE_HEADER_ID AND REV_EVENT_ID
      I) CALLS COMPLETE_JOURNAL_ENTRY WITH REV_AE_HEADER_ID, P_EVENT_ID AND
         P_REV_FLAG = 'Y' TO VALIDATE THE REVERSAL ENTRY REV_AE_HEADER_ID AND ON
         SUCCESS,
         -> CALLS CREATE_MRC_REVERSAL_ENTRY TO CREATE REVERSAL OF ALL OTHER
            LEDGERS AND ENTRIES RELATED TO THE ORIGINAL ENTRY P_EVENT_ID.

==============================================================================*/
   PROCEDURE reverse_journal_entries (
      p_api_version        IN              NUMBER,
      p_init_msg_list      IN              VARCHAR2,
      p_application_id     IN              INTEGER,
      p_event_id           IN              INTEGER,
      p_reversal_method    IN              VARCHAR2,
      p_gl_date            IN              DATE,
      p_post_to_gl_flag    IN              VARCHAR2,
      x_return_status      OUT NOCOPY      VARCHAR2,
      x_msg_count          OUT NOCOPY      NUMBER,
      x_msg_data           OUT NOCOPY      VARCHAR2,
      x_rev_ae_header_id   OUT NOCOPY      INTEGER,
      x_rev_event_id       OUT NOCOPY      INTEGER,
      x_rev_entity_id      OUT NOCOPY      INTEGER,
      x_new_event_id       OUT NOCOPY      INTEGER,
      x_new_entity_id      OUT NOCOPY      INTEGER
   )
   IS
      l_api_name      CONSTANT VARCHAR2 (30)     := 'REVERSE_JOURNAL_ENTRIES';
Line: 872

         SELECT xgl.currency_code, xsu.je_source_name, xah.entity_id,
                xah.ae_header_id, xah.accounting_date, xah.ledger_id,
                e.legal_entity_id, xah.accrual_reversal_flag,
                xe.budgetary_control_flag
           FROM xla_gl_ledgers_v xgl,
                xla_ae_headers xah,
                xla_subledgers xsu,
                xla_transaction_entities e,
                xla_events xe
          WHERE xgl.ledger_id = xah.ledger_id
            AND xsu.application_id = xah.application_id
            AND xah.event_id = p_event_id
            AND xah.application_id = p_application_id
            AND ledger_category_code = 'PRIMARY'
            AND e.application_id = xah.application_id
            AND e.entity_id = xah.entity_id
            AND xe.application_id = xah.application_id
            AND xe.event_id = xah.event_id
            AND xah.accounting_entry_status_code = c_status_final_code
            AND xah.parent_ae_header_id IS NULL
            AND NOT EXISTS (
                   SELECT 1
                     FROM xla_ae_headers xah2
                    WHERE xah2.application_id = p_application_id
                      AND xah2.event_id = p_event_id
                      AND xah2.accounting_entry_status_code =
                                                           c_status_final_code
                      AND NVL (xah2.gl_transfer_status_code, 'N') IN
                                                                  ('N', 'NT'));
Line: 1093

      UPDATE    xla_events
            SET event_status_code = xla_events_pub_pkg.c_event_processed,
                process_status_code = xla_events_pub_pkg.c_event_processed,
                (event_type_code, event_date, reference_num_1,
                 reference_num_2, reference_num_3, reference_num_4,
                 reference_char_1, reference_char_2, reference_char_3,
                 reference_char_4, reference_date_1, reference_date_2,
                 reference_date_3, reference_date_4, on_hold_flag,
                 upg_batch_id, upg_source_application_id, upg_valid_flag,
                 transaction_date, budgetary_control_flag,
                 merge_event_set_id -- EVENT_NUMBER
                                    , creation_date, created_by,
                 last_update_date, last_updated_by, last_update_login,
                 program_update_date, program_application_id, program_id,
                 request_id) =
                   (SELECT 'REVERSAL' -- EVENT_TYPE_CODE
                                      , event_date, reference_num_1,
                           reference_num_2, reference_num_3, reference_num_4,
                           reference_char_1, reference_char_2,
                           reference_char_3, reference_char_4,
                           reference_date_1, reference_date_2,
                           reference_date_3, reference_date_4, on_hold_flag,
                           upg_batch_id, upg_source_application_id,
                           upg_valid_flag, transaction_date,
                           budgetary_control_flag,
                           merge_event_set_id -- EVENT_NUMBER
                                              , SYSDATE, fnd_global.user_id,
                           SYSDATE, fnd_global.user_id, fnd_global.user_id,
                           SYSDATE, -1, -1, -1
                      FROM xla_events
                     WHERE application_id = p_application_id
                       AND event_id = p_event_id)
          WHERE application_id = p_application_id
                AND event_id = x_new_event_id
      RETURNING entity_id
           INTO x_new_entity_id;
Line: 1152

      UPDATE xla_transaction_entities
         SET (entity_code, source_id_int_1, source_id_char_1,
              security_id_int_1, security_id_int_2, security_id_int_3,
              security_id_char_1, security_id_char_2, security_id_char_3,
              source_id_int_2, source_id_char_2, source_id_int_3,
              source_id_char_3, source_id_int_4, source_id_char_4,
              valuation_method, source_application_id, upg_batch_id,
              upg_source_application_id, upg_valid_flag -- TRANSACTION_NUMBER
                                                        -- LEGAL_ENTITY_ID
                                                        -- LEDGER_ID
                                                        ,
              creation_date, created_by, last_update_date, last_updated_by,
              last_update_login) =
                (SELECT 'REVERSAL', -- ENTITY_CODE  THIS ALSO PREVENTS TRANSACTION TO BE USED IN BFLOW.
                                    source_id_int_1,
                        source_id_char_1, security_id_int_1,
                        security_id_int_2, security_id_int_3,
                        security_id_char_1, security_id_char_2,
                        security_id_char_3, source_id_int_2, source_id_char_2,
                        source_id_int_3, source_id_char_3, source_id_int_4,
                        source_id_char_4, valuation_method,
                        source_application_id, upg_batch_id,
                        upg_source_application_id,
                        upg_valid_flag -- TRANSACTION_NUMBER
                                       -- LEGAL_ENTITY_ID
                                       -- LEDGER_ID
                                       , SYSDATE, fnd_global.user_id, SYSDATE,
                        fnd_global.user_id, fnd_global.user_id
                   FROM xla_transaction_entities
                  WHERE application_id = p_application_id
                    AND entity_id = l_entity_id)
       WHERE application_id = p_application_id AND entity_id = x_new_entity_id;
Line: 1207

      UPDATE    xla_ae_headers
            SET entity_id = x_new_entity_id,
                event_id = x_new_event_id,
                event_type_code = 'REVERSAL',
                description = 'DATA FIX ENTRY: EVENT_ID OF ' || p_event_id
          WHERE application_id = p_application_id AND event_id = p_event_id
      RETURNING         ae_header_id
      BULK COLLECT INTO l_array_ae_header_id;
Line: 1239

         UPDATE xla_ae_lines
            SET description = 'DATA FIX ENTRY: EVENT_ID OF ' || p_event_id
          WHERE application_id = p_application_id
            AND ae_header_id = l_array_ae_header_id (i);
Line: 1257

         UPDATE xla_distribution_links
            SET event_id = x_new_event_id
          WHERE application_id = p_application_id
            AND ae_header_id = l_array_ae_header_id (i);
Line: 1274

      UPDATE xla_events
         SET event_status_code = xla_events_pub_pkg.C_EVENT_INCOMPLETE,
             process_status_code = xla_events_pkg.c_internal_unprocessed
       WHERE application_id = p_application_id AND event_id = p_event_id;
Line: 1302

      UPDATE xla_ae_headers
         SET accounting_entry_type_code = 'REVERSAL'
       WHERE application_id = p_application_id AND event_id = x_new_event_id;
Line: 1328

/*select count(*) into
l_ae_header_id_count
from xla_ae_headers where event_id = x_new_event_id ;
Line: 1334

         SELECT ae_header_id
           INTO l_ae_header_id
           FROM xla_ae_headers
          WHERE event_id = x_new_event_id AND ROWNUM = 1;
Line: 1395

         TRACE (p_msg         => 'UPDATE DESCRIPTIONS',
                p_module      => l_log_module,
                p_level       => c_level_statement
               );
Line: 1410

      UPDATE xla_events
         SET event_type_code = 'REVERSAL',
             event_status_code = 'P',
             process_status_code = 'P'
       WHERE event_id = x_rev_event_id;
Line: 1416

      UPDATE    xla_ae_headers
            SET /*description =
                      'DATA FIX REVERSAL ENTRY: EVENT_ID OF '
                      || p_event_id,*/
                event_type_code = 'REVERSAL'
          WHERE application_id = p_application_id
                AND event_id = x_rev_event_id
      RETURNING         ae_header_id
      BULK COLLECT INTO l_array_ae_header_id;
Line: 1443

         UPDATE xla_ae_lines
            SET description =description||' Original Event_id '|| p_event_id
          WHERE application_id = p_application_id
            AND ae_header_id = l_array_ae_header_id (i);
Line: 1562

         SELECT event_id, application_id,accounting_date
           INTO l_event_id, l_application_id,l_gl_date
           FROM xla_ae_headers
          WHERE ae_header_id = p_ae_header_id;
Line: 1570

                                SQLERRM || ' Selection of Application Id '
                              );
Line: 1575

           SELECT xte.security_id_int_1
            INTO l_security_id_int_1
            FROM xla_ae_headers xah,
                 xla_events xe,
                 xla_transaction_entities xte
           WHERE xah.ae_header_id = p_ae_header_id
             AND xah.event_id = xe.event_id
             AND xah.application_id = xe.application_id
             AND xe.application_id = xte.application_id
             AND xe.entity_id = xte.entity_id;
Line: 1689

         SELECT ledger_id
           INTO l_first_ledger_id
           FROM xla_ae_headers
          WHERE ae_header_id = p_list_ae_header_id (i);
Line: 1697

         SELECT ledger_id
           INTO l_ledger_id
           FROM xla_ae_headers
          WHERE ae_header_id = p_list_ae_header_id (j);
Line: 1722

            SELECT ledger_category_code
              INTO l_ledger_category
              FROM gl_ledgers
             WHERE ledger_id = l_first_ledger_id;
Line: 1856

         SELECT application_id
           INTO l_application_id
           FROM fnd_application
          WHERE application_short_name = p_appl_short_name;
Line: 1875

         SELECT glc.completion_status_code, gll.ledger_category_code,
                gll.ledger_id
           INTO l_ledger_status, l_primary,
                l_ledger_id
           FROM gl_ledgers gll, gl_ledger_configurations glc
          WHERE gll.short_name = p_ledger_short_name AND gll.NAME = glc.NAME;
Line: 1905

            SELECT ae_header_id
            BULK COLLECT INTO l_arry_ae_hdr_id
              FROM xla_ae_headers
             WHERE gl_transfer_status_code = 'N'
               AND accounting_entry_status_code = 'F'
               AND application_id = l_application_id
               AND accounting_date <= p_end_date
               -- AND accounting_batch_id = p_accounting_batch_id -- excluded so as in the next run records failed to transfer to PSFT will pick again
               AND ledger_id IN (
                      SELECT DISTINCT target_ledger_id
                                 FROM gl_ledger_relationships
                                WHERE source_ledger_id = l_ledger_id
                                  AND NVL (relationship_enabled_flag, 'N') =
                                                                           'Y');
Line: 1924

                  TRACE (p_msg         =>    'No. of Records need  updated  are zero   '
                                          || p_ledger_short_name,
                         p_module      => l_log_module,
                         p_level       => c_level_statement
                        );
Line: 1944

               SELECT gl_journal_import_s.NEXTVAL
                 INTO l_group_id
                 FROM DUAL;
Line: 2035

         SELECT ledger_id
           INTO l_ledger_id
           FROM gl_ledgers
          WHERE short_name = p_ledger_short_name;
Line: 2057

         SELECT application_id
           INTO l_application_id
           FROM fnd_application
          WHERE application_short_name = p_appl_short_name;
Line: 2082

      SELECT ae_header_id
      BULK COLLECT INTO l_arry_ae_hdr_id_set
        FROM xla_ae_headers
       WHERE gl_transfer_status_code = 'N'
         AND accounting_entry_status_code = 'F'
         AND application_id = l_application_id
         AND accounting_date <= p_end_date
         -- AND accounting_batch_id = p_accounting_batch_id -- excluded so as in the next run records failed to transfer to PSFT will pick again
         AND ledger_id IN (
                SELECT DISTINCT target_ledger_id
                           FROM gl_ledger_relationships
                          WHERE source_ledger_id = l_ledger_id
                            AND NVL (relationship_enabled_flag, 'N') = 'Y');
Line: 2098

      /*DBMS_OUTPUT.put_line (   'Total records identified to Updated = '
                            || l_arry_ae_hdr_id_set.COUNT
                           );*/
Line: 2102

         UPDATE xla_ae_headers
            SET gl_transfer_status_code = 'S',
                GROUP_ID = p_group_id
          WHERE ae_header_id = l_arry_ae_hdr_id_set (i);
Line: 2136

      l_records_updated   NUMBER;
Line: 2172

         UPDATE xla_ae_headers
            SET gl_transfer_status_code = 'Y',
                gl_transfer_date = TO_CHAR (SYSDATE, 'DD-MON-YYYY'),
                last_update_date = TO_CHAR (SYSDATE, 'DD-MON-YYYY'),
                last_updated_by = fnd_profile.VALUE ('USER_ID'),
                last_update_login = fnd_profile.VALUE ('LOGIN_ID')
          WHERE GROUP_ID = l_group_id
            AND accounting_entry_status_code = 'F'
            AND gl_transfer_status_code = 'S';
Line: 2198

         UPDATE xla_ae_headers
            SET GROUP_ID = NULL,
                gl_transfer_status_code = 'N',
                last_update_date = TO_CHAR (SYSDATE, 'DD-MON-YYYY'),
                last_updated_by = fnd_profile.VALUE ('USER_ID'),
                last_update_login = fnd_profile.VALUE ('LOGIN_ID')
          WHERE GROUP_ID = l_group_id
            AND accounting_entry_status_code = 'F'
            AND gl_transfer_status_code = 'S';