DBA Data[Home] [Help]

APPS.CST_XLA_PVT SQL Statements

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

Line: 71

  DELETE FROM XLA_AE_HEADERS_GT;
Line: 73

  DELETE FROM XLA_AE_LINES_GT;
Line: 75

  DELETE FROM XLA_VALIDATION_HDRS_GT;
Line: 77

  DELETE FROM XLA_VALIDATION_LINES_GT;
Line: 79

  DELETE FROM XLA_BAL_CTRL_CTRBS_GT;
Line: 81

  DELETE FROM XLA_BAL_PERIOD_STATS_GT;
Line: 83

  DELETE FROM XLA_BAL_RECREATE_GT;
Line: 85

  DELETE FROM XLA_BAL_ANACRI_LINES_GT;
Line: 87

  DELETE FROM XLA_BAL_ANACRI_CTRBS_GT;
Line: 89

  DELETE FROM XLA_BAL_SYNCHRONIZE_GT;
Line: 91

  DELETE FROM XLA_BAL_STATUSES_GT;
Line: 93

  DELETE FROM XLA_BAL_CTRL_LINES_GT;
Line: 95

  DELETE FROM XLA_EVENTS_GT;
Line: 97

  DELETE FROM XLA_EVT_CLASS_SOURCES_GT;
Line: 99

  DELETE FROM XLA_EVT_CLASS_ORDERS_GT;
Line: 101

  DELETE FROM XLA_TAB_ERRORS_GT;
Line: 103

  DELETE FROM XLA_SEQ_JE_HEADERS_GT;
Line: 105

  DELETE FROM XLA_TAB_NEW_CCIDS_GT;
Line: 107

  DELETE FROM XLA_EXTRACT_OBJECTS_GT;
Line: 109

  DELETE FROM XLA_REFERENCE_OBJECTS_GT;
Line: 111

  DELETE FROM XLA_TRANSACTION_ACCTS_GT;
Line: 113

  DELETE FROM XLA_UPG_LINE_CRITERIA_GT;
Line: 115

  DELETE FROM XLA_TRIAL_BALANCES_GT;
Line: 117

  DELETE FROM XLA_ACCT_PROG_EVENTS_GT;
Line: 119

  DELETE FROM XLA_ACCT_PROG_DOCS_GT;
Line: 121

  DELETE FROM XLA_MERGE_SEG_MAPS_GT;
Line: 123

  DELETE FROM XLA_EVENTS_INT_GT;
Line: 125

  DELETE FROM XLA_REPORT_BALANCES_GT;
Line: 127

  DELETE FROM XLA_TB_BALANCES_GT;
Line: 129

  DELETE FROM XLA_BAL_AC_CTRBS_GT;
Line: 151

    24 , --COST_UPDATE
    27 ) --RECEIPT
  THEN
     -- If Action ID is outside this range no custom inv txn allowed
     -- hence always in the standard list
     x_list_result := 'Y';
Line: 346

    SELECT NVL(PA_POSTING_FLAG, 'N')
    INTO   l_pjm_blueprint
    FROM   PJM_ORG_PARAMETERS
    WHERE  ORGANIZATION_ID = p_trx_info.inv_organization_id;
Line: 394

      SELECT
        EVENT_TYPE_CODE
      INTO
        l_event_type_code
      FROM
        CST_XLA_RCV_EVENT_MAP
      WHERE TRANSACTION_TYPE_ID = p_trx_info.ACCT_EVENT_TYPE_ID
      AND   ATTRIBUTE           = p_trx_info.ATTRIBUTE;
Line: 404

      SELECT
        EVENT_TYPE_CODE
      INTO
        l_event_type_code
      FROM
        CST_XLA_RCV_EVENT_MAP
      WHERE TRANSACTION_TYPE_ID = p_trx_info.ACCT_EVENT_TYPE_ID
      AND   ATTRIBUTE is NULL;
Line: 456

      INSERT into XLA_ACCT_PROG_EVENTS_GT (Event_Id) VALUES (l_event_id);
Line: 510

     - Insert this event into PSA_BC_XLA_EVENTS_GT
     - Call the Budgetary Control API to create the BC accounting entries */


  /* For the DELIVER and RTR events, we do not have the encumbrance amount populated in
   * RRS. This information is populated against the ENCUMBRANCE_REVERSAL event.
   * For the ENCUMBRANCE_REVERSAL event, the event that created this encumbrance
   * reversal is the event type that is created in SLA. This event is created
   * with a BUDGETARY_CONTROL_FLAG = 'Y' to distinguish it
   * The accounting for this BC event is done by PSA through the BC API
   * Note accounting_event_type_id = 13 mains "Encumbrance Reversal" */

  IF ( p_trx_info.ENCUMBRANCE_FLAG = 'Y' AND p_trx_info.ACCT_EVENT_TYPE_ID = 13 ) THEN

    l_stmt_num := 45;
Line: 526

    SELECT ACCOUNTING_EVENT_ID,
           EVENT_TYPE_ID
    INTO   l_source_data.SOURCE_ID_INT_2,
           l_event_type_id
    FROM   RCV_ACCOUNTING_EVENTS
    WHERE  RCV_TRANSACTION_ID = p_trx_info.TRANSACTION_ID
    AND    EVENT_TYPE_ID in (2, 3, 5);
Line: 540

      SELECT nvl(PARENT_TRANSACTION_ID, -1)
      INTO   l_parent_rcv_txn_id
      FROM   RCV_TRANSACTIONS
      WHERE  transaction_id = p_trx_info.TRANSACTION_ID;
Line: 546

        SELECT TRANSACTION_TYPE
        INTO   l_parent_txn_type
        FROM   RCV_TRANSACTIONS
        WHERE  transaction_id = l_parent_rcv_txn_id;
Line: 552

      SELECT event_type_code
      INTO   l_event_type_code
      FROM   CST_XLA_RCV_EVENT_MAP
      WHERE  transaction_type_id = l_event_type_id
      AND    attribute = l_parent_txn_type;
Line: 589

    DELETE PSA_BC_XLA_EVENTS_GT;
Line: 592

    INSERT INTO PSA_BC_XLA_EVENTS_GT (
      EVENT_ID,
      RESULT_CODE )
    VALUES (
      l_bc_event_id,
      'UNPROCESSED' );
Line: 817

  SELECT count(*)
  INTO   l_mta_exists
  FROM   MTL_TRANSACTION_ACCOUNTS
  WHERE  TRANSACTION_ID = p_trx_info.transaction_id
  AND    rownum=1;
Line: 829

    SELECT NVL(PA_POSTING_FLAG, 'N')
    INTO   l_pjm_blueprint
    FROM   PJM_ORG_PARAMETERS
    WHERE  ORGANIZATION_ID = p_trx_info.txn_organization_id
      AND EXISTS ( SELECT 'X'
              FROM MTL_MATERIAL_TRANSACTIONS MMT
               WHERE MMT.TRANSACTION_ID = p_trx_info.transaction_id
                 AND ( (NVL(MMT.LOGICAL_TRANSACTION,2) = 2)
                      OR( (NVL(MMT.LOGICAL_TRANSACTION,2) = 1)
                          AND MMT.TRANSACTION_TYPE_ID = 19
                          AND MMT.TRANSACTION_ACTION_ID = 26
                          AND MMT.TRANSACTION_SOURCE_TYPE_ID = 1
                          AND NVL(MMT.LOGICAL_TRX_TYPE_CODE,5) = 2
                          AND EXISTS ( SELECT 'X'
			                FROM rcv_transactions rt
                                        WHERE rt.transaction_id =
                                          mmt.rcv_transaction_id
					  AND rt.organization_id =
					      p_trx_info.txn_organization_id
                                      )
                          )
                      )
              );
Line: 873

    SELECT DECODE( EVENT_TYPE, 3, G_COGS_REC_EVENT, G_COGS_REC_ADJ_EVENT)
    INTO   l_events(1).event_type_code
    FROM   CST_COGS_EVENTS
    WHERE  MMT_TRANSACTION_ID = p_trx_info.transaction_id;
Line: 889

    SELECT nvl(process_enabled_flag, 'N')
    INTO   l_txfr_process_flag
    FROM   MTL_PARAMETERS
    WHERE  organization_id = p_trx_info.txfr_organization_id;
Line: 912

      SELECT p_trx_info.transaction_id,
             decode(organization, 'TRANSFER', p_trx_info.txfr_organization_id,
                                            p_trx_info.txn_organization_id ),
             -- Leave this transaction src type ID to initial in source_id_int_3
             nvl( p_trx_info.txn_src_type_id, -1),
             event_type_code
      BULK COLLECT INTO l_events
      FROM   cst_xla_inv_event_map
      WHERE  transaction_action_id      = p_trx_info.txn_action_id
      AND   ( ( transaction_source_type_id = l_txn_src_type_id  )  --p_trx_info.txn_src_type_id
            /* Added following OR condition for Bug6792259 */
	    OR (l_txn_src_type_id = 8 AND transaction_source_type_id = 7)
            OR(     transaction_source_type_id is null
                AND NOT EXISTS (
                    SELECT 1
                    FROM   cst_xla_inv_event_map
                    WHERE  transaction_source_type_id = l_txn_src_type_id --p_trx_info.txn_src_type_id
                    AND    transaction_action_id      = p_trx_info.txn_action_id )
               )
             )
      AND   ( ( p_trx_info.tp is null and tp = 'N' ) or
              ( p_trx_info.tp is not null and tp = p_trx_info.tp ) )
      AND NOT  (organization = 'SAME' AND transfer_type = 'RCPT');
Line: 940

      SELECT p_trx_info.transaction_id,
             p_trx_info.txn_organization_id,
             --Leave this value in source_id_int_3
             nvl( p_trx_info.txn_src_type_id, -1),
             event_type_code
      INTO
             l_events(1).transaction_id,
             l_events(1).organization_id,
             l_events(1).txn_src_type_id,
             l_events(1).event_type_code
      FROM   cst_xla_inv_event_map
      WHERE  transaction_action_id      = p_trx_info.txn_action_id
      AND    transfer_type = DECODE(SIGN(p_trx_info.primary_quantity),-1,'SHIP','RCPT')
      AND   ( ( transaction_source_type_id = l_txn_src_type_id ) --p_trx_info.txn_src_type_id
            OR(     transaction_source_type_id is null
                AND NOT EXISTS (
                    SELECT 1
                    FROM   cst_xla_inv_event_map
                    WHERE  transaction_source_type_id = l_txn_src_type_id --p_trx_info.txn_src_type_id
                    AND    transaction_action_id      = p_trx_info.txn_action_id )
               )
             )
      AND    organization                 = p_trx_info.attribute
      AND   ( ( p_trx_info.tp is null and tp = 'N' ) or
              ( p_trx_info.tp is not null and tp = p_trx_info.tp ) );
Line: 978

    SELECT p_trx_info.transaction_id,
           p_trx_info.txn_organization_id,
           nvl ( p_trx_info.txn_src_type_id, -1),
           event_type_code
    INTO
           l_events(1).transaction_id,
           l_events(1).organization_id,
           l_events(1).txn_src_type_id,
           l_events(1).event_type_code
    FROM   cst_xla_inv_event_map
    WHERE  transaction_action_id      = p_trx_info.txn_action_id
    AND     ( ( transaction_source_type_id = l_txn_src_type_id) --p_trx_info.txn_src_type_id
            OR(     transaction_source_type_id is null
                AND NOT EXISTS (
                    SELECT 1
                    FROM   cst_xla_inv_event_map
                    WHERE  transaction_source_type_id = l_txn_src_type_id --p_trx_info.txn_src_type_id
                    AND    transaction_action_id      = p_trx_info.txn_action_id )
               )
             )
    AND    attribute                  = p_trx_info.attribute;
Line: 1012

    SELECT nvl(process_enabled_flag, 'N')
    INTO   l_txfr_process_flag
    FROM   MTL_PARAMETERS
    WHERE  organization_id = p_trx_info.txfr_organization_id;
Line: 1019

      SELECT p_trx_info.transaction_id,
             decode(organization, 'TRANSFER', p_trx_info.txfr_organization_id,
                                              p_trx_info.txn_organization_id ),
             nvl( p_trx_info.txn_src_type_id, -1),
             event_type_code
      BULK COLLECT INTO l_events
      FROM   cst_xla_inv_event_map
      WHERE  transaction_action_id      = p_trx_info.txn_action_id
      AND   ( ( transaction_source_type_id = l_txn_src_type_id) --p_trx_info.txn_src_type_id )
            OR(     transaction_source_type_id is null
                AND NOT EXISTS (
                    SELECT 1
                    FROM   cst_xla_inv_event_map
                    WHERE  transaction_source_type_id = l_txn_src_type_id --p_trx_info.txn_src_type_id
                    AND    transaction_action_id      = p_trx_info.txn_action_id )
               )
             )
      AND    fob_point = p_trx_info.fob_point
      AND    ( tp is null or ( tp is not null and tp = p_trx_info.tp ));
Line: 1051

      SELECT p_trx_info.transaction_id,
             p_trx_info.txn_organization_id,
             nvl( p_trx_info.txn_src_type_id, -1),
             event_type_code
      INTO   l_events(1).transaction_id,
             l_events(1).organization_id,
             l_events(1).txn_src_type_id,
             l_events(1).event_type_code
      FROM   cst_xla_inv_event_map
      WHERE  transaction_action_id      = p_trx_info.txn_action_id
      AND   ( ( transaction_source_type_id = l_txn_src_type_id) --p_trx_info.txn_src_type_id )
            OR(     transaction_source_type_id is null
                AND NOT EXISTS (
                    SELECT 1
                    FROM   cst_xla_inv_event_map
                    WHERE  transaction_source_type_id = l_txn_src_type_id --p_trx_info.txn_src_type_id
                    AND    transaction_action_id      = p_trx_info.txn_action_id )
               )
             )
      AND    fob_point = p_trx_info.fob_point
      AND    ( tp is null or ( tp is not null and tp = p_trx_info.tp ))
      AND    organization =  'SAME';
Line: 1092

    SELECT p_trx_info.transaction_id,
           p_trx_info.txn_organization_id,
           nvl( p_trx_info.txn_src_type_id, -1),
           event_type_code
    INTO   l_events(1).transaction_id,
           l_events(1).organization_id,
           l_events(1).txn_src_type_id,
           l_events(1).event_type_code
    FROM   cst_xla_inv_event_map
    WHERE  transaction_action_id      = p_trx_info.txn_action_id
    AND     ( ( transaction_source_type_id = p_trx_info.txn_src_type_id )
            OR(     transaction_source_type_id is null
                AND NOT EXISTS (
                    SELECT 1
                    FROM   cst_xla_inv_event_map
                    WHERE  transaction_source_type_id = p_trx_info.txn_src_type_id
                    AND    transaction_action_id      = p_trx_info.txn_action_id )
               )
             )
    AND   ( tp is null or ( tp is not null and tp = p_trx_info.tp ));
Line: 1122

    SELECT p_trx_info.transaction_id,
           p_trx_info.txn_organization_id,
           nvl( p_trx_info.txn_src_type_id, -1),
           event_type_code
    INTO   l_events(1).transaction_id,
           l_events(1).organization_id,
           l_events(1).txn_src_type_id,
           l_events(1).event_type_code
    FROM   cst_xla_inv_event_map
    WHERE  transaction_action_id      = p_trx_info.txn_action_id
    AND    attribute is null
    AND     ( ( transaction_source_type_id = l_txn_src_type_id) --p_trx_info.txn_src_type_id )
            OR(     transaction_source_type_id is null
                AND NOT EXISTS (
                    SELECT 1
                    FROM   cst_xla_inv_event_map
                    WHERE  transaction_source_type_id = l_txn_src_type_id --p_trx_info.txn_src_type_id
                    AND    transaction_action_id      = p_trx_info.txn_action_id )
               )
             );
Line: 1159

     Inserts are done into the table in the following loop */

  l_stmt_num := 115;
Line: 1163

  DELETE PSA_BC_XLA_EVENTS_GT;
Line: 1167

    SELECT
            ledger_id,
            operating_unit
    INTO
            l_source_data.ledger_id,
            l_security_data.security_id_int_2
    FROM  CST_ACCT_INFO_V
    WHERE organization_id = l_events(l_index).ORGANIZATION_ID;
Line: 1219

       - Insert these events into PSA_BC_XLA_EVENTS_GT */
    IF     ( P_TRX_INFO.ENCUMBRANCE_FLAG = 'Y')
      --{BUG#6125007
       AND  l_events(l_index).event_type_code IN
            (
             ---------------------------
			 -- Class DIR_INTERORG_RCPT
             ---------------------------
             'DIR_INTERORG_RCPT' ,'DIR_INTERORG_RCPT_NO_TP' ,'DIR_INTERORG_RCPT_TP',
             ---------------------------
             -- Class PURCHASE_ORDER
             ---------------------------
             'LOG_PO_DEL_ADJ','LOG_PO_DEL_INV','LOG_RET_RI_INV',
             'PO_DEL_ADJ'    ,'PO_DEL_INV'    ,'RET_RI_INV'    ,
             ---------------------------
             -- Class FOB_RCPT_RECIPIENT_RCPT
             ---------------------------
             'FOB_RCPT_RECIPIENT_RCPT_NO_TP','FOB_RCPT_RECIPIENT_RCPT_TP',
             ---------------------------
             -- Class FOB_SHIP_SENDER_SHIP
             ---------------------------
             'FOB_SHIP_SENDER_SHIP_NO_TP'   ,'FOB_SHIP_SENDER_SHIP_TP' ,
             -----------------------------------
             --6611359 Internal order to expense
             -----------------------------------
             'EXP_REQ_RCPT_NO_TP','EXP_REQ_RCPT_TP',
             'INT_ORDER_ISSUE_NO_TP','INT_ORDER_ISSUE_TP')
       --}
    THEN
      --BUG#6125007
      IF l_psa_ins_flag = 'N' THEN
         l_psa_ins_flag  := 'Y';
Line: 1284

         INSERT INTO PSA_BC_XLA_EVENTS_GT (
           EVENT_ID,
           RESULT_CODE )
          VALUES (
            l_bc_event_id,
           'UNPROCESSED' );
Line: 1468

    SELECT NVL(PA_POSTING_FLAG, 'N')
    INTO   l_pjm_blueprint
    FROM   PJM_ORG_PARAMETERS
    WHERE  ORGANIZATION_ID = p_trx_info.inv_organization_id;
Line: 1486

  SELECT
	  ledger_id,
          operating_unit
  INTO
	  l_source_data.ledger_id,
          l_security_data.security_id_int_2
  FROM  CST_ACCT_INFO_V
  WHERE organization_id = p_trx_info.INV_ORGANIZATION_ID;
Line: 1515

    SELECT
      EVENT_TYPE_CODE
    INTO
      l_event_type_code
    FROM
      CST_XLA_WIP_EVENT_MAP
    WHERE TRANSACTION_TYPE_ID = p_trx_info.TXN_TYPE_ID
    AND   ATTRIBUTE           = p_trx_info.ATTRIBUTE;
Line: 1525

    SELECT
      EVENT_TYPE_CODE
    INTO
      l_event_type_code
    FROM
      CST_XLA_WIP_EVENT_MAP
    WHERE TRANSACTION_TYPE_ID = p_trx_info.TXN_TYPE_ID
    AND   ATTRIBUTE IS NULL;
Line: 1691

    SELECT NVL(PA_POSTING_FLAG, 'N')
    INTO   l_pjm_blueprint
    FROM   PJM_ORG_PARAMETERS
    WHERE  ORGANIZATION_ID = p_organization_id;
Line: 1709

  SELECT ledger_id,
         operating_unit
  INTO   l_ledger_id,
         l_operating_unit
  FROM   CST_ACCT_INFO_V
  WHERE  ORGANIZATION_ID = p_organization_id;
Line: 1718

  DELETE XLA_EVENTS_INT_GT;
Line: 1719

  INSERT INTO xla_events_int_gt(
      application_id,
      ledger_id,
      entity_code,
      source_id_int_1,
      source_id_int_2,
      source_id_int_3,
      transaction_number,
      event_class_code,
      event_type_code,
      event_date,
      event_status_code,
      security_id_int_1,
      security_id_int_2,
      transaction_date,
      reference_date_1
    )
  SELECT DISTINCT
    G_CST_APPLICATION_ID,
    l_ledger_id,
    'WIP_ACCOUNTING_EVENTS',
    WTA.TRANSACTION_ID,
    WTA.RESOURCE_ID,
    WTA.BASIS_TYPE,
    WTA.TRANSACTION_ID,
    'ABSORPTION',
    DECODE( WTA.COST_ELEMENT_ID, 3, G_RES_ABS_EVENT,
                                 4, DECODE (WCTI.SOURCE_CODE, 'IPV',
                                              G_IPV_TRANSFER_EVENT,
                                              DECODE(WCTI.AUTOCHARGE_TYPE, 3, G_OSP_EVENT,
                                                                           4, G_OSP_EVENT, G_RES_ABS_EVENT)),
                                 5, G_OVH_ABS_EVENT ),
    WCTI.TRANSACTION_DATE,
    XLA_EVENTS_PUB_PKG.C_EVENT_UNPROCESSED,
    WCTI.ORGANIZATION_ID,
    l_operating_unit,
    WCTI.TRANSACTION_DATE,
    INV_LE_TIMEZONE_PUB.get_le_day_time_for_ou(
      WCTI.TRANSACTION_DATE,
      l_operating_unit)
  FROM
    WIP_TRANSACTION_ACCOUNTS WTA,
    WIP_COST_TXN_INTERFACE WCTI
  WHERE
      WCTI.TRANSACTION_ID = WTA.TRANSACTION_ID
  AND WCTI.GROUP_ID       = p_wcti_group_id
  AND WCTI.TRANSACTION_TYPE in (1, 2, 3)
  UNION ALL
  SELECT
    G_CST_APPLICATION_ID,
    l_ledger_id,
    'WIP_ACCOUNTING_EVENTS',
    WCTI.TRANSACTION_ID,
    -1,
    NVL(WCTI.BASIS_TYPE, -1),
    WCTI.TRANSACTION_ID,
    CXWEM.EVENT_CLASS_CODE,
    CXWEM.EVENT_TYPE_CODE,
    WCTI.TRANSACTION_DATE,
    XLA_EVENTS_PUB_PKG.C_EVENT_UNPROCESSED,
    WCTI.ORGANIZATION_ID,
    l_operating_unit,
    WCTI.TRANSACTION_DATE,
    INV_LE_TIMEZONE_PUB.get_le_day_time_for_ou(
      WCTI.TRANSACTION_DATE,
      l_operating_unit)
  FROM
    WIP_COST_TXN_INTERFACE   WCTI,
    CST_XLA_WIP_EVENT_MAP    CXWEM
  WHERE
      WCTI.GROUP_ID         = p_wcti_group_id
  AND WCTI.TRANSACTION_TYPE = CXWEM.TRANSACTION_TYPE_ID
  AND WCTI.TRANSACTION_TYPE in (5, 6, 17)
--{BUG#6916164
  AND EXISTS (SELECT NULL
              FROM WIP_TRANSACTION_ACCOUNTS WTA
              WHERE wta.transaction_id = WCTI.TRANSACTION_ID);
Line: 1871

PROCEDURE Create_CostUpdateXLAEvent (
            p_api_version       IN          NUMBER,
            p_init_msg_list     IN          VARCHAR2,
            p_commit            IN          VARCHAR2,
            p_validation_level  IN          NUMBER,
            x_return_status     OUT NOCOPY  VARCHAR2,
            x_msg_count         OUT NOCOPY  NUMBER,
            x_msg_data          OUT NOCOPY  VARCHAR2,

            p_update_id         IN          NUMBER,
            p_organization_id   IN          NUMBER ) IS

  l_api_name    CONSTANT VARCHAR2(30)   := 'Create_CostUpdateXLAEvent';
Line: 1908

  SAVEPOINT Create_CostUpdateXLAEvent;
Line: 1912

    FND_LOG.string(FND_LOG.LEVEL_PROCEDURE, l_module||'.begin' ,' Create_CostUpdateXLAEvent <<');
Line: 1934

    SELECT NVL(PA_POSTING_FLAG, 'N')
    INTO   l_pjm_blueprint
    FROM   PJM_ORG_PARAMETERS
    WHERE  ORGANIZATION_ID = p_organization_id;
Line: 1945

      FND_LOG.string(FND_LOG.LEVEL_PROCEDURE, l_module||'.end','Create_CostUpdateXLAEvent >>');
Line: 1951

  SELECT ledger_id,
         operating_unit
  INTO   l_ledger_id,
         l_operating_unit
  FROM   CST_ACCT_INFO_V
  WHERE  ORGANIZATION_ID = p_organization_id;
Line: 1961

  DELETE XLA_EVENTS_INT_GT;
Line: 1964

  INSERT INTO xla_events_int_gt
    (
      application_id,
      ledger_id,
      entity_code,
      source_id_int_1,
      source_id_int_2,
      source_id_int_3,
      transaction_number,
      event_class_code,
      event_type_code,
      event_date,
      event_status_code,
      security_id_int_1,
      security_id_int_2,
      transaction_date,
      reference_date_1
    )
    SELECT
      G_CST_APPLICATION_ID,
      l_ledger_id,
      'MTL_ACCOUNTING_EVENTS',
      mmt.TRANSACTION_ID,            -- SOURCE_ID_INT_1
      mmt.ORGANIZATION_id,           -- SOURCE_ID_INT_2 (ORGANIZATION)
      mmt.TRANSACTION_SOURCE_TYPE_ID,-- SOURCE_ID_INT_3 (TRANSACTION_SOURCE_TYPE_ID)
      mmt.TRANSACTION_ID,
      'MTL_COST_UPD',
      'STD_COST_UPD',
      mmt.TRANSACTION_DATE,
      --{BUG#7505874
      DECODE(mta.slid,NULL,XLA_EVENTS_PUB_PKG.C_EVENT_NOACTION, XLA_EVENTS_PUB_PKG.C_EVENT_UNPROCESSED),
      --}
      mmt.ORGANIZATION_ID,
      l_operating_unit,
      mmt.TRANSACTION_DATE,
      INV_LE_TIMEZONE_PUB.get_le_day_time_for_ou(
        mmt.TRANSACTION_DATE,
        l_operating_unit)
    FROM
      MTL_MATERIAL_TRANSACTIONS  mmt
      --{BUG#7505874
    ,(SELECT MAX(inv_sub_ledger_id)  slid
             ,transaction_id         trx_id
         FROM mtl_transaction_accounts
        GROUP BY transaction_id) mta
      --}
    WHERE
          mmt.TRANSACTION_SOURCE_ID      = p_update_id
      AND mmt.TRANSACTION_TYPE_ID        = 24
      AND mmt.TRANSACTION_ACTION_ID      = 24
      AND mmt.TRANSACTION_SOURCE_TYPE_ID = 11
      AND mmt.ORGANIZATION_ID            = p_organization_id
	  AND mmt.transaction_id             = mta.trx_id(+);   --BUG#7505874
Line: 2032

    FND_LOG.string(FND_LOG.LEVEL_PROCEDURE, l_module||'.end','Create_CostUpdateXLAEvent >>');
Line: 2037

     ROLLBACK TO Create_CostUpdateXLAEvent;
Line: 2044

    ROLLBACK TO Create_CostUpdateXLAEvent;
Line: 2051

    ROLLBACK TO Create_CostUpdateXLAEvent;
Line: 2054

      FND_LOG.string(FND_LOG.LEVEL_UNEXPECTED, l_module||':'||l_stmt_num ,'Create_CostUpdateXLAEvent '||l_stmt_num||' : '||substr(SQLERRM,1,200));
Line: 2069

END Create_CostUpdateXLAEvent;
Line: 2094

PROCEDURE Create_WIPUpdateXLAEvent (
            p_api_version       IN          NUMBER,
            p_init_msg_list     IN          VARCHAR2,
            p_commit            IN          VARCHAR2,
            p_validation_level  IN          NUMBER,
            x_return_status     OUT NOCOPY  VARCHAR2,
            x_msg_count         OUT NOCOPY  NUMBER,
            x_msg_data          OUT NOCOPY  VARCHAR2,

            p_update_id         IN          NUMBER,
            p_organization_id   IN          NUMBER ) IS

  l_api_name    CONSTANT VARCHAR2(30)   := 'Create_WIPUpdateXLAEvent';
Line: 2132

  SAVEPOINT Create_WIPUpdateXLAEvent;
Line: 2136

    FND_LOG.string(FND_LOG.LEVEL_PROCEDURE, l_module||'.begin' ,' Create_WIPUpdateXLAEvent <<');
Line: 2158

    SELECT NVL(PA_POSTING_FLAG, 'N')
    INTO   l_pjm_blueprint
    FROM   PJM_ORG_PARAMETERS
    WHERE  ORGANIZATION_ID = p_organization_id;
Line: 2169

      FND_LOG.string(FND_LOG.LEVEL_PROCEDURE, l_module||'.end','Create_WIPUpdateXLAEvent >>');
Line: 2175

  SELECT ledger_id,
         operating_unit
  INTO   l_ledger_id,
         l_operating_unit
  FROM   CST_ACCT_INFO_V
  WHERE  ORGANIZATION_ID = p_organization_id;
Line: 2185

  DELETE XLA_EVENTS_INT_GT;
Line: 2187

  INSERT INTO xla_events_int_gt
    (
      application_id,
      ledger_id,
      entity_code,
      source_id_int_1,
      source_id_int_2,
      source_id_int_3,
      transaction_number,
      event_class_code,
      event_type_code,
      event_date,
      event_status_code,
      security_id_int_1,
      security_id_int_2,
      transaction_date,
      reference_date_1
    )
    SELECT
      G_CST_APPLICATION_ID,
      l_ledger_id,
      'WIP_ACCOUNTING_EVENTS',
      TRANSACTION_ID, -- SOURCE_ID_INT_1
      -1,                       -- SOURCE_ID_INT_2 (WIP_RESOURCE_ID)
      -1,                       -- SOURCE_ID_INT_3 (WIP_BASIS_TYPE_ID)
      TRANSACTION_ID,
      'WIP_COST_UPD',
      'WIP_COST_UPD',
      TRANSACTION_DATE,
      XLA_EVENTS_PUB_PKG.C_EVENT_UNPROCESSED,
      organization_id,
      l_operating_unit,
      TRANSACTION_DATE,
      INV_LE_TIMEZONE_PUB.get_le_day_time_for_ou(
        TRANSACTION_DATE,
        l_operating_unit)
    FROM
      WIP_TRANSACTIONS
    WHERE
          COST_UPDATE_ID   = p_update_id
      AND ORGANIZATION_ID  = p_organization_id;
Line: 2239

    FND_LOG.string(FND_LOG.LEVEL_PROCEDURE, l_module||'.end','Create_WIPUpdateXLAEvent >>');
Line: 2244

     ROLLBACK TO Create_WIPUpdateXLAEvent;
Line: 2251

    ROLLBACK TO Create_WIPUpdateXLAEvent;
Line: 2258

    ROLLBACK TO Create_WIPUpdateXLAEvent;
Line: 2262

      ,'Create_WIPUpdateXLAEvent '||l_stmt_num||' : '||substr(SQLERRM,1,200));
Line: 2277

END Create_WIPUpdateXLAEvent;
Line: 2379

  SELECT SUBSTRB(p.argument_text,
               INSTRB(p.argument_text,',',1,32)+1,
			   INSTRB(p.argument_text,',',1,33)-INSTRB(p.argument_text,',',1,32)-1)
    FROM fnd_concurrent_requests c,
         fnd_concurrent_requests p
   WHERE c.request_id =   fnd_global.conc_request_id
     AND c.parent_request_id = p.request_id;