DBA Data[Home] [Help]

APPS.XLA_CMP_ADR_PKG SQL Statements

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

Line: 28

|     24-JUL-2003 K.Boussema    Updated the error messages                   |
|     30-JUL-2003 K.Boussema    Updated the definition of C_FLEXFIELD_SEGMENT|
|     13-NOV-2003 K.Boussema    Changed to pass to the accounting engine the |
|                               Accounting and transaction coa id values     |
|     20-NOV-2003 K.Boussema    Added the update of journal entry status     |
|                               bug 3269120                                  |
|     05-DEC-2003 K.Boussema    Added Accounting COA value in generation of  |
|                               SetCcid and SetOverride. Set Accounting COA  |
|                               to NULL if CCID source, bug3289875           |
|     18-DEC-2003 K.Boussema    Changed to fix bug 3042840,3307761,3268940   |
|                               3310291 and 3320689                          |
|     12-JAN-2004 K.Boussema    Changed GetSegment and GetCcid to fix issue  |
|                               described in bug 3366176                     |
|     23-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                              |
|     02-JUN-2004 A.Quaglia     Made changes for the Transaction Account     |
|                               Builder.                                     |
|                               Added generate_adr_spec                      |
|                               Added generate_tab_adr                       |
|                               Added build_adrs_for_tab                     |
|     23-JUL-2004 A.Quaglia   GetCcid: changed message tokens                |
|     23-Sep-2004 S.Singhania Minor change for Bulk processing.              |
|     27-SEP-2004 A.Quaglia   GetCcid: added selection of correct template   |
|                                      for constant ccid case, when compiling|
|                                      for the Transaction Account Builder   |
|     28-Feb-2005 W.Shen      Change for ledger currency project             |
|                                Add p_side parameter when call the generated|
|                                adr function, and the setccid/setsegment    |
|                                function in xla_ae_lines_pkg                |
|     07-Mar-2005 K.Boussema    Changed for ADR-enhancements.                |
|     11-Jul-2005 A. Wan        4262811 for MPA project.                     |
|     26-Oct-2005 Jorge Larre The generation of the adr should consider the  |
|                             case of the TAB as similar as the case of      |
|                             flexfield mode:                                |
|    Old code:                                                               |
|    IF NOT l_endif and l_adr IS NOT NULL THEN                               |
|       IF p_flexfield_assign_mode = 'A' THEN                                |
|          l_adr := l_adr ||g_chr_newline||' END IF;';                       |
Line: 603

    SELECT value_code_combination_id
      INTO l_return_value
      FROM
    ( SELECT value_code_combination_id
        FROM
       (
        SELECT 1 priority
              ,xmsv.value_code_combination_id
              ,xmsv.input_value_type_code
          FROM xla_mapping_set_values  xmsv
         WHERE xmsv.mapping_set_code    = ''$mapping_set_code$''
           AND  ( TRUNC(p_validation_date)  BETWEEN NVL(xmsv.effective_date_from,p_validation_date)
                                     AND NVL(xmsv.effective_date_to,p_validation_date) )

           AND xmsv.input_value_type_code  =''I''
           AND xmsv.input_value_constant = TO_CHAR($input_source$)
           AND enabled_flag = ''Y''
       UNION
        SELECT 2 priority
              ,xmsv.value_code_combination_id
              ,xmsv.input_value_type_code
           FROM  xla_mapping_set_values  xmsv
          WHERE  xmsv.mapping_set_code    = ''$mapping_set_code$''
            AND  ( TRUNC(p_validation_date)  BETWEEN NVL(xmsv.effective_date_from,p_validation_date)
                                     AND NVL(xmsv.effective_date_to,p_validation_date) )
            AND xmsv.input_value_type_code = ''D''
            AND enabled_flag = ''Y''
       )
       ORDER BY priority
    )
    WHERE ROWNUM = 1;
Line: 666

    SELECT value_constant
      INTO l_return_value
      FROM
    ( SELECT value_constant
        FROM
       (
        SELECT 1 priority
              ,xmsv.value_constant
              ,xmsv.input_value_type_code
          FROM xla_mapping_set_values  xmsv
         WHERE xmsv.mapping_set_code    = ''$mapping_set_code$''
           AND  ( TRUNC(p_validation_date)  BETWEEN NVL(xmsv.effective_date_from,p_validation_date)
                                     AND NVL(xmsv.effective_date_to,p_validation_date) )

           AND xmsv.input_value_type_code  =''I''
           AND xmsv.input_value_constant = TO_CHAR($input_source$)
           AND enabled_flag = ''Y''
       UNION
        SELECT 2 priority
              ,xmsv.value_constant
              ,xmsv.input_value_type_code
           FROM  xla_mapping_set_values  xmsv
          WHERE  xmsv.mapping_set_code    = ''$mapping_set_code$''
            AND  ( TRUNC(p_validation_date)  BETWEEN NVL(xmsv.effective_date_from,p_validation_date)
                                     AND NVL(xmsv.effective_date_to,p_validation_date) )
            AND xmsv.input_value_type_code = ''D''
            AND enabled_flag = ''Y''
       )
       ORDER BY priority
    )
    WHERE ROWNUM = 1;
Line: 1390

SELECT NAME
  INTO l_adr_name
  FROM xla_seg_rules_tl
 WHERE application_id         = p_value_segment_rule_appl_id
   AND amb_context_code       = p_amb_context_code
   AND segment_rule_type_code = p_value_segment_rule_type_code
   AND segment_rule_code      = p_value_segment_rule_code
   AND language               = userenv('LANG');
Line: 1402

FOR adr_detail_rec IN ( SELECT  xsrd.value_type_code
                              , xsrd.value_source_application_id
                              , xsrd.value_source_type_code
                              , xsrd.value_source_code
                              , xsrd.value_constant
                              , xsrd.value_code_combination_id
                              , xsrd.value_mapping_set_code
                              , xsrd.value_flexfield_segment_code
                              , xsrd.input_source_application_id
                              , xsrd.input_source_type_code
                              , xsrd.input_source_code
                              , xsrd.segment_rule_detail_id
                              , xsrd.user_sequence
                          FROM  xla_seg_rule_details         xsrd
                         WHERE xsrd.application_id         = p_value_segment_rule_appl_id
                           AND xsrd.segment_rule_code      = p_value_segment_rule_code
                           AND xsrd.segment_rule_type_code = p_value_segment_rule_type_code
                           AND xsrd.amb_context_code       = p_amb_context_code
                         ORDER BY xsrd.user_sequence  -- priority
                        ) LOOP

  l_detail := NULL;
Line: 1603

FOR adr_detail_rec IN ( SELECT  xsrd.value_type_code
                              , xsrd.value_source_application_id
                              , xsrd.value_source_type_code
                              , xsrd.value_source_code
                              , xsrd.value_constant
                              , xsrd.value_code_combination_id
                              , xsrd.value_mapping_set_code
                              , xsrd.value_flexfield_segment_code
                              , xsrd.value_segment_rule_appl_id
                              , xsrd.value_segment_rule_type_code
                              , xsrd.value_segment_rule_code
                              , xsrd.input_source_application_id
                              , xsrd.input_source_type_code
                              , xsrd.input_source_code
                              , xsrd.segment_rule_detail_id
                              , xsrd.user_sequence
                          FROM  xla_seg_rule_details               xsrd
                         WHERE xsrd.application_id         = p_application_id
                           AND xsrd.segment_rule_code      = p_segment_rule_code
                           AND xsrd.segment_rule_type_code = p_segment_rule_type_code
                           AND xsrd.amb_context_code       = p_amb_context_code
                         ORDER BY xsrd.user_sequence  -- priority
                        ) LOOP



  l_detail := NULL;
Line: 2156

SELECT DISTINCT
        xsrb.application_id
      , xsrb.segment_rule_type_code
      , xsrb.segment_rule_code
      , xsrb.flexfield_assign_mode_code
      , xsrb.flexfield_segment_code
      , xsrb.flex_value_set_id
      , xsrb.transaction_coa_id
      , xsrb.accounting_coa_id
      , REPLACE(xsrt.name , '''','''''')
  FROM  xla_aad_line_defn_assgns     xald
      , xla_line_defn_adr_assgns     xlda
      , xla_seg_rules_b              xsrb
      , xla_seg_rules_tl             xsrt
      , xla_prod_acct_headers        xpah
      , xla_line_definitions_b       xld
 WHERE xpah.application_id             = p_application_id
   AND xpah.amb_context_code           = p_amb_context_code
   AND xpah.product_rule_type_code     = p_product_rule_type_code
   AND xpah.product_rule_code          = p_product_rule_code
   AND xpah.accounting_required_flag   = 'Y'
   AND xpah.validation_status_code     = 'R'
   --
   AND xpah.application_id             = xald.application_id
   AND xpah.amb_context_code           = xald.amb_context_code
   AND xpah.event_class_code           = xald.event_class_code
   AND xpah.event_type_code            = xald.event_type_code
   AND xpah.product_rule_type_code     = xald.product_rule_type_code
   AND xpah.product_rule_code          = xald.product_rule_code
   --
   AND xald.application_id             = xlda.application_id
   AND xald.amb_context_code           = xlda.amb_context_code
   AND xald.event_class_code           = xlda.event_class_code
   AND xald.event_type_code            = xlda.event_type_code
   AND xald.line_definition_owner_code = xlda.line_definition_owner_code
   AND xald.line_definition_code       = xlda.line_definition_code
   --
   AND NVL(xlda.segment_rule_appl_id
          ,xlda.application_id)        = xsrb.application_id
   AND xlda.amb_context_code           = xsrb.amb_context_code
   AND xlda.segment_rule_code          = xsrb.segment_rule_code
   AND xlda.segment_rule_type_code     = xsrb.segment_rule_type_code
   AND xsrb.enabled_flag               = 'Y'
   --
   AND xsrb.application_id             = xsrt.application_id (+)
   AND xsrb.amb_context_code           = xsrt.amb_context_code (+)
   AND xsrb.segment_rule_code          = xsrt.segment_rule_code (+)
   AND xsrb.segment_rule_type_code     = xsrt.segment_rule_type_code (+)
   AND xsrt.language     (+)           = USERENV('LANG')
   --
   AND xald.application_id         = xld.application_id
   AND xald.amb_context_code       = xld.amb_context_code
   AND xald.event_class_code       = xld.event_class_code
   AND xald.event_type_code        = xld.event_type_code
   AND xald.line_definition_owner_code = xld.line_definition_owner_code
   AND xald.line_definition_code  = xld.line_definition_code
   AND xld.budgetary_control_flag = XLA_CMP_PAD_PKG.g_bc_pkg_flag
--ORDER BY xsrb.flexfield_segment_code, xsrb.segment_rule_type_code, xsrb.segment_rule_code
--------------------------
-- 4262811
--------------------------
UNION
SELECT  xsrb.application_id
      , xsrb.segment_rule_type_code
      , xsrb.segment_rule_code
      , xsrb.flexfield_assign_mode_code
      , xsrb.flexfield_segment_code
      , xsrb.flex_value_set_id
      , xsrb.transaction_coa_id
      , xsrb.accounting_coa_id
      , REPLACE(xsrt.name , '''','''''')
  FROM  xla_prod_acct_headers        xpah
      , xla_aad_line_defn_assgns     xald
      , xla_mpa_jlt_adr_assgns       xmja
      , xla_seg_rules_b              xsrb
      , xla_seg_rules_tl             xsrt
      , xla_line_definitions_b       xld
 WHERE xpah.application_id             = p_application_id
   AND xpah.amb_context_code           = p_amb_context_code
   AND xpah.product_rule_type_code     = p_product_rule_type_code
   AND xpah.product_rule_code          = p_product_rule_code
   AND xpah.accounting_required_flag   = 'Y'
   AND xpah.validation_status_code     = 'R'
   --
   AND xpah.application_id             = xald.application_id
   AND xpah.amb_context_code           = xald.amb_context_code
   AND xpah.event_class_code           = xald.event_class_code
   AND xpah.event_type_code            = xald.event_type_code
   AND xpah.product_rule_type_code     = xald.product_rule_type_code
   AND xpah.product_rule_code          = xald.product_rule_code
   --
   AND xald.application_id             = xmja.application_id
   AND xald.amb_context_code           = xmja.amb_context_code
   AND xald.event_class_code           = xmja.event_class_code
   AND xald.event_type_code            = xmja.event_type_code
   AND xald.line_definition_owner_code = xmja.line_definition_owner_code
   AND xald.line_definition_code       = xmja.line_definition_code
   --
   AND xmja.application_id             = xsrb.application_id
   AND xmja.amb_context_code           = xsrb.amb_context_code
   AND xmja.segment_rule_code          = xsrb.segment_rule_code
   AND xmja.segment_rule_type_code     = xsrb.segment_rule_type_code
   AND xmja.flexfield_segment_code     = nvl(xsrb.flexfield_segment_code,'ALL')
   AND xsrb.enabled_flag               = 'Y'
   --
   AND xsrb.application_id             = xsrt.application_id (+)
   AND xsrb.amb_context_code           = xsrt.amb_context_code (+)
   AND xsrb.segment_rule_code          = xsrt.segment_rule_code (+)
   AND xsrb.segment_rule_type_code     = xsrt.segment_rule_type_code (+)
   AND xsrt.language     (+)           = USERENV('LANG')
   --
   AND xald.application_id         = xld.application_id
   AND xald.amb_context_code       = xld.amb_context_code
   AND xald.event_class_code       = xld.event_class_code
   AND xald.event_type_code        = xld.event_type_code
   AND xald.line_definition_owner_code = xld.line_definition_owner_code
   AND xald.line_definition_code  = xld.line_definition_code
   AND xld.budgetary_control_flag = XLA_CMP_PAD_PKG.g_bc_pkg_flag
ORDER BY 5,2,3   --ORDER BY xsrb.flexfield_segment_code, xsrb.segment_rule_type_code, xsrb.segment_rule_code
;
Line: 2915

SELECT xsrb.application_id
      ,xsrb.segment_rule_code
      ,xsrb.segment_rule_type_code
      ,xsrb.amb_context_code
      ,xsrb.flexfield_assign_mode_code
      ,xsrb.flexfield_segment_code
      ,xsrb.flex_value_set_id
      ,xsrb.transaction_coa_id
      ,xsrb.accounting_coa_id
      ,REPLACE(xsrt.name , '''','''''')
  FROM  xla_seg_rules_b        xsrb
      , xla_seg_rules_tl       xsrt
 WHERE xsrb.application_id             = cp_application_id
   AND xsrb.segment_rule_code          = cp_segment_rule_code
   AND xsrb.segment_rule_type_code     = cp_segment_rule_type_code
   AND xsrb.amb_context_code           = cp_amb_context_code
   AND xsrb.enabled_flag               = 'Y'
   AND xsrt.application_id         (+) =  xsrb.application_id
   AND xsrt.amb_context_code       (+) =  xsrb.amb_context_code
   AND xsrt.segment_rule_code      (+) =  xsrb.segment_rule_code
   AND xsrt.segment_rule_type_code (+) =  xsrb.segment_rule_type_code
   AND xsrt.language               (+) =  USERENV('LANG')
;