DBA Data[Home] [Help]

PACKAGE BODY: APPS.GL_COA_MIRROR_PKG

Source


1 PACKAGE BODY GL_COA_MIRROR_PKG as
2 /* $Header: glcoamrb.pls 120.2 2005/05/05 02:02:36 kvora ship $ */
3 
4   PROCEDURE set_coa_id ( X_coa_id   NUMBER) IS
5   BEGIN
6     gl_coa_mirror_pkg.chart_of_accounts_id := X_coa_id;
7   END set_coa_id;
8 
9   FUNCTION get_coa_id RETURN NUMBER IS
10     profile_val   VARCHAR2(100);
11     defined_flag  BOOLEAN;
12     as_id NUMBER;
13     coa_id        NUMBER;
14   BEGIN
15     IF(gl_coa_mirror_pkg.chart_of_accounts_id is null) then
16         fnd_profile.get_specific(name_z => 'GL_ACCESS_SET_ID',
17                                  val_z => profile_val,
18                                  defined_z=> defined_flag);
19         if(profile_val IS NULL OR defined_flag = FALSE) then
20            app_exception.raise_exception;
21         end if;
22 
23         as_id := to_number(profile_val);
24 
25         SELECT chart_of_accounts_id
26         INTO coa_id
27         FROM gl_access_sets
28         WHERE access_set_id = as_id;
29 
30         gl_coa_mirror_pkg.chart_of_accounts_id := coa_id;
31 
32     END IF;
33 
34     RETURN gl_coa_mirror_pkg.chart_of_accounts_id;
35 
36   EXCEPTION
37     when app_exceptions.application_exception then
38          return -1;
39 
40   END get_coa_id;
41 
42 END GL_COA_MIRROR_PKG;