DBA Data[Home] [Help]

PACKAGE: APPS.CS_SERVICEREQUEST_PUB

Source


1 PACKAGE CS_ServiceRequest_PUB AS
2 /* $Header: cspsrs.pls 120.9 2008/01/24 10:08:53 nveerara ship $ */
3 /*#
4  * You can use this public interface  to create and update a service request.
5  * This interface applies to all service request business rules.
6  *
7  * @rep:scope public
8  * @rep:product CS
9  * @rep:displayname Service Request Processing
10  * @rep:lifecycle active
11  * @rep:compatibility S
12  * @rep:category BUSINESS_ENTITY CS_SERVICE_REQUEST
13  */
14 
15 /**** Above text has been added to enable the integration repository to extract the data from
16       the source code file and populate the integration repository schema so that the interfaces
17       defined in this package appears in the integration repository.
18 ****/
19 
20 TYPE notes_rec IS RECORD (
21     NOTE                            VARCHAR2(2000)  := FND_API.G_MISS_CHAR,
22     NOTE_DETAIL                     VARCHAR2(32767) := FND_API.G_MISS_CHAR,
23     NOTE_TYPE                       VARCHAR2(240)   := FND_API.G_MISS_CHAR,
24     NOTE_CONTEXT_TYPE_01            VARCHAR2(30)    := FND_API.G_MISS_CHAR,
25     NOTE_CONTEXT_TYPE_ID_01         NUMBER          := FND_API.G_MISS_NUM,
26     NOTE_CONTEXT_TYPE_02            VARCHAR2(30)    := FND_API.G_MISS_CHAR,
27     NOTE_CONTEXT_TYPE_ID_02         NUMBER          := FND_API.G_MISS_NUM,
28     NOTE_CONTEXT_TYPE_03            VARCHAR2(30)    := FND_API.G_MISS_CHAR,
29     NOTE_CONTEXT_TYPE_ID_03         NUMBER          := FND_API.G_MISS_NUM
30 
31 );
32 TYPE notes_table IS TABLE OF notes_rec INDEX BY BINARY_INTEGER;
33 
34 -----------------------------------------------------------------------
35 -- Start of comments
36 --  Record Type     : notes_rec
37 --  Description     : Holds the Notes attributes for the
38 --                    Creating records in JTF_NOTES_B
39 --  Fields     :
40 
41 --  NOTE              OPTIONAL
42 
43 --  NOTE_DETAIL       OPTIONAL
44 
45 --  NOTE_TYPE         OPTIONAL
46 --  VAlid values are SR_PROBLEM and SR_RESOLUTION
47 
48 -- NOTE_CONTEXT_TYPE_01  OPTIONAL
49 -- VAlid value is 'SR'
50 
51 -- NOTE_CONTEXT_TYPE_ID_01   OPTIONAL
52 -- VAlid incident_id from cs_incidents_all_b
53 
54 --    NOTE_CONTEXT_TYPE_02
55 -- VAlid value is 'SR'
56 
57 --   NOTE_CONTEXT_TYPE_ID_02
58 -- VAlid incident_id from cs_incidents_all_b
59 
60 --    NOTE_CONTEXT_TYPE_03
61 -- VAlid value is 'SR'
62 
63 
64 --    NOTE_CONTEXT_TYPE_ID_03
65 -- VAlid incident_id from cs_incidents_all_b
66 -------------------------------------------------------------------
67 
68 --
69 --This table will hold the contacts and contact information
70 --for a Service Request customer
71 --
72 TYPE contacts_rec IS RECORD (
73    SR_CONTACT_POINT_ID            NUMBER         := FND_API.G_MISS_NUM,
74    PARTY_ID                       NUMBER         := FND_API.G_MISS_NUM,
75    CONTACT_POINT_ID               NUMBER         := FND_API.G_MISS_NUM,
76    CONTACT_POINT_TYPE             VARCHAR2(30)   := FND_API.G_MISS_CHAR,
77    PRIMARY_FLAG                   VARCHAR2(1)    := FND_API.G_MISS_CHAR,
78    CONTACT_TYPE                   VARCHAR2(30)   := FND_API.G_MISS_CHAR,
79    party_role_code                VARCHAR2(30)   := FND_API.G_MISS_CHAR,
80    start_date_active              DATE           := FND_API.G_MISS_DATE,
81    end_date_active                DATE           := FND_API.G_MISS_DATE
82 );
83 
84 TYPE contacts_table IS TABLE OF contacts_rec INDEX BY BINARY_INTEGER;
85 
86 -----------------------------------------------------------------------
87 -- Start of comments
88 --  Record Type     : contacts_rec
89 --  Description     : Holds the Contacts attributes for the
90 --                    Creating records in CS_HZ_SR_CONTACT_POINTS
91 --  Fields     :
92 --
93 --  sr_contact_point_id         OPTIONAL
94 --  can be specified only if you waNt to update an existing
95 --  record(when called from Update_ServiceRequest API)
96 
97 --  party_id                    REQUIRED
98 --  Valid party id from HZ_PARTIES
99 
100 --  contact_point_id            OPTIONAL
101 --  VAlid contact_point_id from HZ_CONTACT_POINTS
102 
103 --  contact_point_type           OPTIONAL
104 --  From AR_LOOKUPS where lookup_type = 'COMMUNICATION_TYPE'
105 --  and 'PHONE_LINE_TYPE'
106 
107 --  primary_flag                OPTIONAL
108 --  At least one record in the table should have this flag set to Y
109 
110 --  contact_type                REQUIRED
111 --  Valid values are 'PERSON" and 'EMPLOYEE'
112 
113 --------------------------------------------------------
114 
115 TYPE service_request_rec_type IS RECORD (
116      request_date               DATE,
117      type_id                    NUMBER,
118      type_name                  VARCHAR2(30),
119      status_id                  NUMBER,
120      status_name                VARCHAR2(30),
121      severity_id                NUMBER,
122      severity_name              VARCHAR2(30),
123      urgency_id                 NUMBER,
124      urgency_name               VARCHAR2(30),
125      closed_date                DATE,
126      owner_id                   NUMBER,
127      owner_group_id             NUMBER,
128      publish_flag               VARCHAR2(1),
129      summary                    VARCHAR2(240),
130      caller_type                VARCHAR2(30),
131      customer_id                NUMBER,
132      customer_number            VARCHAR2(30),
133      employee_id                NUMBER,
134      employee_number            VARCHAR2(30),
135      verify_cp_flag             VARCHAR2(1),
136      customer_product_id        NUMBER,
137      platform_id                NUMBER,
138      platform_version		VARCHAR2(250),
139      db_version			VARCHAR2(250),
140      platform_version_id        NUMBER,
141      cp_component_id            NUMBER,
142      cp_component_version_id    NUMBER,
143      cp_subcomponent_id         NUMBER,
144      cp_subcomponent_version_id NUMBER,
145      language_id                NUMBER,
146      language                   VARCHAR2(4),
147      cp_ref_number              NUMBER, -- 3840658
148      inventory_item_id          NUMBER,
149      inventory_item_conc_segs   VARCHAR2(800),
150      inventory_item_segment1    VARCHAR2(200),
151      inventory_item_segment2    VARCHAR2(200),
152      inventory_item_segment3    VARCHAR2(200),
153      inventory_item_segment4    VARCHAR2(200),
154      inventory_item_segment5    VARCHAR2(200),
155      inventory_item_segment6    VARCHAR2(200),
156      inventory_item_segment7    VARCHAR2(200),
157      inventory_item_segment8    VARCHAR2(200),
158      inventory_item_segment9    VARCHAR2(200),
159      inventory_item_segment10   VARCHAR2(200),
160      inventory_item_segment11   VARCHAR2(200),
161      inventory_item_segment12   VARCHAR2(200),
162      inventory_item_segment13   VARCHAR2(200),
163      inventory_item_segment14   VARCHAR2(200),
164      inventory_item_segment15   VARCHAR2(200),
165      inventory_item_segment16   VARCHAR2(200),
166      inventory_item_segment17   VARCHAR2(200),
167      inventory_item_segment18   VARCHAR2(200),
168      inventory_item_segment19   VARCHAR2(200),
169      inventory_item_segment20   VARCHAR2(200),
170      inventory_item_vals_or_ids VARCHAR2(1),
171      inventory_org_id           NUMBER,
172      current_serial_number      VARCHAR2(30),
173      original_order_number      NUMBER,
174      purchase_order_num         VARCHAR2(50),
175      problem_code               VARCHAR2(50),
176      exp_resolution_date        DATE,
177      install_site_use_id        NUMBER,
178      request_attribute_1        VARCHAR2(150),
179      request_attribute_2        VARCHAR2(150),
180      request_attribute_3        VARCHAR2(150),
181      request_attribute_4        VARCHAR2(150),
182      request_attribute_5        VARCHAR2(150),
183      request_attribute_6        VARCHAR2(150),
184      request_attribute_7        VARCHAR2(150),
185      request_attribute_8        VARCHAR2(150),
186      request_attribute_9        VARCHAR2(150),
187      request_attribute_10       VARCHAR2(150),
188      request_attribute_11       VARCHAR2(150),
189      request_attribute_12       VARCHAR2(150),
190      request_attribute_13       VARCHAR2(150),
191      request_attribute_14       VARCHAR2(150),
192      request_attribute_15       VARCHAR2(150),
193      request_context            VARCHAR2(30),
194      external_attribute_1       VARCHAR2(150),
195      external_attribute_2       VARCHAR2(150),
196      external_attribute_3       VARCHAR2(150),
197      external_attribute_4       VARCHAR2(150),
198      external_attribute_5       VARCHAR2(150),
199      external_attribute_6       VARCHAR2(150),
200      external_attribute_7       VARCHAR2(150),
201      external_attribute_8       VARCHAR2(150),
202      external_attribute_9       VARCHAR2(150),
203      external_attribute_10      VARCHAR2(150),
204      external_attribute_11      VARCHAR2(150),
205      external_attribute_12      VARCHAR2(150),
206      external_attribute_13      VARCHAR2(150),
207      external_attribute_14      VARCHAR2(150),
208      external_attribute_15      VARCHAR2(150),
209      external_context           VARCHAR2(30),
210      bill_to_site_use_id        NUMBER,
211      bill_to_contact_id         NUMBER,
212      ship_to_site_use_id        NUMBER,
213      ship_to_contact_id         NUMBER,
214      resolution_code            VARCHAR2(50),
215      act_resolution_date        DATE,
216      public_comment_flag        VARCHAR2(1),
217      parent_interaction_id      NUMBER,
218      contract_service_id        NUMBER,
219      contract_service_number    VARCHAR2(150),
220      contract_id                NUMBER,
221      project_number             VARCHAR2(120),
222      qa_collection_plan_id      NUMBER,
223      account_id                 NUMBER,
224      resource_type              VARCHAR2(30),
225      resource_subtype_id        NUMBER,
226      cust_po_number             VARCHAR2(50),
227      cust_ticket_number         VARCHAR2(50),
228      sr_creation_channel        VARCHAR2(50),
229      obligation_date            DATE,
230      time_zone_id               NUMBER,
231      time_difference            NUMBER,
232      site_id                    NUMBER,
233      customer_site_id           NUMBER,
234      territory_id               NUMBER,
235      initialize_flag            VARCHAR2(1),
236      cp_revision_id             NUMBER,
237      inv_item_revision          VARCHAR2(240),
238      inv_component_id           NUMBER,
239      inv_component_version      VARCHAR2(90),
240      inv_subcomponent_id        NUMBER,
241      inv_subcomponent_version   VARCHAR2(90),
242 ------jngeorge---------------07/12/01
243      tier                       VARCHAR2(250),
244      tier_version               VARCHAR2(250),
245      operating_system           VARCHAR2(250),
246      operating_system_version   VARCHAR2(250),
247      database                   VARCHAR2(250),
248      cust_pref_lang_id          NUMBER,
249      category_id                NUMBER,
250      group_type                 VARCHAR2(30),
251      group_territory_id         NUMBER,
252      inv_platform_org_id        NUMBER,
253      component_version          VARCHAR2(3),
254      subcomponent_version       VARCHAR2(3),
255      product_revision           VARCHAR2(240),
256      comm_pref_code             VARCHAR2(30),
257      ---- Added for Post 11.5.6 Enhancement
258      cust_pref_lang_code        VARCHAR2(4),
259      -- Changed the width from 10 to 30 for last_update_channel for bug 2688856
260      -- shijain 3rd dec 2002
261      last_update_channel        VARCHAR2(30),
262      category_set_id            NUMBER,
263      external_reference         VARCHAR2(30),
264      system_id                  NUMBER,
265 ------jngeorge---------------07/12/01
266      error_code                 VARCHAR2(250),
267      incident_occurred_date     DATE,
268      incident_resolved_date     DATE,
269      inc_responded_by_date      DATE,
270      resolution_summary         VARCHAR2(250),
271      incident_location_id       NUMBER,
272      incident_address           VARCHAR2(960),
273      incident_city              VARCHAR2(60),
274      incident_state             VARCHAR2(60),
275      incident_country           VARCHAR2(60),
276      incident_province          VARCHAR2(60),
277      incident_postal_code       VARCHAR2(60),
278      incident_county            VARCHAR2(60),
279   -- Added for Enh# 2216664
280      owner                      VARCHAR2(360),
281      group_owner                VARCHAR2(60),
282   -- Added for Credit Card ER# 2255263 (UI ER#2208078)
283      cc_number                  VARCHAR2(48),
284      cc_expiration_date         DATE,
285      cc_type_code               VARCHAR(30),
286      cc_first_name              VARCHAR(250),
287      cc_last_name               VARCHAR(250),
288      cc_middle_name             VARCHAR(250),
289      cc_id                      NUMBER  ,
290      bill_to_account_id         NUMBER,         -- ER# 2433831
291      ship_to_account_id         NUMBER,         -- ER# 2433831
292      customer_phone_id   	NUMBER,         -- ER# 2463321
293      customer_email_id   	NUMBER,         -- ER# 2463321
294      -- Added for source changes for 1159 by shijain oct 11 2002
295      creation_program_code      VARCHAR2(30),
296      last_update_program_code   VARCHAR2(30),
297      -- Bill_to_party, ship_to_party
298      bill_to_party_id           NUMBER,
299      ship_to_party_id           NUMBER,
300      -- Conc request related fields
301      program_id                 NUMBER,
302      program_application_id     NUMBER,
303      conc_request_id            NUMBER, -- Renamed so that it doesn't clash with SR id
304      program_login_id           NUMBER,
305      -- Bill_to_site, ship_to_site
306      bill_to_site_id           NUMBER,
307      ship_to_site_id           NUMBER,
308      -- Added address related columns by shijain 4th dec 2002
309      incident_point_of_interest        Varchar2(240) ,
310      incident_cross_street             Varchar2(240) ,
311      incident_direction_qualifier      Varchar2(30),
312      incident_distance_qualifier       Varchar2(240) ,
313      incident_distance_qual_uom        Varchar2(30),
314      incident_address2                 Varchar2(240) ,
315      incident_address3                 Varchar2(240),
316      incident_address4                 Varchar2(240) ,
317      incident_address_style            Varchar2(30),
318      incident_addr_lines_phonetic      Varchar2(560) ,
319      incident_po_box_number            Varchar2(50) ,
320      incident_house_number             Varchar2(50),
321      incident_street_suffix            Varchar2(50) ,
322      incident_street                   Varchar2(150),
323      incident_street_number            Varchar2(50) ,
324      incident_floor                    Varchar2(50) ,
325      incident_suite                    Varchar2(50) ,
326      incident_postal_plus4_code        Varchar2(30) ,
327      incident_position                 Varchar2(50) ,
328      incident_location_directions      Varchar2(640),
329      incident_location_description     Varchar2(2000) ,
330      install_site_id                   NUMBER,
331      ------anmukher---------------07/31/03
332      -- Added for CMRO-EAM project of Release 11.5.10
333      item_serial_number			VARCHAR2(30),
334      owning_department_id		NUMBER,
335      -- Added for Misc ERs project of Release 11.5.10
336      -- Changed the default value to 'HZ_LOCATION' --anmukher --09/05/03
337      incident_location_type		VARCHAR2(30) Default 'HZ_LOCATION' ,
338      coverage_type                     VARCHAR2(30),    -- Addedd on 09/09/03 spusegao
339      maint_organization_id             NUMBER,
340      creation_date                     DATE,
341      created_by                        NUMBER
342      );
343 
344 ----------anmukher--------------07/31/03
345 -- Added new record type for OUT parameters of Create API
346 -- so that future overloading of the API can be avoided
347 TYPE sr_create_out_rec_type IS RECORD
348 (
349   request_id			NUMBER,
350   request_number		VARCHAR2(64),
351   interaction_id		NUMBER,
355   individual_type		VARCHAR2(30),
352   workflow_process_id		NUMBER,
353   individual_owner		NUMBER,
354   group_owner			NUMBER,
356   auto_task_gen_status		VARCHAR2(3),
357   auto_task_gen_attempted	BOOLEAN Default FALSE,
358   field_service_task_created	BOOLEAN,
359   contract_service_id		NUMBER,
360   resolve_by_date		DATE,
361   respond_by_date		DATE,
362   resolved_on_date		DATE,
363   responded_on_date		DATE
364   );
365 
366 -- Added new record type for OUT parameters of Update API
367 -- so that future overloading of the API can be avoided
368 TYPE sr_update_out_rec_type IS RECORD
369 ( interaction_id        NUMBER
370 , workflow_process_id   NUMBER
371 , individual_owner      NUMBER
372 , group_owner           NUMBER
373 , individual_type       VARCHAR2(30)
374 , resolved_on_date      DATE
375 , responded_on_date     DATE
376 , status_id             NUMBER
377 , close_date            DATE
378 );
379 
380 -- Added a new record structure for extensible attributes header information
381 -- R12 functionality
382 -----------------------------------------------------------------------
383 -- Start of comments
384 --  Record Type     : ext_attr_grp_rec_type
385 --  Description     : Holds the Attribute Group, Primary Keys and context information for
386 --                    a business object
387 --  Fields     :
388 --
389 --  Row_identifier       REQUIRED
390 --  is the unique numeric identifier for this attribute
391 --  group row within a set of rows to be processed; no two EXT_ATTR_GRP_REC_TYPE
392 --  elements in any single API call can share the same ROW_IDENTIFIER value.
393 
394 --  pk_column_1          REQUIRED
395 --  Primary Key Identifier 1: This column maps to INCIDENT_ID in the CS_INCIDENTS_ALL_B for both
396 --  Service Request and Party Roles Extensible Attributes implementation
397 
398 --  pk_column_2          OPTIONAL
399 --  Primary Key Identifier 2: This column maps to PARTY_ID in the CS_SHZ_SR_CONTACT_POINTS table.
400 --  This should be null for Service Request Extensible Attributes.
401 --  This is REQUIRED for Party Roles Extensible Attributes.
402 
403 --  pk_column_3          OPTIONAL
404 --  Primary Key Identifier 3: This column maps to CONTACT_TYPE in the CS_SHZ_SR_CONTACT_POINTS table.
405 --  This should be null for Service Request Extensible Attributes.
406 --  This is REQUIRED for Party Roles Extensible Attributes.
407 
408 --  pk_column_4          OPTIONAL
409 --  Primary Key Identifier 4: This column maps to PARTY_ROLE_CODE in the CS_SHZ_SR_CONTACT_POINTS table.
410 --  This should be null for Service Request Extensible Attributes.
411 --  This is REQUIRED for Party Roles Extensible Attributes.
412 
413 --  pk_column_5          OPTIONAL
414 --  Primary Key Identifier 5: This column is for future use.  Currently it is not mapped to any Primary Key Identifier.
415 
416 --  context              REQUIRED
417 --  This is the classification for the business object:
418 --  For Service Request Business Object valid values are -1 or a valid SR Type ID
419 --  For Party Roles Business Object valid value a valid Party Role Code
420 
421 --  object_name          REQUIRED
422 --  Object Name for Object from FND_OBJECTS table
423 --  For Service Request Business Object valid value is 'CS_SR'
424 --  For Party Roles Business Object valid value is 'CS_PR'
425 
426 --  attr_group_id        OPTIONAL
427 --  Numeric Identifier for Attribute Group.  This is required for both the SR and PR Extensible Attributes implementation.
428 --  This is REQUIRED if the composite key comprising of attr_group_app_id, attr_group_type, attr_group_name IS NULL.
429 
430 --  attr_group_app_id    OPTIONAL
431 --  The value for this is 170 for the Service Request Module.  REQUIRED if attribute_group_id is NULL.
432 
433 --  attr_group_type      OPTIONAL
434 --  This is the descriptive flex seeded for implementing Extensible Attributes.  REQUIRED if attribute_group_id is NULL.
435 --  Service Request Extensible Attributes this value equals 'CS_SR_CONTEXT'
436 --  Party Roles Extensible Attributes this value equals 'CS_PR_CONTEXT'
437 
438 --  attr_group_name      OPTIONAL
439 --  This is a unique name for the attribute group.  REQUIRED if attribute_group_id is NULL.
440 
441 --  attr_group_disp_name            REQUIRED
442 --  This is the Attrbute Group Display (or user friendly) name.
443 
444 --  mapping_req          OPTIONAL
445 --  If the attributes sent through the attributes child table uses database columns instead of attribute_name then
446 --  this flag should be set to 'Y', else this flag should be 'N'.
447 
448 --  operation            REQUIRED
449 --  Valid operations are 'CREATE', 'UPDATE'.  The 'DELETE' operation is only handled through the HTML Service UI
450 
451 --------------------------------------------------------
452 
453 TYPE EXT_ATTR_GRP_REC_TYPE IS RECORD
454 ( row_identifier       number
455 , pk_column_1          varchar2(150)
456 , pk_column_2          varchar2(150)
457 , pk_column_3          varchar2(150)
458 , pk_column_4          varchar2(150)
459 , pk_column_5          varchar2(150)
460 , context              varchar2(150)
461 , object_name          varchar2(30)
462 , attr_group_id        number
463 , attr_group_app_id    number
464 , attr_group_type      varchar2(40)
465 , attr_group_name      varchar2(30)
466 , attr_group_disp_name varchar2(150)
467 , mapping_req          varchar2(1)
471 TYPE EXT_ATTR_GRP_TBL_TYPE IS TABLE OF EXT_ATTR_GRP_REC_TYPE INDEX BY BINARY_INTEGER;
468 , operation            varchar2(30)
469    );
470 
472 
473 
474 -- Added a new record structure for extensible attributes child information
475 -- R12 functionality
476 -----------------------------------------------------------------------
477 -- Start of comments
478 --  Record Type     : EXT_ATTR_REC_TYPE
479 --  Description     : This record structure holds data for one  attribute in an attribute group row
480 --  Fields     :
481 --
482 --  Row_identifier         REQUIRED
483 --  This is a foriegn key that associates the Attribute Group in the EXT_ATTR_GRP_REC_TYPE structure to the Attribute in
484 --  the EXT_ATTR_REC_TYPE structure .
485 
486 --  Column_name            OPTIONAL
487 --  This maps top the database column name that is setup for the attribute being passed.  If the user is using
488 --  this column to pass attribute information to Service then the MAPPING_REQ in the EXT_ATTR_GRP_REC_TYPE structure needs to be set to 'Y'
489 --  This is REQUIRED if Attr_Name is NULL
490 
491 --  Attr_name              OPTIONAL
492 --  This holds the internal name of the attribute. This is REQUIRED if Column_name is NULL.
493 
494 --  ATTR_DISP_NAME         OPTIONAL
495 --  This holds the display value or user friendly name of the Attribute
496 
497 --  ATTR_VALUE_STR         OPTIONAL
498 --  The value being passed for the attribute is stored in ATTR_VALUE_STR if
499 --  the attribute is a string.  This attribute is mutually exclusive to ATTR_VALUE_NUM,
500 --  ATTR_VALUE_DATE, ATTR_VALUE_DISPLAY.  At any time only one of these fields should be populated
501 
502 --  ATTR_VALUE_NUM         OPTIONAL
503 --  The value being passed for the attribute is stored in ATTR_VALUE_NUM if
504 --  the attribute is a Number.  This attribute is mutually exclusive to ATTR_VALUE_STR,
505 --  ATTR_VALUE_DATE, ATTR_VALUE_DISPLAY.  At any time only one of these fields should be populated
506 
507 --  ATTR_VALUE_DATE        OPTIONAL
508 --  The value being passed for the attribute is stored in ATTR_VALUE_DATE if
509 --  the attribute is a Date.  This attribute is mutually exclusive to ATTR_VALUE_NUM,
510 --  ATTR_VALUE_STR, ATTR_VALUE_DISPLAY.  At any time only one of these fields should be populated
511 
512 
513 --  ATTR_VALUE_DISPLAY     OPTIONAL
514 --  The value being passed for the attribute is stored in ATTR_VALUE_DISPLAY
515 --  if the attribute has a value set with distinct internal and display values
516 --  This attribute is mutually exclusive to ATTR_VALUE_NUM, ATTR_VALUE_DATE, ATTR_VALUE_STR.
517 --  At any time only one of these fields should be populated
518 
519 
520 --  ATTR_UNIT_OF_MEASURE   OPTIONAL
521 --  If the attribute is a number that has a Unit of Measure class associated
522 --  with it, ATTR_UNIT_OF_MEASURE stores the UOM Code for the Unit of Measure
523 --  in which the attribute's value will be displayed; however, the value
524 --  itself will always be passed in ATTR_VALUE_NUM in the base units for
525 --  the Unit of Measure class, not in the display units (unless they happen
526 --  to be the same).  For example, consider an attribute whose Unit of
527 --  Measure class is Length (a UOM Class whose base unit we will assume for
528 --  this example to be Centimeters).  If the caller wants data for this
529 --  attribute to be displayed in Feet (assuming its UOM_CODE is 'FT'),
530 --  then ATTR_UNIT_OF_MEASURE should be passed with 'FT'; however, no
531 --  matter in what unit the caller wants to display this attribute, the
532 --  value in ATTR_VALUE_NUM will always be the attribute's value as
533 --  expressed in Centimeters.
534 
535 --------------------------------------------------------
536 
537 TYPE EXT_ATTR_REC_TYPE IS RECORD
538 (row_identifier        number
539 , column_name          varchar2(30)
540 , attr_name            varchar2(150)
541 , attr_disp_name       varchar2(150)
542 , attr_value_str       varchar2(4000)
543 , attr_value_num       number
544 , attr_value_date      date
545 , attr_value_display   varchar2(4000)
546 , attr_unit_of_measure varchar2(3)
547     );
548 
549 TYPE EXT_ATTR_TBL_TYPE IS TABLE OF EXT_ATTR_REC_TYPE INDEX BY BINARY_INTEGER;
550 
551 
552 -- Added new table type for Security project of 11.5.10 --anmukher --08/18/03
553 -- This table type will be used to pass in and receive a table of resource IDs
554 -- in the new security procedure Validate_Resource
555 
556 TYPE Resource_Validate_Tbl_Type IS TABLE OF NUMBER
557 INDEX BY BINARY_INTEGER;
558 
559 PROCEDURE initialize_rec(
560   p_sr_record                   IN OUT NOCOPY service_request_rec_type
561 );
562 
563 -- Added for Credit Card ER# 2255263 (UI ER#2208078)
564 -- Added for encoding/decoding in Base64. Used for Credit Card
565 -- encoding / decoding
566 
567    TYPE vc2_table IS TABLE OF VARCHAR2(1) INDEX BY BINARY_INTEGER;
568    map  vc2_table;
569 
570 --------------------------------------------------------------------------
571 -- Start of comments
572 --  API name	: Create_ServiceRequest
573 --  Type	: Public
574 --  Function	: Creates a service request in the table CS_INCIDENTS_ALL.
575 --  Pre-reqs	: None.
576 --
577 --  Standard IN Parameters:
578 --	p_api_version			IN	NUMBER		Required
579 --	p_init_msg_list			IN	VARCHAR2	Optional
580 --		Default = FND_API.G_FALSE
581 --	p_commit			IN	VARCHAR2	Optional
582 --		Default = FND_API.G_FALSE
583 --
584 --  Standard OUT Parameters:
588 --
585 --	x_return_status			OUT	VARCHAR2(1)
586 --	x_msg_count			OUT	NUMBER
587 --	x_msg_data			OUT	VARCHAR2(2000)
589 --  Service Request IN Parameters:
590 --	p_resp_appl_id			IN	NUMBER		Optional
591 --		Application identifier
592 --	p_resp_id			IN	NUMBER		Optional
593 --		Responsibility identifier
594 --	p_user_id			IN	NUMBER	        Optional
595 --		Application user identifier
596 --	p_login_id			IN	NUMBER		Optional
597 --		Login session identifier
598 --	p_org_id			IN	NUMBER		Optional
599 --		Operating unit identifier
600 --		Required if Multi-Org is enabled.
601 --		Ignored if Multi-Org is disabled.
602 --      p_request_id                    IN      NUMBER          Optional
603 --
604 --      p_request_number                IN      VARCHAR2        Optional
605 --
606 --      p_service_request_rec           IN     service_request_rec_type   Required
607 --
608 --      p_notes                         IN     notes_table      Optional
609 --
610 --
611 --      p_contacts                      IN     contacts_table   Required if CALLER TYPE IS
612 --                                                              ORGANIZATION OR PERSON
613 
614 --
615 --
616 
617 --------------------------------------------------------------------------
618 --  This parameter is no longer present in the PUBLIC API. The workflow
619 --  is always launched based on the autolaunch flag in the INCIDENT TYPES table
620 
621 --  Workflow IN parameters:
622 --	p_launch_workflow		IN	VARCHAR2(1)	Optional
623 --		If set to TRUE, the API will call the Workflow API to launch
624 --		a workflow process for this service request.
625 
626 --------------------------------------------------------------------------
627 --
628 --  Service Request OUT parameters:
629 --	x_request_id			OUT	NUMBER
630 --		System generated ID of service request.
631 --	x_request_number		OUT	VARCHAR2(64)
632 --		User-visible number of service request.
633 --
634 --
635 --  x_interaction_id                    OUT     NUMBER
636 --
637 --
638 
639 --------------------------------------------------------------------------
640 --
641 
642 --  Workflow OUT parameters:
643 --  x_workflow_process_id               OUT      NUMBER
644 ---------------------------------------------------------------------------------------
645 
646 
647 --  Calls IN parameters:
648 --	p_comments			IN	VARCHAR2(2000)	Optional
649 --		Service request comments or log of the conversation.
650 --	p_public_comment_flag		IN	VARCHAR2(1)	Optional
651 --		DEFAULT = FND_API.G_FALSE
652 --		Indicate whether the service request comment is public (can be
653 --		viewed by anyone).
654 --
655 --  Calls OUT parameters:
656 --	p_call_id			OUT	NUMBER
657 --		System generated ID of service request call.
658 --
659 --  Version : Initial version	1.0
660 -----------------------------------------------------------------------
661 -- Start of comments
662 --  Record Type     : Service_Request_Rec_Type
663 --  Description     : Holds the Service Request attributes for the
664 --                    Create_ServiceRequest Procedure.
665 --  Fields     :
666 --
667 --  The following fields are defaulted to the profile values if not
668 --  passed in the record type :
669 --  request_date, type_id, status_id, severity_id, urgency_id,
670 --  owner_id, resource_type
671 
672 --
673 --	request_date				DATE		Optional
674 --		Service request date. Must be non-null.
675 
676 --	type_id				       NUMBER		Optional
677 --		Service request type identifier. Must be non-null.
678 --   VAlid incident_type_id from cs_incident_types
679 
680 
681 --	type_name				VARCHAR2(30)	Optional
682 --		Service request type name.
683 
684 --	status_id				NUMBER		Optional
685 --		Service request status identifier. Must be non-null.
686 --   Valid incident_status_id  from cs_incident_statuses
687 
688 --	status_name				VARCHAR2(30)	Optional
689 --		Service request status name.
690 
691 --	severity_id				NUMBER		Optional
692 --		Service request severity identifier. Must be non-null.
693 --   Valid incident_severity_id from cs_incident_severities
694 
695 --	severity_name				VARCHAR2(30)	Optional
696 --		Service request severity name.
697 
698 --	urgency_id				NUMBER		Optional
699 --		Service request urgency identifier.
700 --   Valid incident_urgency_id  from cs_incident_urgencies
701 
702 
703 --	urgency_name				VARCHAR2(30)	Optional
704 --		Service request urgency name.
705 
706 --	closed_date				DATE		Optional
707 --		Service request closed date.
708 --		Ignored if the status is not a "closed" status.
709 
710 --	owner_id				NUMBER		Optional
711 --		Service request owner identifier. Must be non-null.
712 --   Valid resource_id from cs_sr_owners_v
713 --
714 --
715 --      owner_group_id                       NUMBER             Optional
716 
717 --      resource_type                 VARCHAR2(30)         Optional
718 --    VAlid resource_type from  cs_sr_owners_v
719 
720 --      resource_subtype_id           NUMBER               Optional
721 
722 --	publish_flag				VARCHAR2	Optional
723 --		Indicate whether the service request is published (entered
724 --		into knowledge base if ConText Server Option is enabled).
725 
726 --	summary				VARCHAR2(240)	        Required
727 --		Service request summary. Must be non-null.
728 --
729 --
733 --
730 -----------------------------------------------------------------------
731 --      These fields are no longer present in the record type
732 --	verify_request_flag			VARCHAR2(1)	Required
734 --		DEFAULT = FND_API.G_TRUE
735 --		Indicate whether the service request is entered in verified
736 --		mode. Must be non-null. If set to TRUE, the API will perform
737 --		validation on the attributes customer_id, employee_id,
738 --		contact_id, bill_to_site_use_id, bill_to_contact_id,
739 --		ship_to_site_use_id, and ship_to_contact_id.
740 --	filed_by_emp_flag			VARCHAR2(1)	Required
741 --		DEFAULT = FND_API.G_FALSE
742 --		Indicate that the service request is filed by an employee.
743 --		Must be non-null. It can only be set when the
744 --		verify_request_flag parameter is set.
745 -------------------------------------------------------------------------------------
746 --
747 --      caller_type                             VARCHAR2(30)    Required
748 --      VAlid values are : ORGANIZATION, PERSON and CALLER_EMP
749 
750 --
751 --	customer_id				NUMBER		Optional
752 --		Service request customer identifier.
753 --
754 --	customer_number			       VARCHAR2(30)	Optional
755 --		Service request customer number.
756 --
757 
758 -----------------------------------------------------------------------
759 --      These fields are no longer present in the record type
760 --
761 --      customer_prefix                        VARCHAR2(50)     Optional
762 --		Service request customer name.
763 
764 --
765 --      customer_firstname                     VARCHAR2(150)     Optional
766 --              Service request customer first name
767 
768 --      customer_lastname                     VARCHAR2(150)     Optional
769 --              Service request customer last name
770 
771 --      customer_company_name                   VARCHAR2(255)  Optional
772 --              Service request customer company name
773 -----------------------------------------------------------------------------------
774 --	employee_id				NUMBER		Optional
775 --		Service request employee identifier.
776 -------------------------------------------------------------------
777 --   This field is no longer present in the record type
778 --	employee_name				VARCHAR2(240)	Optional
779 ------------------------------------------------------------------------
780 --	employee_number			      VARCHAR2(30)	Optional
781 ------------------------------------------------------------------
782 -- These fiels are no longer there in rec type
783 --
784 --	contact01_id				NUMBER		Optional
785 --		Service request customer contact identifier.
786 --
787 --      contact01_prefix                       VARCHAR2(50)   Optional
788 --		Service request customer contact name.
789 --
790 --      contact01_firstname                   VARCHAR2(150)  Optional
791 --
792 --
793 --   contact01_lastname            VARCHAR2(150)  Optional
794 --
795 --   contact01_area_code           VARCHAR2(10)   Optional
796 
797 --   contact01_telephone           VARCHAR2(40)   Optional
798 
799 --   contact01_extension           VARCHAR2(20)   Optional
800 
801 --   contact01_fax_area_code       VARCHAR2(10)   Optional
802 
803 --   contact01_fax_number          VARCHAR2(40)   Optional
804 
805 --   contact01_email_address       VARCHAR2(2000) Optional
806 --
807 --
808 --   contact02_id                  NUMBER         Optional
809 --        Service request customer represented by identifier
810 
811 --   contact02_prefix              VARCHAR2(50)   Optional
812 --        Service request customer represented by prefix
813 
814 --   contact02_firstname           VARCHAR2(150)  Optional
815 --        Service request customer represented by firstname
816 
817 --   contact02_lastname            VARCHAR2(150)  Optional
818 --        Service request customer represented by lastname
819 --
820 --   contact02_area_code           VARCHAR2(10)   Optional
821 
822 --   contact02_telephone           VARCHAR2(40)   Optional
823 
824 --   contact02_extension           VARCHAR2(20)   Optional
825 
826 --   contact02_fax_area_code       VARCHAR2(10)   Optional
827 
828 --   contact02_fax_number          VARCHAR2(40)   Optional
829 
830 --   contact02_email_address       VARCHAR2(2000) Optional
831 -------------------------------------------------------------------
832 
833 --
834 --
835 --   verify_cp_flag		   VARCHAR2(1)	  Required
836 --		Indicate whether to use the Installed Base. Must be non-null.
837 --		If set to TRUE, the API will perform validation on the
838 --		customer product ID.
839 
840 --   customer_product_id	  NUMBER	   Optional
841 --		Unique identifier for a customer product in the Installed Base.
842 --
843 ---------------------------------------------------------
844 -----no longer used
845 --     lot_num                    VARCHAR2(30)   Optional
846 -------------------------------------------------------
847 -- Supporting platform_id again because of enh 1711552
848 --     platform_id                NUMBER         Optional
849 --- ********THE functionality for the below 2 fileds is no longer supported.
850 --     platform_version_id        NUMBER         Optional
851 
852 --     language_id                NUMBER         Optional
853 --          This is the Product's language id
854 
855 
859 
856 --     cp_component_id               NUMBER         Optional
857 
858 --     cp_component_version_id       NUMBER         Optional
860 --     cp_subcomponent_id            NUMBER         Optional
861 
862 --     cp_subcomponent_version_id    NUMBER         Optional
863 
864 
865 --     language                   VARCHAR2(4)    Optional
866 --          This is used for TL tables
867 
868 --
869 --	cp_ref_number				Number	Optional -- 3840658
870 --		Reference number for a customer product in the Installed Base.
871 
872 --	inventory_item_id			NUMBER		Optional
873 --		Corresponds to the column INVENTORY_ITEM_ID in the table
874 --		MTL_SYSTEM_ITEMS, and identifies the service request product.
875 --		Ignored if the verify_cp_flag parameter is set.
876 --
877 --
878 --	inventory_item_conc_segs		VARCHAR2	Optional
879 --		String that contains a concatenation of the key flexfield
880 --		segments.
881 
882 --	inventory_item_segment1		VARCHAR2(40)	Optional
883 --		System Items key flexfield individual segments (1..20).
884 --	inventory_item_segment2		VARCHAR2(40)	Optional
885 --	inventory_item_segment3		VARCHAR2(40)	Optional
886 --	inventory_item_segment4		VARCHAR2(40)	Optional
887 --	inventory_item_segment5		VARCHAR2(40)	Optional
888 --	inventory_item_segment6		VARCHAR2(40)	Optional
889 --	inventory_item_segment7		VARCHAR2(40)	Optional
890 --	inventory_item_segment8		VARCHAR2(40)	Optional
891 --	inventory_item_segment9		VARCHAR2(40)	Optional
892 --	inventory_item_segment10		VARCHAR2(40)	Optional
893 --	inventory_item_segment11		VARCHAR2(40)	Optional
894 --	inventory_item_segment12		VARCHAR2(40)	Optional
895 --	inventory_item_segment13		VARCHAR2(40)	Optional
896 --	inventory_item_segment14		VARCHAR2(40)	Optional
897 --	inventory_item_segment15		VARCHAR2(40)	Optional
898 --	inventory_item_segment16		VARCHAR2(40)	Optional
899 --	inventory_item_segment17		VARCHAR2(40)	Optional
900 --	inventory_item_segment18		VARCHAR2(40)	Optional
901 --	inventory_item_segment19		VARCHAR2(40)	Optional
902 --	inventory_item_segment20		VARCHAR2(40)	Optional
903 
904 --	inventory_item_vals_or_ids		VARCHAR2(1)	Optional
905 --		DEFAULT = 'V'
906 --		Indicate whether input segments are values ('V') or hidden
907 --		IDs ('I'). If values are input the API expects one value for
908 --		every displayed segment, whereas if IDs are input the API
909 --		expects one ID for each enabled segment whether or not the
910 --		segment is displayed.
911 --
912 --
913 --	inventory_org_id			NUMBER		Optional
914 --		Item organization ID. Part of the unique key that uniquely
915 --		identifies an inventory item. Corresponds to the column
916 --		ORGANIZATION_ID in the table MTL_SYSTEM_ITEMS.
917 --		Required if inventory_item_id is used.
918 --
919 --	current_serial_number			VARCHAR2(30)	Optional
920 --		Serial number for serialized items.
921 --		Ignored if the verify_cp_flag parameter is set.
922 
923 --	original_order_number				NUMBER		Optional
924 --		Sales Order information.
925 --		Ignored if the verify_cp_flag parameter is set.
926 
927 --	purchase_order_number			VARCHAR2(50)	Optional
928 --		Sales Order information.
929 --		Ignored if the verify_cp_flag parameter is set.
930 
931 ------------------------------------------------------------------
932 --   This field is no longer present in the record type
933 --	problem_description			VARCHAR2(2000)	Optional
934 --		Service request problem description.
935 -----------------------------------------------------------------------
936 --
937 --	problem_code				VARCHAR2(30)	Optional
938 --		Service request problem code.
939 
940 --	exp_resolution_date			DATE		Optional
941 --		Service request expected resolution date.
942 --
943 ------------------------------------------------------------------
944 --   This field is no longer present in the record type
945 --	make_public_problem			VARCHAR2(1)	Optional
946 --		Indicate whether the problem description is public.
947 ------------------------------------------------------------------------
948 
949 --      install_site_use_id             NUMBER          Optional
950 
951 
952 -----------------------------------------------------------------------
953 --      These fields are no longer present in the record type
954 
955 --	install_location		VARCHAR2(40)	Optional
956 --	install_customer		VARCHAR2(50)	Optional
957 --      install_country                 VARCHAR2(60)    Optional
958 --	install_address_1		VARCHAR2(240)	Optional
959 --	install_address_2		VARCHAR2(240)	Optional
960 --	install_address_3		VARCHAR2(240)	Optional
961 
962 ------------------------------------------------------------------
963 
964 --   These fields are no longer present in the record type
965 --	rma_flag				VARCHAR2(1)	Required
966 --		Indicate whether an RMA is assigned. Must be non-null. If set
967 --		to TRUE, the API will perform validation on the RMA header ID.
968 --		It can only be set when the verify_request_flag parameter is
969 --		set.
970 --	rma_header_id				NUMBER		Optional
971 --		Sales order header identifier of the RMA.
972 --		Ignored if the rma_flag parameter is not set.
973 --	rma_number				NUMBER		Optional
974 --		User-visible sales order number of the RMA.
975 --	order_type_id				NUMBER		Optional
976 --		Sales order type of the RMA.
977 --	web_entry_flag			VARCHAR2(1)	Required
978 --		DEFAULT = FND_API.G_FALSE
982 --	request_segment1			VARCHAR2(150)	Optional
979 --		Indicate whether the service request is entered from
980 --		Self-Service Web Applications. Must be non-null.
981 --------------------------------------------------------------------------------------
983 --		Service request descriptive flexfield individual segments
984 --		(1..15).
985 --	request_segment2			VARCHAR2(150)	Optional
986 --	request_segment3			VARCHAR2(150)	Optional
987 --	request_segment4			VARCHAR2(150)	Optional
988 --	request_segment5			VARCHAR2(150)	Optional
989 --	request_segment6			VARCHAR2(150)	Optional
990 --	request_segment7			VARCHAR2(150)	Optional
991 --	request_segment8			VARCHAR2(150)	Optional
992 --	request_segment9			VARCHAR2(150)	Optional
993 --	request_segment10			VARCHAR2(150)	Optional
994 --	request_segment11			VARCHAR2(150)	Optional
995 --	request_segment12			VARCHAR2(150)	Optional
996 --	request_segment13			VARCHAR2(150)	Optional
997 --	request_segment14			VARCHAR2(150)	Optional
998 --	request_segment15			VARCHAR2(150)	Optional
999 --	request_context			VARCHAR2(30)	Optional
1000 --		Descriptive flexfield structure defining column.
1001 --
1002 
1003 
1004 
1005 --	bill_to_site_use_id			NUMBER		Optional
1006 --		Bill To site use identifier.
1007 
1008 --	bill_to_contact_id			NUMBER		Optional
1009 --		Bill To contact identifier.
1010 --
1011 
1012 -----------------------------------------------------------------------
1013 --      These fields are no longer present in the record type
1014 
1015 --	bill_to_location			VARCHAR2(40)	Optional
1016 --
1017 
1018 --	bill_to_customer			VARCHAR2(50)	Optional
1019 --
1020 
1021 --      bill_country                            VARCHAR2(60)    Optional
1022 
1023 --	bill_to_address_1		        VARCHAR2(240)	Optional
1024 
1025 --	bill_to_address_2		        VARCHAR2(240)	Optional
1026 
1027 --	bill_to_address_3		        VARCHAR2(240)	Optional
1028 
1029 --	bill_to_contact 			VARCHAR2(100)	Optional
1030 --------------------------------------------------------------------------------
1031 
1032 --	ship_to_site_use_id			NUMBER		Optional
1033 --		Ship To site use identifier.
1034 --
1035 
1036 --	ship_to_contact_id			NUMBER		Optional
1037 --		Ship To contact identifier.
1038 --
1039 
1040 -----------------------------------------------------------------------
1041 --      These fields are no longer present in the record type
1042 
1043 --	ship_to_location			VARCHAR2(40)	Optional
1044 --
1045 
1046 --	ship_to_customer			VARCHAR2(50)	Optional
1047 --
1048 --
1049 --      ship_country                            VARCHAR2(60)    Optional
1050 
1051 --	ship_to_address_1		        VARCHAR2(240)	Optional
1052 
1053 --	ship_to_address_2		        VARCHAR2(240)	Optional
1054 --
1055 
1056 --	ship_to_address_3		        VARCHAR2(240)	Optional
1057 --
1058 --	ship_to_contact 			VARCHAR2(100)	Optional
1059 ----------------------------------------------------------------------
1060 
1061 
1062 
1063 ------------------------------------------------------------------
1064 --   This field is no longer present in the record type
1065 --	problem_resolution			VARCHAR2(2000)	Optional
1066 --		Service request problem resolution.
1067 ---------------------------------------------------------------------
1068 --
1069 --	resolution_code			VARCHAR2(30)	Optional
1070 --		Service request resolution code.
1071 
1072 --	act_resolution_date		DATE		Optional
1073 --		Service request actual resolution date.
1074 --
1075 ------------------------------------------------------------------
1076 --   This field is no longer present in the record type
1077 --	make_public_resolution		VARCHAR2(1)	Optional
1078 --		Indicate whether the problem resolution is public.
1079 -------------------------------------------------------------------------
1080 
1081 --      public_comment_flag           VARCHAR2(1)          Optional
1082 --      parent_interaction_id         NUMBER               Optional
1083 --      contract_service_id           NUMBER               Optional
1084 --      contract_service_number       VARCHAR2(150)        Optional
1085 --      qa_collection_plan_id         NUMBER               Optional
1086 --      account_id                    NUMBER               Optional
1087 --      cust_po_number                VARCHAR2(50)         Optional
1088 --      cust_ticket_number            VARCHAR2(50)         Optional
1089 --      sr_creation_channel           VARCHAR2(50)         Optional
1090 --      obligation_date               DATE                 Optional
1091 --      time_zone_id                  NUMBER               Optional
1092 --      time_difference               NUMBER               Optional
1093 --      site_id                       NUMBER               Optional
1094 --      customer_site_id              NUMBER               Optional
1095 --      territory_id                  NUMBER               Optional
1096 --      initialize_flag               VARCHAR2(1)          Optional
1097 
1098 --      cp_revision_id                NUMBER          OPTIONAL
1099 --      inv_item_revision             VARCHAR2(3)     OPTIONAL
1100 --      inv_component_id              NUMBER          OPTIONAL
1101 --      inv_component_version         VARCHAR2(3)     OPTIONAL
1102 --      inv_subcomponent_id           NUMBER          OPTIONAL
1103 --      inv_subcomponent_version      VARCHAR2(3)     OPTIONAL
1104 
1105 
1106 
1107 
1108 
1112 --		SYSDATE.
1109 -- End of service_request_rec_type comments
1110 --
1111 --  Notes:	If request_date is not passed, the default value will be
1113 --
1114 --		If both type_id and type_name are passed, type_name will
1115 --		be ignored. If neither is passed, the default value will be
1116 --		retrieved from the 'Service: Default Service Request Type'
1117 --		profile.
1118 --
1119 --		If both status_id and status_name are passed,
1120 --		status_name will be ignored. If neither is passed, the
1121 --		default value will be the seeded value 1 ('Open').
1122 --
1123 --		If both severity_id and severity_name are passed,
1124 --		severity_name will be ignored. If neither is passed, the
1125 --		default value will be retrieved from the 'Service: Default
1126 --		Service Request Severity' profile.
1127 --
1128 --		If both urgency_id and urgency_name are passed,
1129 --		urgency_name will be ignored. If neither is passed, the
1130 --		default value will be retrieved from the 'Service: Default
1131 --		Service Request Urgency' profile.
1132 --
1133 --		If owner_id is not passed, the default value will be
1134 --		retrieved from the 'Service: Default Service Request Owner'
1135 --		profile.
1136 --
1137 --		If resource_type is not passed, the default value will be
1138 --		retrieved based on 'Service: Default Service Request Owner'
1139 --		profile.
1140 
1141 
1142 
1143 --		Insertion of the publish flag is controlled by the profile
1144 --		'Service: Publish Flag Update Allowed'. If the profile is not
1145 --		set and the caller passes in a non-null value, the API will
1146 --		return an error.
1147 --
1148 --		Either customer_id, customer_name, or customer_number
1149 --		must be passed if the filed_by_emp_flag is not set. If more
1150 --		than one parameter are passed, the customer ID has precedence
1151 --		over the customer number, and the customer number has
1152 --		precedence over the customer name.
1153 --
1154 --		Either employee_id, employee_name, or employee_number
1155 --		must be passed if the filed_by_emp_flag is set. If more than
1156 --		one parameter are passed, the employee ID has precedence over
1157 --		the employee number, and the employee number has precedence
1158 --		over the employee name.
1159 --
1160 --		Either customer_product_id or cp_ref_number must be passed
1161 --		if the verify_cp_flag is set. If both are passed,
1162 --		cp_ref_number will be ignored.
1163 --
1164 --		If inventory_org_id is not passed, the default value will be
1165 --		retrieved from the 'OE: Item Validation Organization' profile.
1166 --
1167 --		If make_public_problem or make_public_resolution is not
1168 --		passed, the default value will be retrieved from the 'Service:
1169 --		Default Make Public Flag' profile.
1170 --
1171 --		If both rma_header_id and rma_number are passed,
1172 --		rma_number will be ignored.
1173 --
1174 --		For value-ID conversion, when the ID of an attribute is not
1175 --		passed, and the value of the attribute is passed and the value
1176 --		is NULL, the ID is converted into NULL. For example, if
1177 --		urgency_id = FND_API.G_MISS_NUM and urgency_name = NULL,
1178 --		NULL is inserted into the incident_urgency_id column. This has
1179 --		the effect that urgency ID will not be defaulted from the
1180 --		profile option (since the caller explicitly passed in NULL).
1181 --
1182 --		For the key and descriptive flexfield segments, segment	values
1183 --		must be input in attribute_segment1..attribute_segmentN in
1184 --		the order displayed. The caller must explicitly set
1185 --		attribute_segmentM to NULL if the Mth segment is NULL, or
1186 --		this will generate a 'NO DATA FOUND' error. Alternatively, the
1187 --		caller may pass in the segment values in a string concatenated
1188 --		by the segment delimiter for the flexfield.
1189 --
1190 --		For the descriptive flexfield segments, the caller must pass
1191 --		the IDs for all columns that might be used in the descriptive
1192 --		flexfield. Values input is currently not supported.
1193 --
1194 --
1195 --		The service request record must be committed before launching
1196 --		the workflow process. This is necessary because Workflow needs
1197 --		to obtain a lock on the record. If the caller passes in FALSE
1198 --		for p_commit and (the autolaunch workflow flag is set ),
1199 --              the API will return an error.
1200 
1201 ----------------------------------------------------
1202 --              Old logic
1203 --              (TRUE for p_launch_workflow)
1204 --		A workflow is automatically launched only if the caller passes
1205 --		in TRUE for the p_launch_workflow parameter and the profile
1206 --		option 'Service: Auto Launch Workflow' is set to 'Y'.
1207 --------------------------------------------------------------------------
1208 
1209 --		A workflow is automatically launched only if the autolaunch
1210 --              workflow falg is set to Y in the incident types table.
1211 
1212 -------------------------------------------------------------------------
1213 --              Old Logic
1214 --		If p_launch_workflow is set, the Workflow API will try to lock
1215 --		the service request record because it needs to update the
1216 --		workflow_process_id column. The NOWAIT option can be specified
1217 --		by setting the p_nowait parameter. If p_nowait is set and the
1218 --		service request record is locked by another user, an error
1219 --		status is returned via the p_return_status_wkflw parameter
1220 --		indicating the workflow process is not launched.
1221 --
1222 --		If p_launch_workflow is set and the service request record is
1223 --		created successfully, a success code will be returned via the
1227 
1224 --		p_return_status parameter regardless of the result of the
1225 --		workflow launch. The status code from the Workflow launch is
1226 --		returned via the p_return_status_wkflw parameter instead.
1228 -----------------
1229 
1230 --		If the autolaunch workflow flag is set, the Workflow API will try to lock
1231 --		the service request record because it needs to update the
1232 --		workflow_process_id column. The NOWAIT option can be specified
1233 --		by setting the p_nowait parameter. If p_nowait is set and the
1234 --		service request record is locked by another user, an error
1235 --		status is returned via the p_return_status_wkflw parameter
1236 --		indicating the workflow process is not launched.
1237 --
1238 --		If autolaunch workflow flag is set and the service request record is
1239 --		created successfully, a success code will be returned via the
1240 --		p_return_status parameter regardless of the result of the
1241 --		workflow launch. The status code from the Workflow launch is
1242 --		returned via the p_return_status_wkflw parameter instead.
1243 
1244 
1245 
1246 
1247 
1248 --
1249 -- End of comments
1250 --------------------------------------------------------------
1251 /*#
1252  * Creates a new service request and related information such as service request contacts, notes, and tasks.
1253  * For details on the parameters, please refer to the document on Metalink from the URL provided above.
1254  *
1255  * @rep:scope public
1256  * @rep:lifecycle active
1257  * @rep:compatibility S
1258  * @rep:displayname Create Service Request
1259  * @rep:primaryinstance
1260  * @rep:businessevent oracle.apps.cs.sr.ServiceRequest.created
1261  * @rep:metalink 390479.1 Oracle White Paper : Service Request Public Application Programming Interfaces (APIs)
1262  */
1263 
1264 /**** Above text has been added to enable the integration repository to extract the data from
1265       the source code file and populate the integration repository schema so that
1266       Create_ServiceRequest API appears in the integration repository.
1267 ****/
1268 
1269 PROCEDURE Create_ServiceRequest
1270 ( p_api_version		  	  IN         NUMBER,
1271   p_init_msg_list	  	  IN         VARCHAR2 	:= FND_API.G_FALSE,
1272   p_commit		  	  IN         VARCHAR2 	:= FND_API.G_FALSE,
1273   x_return_status	  	  OUT NOCOPY VARCHAR2,
1274   x_msg_count		  	  OUT NOCOPY NUMBER,
1275   x_msg_data		  	  OUT NOCOPY VARCHAR2,
1276   p_resp_appl_id	  	  IN         NUMBER	:= NULL,
1277   p_resp_id		  	  IN         NUMBER	:= NULL,
1278   p_user_id		  	  IN         NUMBER	:= NULL,
1279   p_login_id		  	  IN         NUMBER	:= NULL,
1280   p_org_id		  	  IN         NUMBER	:= NULL,
1281   p_request_id            	  IN         NUMBER     := NULL,
1282   p_request_number	  	  IN         VARCHAR2	:= NULL,
1283   p_service_request_rec   	  IN         service_request_rec_type,
1284   p_notes                 	  IN         notes_table,
1285   p_contacts              	  IN         contacts_table,
1286    -- Added for Assignment Manager 11.5.9 change
1287   p_auto_assign           	  IN         VARCHAR2  Default 'N',
1288   --------------anmukher----------------------07/31/03
1289   -- Added for 11.5.10 projects (AutoTask, Miscellaneous ERs)
1290   p_auto_generate_tasks		  IN		VARCHAR2 Default 'N',
1291   x_sr_create_out_rec		  OUT NOCOPY	sr_create_out_rec_type,
1292   p_default_contract_sla_ind	  IN		VARCHAR2 Default 'N',
1293   p_default_coverage_template_id  IN		NUMBER Default NULL
1294   ---------------anmukher----------------------07/31/03
1295   -- The following OUT parameters have been added to the record type sr_create_out_rec_type
1296   -- and have therefore been commented out. This will allow avoidance of future overloading
1297   -- if a new OUT parameter were to be needed, since it can be added to the same record type.
1298   -- x_request_id		  OUT NOCOPY NUMBER,
1299   -- x_request_number		  OUT NOCOPY VARCHAR2,
1300   -- x_interaction_id        	  OUT NOCOPY NUMBER,
1301   -- x_workflow_process_id   	  OUT NOCOPY NUMBER,
1302   -- Added for assignment manager changes for 11.5.9
1303   -- x_individual_owner      	  OUT NOCOPY NUMBER,
1304   -- x_group_owner           	  OUT NOCOPY NUMBER,
1305   -- x_individual_type       	  OUT NOCOPY VARCHAR2
1306 );
1307 
1308 ----------------anmukher--------------07/31/03
1309 -- Overloaded procedure added for backward compatibility in 11.5.10
1310 -- since several new OUT parameters have been added to the 11.5.9 signature
1311 -- in the form of a new record type, sr_create_out_rec_type
1312 PROCEDURE Create_ServiceRequest
1313 ( p_api_version		  IN         NUMBER,
1314   p_init_msg_list	  IN         VARCHAR2 	:= FND_API.G_FALSE,
1315   p_commit		  IN         VARCHAR2 	:= FND_API.G_FALSE,
1316   x_return_status	  OUT NOCOPY VARCHAR2,
1317   x_msg_count		  OUT NOCOPY NUMBER,
1318   x_msg_data		  OUT NOCOPY VARCHAR2,
1319   p_resp_appl_id	  IN         NUMBER	:= NULL,
1320   p_resp_id		  IN         NUMBER	:= NULL,
1321   p_user_id		  IN         NUMBER	:= NULL,
1322   p_login_id		  IN         NUMBER	:= NULL,
1323   p_org_id		  IN         NUMBER	:= NULL,
1324   p_request_id            IN         NUMBER     := NULL,
1325   p_request_number	  IN         VARCHAR2	:= NULL,
1326   p_service_request_rec   IN         service_request_rec_type,
1327   p_notes                 IN         notes_table,
1328   p_contacts              IN         contacts_table,
1329   -- Added for Assignment Manager 11.5.9 change
1330   p_auto_assign           IN         VARCHAR2  Default 'N',
1331   p_default_contract_sla_ind	  IN		VARCHAR2 Default 'N',
1332   x_request_id		  OUT NOCOPY NUMBER,
1333   x_request_number	  OUT NOCOPY VARCHAR2,
1337   x_individual_owner      OUT NOCOPY NUMBER,
1334   x_interaction_id        OUT NOCOPY NUMBER,
1335   x_workflow_process_id   OUT NOCOPY NUMBER,
1336   -- Added for assignment manager changes for 11.5.9
1338   x_group_owner           OUT NOCOPY NUMBER,
1339   x_individual_type       OUT NOCOPY VARCHAR2
1340 );
1341 
1342 
1343 --------------------------------------------------------------------------
1344 -- Start of comments
1345 --  API name	: Update_ServiceRequest
1346 --  Type	: Public
1347 --  Function	: Updates a service request in the table CS_INCIDENTS_ALL.
1348 --  Pre-reqs	: None.
1349 --
1350 --  Standard IN Parameters:
1351 --	p_api_version			IN	NUMBER		Required
1352 --	p_init_msg_list		  	IN	VARCHAR2 	Optional
1353 --	p_commit			IN	VARCHAR2 	Optional
1354 --
1355 --  Standard OUT Parameters:
1356 --	x_return_status			OUT	VARCHAR2(1)
1357 --	x_msg_count			OUT	NUMBER
1358 --	x_msg_data			OUT	VARCHAR2(2000)
1359 --
1360 ---------------------------------------------------------------------
1361 --      These are required only for create_servicerequest procedure
1362 --  	p_user_id			IN	NUMBER		Optional
1363 --  	p_login_id			IN	NUMBER		Optional
1364 ------------------------------------------------------------------
1365 --
1366 --  Service Request IN Parameters:
1367 --	p_resp_appl_id		  	IN	NUMBER		Optional
1368 --	p_resp_id			IN	NUMBER		Optional
1369 
1370 
1371 
1372 ----------------------------------------------------------------------
1373 --     No longer there in the Update_ServiceRequest
1374 --  	p_org_id			IN	NUMBER		Optional
1375 ----------------------------------------------------------------------------
1376 
1377 
1378 --	p_request_id		 	IN    	NUMBER		Optional
1379 --	p_request_number		IN	VARCHAR2	Optional
1380 --      p_object_version_number         IN      NUMBER          Required by web-apps
1381 --
1382 --
1383 --	p_audit_comments		IN	VARCHAR2 	Optional
1384 --		Maximum string length of 2000 bytes
1385 
1386 
1387 --   p_last_updated_by                 IN   NUMBER         Required
1388 --   valid user from fnd_user
1389 
1390 --   p_last_update_login               IN   NUMBER         Optional
1391 --        Default = NULL
1392 --   p_last_update_date                IN   DATE           Required
1393 --
1394 --   p_service_request_rec             IN   service_request_rec_type  Required
1395 --   p_notes                           IN   notes_table               Optional
1396 
1397 --   p_contacts                        IN   contacts_table            Optional
1398 --
1399 --   p_called_by_workflow		IN	VARCHAR2	Optional
1400 --	        Whether or not the API is being called by a workflow process
1401 
1402 --   p_workflow_process_id		IN	NUMBER		Optional
1403 --	        Workflow process ID of the active workflow process
1404 --
1405 --   p_default_contract_sla_ind      IN      VARCHAR2        Optional
1406 --              DEFAULT 'N'
1407 --              Indicates whether the API needs to determine the contract, respond by date
1408 --              and resolve by date for a service request and stamp it on the service request.
1409 --
1410 --   Service Request OUT Parameters:
1411 --   x_workflow_process_id          OUT   NUMBER
1412 --           This will have a value if a new workflow got launched during the update
1413 --   x_intercation_id               OUT   NUMBER
1414 
1415 -------------------------------------------------------------------
1416 --      Not present in the Procedure declaration
1417 --	p_web_entry_flag
1418 --		Whether the update was entered through the Web
1419 -----------------------------------------------------------------
1420 --  Calls IN parameters:
1421 --	p_comments			IN	VARCHAR2(2000)	Optional
1422 --		Service request comments or log of the conversation.
1423 --	p_public_comment_flag		IN	VARCHAR2(1)	Optional
1424 --		Indicate whether the service request comment is public (can be
1425 --		viewed by anyone).
1426 --
1427 --  Calls OUT parameters:
1428 --	p_call_id			OUT	NUMBER
1429 --		System generated ID of service request call
1430 --
1431 --  Version : Initial version	1.0
1432 ------------------------------------------------------------------------------
1433 
1434 -- Start of comments
1435 --  Record Type     : Service_Request_Rec_Type
1436 --  Description     : Holds the Service Request attributes
1437 --                    for the Update_ServiceRequest Procedure.
1438 --  Fields     :
1439 --
1440 --
1441 --  	type_id				NUMBER		Optional
1442 --		Must be non-null
1443 
1444 --	type_name			VARCHAR2	Optional
1445 --		Must be non-null
1446 
1447 --	status_id			NUMBER		Optional
1448 --		Must be non-null
1449 
1450 --	status_name			VARCHAR2 	Optional
1451 --		Must be non-null
1452 
1453 --	severity_id			NUMBER		Optional
1454 --		Must be non-null
1455 
1456 --	severity_name		  	VARCHAR2 	Optional
1457 --		Must be non-null
1458 
1459 --	urgency_id			NUMBER		Optional
1460 
1461 --  	urgency_name			VARCHAR2 	Optional
1462 
1463 --	closed_date			DATE		Optional
1464 
1465 --	owner_id			NUMBER		Optional
1466 --		Must be non-null
1467 
1468 --      owner_group_id                  NUMBER          Optional
1469 --
1470 --	publish_flag			VARCHAR2	Optional
1471 --		Indicate whether the service request is published (entered
1472 --		  into knowledge base if ConText Server Option is enabled).
1473 
1477 --      These fields are no longer present in the record type
1474 -- 	summary				VARCHAR2	Optional
1475 --		Must be non-null
1476 -----------------------------------------------------------------------
1478 --	verify_request_flag			VARCHAR2	Optional
1479 --		Must be either FND_API.G_TRUE or FND_API.G_FALSE.  Used
1480 -- 		to indicate if this is a verified or non-verified request
1481 -----------------------------------------------------------------------------
1482 --	customer_id			 NUMBER		 Optional
1483 
1484 
1485 --	customer_number		         VARCHAR2	 Optional
1486 
1487 
1488 -----------------------------------------------------------------------
1489 --      These fields are no longer present in the record type
1490 
1491 --   customer_prefix                     VARCHAR2(50)    Optional
1492 --		Service request customer name.
1493 --
1494 --   customer_firstname                  VARCHAR2(150)   Optional
1495 --              Service request customer first name
1496 
1497 --   customer_lastname                   VARCHAR2(150)  Optional
1498 --              Service request customer last name
1499 
1500 
1501 --   customer_company_name               VARCHAR2(255)  Optional
1502 --              Service request customer company name
1503 
1504 ----------------------------------------------------------------
1505 
1506 --	employee_id			 NUMBER		Optional
1507 
1508 --	employee_number			 VARCHAR2(30)	Optional
1509 --
1510 
1511 ------------------------------------------------------------------
1512 -- These fiels are no longer there in rec type
1513 
1514 --
1515 --	contact01_id			 NUMBER		Optional
1516 
1517 --       contact01_prefix                VARCHAR2(50)   Optional
1518 --		Service request customer contact name.
1519 
1520 --
1521 --   contact01_firstname           VARCHAR2(150)  Optional
1522 --
1523 --
1524 --   contact01_lastname            VARCHAR2(150)  Optional
1525 --
1526 --   contact01_area_code           VARCHAR2(10)   Optional
1527 --   contact01_telephone           VARCHAR2(40)   Optional
1528 --   contact01_extension           VARCHAR2(20)   Optional
1529 --   contact01_fax_area_code       VARCHAR2(10)   Optional
1530 --   contact01_fax_number          VARCHAR2(40)   Optional
1531 --   contact01_email_address       VARCHAR2(2000) Optional
1532 --
1533 --
1534 --   contact02_id                  NUMBER         Optional
1535 --        Service request customer represented by identifier
1536 
1537 --   contact02_prefix              VARCHAR2(50)   Optional
1538 --        Service request customer represented by prefix
1539 
1540 --   contact02_firstname           VARCHAR2(150)  Optional
1541 --        Service request customer represented by firstname
1542 
1543 --   contact02_lastname            VARCHAR2(150)  Optional
1544 --        Service request customer represented by lastname
1545 --
1546 --   contact02_area_code           VARCHAR2(10)   Optional
1547 
1548 --   contact02_telephone           VARCHAR2(40)   Optional
1549 
1550 --   contact02_extension           VARCHAR2(20)   Optional
1551 
1552 --   contact02_fax_area_code       VARCHAR2(10)   Optional
1553 
1554 --   contact02_fax_number          VARCHAR2(40)   Optional
1555 
1556 --   contact02_email_address       VARCHAR2(2000) Optional
1557 -------------------------------------------------------------------
1558 
1559 --
1560 --    verify_cp_flag		   VARCHAR2	  Optional
1561 
1562 --    customer_product_id	   NUMBER	  Optional
1563 --
1564 ---------------------------------------------------
1565 --no longer used
1566 --     lot_num                    VARCHAR2(30)   Optional
1567 --------------------------------------------------------
1568 
1569 -- Supporting platform_id again because of enh 1711552
1570 --     platform_id                NUMBER         Optional
1571 --    *********THE functionality for the below 2 fileds is no longer supported.
1572 --     platform_version_id        NUMBER         Optional
1573 
1574 --     language_id                NUMBER         Optional
1575 --          This is the Product's language id
1576 
1577 --     cp_component_id               NUMBER         Optional
1578 --     cp_component_version_id       NUMBER         Optional
1579 --     cp_subcomponent_id            NUMBER         Optional
1580 --     cp_subcomponent_version_id    NUMBER         Optional
1581 
1582 
1583 --     language                   VARCHAR2(4)    Optional
1584 --          This is used for TL tables
1585 --          IF not passed to the api, the userenv('LANG') is used.
1586 --
1587 
1588 --
1589 --	cp_ref_number		  Number  	 Optional -- 3840658
1590 --
1591 --	inventory_item_id         NUMBER	 Optional
1592 
1593 --	inventory_item_conc_segs	VARCHAR2	Optional
1594 --	inventory_item_segment1		VARCHAR2	Optional
1595 --	inventory_item_segment2		VARCHAR2	Optional
1596 --	inventory_item_segment3		VARCHAR2	Optional
1597 --	inventory_item_segment4		VARCHAR2	Optional
1598 --	inventory_item_segment5		VARCHAR2	Optional
1599 --	inventory_item_segment6		VARCHAR2	Optional
1600 --	inventory_item_segment7		VARCHAR2	Optional
1601 --	inventory_item_segment8	        VARCHAR2	Optional
1602 --	inventory_item_segment9		VARCHAR2	Optional
1603 --	inventory_item_segment10	VARCHAR2	Optional
1604 --	inventory_item_segment11	VARCHAR2	Optional
1605 --	inventory_item_segment12	VARCHAR2	Optional
1606 --	inventory_item_segment13	VARCHAR2	Optional
1610 --	inventory_item_segment17	VARCHAR2	Optional
1607 --	inventory_item_segment14	VARCHAR2	Optional
1608 --	inventory_item_segment15	VARCHAR2	Optional
1609 --	inventory_item_segment16	VARCHAR2	Optional
1611 --	inventory_item_segment18	VARCHAR2	Optional
1612 --	inventory_item_segment19	VARCHAR2	Optional
1613 --	inventory_item_segment20	VARCHAR2	Optional
1614 
1615 --	inventory_item_vals_or_ids	VARCHAR2	Optional
1616 --		Must be 'I' for IDs and 'V' for values.  This parameter
1617 --		indicate whether the item key flex segments are passed
1618 --		in by ID or value
1619 --
1620 --	inventory_org_id			NUMBER		Optional
1621 
1622 --	current_serial_number	  		VARCHAR2	Optional
1623 --
1624 
1625 --	original_order_number	  		NUMBER		Optional
1626 
1627 --	purchase_order_num  	  		VARCHAR2	Optional
1628 --
1629 
1630 ------------------------------------------------------------------
1631 --   This field is no longer present in the record type
1632 --	problem_description			VARCHAR2	Optional
1633 --		Maximum string length of 2000 bytes
1634 -----------------------------------------------------------------------
1635 --
1636 --	problem_code		  		VARCHAR2	Optional
1637 
1638 --	exp_resolution_date			DATE		Optional
1639 
1640 ------------------------------------------------------------------
1641 --   This field is no longer present in the record type
1642 --	make_public_problem			VARCHAR2	Optional
1643 --		Indicate whether the problem description is public.
1644 ----------------------------------------------------------------------
1645 
1646 --      install_site_use_id                     NUMBER          Optional
1647 
1648 
1649 -----------------------------------------------------------------------
1650 --      These fields are no longer present in the record type
1651 --	install_location			VARCHAR2	Optional
1652 --
1653 --	install_customer			VARCHAR2	Optional
1654 --
1655 --      install_country                         VARCHAR2(60)    Optional
1656 
1657 --	install_address_1		        VARCHAR2	Optional
1658 --
1659 --  	install_address_2		        VARCHAR2	Optional
1660 --
1661 --	install_address_3		        VARCHAR2	Optional
1662 --
1663 ------------------------------------------------------------------
1664 --   These fields are no longer present in the record type
1665 --	rma_flag				VARCHAR2	Optional
1666 --	rma_header_id		  		NUMBER		Optional
1667 --	rma_number				NUMBER		Optional
1668 --	order_type_id		  		NUMBER		Optional
1669 -------------------------------------------------------------------------
1670 --
1671 --	request_segment1			VARCHAR2	Optional
1672 --	request_segment2			VARCHAR2	Optional
1673 --	request_segment3		        VARCHAR2	Optional
1674 --	request_segment4			VARCHAR2	Optional
1675 --	request_segment5			VARCHAR2	Optional
1676 --	request_segment6			VARCHAR2	Optional
1677 --	request_segment7			VARCHAR2	Optional
1678 --	request_segment8			VARCHAR2	Optional
1679 --	request_segment9			VARCHAR2	Optional
1680 --	request_segment10			VARCHAR2	Optional
1681 --	request_segment11			VARCHAR2	Optional
1682 --	request_segment12			VARCHAR2	Optional
1683 --	request_segment13			VARCHAR2	Optional
1684 --	request_segment14		        VARCHAR2	Optional
1685 --	request_segment15			VARCHAR2	Optional
1686 --	request_context			        VARCHAR2	Optional
1687 --
1688 --	bill_to_site_use_id			NUMBER		Optional
1689 
1690 --	bill_to_contact_id			NUMBER		Optional
1691 
1692 
1693 
1694 -----------------------------------------------------------------------
1695 --      These fields are no longer present in the record type
1696 
1697 --	bill_to_location			VARCHAR2	Optional
1698 
1699 --	bill_to_customer			VARCHAR2	Optional
1700 
1701 --      bill_country                            VARCHAR2(60)    Optional
1702 --
1703 --	bill_to_address_1		        VARCHAR2	Optional
1704 
1705 --	bill_to_address_2		        VARCHAR2	Optional
1706 
1707 --	bill_to_address_3		        VARCHAR2	Optional
1708 
1709 --	bill_to_contact			        VARCHAR2	Optional
1710 ---------------------------------------------------------------------------
1711 --
1712 --	ship_to_site_use_id			NUMBER		Optional
1713 
1714 --	ship_to_contact_id			NUMBER		Optional
1715 
1716 
1717 -----------------------------------------------------------------------
1718 --      These fields are no longer present in the record type
1719 
1720 --	ship_to_location			VARCHAR2	Optional
1721 
1722 --	ship_to_customer			VARCHAR2	Optional
1723 
1724 --      ship_country                            VARCHAR2(60)    Optional
1725 
1726 --	ship_to_address_1		        VARCHAR2	Optional
1727 
1728 --	ship_to_address_2		        VARCHAR2	Optional
1729 
1730 --	ship_to_address_3		        VARCHAR2	Optional
1731 
1732 --	ship_to_contact			        VARCHAR2	Optional
1733 
1734 
1735 ------------------------------------------------------------------
1736 --   This field is no longer present in the record type
1737 --	problem_resolution			VARCHAR2	Optional
1738 --		Maximum string length of 2000 bytes
1739 --------------------------------------------------------------------
1740 
1741 --	resolution_code		      VARCHAR2	        Optional
1742 --	act_resolution_date	      DATE		Optional
1743 --      public_comment_flag           VARCHAR2(1)       Optional
1744 --      parent_interaction_id         NUMBER            Optional
1745 --      contract_service_id           NUMBER            Optional
1749 --      resource_type                 VARCHAR2(30)      Optional
1746 --      contract_service_number       VARCHAR2(150)     Optional
1747 --      qa_collection_plan_id         NUMBER            Optional
1748 --      account_id                    NUMBER            Optional
1750 --      resource_subtype_id           NUMBER            Optional
1751 --      cust_po_number                VARCHAR2(50)      Optional
1752 --      cust_ticket_number            VARCHAR2(50)      Optional
1753 ---------------------------------------------------------------
1754 --   This is a non updatable field
1755 --      sr_creation_channel           VARCHAR2(50)      Optional
1756 ------------------------------------------------------------------
1757 --      obligation_date               DATE              Optional
1758 --      time_zone_id                  NUMBER            Optional
1759 --      time_difference               NUMBER            Optional
1760 --      site_id                       NUMBER            Optional
1761 --      customer_site_id              NUMBER            Optional
1762 --      territory_id                  NUMBER            Optional
1763 --      initialize_flag               VARCHAR2(1)       Optional
1764 
1765 --      cp_revision_id                NUMBER          OPTIONAL
1766 --      inv_item_revision             VARCHAR2(3)     OPTIONAL
1767 --      inv_component_id              NUMBER          OPTIONAL
1768 --      inv_component_version         VARCHAR2(3)     OPTIONAL
1769 --      inv_subcomponent_id           NUMBER          OPTIONAL
1770 --      inv_subcomponent_version      VARCHAR2(3)     OPTIONAL
1771 --
1772 --
1773 --  Notes:	: Either request_id or request_number must be non-null.
1774 --		  If both are passed in, request_number will be ignored
1775 --
1776 --      	  If a field is not to be updated, do not pass in NULL.  Either
1777 --                don't pass in the parameter at all, or pass in one of the
1778 --		  missing parameter constants defined in the FND_API
1779 --		  package(G_MISS_...).
1780 --
1781 --      	  For all the "flag" parameters, and p_called_by_workflow
1782 --		  parameter, pass in the boolean constants defined in the
1783 --		  FND_API package (G_TRUE and G_FALSE).
1784 --
1785 --		  Varchar parameters with the maximum length noted above will
1786 --		  be truncated if the length of the value being passed in
1787 --		  exceeds the maximum allowance, and a warning will be appended
1788 --		  to the runtime message list.
1789 --
1790 --		  The type and owner of the the service request cannot be
1791 --		  updated when there is an active workflow process. The status
1792 --		  of the service request can be set to a "closed" status
1793 --		  (status whose close_flag is set) under the same condition.
1794 --		  In that case, this API will abort the active workflow
1795 --		  process. When this API is being called by the workflow
1796 --		  process, the caller must pass in the workflow process ID of
1797 --		  the active workflow process for verification.
1798 --
1799 --		  For the descriptive flexfield segments, the caller must pass
1800 --		  in the IDs for all columns that are used in the descriptive
1801 --	    	  flexfield. Input by value is currently not supported.
1802 --
1803 --		  The publish flag cannot be updated if the profile
1804 --		  'Service: Publish Flag Update Allowed' is not set. If the
1805 --		  caller passes in a non-null value when the profile is not
1806 --		  set, the API will return an error.
1807 
1808 --        The service request record must be committed before launching
1809 --        the workflow process. This is necessary because Workflow needs
1810 --        to obtain a lock on the record. If the caller passes in FALSE
1811 --        for p_commit and TRUE for p_launch_workflow, the API will
1812 --        return an error.
1813 --
1814 --        A workflow is automatically launched only if the caller passes
1815 --        in TRUE for the p_launch_workflow parameter and the profile
1816 --        option 'Service: Auto Launch Workflow' is set to 'Y'.
1817 --
1818 --        If p_launch_workflow is set, the Workflow API will try to lock
1819 --        the service request record because it needs to update the
1820 --        workflow_process_id column. The NOWAIT option can be specified
1821 --        by setting the p_nowait parameter. If p_nowait is set and the
1822 --        service request record is locked by another user, an error
1823 --        status is returned via the p_return_status_wkflw parameter
1824 --        indicating the workflow process is not launched.
1825 --
1826 --        If p_launch_workflow is set and the service request record is
1827 --        created successfully, a success code will be returned via the
1828 --        p_return_status parameter regardless of the result of the
1829 --        workflow launch. The status code from the Workflow launch is
1830 --        returned via the p_return_status_wkflw parameter instead.
1831 
1832 --
1833 -- End of comments
1834 --
1835 --------------------------------------------------------------------------
1836 /*#
1837  * Update Service Request enables user to update a service request, and other service request related data
1838  * such as service contacts, and tasks. For details on the parameters, please refer to the document on Metalink from the URL provided above.
1839  *
1840  * @rep:scope public
1841  * @rep:lifecycle active
1842  * @rep:compatibility S
1843  * @rep:displayname Update Service Request
1844  * @rep:primaryinstance
1845  * @rep:businessevent oracle.apps.cs.sr.ServiceRequest.updated
1849 /**** Above text has been added to enable the integration repository to extract the
1846  * @rep:metalink 390479.1 Oracle White Paper : Service Request Public Application Programming Interfaces (APIs)
1847  */
1848 
1850       data from the source code file and populate the integration repository schema so
1851       that Update_ServiceRequest API appears in the integration repository.
1852 ****/
1853 
1854 
1855 PROCEDURE Update_ServiceRequest(
1856   p_api_version            	IN     NUMBER,
1857   p_init_msg_list          	IN     VARCHAR2      := FND_API.G_FALSE,
1858   p_commit                 	IN     VARCHAR2      := FND_API.G_FALSE,
1859   x_return_status          	OUT NOCOPY VARCHAR2,
1860   x_msg_count              	OUT NOCOPY NUMBER,
1861   x_msg_data               	OUT NOCOPY VARCHAR2,
1862   p_request_id             	IN     NUMBER        := NULL,
1863   p_request_number         	IN     VARCHAR2      := NULL,
1864   p_audit_comments         	IN     VARCHAR2      := NULL,
1865   p_object_version_number  	IN     NUMBER,
1866   p_resp_appl_id           	IN     NUMBER        := NULL,
1867   p_resp_id                	IN     NUMBER        := NULL,
1868   p_last_updated_by        	IN     NUMBER,
1869   p_last_update_login      	IN     NUMBER        := NULL,
1870   p_last_update_date       	IN     DATE,
1871   p_service_request_rec    	IN     service_request_rec_type,
1872   p_notes                  	IN     notes_table,
1873   p_contacts               	IN     contacts_table,
1874   p_called_by_workflow     	IN     VARCHAR2      := FND_API.G_FALSE,
1875   p_workflow_process_id    	IN     NUMBER        := NULL,
1876   -- Commented out since these are now part of the out rec type --anmukher--08/08/03
1877   -- x_workflow_process_id    	OUT NOCOPY NUMBER,
1878   -- x_interaction_id         	OUT NOCOPY NUMBER,
1879   ----------------anmukher--------------------08/08/03
1880   -- Added for 11.5.10 projects
1881   p_auto_assign		    	IN	VARCHAR2 Default 'N',
1882   p_validate_sr_closure	    	IN	VARCHAR2 Default 'N',
1883   p_auto_close_child_entities	IN	VARCHAR2 Default 'N',
1884   p_default_contract_sla_ind	IN      VARCHAR2 Default 'N',
1885   x_sr_update_out_rec		OUT NOCOPY	sr_update_out_rec_type
1886 );
1887 
1888 
1889 ----------------anmukher--------------08/08/03
1890 -- Overloaded procedure added for backward compatibility in 11.5.10
1891 -- since several new OUT parameters have been added to the 11.5.9 signature
1892 -- in the form of a new record type, sr_update_out_rec_type
1893 PROCEDURE Update_ServiceRequest(
1894   p_api_version            	IN     NUMBER,
1895   p_init_msg_list          	IN     VARCHAR2      := FND_API.G_FALSE,
1896   p_commit                 	IN     VARCHAR2      := FND_API.G_FALSE,
1897   x_return_status          	OUT NOCOPY VARCHAR2,
1898   x_msg_count              	OUT NOCOPY NUMBER,
1899   x_msg_data               	OUT NOCOPY VARCHAR2,
1900   p_request_id             	IN     NUMBER        := NULL,
1901   p_request_number         	IN     VARCHAR2      := NULL,
1902   p_audit_comments         	IN     VARCHAR2      := NULL,
1903   p_object_version_number  	IN     NUMBER,
1904   p_resp_appl_id           	IN     NUMBER        := NULL,
1905   p_resp_id                	IN     NUMBER        := NULL,
1906   p_last_updated_by        	IN     NUMBER,
1907   p_last_update_login      	IN     NUMBER        := NULL,
1908   p_last_update_date       	IN     DATE,
1909   p_service_request_rec    	IN     service_request_rec_type,
1910   p_notes                  	IN     notes_table,
1911   p_contacts               	IN     contacts_table,
1912   p_called_by_workflow     	IN     VARCHAR2      := FND_API.G_FALSE,
1913   p_workflow_process_id    	IN     NUMBER        := NULL,
1914   p_default_contract_sla_ind	IN      VARCHAR2 Default 'N',
1915   x_workflow_process_id    	OUT NOCOPY NUMBER,
1916   x_interaction_id         	OUT NOCOPY NUMBER
1917   );
1918 
1919 -- -------------------------------------------------------------------
1920 -- Start of comments
1921 --  API Name	: Update_Status
1922 --  Type	: Public
1923 --  Description	: Update the status of a service request
1924 --  Pre-reqs	: None
1925 --
1926 --  Standard IN Parameters:
1927 --	p_api_version			IN	NUMBER		Required
1928 --	p_init_msg_list			IN	VARCHAR2	Optional
1929 --		Default = FND_API.G_FALSE
1930 --	p_commit			IN	VARCHAR2	Optional
1931 --		Default = FND_API.G_FALSE
1932 --
1933 --  Standard OUT Parameters:
1934 --	p_return_status			OUT	VARCHAR2(1)
1935 --	p_msg_count			OUT	NUMBER
1936 --	p_msg_data			OUT	VARCHAR2(2000)
1937 --
1938 --  Service Request IN Parameters:
1939 --	p_resp_appl_id			IN	NUMBER		Optional
1940 --		Default = NULL
1941 --	p_resp_id			IN	NUMBER		Optional
1942 --		Default = NULL
1943 --	p_user_id			IN	NUMBER		Optional
1944 --		Default = NULL
1945 --	p_login_id			IN	NUMBER		Optional
1946 --		Default = FND_API.G_MISS_NUM
1947 
1948 ----------------------------------------------------
1949 --   Not in the API
1950 --      p_org_id			IN	NUMBER		Optional
1951 --		Default = NULL
1952 ------------------------------------------------------------
1953 
1954 
1955 
1956 --	p_request_id			IN	NUMBER		Optional
1957 --		Default = NULL
1958 --	p_request_number		IN	VARCHAR2	Optional
1959 --		Default = NULL
1960 --	p_status_id			IN	NUMBER		Optional
1961 --		Default = NULL
1962 --	p_status			IN	VARCHAR2	Optional
1963 --		Default = NULL
1964 --      p_closed_date			IN	DATE		Optional
1965 --		Default = FND_API.G_MISS_DATE
1966 --	p_audit_comments		IN	VARCHAR2	Optional
1967 --		Default = NULL
1971 --		Whether or not this API is being called by the active workflow
1968 --		Used for the audit record.
1969 --	p_called_by_workflow		IN	NUMBER		Optional
1970 --		Default = FND_API.G_FALSE
1972 --		process of the service request.
1973 --	p_workflow_process_id		IN	NUMBER		Optional
1974 --		Default = NULL
1975 --		The workflow process ID of the active workflow process.
1976 --
1977 --  Calls IN parameters:
1978 --	p_comments			IN	VARCHAR2(2000)	Optional
1979 --		Service request comments or log of the conversation.
1980 --	p_public_comment_flag		IN	VARCHAR2(1)	Optional
1981 --		Indicate whether the service request comment is public (can be
1982 --		viewed by anyone).
1983 --
1984 --  Calls OUT parameters:
1985 --	p_call_id			OUT	NUMBER
1986 --		System generated ID of service request call
1987 --
1988 --  Version	: Initial Version	1.0
1989 --
1990 --  Notes:	: Either p_request_id or p_request_number must be non-null.
1991 --		  If both are passed in, p_request_number will be ignored
1992 --
1993 --		  Either p_Status or p_Status_id must be passed in. If
1994 --		  both are passed in, the value of p_Status will be ignore.
1995 --
1996 --		  The status of the service request can be updated to a
1997 --		  "closed" status (statuses whose close_flag is set) when
1998 --		  there is an active workflow process. In that case, the API
1999 --		  will abort the active workflow process. When the API is
2000 --		  being called by the process itself, the caller must pass in
2001 --		  the workflow process ID of the active workflow process for
2002 --		  verification.
2003 --
2004 --		  If the new status is a "closed" status, then the value
2005 --		  of p_closed_date will be used to set the close date of
2006 -- 		  the service request.  If p_closed_date is not passed
2007 --                in, sysdate will be defaulted.
2008 --
2009 -- End of comments
2010 -- -------------------------------------------------------------------
2011 /*#
2012  * Updates the status of an existing service request.
2013  * For details on the parameters, please refer to the document on Metalink from the URL provided above.
2014  *
2015  * @rep:scope public
2016  * @rep:lifecycle active
2017  * @rep:compatibility S
2018  * @rep:displayname Update Service Request Status
2019  * @rep:primaryinstance
2020  * @rep:metalink 390479.1 Oracle White Paper : Service Request Public Application Programming Interfaces (APIs)
2021 */
2022 
2023 /**** Above text has been added to enable the integration repository to extract the data
2024       from the source code file and populate the integration repository schema so that
2025       Update_Status API appears in the integration repository.
2026 ****/
2027 
2028 PROCEDURE Update_Status
2029 ( p_api_version		IN	NUMBER,
2030   p_init_msg_list	IN	VARCHAR2 := FND_API.G_FALSE,
2031   p_commit		    IN	VARCHAR2 := FND_API.G_FALSE,
2032   x_return_status	OUT	NOCOPY VARCHAR2,
2033   x_msg_count		OUT	NOCOPY NUMBER,
2034   x_msg_data		OUT	NOCOPY VARCHAR2,
2035   p_resp_appl_id	IN	NUMBER   := NULL,
2036   p_resp_id		    IN	NUMBER   := NULL,
2037   p_user_id		    IN	NUMBER   := NULL,
2038   p_login_id		IN	NUMBER   := FND_API.G_MISS_NUM,
2039   p_request_id		IN	NUMBER   := NULL,
2040   p_request_number	IN	VARCHAR2 := NULL,
2041   p_object_version_number IN NUMBER,
2042   p_status_id		IN	NUMBER   := NULL,
2043   p_status		    IN	VARCHAR2 := NULL,
2044   p_closed_date		IN	DATE     := FND_API.G_MISS_DATE,
2045   p_audit_comments	     IN	VARCHAR2 := NULL,
2046   p_called_by_workflow	 IN	VARCHAR2 := FND_API.G_FALSE,
2047   p_workflow_process_id	 IN	NUMBER   := NULL,
2048   p_comments		     IN	VARCHAR2 := NULL,
2049   p_public_comment_flag	 IN	VARCHAR2 := FND_API.G_FALSE,
2050   p_validate_sr_closure         IN      VARCHAR2 Default 'N',
2051   p_auto_close_child_entities   IN      VARCHAR2 Default 'N',
2052   x_interaction_id		 OUT	NOCOPY NUMBER
2053 );
2054 
2055 -- -------------------------------------------------------------------
2056 -- Start of comments
2057 --  API Name	: Update_Severity
2058 --  Type	: Public
2059 --  Description	: Update the severity of a service request
2060 --  Pre-reqs	: None
2061 --
2062 --  Standard IN Parameters:
2063 --	p_api_version			IN	NUMBER		Required
2064 --	p_init_msg_list			IN	VARCHAR2	Optional
2065 --		Default = FND_API.G_FALSE
2066 --	p_commit			IN	VARCHAR2	Optional
2067 --		Default = FND_API.G_FALSE
2068 --
2069 --  Standard OUT Parameters:
2070 --	p_return_status			OUT	VARCHAR2(1)
2071 --	p_msg_count			OUT	NUMBER
2072 --	p_msg_data			OUT	VARCHAR2(2000)
2073 --
2074 --  Service Request IN Parameters:
2075 --	p_resp_appl_id			IN	NUMBER		Optional
2076 --		Default = NULL
2077 --	p_resp_id			IN	NUMBER		Optional
2078 --		Default = NULL
2079 --	p_user_id			IN	NUMBER		Optional
2080 --		Default = NULL
2081 --	p_login_id			IN	NUMBER		Optional
2082 --		Default = FND_API.G_MISS_NUM
2083 
2084 ---------------------------------------------------
2085 --      Not in the API
2086 --      p_org_id			IN	NUMBER		Optional
2087 --		Default = NULL
2088 ---------------------------------
2089 
2090 --	p_request_id			IN	NUMBER		Optional
2091 --		Default = NULL
2092 --	p_request_number		IN	VARCHAR2	Optional
2093 --		Default = NULL
2094 --	p_severity_id			IN	NUMBER		Optional
2095 --		Default = NULL
2096 --	p_severity			IN	VARCHAR2	Optional
2097 --		Default = NULL
2098 --	p_audit_comments		IN	VARCHAR2	Optional
2099 --		Default = NULL
2100 --		Used for the audit record.
2101 --
2105 --	p_public_comment_flag		IN	VARCHAR2(1)	Optional
2102 --  Calls IN parameters:
2103 --	p_comments			IN	VARCHAR2(2000)	Optional
2104 --		Service request comments or log of the conversation.
2106 --		Indicate whether the service request comment is public (can be
2107 --		viewed by anyone).
2108 --
2109 --  Calls OUT parameters:
2110 --	p_call_id			OUT	NUMBER
2111 --		System generated ID of service request call
2112 --
2113 --  Version	: Initial Version	1.0
2114 --
2115 --  Notes:	: Either p_request_id or p_request_number must be non-null.
2116 --		  If both are passed in, p_request_number will be ignored
2117 --
2118 --		  Either p_severity or p_severity_id must be passed in. If
2119 --		  both are passed in, the value of p_severity will be ignore.
2120 --
2121 -- End of comments
2122 -- -------------------------------------------------------------------
2123 
2124 PROCEDURE Update_Severity
2125 ( p_api_version		IN	NUMBER,
2126   p_init_msg_list	IN	VARCHAR2 := FND_API.G_FALSE,
2127   p_commit		    IN	VARCHAR2 := FND_API.G_FALSE,
2128   x_return_status	OUT	NOCOPY VARCHAR2,
2129   x_msg_count		OUT	NOCOPY NUMBER,
2130   x_msg_data		OUT	NOCOPY VARCHAR2,
2131   p_resp_appl_id	IN	NUMBER   := NULL,
2132   p_resp_id		    IN	NUMBER   := NULL,
2133   p_user_id		    IN	NUMBER   := NULL,
2134   p_login_id		IN	NUMBER   := FND_API.G_MISS_NUM,
2135   p_request_id		IN	NUMBER   := NULL,
2136   p_request_number	IN	VARCHAR2 := NULL,
2137   p_object_version_number IN NUMBER,
2138   p_severity_id		IN	NUMBER   := NULL,
2139   p_severity		IN	VARCHAR2 := NULL,
2140   p_audit_comments	IN	VARCHAR2 := NULL,
2141   p_comments		IN	VARCHAR2 := NULL,
2142   p_public_comment_flag	IN	VARCHAR2 := FND_API.G_FALSE,
2143   x_interaction_id  OUT NOCOPY NUMBER
2144 );
2145 
2146 -- -------------------------------------------------------------------
2147 -- Start of comments
2148 --  API Name	: Update_Urgency
2149 --  Type	: Public
2150 --  Description	: Update the urgency of a service request
2151 --  Pre-reqs	: None
2152 --
2153 --  Standard IN Parameters:
2154 --	p_api_version			IN	NUMBER		Required
2155 --	p_init_msg_list			IN	VARCHAR2	Optional
2156 --		Default = FND_API.G_FALSE
2157 --	p_commit			IN	VARCHAR2	Optional
2158 --		Default = FND_API.G_FALSE
2159 --
2160 --  Standard OUT Parameters:
2161 --	p_return_status			OUT	VARCHAR2(1)
2162 --	p_msg_count			OUT	NUMBER
2163 --	p_msg_data			OUT	VARCHAR2(2000)
2164 --
2165 --  Service Request IN Parameters:
2166 --	p_resp_appl_id			IN	NUMBER		Optional
2167 --		Default = NULL
2168 --	p_resp_id			IN	NUMBER		Optional
2169 --		Default = NULL
2170 --	p_user_id			IN	NUMBER		Optional
2171 --		Default = NULL
2172 --	p_login_id			IN	NUMBER		Optional
2173 --		Default = FND_API.G_MISS_NUM
2174 
2175 ----------------------------------------------
2176 --      Not in the API
2177 
2178 --      p_org_id			IN	NUMBER		Optional
2179 --		Default = NULL
2180 
2181 -------------------------------------------------------
2182 --	p_request_id			IN	NUMBER		Optional
2183 --		Default = NULL
2184 --	p_request_number		IN	VARCHAR2	Optional
2185 --		Default = NULL
2186 --	p_urgency_id			IN	NUMBER		Optional
2187 --		Default = FND_API.G_MISS_NUM
2188 --	p_urgency			IN	VARCHAR2	Optional
2189 --		Default = FND_API.G_MISS_CHAR
2190 --	p_audit_comments		IN	VARCHAR2	Optional
2191 --		Default = NULL
2192 --		Used for the audit record.
2193 --
2194 --  Calls IN parameters:
2195 --	p_comments			IN	VARCHAR2(2000)	Optional
2196 --		Service request comments or log of the conversation.
2197 --	p_public_comment_flag		IN	VARCHAR2(1)	Optional
2198 --		Indicate whether the service request comment is public (can be
2199 --		viewed by anyone).
2200 --
2201 --  Calls OUT parameters:
2202 --	p_call_id			OUT	NUMBER
2203 --		System generated ID of service request call
2204 --
2205 --  Version	: Initial Version	1.0
2206 --
2207 --  Notes:	: Either p_request_id or p_request_number must be non-null.
2208 --		  If both are passed in, p_request_number will be ignored
2209 --
2210 --		  Either p_urgency or p_urgency_id must be passed in. If
2211 --		  both are passed in, the value of p_urgency will be ignore.
2212 --
2213 -- End of comments
2214 -- -------------------------------------------------------------------
2215 
2216 PROCEDURE Update_Urgency
2217 ( p_api_version		IN	NUMBER,
2218   p_init_msg_list	IN	VARCHAR2 := FND_API.G_FALSE,
2219   p_commit		    IN	VARCHAR2 := FND_API.G_FALSE,
2220   x_return_status	OUT	NOCOPY VARCHAR2,
2221   x_msg_count		OUT	NOCOPY NUMBER,
2222   x_msg_data		OUT	NOCOPY VARCHAR2,
2223   p_resp_appl_id	IN	NUMBER   := NULL,
2224   p_resp_id		    IN	NUMBER   := NULL,
2225   p_user_id		    IN	NUMBER   := NULL,
2226   p_login_id		IN	NUMBER   := FND_API.G_MISS_NUM,
2227   p_request_id		IN	NUMBER   := NULL,
2228   p_request_number	IN	VARCHAR2 := NULL,
2229   p_object_version_number IN NUMBER,
2230   p_urgency_id		IN	NUMBER   := FND_API.G_MISS_NUM,
2231   p_urgency		    IN	VARCHAR2 := FND_API.G_MISS_CHAR,
2232   p_audit_comments	IN	VARCHAR2 := NULL,
2233   p_comments		IN	VARCHAR2 := NULL,
2234   p_public_comment_flag	IN	VARCHAR2 := FND_API.G_FALSE,
2235   x_interaction_id  OUT NOCOPY NUMBER
2236 );
2237 
2238 
2239 -- -------------------------------------------------------------------
2240 -- Start of comments
2241 --  API Name	: Update_Owner
2242 --  Type	: Public
2243 --  Description	: Update the owner of a service request
2247 --  Standard IN Parameters:
2244 --  Pre-reqs	: Parameter p_owner_id must be a valid employee ID of
2245 --                an active employee in HR
2246 --
2248 --	p_api_version			IN	NUMBER		Required
2249 --	p_init_msg_list			IN	VARCHAR2	Optional
2250 --		Default = FND_API.G_FALSE
2251 --	p_commit			IN	VARCHAR2	Optional
2252 --		Default = FND_API.G_FALSE
2253 --
2254 --  Standard OUT Parameters:
2255 --	p_return_status			OUT	VARCHAR2(1)
2256 --	p_msg_count			OUT	NUMBER
2257 --	p_msg_data			OUT	VARCHAR2(2000)
2258 --
2259 --  Service Request IN Parameters:
2260 --	p_resp_appl_id			IN	NUMBER		Optional
2261 --		Default = NULL
2262 --	p_resp_id			IN	NUMBER		Optional
2263 --		Default = NULL
2264 --	p_user_id			IN	NUMBER		Optional
2265 --		Default = NULL
2266 --	p_login_id			IN	NUMBER		Optional
2267 --		Default = FND_API.G_MISS_NUM
2268 
2269 -----------------------------------------
2270 --     Not in the API
2271 --      p_org_id			IN	NUMBER		Optional
2272 --		Default = NULL
2273 -----------------------------------------------
2274 
2275 --	p_request_id			IN	NUMBER		Optional
2276 --		Default = NULL
2277 --	p_request_number		IN	VARCHAR2	Optional
2278 --		Default = NULL
2279 --	p_Owner_id			IN	NUMBER		Required
2280 --		Cannot be NULL.
2281 --	p_audit_comments		IN	VARCHAR2	Optional
2282 --		Default = NULL
2283 --		Used for the audit record.
2284 --	p_called_by_workflow		IN	NUMBER		Optional
2285 --		Default = FND_API.G_FALSE
2286 --		Whether or not this API is being called by the active workflow
2287 --		process of the service request.
2288 --	p_workflow_process_id		IN	NUMBER		Optional
2289 --		Default = NULL
2290 --		The workflow process ID of the active workflow process.
2291 --
2292 --  Calls IN parameters:
2293 --	p_comments			IN	VARCHAR2(2000)	Optional
2294 --		Service request comments or log of the conversation.
2295 --	p_public_comment_flag		IN	VARCHAR2(1)	Optional
2296 --		Indicate whether the service request comment is public (can be
2297 --		viewed by anyone).
2298 --
2299 --  Calls OUT parameters:
2300 --	p_call_id			OUT	NUMBER
2301 --		System generated ID of service request call
2302 --
2303 --  Version	: Initial Version	1.0
2304 --
2305 --  Notes:	: Either p_request_id or p_request_number must be non-null.
2306 --		  If both are passed in, p_request_number will be ignored
2307 --
2308 --		  The owner of the service request cannot be updated when
2309 --		  there is an active workflow process unless the API is
2310 --    		  being called by the process itself.  In that case, the
2311 --      	  caller must pass in the workflow process ID of the active
2312 --                workflow process for verification.
2313 --
2314 -- End of comments
2315 -- -------------------------------------------------------------------
2316 /*#
2317  * Updates both the group and the individual owner of an existing service request.
2318  * For details on the parameters, please refer to the document on Metalink from the URL provided above.
2319  *
2320  * @rep:scope public
2321  * @rep:lifecycle active
2322  * @rep:compatibility S
2323  * @rep:displayname Update Service Request Owner
2324  * @rep:primaryinstance
2325  * @rep:metalink 390479.1 Oracle White Paper : Service Request Public Application Programming Interfaces (APIs)
2326 */
2327 
2328 /**** Above text has been added to enable the integration repository to extract the data
2329       from the source code file and populate the integration repository schema so that
2330       Update_Owner API appears in the integration repository.
2331 ****/
2332 
2333 PROCEDURE Update_Owner
2334 ( p_api_version		IN	NUMBER,
2335   p_init_msg_list	IN	VARCHAR2 := FND_API.G_FALSE,
2336   p_commit		    IN	VARCHAR2 := FND_API.G_FALSE,
2337   x_return_status	OUT	NOCOPY VARCHAR2,
2338   x_msg_count		OUT	NOCOPY NUMBER,
2339   x_msg_data		OUT	NOCOPY VARCHAR2,
2340   p_resp_appl_id	IN	NUMBER   := NULL,
2341   p_resp_id		    IN	NUMBER   := NULL,
2342   p_user_id		    IN	NUMBER   := NULL,
2343   p_login_id		IN	NUMBER   := FND_API.G_MISS_NUM,
2344   p_request_id		IN	NUMBER   := NULL,
2345   p_request_number	IN	VARCHAR2 := NULL,
2346   p_object_version_number IN NUMBER,
2347   p_owner_id		IN	NUMBER,
2348   p_owner_group_id  IN   NUMBER,
2349   p_resource_type	IN	VARCHAR2,
2350   p_audit_comments	IN	VARCHAR2 := NULL,
2351   p_called_by_workflow	IN	VARCHAR2 := FND_API.G_FALSE,
2352   p_workflow_process_id	IN	NUMBER   := NULL,
2353   p_comments		    IN	VARCHAR2 := NULL,
2354   p_public_comment_flag	IN	VARCHAR2 := FND_API.G_FALSE,
2355   x_interaction_id  OUT NOCOPY NUMBER
2356 );
2357 
2358 -- -------------------------------------------------------------------
2359 -- Start of comments
2360 --  API Name	: Update_Problem_Code
2361 --  Type	: Public
2362 --  Description	: Update the problem code of a service request
2363 --  Pre-reqs	: None
2364 --
2365 --  Standard IN Parameters:
2366 --	p_api_version			IN	NUMBER		Required
2367 --	p_init_msg_list			IN	VARCHAR2	Optional
2368 --		Default = FND_API.G_FALSE
2369 --	p_commit			IN	VARCHAR2	Optional
2370 --		Default = FND_API.G_FALSE
2371 --
2372 --  Standard OUT Parameters:
2373 --	p_return_status			OUT	VARCHAR2(1)
2374 --	p_msg_count			OUT	NUMBER
2375 --	p_msg_data			OUT	VARCHAR2(2000)
2376 --
2377 --  Service Request IN Parameters:
2378 --	p_resp_appl_id			IN	NUMBER		Optional
2379 --		Default = NULL
2380 --	p_resp_id			IN	NUMBER		Optional
2381 --		Default = NULL
2385 --		Default = FND_API.G_MISS_NUM
2382 --	p_user_id			IN	NUMBER		Optional
2383 --		Default = NULL
2384 --	p_login_id			IN	NUMBER		Optional
2386 
2387 ---------------------------------
2388 --     Not in API
2389 --      p_org_id			IN	NUMBER		Optional
2390 --		Default = NULL
2391 
2392 -----------------------------
2393 
2394 
2395 --	p_request_id			IN	NUMBER		Optional
2396 --		Default = NULL
2397 --	p_request_number		IN	VARCHAR2	Optional
2398 --		Default = NULL
2399 --      p_problem_code			IN	VARCHAR2	Required
2400 --
2401 --  Calls IN parameters:
2402 --	p_comments			IN	VARCHAR2(2000)	Optional
2403 --		Service request comments or log of the conversation.
2404 --	p_public_comment_flag		IN	VARCHAR2(1)	Optional
2405 --		Indicate whether the service request comment is public (can be
2406 --		viewed by anyone).
2407 --
2408 --  Calls OUT parameters:
2409 --	p_call_id			OUT	NUMBER
2410 --		System generated ID of service request call
2411 --
2412 --  Version	: Initial Version	1.0
2413 --
2414 --  Notes:	: Either p_request_id or p_request_number must be non-null.
2415 --		  If both are passed in, p_request_number will be ignored
2416 --
2417 -- End of comments
2418 -- -------------------------------------------------------------------
2419 
2420 PROCEDURE Update_Problem_Code
2421 ( p_api_version		IN	NUMBER,
2422   p_init_msg_list	IN	VARCHAR2 := FND_API.G_FALSE,
2423   p_commit		    IN	VARCHAR2 := FND_API.G_FALSE,
2424   x_return_status	OUT	NOCOPY VARCHAR2,
2425   x_msg_count		OUT	NOCOPY NUMBER,
2426   x_msg_data		OUT	NOCOPY VARCHAR2,
2427   p_resp_appl_id	IN	NUMBER   := NULL,
2428   p_resp_id		    IN	NUMBER   := NULL,
2429   p_user_id		    IN	NUMBER   := NULL,
2430   p_login_id		IN	NUMBER   := FND_API.G_MISS_NUM,
2431   p_request_id		IN	NUMBER   := NULL,
2432   p_request_number	IN	VARCHAR2 := NULL,
2433   p_object_version_number IN NUMBER,
2434   p_problem_code	IN	VARCHAR2,
2435   p_comments		IN	VARCHAR2 := NULL,
2436   p_public_comment_flag	IN	VARCHAR2 := FND_API.G_FALSE,
2437   x_interaction_id  OUT NOCOPY NUMBER
2438 );
2439 
2440 
2441 -------------------------------------------------------------------
2442 ---These APIs are owned by Shih-Hsin
2443 -- Start of comments
2444 --  API Name    : Link_KB_Statement
2445 --  Type        : Public
2446 --  Function    : Link a Knowledge Management statement with a Service Request
2447 --  Pre-reqs    : Must a valid Service Request id and KB Element id
2448 --
2449 --  Parameters  :
2450 --      IN      :
2451 --   p_api_version            IN   NUMBER         Required
2452 --   p_init_msg_list               IN   VARCHAR2(1)    Optional
2453 --        Default = FND_API.G_FALSE
2454 --   p_commit            IN   VARCHAR2(1)    Optional
2455 --        Default = FND_API.G_FALSE
2456 --      p_request_id                    IN      NUMBER          Required
2457 --      p_statement_id                  IN      NUMBER          Required
2458 --      p_is_statement_true             IN      BOOLEAN         Required
2459 --
2460 --      OUT     :
2461 --   x_return_status               OUT  VARCHAR2(1)
2462 --   x_msg_count              OUT  NUMBER
2463 --   x_msg_data               OUT  VARCHAR2(2000)
2464 --      x_statement_link_id             OUT     NUMBER
2465 --
2466 --  Version     : Initial Version     1.0
2467 --
2468 --  Notes       : This procedure will link a statement in the knowledge
2469 --                management system to a service request.
2470 --
2471 -- End of comments
2472 
2473 PROCEDURE Link_KB_Statement
2474 (
2475  p_api_version            IN     NUMBER,
2476  p_init_msg_list          IN     VARCHAR2      := FND_API.G_FALSE,
2477  p_commit                 IN     VARCHAR2      := FND_API.G_FALSE,
2478  p_validation_level       IN     NUMBER        := FND_API.G_VALID_LEVEL_FULL,
2479  x_return_status          OUT    NOCOPY VARCHAR2,
2480  x_msg_count              OUT    NOCOPY NUMBER,
2481  x_msg_data               OUT    NOCOPY VARCHAR2,
2482  p_request_id             IN     NUMBER,
2483  p_statement_id           IN     NUMBER,
2484  p_is_statement_true      IN     VARCHAR2,
2485  x_statement_link_id      OUT    NOCOPY NUMBER
2486 );
2487 
2488 -------------------------------------------------------------------------
2489 -- Start of comments
2490 --  API Name    : Link_KB_Solution
2491 --  Type        : Public
2492 --  Function    : Link a Knowledge Management solution with a Service Request
2493 --  Pre-reqs    : Must a valid Service Request id and KB Set id
2494 --
2495 --  Parameters  :
2496 --      IN      :
2497 --   p_api_version            IN   NUMBER         Required
2498 --   p_init_msg_list               IN   VARCHAR2(1)    Optional
2499 --        Default = FND_API.G_FALSE
2500 --   p_commit            IN   VARCHAR2(1)    Optional
2501 --        Default = FND_API.G_FALSE
2502 --      p_request_id                    IN      NUMBER          Required
2503 --      p_solution_id                   IN      NUMBER          Required
2504 --      p_is_solution_true              IN      BOOLEAN         Required
2505 --
2506 --      OUT     :
2507 --   x_return_status               OUT  VARCHAR2(1)
2508 --   x_msg_count              OUT  NUMBER
2509 --   x_msg_data               OUT  VARCHAR2(2000)
2510 --      x_solution_link_id              OUT     NUMBER
2511 --
2512 --  Version     : Initial Version     1.0
2513 --
2517 -- End of comments
2514 --  Notes       : This procedure will link a solution in the knowledge
2515 --                management system to a service request.
2516 --
2518 
2519 /*#
2520  * Links an Oracle Knowledge Base solution to an existing service request.
2521  * For details on the parameters, please refer to the document on Metalink from the URL provided above.
2522  *
2523  * @rep:scope public
2524  * @rep:lifecycle active
2525  * @rep:compatibility S
2526  * @rep:displayname Link Knowledge Base Solution
2527  * @rep:primaryinstance
2528  * @rep:businessevent  oracle.apps.cs.knowledge.SolutionLinked
2529  * @rep:metalink 390479.1 Oracle White Paper : Service Request Public Application Programming Interfaces (APIs)
2530 */
2531 
2532 /**** Above text has been added to enable the integration repository to extract the data
2533       from the source code file and populate the integration repository schema so that
2534       Link_KB_Solution API appears in the integration repository.
2535 ****/
2536 
2537 PROCEDURE Link_KB_Solution
2538 (
2539  p_api_version            IN     NUMBER,
2540  p_init_msg_list          IN     VARCHAR2      := FND_API.G_FALSE,
2541  p_commit                 IN     VARCHAR2      := FND_API.G_FALSE,
2542  p_validation_level       IN     NUMBER        := FND_API.G_VALID_LEVEL_FULL,
2543  x_return_status          OUT    NOCOPY VARCHAR2,
2544  x_msg_count              OUT    NOCOPY NUMBER,
2545  x_msg_data               OUT    NOCOPY VARCHAR2,
2546  p_request_id             IN     NUMBER,
2547  p_solution_id            IN     NUMBER,
2548  p_is_solution_true       IN     VARCHAR2,
2549  x_solution_link_id       OUT    NOCOPY NUMBER
2550 );
2551 
2552 /* This is a overloaded procedure for create service request which is mainly
2553    created for making the changes for 1159 backward compatiable. This does not
2554    contain the following parameters:-
2555    x_individual_owner, x_group_owner, x_individual_type and p_auto_assign.
2556    and will call the above procedure with all these parameters and version
2557    as 3.0*/
2558 
2559 PROCEDURE Create_ServiceRequest
2560 ( p_api_version                   IN      NUMBER,
2561   p_init_msg_list                 IN      VARCHAR2      := FND_API.G_FALSE,
2562   p_commit                        IN      VARCHAR2      := FND_API.G_FALSE,
2563   x_return_status                 OUT     NOCOPY VARCHAR2,
2564   x_msg_count                     OUT     NOCOPY NUMBER,
2565   x_msg_data                      OUT     NOCOPY VARCHAR2,
2566   p_resp_appl_id                  IN      NUMBER                := NULL,
2567   p_resp_id                       IN      NUMBER                := NULL,
2568   p_user_id                       IN      NUMBER                := NULL,
2569   p_login_id                      IN      NUMBER                := NULL,
2570   p_org_id                        IN      NUMBER                := NULL,
2571   p_request_id                    IN      NUMBER                := NULL,
2572   p_request_number                IN      VARCHAR2              := NULL,
2573   p_service_request_rec           IN      SERVICE_REQUEST_REC_TYPE,
2574   p_notes                         IN      NOTES_TABLE,
2575   p_contacts                      IN      CONTACTS_TABLE,
2576   p_default_contract_sla_ind	  IN      VARCHAR2 Default 'N',
2577   x_request_id                    OUT     NOCOPY NUMBER,
2578   x_request_number                OUT     NOCOPY VARCHAR2,
2582 
2579   x_interaction_id                OUT     NOCOPY NUMBER,
2580   x_workflow_process_id           OUT     NOCOPY NUMBER
2581 );
2583 /*#
2584  * Updates the values of user-defined attributes (extensible attributes) for an existing service request.
2585  * Extensible attributes are used only by Customer Support, Service Desk, and Oracle Case Management.
2586  * For details on the parameters, please refer to the document on Metalink from the URL provided above.
2587  *
2588  * @rep:scope public
2589  * @rep:lifecycle active
2590  * @rep:compatibility S
2591  * @rep:displayname Process SR Extensible Attributes
2592  * @rep:primaryinstance
2593  * @rep:metalink 390479.1 Oracle White Paper : Service Request Public Application Programming Interfaces (APIs)
2597 , p_init_msg_list       IN         VARCHAR2 DEFAULT NULL
2594 */
2595 PROCEDURE process_sr_ext_attrs
2596 ( p_api_version         IN         NUMBER
2598 , p_commit              IN         VARCHAR2 DEFAULT NULL
2599 , p_incident_id         IN         NUMBER
2600 , p_ext_attr_grp_tbl    IN         CS_ServiceRequest_PUB.EXT_ATTR_GRP_TBL_TYPE
2601 , p_ext_attr_tbl        IN         CS_ServiceRequest_PUB.EXT_ATTR_TBL_TYPE
2602 , p_modified_by         IN         NUMBER   DEFAULT NULL
2603 , p_modified_on         IN         DATE     DEFAULT NULL
2604 , x_failed_row_id_list  OUT NOCOPY VARCHAR2
2605 , x_return_status       OUT NOCOPY VARCHAR2
2606 , x_errorcode           OUT NOCOPY NUMBER
2607 , x_msg_count           OUT NOCOPY NUMBER
2608 , x_msg_data            OUT NOCOPY VARCHAR2
2609 );
2610 -----------------------------------------------------------
2611 
2612 END CS_ServiceRequest_PUB;