DBA Data[Home] [Help]

PACKAGE: APPS.CS_SERVICEREQUEST_PUB

Source


1 PACKAGE CS_ServiceRequest_PUB AUTHID CURRENT_USER AS
2 /* $Header: cspsrs.pls 120.16.12020000.3 2013/01/30 05:45:23 lkullamb 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 by siahmed for 12.1.2 enhancement
280      site_number                VARCHAR2(30)  DEFAULT NULL,
281 	site_name                  VARCHAR2(240) DEFAULT NULL,
282 	addressee                  VARCHAR2(150) DEFAULT NULL,
283   -- Added for Enh# 2216664
284      owner                      VARCHAR2(360),
285      group_owner                VARCHAR2(60),
286   -- Added for Credit Card ER# 2255263 (UI ER#2208078)
287      cc_number                  VARCHAR2(48),
288      cc_expiration_date         DATE,
289      cc_type_code               VARCHAR(30),
290      cc_first_name              VARCHAR(250),
291      cc_last_name               VARCHAR(250),
292      cc_middle_name             VARCHAR(250),
293      cc_id                      NUMBER  ,
294      bill_to_account_id         NUMBER,         -- ER# 2433831
295      ship_to_account_id         NUMBER,         -- ER# 2433831
296      customer_phone_id   	NUMBER,         -- ER# 2463321
297      customer_email_id   	NUMBER,         -- ER# 2463321
298      -- Added for source changes for 1159 by shijain oct 11 2002
299      creation_program_code      VARCHAR2(30),
300      last_update_program_code   VARCHAR2(30),
301      -- Bill_to_party, ship_to_party
302      bill_to_party_id           NUMBER,
303      ship_to_party_id           NUMBER,
304      -- Conc request related fields
305      program_id                 NUMBER,
306      program_application_id     NUMBER,
307      conc_request_id            NUMBER, -- Renamed so that it doesn't clash with SR id
308      program_login_id           NUMBER,
309      -- Bill_to_site, ship_to_site
310      bill_to_site_id           NUMBER,
311      ship_to_site_id           NUMBER,
312      -- Added address related columns by shijain 4th dec 2002
313      incident_point_of_interest        Varchar2(240) ,
314      incident_cross_street             Varchar2(240) ,
315      incident_direction_qualifier      Varchar2(30),
316      incident_distance_qualifier       Varchar2(240) ,
317      incident_distance_qual_uom        Varchar2(30),
318      incident_address2                 Varchar2(240) ,
319      incident_address3                 Varchar2(240),
320      incident_address4                 Varchar2(240) ,
321      incident_address_style            Varchar2(30),
322      incident_addr_lines_phonetic      Varchar2(560) ,
323      incident_po_box_number            Varchar2(50) ,
324      incident_house_number             Varchar2(50),
325      incident_street_suffix            Varchar2(50) ,
326      incident_street                   Varchar2(150),
327      incident_street_number            Varchar2(50) ,
328      incident_floor                    Varchar2(50) ,
329      incident_suite                    Varchar2(50) ,
330      incident_postal_plus4_code        Varchar2(30) ,
331      incident_position                 Varchar2(50) ,
332      incident_location_directions      Varchar2(640),
333      incident_location_description     Varchar2(2000) ,
334      install_site_id                   NUMBER,
335      ------anmukher---------------07/31/03
336      -- Added for CMRO-EAM project of Release 11.5.10
337      item_serial_number			VARCHAR2(30),
338      owning_department_id		NUMBER,
339      -- Added for Misc ERs project of Release 11.5.10
340      -- Changed the default value to 'HZ_LOCATION' --anmukher --09/05/03
341      incident_location_type		VARCHAR2(30) Default 'HZ_LOCATION' ,
342      coverage_type                     VARCHAR2(30),    -- Addedd on 09/09/03 spusegao
343      maint_organization_id             NUMBER,
344      creation_date                     DATE,
345      created_by                        NUMBER,
346 	-- Credit Card 9358401
347 	instrument_payment_use_id         NUMBER,
348     --create for integration with oracle projects
349      project_id                       NUMBER DEFAULT FND_API.G_MISS_NUM,
350      project_task_id                  NUMBER DEFAULT FND_API.G_MISS_NUM,
351      expenditure_org_id                       NUMBER DEFAULT FND_API.G_MISS_NUM,
352      --14004721 . Additional SLA dates
353      sla_date_1				DATE,
354      sla_date_2				DATE,
355      sla_date_3				DATE,
356      sla_date_4				DATE,
357      sla_date_5				DATE,
358      sla_date_6				DATE,
359      sla_duration_1			NUMBER,
360      sla_duration_2			NUMBER,
361 	--15995804. Add price_list_header_id
362      price_list_header_id              NUMBER
363      );
364 
365 ----------anmukher--------------07/31/03
366 -- Added new record type for OUT parameters of Create API
367 -- so that future overloading of the API can be avoided
368 TYPE sr_create_out_rec_type IS RECORD
369 (
370   request_id			NUMBER,
371   request_number		VARCHAR2(64),
372   interaction_id		NUMBER,
373   workflow_process_id		NUMBER,
374   individual_owner		NUMBER,
375   group_owner			NUMBER,
376   individual_type		VARCHAR2(30),
377   auto_task_gen_status		VARCHAR2(3),
378   auto_task_gen_attempted	BOOLEAN Default FALSE,
379   field_service_task_created	BOOLEAN,
380   contract_service_id		NUMBER,
381   resolve_by_date		DATE,
382   respond_by_date		DATE,
383   resolved_on_date		DATE,
384   responded_on_date		DATE,
385   --added by siahmed for 12.1.2 project
386   incident_location_id   NUMBER
387   );
388 
389 -- Added new record type for OUT parameters of Update API
390 -- so that future overloading of the API can be avoided
391 TYPE sr_update_out_rec_type IS RECORD
392 ( interaction_id        NUMBER
393 , workflow_process_id   NUMBER
394 , individual_owner      NUMBER
395 , group_owner           NUMBER
396 , individual_type       VARCHAR2(30)
397 , resolved_on_date      DATE
398 , responded_on_date     DATE
399 , status_id             NUMBER
400 , close_date            DATE
401 --added by siahmed for 12.1.2 project
402 , incident_location_id  NUMBER
403 );
404 
405 -- Added a new record structure for extensible attributes header information
406 -- R12 functionality
407 -----------------------------------------------------------------------
408 -- Start of comments
409 --  Record Type     : ext_attr_grp_rec_type
410 --  Description     : Holds the Attribute Group, Primary Keys and context information for
411 --                    a business object
412 --  Fields     :
413 --
414 --  Row_identifier       REQUIRED
415 --  is the unique numeric identifier for this attribute
416 --  group row within a set of rows to be processed; no two EXT_ATTR_GRP_REC_TYPE
417 --  elements in any single API call can share the same ROW_IDENTIFIER value.
418 
419 --  pk_column_1          REQUIRED
420 --  Primary Key Identifier 1: This column maps to INCIDENT_ID in the CS_INCIDENTS_ALL_B for both
421 --  Service Request and Party Roles Extensible Attributes implementation
422 
423 --  pk_column_2          OPTIONAL
424 --  Primary Key Identifier 2: This column maps to PARTY_ID in the CS_SHZ_SR_CONTACT_POINTS table.
425 --  This should be null for Service Request Extensible Attributes.
426 --  This is REQUIRED for Party Roles Extensible Attributes.
427 
428 --  pk_column_3          OPTIONAL
429 --  Primary Key Identifier 3: This column maps to CONTACT_TYPE in the CS_SHZ_SR_CONTACT_POINTS table.
430 --  This should be null for Service Request Extensible Attributes.
431 --  This is REQUIRED for Party Roles Extensible Attributes.
432 
433 --  pk_column_4          OPTIONAL
434 --  Primary Key Identifier 4: This column maps to PARTY_ROLE_CODE in the CS_SHZ_SR_CONTACT_POINTS table.
435 --  This should be null for Service Request Extensible Attributes.
436 --  This is REQUIRED for Party Roles Extensible Attributes.
437 
438 --  pk_column_5          OPTIONAL
439 --  Primary Key Identifier 5: This column is for future use.  Currently it is not mapped to any Primary Key Identifier.
440 
441 --  context              REQUIRED
442 --  This is the classification for the business object:
443 --  For Service Request Business Object valid values are -1 or a valid SR Type ID
444 --  For Party Roles Business Object valid value a valid Party Role Code
445 
446 --  object_name          REQUIRED
447 --  Object Name for Object from FND_OBJECTS table
448 --  For Service Request Business Object valid value is 'CS_SR'
449 --  For Party Roles Business Object valid value is 'CS_PR'
450 
451 --  attr_group_id        OPTIONAL
452 --  Numeric Identifier for Attribute Group.  This is required for both the SR and PR Extensible Attributes implementation.
453 --  This is REQUIRED if the composite key comprising of attr_group_app_id, attr_group_type, attr_group_name IS NULL.
454 
455 --  attr_group_app_id    OPTIONAL
456 --  The value for this is 170 for the Service Request Module.  REQUIRED if attribute_group_id is NULL.
457 
458 --  attr_group_type      OPTIONAL
459 --  This is the descriptive flex seeded for implementing Extensible Attributes.  REQUIRED if attribute_group_id is NULL.
460 --  Service Request Extensible Attributes this value equals 'CS_SR_CONTEXT'
461 --  Party Roles Extensible Attributes this value equals 'CS_PR_CONTEXT'
462 
463 --  attr_group_name      OPTIONAL
464 --  This is a unique name for the attribute group.  REQUIRED if attribute_group_id is NULL.
465 
466 --  attr_group_disp_name            REQUIRED
467 --  This is the Attrbute Group Display (or user friendly) name.
468 
469 --  mapping_req          OPTIONAL
470 --  If the attributes sent through the attributes child table uses database columns instead of attribute_name then
471 --  this flag should be set to 'Y', else this flag should be 'N'.
472 
473 --  operation            REQUIRED
474 --  Valid operations are 'CREATE', 'UPDATE'.  The 'DELETE' operation is only handled through the HTML Service UI
475 
476 --------------------------------------------------------
477 
478 TYPE EXT_ATTR_GRP_REC_TYPE IS RECORD
479 ( row_identifier       number
480 , pk_column_1          varchar2(150)
481 , pk_column_2          varchar2(150)
482 , pk_column_3          varchar2(150)
483 , pk_column_4          varchar2(150)
484 , pk_column_5          varchar2(150)
485 , context              varchar2(150)
486 , object_name          varchar2(30)
487 , attr_group_id        number
488 , attr_group_app_id    number
489 , attr_group_type      varchar2(40)
490 , attr_group_name      varchar2(30)
491 , attr_group_disp_name varchar2(150)
492 , mapping_req          varchar2(1)
493 , operation            varchar2(30)
494    );
495 
496 TYPE EXT_ATTR_GRP_TBL_TYPE IS TABLE OF EXT_ATTR_GRP_REC_TYPE INDEX BY BINARY_INTEGER;
497 
498 
499 -- Added a new record structure for extensible attributes child information
500 -- R12 functionality
501 -----------------------------------------------------------------------
502 -- Start of comments
503 --  Record Type     : EXT_ATTR_REC_TYPE
504 --  Description     : This record structure holds data for one  attribute in an attribute group row
505 --  Fields     :
506 --
507 --  Row_identifier         REQUIRED
508 --  This is a foriegn key that associates the Attribute Group in the EXT_ATTR_GRP_REC_TYPE structure to the Attribute in
509 --  the EXT_ATTR_REC_TYPE structure .
510 
511 --  Column_name            OPTIONAL
512 --  This maps top the database column name that is setup for the attribute being passed.  If the user is using
513 --  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'
514 --  This is REQUIRED if Attr_Name is NULL
515 
516 --  Attr_name              OPTIONAL
517 --  This holds the internal name of the attribute. This is REQUIRED if Column_name is NULL.
518 
519 --  ATTR_DISP_NAME         OPTIONAL
520 --  This holds the display value or user friendly name of the Attribute
521 
522 --  ATTR_VALUE_STR         OPTIONAL
523 --  The value being passed for the attribute is stored in ATTR_VALUE_STR if
524 --  the attribute is a string.  This attribute is mutually exclusive to ATTR_VALUE_NUM,
525 --  ATTR_VALUE_DATE, ATTR_VALUE_DISPLAY.  At any time only one of these fields should be populated
526 
527 --  ATTR_VALUE_NUM         OPTIONAL
528 --  The value being passed for the attribute is stored in ATTR_VALUE_NUM if
529 --  the attribute is a Number.  This attribute is mutually exclusive to ATTR_VALUE_STR,
530 --  ATTR_VALUE_DATE, ATTR_VALUE_DISPLAY.  At any time only one of these fields should be populated
531 
532 --  ATTR_VALUE_DATE        OPTIONAL
533 --  The value being passed for the attribute is stored in ATTR_VALUE_DATE if
534 --  the attribute is a Date.  This attribute is mutually exclusive to ATTR_VALUE_NUM,
535 --  ATTR_VALUE_STR, ATTR_VALUE_DISPLAY.  At any time only one of these fields should be populated
536 
537 
538 --  ATTR_VALUE_DISPLAY     OPTIONAL
539 --  The value being passed for the attribute is stored in ATTR_VALUE_DISPLAY
540 --  if the attribute has a value set with distinct internal and display values
541 --  This attribute is mutually exclusive to ATTR_VALUE_NUM, ATTR_VALUE_DATE, ATTR_VALUE_STR.
542 --  At any time only one of these fields should be populated
543 
544 
545 --  ATTR_UNIT_OF_MEASURE   OPTIONAL
546 --  If the attribute is a number that has a Unit of Measure class associated
547 --  with it, ATTR_UNIT_OF_MEASURE stores the UOM Code for the Unit of Measure
548 --  in which the attribute's value will be displayed; however, the value
549 --  itself will always be passed in ATTR_VALUE_NUM in the base units for
550 --  the Unit of Measure class, not in the display units (unless they happen
551 --  to be the same).  For example, consider an attribute whose Unit of
552 --  Measure class is Length (a UOM Class whose base unit we will assume for
553 --  this example to be Centimeters).  If the caller wants data for this
554 --  attribute to be displayed in Feet (assuming its UOM_CODE is 'FT'),
555 --  then ATTR_UNIT_OF_MEASURE should be passed with 'FT'; however, no
556 --  matter in what unit the caller wants to display this attribute, the
557 --  value in ATTR_VALUE_NUM will always be the attribute's value as
558 --  expressed in Centimeters.
559 
560 --------------------------------------------------------
561 
562 TYPE EXT_ATTR_REC_TYPE IS RECORD
563 (row_identifier        number
564 , column_name          varchar2(30)
565 , attr_name            varchar2(150)
566 , attr_disp_name       varchar2(150)
567 , attr_value_str       varchar2(4000)
568 , attr_value_num       number
569 , attr_value_date      date
570 , attr_value_display   varchar2(4000)
571 , attr_unit_of_measure varchar2(3)
572     );
573 
574 TYPE EXT_ATTR_TBL_TYPE IS TABLE OF EXT_ATTR_REC_TYPE INDEX BY BINARY_INTEGER;
575 
576 
577 -- Added new table type for Security project of 11.5.10 --anmukher --08/18/03
578 -- This table type will be used to pass in and receive a table of resource IDs
579 -- in the new security procedure Validate_Resource
580 
581 TYPE Resource_Validate_Tbl_Type IS TABLE OF NUMBER
582 INDEX BY BINARY_INTEGER;
583 
584 PROCEDURE initialize_rec(
585   p_sr_record                   IN OUT NOCOPY service_request_rec_type
586 );
587 
588 -- Added for Credit Card ER# 2255263 (UI ER#2208078)
589 -- Added for encoding/decoding in Base64. Used for Credit Card
590 -- encoding / decoding
591 
592    TYPE vc2_table IS TABLE OF VARCHAR2(1) INDEX BY BINARY_INTEGER;
593    map  vc2_table;
594 
595 --start changes for get sr type changes for 12.2
596 
597 TYPE GET_SR_REC IS RECORD (
598     Incident_id                   cs_incidents_all_b.incident_id%TYPE  ,
599     Incident_number               cs_incidents_all_b.incident_number%TYPE  ,
600     incident_type_id              cs_incidents_all_b.incident_type_id%TYPE  ,
601     incident_type                 cs_incident_types_tl.name%TYPE  ,
602     incident_status_id            cs_incidents_all_b.incident_status_id%TYPE ,
603     Incident_status               cs_incident_statuses_tl.name%TYPE ,
604     incident_severity_id          cs_incidents_all_b.incident_severity_id%TYPE ,
605     Incident_severity             cs_incident_severities_tl.name%TYPE ,
606     Sev_importance_level          cs_incident_severities_b.importance_level%TYPE ,
607     incident_urgency_id           cs_incidents_all_b.incident_urgency_id%TYPE ,
608     Incidient_Urgency             cs_incident_urgencies_tl.name%TYPE ,
609     SR_Group_Id                   cs_incidents_all_b.owner_group_id%TYPE ,
610     SR_Group                      jtf_rs_groups_tl.group_name%TYPE ,
611     SR_Owner_id                   cs_incidents_all_b.incident_owner_id%TYPE ,
612     SR_owner                      jtf_rs_resource_extns_tl.resource_name%TYPE ,
613     Problem_Code_id               cs_incidents_all_b.problem_code%TYPE ,
614     Problem_Code                  FND_LOOKUP_VALUES.meaning%TYPE ,
615     Resolution_Code_id            cs_incidents_all_b.resolution_code%TYPE ,
616     Resolution_Code               FND_LOOKUP_VALUES.meaning%TYPE ,
617     Publish_Flag                  cs_incidents_all_b.publish_flag%TYPE ,
618     SR_Creation_Channel           FND_LOOKUP_VALUES.meaning%TYPE ,
619     Summary                       cs_incidents_all_tl.summary%TYPE ,
620     Resolution_Summary            cs_incidents_all_tl.resolution_summary%TYPE ,
621     Created_By                    fnd_user.user_name%TYPE ,
622     Contact_Party_id              cs_hz_sr_contact_points.party_id%TYPE ,
623     Contact_Type                  FND_LOOKUP_VALUES.meaning%TYPE ,
624     --special case
625     Contact_Name                  hz_parties.party_name%TYPE ,
626     Time_Zone_Id                 cs_incidents_all_b.time_zone_id%TYPE ,
627     Time_Zone_Name                hz_timezones.global_timezone_name%TYPE ,
628     Customer_ID                   cs_incidents_all_b.customer_id%TYPE ,
629     Customer_Number               hz_parties.party_number%TYPE ,
630     Customer_Name                 hz_parties.party_name%TYPE ,
631     Account_Id                    cs_incidents_all_b.account_id%TYPE ,
632     Account_Number                hz_cust_accounts.account_number%TYPE ,
633     Inventory_item_id             cs_incidents_all_b.inventory_item_id%TYPE ,
634     Product                       mtl_system_items_b_kfv.concatenated_segments%TYPE ,
635     Product_Description           mtl_system_items_tl.description%TYPE ,
636     creation_date                 cs_incidents_all_b.incident_date%TYPE ,
637     last_update_date              cs_incidents_all_b.incident_last_modified_date%TYPE ,
638     Incident_date                 cs_incidents_all_b.incident_occurred_date%TYPE ,
639     Close_date                    cs_incidents_all_b.close_date%TYPE ,
640     Date_Resolved                 cs_incidents_all_b.incident_resolved_date%TYPE  ,
641     Expected_Reaction_Date        cs_incidents_all_b.obligation_date%TYPE  ,
642     Expected_Resolution_Date      cs_incidents_all_b.expected_resolution_date%TYPE  ,
643     Date_First_Reacted            cs_incidents_all_b.inc_responded_by_date%TYPE  ,
644     Actual_Resolution_Date        cs_incidents_all_b.actual_resolution_date%TYPE  ,
645     Status_Sort_order             cs_incident_statuses_b.sort_order%TYPE  ,
646     Status_Flag_Code              cs_incidents_all_b.status_flag%TYPE  ,
647     Inc_Responded_By_Date         cs_incidents_all_b.inc_responded_by_date%TYPE  ,
648     Created_By_Id                 cs_incidents_all_b.created_by%TYPE  ,
649     Customer_Product_Id           cs_incidents_all_b.customer_product_id%TYPE  ,
650     Organization_Id               cs_incidents_all_b.org_id%TYPE  ,
651     Inventory_Org_id              cs_incidents_all_b.inv_organization_id%TYPE  ,
652     customer_phone                hz_parties.primary_phone_number%TYPE  ,
653     Customer_Email                hz_parties.email_address%TYPE  ,
654     Contract_Number               okc_k_headers_all_b.contract_number%TYPE  ,
655     Contract_Service_Description  mtl_system_items_b.description%TYPE  ,
656     Contract_Coverage_Description okc_k_lines_tl.item_description%TYPE  ,
657     Customer_Type                 FND_LOOKUP_VALUES.meaning%TYPE  ,
658     Contact_Phone_Number          per_phones.phone_number%TYPE  ,
659     Contact_Email                 per_all_people_f.email_address%TYPE  ,
660     Item_Category                 mtl_categories_b_kfv.concatenated_segments%TYPE  ,
661     Instance_Number               csi_item_instances.instance_number%TYPE  ,
662     Serial_Number                 csi_item_instances.serial_number%TYPE  ,
663     Tag_Number                    csi_item_instances.external_reference%TYPE  ,
664     System_Number                 CSI_SYSTEMS_TL.name%TYPE  ,
665     Component                    mtl_system_items_b_kfv.concatenated_segments%TYPE  ,
666     Sub_Component                mtl_system_items_b_kfv.concatenated_segments%TYPE  ,
667      item_revision                cs_incidents_all_b.inv_item_revision%TYPE  ,
668     Component_Revision           cs_incidents_all_b.inv_component_version%TYPE  ,
669     Sub_Component_Revision       csi_item_instances.inventory_revision%TYPE  ,
670     incident_Address              VARCHAR2(3000),
671     Resource_Type                 jtf_objects_tl.name%TYPE  ,
672     Attribute1                    cs_incidents_all_b.incident_attribute_1%TYPE  ,
673     Attribute2                    cs_incidents_all_b.incident_attribute_2%TYPE  ,
674     Attribute3                    cs_incidents_all_b.incident_attribute_3%TYPE  ,
675     Attribute4                    cs_incidents_all_b.incident_attribute_4%TYPE  ,
676     Attribute5                    cs_incidents_all_b.incident_attribute_5%TYPE  ,
677     Attribute6                    cs_incidents_all_b.incident_attribute_6%TYPE  ,
678     Attribute7                    cs_incidents_all_b.incident_attribute_7%TYPE  ,
679     Attribute8                    cs_incidents_all_b.incident_attribute_8%TYPE  ,
680     Attribute9                    cs_incidents_all_b.incident_attribute_9%TYPE  ,
681     Attribute10                   cs_incidents_all_b.incident_attribute_10%TYPE  ,
682     Attribute11                   cs_incidents_all_b.incident_attribute_11%TYPE  ,
683     Attribute12                   cs_incidents_all_b.incident_attribute_12%TYPE  ,
684     Attribute13                   cs_incidents_all_b.incident_attribute_13%TYPE  ,
685     Attribute14                   cs_incidents_all_b.incident_attribute_14%TYPE  ,
686     Attribute15                   cs_incidents_all_b.incident_attribute_15%TYPE  ,
687     Incident_Context              cs_incidents_all_b.incident_context%TYPE  ,
688     ExtAttribute1                 cs_incidents_all_b.external_attribute_1%TYPE  ,
689     ExtAttribute2                 cs_incidents_all_b.external_attribute_2%TYPE  ,
690     ExtAttribute3                 cs_incidents_all_b.external_attribute_3%TYPE  ,
691     ExtAttribute4                 cs_incidents_all_b.external_attribute_4%TYPE  ,
692     ExtAttribute5                 cs_incidents_all_b.external_attribute_5%TYPE  ,
693     ExtAttribute6                 cs_incidents_all_b.external_attribute_6%TYPE  ,
694     ExtAttribute7                 cs_incidents_all_b.external_attribute_7%TYPE  ,
695     ExtAttribute8                 cs_incidents_all_b.external_attribute_8%TYPE  ,
696     ExtAttribute9                 cs_incidents_all_b.external_attribute_9%TYPE  ,
697     ExtAttribute10                cs_incidents_all_b.external_attribute_10%TYPE  ,
698     ExtAttribute11                cs_incidents_all_b.external_attribute_11%TYPE  ,
699     ExtAttribute12                cs_incidents_all_b.external_attribute_12%TYPE  ,
700     ExtAttribute13                cs_incidents_all_b.external_attribute_13%TYPE  ,
701     ExtAttribute14                cs_incidents_all_b.external_attribute_14%TYPE  ,
702     ExtAttribute15                cs_incidents_all_b.external_attribute_15%TYPE  ,
703     ext_context                   cs_incidents_all_b.external_context%TYPE
704 );
705 
706 
707 
708 TYPE GET_SR_NOTES_REC IS RECORD (
709     NOTES                           JTF_NOTES_TL.NOTES%TYPE ,
710     NOTE_STATUS	                    JTF_NOTES_B.NOTE_STATUS%TYPE  ,
711     NOTES_DETAIL                    JTF_NOTES_TL.NOTES_DETAIL%TYPE  ,
712     CREATED_BY                      JTF_NOTES_B.CREATED_BY%TYPE );
713 TYPE sr_notes_table IS TABLE OF GET_SR_NOTES_REC INDEX BY BINARY_INTEGER;
714 
715 TYPE GET_SR_TASKS_REC IS RECORD (
716  task_type      		cs_sr_tasks_v.task_type%TYPE,
717  task_status			cs_sr_tasks_v.task_status%TYPE,
718  task_priority			cs_sr_tasks_v.task_priority%TYPE,
719  restrict_closure_flag		cs_sr_tasks_v.restrict_closure_flag%TYPE,
720  owner_type			cs_sr_tasks_v.owner_type%TYPE,
721  owner				cs_sr_tasks_v.owner%TYPE,
722  task_name			cs_sr_tasks_v.task_name%TYPE,
723  description			cs_sr_tasks_v.description%TYPE,
724  task_number			cs_sr_tasks_v.task_number%TYPE,
725  parent_task_number		cs_sr_tasks_v.parent_task_number%TYPE,
726  escalation_level		cs_sr_tasks_v.escalation_level%TYPE,
727  task_confirmation_status	cs_sr_tasks_v.task_confirmation_status%TYPE,
728  planned_start_date		cs_sr_tasks_v.planned_start_date%TYPE,
729  planned_end_date		cs_sr_tasks_v.planned_end_date%TYPE,
730  scheduled_start_date		cs_sr_tasks_v.scheduled_start_date%TYPE,
731  scheduled_end_date		cs_sr_tasks_v.scheduled_end_date%TYPE,
732  actual_start_date		cs_sr_tasks_v.actual_start_date%TYPE,
733  actual_end_date		cs_sr_tasks_v.actual_end_date%TYPE,
734  planned_effort			cs_sr_tasks_v.planned_effort%TYPE,
735  planned_effort_uom		cs_sr_tasks_v.planned_effort_uom%TYPE,
736  actual_effort			cs_sr_tasks_v.actual_effort%TYPE,
737  actual_effort_uom		cs_sr_tasks_v.actual_effort_uom%TYPE,
738  DURATION			cs_sr_tasks_v.DURATION%TYPE,
739  duration_uom			cs_sr_tasks_v.duration_uom%TYPE,
740  private_flag			cs_sr_tasks_v.private_flag%TYPE,
741  publish_flag			cs_sr_tasks_v.publish_flag%TYPE,
742  row_id				cs_sr_tasks_v.row_id%TYPE,
743  created_by			cs_sr_tasks_v.created_by%TYPE,
744  creation_date			cs_sr_tasks_v.creation_date%TYPE,
745  last_updated_by		cs_sr_tasks_v.last_updated_by%TYPE,
746  last_update_date		cs_sr_tasks_v.last_update_date%TYPE,
747  last_update_login		cs_sr_tasks_v.last_update_login%TYPE,
748  source_object_id		cs_sr_tasks_v.source_object_id%TYPE,
749  source_object_type_code	cs_sr_tasks_v.source_object_type_code%TYPE,
750  source_object_name		cs_sr_tasks_v.source_object_name%TYPE,
751  task_type_id			cs_sr_tasks_v.task_type_id%TYPE,
752  task_status_id			cs_sr_tasks_v.task_status_id%TYPE,
753  task_priority_id		cs_sr_tasks_v.task_priority_id%TYPE,
754  owner_id			cs_sr_tasks_v.owner_id%TYPE,
755  owner_territory_id		cs_sr_tasks_v.owner_territory_id%TYPE,
756  task_id			cs_sr_tasks_v.task_id%TYPE,
757  timezone_id			cs_sr_tasks_v.timezone_id%TYPE,
758  parent_task_id			cs_sr_tasks_v.parent_task_id%TYPE,
759  object_version_number		cs_sr_tasks_v.object_version_number%TYPE,
760  customer_id			cs_sr_tasks_v.customer_id%TYPE,
761  cust_account_id		cs_sr_tasks_v.cust_account_id%TYPE,
762  owner_type_code		cs_sr_tasks_v.owner_type_code%TYPE,
763  recurrence_rule_id		cs_sr_tasks_v.recurrence_rule_id%TYPE,
764  multi_booked_flag		cs_sr_tasks_v.multi_booked_flag%TYPE,
765  milestone_flag			cs_sr_tasks_v.milestone_flag%TYPE,
766  holiday_flag			cs_sr_tasks_v.holiday_flag%TYPE,
767  billable_flag			cs_sr_tasks_v.billable_flag%TYPE,
768  currency_code			cs_sr_tasks_v.currency_code%TYPE,
769  costs				cs_sr_tasks_v.costs%TYPE,
770  attribute1			cs_sr_tasks_v.attribute1%TYPE,
771  attribute2			cs_sr_tasks_v.attribute2%TYPE,
772  attribute3			cs_sr_tasks_v.attribute3%TYPE,
773  attribute4			cs_sr_tasks_v.attribute4%TYPE,
774  attribute5			cs_sr_tasks_v.attribute5%TYPE,
775  attribute6			cs_sr_tasks_v.attribute6%TYPE,
776  attribute7			cs_sr_tasks_v.attribute7%TYPE,
777  attribute8			cs_sr_tasks_v.attribute8%TYPE,
778  attribute9			cs_sr_tasks_v.attribute9%TYPE,
779  attribute10			cs_sr_tasks_v.attribute10%TYPE,
780  attribute11			cs_sr_tasks_v.attribute11%TYPE,
781  attribute12			cs_sr_tasks_v.attribute12%TYPE,
782  attribute13			cs_sr_tasks_v.attribute13%TYPE,
783  attribute14			cs_sr_tasks_v.attribute14%TYPE,
784  attribute15			cs_sr_tasks_v.attribute15%TYPE,
785  attribute_category		cs_sr_tasks_v.attribute_category%TYPE
786  );
787 
788 TYPE tasks_table IS TABLE OF GET_SR_TASKS_REC INDEX BY BINARY_INTEGER;
789 --end changes for 12.2
790 
791 --------------------------------------------------------------------------
792 -- Start of comments
793 --  API name	: Create_ServiceRequest
794 --  Type	: Public
795 --  Function	: Creates a service request in the table CS_INCIDENTS_ALL.
796 --  Pre-reqs	: None.
797 --
798 --  Standard IN Parameters:
799 --	p_api_version			IN	NUMBER		Required
800 --	p_init_msg_list			IN	VARCHAR2	Optional
801 --		Default = FND_API.G_FALSE
802 --	p_commit			IN	VARCHAR2	Optional
803 --		Default = FND_API.G_FALSE
804 --
805 --  Standard OUT Parameters:
806 --	x_return_status			OUT	VARCHAR2(1)
807 --	x_msg_count			OUT	NUMBER
808 --	x_msg_data			OUT	VARCHAR2(2000)
809 --
810 --  Service Request IN Parameters:
811 --	p_resp_appl_id			IN	NUMBER		Optional
812 --		Application identifier
813 --	p_resp_id			IN	NUMBER		Optional
814 --		Responsibility identifier
815 --	p_user_id			IN	NUMBER	        Optional
816 --		Application user identifier
817 --	p_login_id			IN	NUMBER		Optional
818 --		Login session identifier
819 --	p_org_id			IN	NUMBER		Optional
820 --		Operating unit identifier
821 --		Required if Multi-Org is enabled.
822 --		Ignored if Multi-Org is disabled.
823 --      p_request_id                    IN      NUMBER          Optional
824 --
825 --      p_request_number                IN      VARCHAR2        Optional
826 --
827 --      p_service_request_rec           IN     service_request_rec_type   Required
828 --
829 --      p_notes                         IN     notes_table      Optional
830 --
831 --
832 --      p_contacts                      IN     contacts_table   Required if CALLER TYPE IS
833 --                                                              ORGANIZATION OR PERSON
834 
835 --
836 --
837 
838 --------------------------------------------------------------------------
839 --  This parameter is no longer present in the PUBLIC API. The workflow
840 --  is always launched based on the autolaunch flag in the INCIDENT TYPES table
841 
842 --  Workflow IN parameters:
843 --	p_launch_workflow		IN	VARCHAR2(1)	Optional
844 --		If set to TRUE, the API will call the Workflow API to launch
845 --		a workflow process for this service request.
846 
847 --------------------------------------------------------------------------
848 --
849 --  Service Request OUT parameters:
850 --	x_request_id			OUT	NUMBER
851 --		System generated ID of service request.
852 --	x_request_number		OUT	VARCHAR2(64)
853 --		User-visible number of service request.
854 --
855 --
856 --  x_interaction_id                    OUT     NUMBER
857 --
858 --
859 
860 --------------------------------------------------------------------------
861 --
862 
863 --  Workflow OUT parameters:
864 --  x_workflow_process_id               OUT      NUMBER
865 ---------------------------------------------------------------------------------------
866 
867 
868 --  Calls IN parameters:
869 --	p_comments			IN	VARCHAR2(2000)	Optional
870 --		Service request comments or log of the conversation.
871 --	p_public_comment_flag		IN	VARCHAR2(1)	Optional
872 --		DEFAULT = FND_API.G_FALSE
873 --		Indicate whether the service request comment is public (can be
874 --		viewed by anyone).
875 --
876 --  Calls OUT parameters:
877 --	p_call_id			OUT	NUMBER
878 --		System generated ID of service request call.
879 --
880 --  Version : Initial version	1.0
881 -----------------------------------------------------------------------
882 -- Start of comments
883 --  Record Type     : Service_Request_Rec_Type
884 --  Description     : Holds the Service Request attributes for the
885 --                    Create_ServiceRequest Procedure.
886 --  Fields     :
887 --
888 --  The following fields are defaulted to the profile values if not
889 --  passed in the record type :
890 --  request_date, type_id, status_id, severity_id, urgency_id,
891 --  owner_id, resource_type
892 
893 --
894 --	request_date				DATE		Optional
895 --		Service request date. Must be non-null.
896 
897 --	type_id				       NUMBER		Optional
898 --		Service request type identifier. Must be non-null.
899 --   VAlid incident_type_id from cs_incident_types
900 
901 
902 --	type_name				VARCHAR2(30)	Optional
903 --		Service request type name.
904 
905 --	status_id				NUMBER		Optional
906 --		Service request status identifier. Must be non-null.
907 --   Valid incident_status_id  from cs_incident_statuses
908 
909 --	status_name				VARCHAR2(30)	Optional
910 --		Service request status name.
911 
912 --	severity_id				NUMBER		Optional
913 --		Service request severity identifier. Must be non-null.
914 --   Valid incident_severity_id from cs_incident_severities
915 
916 --	severity_name				VARCHAR2(30)	Optional
917 --		Service request severity name.
918 
919 --	urgency_id				NUMBER		Optional
920 --		Service request urgency identifier.
921 --   Valid incident_urgency_id  from cs_incident_urgencies
922 
923 
924 --	urgency_name				VARCHAR2(30)	Optional
925 --		Service request urgency name.
926 
927 --	closed_date				DATE		Optional
928 --		Service request closed date.
929 --		Ignored if the status is not a "closed" status.
930 
931 --	owner_id				NUMBER		Optional
932 --		Service request owner identifier. Must be non-null.
933 --   Valid resource_id from cs_sr_owners_v
934 --
935 --
936 --      owner_group_id                       NUMBER             Optional
937 
938 --      resource_type                 VARCHAR2(30)         Optional
939 --    VAlid resource_type from  cs_sr_owners_v
940 
941 --      resource_subtype_id           NUMBER               Optional
942 
943 --	publish_flag				VARCHAR2	Optional
944 --		Indicate whether the service request is published (entered
945 --		into knowledge base if ConText Server Option is enabled).
946 
947 --	summary				VARCHAR2(240)	        Required
948 --		Service request summary. Must be non-null.
949 --
950 --
951 -----------------------------------------------------------------------
952 --      These fields are no longer present in the record type
953 --	verify_request_flag			VARCHAR2(1)	Required
954 --
955 --		DEFAULT = FND_API.G_TRUE
956 --		Indicate whether the service request is entered in verified
957 --		mode. Must be non-null. If set to TRUE, the API will perform
958 --		validation on the attributes customer_id, employee_id,
959 --		contact_id, bill_to_site_use_id, bill_to_contact_id,
960 --		ship_to_site_use_id, and ship_to_contact_id.
961 --	filed_by_emp_flag			VARCHAR2(1)	Required
962 --		DEFAULT = FND_API.G_FALSE
963 --		Indicate that the service request is filed by an employee.
964 --		Must be non-null. It can only be set when the
965 --		verify_request_flag parameter is set.
966 -------------------------------------------------------------------------------------
967 --
968 --      caller_type                             VARCHAR2(30)    Required
969 --      VAlid values are : ORGANIZATION, PERSON and CALLER_EMP
970 
971 --
972 --	customer_id				NUMBER		Optional
973 --		Service request customer identifier.
974 --
975 --	customer_number			       VARCHAR2(30)	Optional
976 --		Service request customer number.
977 --
978 
979 -----------------------------------------------------------------------
980 --      These fields are no longer present in the record type
981 --
982 --      customer_prefix                        VARCHAR2(50)     Optional
983 --		Service request customer name.
984 
985 --
986 --      customer_firstname                     VARCHAR2(150)     Optional
987 --              Service request customer first name
988 
989 --      customer_lastname                     VARCHAR2(150)     Optional
990 --              Service request customer last name
991 
992 --      customer_company_name                   VARCHAR2(255)  Optional
993 --              Service request customer company name
994 -----------------------------------------------------------------------------------
995 --	employee_id				NUMBER		Optional
996 --		Service request employee identifier.
997 -------------------------------------------------------------------
998 --   This field is no longer present in the record type
999 --	employee_name				VARCHAR2(240)	Optional
1000 ------------------------------------------------------------------------
1001 --	employee_number			      VARCHAR2(30)	Optional
1002 ------------------------------------------------------------------
1003 -- These fiels are no longer there in rec type
1004 --
1005 --	contact01_id				NUMBER		Optional
1006 --		Service request customer contact identifier.
1007 --
1008 --      contact01_prefix                       VARCHAR2(50)   Optional
1009 --		Service request customer contact name.
1010 --
1011 --      contact01_firstname                   VARCHAR2(150)  Optional
1012 --
1013 --
1014 --   contact01_lastname            VARCHAR2(150)  Optional
1015 --
1016 --   contact01_area_code           VARCHAR2(10)   Optional
1017 
1018 --   contact01_telephone           VARCHAR2(40)   Optional
1019 
1020 --   contact01_extension           VARCHAR2(20)   Optional
1021 
1022 --   contact01_fax_area_code       VARCHAR2(10)   Optional
1023 
1024 --   contact01_fax_number          VARCHAR2(40)   Optional
1025 
1026 --   contact01_email_address       VARCHAR2(2000) Optional
1027 --
1028 --
1029 --   contact02_id                  NUMBER         Optional
1030 --        Service request customer represented by identifier
1031 
1032 --   contact02_prefix              VARCHAR2(50)   Optional
1033 --        Service request customer represented by prefix
1034 
1035 --   contact02_firstname           VARCHAR2(150)  Optional
1036 --        Service request customer represented by firstname
1037 
1038 --   contact02_lastname            VARCHAR2(150)  Optional
1039 --        Service request customer represented by lastname
1040 --
1041 --   contact02_area_code           VARCHAR2(10)   Optional
1042 
1043 --   contact02_telephone           VARCHAR2(40)   Optional
1044 
1045 --   contact02_extension           VARCHAR2(20)   Optional
1046 
1047 --   contact02_fax_area_code       VARCHAR2(10)   Optional
1048 
1049 --   contact02_fax_number          VARCHAR2(40)   Optional
1050 
1051 --   contact02_email_address       VARCHAR2(2000) Optional
1052 -------------------------------------------------------------------
1053 
1054 --
1055 --
1056 --   verify_cp_flag		   VARCHAR2(1)	  Required
1057 --		Indicate whether to use the Installed Base. Must be non-null.
1058 --		If set to TRUE, the API will perform validation on the
1059 --		customer product ID.
1060 
1061 --   customer_product_id	  NUMBER	   Optional
1062 --		Unique identifier for a customer product in the Installed Base.
1063 --
1064 ---------------------------------------------------------
1065 -----no longer used
1066 --     lot_num                    VARCHAR2(30)   Optional
1067 -------------------------------------------------------
1068 -- Supporting platform_id again because of enh 1711552
1069 --     platform_id                NUMBER         Optional
1070 --- ********THE functionality for the below 2 fileds is no longer supported.
1071 --     platform_version_id        NUMBER         Optional
1072 
1073 --     language_id                NUMBER         Optional
1074 --          This is the Product's language id
1075 
1076 
1077 --     cp_component_id               NUMBER         Optional
1078 
1079 --     cp_component_version_id       NUMBER         Optional
1080 
1081 --     cp_subcomponent_id            NUMBER         Optional
1082 
1083 --     cp_subcomponent_version_id    NUMBER         Optional
1084 
1085 
1086 --     language                   VARCHAR2(4)    Optional
1087 --          This is used for TL tables
1088 
1089 --
1090 --	cp_ref_number				Number	Optional -- 3840658
1091 --		Reference number for a customer product in the Installed Base.
1092 
1093 --	inventory_item_id			NUMBER		Optional
1094 --		Corresponds to the column INVENTORY_ITEM_ID in the table
1095 --		MTL_SYSTEM_ITEMS, and identifies the service request product.
1096 --		Ignored if the verify_cp_flag parameter is set.
1097 --
1098 --
1099 --	inventory_item_conc_segs		VARCHAR2	Optional
1100 --		String that contains a concatenation of the key flexfield
1101 --		segments.
1102 
1103 --	inventory_item_segment1		VARCHAR2(40)	Optional
1104 --		System Items key flexfield individual segments (1..20).
1105 --	inventory_item_segment2		VARCHAR2(40)	Optional
1106 --	inventory_item_segment3		VARCHAR2(40)	Optional
1107 --	inventory_item_segment4		VARCHAR2(40)	Optional
1108 --	inventory_item_segment5		VARCHAR2(40)	Optional
1109 --	inventory_item_segment6		VARCHAR2(40)	Optional
1110 --	inventory_item_segment7		VARCHAR2(40)	Optional
1111 --	inventory_item_segment8		VARCHAR2(40)	Optional
1112 --	inventory_item_segment9		VARCHAR2(40)	Optional
1113 --	inventory_item_segment10		VARCHAR2(40)	Optional
1114 --	inventory_item_segment11		VARCHAR2(40)	Optional
1115 --	inventory_item_segment12		VARCHAR2(40)	Optional
1116 --	inventory_item_segment13		VARCHAR2(40)	Optional
1117 --	inventory_item_segment14		VARCHAR2(40)	Optional
1118 --	inventory_item_segment15		VARCHAR2(40)	Optional
1119 --	inventory_item_segment16		VARCHAR2(40)	Optional
1120 --	inventory_item_segment17		VARCHAR2(40)	Optional
1121 --	inventory_item_segment18		VARCHAR2(40)	Optional
1122 --	inventory_item_segment19		VARCHAR2(40)	Optional
1123 --	inventory_item_segment20		VARCHAR2(40)	Optional
1124 
1125 --	inventory_item_vals_or_ids		VARCHAR2(1)	Optional
1126 --		DEFAULT = 'V'
1127 --		Indicate whether input segments are values ('V') or hidden
1128 --		IDs ('I'). If values are input the API expects one value for
1129 --		every displayed segment, whereas if IDs are input the API
1130 --		expects one ID for each enabled segment whether or not the
1131 --		segment is displayed.
1132 --
1133 --
1134 --	inventory_org_id			NUMBER		Optional
1135 --		Item organization ID. Part of the unique key that uniquely
1136 --		identifies an inventory item. Corresponds to the column
1137 --		ORGANIZATION_ID in the table MTL_SYSTEM_ITEMS.
1138 --		Required if inventory_item_id is used.
1139 --
1140 --	current_serial_number			VARCHAR2(30)	Optional
1141 --		Serial number for serialized items.
1142 --		Ignored if the verify_cp_flag parameter is set.
1143 
1144 --	original_order_number				NUMBER		Optional
1145 --		Sales Order information.
1146 --		Ignored if the verify_cp_flag parameter is set.
1147 
1148 --	purchase_order_number			VARCHAR2(50)	Optional
1149 --		Sales Order information.
1150 --		Ignored if the verify_cp_flag parameter is set.
1151 
1152 ------------------------------------------------------------------
1153 --   This field is no longer present in the record type
1154 --	problem_description			VARCHAR2(2000)	Optional
1155 --		Service request problem description.
1156 -----------------------------------------------------------------------
1157 --
1158 --	problem_code				VARCHAR2(30)	Optional
1159 --		Service request problem code.
1160 
1161 --	exp_resolution_date			DATE		Optional
1162 --		Service request expected resolution date.
1163 --
1164 ------------------------------------------------------------------
1165 --   This field is no longer present in the record type
1166 --	make_public_problem			VARCHAR2(1)	Optional
1167 --		Indicate whether the problem description is public.
1168 ------------------------------------------------------------------------
1169 
1170 --      install_site_use_id             NUMBER          Optional
1171 
1172 
1173 -----------------------------------------------------------------------
1174 --      These fields are no longer present in the record type
1175 
1176 --	install_location		VARCHAR2(40)	Optional
1177 --	install_customer		VARCHAR2(50)	Optional
1178 --      install_country                 VARCHAR2(60)    Optional
1179 --	install_address_1		VARCHAR2(240)	Optional
1180 --	install_address_2		VARCHAR2(240)	Optional
1181 --	install_address_3		VARCHAR2(240)	Optional
1182 
1183 ------------------------------------------------------------------
1184 
1185 --   These fields are no longer present in the record type
1186 --	rma_flag				VARCHAR2(1)	Required
1187 --		Indicate whether an RMA is assigned. Must be non-null. If set
1188 --		to TRUE, the API will perform validation on the RMA header ID.
1189 --		It can only be set when the verify_request_flag parameter is
1190 --		set.
1191 --	rma_header_id				NUMBER		Optional
1192 --		Sales order header identifier of the RMA.
1193 --		Ignored if the rma_flag parameter is not set.
1194 --	rma_number				NUMBER		Optional
1195 --		User-visible sales order number of the RMA.
1196 --	order_type_id				NUMBER		Optional
1197 --		Sales order type of the RMA.
1198 --	web_entry_flag			VARCHAR2(1)	Required
1199 --		DEFAULT = FND_API.G_FALSE
1200 --		Indicate whether the service request is entered from
1201 --		Self-Service Web Applications. Must be non-null.
1202 --------------------------------------------------------------------------------------
1203 --	request_segment1			VARCHAR2(150)	Optional
1204 --		Service request descriptive flexfield individual segments
1205 --		(1..15).
1206 --	request_segment2			VARCHAR2(150)	Optional
1207 --	request_segment3			VARCHAR2(150)	Optional
1208 --	request_segment4			VARCHAR2(150)	Optional
1209 --	request_segment5			VARCHAR2(150)	Optional
1210 --	request_segment6			VARCHAR2(150)	Optional
1211 --	request_segment7			VARCHAR2(150)	Optional
1212 --	request_segment8			VARCHAR2(150)	Optional
1213 --	request_segment9			VARCHAR2(150)	Optional
1214 --	request_segment10			VARCHAR2(150)	Optional
1215 --	request_segment11			VARCHAR2(150)	Optional
1216 --	request_segment12			VARCHAR2(150)	Optional
1217 --	request_segment13			VARCHAR2(150)	Optional
1218 --	request_segment14			VARCHAR2(150)	Optional
1219 --	request_segment15			VARCHAR2(150)	Optional
1220 --	request_context			VARCHAR2(30)	Optional
1221 --		Descriptive flexfield structure defining column.
1222 --
1223 
1224 
1225 
1226 --	bill_to_site_use_id			NUMBER		Optional
1227 --		Bill To site use identifier.
1228 
1229 --	bill_to_contact_id			NUMBER		Optional
1230 --		Bill To contact identifier.
1231 --
1232 
1233 -----------------------------------------------------------------------
1234 --      These fields are no longer present in the record type
1235 
1236 --	bill_to_location			VARCHAR2(40)	Optional
1237 --
1238 
1239 --	bill_to_customer			VARCHAR2(50)	Optional
1240 --
1241 
1242 --      bill_country                            VARCHAR2(60)    Optional
1243 
1244 --	bill_to_address_1		        VARCHAR2(240)	Optional
1245 
1246 --	bill_to_address_2		        VARCHAR2(240)	Optional
1247 
1248 --	bill_to_address_3		        VARCHAR2(240)	Optional
1249 
1250 --	bill_to_contact 			VARCHAR2(100)	Optional
1251 --------------------------------------------------------------------------------
1252 
1253 --	ship_to_site_use_id			NUMBER		Optional
1254 --		Ship To site use identifier.
1255 --
1256 
1257 --	ship_to_contact_id			NUMBER		Optional
1258 --		Ship To contact identifier.
1259 --
1260 
1261 -----------------------------------------------------------------------
1262 --      These fields are no longer present in the record type
1263 
1264 --	ship_to_location			VARCHAR2(40)	Optional
1265 --
1266 
1267 --	ship_to_customer			VARCHAR2(50)	Optional
1268 --
1269 --
1270 --      ship_country                            VARCHAR2(60)    Optional
1271 
1272 --	ship_to_address_1		        VARCHAR2(240)	Optional
1273 
1274 --	ship_to_address_2		        VARCHAR2(240)	Optional
1275 --
1276 
1277 --	ship_to_address_3		        VARCHAR2(240)	Optional
1278 --
1279 --	ship_to_contact 			VARCHAR2(100)	Optional
1280 ----------------------------------------------------------------------
1281 
1282 
1283 
1284 ------------------------------------------------------------------
1285 --   This field is no longer present in the record type
1286 --	problem_resolution			VARCHAR2(2000)	Optional
1287 --		Service request problem resolution.
1288 ---------------------------------------------------------------------
1289 --
1290 --	resolution_code			VARCHAR2(30)	Optional
1291 --		Service request resolution code.
1292 
1293 --	act_resolution_date		DATE		Optional
1294 --		Service request actual resolution date.
1295 --
1296 ------------------------------------------------------------------
1297 --   This field is no longer present in the record type
1298 --	make_public_resolution		VARCHAR2(1)	Optional
1299 --		Indicate whether the problem resolution is public.
1300 -------------------------------------------------------------------------
1301 
1302 --      public_comment_flag           VARCHAR2(1)          Optional
1303 --      parent_interaction_id         NUMBER               Optional
1304 --      contract_service_id           NUMBER               Optional
1305 --      contract_service_number       VARCHAR2(150)        Optional
1306 --      qa_collection_plan_id         NUMBER               Optional
1307 --      account_id                    NUMBER               Optional
1308 --      cust_po_number                VARCHAR2(50)         Optional
1309 --      cust_ticket_number            VARCHAR2(50)         Optional
1310 --      sr_creation_channel           VARCHAR2(50)         Optional
1311 --      obligation_date               DATE                 Optional
1312 --      time_zone_id                  NUMBER               Optional
1313 --      time_difference               NUMBER               Optional
1314 --      site_id                       NUMBER               Optional
1315 --      customer_site_id              NUMBER               Optional
1316 --      territory_id                  NUMBER               Optional
1317 --      initialize_flag               VARCHAR2(1)          Optional
1318 
1319 --      cp_revision_id                NUMBER          OPTIONAL
1320 --      inv_item_revision             VARCHAR2(3)     OPTIONAL
1321 --      inv_component_id              NUMBER          OPTIONAL
1322 --      inv_component_version         VARCHAR2(3)     OPTIONAL
1323 --      inv_subcomponent_id           NUMBER          OPTIONAL
1324 --      inv_subcomponent_version      VARCHAR2(3)     OPTIONAL
1325 
1326 
1327 
1328 
1329 
1330 -- End of service_request_rec_type comments
1331 --
1332 --  Notes:	If request_date is not passed, the default value will be
1333 --		SYSDATE.
1334 --
1335 --		If both type_id and type_name are passed, type_name will
1336 --		be ignored. If neither is passed, the default value will be
1337 --		retrieved from the 'Service: Default Service Request Type'
1338 --		profile.
1339 --
1340 --		If both status_id and status_name are passed,
1341 --		status_name will be ignored. If neither is passed, the
1342 --		default value will be the seeded value 1 ('Open').
1343 --
1344 --		If both severity_id and severity_name are passed,
1345 --		severity_name will be ignored. If neither is passed, the
1346 --		default value will be retrieved from the 'Service: Default
1347 --		Service Request Severity' profile.
1348 --
1349 --		If both urgency_id and urgency_name are passed,
1350 --		urgency_name will be ignored. If neither is passed, the
1351 --		default value will be retrieved from the 'Service: Default
1352 --		Service Request Urgency' profile.
1353 --
1354 --		If owner_id is not passed, the default value will be
1355 --		retrieved from the 'Service: Default Service Request Owner'
1356 --		profile.
1357 --
1358 --		If resource_type is not passed, the default value will be
1359 --		retrieved based on 'Service: Default Service Request Owner'
1360 --		profile.
1361 
1362 
1363 
1364 --		Insertion of the publish flag is controlled by the profile
1365 --		'Service: Publish Flag Update Allowed'. If the profile is not
1366 --		set and the caller passes in a non-null value, the API will
1367 --		return an error.
1368 --
1369 --		Either customer_id, customer_name, or customer_number
1370 --		must be passed if the filed_by_emp_flag is not set. If more
1371 --		than one parameter are passed, the customer ID has precedence
1372 --		over the customer number, and the customer number has
1373 --		precedence over the customer name.
1374 --
1375 --		Either employee_id, employee_name, or employee_number
1376 --		must be passed if the filed_by_emp_flag is set. If more than
1377 --		one parameter are passed, the employee ID has precedence over
1378 --		the employee number, and the employee number has precedence
1379 --		over the employee name.
1380 --
1381 --		Either customer_product_id or cp_ref_number must be passed
1382 --		if the verify_cp_flag is set. If both are passed,
1383 --		cp_ref_number will be ignored.
1384 --
1385 --		If inventory_org_id is not passed, the default value will be
1386 --		retrieved from the 'OE: Item Validation Organization' profile.
1387 --
1388 --		If make_public_problem or make_public_resolution is not
1389 --		passed, the default value will be retrieved from the 'Service:
1390 --		Default Make Public Flag' profile.
1391 --
1392 --		If both rma_header_id and rma_number are passed,
1393 --		rma_number will be ignored.
1394 --
1395 --		For value-ID conversion, when the ID of an attribute is not
1396 --		passed, and the value of the attribute is passed and the value
1397 --		is NULL, the ID is converted into NULL. For example, if
1398 --		urgency_id = FND_API.G_MISS_NUM and urgency_name = NULL,
1399 --		NULL is inserted into the incident_urgency_id column. This has
1400 --		the effect that urgency ID will not be defaulted from the
1401 --		profile option (since the caller explicitly passed in NULL).
1402 --
1403 --		For the key and descriptive flexfield segments, segment	values
1404 --		must be input in attribute_segment1..attribute_segmentN in
1405 --		the order displayed. The caller must explicitly set
1406 --		attribute_segmentM to NULL if the Mth segment is NULL, or
1407 --		this will generate a 'NO DATA FOUND' error. Alternatively, the
1408 --		caller may pass in the segment values in a string concatenated
1409 --		by the segment delimiter for the flexfield.
1410 --
1411 --		For the descriptive flexfield segments, the caller must pass
1412 --		the IDs for all columns that might be used in the descriptive
1413 --		flexfield. Values input is currently not supported.
1414 --
1415 --
1416 --		The service request record must be committed before launching
1417 --		the workflow process. This is necessary because Workflow needs
1418 --		to obtain a lock on the record. If the caller passes in FALSE
1419 --		for p_commit and (the autolaunch workflow flag is set ),
1420 --              the API will return an error.
1421 
1422 ----------------------------------------------------
1423 --              Old logic
1424 --              (TRUE for p_launch_workflow)
1425 --		A workflow is automatically launched only if the caller passes
1426 --		in TRUE for the p_launch_workflow parameter and the profile
1427 --		option 'Service: Auto Launch Workflow' is set to 'Y'.
1428 --------------------------------------------------------------------------
1429 
1430 --		A workflow is automatically launched only if the autolaunch
1431 --              workflow falg is set to Y in the incident types table.
1432 
1433 -------------------------------------------------------------------------
1434 --              Old Logic
1435 --		If p_launch_workflow is set, the Workflow API will try to lock
1436 --		the service request record because it needs to update the
1437 --		workflow_process_id column. The NOWAIT option can be specified
1438 --		by setting the p_nowait parameter. If p_nowait is set and the
1439 --		service request record is locked by another user, an error
1440 --		status is returned via the p_return_status_wkflw parameter
1441 --		indicating the workflow process is not launched.
1442 --
1443 --		If p_launch_workflow is set and the service request record is
1444 --		created successfully, a success code will be returned via the
1445 --		p_return_status parameter regardless of the result of the
1446 --		workflow launch. The status code from the Workflow launch is
1447 --		returned via the p_return_status_wkflw parameter instead.
1448 
1449 -----------------
1450 
1451 --		If the autolaunch workflow flag is set, the Workflow API will try to lock
1452 --		the service request record because it needs to update the
1453 --		workflow_process_id column. The NOWAIT option can be specified
1454 --		by setting the p_nowait parameter. If p_nowait is set and the
1455 --		service request record is locked by another user, an error
1456 --		status is returned via the p_return_status_wkflw parameter
1457 --		indicating the workflow process is not launched.
1458 --
1459 --		If autolaunch workflow flag is set and the service request record is
1460 --		created successfully, a success code will be returned via the
1461 --		p_return_status parameter regardless of the result of the
1462 --		workflow launch. The status code from the Workflow launch is
1463 --		returned via the p_return_status_wkflw parameter instead.
1464 
1465 
1466 
1467 
1468 
1469 --
1470 -- End of comments
1471 --------------------------------------------------------------
1472 /*#
1473  * Creates a new service request and related information such as service request contacts, notes, and tasks.
1474  * For details on the parameters, please refer to the document on Metalink from the URL provided above.
1475  *
1476  * @rep:scope public
1477  * @rep:lifecycle active
1478  * @rep:compatibility S
1479  * @rep:displayname Create Service Request
1480  * @rep:primaryinstance
1481  * @rep:businessevent oracle.apps.cs.sr.ServiceRequest.created
1482  * @rep:metalink 390479.1 Oracle White Paper : Service Request Public Application Programming Interfaces (APIs)
1483  */
1484 
1485 /**** Above text has been added to enable the integration repository to extract the data from
1486       the source code file and populate the integration repository schema so that
1487       Create_ServiceRequest API appears in the integration repository.
1488 ****/
1489 
1490 PROCEDURE Create_ServiceRequest
1491 ( p_api_version		  	  IN         NUMBER,
1492   p_init_msg_list	  	  IN         VARCHAR2 	:= FND_API.G_FALSE,
1493   p_commit		  	  IN         VARCHAR2 	:= FND_API.G_FALSE,
1494   x_return_status	  	  OUT NOCOPY VARCHAR2,
1495   x_msg_count		  	  OUT NOCOPY NUMBER,
1496   x_msg_data		  	  OUT NOCOPY VARCHAR2,
1497   p_resp_appl_id	  	  IN         NUMBER	:= NULL,
1498   p_resp_id		  	  IN         NUMBER	:= NULL,
1499   p_user_id		  	  IN         NUMBER	:= NULL,
1500   p_login_id		  	  IN         NUMBER	:= NULL,
1501   p_org_id		  	  IN         NUMBER	:= FND_API.G_MISS_NUM,
1502   p_request_id            	  IN         NUMBER     := NULL,
1503   p_request_number	  	  IN         VARCHAR2	:= NULL,
1504   p_service_request_rec   	  IN         service_request_rec_type,
1505   p_notes                 	  IN         notes_table,
1506   p_contacts              	  IN         contacts_table,
1507    -- Added for Assignment Manager 11.5.9 change
1508   p_auto_assign           	  IN         VARCHAR2  Default 'N',
1509   --------------anmukher----------------------07/31/03
1510   -- Added for 11.5.10 projects (AutoTask, Miscellaneous ERs)
1511   p_auto_generate_tasks		  IN		VARCHAR2 Default 'N',
1512   x_sr_create_out_rec		  OUT NOCOPY	sr_create_out_rec_type,
1513   p_default_contract_sla_ind	  IN		VARCHAR2 Default 'N',
1514   p_default_coverage_template_id  IN		NUMBER Default NULL
1515   ---------------anmukher----------------------07/31/03
1516   -- The following OUT parameters have been added to the record type sr_create_out_rec_type
1517   -- and have therefore been commented out. This will allow avoidance of future overloading
1518   -- if a new OUT parameter were to be needed, since it can be added to the same record type.
1519   -- x_request_id		  OUT NOCOPY NUMBER,
1520   -- x_request_number		  OUT NOCOPY VARCHAR2,
1521   -- x_interaction_id        	  OUT NOCOPY NUMBER,
1522   -- x_workflow_process_id   	  OUT NOCOPY NUMBER,
1523   -- Added for assignment manager changes for 11.5.9
1524   -- x_individual_owner      	  OUT NOCOPY NUMBER,
1525   -- x_group_owner           	  OUT NOCOPY NUMBER,
1526   -- x_individual_type       	  OUT NOCOPY VARCHAR2
1527 );
1528 
1529 ----------------anmukher--------------07/31/03
1530 -- Overloaded procedure added for backward compatibility in 11.5.10
1531 -- since several new OUT parameters have been added to the 11.5.9 signature
1532 -- in the form of a new record type, sr_create_out_rec_type
1533 PROCEDURE Create_ServiceRequest
1534 ( p_api_version		  IN         NUMBER,
1535   p_init_msg_list	  IN         VARCHAR2 	:= FND_API.G_FALSE,
1536   p_commit		  IN         VARCHAR2 	:= FND_API.G_FALSE,
1537   x_return_status	  OUT NOCOPY VARCHAR2,
1538   x_msg_count		  OUT NOCOPY NUMBER,
1539   x_msg_data		  OUT NOCOPY VARCHAR2,
1540   p_resp_appl_id	  IN         NUMBER	:= NULL,
1541   p_resp_id		  IN         NUMBER	:= NULL,
1542   p_user_id		  IN         NUMBER	:= NULL,
1543   p_login_id		  IN         NUMBER	:= NULL,
1544   p_org_id		  IN         NUMBER	:= NULL,
1545   p_request_id            IN         NUMBER     := NULL,
1546   p_request_number	  IN         VARCHAR2	:= NULL,
1547   p_service_request_rec   IN         service_request_rec_type,
1548   p_notes                 IN         notes_table,
1549   p_contacts              IN         contacts_table,
1550   -- Added for Assignment Manager 11.5.9 change
1551   p_auto_assign           IN         VARCHAR2  Default 'N',
1552   p_default_contract_sla_ind	  IN		VARCHAR2 Default 'N',
1553   x_request_id		  OUT NOCOPY NUMBER,
1554   x_request_number	  OUT NOCOPY VARCHAR2,
1555   x_interaction_id        OUT NOCOPY NUMBER,
1556   x_workflow_process_id   OUT NOCOPY NUMBER,
1557   -- Added for assignment manager changes for 11.5.9
1558   x_individual_owner      OUT NOCOPY NUMBER,
1559   x_group_owner           OUT NOCOPY NUMBER,
1560   x_individual_type       OUT NOCOPY VARCHAR2
1561 );
1562 
1563 
1564 --------------------------------------------------------------------------
1565 -- Start of comments
1566 --  API name	: Update_ServiceRequest
1567 --  Type	: Public
1568 --  Function	: Updates a service request in the table CS_INCIDENTS_ALL.
1569 --  Pre-reqs	: None.
1570 --
1571 --  Standard IN Parameters:
1572 --	p_api_version			IN	NUMBER		Required
1573 --	p_init_msg_list		  	IN	VARCHAR2 	Optional
1574 --	p_commit			IN	VARCHAR2 	Optional
1575 --
1576 --  Standard OUT Parameters:
1577 --	x_return_status			OUT	VARCHAR2(1)
1578 --	x_msg_count			OUT	NUMBER
1579 --	x_msg_data			OUT	VARCHAR2(2000)
1580 --
1581 ---------------------------------------------------------------------
1582 --      These are required only for create_servicerequest procedure
1583 --  	p_user_id			IN	NUMBER		Optional
1584 --  	p_login_id			IN	NUMBER		Optional
1585 ------------------------------------------------------------------
1586 --
1587 --  Service Request IN Parameters:
1588 --	p_resp_appl_id		  	IN	NUMBER		Optional
1589 --	p_resp_id			IN	NUMBER		Optional
1590 
1591 
1592 
1593 ----------------------------------------------------------------------
1594 --     No longer there in the Update_ServiceRequest
1595 --  	p_org_id			IN	NUMBER		Optional
1596 ----------------------------------------------------------------------------
1597 
1598 
1599 --	p_request_id		 	IN    	NUMBER		Optional
1600 --	p_request_number		IN	VARCHAR2	Optional
1601 --      p_object_version_number         IN      NUMBER          Required by web-apps
1602 --
1603 --
1604 --	p_audit_comments		IN	VARCHAR2 	Optional
1605 --		Maximum string length of 2000 bytes
1606 
1607 
1608 --   p_last_updated_by                 IN   NUMBER         Required
1609 --   valid user from fnd_user
1610 
1611 --   p_last_update_login               IN   NUMBER         Optional
1612 --        Default = NULL
1613 --   p_last_update_date                IN   DATE           Required
1614 --
1615 --   p_service_request_rec             IN   service_request_rec_type  Required
1616 --   p_notes                           IN   notes_table               Optional
1617 
1618 --   p_contacts                        IN   contacts_table            Optional
1619 --
1620 --   p_called_by_workflow		IN	VARCHAR2	Optional
1621 --	        Whether or not the API is being called by a workflow process
1622 
1623 --   p_workflow_process_id		IN	NUMBER		Optional
1624 --	        Workflow process ID of the active workflow process
1625 --
1626 --   p_default_contract_sla_ind      IN      VARCHAR2        Optional
1627 --              DEFAULT 'N'
1628 --              Indicates whether the API needs to determine the contract, respond by date
1629 --              and resolve by date for a service request and stamp it on the service request.
1630 --
1631 --   Service Request OUT Parameters:
1632 --   x_workflow_process_id          OUT   NUMBER
1633 --           This will have a value if a new workflow got launched during the update
1634 --   x_intercation_id               OUT   NUMBER
1635 
1636 -------------------------------------------------------------------
1637 --      Not present in the Procedure declaration
1638 --	p_web_entry_flag
1639 --		Whether the update was entered through the Web
1640 -----------------------------------------------------------------
1641 --  Calls IN parameters:
1642 --	p_comments			IN	VARCHAR2(2000)	Optional
1643 --		Service request comments or log of the conversation.
1644 --	p_public_comment_flag		IN	VARCHAR2(1)	Optional
1645 --		Indicate whether the service request comment is public (can be
1646 --		viewed by anyone).
1647 --
1648 --  Calls OUT parameters:
1649 --	p_call_id			OUT	NUMBER
1650 --		System generated ID of service request call
1651 --
1652 --  Version : Initial version	1.0
1653 ------------------------------------------------------------------------------
1654 
1655 -- Start of comments
1656 --  Record Type     : Service_Request_Rec_Type
1657 --  Description     : Holds the Service Request attributes
1658 --                    for the Update_ServiceRequest Procedure.
1659 --  Fields     :
1660 --
1661 --
1662 --  	type_id				NUMBER		Optional
1663 --		Must be non-null
1664 
1665 --	type_name			VARCHAR2	Optional
1666 --		Must be non-null
1667 
1668 --	status_id			NUMBER		Optional
1669 --		Must be non-null
1670 
1671 --	status_name			VARCHAR2 	Optional
1672 --		Must be non-null
1673 
1674 --	severity_id			NUMBER		Optional
1675 --		Must be non-null
1676 
1677 --	severity_name		  	VARCHAR2 	Optional
1678 --		Must be non-null
1679 
1680 --	urgency_id			NUMBER		Optional
1681 
1682 --  	urgency_name			VARCHAR2 	Optional
1683 
1684 --	closed_date			DATE		Optional
1685 
1686 --	owner_id			NUMBER		Optional
1687 --		Must be non-null
1688 
1689 --      owner_group_id                  NUMBER          Optional
1690 --
1691 --	publish_flag			VARCHAR2	Optional
1692 --		Indicate whether the service request is published (entered
1693 --		  into knowledge base if ConText Server Option is enabled).
1694 
1695 -- 	summary				VARCHAR2	Optional
1696 --		Must be non-null
1697 -----------------------------------------------------------------------
1698 --      These fields are no longer present in the record type
1699 --	verify_request_flag			VARCHAR2	Optional
1700 --		Must be either FND_API.G_TRUE or FND_API.G_FALSE.  Used
1701 -- 		to indicate if this is a verified or non-verified request
1702 -----------------------------------------------------------------------------
1703 --	customer_id			 NUMBER		 Optional
1704 
1705 
1706 --	customer_number		         VARCHAR2	 Optional
1707 
1708 
1709 -----------------------------------------------------------------------
1710 --      These fields are no longer present in the record type
1711 
1712 --   customer_prefix                     VARCHAR2(50)    Optional
1713 --		Service request customer name.
1714 --
1715 --   customer_firstname                  VARCHAR2(150)   Optional
1716 --              Service request customer first name
1717 
1718 --   customer_lastname                   VARCHAR2(150)  Optional
1719 --              Service request customer last name
1720 
1721 
1722 --   customer_company_name               VARCHAR2(255)  Optional
1723 --              Service request customer company name
1724 
1725 ----------------------------------------------------------------
1726 
1727 --	employee_id			 NUMBER		Optional
1728 
1729 --	employee_number			 VARCHAR2(30)	Optional
1730 --
1731 
1732 ------------------------------------------------------------------
1733 -- These fiels are no longer there in rec type
1734 
1735 --
1736 --	contact01_id			 NUMBER		Optional
1737 
1738 --       contact01_prefix                VARCHAR2(50)   Optional
1739 --		Service request customer contact name.
1740 
1741 --
1742 --   contact01_firstname           VARCHAR2(150)  Optional
1743 --
1744 --
1745 --   contact01_lastname            VARCHAR2(150)  Optional
1746 --
1747 --   contact01_area_code           VARCHAR2(10)   Optional
1748 --   contact01_telephone           VARCHAR2(40)   Optional
1749 --   contact01_extension           VARCHAR2(20)   Optional
1750 --   contact01_fax_area_code       VARCHAR2(10)   Optional
1751 --   contact01_fax_number          VARCHAR2(40)   Optional
1752 --   contact01_email_address       VARCHAR2(2000) Optional
1753 --
1754 --
1755 --   contact02_id                  NUMBER         Optional
1756 --        Service request customer represented by identifier
1757 
1758 --   contact02_prefix              VARCHAR2(50)   Optional
1759 --        Service request customer represented by prefix
1760 
1761 --   contact02_firstname           VARCHAR2(150)  Optional
1762 --        Service request customer represented by firstname
1763 
1764 --   contact02_lastname            VARCHAR2(150)  Optional
1765 --        Service request customer represented by lastname
1766 --
1767 --   contact02_area_code           VARCHAR2(10)   Optional
1768 
1769 --   contact02_telephone           VARCHAR2(40)   Optional
1770 
1771 --   contact02_extension           VARCHAR2(20)   Optional
1772 
1773 --   contact02_fax_area_code       VARCHAR2(10)   Optional
1774 
1775 --   contact02_fax_number          VARCHAR2(40)   Optional
1776 
1777 --   contact02_email_address       VARCHAR2(2000) Optional
1778 -------------------------------------------------------------------
1779 
1780 --
1781 --    verify_cp_flag		   VARCHAR2	  Optional
1782 
1783 --    customer_product_id	   NUMBER	  Optional
1784 --
1785 ---------------------------------------------------
1786 --no longer used
1787 --     lot_num                    VARCHAR2(30)   Optional
1788 --------------------------------------------------------
1789 
1790 -- Supporting platform_id again because of enh 1711552
1791 --     platform_id                NUMBER         Optional
1792 --    *********THE functionality for the below 2 fileds is no longer supported.
1793 --     platform_version_id        NUMBER         Optional
1794 
1795 --     language_id                NUMBER         Optional
1796 --          This is the Product's language id
1797 
1798 --     cp_component_id               NUMBER         Optional
1799 --     cp_component_version_id       NUMBER         Optional
1800 --     cp_subcomponent_id            NUMBER         Optional
1801 --     cp_subcomponent_version_id    NUMBER         Optional
1802 
1803 
1804 --     language                   VARCHAR2(4)    Optional
1805 --          This is used for TL tables
1806 --          IF not passed to the api, the userenv('LANG') is used.
1807 --
1808 
1809 --
1810 --	cp_ref_number		  Number  	 Optional -- 3840658
1811 --
1812 --	inventory_item_id         NUMBER	 Optional
1813 
1814 --	inventory_item_conc_segs	VARCHAR2	Optional
1815 --	inventory_item_segment1		VARCHAR2	Optional
1816 --	inventory_item_segment2		VARCHAR2	Optional
1817 --	inventory_item_segment3		VARCHAR2	Optional
1818 --	inventory_item_segment4		VARCHAR2	Optional
1819 --	inventory_item_segment5		VARCHAR2	Optional
1820 --	inventory_item_segment6		VARCHAR2	Optional
1821 --	inventory_item_segment7		VARCHAR2	Optional
1822 --	inventory_item_segment8	        VARCHAR2	Optional
1823 --	inventory_item_segment9		VARCHAR2	Optional
1824 --	inventory_item_segment10	VARCHAR2	Optional
1825 --	inventory_item_segment11	VARCHAR2	Optional
1826 --	inventory_item_segment12	VARCHAR2	Optional
1827 --	inventory_item_segment13	VARCHAR2	Optional
1828 --	inventory_item_segment14	VARCHAR2	Optional
1829 --	inventory_item_segment15	VARCHAR2	Optional
1830 --	inventory_item_segment16	VARCHAR2	Optional
1831 --	inventory_item_segment17	VARCHAR2	Optional
1832 --	inventory_item_segment18	VARCHAR2	Optional
1833 --	inventory_item_segment19	VARCHAR2	Optional
1834 --	inventory_item_segment20	VARCHAR2	Optional
1835 
1836 --	inventory_item_vals_or_ids	VARCHAR2	Optional
1837 --		Must be 'I' for IDs and 'V' for values.  This parameter
1838 --		indicate whether the item key flex segments are passed
1839 --		in by ID or value
1840 --
1841 --	inventory_org_id			NUMBER		Optional
1842 
1843 --	current_serial_number	  		VARCHAR2	Optional
1844 --
1845 
1846 --	original_order_number	  		NUMBER		Optional
1847 
1848 --	purchase_order_num  	  		VARCHAR2	Optional
1849 --
1850 
1851 ------------------------------------------------------------------
1852 --   This field is no longer present in the record type
1853 --	problem_description			VARCHAR2	Optional
1854 --		Maximum string length of 2000 bytes
1855 -----------------------------------------------------------------------
1856 --
1857 --	problem_code		  		VARCHAR2	Optional
1858 
1859 --	exp_resolution_date			DATE		Optional
1860 
1861 ------------------------------------------------------------------
1862 --   This field is no longer present in the record type
1863 --	make_public_problem			VARCHAR2	Optional
1864 --		Indicate whether the problem description is public.
1865 ----------------------------------------------------------------------
1866 
1867 --      install_site_use_id                     NUMBER          Optional
1868 
1869 
1870 -----------------------------------------------------------------------
1871 --      These fields are no longer present in the record type
1872 --	install_location			VARCHAR2	Optional
1873 --
1874 --	install_customer			VARCHAR2	Optional
1875 --
1876 --      install_country                         VARCHAR2(60)    Optional
1877 
1878 --	install_address_1		        VARCHAR2	Optional
1879 --
1880 --  	install_address_2		        VARCHAR2	Optional
1881 --
1882 --	install_address_3		        VARCHAR2	Optional
1883 --
1884 ------------------------------------------------------------------
1885 --   These fields are no longer present in the record type
1886 --	rma_flag				VARCHAR2	Optional
1887 --	rma_header_id		  		NUMBER		Optional
1888 --	rma_number				NUMBER		Optional
1889 --	order_type_id		  		NUMBER		Optional
1890 -------------------------------------------------------------------------
1891 --
1892 --	request_segment1			VARCHAR2	Optional
1893 --	request_segment2			VARCHAR2	Optional
1894 --	request_segment3		        VARCHAR2	Optional
1895 --	request_segment4			VARCHAR2	Optional
1896 --	request_segment5			VARCHAR2	Optional
1897 --	request_segment6			VARCHAR2	Optional
1898 --	request_segment7			VARCHAR2	Optional
1899 --	request_segment8			VARCHAR2	Optional
1900 --	request_segment9			VARCHAR2	Optional
1901 --	request_segment10			VARCHAR2	Optional
1902 --	request_segment11			VARCHAR2	Optional
1903 --	request_segment12			VARCHAR2	Optional
1904 --	request_segment13			VARCHAR2	Optional
1905 --	request_segment14		        VARCHAR2	Optional
1906 --	request_segment15			VARCHAR2	Optional
1907 --	request_context			        VARCHAR2	Optional
1908 --
1909 --	bill_to_site_use_id			NUMBER		Optional
1910 
1911 --	bill_to_contact_id			NUMBER		Optional
1912 
1913 
1914 
1915 -----------------------------------------------------------------------
1916 --      These fields are no longer present in the record type
1917 
1918 --	bill_to_location			VARCHAR2	Optional
1919 
1920 --	bill_to_customer			VARCHAR2	Optional
1921 
1922 --      bill_country                            VARCHAR2(60)    Optional
1923 --
1924 --	bill_to_address_1		        VARCHAR2	Optional
1925 
1926 --	bill_to_address_2		        VARCHAR2	Optional
1927 
1928 --	bill_to_address_3		        VARCHAR2	Optional
1929 
1930 --	bill_to_contact			        VARCHAR2	Optional
1931 ---------------------------------------------------------------------------
1932 --
1933 --	ship_to_site_use_id			NUMBER		Optional
1934 
1935 --	ship_to_contact_id			NUMBER		Optional
1936 
1937 
1938 -----------------------------------------------------------------------
1939 --      These fields are no longer present in the record type
1940 
1941 --	ship_to_location			VARCHAR2	Optional
1942 
1943 --	ship_to_customer			VARCHAR2	Optional
1944 
1945 --      ship_country                            VARCHAR2(60)    Optional
1946 
1947 --	ship_to_address_1		        VARCHAR2	Optional
1948 
1949 --	ship_to_address_2		        VARCHAR2	Optional
1950 
1951 --	ship_to_address_3		        VARCHAR2	Optional
1952 
1953 --	ship_to_contact			        VARCHAR2	Optional
1954 
1955 
1956 ------------------------------------------------------------------
1957 --   This field is no longer present in the record type
1958 --	problem_resolution			VARCHAR2	Optional
1959 --		Maximum string length of 2000 bytes
1960 --------------------------------------------------------------------
1961 
1962 --	resolution_code		      VARCHAR2	        Optional
1963 --	act_resolution_date	      DATE		Optional
1964 --      public_comment_flag           VARCHAR2(1)       Optional
1965 --      parent_interaction_id         NUMBER            Optional
1966 --      contract_service_id           NUMBER            Optional
1967 --      contract_service_number       VARCHAR2(150)     Optional
1968 --      qa_collection_plan_id         NUMBER            Optional
1969 --      account_id                    NUMBER            Optional
1970 --      resource_type                 VARCHAR2(30)      Optional
1971 --      resource_subtype_id           NUMBER            Optional
1972 --      cust_po_number                VARCHAR2(50)      Optional
1973 --      cust_ticket_number            VARCHAR2(50)      Optional
1974 ---------------------------------------------------------------
1975 --   This is a non updatable field
1976 --      sr_creation_channel           VARCHAR2(50)      Optional
1977 ------------------------------------------------------------------
1978 --      obligation_date               DATE              Optional
1979 --      time_zone_id                  NUMBER            Optional
1980 --      time_difference               NUMBER            Optional
1981 --      site_id                       NUMBER            Optional
1982 --      customer_site_id              NUMBER            Optional
1983 --      territory_id                  NUMBER            Optional
1984 --      initialize_flag               VARCHAR2(1)       Optional
1985 
1986 --      cp_revision_id                NUMBER          OPTIONAL
1987 --      inv_item_revision             VARCHAR2(3)     OPTIONAL
1988 --      inv_component_id              NUMBER          OPTIONAL
1989 --      inv_component_version         VARCHAR2(3)     OPTIONAL
1990 --      inv_subcomponent_id           NUMBER          OPTIONAL
1991 --      inv_subcomponent_version      VARCHAR2(3)     OPTIONAL
1992 --
1993 --
1994 --  Notes:	: Either request_id or request_number must be non-null.
1995 --		  If both are passed in, request_number will be ignored
1996 --
1997 --      	  If a field is not to be updated, do not pass in NULL.  Either
1998 --                don't pass in the parameter at all, or pass in one of the
1999 --		  missing parameter constants defined in the FND_API
2000 --		  package(G_MISS_...).
2001 --
2002 --      	  For all the "flag" parameters, and p_called_by_workflow
2003 --		  parameter, pass in the boolean constants defined in the
2004 --		  FND_API package (G_TRUE and G_FALSE).
2005 --
2006 --		  Varchar parameters with the maximum length noted above will
2007 --		  be truncated if the length of the value being passed in
2008 --		  exceeds the maximum allowance, and a warning will be appended
2009 --		  to the runtime message list.
2010 --
2011 --		  The type and owner of the the service request cannot be
2012 --		  updated when there is an active workflow process. The status
2013 --		  of the service request can be set to a "closed" status
2014 --		  (status whose close_flag is set) under the same condition.
2015 --		  In that case, this API will abort the active workflow
2016 --		  process. When this API is being called by the workflow
2017 --		  process, the caller must pass in the workflow process ID of
2018 --		  the active workflow process for verification.
2019 --
2020 --		  For the descriptive flexfield segments, the caller must pass
2021 --		  in the IDs for all columns that are used in the descriptive
2022 --	    	  flexfield. Input by value is currently not supported.
2023 --
2024 --		  The publish flag cannot be updated if the profile
2025 --		  'Service: Publish Flag Update Allowed' is not set. If the
2026 --		  caller passes in a non-null value when the profile is not
2027 --		  set, the API will return an error.
2028 
2029 --        The service request record must be committed before launching
2030 --        the workflow process. This is necessary because Workflow needs
2031 --        to obtain a lock on the record. If the caller passes in FALSE
2032 --        for p_commit and TRUE for p_launch_workflow, the API will
2033 --        return an error.
2034 --
2035 --        A workflow is automatically launched only if the caller passes
2036 --        in TRUE for the p_launch_workflow parameter and the profile
2037 --        option 'Service: Auto Launch Workflow' is set to 'Y'.
2038 --
2039 --        If p_launch_workflow is set, the Workflow API will try to lock
2040 --        the service request record because it needs to update the
2041 --        workflow_process_id column. The NOWAIT option can be specified
2042 --        by setting the p_nowait parameter. If p_nowait is set and the
2043 --        service request record is locked by another user, an error
2044 --        status is returned via the p_return_status_wkflw parameter
2045 --        indicating the workflow process is not launched.
2046 --
2047 --        If p_launch_workflow is set and the service request record is
2048 --        created successfully, a success code will be returned via the
2049 --        p_return_status parameter regardless of the result of the
2050 --        workflow launch. The status code from the Workflow launch is
2051 --        returned via the p_return_status_wkflw parameter instead.
2052 
2053 --
2054 -- End of comments
2055 --
2056 --------------------------------------------------------------------------
2057 /*#
2058  * Update Service Request enables user to update a service request, and other service request related data
2059  * such as service contacts, and tasks. For details on the parameters, please refer to the document on Metalink from the URL provided above.
2060  *
2061  * @rep:scope public
2062  * @rep:lifecycle active
2063  * @rep:compatibility S
2064  * @rep:displayname Update Service Request
2065  * @rep:primaryinstance
2066  * @rep:businessevent oracle.apps.cs.sr.ServiceRequest.updated
2067  * @rep:metalink 390479.1 Oracle White Paper : Service Request Public Application Programming Interfaces (APIs)
2068  */
2069 
2070 /**** Above text has been added to enable the integration repository to extract the
2071       data from the source code file and populate the integration repository schema so
2072       that Update_ServiceRequest API appears in the integration repository.
2073 ****/
2074 
2075 
2076 PROCEDURE Update_ServiceRequest(
2077   p_api_version            	IN     NUMBER,
2078   p_init_msg_list          	IN     VARCHAR2      := FND_API.G_FALSE,
2079   p_commit                 	IN     VARCHAR2      := FND_API.G_FALSE,
2080   x_return_status          	OUT NOCOPY VARCHAR2,
2081   x_msg_count              	OUT NOCOPY NUMBER,
2082   x_msg_data               	OUT NOCOPY VARCHAR2,
2083   p_request_id             	IN     NUMBER        := NULL,
2084   p_request_number         	IN     VARCHAR2      := NULL,
2085   p_audit_comments         	IN     VARCHAR2      := NULL,
2086   p_object_version_number  	IN     NUMBER,
2087   p_resp_appl_id           	IN     NUMBER        := NULL,
2088   p_resp_id                	IN     NUMBER        := NULL,
2089   p_last_updated_by        	IN     NUMBER,
2090   p_last_update_login      	IN     NUMBER        := NULL,
2091   p_last_update_date       	IN     DATE,
2092   p_service_request_rec    	IN     service_request_rec_type,
2093   p_notes                  	IN     notes_table,
2094   p_contacts               	IN     contacts_table,
2095   p_called_by_workflow     	IN     VARCHAR2      := FND_API.G_FALSE,
2096   p_workflow_process_id    	IN     NUMBER        := NULL,
2097   -- Commented out since these are now part of the out rec type --anmukher--08/08/03
2098   -- x_workflow_process_id    	OUT NOCOPY NUMBER,
2099   -- x_interaction_id         	OUT NOCOPY NUMBER,
2100   ----------------anmukher--------------------08/08/03
2101   -- Added for 11.5.10 projects
2102   p_auto_assign		    	IN	VARCHAR2 Default 'N',
2103   p_validate_sr_closure	    	IN	VARCHAR2 Default 'N',
2104   p_auto_close_child_entities	IN	VARCHAR2 Default 'N',
2105   p_default_contract_sla_ind	IN      VARCHAR2 Default 'N',
2106   --Add p_auto_generate_tasks for 12.2-Auto Task creation
2107   p_auto_generate_tasks		IN	VARCHAR2 Default 'N',
2108   x_sr_update_out_rec		OUT NOCOPY	sr_update_out_rec_type
2109 );
2110 
2111 
2112 ----------------anmukher--------------08/08/03
2113 -- Overloaded procedure added for backward compatibility in 11.5.10
2114 -- since several new OUT parameters have been added to the 11.5.9 signature
2115 -- in the form of a new record type, sr_update_out_rec_type
2116 PROCEDURE Update_ServiceRequest(
2117   p_api_version            	IN     NUMBER,
2118   p_init_msg_list          	IN     VARCHAR2      := FND_API.G_FALSE,
2119   p_commit                 	IN     VARCHAR2      := FND_API.G_FALSE,
2120   x_return_status          	OUT NOCOPY VARCHAR2,
2121   x_msg_count              	OUT NOCOPY NUMBER,
2122   x_msg_data               	OUT NOCOPY VARCHAR2,
2123   p_request_id             	IN     NUMBER        := NULL,
2124   p_request_number         	IN     VARCHAR2      := NULL,
2125   p_audit_comments         	IN     VARCHAR2      := NULL,
2126   p_object_version_number  	IN     NUMBER,
2127   p_resp_appl_id           	IN     NUMBER        := NULL,
2128   p_resp_id                	IN     NUMBER        := NULL,
2129   p_last_updated_by        	IN     NUMBER,
2130   p_last_update_login      	IN     NUMBER        := NULL,
2131   p_last_update_date       	IN     DATE,
2132   p_service_request_rec    	IN     service_request_rec_type,
2133   p_notes                  	IN     notes_table,
2134   p_contacts               	IN     contacts_table,
2135   p_called_by_workflow     	IN     VARCHAR2      := FND_API.G_FALSE,
2136   p_workflow_process_id    	IN     NUMBER        := NULL,
2137   p_default_contract_sla_ind	IN      VARCHAR2 Default 'N',
2138   x_workflow_process_id    	OUT NOCOPY NUMBER,
2139   x_interaction_id         	OUT NOCOPY NUMBER
2140   );
2141 
2142 -- -------------------------------------------------------------------
2143 -- Start of comments
2144 --  API Name	: Update_Status
2145 --  Type	: Public
2146 --  Description	: Update the status of a service request
2147 --  Pre-reqs	: None
2148 --
2149 --  Standard IN Parameters:
2150 --	p_api_version			IN	NUMBER		Required
2151 --	p_init_msg_list			IN	VARCHAR2	Optional
2152 --		Default = FND_API.G_FALSE
2153 --	p_commit			IN	VARCHAR2	Optional
2154 --		Default = FND_API.G_FALSE
2155 --
2156 --  Standard OUT Parameters:
2157 --	p_return_status			OUT	VARCHAR2(1)
2158 --	p_msg_count			OUT	NUMBER
2159 --	p_msg_data			OUT	VARCHAR2(2000)
2160 --
2161 --  Service Request IN Parameters:
2162 --	p_resp_appl_id			IN	NUMBER		Optional
2163 --		Default = NULL
2164 --	p_resp_id			IN	NUMBER		Optional
2165 --		Default = NULL
2166 --	p_user_id			IN	NUMBER		Optional
2167 --		Default = NULL
2168 --	p_login_id			IN	NUMBER		Optional
2169 --		Default = FND_API.G_MISS_NUM
2170 
2171 ----------------------------------------------------
2172 --   Not in the API
2173 --      p_org_id			IN	NUMBER		Optional
2174 --		Default = NULL
2175 ------------------------------------------------------------
2176 
2177 
2178 
2179 --	p_request_id			IN	NUMBER		Optional
2180 --		Default = NULL
2181 --	p_request_number		IN	VARCHAR2	Optional
2182 --		Default = NULL
2183 --	p_status_id			IN	NUMBER		Optional
2184 --		Default = NULL
2185 --	p_status			IN	VARCHAR2	Optional
2186 --		Default = NULL
2187 --      p_closed_date			IN	DATE		Optional
2188 --		Default = FND_API.G_MISS_DATE
2189 --	p_audit_comments		IN	VARCHAR2	Optional
2190 --		Default = NULL
2191 --		Used for the audit record.
2192 --	p_called_by_workflow		IN	NUMBER		Optional
2193 --		Default = FND_API.G_FALSE
2194 --		Whether or not this API is being called by the active workflow
2195 --		process of the service request.
2196 --	p_workflow_process_id		IN	NUMBER		Optional
2197 --		Default = NULL
2198 --		The workflow process ID of the active workflow process.
2199 --
2200 --  Calls IN parameters:
2201 --	p_comments			IN	VARCHAR2(2000)	Optional
2202 --		Service request comments or log of the conversation.
2203 --	p_public_comment_flag		IN	VARCHAR2(1)	Optional
2204 --		Indicate whether the service request comment is public (can be
2205 --		viewed by anyone).
2206 --
2207 --  Calls OUT parameters:
2208 --	p_call_id			OUT	NUMBER
2209 --		System generated ID of service request call
2210 --
2211 --  Version	: Initial Version	1.0
2212 --
2213 --  Notes:	: Either p_request_id or p_request_number must be non-null.
2214 --		  If both are passed in, p_request_number will be ignored
2215 --
2216 --		  Either p_Status or p_Status_id must be passed in. If
2217 --		  both are passed in, the value of p_Status will be ignore.
2218 --
2219 --		  The status of the service request can be updated to a
2220 --		  "closed" status (statuses whose close_flag is set) when
2221 --		  there is an active workflow process. In that case, the API
2222 --		  will abort the active workflow process. When the API is
2223 --		  being called by the process itself, the caller must pass in
2224 --		  the workflow process ID of the active workflow process for
2225 --		  verification.
2226 --
2227 --		  If the new status is a "closed" status, then the value
2228 --		  of p_closed_date will be used to set the close date of
2229 -- 		  the service request.  If p_closed_date is not passed
2230 --                in, sysdate will be defaulted.
2231 --
2232 -- End of comments
2233 -- -------------------------------------------------------------------
2234 /*#
2235  * Updates the status of an existing service request.
2236  * For details on the parameters, please refer to the document on Metalink from the URL provided above.
2237  *
2238  * @rep:scope public
2239  * @rep:lifecycle active
2240  * @rep:compatibility S
2241  * @rep:displayname Update Service Request Status
2242  * @rep:primaryinstance
2243  * @rep:metalink 390479.1 Oracle White Paper : Service Request Public Application Programming Interfaces (APIs)
2244 */
2245 
2246 /**** Above text has been added to enable the integration repository to extract the data
2247       from the source code file and populate the integration repository schema so that
2248       Update_Status API appears in the integration repository.
2249 ****/
2250 
2251 PROCEDURE Update_Status
2252 ( p_api_version		IN	NUMBER,
2253   p_init_msg_list	IN	VARCHAR2 := FND_API.G_FALSE,
2254   p_commit		    IN	VARCHAR2 := FND_API.G_FALSE,
2255   x_return_status	OUT	NOCOPY VARCHAR2,
2256   x_msg_count		OUT	NOCOPY NUMBER,
2257   x_msg_data		OUT	NOCOPY VARCHAR2,
2258   p_resp_appl_id	IN	NUMBER   := NULL,
2259   p_resp_id		    IN	NUMBER   := NULL,
2260   p_user_id		    IN	NUMBER   := NULL,
2261   p_login_id		IN	NUMBER   := FND_API.G_MISS_NUM,
2262   p_request_id		IN	NUMBER   := NULL,
2263   p_request_number	IN	VARCHAR2 := NULL,
2264   p_object_version_number IN NUMBER,
2265   p_status_id		IN	NUMBER   := NULL,
2266   p_status		    IN	VARCHAR2 := NULL,
2267   p_closed_date		IN	DATE     := FND_API.G_MISS_DATE,
2268   p_audit_comments	     IN	VARCHAR2 := NULL,
2269   p_called_by_workflow	 IN	VARCHAR2 := FND_API.G_FALSE,
2270   p_workflow_process_id	 IN	NUMBER   := NULL,
2271   p_comments		     IN	VARCHAR2 := NULL,
2272   p_public_comment_flag	 IN	VARCHAR2 := FND_API.G_FALSE,
2273   p_validate_sr_closure         IN      VARCHAR2 Default 'N',
2274   p_auto_close_child_entities   IN      VARCHAR2 Default 'N',
2275   --Add p_auto_generate_tasks for 12.2-Auto Task creation
2276   p_auto_generate_tasks		IN	VARCHAR2 Default 'N',
2277   x_interaction_id		 OUT	NOCOPY NUMBER
2278 );
2279 
2280 -- -------------------------------------------------------------------
2281 -- Start of comments
2282 --  API Name	: Update_Severity
2283 --  Type	: Public
2284 --  Description	: Update the severity of a service request
2285 --  Pre-reqs	: None
2286 --
2287 --  Standard IN Parameters:
2288 --	p_api_version			IN	NUMBER		Required
2289 --	p_init_msg_list			IN	VARCHAR2	Optional
2290 --		Default = FND_API.G_FALSE
2291 --	p_commit			IN	VARCHAR2	Optional
2292 --		Default = FND_API.G_FALSE
2293 --
2294 --  Standard OUT Parameters:
2295 --	p_return_status			OUT	VARCHAR2(1)
2296 --	p_msg_count			OUT	NUMBER
2297 --	p_msg_data			OUT	VARCHAR2(2000)
2298 --
2299 --  Service Request IN Parameters:
2300 --	p_resp_appl_id			IN	NUMBER		Optional
2301 --		Default = NULL
2302 --	p_resp_id			IN	NUMBER		Optional
2303 --		Default = NULL
2304 --	p_user_id			IN	NUMBER		Optional
2305 --		Default = NULL
2306 --	p_login_id			IN	NUMBER		Optional
2307 --		Default = FND_API.G_MISS_NUM
2308 
2309 ---------------------------------------------------
2310 --      Not in the API
2311 --      p_org_id			IN	NUMBER		Optional
2312 --		Default = NULL
2313 ---------------------------------
2314 
2315 --	p_request_id			IN	NUMBER		Optional
2316 --		Default = NULL
2317 --	p_request_number		IN	VARCHAR2	Optional
2318 --		Default = NULL
2319 --	p_severity_id			IN	NUMBER		Optional
2320 --		Default = NULL
2321 --	p_severity			IN	VARCHAR2	Optional
2322 --		Default = NULL
2323 --	p_audit_comments		IN	VARCHAR2	Optional
2324 --		Default = NULL
2325 --		Used for the audit record.
2326 --
2327 --  Calls IN parameters:
2328 --	p_comments			IN	VARCHAR2(2000)	Optional
2329 --		Service request comments or log of the conversation.
2330 --	p_public_comment_flag		IN	VARCHAR2(1)	Optional
2331 --		Indicate whether the service request comment is public (can be
2332 --		viewed by anyone).
2333 --
2334 --  Calls OUT parameters:
2335 --	p_call_id			OUT	NUMBER
2336 --		System generated ID of service request call
2337 --
2338 --  Version	: Initial Version	1.0
2339 --
2340 --  Notes:	: Either p_request_id or p_request_number must be non-null.
2341 --		  If both are passed in, p_request_number will be ignored
2342 --
2343 --		  Either p_severity or p_severity_id must be passed in. If
2344 --		  both are passed in, the value of p_severity will be ignore.
2345 --
2346 -- End of comments
2347 -- -------------------------------------------------------------------
2348 
2349 PROCEDURE Update_Severity
2350 ( p_api_version		IN	NUMBER,
2351   p_init_msg_list	IN	VARCHAR2 := FND_API.G_FALSE,
2352   p_commit		    IN	VARCHAR2 := FND_API.G_FALSE,
2353   x_return_status	OUT	NOCOPY VARCHAR2,
2354   x_msg_count		OUT	NOCOPY NUMBER,
2355   x_msg_data		OUT	NOCOPY VARCHAR2,
2356   p_resp_appl_id	IN	NUMBER   := NULL,
2357   p_resp_id		    IN	NUMBER   := NULL,
2358   p_user_id		    IN	NUMBER   := NULL,
2359   p_login_id		IN	NUMBER   := FND_API.G_MISS_NUM,
2360   p_request_id		IN	NUMBER   := NULL,
2361   p_request_number	IN	VARCHAR2 := NULL,
2362   p_object_version_number IN NUMBER,
2363   p_severity_id		IN	NUMBER   := NULL,
2364   p_severity		IN	VARCHAR2 := NULL,
2365   p_audit_comments	IN	VARCHAR2 := NULL,
2366   p_comments		IN	VARCHAR2 := NULL,
2367   p_public_comment_flag	IN	VARCHAR2 := FND_API.G_FALSE,
2368   x_interaction_id  OUT NOCOPY NUMBER
2369 );
2370 
2371 -- -------------------------------------------------------------------
2372 -- Start of comments
2373 --  API Name	: Update_Urgency
2374 --  Type	: Public
2375 --  Description	: Update the urgency of a service request
2376 --  Pre-reqs	: None
2377 --
2378 --  Standard IN Parameters:
2379 --	p_api_version			IN	NUMBER		Required
2380 --	p_init_msg_list			IN	VARCHAR2	Optional
2381 --		Default = FND_API.G_FALSE
2382 --	p_commit			IN	VARCHAR2	Optional
2383 --		Default = FND_API.G_FALSE
2384 --
2385 --  Standard OUT Parameters:
2386 --	p_return_status			OUT	VARCHAR2(1)
2387 --	p_msg_count			OUT	NUMBER
2388 --	p_msg_data			OUT	VARCHAR2(2000)
2389 --
2390 --  Service Request IN Parameters:
2391 --	p_resp_appl_id			IN	NUMBER		Optional
2392 --		Default = NULL
2393 --	p_resp_id			IN	NUMBER		Optional
2394 --		Default = NULL
2395 --	p_user_id			IN	NUMBER		Optional
2396 --		Default = NULL
2397 --	p_login_id			IN	NUMBER		Optional
2398 --		Default = FND_API.G_MISS_NUM
2399 
2400 ----------------------------------------------
2401 --      Not in the API
2402 
2403 --      p_org_id			IN	NUMBER		Optional
2404 --		Default = NULL
2405 
2406 -------------------------------------------------------
2407 --	p_request_id			IN	NUMBER		Optional
2408 --		Default = NULL
2409 --	p_request_number		IN	VARCHAR2	Optional
2410 --		Default = NULL
2411 --	p_urgency_id			IN	NUMBER		Optional
2412 --		Default = FND_API.G_MISS_NUM
2413 --	p_urgency			IN	VARCHAR2	Optional
2414 --		Default = FND_API.G_MISS_CHAR
2415 --	p_audit_comments		IN	VARCHAR2	Optional
2416 --		Default = NULL
2417 --		Used for the audit record.
2418 --
2419 --  Calls IN parameters:
2420 --	p_comments			IN	VARCHAR2(2000)	Optional
2421 --		Service request comments or log of the conversation.
2422 --	p_public_comment_flag		IN	VARCHAR2(1)	Optional
2423 --		Indicate whether the service request comment is public (can be
2424 --		viewed by anyone).
2425 --
2426 --  Calls OUT parameters:
2427 --	p_call_id			OUT	NUMBER
2428 --		System generated ID of service request call
2429 --
2430 --  Version	: Initial Version	1.0
2431 --
2432 --  Notes:	: Either p_request_id or p_request_number must be non-null.
2433 --		  If both are passed in, p_request_number will be ignored
2434 --
2435 --		  Either p_urgency or p_urgency_id must be passed in. If
2436 --		  both are passed in, the value of p_urgency will be ignore.
2437 --
2438 -- End of comments
2439 -- -------------------------------------------------------------------
2440 
2441 PROCEDURE Update_Urgency
2442 ( p_api_version		IN	NUMBER,
2443   p_init_msg_list	IN	VARCHAR2 := FND_API.G_FALSE,
2444   p_commit		    IN	VARCHAR2 := FND_API.G_FALSE,
2445   x_return_status	OUT	NOCOPY VARCHAR2,
2446   x_msg_count		OUT	NOCOPY NUMBER,
2447   x_msg_data		OUT	NOCOPY VARCHAR2,
2448   p_resp_appl_id	IN	NUMBER   := NULL,
2449   p_resp_id		    IN	NUMBER   := NULL,
2450   p_user_id		    IN	NUMBER   := NULL,
2451   p_login_id		IN	NUMBER   := FND_API.G_MISS_NUM,
2452   p_request_id		IN	NUMBER   := NULL,
2453   p_request_number	IN	VARCHAR2 := NULL,
2454   p_object_version_number IN NUMBER,
2455   p_urgency_id		IN	NUMBER   := FND_API.G_MISS_NUM,
2456   p_urgency		    IN	VARCHAR2 := FND_API.G_MISS_CHAR,
2457   p_audit_comments	IN	VARCHAR2 := NULL,
2458   p_comments		IN	VARCHAR2 := NULL,
2459   p_public_comment_flag	IN	VARCHAR2 := FND_API.G_FALSE,
2460   x_interaction_id  OUT NOCOPY NUMBER
2461 );
2462 
2463 
2464 -- -------------------------------------------------------------------
2465 -- Start of comments
2466 --  API Name	: Update_Owner
2467 --  Type	: Public
2468 --  Description	: Update the owner of a service request
2469 --  Pre-reqs	: Parameter p_owner_id must be a valid employee ID of
2470 --                an active employee in HR
2471 --
2472 --  Standard IN Parameters:
2473 --	p_api_version			IN	NUMBER		Required
2474 --	p_init_msg_list			IN	VARCHAR2	Optional
2475 --		Default = FND_API.G_FALSE
2476 --	p_commit			IN	VARCHAR2	Optional
2477 --		Default = FND_API.G_FALSE
2478 --
2479 --  Standard OUT Parameters:
2480 --	p_return_status			OUT	VARCHAR2(1)
2481 --	p_msg_count			OUT	NUMBER
2482 --	p_msg_data			OUT	VARCHAR2(2000)
2483 --
2484 --  Service Request IN Parameters:
2485 --	p_resp_appl_id			IN	NUMBER		Optional
2486 --		Default = NULL
2487 --	p_resp_id			IN	NUMBER		Optional
2488 --		Default = NULL
2489 --	p_user_id			IN	NUMBER		Optional
2490 --		Default = NULL
2491 --	p_login_id			IN	NUMBER		Optional
2492 --		Default = FND_API.G_MISS_NUM
2493 
2494 -----------------------------------------
2495 --     Not in the API
2496 --      p_org_id			IN	NUMBER		Optional
2497 --		Default = NULL
2498 -----------------------------------------------
2499 
2500 --	p_request_id			IN	NUMBER		Optional
2501 --		Default = NULL
2502 --	p_request_number		IN	VARCHAR2	Optional
2503 --		Default = NULL
2504 --	p_Owner_id			IN	NUMBER		Required
2505 --		Cannot be NULL.
2506 --	p_audit_comments		IN	VARCHAR2	Optional
2507 --		Default = NULL
2508 --		Used for the audit record.
2509 --	p_called_by_workflow		IN	NUMBER		Optional
2510 --		Default = FND_API.G_FALSE
2511 --		Whether or not this API is being called by the active workflow
2512 --		process of the service request.
2513 --	p_workflow_process_id		IN	NUMBER		Optional
2514 --		Default = NULL
2515 --		The workflow process ID of the active workflow process.
2516 --
2517 --  Calls IN parameters:
2518 --	p_comments			IN	VARCHAR2(2000)	Optional
2519 --		Service request comments or log of the conversation.
2520 --	p_public_comment_flag		IN	VARCHAR2(1)	Optional
2521 --		Indicate whether the service request comment is public (can be
2522 --		viewed by anyone).
2523 --
2524 --  Calls OUT parameters:
2525 --	p_call_id			OUT	NUMBER
2526 --		System generated ID of service request call
2527 --
2528 --  Version	: Initial Version	1.0
2529 --
2530 --  Notes:	: Either p_request_id or p_request_number must be non-null.
2531 --		  If both are passed in, p_request_number will be ignored
2532 --
2533 --		  The owner of the service request cannot be updated when
2534 --		  there is an active workflow process unless the API is
2535 --    		  being called by the process itself.  In that case, the
2536 --      	  caller must pass in the workflow process ID of the active
2537 --                workflow process for verification.
2538 --
2539 -- End of comments
2540 -- -------------------------------------------------------------------
2541 /*#
2542  * Updates both the group and the individual owner of an existing service request.
2543  * For details on the parameters, please refer to the document on Metalink from the URL provided above.
2544  *
2545  * @rep:scope public
2546  * @rep:lifecycle active
2547  * @rep:compatibility S
2548  * @rep:displayname Update Service Request Owner
2549  * @rep:primaryinstance
2550  * @rep:metalink 390479.1 Oracle White Paper : Service Request Public Application Programming Interfaces (APIs)
2551 */
2552 
2553 /**** Above text has been added to enable the integration repository to extract the data
2554       from the source code file and populate the integration repository schema so that
2555       Update_Owner API appears in the integration repository.
2556 ****/
2557 
2558 PROCEDURE Update_Owner
2559 ( p_api_version		IN	NUMBER,
2560   p_init_msg_list	IN	VARCHAR2 := FND_API.G_FALSE,
2561   p_commit		    IN	VARCHAR2 := FND_API.G_FALSE,
2562   x_return_status	OUT	NOCOPY VARCHAR2,
2563   x_msg_count		OUT	NOCOPY NUMBER,
2564   x_msg_data		OUT	NOCOPY VARCHAR2,
2565   p_resp_appl_id	IN	NUMBER   := NULL,
2566   p_resp_id		    IN	NUMBER   := NULL,
2567   p_user_id		    IN	NUMBER   := NULL,
2568   p_login_id		IN	NUMBER   := FND_API.G_MISS_NUM,
2569   p_request_id		IN	NUMBER   := NULL,
2570   p_request_number	IN	VARCHAR2 := NULL,
2571   p_object_version_number IN NUMBER,
2572   p_owner_id		IN	NUMBER,
2573   p_owner_group_id  IN   NUMBER,
2574   p_resource_type	IN	VARCHAR2,
2575   p_audit_comments	IN	VARCHAR2 := NULL,
2576   p_called_by_workflow	IN	VARCHAR2 := FND_API.G_FALSE,
2577   p_workflow_process_id	IN	NUMBER   := NULL,
2578   p_comments		    IN	VARCHAR2 := NULL,
2579   p_public_comment_flag	IN	VARCHAR2 := FND_API.G_FALSE,
2580   x_interaction_id  OUT NOCOPY NUMBER
2581 );
2582 
2583 -- -------------------------------------------------------------------
2584 -- Start of comments
2585 --  API Name	: Update_Problem_Code
2586 --  Type	: Public
2587 --  Description	: Update the problem code of a service request
2588 --  Pre-reqs	: None
2589 --
2590 --  Standard IN Parameters:
2591 --	p_api_version			IN	NUMBER		Required
2592 --	p_init_msg_list			IN	VARCHAR2	Optional
2593 --		Default = FND_API.G_FALSE
2594 --	p_commit			IN	VARCHAR2	Optional
2595 --		Default = FND_API.G_FALSE
2596 --
2597 --  Standard OUT Parameters:
2598 --	p_return_status			OUT	VARCHAR2(1)
2599 --	p_msg_count			OUT	NUMBER
2600 --	p_msg_data			OUT	VARCHAR2(2000)
2601 --
2602 --  Service Request IN Parameters:
2603 --	p_resp_appl_id			IN	NUMBER		Optional
2604 --		Default = NULL
2605 --	p_resp_id			IN	NUMBER		Optional
2606 --		Default = NULL
2607 --	p_user_id			IN	NUMBER		Optional
2608 --		Default = NULL
2609 --	p_login_id			IN	NUMBER		Optional
2610 --		Default = FND_API.G_MISS_NUM
2611 
2612 ---------------------------------
2613 --     Not in API
2614 --      p_org_id			IN	NUMBER		Optional
2615 --		Default = NULL
2616 
2617 -----------------------------
2618 
2619 
2620 --	p_request_id			IN	NUMBER		Optional
2621 --		Default = NULL
2622 --	p_request_number		IN	VARCHAR2	Optional
2623 --		Default = NULL
2624 --      p_problem_code			IN	VARCHAR2	Required
2625 --
2626 --  Calls IN parameters:
2627 --	p_comments			IN	VARCHAR2(2000)	Optional
2628 --		Service request comments or log of the conversation.
2629 --	p_public_comment_flag		IN	VARCHAR2(1)	Optional
2630 --		Indicate whether the service request comment is public (can be
2631 --		viewed by anyone).
2632 --
2633 --  Calls OUT parameters:
2634 --	p_call_id			OUT	NUMBER
2635 --		System generated ID of service request call
2636 --
2637 --  Version	: Initial Version	1.0
2638 --
2639 --  Notes:	: Either p_request_id or p_request_number must be non-null.
2640 --		  If both are passed in, p_request_number will be ignored
2641 --
2642 -- End of comments
2643 -- -------------------------------------------------------------------
2644 
2645 PROCEDURE Update_Problem_Code
2646 ( p_api_version		IN	NUMBER,
2647   p_init_msg_list	IN	VARCHAR2 := FND_API.G_FALSE,
2648   p_commit		    IN	VARCHAR2 := FND_API.G_FALSE,
2649   x_return_status	OUT	NOCOPY VARCHAR2,
2650   x_msg_count		OUT	NOCOPY NUMBER,
2651   x_msg_data		OUT	NOCOPY VARCHAR2,
2652   p_resp_appl_id	IN	NUMBER   := NULL,
2653   p_resp_id		    IN	NUMBER   := NULL,
2654   p_user_id		    IN	NUMBER   := NULL,
2655   p_login_id		IN	NUMBER   := FND_API.G_MISS_NUM,
2656   p_request_id		IN	NUMBER   := NULL,
2657   p_request_number	IN	VARCHAR2 := NULL,
2658   p_object_version_number IN NUMBER,
2659   p_problem_code	IN	VARCHAR2,
2660   p_comments		IN	VARCHAR2 := NULL,
2661   p_public_comment_flag	IN	VARCHAR2 := FND_API.G_FALSE,
2662   x_interaction_id  OUT NOCOPY NUMBER
2663 );
2664 
2665 
2666 -------------------------------------------------------------------
2667 ---These APIs are owned by Shih-Hsin
2668 -- Start of comments
2669 --  API Name    : Link_KB_Statement
2670 --  Type        : Public
2671 --  Function    : Link a Knowledge Management statement with a Service Request
2672 --  Pre-reqs    : Must a valid Service Request id and KB Element id
2673 --
2674 --  Parameters  :
2675 --      IN      :
2676 --   p_api_version            IN   NUMBER         Required
2677 --   p_init_msg_list               IN   VARCHAR2(1)    Optional
2678 --        Default = FND_API.G_FALSE
2679 --   p_commit            IN   VARCHAR2(1)    Optional
2680 --        Default = FND_API.G_FALSE
2681 --      p_request_id                    IN      NUMBER          Required
2682 --      p_statement_id                  IN      NUMBER          Required
2683 --      p_is_statement_true             IN      BOOLEAN         Required
2684 --
2685 --      OUT     :
2686 --   x_return_status               OUT  VARCHAR2(1)
2687 --   x_msg_count              OUT  NUMBER
2688 --   x_msg_data               OUT  VARCHAR2(2000)
2689 --      x_statement_link_id             OUT     NUMBER
2690 --
2691 --  Version     : Initial Version     1.0
2692 --
2693 --  Notes       : This procedure will link a statement in the knowledge
2694 --                management system to a service request.
2695 --
2696 -- End of comments
2697 
2698 PROCEDURE Link_KB_Statement
2699 (
2700  p_api_version            IN     NUMBER,
2701  p_init_msg_list          IN     VARCHAR2      := FND_API.G_FALSE,
2702  p_commit                 IN     VARCHAR2      := FND_API.G_FALSE,
2703  p_validation_level       IN     NUMBER        := FND_API.G_VALID_LEVEL_FULL,
2704  x_return_status          OUT    NOCOPY VARCHAR2,
2705  x_msg_count              OUT    NOCOPY NUMBER,
2706  x_msg_data               OUT    NOCOPY VARCHAR2,
2707  p_request_id             IN     NUMBER,
2708  p_statement_id           IN     NUMBER,
2709  p_is_statement_true      IN     VARCHAR2,
2710  x_statement_link_id      OUT    NOCOPY NUMBER
2711 );
2712 
2713 -------------------------------------------------------------------------
2714 -- Start of comments
2715 --  API Name    : Link_KB_Solution
2716 --  Type        : Public
2717 --  Function    : Link a Knowledge Management solution with a Service Request
2718 --  Pre-reqs    : Must a valid Service Request id and KB Set id
2719 --
2720 --  Parameters  :
2721 --      IN      :
2722 --   p_api_version            IN   NUMBER         Required
2723 --   p_init_msg_list               IN   VARCHAR2(1)    Optional
2724 --        Default = FND_API.G_FALSE
2725 --   p_commit            IN   VARCHAR2(1)    Optional
2726 --        Default = FND_API.G_FALSE
2727 --      p_request_id                    IN      NUMBER          Required
2728 --      p_solution_id                   IN      NUMBER          Required
2729 --      p_is_solution_true              IN      BOOLEAN         Required
2730 --
2731 --      OUT     :
2732 --   x_return_status               OUT  VARCHAR2(1)
2733 --   x_msg_count              OUT  NUMBER
2734 --   x_msg_data               OUT  VARCHAR2(2000)
2735 --      x_solution_link_id              OUT     NUMBER
2736 --
2737 --  Version     : Initial Version     1.0
2738 --
2739 --  Notes       : This procedure will link a solution in the knowledge
2740 --                management system to a service request.
2741 --
2742 -- End of comments
2743 
2744 /*#
2745  * Links an Oracle Knowledge Base solution to an existing service request.
2746  * For details on the parameters, please refer to the document on Metalink from the URL provided above.
2747  *
2748  * @rep:scope public
2749  * @rep:lifecycle active
2750  * @rep:compatibility S
2751  * @rep:displayname Link Knowledge Base Solution
2752  * @rep:primaryinstance
2753  * @rep:businessevent  oracle.apps.cs.knowledge.SolutionLinked
2754  * @rep:metalink 390479.1 Oracle White Paper : Service Request Public Application Programming Interfaces (APIs)
2755 */
2756 
2757 /**** Above text has been added to enable the integration repository to extract the data
2758       from the source code file and populate the integration repository schema so that
2759       Link_KB_Solution API appears in the integration repository.
2760 ****/
2761 
2762 PROCEDURE Link_KB_Solution
2763 (
2764  p_api_version            IN     NUMBER,
2765  p_init_msg_list          IN     VARCHAR2      := FND_API.G_FALSE,
2766  p_commit                 IN     VARCHAR2      := FND_API.G_FALSE,
2767  p_validation_level       IN     NUMBER        := FND_API.G_VALID_LEVEL_FULL,
2768  x_return_status          OUT    NOCOPY VARCHAR2,
2769  x_msg_count              OUT    NOCOPY NUMBER,
2770  x_msg_data               OUT    NOCOPY VARCHAR2,
2771  p_request_id             IN     NUMBER,
2772  p_solution_id            IN     NUMBER,
2773  p_is_solution_true       IN     VARCHAR2,
2774  x_solution_link_id       OUT    NOCOPY NUMBER
2775 );
2776 
2777 /* This is a overloaded procedure for create service request which is mainly
2778    created for making the changes for 1159 backward compatiable. This does not
2779    contain the following parameters:-
2780    x_individual_owner, x_group_owner, x_individual_type and p_auto_assign.
2781    and will call the above procedure with all these parameters and version
2782    as 3.0*/
2783 
2784 PROCEDURE Create_ServiceRequest
2785 ( p_api_version                   IN      NUMBER,
2786   p_init_msg_list                 IN      VARCHAR2      := FND_API.G_FALSE,
2787   p_commit                        IN      VARCHAR2      := FND_API.G_FALSE,
2788   x_return_status                 OUT     NOCOPY VARCHAR2,
2789   x_msg_count                     OUT     NOCOPY NUMBER,
2790   x_msg_data                      OUT     NOCOPY VARCHAR2,
2791   p_resp_appl_id                  IN      NUMBER                := NULL,
2792   p_resp_id                       IN      NUMBER                := NULL,
2793   p_user_id                       IN      NUMBER                := NULL,
2794   p_login_id                      IN      NUMBER                := NULL,
2795   p_org_id                        IN      NUMBER                := NULL,
2796   p_request_id                    IN      NUMBER                := NULL,
2797   p_request_number                IN      VARCHAR2              := NULL,
2798   p_service_request_rec           IN      SERVICE_REQUEST_REC_TYPE,
2799   p_notes                         IN      NOTES_TABLE,
2800   p_contacts                      IN      CONTACTS_TABLE,
2801   p_default_contract_sla_ind	  IN      VARCHAR2 Default 'N',
2802   x_request_id                    OUT     NOCOPY NUMBER,
2803   x_request_number                OUT     NOCOPY VARCHAR2,
2804   x_interaction_id                OUT     NOCOPY NUMBER,
2805   x_workflow_process_id           OUT     NOCOPY NUMBER
2806 );
2807 
2808 /*#
2809  * Updates the values of user-defined attributes (extensible attributes) for an existing service request.
2810  * Extensible attributes are used only by Customer Support, Service Desk, and Oracle Case Management.
2811  * For details on the parameters, please refer to the document on Metalink from the URL provided above.
2812  *
2813  * @rep:scope public
2814  * @rep:lifecycle active
2815  * @rep:compatibility S
2816  * @rep:displayname Process SR Extensible Attributes
2817  * @rep:primaryinstance
2818  * @rep:metalink 390479.1 Oracle White Paper : Service Request Public Application Programming Interfaces (APIs)
2819 */
2820 PROCEDURE process_sr_ext_attrs
2821 ( p_api_version         IN         NUMBER
2822 , p_init_msg_list       IN         VARCHAR2 DEFAULT NULL
2823 , p_commit              IN         VARCHAR2 DEFAULT NULL
2824 , p_incident_id         IN         NUMBER
2825 , p_ext_attr_grp_tbl    IN         CS_ServiceRequest_PUB.EXT_ATTR_GRP_TBL_TYPE
2826 , p_ext_attr_tbl        IN         CS_ServiceRequest_PUB.EXT_ATTR_TBL_TYPE
2827 , p_modified_by         IN         NUMBER   DEFAULT NULL
2828 , p_modified_on         IN         DATE     DEFAULT NULL
2829 , x_failed_row_id_list  OUT NOCOPY VARCHAR2
2830 , x_return_status       OUT NOCOPY VARCHAR2
2831 , x_errorcode           OUT NOCOPY NUMBER
2832 , x_msg_count           OUT NOCOPY NUMBER
2833 , x_msg_data            OUT NOCOPY VARCHAR2
2834 );
2835 
2836 
2837 /*Start changes for get SR related info
2838 * for 12.2
2839 */
2840   PROCEDURE GET_SR_INFO
2841   ( p_api_version        IN   NUMBER,
2842     p_incident_id        IN   NUMBER ,
2843     p_incident_number    IN   VARCHAR2,
2844     x_getsr_out_rec      IN OUT NOCOPY GET_SR_REC,
2845     x_tasks              IN OUT NOCOPY tasks_table,
2846     x_notes              IN OUT NOCOPY sr_notes_table,
2847      x_return_status      OUT NOCOPY VARCHAR2,
2848     x_msg_count          OUT NOCOPY VARCHAR2,
2849     x_msg_data           OUT NOCOPY VARCHAR2);
2850 
2851 -- end changes for get sr related info -12.2
2852 
2853 -----------------------------------------------------------
2854 
2855 END CS_ServiceRequest_PUB;