DBA Data[Home] [Help]

PACKAGE BODY: APPS.PO_MASS_UPDATE_PO_GRP

Source


1 PACKAGE BODY PO_Mass_Update_PO_GRP AS
2 /* $Header: PO_Mass_Update_PO_GRP.plb 120.2 2008/01/09 14:30:58 rakchakr noship $*/
3 
4 --------------------------------------------------------------------------------------------------
5 
6 -- Call is made such that the sql file POXMUB.sql calls the procedure
7 -- PO_Mass_Update_PO_GRP.Update_Persons
8 -- PO_Mass_Update_PO_GRP.Update_Persons calls the procedure PO_Mass_Update_PO_PVT.DO_Update
9 
10 --------------------------------------------------------------------------------------------------
11 
12 g_debug_stmt CONSTANT BOOLEAN := PO_DEBUG.is_debug_stmt_on;
13 g_debug_unexp CONSTANT BOOLEAN := PO_DEBUG.is_debug_unexp_on;
14 g_pkg_name CONSTANT VARCHAR2(100) := 'PO_Mass_Update_PO_GRP';
15 g_log_head  CONSTANT VARCHAR2(100) := 'po.plsql.' || g_pkg_name || '.';
16 
17 --------------------------------------------------------------------------------------------------
18 -- Start of Comments
19 
20 -- API Name   : Update_Persons
21 -- Type       : Group
22 -- Pre-reqs   : None
23 -- Function   : Calls the procedure PO_Mass_Update_PO_PVT.Do_Update to update the
24 --              Buyer/Approver/Deliver_To person accordingly to the input received
25 --	        from the Update_Person parameter value set.
26 -- Parameters :
27 
28 -- IN         : p_update_person        Person needs to be updated.(Buyer/Approver/Deliver_To)
29 --              p_old_personid         Id of the old person
30 --		p_new_personid         Id of the new person
31 --		p_document_type        Type of the document(STANDARD,BLANKET.CONTRACT,PLANNED).
32 --		p_document_no_from     Document number from
33 --		p_document_no_to       Document number to
34 --		p_date_from            Date from
35 --		p_date_to              Date to
36 --		p_supplier_id          Supplier id
37 --		p_include_close_po     Include Close PO's or not (Value as Yes or No)
38 --		p_commit_interval      Commit interval
39 
40 -- OUT        : p_msg_data             Actual message in encoded format
41 --		p_msg_count            Holds the number of messages in the API list
42 --		p_return_status        Return status of the API (Includes 'S','E','U')
43 
44 -- End of Comments
45 --------------------------------------------------------------------------------------------------
46 
47 PROCEDURE Update_Persons(p_update_person    IN VARCHAR2,
48                          p_old_personid     IN NUMBER,
49                          p_new_personid     IN NUMBER,
50                          p_document_type    IN VARCHAR2,
51                          p_document_no_from IN VARCHAR2,
52                          p_document_no_to   IN VARCHAR2,
53                          p_date_from        IN DATE,
54                          p_date_to          IN DATE,
55                          p_supplier_id      IN NUMBER,
56                          p_include_close_po IN VARCHAR2,
57 			 p_commit_interval  IN NUMBER,
58 			 p_msg_data         OUT NOCOPY  VARCHAR2,
59                          p_msg_count        OUT NOCOPY  NUMBER,
60                          p_return_status    OUT NOCOPY  VARCHAR2) IS
61 
62 l_progress                 VARCHAR2(3);
63 l_log_head                 CONSTANT VARCHAR2(1000) := g_log_head||'Update_Persons';
64 
65 BEGIN
66 
67 l_progress  := '000';
68 
69 IF g_debug_stmt THEN
70 
71 	PO_DEBUG.debug_begin(l_log_head);
72 	PO_DEBUG.debug_var(l_log_head,l_progress,'p_update_person',p_update_person );
73         PO_DEBUG.debug_var(l_log_head,l_progress,'p_old_personid', p_old_personid);
74         PO_DEBUG.debug_var(l_log_head,l_progress,'p_new_personid', p_new_personid);
75         PO_DEBUG.debug_var(l_log_head,l_progress,'p_document_type',p_document_type );
76         PO_DEBUG.debug_var(l_log_head,l_progress,'p_document_no_from',p_document_no_from );
77 	PO_DEBUG.debug_var(l_log_head,l_progress,'p_date_from',p_date_from);
78 	PO_DEBUG.debug_var(l_log_head,l_progress,'p_date_to',p_date_to);
79 	PO_DEBUG.debug_var(l_log_head,l_progress,'p_supplier_id',p_supplier_id);
80 	PO_DEBUG.debug_var(l_log_head,l_progress,'p_include_close_po',p_include_close_po);
81 	PO_DEBUG.debug_var(l_log_head,l_progress,'p_commit_interval',p_commit_interval);
82 
83 END IF;
84 
85 SAVEPOINT Update_Persons_SP;
86 
87 PO_Mass_Update_PO_PVT.DO_Update(p_update_person,
88                                 p_old_personid,
89                                 p_new_personid,
90                                 p_document_type,
91                                 p_document_no_from,
92                                 p_document_no_to,
93                                 p_date_from,
94                                 p_date_to,
95                                 p_supplier_id,
96                                 p_include_close_po,
97 				p_commit_interval,
98 				p_msg_data,
99                                 p_msg_count,
100                                 p_return_status);
101 
102 
103 l_progress  := '001';
104 
105 IF g_debug_stmt THEN
106 
107 	PO_DEBUG.debug_var(l_log_head,l_progress,'After Calling Do_Update', 'After Calling Do_Update');
108 
109 END IF;
110 
111 EXCEPTION
112 
113 WHEN OTHERS THEN
114 
115 	IF ( FND_LOG.LEVEL_UNEXPECTED >= FND_LOG.G_CURRENT_RUNTIME_LEVEL) THEN
116 
117 		FND_LOG.STRING( FND_LOG.LEVEL_UNEXPECTED ,l_log_head,l_progress||SQLCODE||SUBSTR(SQLERRM,1,200));
118 
119 	END IF;
120 
121 ROLLBACK TO Update_Persons_SP;
122 
123 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
124 
125 	IF FND_MSG_PUB.Check_Msg_Level( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR ) THEN
126 
127 		FND_MSG_PUB.Add_Exc_Msg( G_PKG_NAME, l_log_head );
128 
129 	END IF;
130 
131 FND_MSG_PUB.Count_And_Get(p_encoded=>'F', p_count => p_msg_count, p_data => p_msg_data );
132 
133 END Update_Persons;
134 
135 END PO_Mass_Update_PO_GRP;