DBA Data[Home] [Help]

PACKAGE: APPS.GCS_UTILITY_PKG

Source


1 PACKAGE GCS_UTILITY_PKG as
2 /* $Header: gcsutils.pls 120.6 2007/06/29 00:58:47 skamdar noship $ */
3 
4 
5   -- Definition of Global Data Types and Variables
6 
7    -- Action types for writing module information to the log file.
8    g_module_enter         CONSTANT VARCHAR2 (3)        := '>> ';
9    g_module_success       CONSTANT VARCHAR2 (3)        := '<< ';
10    g_module_failure       CONSTANT VARCHAR2 (3)        := '<x ';
11    -- A newline character. Included for convenience when writing long strings.
12    g_nl                   CONSTANT VARCHAR2 (1)        := fnd_global.newline;
13 
14    -- return codes for sub processes
15    g_ret_sts_success CONSTANT VARCHAR2(1) := 'S';
16    g_ret_sts_unexp_error CONSTANT VARCHAR2(1) := 'U';
17    g_ret_sts_error CONSTANT VARCHAR2(1) := 'E';
18    g_ret_sts_warn CONSTANT VARCHAR2(1) := 'W';
19 
20    -- Records, Associative Arrays, and Variables to store attribute information
21    TYPE r_dimension_attr_info IS RECORD
22     				(dimension_id 			NUMBER(15),
23      				 attribute_id 			NUMBER(15),
24      				 column_name			VARCHAR2(30),
25      				 attribute_varchar_label        VARCHAR2(30),
26      				 attribute_value_column_name    VARCHAR2(30),
27      				 version_id			NUMBER);
28 
29    TYPE t_hash_dimension_attr_info IS
30      				TABLE OF r_dimension_attr_info INDEX BY VARCHAR2(200);
31 
32    g_dimension_attr_info t_hash_dimension_attr_info;
33 
34    -- Records, Associative Arrays, and Variables to store dimensionality information
35    TYPE r_gcs_dimension_info IS RECORD
36       				(column_name 			VARCHAR2(30),
37       				 dimension_id                   NUMBER(15),
38       				 associated_value_set_id        NUMBER(15),
39       				 required_for_gcs               VARCHAR2(1),
40       				 required_for_fem		VARCHAR2(1),
41       				 default_value                  NUMBER,
42       				 detail_value_set_id            NUMBER(15),
43 				 dim_b_table_name		VARCHAR2(30),
44 				 dim_vl_view_name		VARCHAR2(30),
45 				 dim_member_col			VARCHAR2(30),
46 				 dim_member_display_code	VARCHAR2(30));
47 
48    TYPE t_hash_gcs_dimension_info IS
49       				TABLE OF r_gcs_dimension_info INDEX BY VARCHAR2(30);
50 
51    g_gcs_dimension_info t_hash_gcs_dimension_info;
52 
53 
54    -- Bugfix 5707630: Records, Associative Arrays, and Variables to store historical rates
55    -- dimensionality information
56    TYPE r_hrate_dim_info IS RECORD
57                                 (column_name 			VARCHAR2(30),
58                                  required_for_hrate             VARCHAR2(1));
59 
60    TYPE t_hash_hrate_dim_info IS TABLE OF r_hrate_dim_info INDEX BY VARCHAR2(30);
61 
62    g_hrate_dim_info t_hash_hrate_dim_info;
63 
64    -- end bugfix 5707630
65 
66 
67    -- Record to store current and prior calendar period information
68    TYPE r_cal_period_info IS RECORD
69       			     (cal_period_id  			NUMBER,
70       			      cal_period_number                 NUMBER(15),
71       			      cal_period_year                   NUMBER(15),
72       			      prev_cal_period_id                NUMBER,
73       			      prev_cal_period_number            NUMBER(15),
74       			      prev_cal_period_year              NUMBER(15),
75       			      next_cal_period_id                NUMBER,
76       			      next_cal_period_number            NUMBER(15),
77       			      next_cal_period_year              NUMBER(15),
78       			      cal_periods_per_year              NUMBER(15));
79 
80    -- Record to store entry name and description (Added by STK 1/12/03)
81    TYPE r_entry_header    IS RECORD
82    			     (name				VARCHAR2(80),
83    			      description			VARCHAR2(240));
84 
85   -- Added global variables (STK 2/17/04)
86   g_dataprep_obj_id		NUMBER(9)	:=	1002;
87   g_xlate_obj_id		NUMBER(9)	:=	1003;
88   g_aggregation_obj_id		NUMBER(9)	:=	1004;
89   g_intracompany_obj_id		NUMBER(9)	:=	1005;
90   g_oper_adj_obj_id		NUMBER(9)	:=	1006;
91   g_acq_dis_obj_id		NUMBER(9)	:=	1007;
92   g_pre_interco_obj_id		NUMBER(9)	:=	1008;
93   g_interco_obj_id		NUMBER(9)	:=	1009;
94   g_post_interco_obj_id		NUMBER(9)	:=	1010;
95   g_minority_int_obj_id		NUMBER(9)	:=	1011;
96   g_pre_dataprep_obj_id		NUMBER(9)	:=	1012;
97   g_pre_aggregation_obj_id	NUMBER(9)	:=	1013;
98   g_gcs_source_system_code	NUMBER		:=	70;
99   g_avg_fin_elem		NUMBER		:=	140;
100   g_fch_global_vs_combo_id	NUMBER(9);
101 
102   --
103   -- Procedure
104   --   init_dimension_attr_info
105   -- Purpose
106   --   stores the attribute name, attribute surrogate key within a hashtable to avoid joins
107   --   between GCS Modules and FEM_DIM_ATTRIBUTES_B.
108   -- Arguments
109   -- Notes
110 
111   PROCEDURE init_dimension_attr_info;
112 
113   --
114   -- Procedure
115   -- Purpose
116   --   determines the associations between dimensions within FEM_BALANCES and the application GCS.
117   --   (i.e. default values, part of GCS processing key, etc).
118   -- Arguments
119   -- Notes
120 
121   PROCEDURE init_dimension_info;
122 
123 
124 
125   --
126   -- Procedure
127   --   get_cal_period_details()
128   -- Purpose
129   --   extracts period attribute information for the specified period, and details for the prior period.
130   -- Arguments
131   --   p_cal_period_id		Reference Calendar Period
132   --   p_cal_period_record	Record structure storing period attribution for refernce and previous period
133   -- Notes
134   --
135 
136   PROCEDURE get_cal_period_details(p_cal_period_id 	NUMBER,
137   				   p_cal_period_record	IN OUT NOCOPY r_cal_period_info);
138 
139 
140   -- STK 1/12/04
141   -- Procedure
142   --   get_entry_header()
143   -- Purpose
144   --   generates a unique name, and appropriate description for all automated GCS II processes
145   -- Arguments
146   --   p_process_type_code	Automated Process Values: Data Prep, Translation, Aggregation,Acquisitions and Disposals,
147   --							  Pre-Intercompany, Intercompany, Post-Intercompany,
148   --							  Minority Interest, Post-Minority Interest
149   --   p_entry_id		Entry ID
150   --   p_entity_id		Entity ID associated with process (parent entity in case of rules)
151   --   p_rule_id		Required Only for Automated Rules
152   -- Notes
153   --
154   PROCEDURE get_entry_header(	p_process_type_code	VARCHAR2,
155   				p_entry_id 		NUMBER,
156   				p_entity_id		NUMBER,
157   				p_currency_code		VARCHAR2,
158   				p_rule_id		NUMBER DEFAULT NULL,
159   				p_entry_header	IN OUT NOCOPY r_entry_header);
160 
161   --
162   -- Function
163   --   Get_Dimension_Required
164   -- Purpose
165   --   Get whether or not this dimension is required. Return 'Y' or 'N'.
166   -- Arguments
167   --   p_dim_col	 Dimension column name
168   -- Example
169   --   GCS_UTILITY_PKG.Get_Dimension_Required
170   -- Notes
171   --
172   FUNCTION Get_Dimension_Required(p_dim_col VARCHAR2) RETURN VARCHAR2;
173 
174   --
175   -- Function
176   --   Get_Fem_Dim_Required
177   -- Purpose
178   --   Get whether or not this dimension is required for FEM. Return 'Y' or 'N'.
179   -- Arguments
180   --   p_dim_col	 Dimension column name
181   -- Example
182   --   GCS_UTILITY_PKG.Get_Fem_Dim_Required
183   -- Notes
184   --
185   FUNCTION Get_Fem_Dim_Required(p_dim_col VARCHAR2) RETURN VARCHAR2;
186 
187 
188   --
189   -- Function
190   --   Get_Hrate_Dim_Required
191   -- Purpose
192   --   Get whether or not this dimension is required for Historical rates. Return 'Y' or 'N'.
193   -- Arguments
194   --   p_dim_col	 Dimension column name
195   -- Example
196   --   GCS_UTILITY_PKG.Get_Hrate_Dim_Required
197   -- Notes
198   --
199   FUNCTION Get_Hrate_Dim_Required(p_dim_col VARCHAR2) RETURN VARCHAR2;
200 
201 
202   --
203   -- Function
204   --   Get_Default_Value
205   -- Purpose
206   --   Get default value for the dimension
207   -- Arguments
208   --   p_dim_col	 Dimension column name
209   -- Example
210   --   GCS_UTILITY_PKG.Get_Default_Value
211   -- Notes
212   --
213   FUNCTION Get_Default_Value(p_dim_col VARCHAR2) RETURN NUMBER;
214 
215   --
216   -- Function
217   --   Get_Dimension_Attribute
218   -- Purpose
219   --   Get attribute_id for the dimension-attribute
220   -- Arguments
221   --   p_dim_attr Dimension attribute
222   -- Example
223   --   GCS_UTILITY_PKG.Get_Dimension_Attribute('CAL_PERIOD_ID-CAL_PERIOD_END_DATE')
224   -- Notes
225   --
226   FUNCTION Get_Dimension_Attribute(p_dim_attr VARCHAR2) RETURN NUMBER;
227 
228 
229   --
230   -- Function
231   --   Get_Org_Id(p_entity_id NUMBER, p_hierarchy_id NUMBER, p_relationship_id NUMBER) RETURN NUMBER
232   -- Purpose
233   --   Get org_id for the given entity. If no org_id is found, then look
234   --   for org_id for the associated operating entity for this consolidation
235   --   entity.  If no org_id is found, then look for org_id for any one of the
236   --   child entities
237   -- Arguments
238   --   p_entity_id	   Entity Id
239   --   p_hierarchy_id      Hierarchy Id
240   --   p_relationship_id   Relationship Id
241   -- Example
242   --   GCS_UTILITY_PKG.Get_Org_Id
243   -- Notes
244   --
245   FUNCTION Get_Org_Id (p_entity_id NUMBER , p_hierarchy_id NUMBER) RETURN NUMBER;
246 
247  --
248   -- PROCEDURE
249   --   Get_Conversion_Rate
250   -- Purpose
251   --   Get the conversion rate.
252   --
253   --
254   --
255   -- Arguments
256   --   p_source_currency	 Source Currency
257   --   p_target_currency         Target Currency
258   --   p_cal_period_id           Cal Period Id
259   -- Example
260   --   GCS_UTILITY_PKG.Get_Conversion_Rate('EUR', 'USD',
261   --                                        24528210000000000000061000200140,
262   --                                        l_errbuf,
263   --                                        l_errcode);
264   -- Notes
265   --
266 
267  PROCEDURE  get_conversion_rate (P_Source_Currency IN	 	VARCHAR2,
268                                  P_Target_Currency IN     	VARCHAR2,
269   			         p_cal_period_Id   IN		NUMBER,
270                                  p_conversion_rate IN OUT NOCOPY      NUMBER,
271                                  P_errbuf     IN OUT  NOCOPY   	VARCHAR2,
272                                  p_errcode    IN OUT   NOCOPY  	NUMBER);
273 
274   --
275   -- Function
276   --   Get_Associated_Value_Set_Id
277   -- Purpose
278   --   Get associated_value_set_id for the dimension
279   -- Arguments
280   --   p_dim_col Dimension
281   -- Example
282   --   GCS_UTILITY_PKG.Get_Associated_Value_Set_Id('LINE_ITEM_ID')
283   -- Notes
284   --
285 
286   FUNCTION Get_Associated_Value_Set_Id(p_dim_col VARCHAR2) RETURN NUMBER;
287 
288   --
289   -- Procedure
290   --   populate_calendar_map_details
291   -- Purpose
292   --   Takes the source calendar period and maps it to the target calendar period
293   -- Arguments
294   --   p_source_cal_period_id	Calendar Period
295   --   p_source_period_flag	Source Period
296   -- Example
297   -- Notes
298   --
299 
300   PROCEDURE populate_calendar_map_details(p_cal_period_id       IN      NUMBER,
301                                           p_source_period_flag  IN      VARCHAR2,
302 					  p_greater_than_flag	IN	VARCHAR2);
303 
304 
305   --Bugfix 6160542: Making Get_Base_Org_Id to public
306   -- Function
307   --   Get_Base_Org_Id(p_entity_id NUMBER) RETURN NUMBER
308   -- Purpose
309   --   Get org_id for the given entity.
310   -- Arguments
311   --   p_entity_id         Entity Id
312   -- Example
313   --   GCS_UTILITY_PKG.Get_Org_Id
314   -- Notes
315   --   This is a private function, only called by the public Get_Org_Id().
316   -- History
317   --   23-Jun-2004  J Huang  BaseOrg enhancement. (Bug 3711204)
318   --
319 
320   FUNCTION Get_Base_Org_Id(p_entity_id NUMBER) RETURN NUMBER;
321 
322 
323 END GCS_UTILITY_PKG;