DBA Data[Home] [Help]

PACKAGE: APPS.CST_UTILITY_PUB

Source


1 PACKAGE CST_Utility_PUB AUTHID CURRENT_USER AS
2 /* $Header: CSTUTILS.pls 120.3 2006/02/22 12:54:23 visrivas noship $ */
3 
4 
5 ----------------------------------------------------------------------------
6 -- PROCEDURE                                                              --
7 --   writeLogMessages                                                     --
8 --                                                                        --
9 -- DESCRIPTION                                                            --
10 --   This API loops through the message stack and writes the messages to  --
11 -- log file                                                               --
12 --                                                                        --
13 -- PURPOSE:                                                               --
14 --   Oracle Applications Rel 11i.4                                        --
15 --                                                                        --
16 --                                                                        --
17 -- HISTORY:                                                               --
18 --    10/12/00     Anitha B       Created                                 --
19 ----------------------------------------------------------------------------
20 PROCEDURE writeLogMessages (p_api_version       IN   NUMBER,
21                             p_msg_count         IN   NUMBER,
22                             p_msg_data          IN   VARCHAR2,
23 
24                             x_return_status     OUT NOCOPY  VARCHAR2);
25 
26 ----------------------------------------------------------------------------
27 -- PROCEDURE                                                              --
28 --   getTxnCategoryId                                                     --
29 --                                                                        --
30 -- DESCRIPTION                                                            --
31 --   This API loops through the message stack and writes the messages to  --
32 -- log file                                                               --
33 --                                                                        --
34 -- PURPOSE:                                                               --
35 --   Oracle Applications Rel 11i.4                                        --
36 --                                                                        --
37 --                                                                        --
38 -- HISTORY:                                                               --
39 --    11/03/00     Hemant G       Created                                 --
40 ----------------------------------------------------------------------------
41 PROCEDURE getTxnCategoryId (p_api_version        IN   NUMBER,
42                             p_init_msg_list      IN   VARCHAR2
43                                                   := FND_API.G_FALSE,
44                             p_commit             IN   VARCHAR2
45                                                   := FND_API.G_FALSE,
46                             p_validation_level   IN   NUMBER
47                                                   := FND_API.G_VALID_LEVEL_FULL,
48 
49 
50                             p_txn_id		 IN   NUMBER,
51                             p_txn_action_id      IN   NUMBER,
52                             p_txn_source_type_id IN   NUMBER,
53                             p_txn_source_id      IN   NUMBER,
54                             p_item_id            IN   NUMBER,
55                             p_organization_id    IN   NUMBER,
56 
57                             x_category_id        OUT NOCOPY  NUMBER,
58                             x_return_status      OUT NOCOPY  VARCHAR2,
59                             x_msg_count          OUT NOCOPY  NUMBER,
60                             x_msg_data           OUT NOCOPY  VARCHAR2 );
61 
62 ----------------------------------------------------------------------------
63 -- PROCEDURE                                                              --
64 --   get_Std_CG_Acct_Flag                                                 --
65 --                                                                        --
66 -- DESCRIPTION                                                            --
67 --   This API determines if the standard costing organization follows     --
68 -- cost group accounting. If yes, then it has PJM support. If the         --
69 -- organization ID provided is not standard costing organization, the     --
70 -- API will raise an error                                                --
71 --                                                                        --
72 -- PURPOSE:                                                               --
73 --   Oracle Applications Rel 11i.6                                        --
74 -- PJM support for Standard Costing Organizations                         --
75 --                                                                        --
76 --                                                                        --
77 -- HISTORY:                                                               --
78 --    11/03/00     Anitha Dixit      Created                              --
79 ----------------------------------------------------------------------------
80 PROCEDURE get_Std_CG_Acct_Flag (
81                             p_api_version        IN   NUMBER,
82                             p_init_msg_list      IN   VARCHAR2
83                                                 := FND_API.G_FALSE,
84                             p_commit             IN   VARCHAR2
85                                                 := FND_API.G_FALSE,
86                             p_validation_level   IN   NUMBER
87                                                 := FND_API.G_VALID_LEVEL_FULL,
88 
89                             p_organization_id    IN   NUMBER DEFAULT NULL,
90                             p_organization_code  IN   VARCHAR2 DEFAULT NULL,
91 
92                             x_cg_acct_flag       OUT NOCOPY  NUMBER,
93                             x_return_status      OUT NOCOPY  VARCHAR2,
94                             x_msg_count          OUT NOCOPY  NUMBER,
95                             x_msg_data           OUT NOCOPY  VARCHAR2 );
96 
97 -----------------------------------------------------------------------------
98 -- Start of comments                                                       --
99 --                                                                         --
100 -- PROCEDURE                                                               --
101 --  insert_MTA      Function to ensure correct insertion of data into MTA  --
102 --                  Can be called from user code including the             --
103 --                  cst_dist_hook functions.  It derives the values for    --
104 --                  populating the table from what the user provides.      --
105 --                                                                         --
106 -- VERSION 1.0                                                             --
107 --                                                                         --
108 -- PARAMETERS                                                              --
109 --  P_API_VERSION      API Version # - REQUIRED: enter 1.0                 --
110 --  P_INIT_MSG_LIST    Initialize message list? True/False                 --
111 --  P_COMMIT           Should the API commit before returning? True/False  --
112 --  X_RETURN_STATUS    Success/Error/Unexplained error - 'S','E', or 'U'   --
113 --  X_MSG_COUNT        Message Count - # of messages placed in message list--
114 --  X_MSG_DATA         Message Text - returns msg contents if msg_count = 1--
115 --  P_ORG_ID           Organization ID - REQUIRED                          --
116 --  P_TXN_ID           Transaction ID - REQUIRED: should exist in MMT      --
117 --  P_USER_ID          User ID - REQUIRED                                  --
118 --  P_LOGIN_ID         Login ID                                            --
119 --  P_REQ_ID           Request ID                                          --
120 --  P_PRG_APPL_ID      Program Application ID                              --
121 --  P_PRG_ID           Program ID                                          --
122 --  P_ACCOUNT          Reference account - should correspond to            --
123 --                     gl_code_combinations.code_combination_id            --
124 --  P_DBT_CRDT         Debit / Credit flag - enter 1 for debit             --
125 --                                                -1 for credit            --
126 --                     will be used to set the sign for both base_txn_value--
127 --                     and primary_quantity in MTA                         --
128 --  P_LINE_TYP         Accounting line type - should correspond to a       --
129 --                     lookup for CST_ACCOUNTING_LINE_TYPE                 --
130 --  P_BS_TXN_VAL       Total txn value in base currency - Enter a positive --
131 --                     value, the sign will be determined by the value of  --
132 --                     P_DBT_CRDT                                          --
133 --  P_CST_ELEMENT      Cost element ID (1-5) - 1=material, 2=MOH, ...      --
134 --  P_RESOURCE_ID      Resource ID from BOM_RESOURCES - should correspond  --
135 --                     to bom_resources.resource_id                        --
136 --  P_ENCUMBR_ID       Encumbrance type ID - should correspond to          --
137 --                     gl_encumbrance_types.encumbrance_type_id            --
138 --                                                                         --
139 -- HISTORY:                                                                --
140 --    09/25/02     Bryan Kuntz      Created                                --
141 -- End of comments
142 -----------------------------------------------------------------------------
143 procedure insert_MTA (
144   P_API_VERSION    IN         NUMBER,
145   P_INIT_MSG_LIST  IN         VARCHAR2 default FND_API.G_FALSE,
146   P_COMMIT         IN         VARCHAR2 default FND_API.G_FALSE,
147   X_RETURN_STATUS  OUT NOCOPY VARCHAR2,
148   X_MSG_COUNT      OUT NOCOPY NUMBER,
149   X_MSG_DATA       OUT NOCOPY VARCHAR2,
150   P_ORG_ID         IN         NUMBER,
151   P_TXN_ID         IN         NUMBER,
152   P_USER_ID        IN         NUMBER,
153   P_LOGIN_ID       IN         NUMBER default NULL,
154   P_REQ_ID         IN         NUMBER default NULL,
155   P_PRG_APPL_ID    IN         NUMBER default NULL,
156   P_PRG_ID         IN         NUMBER default NULL,
157   P_ACCOUNT        IN         NUMBER default NULL,
158   P_DBT_CRDT       IN         NUMBER,
159   P_LINE_TYP       IN         NUMBER,
160   P_BS_TXN_VAL     IN         NUMBER,
161   P_CST_ELEMENT    IN         NUMBER default NULL,
162   P_RESOURCE_ID    IN         NUMBER default NULL,
163   P_ENCUMBR_ID     IN         NUMBER default NULL
164 );
165 
166 -----------------------------------------------------------------------------
167 -- Start of comments                                                       --
168 --                                                                         --
169 -- FUNCTION                                                                --
170 -- get_ret_sts_success              returns constant G_RET_STS_SUCCESS from--
171 --                                  fnd_api package                        --
172 -----------------------------------------------------------------------------
173 FUNCTION get_ret_sts_success return varchar2;
174 
175 -----------------------------------------------------------------------------
176 -- Start of comments                                                       --
177 --                                                                         --
178 -- FUNCTION                                                                --
179 -- get_ret_sts_error                returns constant G_RET_STS_ERROR from  --
180 --                                  fnd_api package                        --
181 -----------------------------------------------------------------------------
182 FUNCTION get_ret_sts_error return varchar2;
183 
184 -----------------------------------------------------------------------------
185 -- Start of comments                                                       --
186 --                                                                         --
187 -- FUNCTION                                                                --
188 -- get_ret_sts_unexp_error          returns constant G_RET_STS_UNEXP_ERROR --
189 --                                  from fnd_api package                   --
190 -----------------------------------------------------------------------------
191 FUNCTION get_ret_sts_unexp_error return varchar2;
192 
193 -----------------------------------------------------------------------------
194 -- Start of comments                                                       --
195 --                                                                         --
196 -- FUNCTION                                                                --
197 -- get_true                   returns constant G_TRUE from fnd_api package --
198 -----------------------------------------------------------------------------
199 FUNCTION get_true return varchar2;
200 
201 -----------------------------------------------------------------------------
202 -- Start of comments                                                       --
203 --                                                                         --
204 -- FUNCTION                                                                --
205 -- get_false                  returns constant G_FALSE from fnd_api package--
206 -----------------------------------------------------------------------------
207 FUNCTION get_false return varchar2;
208 
209 -----------------------------------------------------------------------------
210 -- Start of comments                                                       --
211 --                                                                         --
212 -- FUNCTION                                                                --
213 -- get_log                    returns constant LOG from fnd_file package   --
214 -----------------------------------------------------------------------------
215 FUNCTION get_log return number;
216 
217 -----------------------------------------------------------------------------
218 -- PROCEDURE                                                               --
219 --  get_ZeroCost_Flag							   --
220 --                                                                         --
221 -- DESCRIPTION								   --
222 --  Transaction ID and organization ID are passed in to this procedure.	   --
223 --  With this information, check to see if:				   --
224 --    organization_id is EAM-enabled,					   --
225 --    transaction_source_type = 5,					   --
226 --    transaction_action_id = 1, 27, 33, 34				   --
227 --    subinventory_code is an expense subinventory			   --
228 --    inventory item is an asset item					   --
229 --    entity_type of wip_entity_id = 6, 7				   --
230 --  If any of these conditions are not passed, then return 0		   --
231 --  After checking that all these conditions pass, then check the	   --
232 --    issue_zero_cost_flag in wip_discrete_jobs of the work order;	   --
233 --    return the value of the flag					   --
234 --									   --
235 -- PARAMETERS                                                              --
236 --  P_API_VERSION      API Version # - REQUIRED: enter 1.0                 --
237 --  P_INIT_MSG_LIST    Initialize message list? True/False                 --
238 --  P_COMMIT           Should the API commit before returning? True/False  --
239 --  X_RETURN_STATUS    Success/Error/Unexplained error - 'S','E', or 'U'   --
240 --  X_MSG_COUNT        Message Count - # of messages placed in message list--
241 --  X_MSG_DATA         Message Text - returns msg contents if msg_count = 1--
242 --  P_TXN_ID           Transaction ID - REQUIRED: should exist in MMT      --
243 --  P_ORG_ID           Organization ID - REQUIRED                          --
244 --  X_ZERO_COST_FLAG   Return 0 if none of the above conditions are met;   --
245 --		       Otherwise return the value of issue_zero_cost_flag  --
246 --		       of the work order				   --
247 --                                                                         --
248 -- HISTORY:                                                                --
249 --    07/01/03	Linda Soo	Created					   --
250 -----------------------------------------------------------------------------
251 PROCEDURE get_ZeroCostIssue_Flag (
252   P_API_VERSION    IN         NUMBER,
253   P_INIT_MSG_LIST  IN         VARCHAR2 default FND_API.G_FALSE,
254   X_RETURN_STATUS  OUT NOCOPY VARCHAR2,
255   X_MSG_COUNT      OUT NOCOPY NUMBER,
256   X_MSG_DATA       OUT NOCOPY VARCHAR2,
257   P_TXN_ID         IN         NUMBER,
258   X_ZERO_COST_FLAG OUT NOCOPY NUMBER
259 );
260 
261 ----------------------------------------------------------------------------
262 -- PROCEDURE                                                              --
263 --   get_Direct_Item_Charge_Acct                                          --
264 --                                                                        --
268 --  Changes starting from J should be made to this API.
265 -- DESCRIPTION                                                            --
266 --  This API is from CST_eamCost_PUB package. Moved the API to this
267 --  package to minimuze the dependencies PO would have on the API.
269 --
270 --  This API returns the account number given a EAM job
271 --  (entity type = 6,7) and purchasing category.  If the wip identity
272 --  doesn't refer to an EAM job type then -1 is returned, -1 is also
273 --  returned if no account is defined for that particular wip entity.
274 --
275 -- PURPOSE:                                                               --
276 --   Oracle Applications Rel 11i.6                                        --
277 --   Costing Support for EAM                                              --
278 --   Called by the PO account generator
279 --                                                                        --
280 --                                                                        --
281 -- HISTORY:                                                               --
282 --    08/28/03		Linda Soo		Created
283 ----------------------------------------------------------------------------
284 PROCEDURE get_Direct_Item_Charge_Acct (
285                             p_api_version        IN   NUMBER,
286                             p_init_msg_list      IN   VARCHAR2
287                                                 := FND_API.G_FALSE,
288                             p_commit             IN   VARCHAR2
289                                                 := FND_API.G_FALSE,
290                             p_validation_level   IN   NUMBER
291                                                 := FND_API.G_VALID_LEVEL_FULL,
292                             p_wip_entity_id      IN   NUMBER DEFAULT NULL,
293 			    x_material_acct	 OUT NOCOPY  NUMBER,
294                             x_return_status      OUT NOCOPY  VARCHAR2,
295                             x_msg_count          OUT NOCOPY  NUMBER,
296                             x_msg_data           OUT NOCOPY  VARCHAR2,
297 			    p_category_id	 IN   NUMBER := -1);
298 
299 -----------------------------------------------------------------------------
300 -- Start of comments                                                       --
301 --                                                                         --
302 -- FUNCTION                                                                --
303 -- check_db_version         returns 1 if database version is 9i or greater --
304 -- PARAMETERS                                                              --
305 --  P_API_VERSION      API Version # - REQUIRED: enter 1.0                 --
306 --  P_INIT_MSG_LIST    Initialize message list? True/False                 --
307 --  X_RETURN_STATUS    Success/Error/Unexplained error - 'S','E', or 'U'   --
308 --  X_MSG_COUNT        Message Count - # of messages placed in message list--
309 --  X_MSG_DATA         Message Text - returns msg contents if msg_count = 1--
310 -----------------------------------------------------------------------------
311 FUNCTION check_db_version (
312   P_API_VERSION    IN         NUMBER,
313   P_INIT_MSG_LIST  IN         VARCHAR2 DEFAULT FND_API.G_FALSE,
314   X_RETURN_STATUS  OUT NOCOPY VARCHAR2,
315   X_MSG_COUNT      OUT NOCOPY NUMBER,
316   X_MSG_DATA       OUT NOCOPY VARCHAR2
317 ) return NUMBER;
318 
319 ----------------------------------------------------------------------------
320 -- Start of Comments
321 --
322 -- PROCEDURE
323 -- Get_Context_Value  Returns the Operating unit, Legal entity and ledger
324 --                    Associated with an organization.
325 -- PARAMETERS
326 -- p_api_version       API version Required
327 -- p_init_mes_list     Initilaize Message List (True/False)
328 -- p_commit            Whether to commit inside the API or Not
329 -- p_validation_level  Validation Level
330 -- x_return_status     Success/Error/Unexplained Error
331 -- x_msg_count         Message Count
332 -- x_msg_data          Message Text
333 -- p_org_id            Organization ID
334 -- p_ledger_id         Ledger associated with Organization
335 -- p_le_id             Legal Entity ID
336 -- p_ou_id             Operating Unit ID
337 -------------------------------------------------------------------------------
338 Procedure Get_Context_Value (
339  p_api_version       IN          NUMBER,
340  p_init_msg_list     IN          VARCHAR2 ,
341  p_commit            IN          VARCHAR2 ,
342  p_validation_level  IN          NUMBER  ,
343  x_return_status     OUT NOCOPY  VARCHAR2,
344  x_msg_count         OUT NOCOPY  NUMBER,
345  x_msg_data          OUT NOCOPY  VARCHAR2,
346  p_org_id            IN          NUMBER,
347  p_ledger_id         OUT NOCOPY  NUMBER,
348  p_le_id             OUT NOCOPY  NUMBER,
349  p_ou_id             OUT NOCOPY  NUMBER);
350 
351 ----------------------------------------------------------------------------
352 -- Start of Comments
353 --
354 -- PROCEDURE
355 -- Get_Receipt_Event_Info:
356 -- API provides the name of the event class and entity code for a
357 -- receiving transaction type
358 -- PARAMETERS
359 -- p_api_version       API version Required
360 -- p_transaction_type  Receiving Transaction Type (from RCV_TRANSACTIONS)
361 -- p_entity_code       XLA Entity Code (RCV_ACCOUNTING_EVENTS)
362 -- p_application_id    Application Identifier for Cost Management
363 -- p_event_class_code  XLA Event Class Code
364 --------------------------------------------------------------------------
365 
366 Procedure Get_Receipt_Event_Info (
367   p_api_version      IN NUMBER,
368   p_transaction_type IN VARCHAR2,
369   x_return_status    OUT NOCOPY VARCHAR2,
373   p_application_id   OUT NOCOPY NUMBER,
370   x_msg_count        OUT NOCOPY NUMBER,
371   x_msg_data         OUT NOCOPY VARCHAR2,
372   p_entity_code      OUT NOCOPY VARCHAR2,
374   p_event_class_code OUT NOCOPY VARCHAR2
375 );
376 
377 END CST_Utility_PUB;