DBA Data[Home] [Help]

PACKAGE: APPS.FTE_UTIL_PKG

Source


1 PACKAGE FTE_UTIL_PKG AS
2 /* $Header: FTEUTILS.pls 120.1 2005/06/28 03:19:08 appldev ship $ */
3 
4 
5   ----------------------------------------------------------------
6   -- FUNCTION : Tokenize_String
7   --
8   -- Parameters :
9   -- IN:
10   --  1. p_string            VARCHAR2          REQUIRED
11   --                         The string to be tokenized.
12   --  2. p_delim             VARCHAR2          REQUIRED
13   --                         The delimiter, or token.
14   -- RETURN: A Stringarray containing the tokens of the string.
15   ----------------------------------------------------------------
16   FUNCTION TOKENIZE_STRING (p_string   IN   VARCHAR2,
17 			    p_delim    IN   VARCHAR2) RETURN STRINGARRAY;
18 
19   ------------------------------------------------------------
20   --FUNCTION : Get_Msg
21   --
22   -- Parameters :
23   -- IN:
24   --  1. p_name        VARCHAR2       REQUIRED
25   --  2. p_tokens      STRINGARRAY    NOT REQUIRED.
26   --                   The tokens for the message.
27   --  3. p_values      STRINGARRAY    NOT REQUIRED.
28   --                   The token values.  Required if p_tokens is passed.
29   --
30   -- RETURN  The token-substituted message text
31   -------------------------------------------------------------
32   FUNCTION GET_MSG (p_name         IN    VARCHAR2,
33 		    p_tokens       IN    STRINGARRAY default NULL,
34 		    p_values       IN    STRINGARRAY default NULL) RETURN VARCHAR2;
35 
36   -----------------------------------------------------------------
37   -- FUNCTION : Canonicalize_Number
38   --
39   -- Parameters :
40   -- IN:
41   --  1. p_number             NUMBER            REQUIRED
42   ------------------------------------------------------------------
43   FUNCTION Canonicalize_Number (p_number    IN    NUMBER)
44       RETURN NUMBER;
45 
46   -----------------------------------------------------------------------------
47   -- FUNCTION  GET_CARRIER_ID
48   --
49   -- Purpose  Get Carrier Id From Carrier Name
50   --
51   -- IN Parameters:
52   --  	1. p_carrier_name:	carrier name
53   -----------------------------------------------------------------------------
54   FUNCTION GET_CARRIER_ID(p_carrier_name    IN      VARCHAR2) RETURN NUMBER;
55 
56   -------------------------------------------------------------------------------
57 
58   -----------------------------------------------------------------------------
59   -- FUNCTION  GET_CARRIER_NAME
60   --
61   -- Purpose  Get Carrier Name From Carrier ID
62   --
63   -- IN Parameters:
64   --  	1. p_carrier_name:	carrier name
65   -----------------------------------------------------------------------------
66   FUNCTION GET_CARRIER_NAME(p_carrier_id IN NUMBER) RETURN VARCHAR2;
67 
68   --  FUNCTION GET_LOOKUP_CODE
69   --
70   --  Purpose:	Get the code from fnd_lookup_values
71   --
72   --  IN parameter:
73   --	1. p_lookup_type:	type of the lookup
74   --	2. p_value:		value to lookup
75   -------------------------------------------------------------------------------
76   FUNCTION GET_LOOKUP_CODE(p_lookup_type IN VARCHAR2,
77                            p_value       IN VARCHAR2)  RETURN VARCHAR2;
78 
79   -------------------------------------------------------------------------------
80   -- FUNCTION GET_UOM_CODE
81   --
82   -- Purpose: get the uom code from uom name and class
83   --
84   -- IN parameters:
85   --	1. p_uom:	uom name
86   --	2. p_uom_class: class name (only applies to weight and volumn)
87   --
88   -- Returns a Uom_Code searching into mtl_units_of_measure
89   --                 using first uom_code then unit_of_measure
90   -------------------------------------------------------------------------------
91   FUNCTION GET_UOM_CODE(p_uom		IN	VARCHAR2,
92 			p_uom_class	IN	VARCHAR2 DEFAULT NULL) RETURN VARCHAR2;
93 
94   -----------------------------------------------------------------------------
95   -- FUNCTION  GET_DATA
96   --
97   -- Purpose  Given two String arrays representing key/value pairs, and a 'key',
98   --          it returns the corresponding 'value'.
99   --
100   -- IN Parameters
101   --    1. p_key: The 'key' whose corresponding value is required
102   --    2. p_keys: An array of keys.
103   --    3. p_values : An array of values.
104   --
105   -- RETURN: The corresponding 'value' of the input parameter 'p_key', or NULL
106   --         if 'p_key' is not in the array of keys.
107   -----------------------------------------------------------------------------
108   FUNCTION GET_DATA(p_key     IN     VARCHAR2,
109                     p_values  IN     FTE_BULKLOAD_PKG.data_values_tbl) RETURN VARCHAR2;
110 
111 
112   -----------------------------------------------------------------------------
113   -- FUNCTION Get_Vehicle_Type
114   --
115   -- Purpose  Get the vehicle ID Given the vehicle type or id
116   --
117   -- IN Parameters
118   --    1. l_vehicle_type   IN   VARCHAR2 : The vehicle type to be validated.
119   --
120   -- RETURN:
121   --    the vehicle ID, or null if it doesn't exist.
122   -----------------------------------------------------------------------------
123   FUNCTION Get_Vehicle_Type (p_vehicle_type  IN           VARCHAR2) RETURN VARCHAR2;
124 
125   -----------------------------------------------------------------------------
126   -- PROCEDURE     GET_CATEGORY_ID
127   --
128   -- Purpose
129   --    Return the category ID of the freight class represented in
130   --    the string 'p_commodity_value'.  Caches the values of all commodities
131   --    the first time it is called, for greater efficiency.
132   --
133   -- IN Parameters
134   --    1. p_commodity_value: Three different (but equivalent) configurations of
135   --       the commodity will all evaluate to the same value. E.g. '500', 'FC.500'
136   --       and 'FC.500.US' are all acceptable inputs, and will return the same
137   --       category ID.
138   --
139   -- Out Parameters
140   --    1. x_catg_id: The category ID of the input.
141   --    2. x_class_code: The class_code of the input. (e.g. FC)
142   -----------------------------------------------------------------------------
143   PROCEDURE GET_CATEGORY_ID (p_commodity_value   IN  VARCHAR2,
144                              x_catg_id           OUT NOCOPY NUMBER,
145                              x_class_code        OUT NOCOPY VARCHAR2,
146                              x_status            OUT NOCOPY NUMBER,
147                              x_error_msg         OUT NOCOPY VARCHAR2);
148 
149   -----------------------------------------------------------------------------
150   -- PROCEDURE    GET_CATEGORY_ID
151   --
152   -- Purpose
153   --  Overloaded version of the function GET_CATEGORY_ID. See above.
154   -----------------------------------------------------------------------------
155   PROCEDURE GET_CATEGORY_ID (p_commodity_value   IN  VARCHAR2,
156                              x_catg_id           OUT NOCOPY NUMBER,
157                              x_status            OUT NOCOPY NUMBER,
158                              x_error_msg         OUT NOCOPY VARCHAR2);
159 
160   -----------------------------------------------------------------------------
161   -- FUNCTION GET_CATG_ID
162   --
163   -- Purpose  Get the category ID using the commodity value
164   --
165   -- IN Parameters
166   --    1. p_com_class:	commodity class
167   --	2. p_value:	commodity value
168   --
169   -- RETURN:
170   --    the category id for the commodity, -1 if not found
171   -----------------------------------------------------------------------------
172   FUNCTION GET_CATG_ID (p_com_class	IN	VARCHAR2,
173 			p_value		IN	VARCHAR2) RETURN NUMBER;
174 
175   -----------------------------------------------------------------------------
176   -- PROCEDURE  GET_Fnd_Currency
177   --
178   -- Purpose  Validate a currency against Fnd_Currencies.
179   --
180   -- Parameters
181   --   p_currency : The currency name to be validated.
182   --
183   -- RETURN       : The currency, if the currency is valid. NULL if the currency
184   --                is not valid.
185   -----------------------------------------------------------------------------
186   FUNCTION GET_Fnd_Currency (p_currency      IN       VARCHAR2,
187                                   x_error_msg OUT NOCOPY   VARCHAR2,
188                                   x_status    OUT NOCOPY   NUMBER) RETURN VARCHAR2;
189 
190   -------------------------------------------------------------------------------------
191   -- PROCEDURE  Write_LogFile
192   --
193   -- Purpose:  Logging a message with an attribute and value (ie. carrier_id = 100)
194   --
195   -- IN Parameters:
196   --  	1. p_module_name	the module messages were logged at
197   --	2. p_attribute		the attribute displayed
198   --	3. p_value		    the value of the attribute
199   -------------------------------------------------------------------------------------
200   PROCEDURE WRITE_LOGFILE(p_module_name  IN   VARCHAR2,
201                           p_attribute    IN   VARCHAR2,
202                           p_value        IN   VARCHAR2);
203 
204   -------------------------------------------------------------------------------------
205   -- PROCEDURE  Write_LogFile
206   --
207   -- Purpose:  Logging a message.
208   --
209   -- IN Parameters:
210   --  	1. p_module_name	the module messages were logged at
211   --	    2. p_message		the message to be logged.
212   -------------------------------------------------------------------------------------
213   PROCEDURE WRITE_LOGFILE(p_module_name  IN VARCHAR2,
214                           p_message      IN VARCHAR2);
215 
216   -------------------------------------------------------------------------------------
217   -- PROCEDURE  Write_OutFile
218   --
219   -- Purpose:  Writing a message in the concurrent output file(without tokens).
220   --
221   -- IN Parameters:
222   --  	1. p_msg	    the message (i.e. sqlerrm)
223   --	2. p_module_name    procedure name
224   --    3. p_category       category the p_msg_name belongs to.
225   --    4. p_line_number    the line number where the error occurs.
226   -------------------------------------------------------------------------------------
227 
228   PROCEDURE Write_OutFile(p_msg     	IN	VARCHAR2,
229 			  p_module_name IN	VARCHAR2,
230                           p_category    IN	VARCHAR2,
231                           p_line_number IN	NUMBER DEFAULT NULL);
232 
233   -------------------------------------------------------------------------------------
234   -- PROCEDURE  Write_OutFile
235   --
236   -- Purpose:  Writing a message with tokens in the concurrent output file.
237   --
238   -- IN Parameters:
239   --  	1. p_msg_name	    the message name. e.g, 'FTE_CAT_ACTION_INVALID'
240   --	2. p_tokens		    the tokens the message text of p_msg_name has.
241   --	3. p_values		    the values for the p_tokens.
242   --	4. p_module_name:	module where error occured
243   --    4. p_category       category the p_msg_name belongs to.
244   --    5. p_line_number    the line number where the error occurs.
245   -------------------------------------------------------------------------------------
246   PROCEDURE Write_OutFile(p_msg_name     IN  VARCHAR2,
247                           p_tokens       IN  STRINGARRAY DEFAULT NULL,
248                           p_values       IN  STRINGARRAY DEFAULT NULL,
249 			  p_module_name	 IN  VARCHAR2,
250                           p_category     IN  VARCHAR2,
251                           p_line_number  IN  NUMBER DEFAULT NULL) ;
252 
253   -----------------------------------------------------------------------------
254   -- PROCEDURE  Exit_Debug
255   --
256   -- Purpose:  Exit the debug for current procedure/function in wsh debug file
257   --
258   -- IN Parameters:
259   --	1. p_module_name:	module name to exit
260   --
261   -----------------------------------------------------------------------------
262   PROCEDURE EXIT_DEBUG(p_module_name  IN  VARCHAR2);
263 
264   -----------------------------------------------------------------------------
265   -- PROCEDURE  Enter_Debug
266   --
267   -- Purpose:  Enter the debug for current procedure/function in wsh debug file
268   --
269   -- IN Parameters:
270   --	1. p_module_name:	module name to enter
271   --
272   -----------------------------------------------------------------------------
273   PROCEDURE ENTER_DEBUG(p_module_name  IN  VARCHAR2);
274 
275   -------------------------------------------------------------------------------------
276   -- PROCEDURE  Init_Debug
277   --
278   -- Purpose:  This procedure turns the debug on depending on the value p_user_debug.
279   --           and starts the WSH debugger.
280   --
281   -- IN Parameters:
282   --	1. p_user_debug: user debug flag
283   -------------------------------------------------------------------------------------
284   PROCEDURE INIT_DEBUG(p_user_debug NUMBER);
285 
286   ------------------------------------------------------------
287   -- FUNCTION GET_CATEGORY_MESSAGE
288   --
289   -- Purpose: get the category message for error
290   --
291   -- IN parameters:
292   --	1. p_category:	the category letter
293   --
294   -- Return category message
295   ------------------------------------------------------------
296   FUNCTION GET_CATEGORY_MESSAGE(p_category IN VARCHAR2) RETURN VARCHAR2;
297 
298 END FTE_UTIL_PKG;