DBA Data[Home] [Help]

PACKAGE: APPS.QA_PLANS_PUB

Source


1 PACKAGE qa_plans_pub AS
2 /* $Header: qltpplnb.pls 120.3.12010000.1 2008/07/25 09:22:04 appldev ship $ */
3 /*#
4  * This package is the public interface for Quality Collection Plans setup.
5  * It allows for the creation of new collection plans. A new collection plan
6  * can be created as a copy of an existing collection plan, or with addition
7  * of individual collection elements. This package also supports deleting an
8  * existing collection plan.
9  * @rep:scope public
10  * @rep:product QA
11  * @rep:displayname Collection Plan Setup
12  * @rep:lifecycle active
13  * @rep:category BUSINESS_ENTITY QA_PLAN
14  */
15 
16 --
17 -- Global constants
18 --
19 
20 --
21 -- Seeded Plan Type Codes
22 --
23     g_plan_type_wip_inspection CONSTANT NUMBER := 1;
24     g_plan_type_rcv_inspection CONSTANT NUMBER := 2;
25     g_plan_type_fgi_inspection CONSTANT NUMBER := 3;
26     g_plan_type_field_returns  CONSTANT NUMBER := 4;
27 
28 --
29 -- Seeded Specification Assignment Types
30 --
31 
32     g_spec_type_item     CONSTANT NUMBER := 1;
33     g_spec_type_supplier CONSTANT NUMBER := 2;
34     g_spec_type_customer CONSTANT NUMBER := 3;
35     g_spec_type_none     CONSTANT NUMBER := 4;
36 
37 --
38 -- Frequently a plan element attribute can inherit the default
39 -- value defined for the element.  If we also allow the user to
40 -- override this default, then we have to face the problem of
41 -- ambiguity.  An example is, when the user specify NULL as
42 -- the plan element "Default Value", does he mean to inherit
43 -- the value from the element level?  or does he mean override
44 -- whatever value was at the element level, but use NULL as the
45 -- value?  So, we define a constant to mean inherit.
46 --
47     g_inherit  CONSTANT VARCHAR2(1) := chr(0);
48 
49 --
50 -- API name        : create_collection_plan
51 -- Type            : Public
52 -- Pre-reqs        : None
53 --
54 -- API to create a new Collection Plan in Oracle Quality.
55 -- Version 1.0
56 --
57 -- This API creates a header of a Collection Plan.  After calling
58 -- this procedure, the user should call add_plan_element consecutively
59 -- to add as many collection elements as needed.  Afterwards, call
60 -- complete_plan_processing to finish the plan creation.
61 --
62 -- Database commit is never performed.
63 --
64 -- Parameters:
65 --
66 --  p_api_version                                           NUMBER
67 --     Should be 1.0
68 --
69 --  p_init_msg_list                                         VARCHAR2
70 --     Standard api parameter.  Indicates whether to
71 --     re-initialize the message list.
72 --     Default is fnd_api.g_false.
73 --
74 --  p_validation_level                                      NUMBER
75 --     Standard api parameter.  Indicates validation level.
76 --     Use the default fnd_api.g_valid_level_full.
77 --
78 --  p_user_name                                             VARCHAR2(100)
79 --     The user's name, as defined in fnd_user table.
80 --     This is used to record audit info in the WHO columns.
81 --     If the user accepts the default, then the API will
82 --     use fnd_global.user_id.
83 --
84 --  p_plan_name                                             VARCHAR2(30)
85 --     Plan name.  Automatically converted to upper case.
86 --
87 --  p_organization_code                                     VARCHAR2
88 --     Organization code.
89 --
90 --  p_plan_type                                             VARCHAR2
91 --     Collection plan type as set up in the Setup
92 --     Collection Plan Type form. This is the descriptive name
93 --     instead of the plan type code.
94 --
95 --     These are the seeded plan type code and description.
96 --
97 --     1 = WIP Inspection        (qa_plans_pub.g_plan_type_wip_inspection)
98 --     2 = Receiving Inspection  (qa_plans_pub.g_plan_type_rcv_inspection)
99 --     3 = FGI Inspection        (qa_plans_pub.g_plan_type_fgi_inspection)
100 --     4 = Field Returns         (qa_plans_pub.g_plan_type_field_returns)
101 --
102 --  p_description                                           VARCHAR2(150)
103 --     Description of the plan.
104 --     Default is NULL.
105 --
106 --  p_effective_from                                        DATE
107 --     Start date.  Specify NULL if no start date limit.
108 --     Default is sysdate.
109 --
110 --  p_effective_to                                          DATE
111 --     End date.  Specify NULL if no end date limit.
112 --     Default is NULL.
113 --
114 --  p_spec_assignment_type                                  NUMBER
115 --     A plan can be associated with a specification type:
116 --
117 --     1 = Item Specification     (qa_plans_pub.g_spec_type_item)
118 --     2 = Supplier Specification (qa_plans_pub.g_spec_type_supplier)
119 --     3 = Customer Specification (qa_plans_pub.g_spec_type_customer)
120 --     4 = No Specification       (qa_plans_pub.g_spec_type_none)
121 --
122 --     Default is qa_plans_pub.g_spec_type_none.
123 --
124 --  x_plan_id                                               OUT NUMBER
125 --     The plan ID created.
126 --
127 --  x_msg_count                                             OUT NUMBER
128 --     Standard api parameter.  Indicates no. of messages
129 --     put into the message stack.
130 --
131 --  x_msg_data                                              OUT VARCHAR2
132 --     Standard api parameter.  Messages returned.
133 --
134 --  x_return_status                                         OUT VARCHAR2
135 --     Standard api return status parameter.
136 --     Values: fnd_api.g_ret_sts_success,
137 --             fnd_api.g_ret_sts_error,
138 --             fnd_api.g_ret_sts_unexp_error.
139 --
140 /*#
141  * Creates a header of a Collection Plan.
142  * After calling this procedure, the user should call add_plan_element consecutively
143  * to add as many collection elements as needed.  Afterwards, call
144  * complete_plan_processing to finish the plan creation.
145  * @param p_api_version Should be 1.0
146  * @param p_init_msg_list Indicates whether to re-initialize the message list
147  * @param p_validation_level Indicates validation level
148  * @param p_user_name The user's name, as defined in fnd_user table
149  * @param p_plan_name Plan name, Automatically converted to upper case
150  * @param p_organization_code Organization code
151  * @param p_plan_type Collection plan type
152  * @param p_description Plan Description
153  * @param p_effective_from Plan Effective From Date
154  * @param p_effective_to Plan Effective To Date
155  * @param p_spec_assignment_type Specification Type
156  * @param x_plan_id Plan ID that gets created
157  * @param x_msg_count Count of messages in message stack
158  * @param x_msg_data Messages returned
159  * @param x_return_status API Return Status
160  * @rep:displayname Create a Collection Plan
161  */
162 PROCEDURE create_collection_plan(
163     p_api_version               IN  NUMBER,
164     p_init_msg_list             IN  VARCHAR2  := fnd_api.g_false,
165     p_validation_level          IN  NUMBER    := fnd_api.g_valid_level_full,
166     p_user_name                 IN  VARCHAR2  := NULL,
167     p_plan_name                 IN  VARCHAR2,
168     p_organization_code         IN  VARCHAR2,
169     p_plan_type       		IN  VARCHAR2,
170     p_description               IN  VARCHAR2  := NULL,
171     p_effective_from            IN  DATE      := sysdate,
172     p_effective_to              IN  DATE      := NULL,
173     p_spec_assignment_type      IN  NUMBER    := qa_plans_pub.g_spec_type_none,
174     p_multirow_flag             IN  NUMBER    := 2,
175     x_plan_id                   OUT NOCOPY NUMBER,
176     x_msg_count                 OUT NOCOPY NUMBER,
177     x_msg_data                  OUT NOCOPY VARCHAR2,
178     x_return_status             OUT NOCOPY VARCHAR2);
179 
180 
181 --
182 -- API name        : add_plan_element
183 -- Type            : Public
184 -- Pre-reqs        : None
185 --
186 -- API to add a new element to an existing collection plan.
187 -- Version 1.0
188 --
189 -- This API adds a new element to an existing collection plan, most
190 -- probably, but not necessarily, created by create_collection_plan.
191 -- The user may call add_plan_element consecutively to add as many
192 -- collection elements as needed.  Afterwards, call
193 -- complete_plan_processing to finish the plan creation.
194 --
195 -- Database commit is never performed.
196 --
197 -- Parameters:
198 --
199 --  p_api_version                                           NUMBER
200 --     Should be 1.0
201 --
202 --  p_init_msg_list                                         VARCHAR2
203 --     Standard api parameter.  Indicates whether to
204 --     re-initialize the message list.
205 --     Default is fnd_api.g_false.
206 --
207 --  p_validation_level                                      NUMBER
208 --     Standard api parameter.  Indicates validation level.
209 --     Use the default fnd_api.g_valid_level_full.
210 --
211 --  p_user_name                                             VARCHAR2(100)
212 --     The user's name, as defined in fnd_user table.
213 --     This is used to record audit info in the WHO columns.
214 --     If the user accepts the default, then the API will
215 --     use fnd_global.user_id.
216 --
217 --  p_plan_name                                             VARCHAR2(30)
218 --     Plan name.  Automatically converted to upper case.
219 --
220 --  p_organization_code                                     VARCHAR2
221 --     Organization code.
222 --
223 --  p_element_name                                          VARCHAR2(30)
224 --     Name of the collection element to be added.
225 --     Mixed case.
226 --
227 --  p_prompt_sequence                                       NUMBER
228 --     The integer prompt sequence.
229 --     Default is NULL, which will auto-assign as the
230 --     last element.
231 --
232 --  p_prompt                                                VARCHAR2(30)
233 --     The prompt to appear as column heading.
234 --     Default is g_inherit, which will use the element's
235 --     prompt.
236 --
237 --  p_default_value                                         VARCHAR2(150)
238 --     Default value of the element.
239 --     Default is g_inherit, which will use the element's
240 --     default value.
241 --
242 --  p_enabled_flag                                          VARCHAR2
243 --     Enabled flag.
244 --     Valid values are fnd_api.g_true or fnd_api.g_false.
245 --     Default is fnd_api.g_true.
246 --
247 --  p_mandatory_flag                                        VARCHAR2
248 --     Mandatory flag.
249 --     Valid values are fnd_api.g_true or fnd_api.g_false
250 --     and g_inherit.
251 --     Default is g_inherit which will inherit the value
252 --     set up for the collection element.
253 --
254 --  p_displayed_flag                                        VARCHAR2
255 --     Display flag.  Specify whether this element will
256 --     be displayed during transaction entry form.
257 --     Valid values are fnd_api.g_true or fnd_api.g_false.
258 --     Default is fnd_api.g_true.
259 --
260 --  p_result_column_name                                    VARCHAR2
261 --     This parameter is intended for use by experienced
262 --     users who are familiar with the underlying QA data
263 --     model.  This parameter suggests a database column
264 --     in qa_results table for use as storage.  Most users
265 --     should simply accept the default value of NULL and
266 --     let the API selects a correct database column.
267 --
268 --  x_msg_count                                             OUT NUMBER
269 --     Standard api parameter.  Indicates no. of messages
270 --     put into the message stack.
271 --
272 --  x_msg_data                                              OUT VARCHAR2
273 --     Standard api parameter.  Messages returned.
274 --
275 --  x_return_status                                         OUT VARCHAR2
276 --     Standard api return status parameter.
277 --     Values: fnd_api.g_ret_sts_success,
278 --             fnd_api.g_ret_sts_error,
279 --             fnd_api.g_ret_sts_unexp_error.
280 --
281 --  Bug 3709284. Added three new flags for Read Only Plan elements
285 -- p_read_only_flag
282 --  description given below.
283 -- saugupta Mon, 21 Jun 2004 02:22:47 -0700 PDT
284 --
286 --     Read Only Flag. Specify whether this element will be
287 --     displayed as non editable and non updateable.
288 --     Valid values are fnd_api.g_true or fnd_api.g_false.
289 --     Default is NULL.
290 --
291 -- p_ss_poplist_flag
292 --     Display as poplist on Workbench. Displays the element
293 --     values as a poplist instead of default LOV for faster
294 --     working of wrokbench application.
295 --     Valid values are fnd_api.g_true or fnd_api.g_false.
296 --     Default is NULL.
297 --
298 -- p_information_flag
299 --    Information flag. Dispalys a information icon for the
300 --    element in workbench application.
301 --     Valid values are fnd_api.g_true or fnd_api.g_false.
302 --     Default is NULL.
303 --
304 -- saugupta Thu Aug 28 08:59:59 PDT 2003
305 --
306 /*#
307  * Add a new element to an existing collection plan
308  * @param p_api_version Should be 1.0
309  * @param p_init_msg_list Indicates whether to re-initialize the message list
310  * @param p_validation_level Indicates validation level
311  * @param p_user_name The user's name, as defined in fnd_user table
312  * @param p_plan_name Plan name, Automatically converted to upper case
313  * @param p_organization_code Organization code
314  * @param p_element_name Name of collection element to be added
315  * @param p_prompt_sequence Integer display sequence
316  * @param p_prompt Prompt to appear as column heading
317  * @param p_default_value Default value of the element
318  * @param p_enabled_flag Enabled Flag
319  * @param p_mandatory_flag Mandatory Flag
320  * @param p_displayed_flag Displayed Flag
321  * @param p_read_only_flag specifies whether this element is non updateable
322  * @param p_ss_poplist_flag displays element as poplist on Workbench
323  * @param p_information_flag displays element in Information column
324  * @param p_result_column_name Leave the default value of NULL as it is
325  * @param p_device_flag specifies whether there is a device attached to the element
326  * @param p_device_name is the device name as defined in Device Setup Page
327  * @param p_sensor_alias is the sensor alias as defined in Device Setup Page
328  * @param p_override_flag specifies whether the device enabled element is updatable
329  * @param x_msg_count Count of messages in message stack
330  * @param x_msg_data Messages returned
331  * @param x_return_status API Return Status
332  * @rep:displayname Add collection element to a plan
333  */
334 PROCEDURE add_plan_element(
335     p_api_version               IN  NUMBER,
336     p_init_msg_list             IN  VARCHAR2    := fnd_api.g_false,
337     p_validation_level          IN  NUMBER      := fnd_api.g_valid_level_full,
338     p_user_name                 IN  VARCHAR2    := NULL,
339     p_plan_name                 IN  VARCHAR2,
340     p_organization_code         IN  VARCHAR2,
341     p_element_name              IN  VARCHAR2,
342     p_prompt_sequence           IN  NUMBER      := NULL,
343     p_prompt                    IN  VARCHAR2    := g_inherit,
344     p_default_value             IN  VARCHAR2    := g_inherit,
345     p_enabled_flag              IN  VARCHAR2    := fnd_api.g_true,
346     p_mandatory_flag            IN  VARCHAR2    := g_inherit,
347     p_displayed_flag            IN  VARCHAR2    := fnd_api.g_true,
348     p_read_only_flag            IN  VARCHAR2    := NULL,
349     p_ss_poplist_flag           IN  VARCHAR2    := NULL,
350     p_information_flag          IN  VARCHAR2    := NULL,
351     p_result_column_name        IN  VARCHAR2    := NULL,
352     -- 12.1 Device Integration Project
353     -- bhsankar Mon Nov 12 05:51:37 PST 2007
354     p_device_flag               IN  VARCHAR2    := NULL,
355     p_device_name               IN  VARCHAR2    := NULL,
356     p_sensor_alias              IN  VARCHAR2    := NULL,
357     p_override_flag             IN  VARCHAR2    := NULL,
358     -- 12.1 Device Integration Project End.
359     x_msg_count                 OUT NOCOPY NUMBER,
360     x_msg_data                  OUT NOCOPY VARCHAR2,
361     x_return_status             OUT NOCOPY VARCHAR2);
362 
363 
364 --
365 -- API name        : complete_plan_processing
366 -- Type            : Public
367 -- Pre-reqs        : None
368 --
369 -- API to complete the plan processing.
370 -- Version 1.0
371 --
372 -- This API signals a completion of a collection plan definition.
373 -- This API is used generally after calling create_collection_plan
374 -- and a series of add_plan_element calls.
375 --
376 -- Parameters:
377 --
378 --  p_api_version                                           NUMBER
379 --     Should be 1.0
380 --
381 --  p_init_msg_list                                         VARCHAR2
382 --     Standard api parameter.  Indicates whether to
383 --     re-initialize the message list.
384 --     Default is fnd_api.g_false.
385 --
386 --  p_validation_level                                      NUMBER
387 --     Standard api parameter.  Indicates validation level.
388 --     Use the default fnd_api.g_valid_level_full.
389 --
390 --  p_user_name                                             VARCHAR2(100)
391 --     The user's name, as defined in fnd_user table.
392 --     This is used to record audit info in the WHO columns.
393 --     If the user accepts the default, then the API will
394 --     use fnd_global.user_id.
395 --
399 --  p_organization_code                                     VARCHAR2
396 --  p_plan_name                                             VARCHAR2(30)
397 --     Plan name.  Automatically converted to upper case.
398 --
400 --     Organization code.
401 --
402 --  p_commit                                                VARCHAR2
403 --     Indicates whether the API shall perform a
404 --     database commit.  Specify fnd_api.g_true or
405 --     fnd_api.g_false.
406 --     Default is fnd_api.g_false.
407 --
408 --     It is recommended a commit is performed (even
409 --     though the standard requires us to use g_false
410 --     as the default value.)  The dynamic plan views
411 --     generator can be executed only if the user commits.
412 --     Alternatively, you may launch the view generator
413 --     manually in the Setup Collection Plans form.
414 --
415 --  x_msg_count                                             OUT NUMBER
416 --     Standard api parameter.  Indicates no. of messages
417 --     put into the message stack.
418 --
419 --  x_msg_data                                              OUT VARCHAR2
420 --     Standard api parameter.  Messages returned.
421 --
422 --  x_return_status                                         OUT VARCHAR2
423 --     Standard api return status parameter.
424 --     Values: fnd_api.g_ret_sts_success,
425 --             fnd_api.g_ret_sts_error,
426 --             fnd_api.g_ret_sts_unexp_error.
427 --
428 /*#
429  * Complete processing of collection plan definition
430  * @param p_api_version Should be 1.0
431  * @param p_init_msg_list Indicates whether to re-initialize the message list
432  * @param p_validation_level Indicates validation level
433  * @param p_user_name The user's name, as defined in fnd_user table
434  * @param p_plan_name Plan name, Automatically converted to upper case
435  * @param p_organization_code Organization code
436  * @param p_commit Indicate if database commit should be performed
437  * @param x_msg_count Count of messages in message stack
438  * @param x_msg_data Messages returned
439  * @param x_return_status API Return Status
440  * @rep:displayname Complete the definition of collection plan
441  */
442 PROCEDURE complete_plan_processing(
443     p_api_version               IN  NUMBER,
444     p_init_msg_list             IN  VARCHAR2    := fnd_api.g_false,
445     p_validation_level          IN  NUMBER      := fnd_api.g_valid_level_full,
446     p_user_name                 IN  VARCHAR2    := NULL,
447     p_plan_name                 IN  VARCHAR2,
448     p_organization_code         IN  VARCHAR2,
449     p_commit                    IN  VARCHAR2    := fnd_api.g_false,
450     x_msg_count                 OUT NOCOPY NUMBER,
451     x_msg_data                  OUT NOCOPY VARCHAR2,
452     x_return_status             OUT NOCOPY VARCHAR2);
453 
454 
455 --
456 -- API name        : delete_collection_plan
457 -- Type            : Public
458 -- Pre-reqs        : None
459 --
460 -- API to delete an existing collection plan.
461 -- Version 1.0
462 --
463 -- This API deletes an existing collection plan and all its elements.
464 -- The user is prevented from deleting a plan if Quality results
465 -- have been collected.
466 --
467 -- Parameters:
468 --
469 --  p_api_version                                           NUMBER
470 --     Should be 1.0
471 --
472 --  p_init_msg_list                                         VARCHAR2
473 --     Standard api parameter.  Indicates whether to
474 --     re-initialize the message list.
475 --     Default is fnd_api.g_false.
476 --
477 --  p_validation_level                                      NUMBER
478 --     Standard api parameter.  Indicates validation level.
479 --     Use the default fnd_api.g_valid_level_full.
480 --
481 --  p_user_name                                             VARCHAR2(100)
482 --     The user's name, as defined in fnd_user table.
483 --     This is used to record audit info in the WHO columns.
484 --     If the user accepts the default, then the API will
485 --     use fnd_global.user_id.
486 --
487 --  p_plan_name                                             VARCHAR2(30)
488 --     Plan name.  Automatically converted to upper case.
489 --
490 --  p_organization_code                                     VARCHAR2
491 --     Organization code.
492 --
493 --  p_commit                                                VARCHAR2
494 --     Indicates whether the API shall perform a
495 --     database commit.  Specify fnd_api.g_true or
496 --     fnd_api.g_false.
497 --     Default is fnd_api.g_false.
498 --
499 --  x_msg_count                                             OUT NUMBER
500 --     Standard api parameter.  Indicates no. of messages
501 --     put into the message stack.
502 --
503 --  x_msg_data                                              OUT VARCHAR2
504 --     Standard api parameter.  Messages returned.
505 --
506 --  x_return_status                                         OUT VARCHAR2
507 --     Standard api return status parameter.
508 --     Values: fnd_api.g_ret_sts_success,
509 --             fnd_api.g_ret_sts_error,
510 --             fnd_api.g_ret_sts_unexp_error.
511 --
512 /*#
513  * Delete an existing collection plan
514  * @param p_api_version Should be 1.0
515  * @param p_init_msg_list Indicates whether to re-initialize the message list
516  * @param p_validation_level Indicates validation level
517  * @param p_user_name The user's name, as defined in fnd_user table
521  * @param x_msg_count Count of messages in message stack
518  * @param p_plan_name Plan name, Automatically converted to upper case
519  * @param p_organization_code Organization code
520  * @param p_commit Indicate if database commit should be performed
522  * @param x_msg_data Messages returned
523  * @param x_return_status API Return Status
524  * @rep:displayname Delete an existing collection plan
525  */
526 PROCEDURE delete_collection_plan(
527     p_api_version               IN  NUMBER,
528     p_init_msg_list             IN  VARCHAR2    := fnd_api.g_false,
529     p_validation_level          IN  NUMBER      := fnd_api.g_valid_level_full,
530     p_user_name                 IN  VARCHAR2    := NULL,
531     p_plan_name                 IN  VARCHAR2,
532     p_organization_code         IN  VARCHAR2,
533     p_commit                    IN  VARCHAR2    := fnd_api.g_false,
534     x_msg_count                 OUT NOCOPY NUMBER,
535     x_msg_data                  OUT NOCOPY VARCHAR2,
536     x_return_status             OUT NOCOPY VARCHAR2);
537 
538 
539 --
540 -- API name        : delete_plan_element
541 -- Type            : Public
542 -- Pre-reqs        : None
543 --
544 -- API to delete an element from an existing collection plan.
545 -- Version 1.0
546 --
547 -- This API deletes an element from a collection plan.  The user
548 -- is prevented to do this if Quality result has been collected
549 -- for that element.
550 --
551 -- Parameters:
552 --
553 --  p_api_version                                           NUMBER
554 --     Should be 1.0
555 --
556 --  p_init_msg_list                                         VARCHAR2
557 --     Standard api parameter.  Indicates whether to
558 --     re-initialize the message list.
559 --     Default is fnd_api.g_false.
560 --
561 --  p_validation_level                                      NUMBER
562 --     Standard api parameter.  Indicates validation level.
563 --     Use the default fnd_api.g_valid_level_full.
564 --
565 --  p_user_name                                             VARCHAR2(100)
566 --     The user's name, as defined in fnd_user table.
567 --     This is used to record audit info in the WHO columns.
568 --     If the user accepts the default, then the API will
569 --     use fnd_global.user_id.
570 --
571 --  p_plan_name                                             VARCHAR2(30)
572 --     Plan name.  Automatically converted to upper case.
573 --
574 --  p_organization_code                                     VARCHAR2
575 --     Organization code.
576 --
577 --  p_element_name                                          VARCHAR2(30)
578 --     The element to be deleted.  Mixed case.
579 --
580 --  p_commit                                                VARCHAR2
581 --     Indicates whether the API shall perform a
582 --     database commit.  Specify fnd_api.g_true or
583 --     fnd_api.g_false.
584 --     Default is fnd_api.g_false.
585 --
586 --  x_msg_count                                             OUT NUMBER
587 --     Standard api parameter.  Indicates no. of messages
588 --     put into the message stack.
589 --
590 --  x_msg_data                                              OUT VARCHAR2
591 --     Standard api parameter.  Messages returned.
592 --
593 --  x_return_status                                         OUT VARCHAR2
594 --     Standard api return status parameter.
595 --     Values: fnd_api.g_ret_sts_success,
596 --             fnd_api.g_ret_sts_error,
597 --             fnd_api.g_ret_sts_unexp_error.
598 --
599 /*#
600  * Delete an element from a collection plan
601  * @param p_api_version Should be 1.0
602  * @param p_init_msg_list Indicates whether to re-initialize the message list
603  * @param p_validation_level Indicates validation level
604  * @param p_user_name The user's name, as defined in fnd_user table
605  * @param p_plan_name Plan name, Automatically converted to upper case
606  * @param p_element_name Name of collection element to be deleted from plan
607  * @param p_organization_code Organization code
608  * @param p_commit Indicate if database commit should be performed
609  * @param x_msg_count Count of messages in message stack
610  * @param x_msg_data Messages returned
611  * @param x_return_status API Return Status
612  * @rep:displayname Delete an element from a collection plan
613  */
614 PROCEDURE delete_plan_element(
615     p_api_version               IN  NUMBER,
616     p_init_msg_list             IN  VARCHAR2    := fnd_api.g_false,
617     p_validation_level          IN  NUMBER      := fnd_api.g_valid_level_full,
618     p_user_name                 IN  VARCHAR2    := NULL,
619     p_plan_name                 IN  VARCHAR2,
620     p_organization_code         IN  VARCHAR2,
621     p_element_name              IN  VARCHAR2,
622     p_commit                    IN  VARCHAR2    := fnd_api.g_false,
623     x_msg_count                 OUT NOCOPY NUMBER,
624     x_msg_data                  OUT NOCOPY VARCHAR2,
625     x_return_status             OUT NOCOPY VARCHAR2);
626 
627 
628 --
629 -- API name        : copy_collection_plan
630 -- Type            : Public
631 -- Pre-reqs        : None
632 --
633 -- API to copy a collection plan.
634 -- Version 1.0
635 --
636 -- This API creates a new collection plan by copying the
637 -- definition of an existing collection plan or updates
638 -- an existing collection plan with additional elements
642 -- call complete_plan_processing to finish the plan creation.
639 -- copied from a source plan.  Should there be conflict
640 -- in the latter case, the new elements from the source
641 -- plan will not overwrite the existing elements.  Afterwards,
643 --
644 -- Database commit is never performed.
645 --
646 --
647 -- Parameters:
648 --
649 --  p_api_version                                           NUMBER
650 --     Should be 1.0
651 --
652 --  p_init_msg_list                                         VARCHAR2
653 --     Standard api parameter.  Indicates whether to
654 --     re-initialize the message list.
655 --     Default is fnd_api.g_false.
656 --
657 --  p_validation_level                                      NUMBER
658 --     Standard api parameter.  Indicates validation level.
659 --     Use the default fnd_api.g_valid_level_full.
660 --
661 --  p_user_name                                             VARCHAR2(100)
662 --     The user's name, as defined in fnd_user table.
663 --     This is used to record audit info in the WHO columns.
664 --     If the user accepts the default, then the API will
665 --     use fnd_global.user_id.
666 --
667 --  p_plan_name                                             VARCHAR2(30)
668 --     The source plan name.  Automatically converted
669 --     to upper case.
670 --
671 --  p_organization_code                                     VARCHAR2
672 --     Organization code.  Can be NULL for template plans.
673 --     Default is NULL.
674 --
675 --  p_to_plan_name                                          VARCHAR2(30)
676 --     The destination plan name.  Automatically converted
677 --     to upper case.
678 --
679 --  p_to_organization_code                                  VARCHAR2
680 --     The destination Organization code.
681 --
682 --  p_copy_actions_flag                                     VARCHAR2
683 --     Specifies whether to copy all actions associated
684 --     with each plan element.
685 --     Valid values are fnd_api.g_true or fnd_api.g_false.
686 --     Default is fnd_api.g_true.
687 --
688 --  p_copy_values_flag                                      VARCHAR2
689 --     Specifies whether to copy all lookup values
690 --     associated with each plan element.
691 --     Valid values are fnd_api.g_true or fnd_api.g_false.
692 --     Default is fnd_api.g_true.
693 --
694 --  p_copy_transactions_flag                                VARCHAR2
695 --     Specifies whether to copy all transactions and
696 --     collection triggers associated with each plan element.
697 --     Valid values are fnd_api.g_true or fnd_api.g_false.
698 --     Default is fnd_api.g_true.
699 --
700 --  p_commit                                                VARCHAR2
701 --     Indicates whether the API shall perform a
702 --     database commit.  Specify fnd_api.g_true or
703 --     fnd_api.g_false.
704 --     Default is fnd_api.g_false.
705 --
706 --  x_msg_count                                             OUT NUMBER
707 --     Standard api parameter.  Indicates no. of messages
708 --     put into the message stack.
709 --
710 --  x_msg_data                                              OUT VARCHAR2
711 --     Standard api parameter.  Messages returned.
712 --
713 --  x_return_status                                         OUT VARCHAR2
714 --     Standard api return status parameter.
715 --     Values: fnd_api.g_ret_sts_success,
716 --             fnd_api.g_ret_sts_error,
717 --             fnd_api.g_ret_sts_unexp_error.
718 --
719 /*#
720  * Create a new collection plan by copying definition of an existing collection plan
721  * @param p_api_version Should be 1.0
722  * @param p_init_msg_list Indicates whether to re-initialize the message list
723  * @param p_validation_level Indicates validation level
724  * @param p_user_name The user's name, as defined in fnd_user table
725  * @param p_plan_name Plan name, Automatically converted to upper case
726  * @param p_organization_code Organization code
727  * @param p_to_plan_name Destination plan name
728  * @param p_to_organization_code Destination organization code
729  * @param p_copy_actions_flag specifies whether to copy all plan element actions
730  * @param p_copy_values_flag specifies whether to copy all plan element lookup values
731  * @param p_copy_transactions_flag  specifies whether to copy all plan transactions
732  * @param p_commit Indicate if database commit should be performed
733  * @param x_to_plan_id New Plan ID that gets created automatically
734  * @param x_msg_count Count of messages in message stack
735  * @param x_msg_data Messages returned
736  * @param x_return_status API Return Status
737  * @rep:displayname Copy Collection Plan
738  */
739 PROCEDURE copy_collection_plan(
740     p_api_version               IN  NUMBER,
741     p_init_msg_list             IN  VARCHAR2    := fnd_api.g_false,
742     p_validation_level          IN  NUMBER      := fnd_api.g_valid_level_full,
743     p_user_name                 IN  VARCHAR2    := NULL,
744     p_plan_name                 IN  VARCHAR2,
745     p_organization_code         IN  VARCHAR2,
746     p_to_plan_name              IN  VARCHAR2,
747     p_to_organization_code      IN  VARCHAR2,
748     p_copy_actions_flag         IN  VARCHAR2    := fnd_api.g_true,
749     p_copy_values_flag          IN  VARCHAR2    := fnd_api.g_true,
750     p_copy_transactions_flag    IN  VARCHAR2    := fnd_api.g_true,
751     p_commit                    IN  VARCHAR2    := fnd_api.g_false,
752     x_to_plan_id                OUT NOCOPY NUMBER,
753     x_msg_count                 OUT NOCOPY NUMBER,
754     x_msg_data                  OUT NOCOPY VARCHAR2,
755     x_return_status             OUT NOCOPY VARCHAR2);
756 
757 
758 FUNCTION get_plan_type (p_lookup_code IN VARCHAR2) RETURN VARCHAR2;
759 
760 -- Function to get the Plan View name
761 FUNCTION get_plan_view_name(p_name VARCHAR2) RETURN VARCHAR2;
762 
763 -- Function to get the Import view name
764 FUNCTION get_import_view_name(p_name VARCHAR2) RETURN VARCHAR2;
765 
766 END qa_plans_pub;
767 
768 
769