DBA Data[Home] [Help]

PACKAGE BODY: APPS.EAM_REQUEST_DEFAULT_PVT

Source


1 PACKAGE BODY EAM_REQUEST_DEFAULT_PVT AS
2 /* $Header: EAMVRQDB.pls 120.1 2005/12/15 04:00:57 mmaduska noship $ */
3 /***************************************************************************
4 --
5 --  Copyright (c) 2002 Oracle Corporation, Redwood Shores, CA, USA
6 --  All rights reserved.
7 --
8 --  FILENAME
9 --
10 --      EAMVRQDB.pls
11 --
12 --  DESCRIPTION
13 --
14 --      Body of package EAM_REQUEST_DEFAULT_PVT
15 --
16 --  NOTES
17 --
18 --  HISTORY
19 --
20 --  14-FEB-2005    mmaduska     Initial Creation
21 ***************************************************************************/
22 
23  PROCEDURE Attribute_Defaulting
24 (     p_eam_request_rec               IN  EAM_PROCESS_WO_PUB.eam_request_rec_type
25     , x_eam_request_rec               OUT NOCOPY  EAM_PROCESS_WO_PUB.eam_request_rec_type
26     , x_return_status                 OUT NOCOPY  VARCHAR2
27 )
28   IS
29      l_eam_request_rec                  EAM_PROCESS_WO_PUB.eam_request_rec_type;
30   BEGIN
31 
32      IF EAM_PROCESS_WO_PVT.Get_Debug = 'Y' THEN EAM_ERROR_MESSAGE_PVT.Write_Debug('Work Request/Service Request processing Attribute Defaulting'); END IF;
33 
34 	  x_eam_request_rec := p_eam_request_rec;
35 	  x_return_status   := FND_API.G_RET_STS_SUCCESS;
36 
37 	  IF p_eam_request_rec.organization_code IS NOT NULL AND
38 		(p_eam_request_rec.organization_id IS NULL OR p_eam_request_rec.organization_id = FND_API.G_MISS_NUM) THEN
39 
40 		SELECT organization_id
41 		  INTO x_eam_request_rec.organization_id
42 		  FROM MTL_PARAMETERS mp
43                  WHERE mp.organization_code = p_eam_request_rec.organization_code;
44 
45 	  END IF;
46 
47 	  IF p_eam_request_rec.wip_entity_name IS NOT NULL AND
48 	     (p_eam_request_rec.wip_entity_id IS NULL OR p_eam_request_rec.wip_entity_id = FND_API.G_MISS_NUM) THEN
49 
50 		SELECT wip_entity_id into x_eam_request_rec.wip_entity_id
51 		  FROM WIP_ENTITIES we
52 		 WHERE we.organization_id = x_eam_request_rec.organization_id
53 		   AND we.wip_entity_name = p_eam_request_rec.wip_entity_name;
54 	 END IF;
55 
56 	 IF p_eam_request_rec.request_number IS NOT NULL AND
57 	     (p_eam_request_rec.request_id IS NULL OR p_eam_request_rec.request_id = FND_API.G_MISS_NUM) THEN
58 
59 	     IF p_eam_request_rec.request_type = 1 THEN
60 			x_eam_request_rec.request_id := p_eam_request_rec.request_number;
61 	     ELSE
62 			SELECT incident_id
63 			  INTO x_eam_request_rec.request_id
64 			  FROM cs_incidents_all_b
65 			 WHERE incident_number = p_eam_request_rec.request_number;
66 	     END IF;
67          END IF;
68 
69 	 IF  p_eam_request_rec.transaction_type = EAM_PROCESS_WO_PVT.G_OPR_CREATE AND p_eam_request_rec.request_type = 2 THEN
70 		SELECT EAM_WO_SERVICE_ASSOCIATION_S.NEXTVAL
71 		  INTO x_eam_request_rec.service_assoc_id
72 		  FROM dual;
73 	 END IF;
74 
75   END Attribute_Defaulting;
76 
77 
78 END EAM_REQUEST_DEFAULT_PVT;