Thursday, 13 June 2013

GL to PA link in R12

/* Formatted on 6/13/2013 9:49:45 AM (QP5 v5.114.809.3010) */

SELECT   *
  FROM   gl_je_lines
 WHERE   je_header_id = 123 AND Je_line_num = 1;

/* Formatted on 6/13/2013 9:49:41 AM (QP5 v5.114.809.3010) */

SELECT   *
  FROM   gl_import_references
 WHERE   je_header_id = 123 AND Je_line_num = 1;

/* Formatted on 6/13/2013 9:49:34 AM (QP5 v5.114.809.3010) */

SELECT *
  FROM xla_ae_lines
WHERE gl_sl_link_id in (SELECT gl_sl_link_id
                                          FROM gl_import_references
                                       WHERE je_header_id = 123
                                            AND Je_line_num =1;

/* Formatted on 6/13/2013 9:49:26 AM (QP5 v5.114.809.3010) */

SELECT   *
  FROM   xla_distribution_links
 WHERE   ae_header_id IN
               (SELECT   ae_header_id
                  FROM   xla_ae_lines
                 WHERE   gl_sl_link_id IN
                               (SELECT   gl_sl_link_id
                                  FROM   gl_import_references
                                 WHERE   je_header_id = 123
                                         AND Je_line_num = 1))
         AND ae_line_num = 1;

/* Formatted on 6/13/2013 9:49:20 AM (QP5 v5.114.809.3010) */

SELECT   source_distribution_id_num_1
  FROM   xla_distribution_links
 WHERE   ae_header_id IN
               (SELECT   ae_header_id
                  FROM   xla_ae_lines
                 WHERE   gl_sl_link_id IN
                               (SELECT   gl_sl_link_id
                                  FROM   gl_import_references
                                 WHERE   je_header_id = 123
                                         AND Je_line_num = 1))

/* Formatted on 6/13/2013 9:49:54 AM (QP5 v5.114.809.3010) */

SELECT   *
  FROM   pa_cost_distribution_lines_all
 WHERE   expenditure_item_id IN
               (SELECT   source_distribution_id_num_1
                  FROM   xla_distribution_links
                 WHERE   ae_header_id IN
                               (SELECT   ae_header_id
                                  FROM   xla_ae_lines
                                 WHERE   gl_sl_link_id IN
                                               (SELECT   gl_sl_link_id
                                                  FROM   gl_import_references
                                                 WHERE   je_header_id = 123
                                                         AND Je_line_num = 1)));

No comments:

Post a Comment