1 PACKAGE INV_ITEM_MSG AS
2 /* $Header: INVVIMSS.pls 120.1 2006/05/25 10:44:09 lparihar noship $ */
3
4
5 ----------------------- Global variables and constants -----------------------
6
7 g_MISS_CHAR CONSTANT VARCHAR2(1) := fnd_api.g_MISS_CHAR;
8 g_MISS_NUM CONSTANT NUMBER := fnd_api.g_MISS_NUM;
9 g_MISS_DATE CONSTANT DATE := fnd_api.g_MISS_DATE;
10 g_YES CONSTANT VARCHAR2(1) := 'Y';
11 g_NO CONSTANT VARCHAR2(1) := 'N';
12
13 -- Global constants used by the Write_Message procedure to
14 -- determine which message to write.
15
16 G_FIRST CONSTANT NUMBER := -1 ;
17 G_NEXT CONSTANT NUMBER := -2 ;
18 G_LAST CONSTANT NUMBER := -3 ;
19 G_PREVIOUS CONSTANT NUMBER := -4 ;
20
21 -- Message/debug level
22
23 g_Level_Unexpected CONSTANT NUMBER := 6; -- Message level Unexpected Error
24 g_Level_Error CONSTANT NUMBER := 5; -- Message level Error
25 g_Level_Warning CONSTANT NUMBER := 4; -- Message level Warning
26 g_Level_Event CONSTANT NUMBER := 3; -- Message level Debug Event
27 g_Level_Procedure CONSTANT NUMBER := 2; -- Message level Debug Procedure
28 g_Level_Statement CONSTANT NUMBER := 1; -- Message level Debug Statement
29
30
31 -- Globals to store data for logging interface errors
32
33 g_Organization_Id NUMBER := NULL;
34 g_Table_Name VARCHAR2(30) := NULL;
35
36 g_User_id NUMBER := -1;
37 g_Login_id NUMBER := -1;
38 g_Prog_appid NUMBER := -1;
39 g_Prog_id NUMBER := -1;
40 g_Request_id NUMBER := -1;
41
42
43 -------------------------- Global type declarations --------------------------
44
45 -- Message context type for debug messages
46
47 TYPE Msg_Ctx_type IS RECORD
48 (
49 Package_Name VARCHAR2(30) := NULL
50 , Procedure_Name VARCHAR2(30) := NULL
51 );
52
53 ------------------------------------------------------------------------------
54
55
56 --------------------------------- Initialize ---------------------------------
57
58 PROCEDURE Initialize;
59
60 PROCEDURE Initialize_Error_Handler;
61
62 ----------------------------- set_Message_Level ------------------------------
63
64 PROCEDURE set_Message_Level (p_Msg_Level IN NUMBER);
65
66
67 ------------------------------ set_Message_Mode ------------------------------
68
69 FUNCTION set_Message_Mode (p_Mode IN VARCHAR2)
70 RETURN VARCHAR2;
71
72 PROCEDURE set_Message_Mode (p_Mode IN VARCHAR2);
73
74
75 -------------------------------- Add_Message ---------------------------------
76
77 PROCEDURE Add_Message
78 ( p_Msg_Name IN VARCHAR2
79 , p_token1 IN VARCHAR2 DEFAULT fnd_api.g_MISS_CHAR
80 , p_value1 IN VARCHAR2 DEFAULT fnd_api.g_MISS_CHAR
81 , p_token2 IN VARCHAR2 DEFAULT fnd_api.g_MISS_CHAR
82 , p_value2 IN VARCHAR2 DEFAULT fnd_api.g_MISS_CHAR
83 , p_token3 IN VARCHAR2 DEFAULT fnd_api.g_MISS_CHAR
84 , p_value3 IN VARCHAR2 DEFAULT fnd_api.g_MISS_CHAR
85 , p_translate IN VARCHAR2 DEFAULT fnd_api.g_FALSE
86 , p_transaction_id IN NUMBER DEFAULT fnd_api.g_MISS_NUM
87 , p_column_name IN VARCHAR2 DEFAULT NULL
88 );
89
90
91 ---------------------------------- Add_Error ---------------------------------
92
93 PROCEDURE Add_Error
94 ( p_Msg_Name IN VARCHAR2
95 , p_token IN VARCHAR2 DEFAULT fnd_api.g_MISS_CHAR
96 , p_value IN VARCHAR2 DEFAULT fnd_api.g_MISS_CHAR
97 , p_translate IN VARCHAR2 DEFAULT fnd_api.g_FALSE
98 );
99
100
101 --------------------------------- Add_Warning --------------------------------
102
103 PROCEDURE Add_Warning
104 ( p_Msg_Name IN VARCHAR2
105 , p_token IN VARCHAR2 DEFAULT fnd_api.g_MISS_CHAR
106 , p_value IN VARCHAR2 DEFAULT fnd_api.g_MISS_CHAR
107 , p_translate IN VARCHAR2 DEFAULT fnd_api.g_FALSE
108 );
109
110
111 ---------------------------- Add_Unexpected_Error ----------------------------
112
113 PROCEDURE Add_Unexpected_Error
114 ( p_Msg_Ctx IN INV_ITEM_MSG.Msg_Ctx_type
115 , p_Error_Text IN VARCHAR2
116 );
117
118
119 ----------------------------------- Debug ------------------------------------
120
121 PROCEDURE Debug
122 ( p_Msg_Ctx IN INV_ITEM_MSG.Msg_Ctx_type
123 , p_Msg_Text IN VARCHAR2
124 );
125
126
127 ---------------------------------- Count_Msg ---------------------------------
128
129 FUNCTION Count_Msg
130 RETURN NUMBER;
131
132
133 -------------------------------- Count_And_Get -------------------------------
134
135 PROCEDURE Count_And_Get
136 ( p_encoded IN VARCHAR2 := FND_API.g_TRUE
137 , p_count OUT NOCOPY NUMBER
138 , p_data OUT NOCOPY VARCHAR2
139 );
140
141
142 -------------------------------- Write_Message -------------------------------
143
144 -- Usage Used to unload a message from the INV_ITEM_MSG message table.
145
146 PROCEDURE Write_Message
147 ( p_msg_index IN NUMBER
148 );
149
150
151 --------------------------------- Write_List ---------------------------------
152
153 -- Usage Used to unload all messages from the INV_ITEM_MSG message table.
154
155 PROCEDURE Write_List
156 ( p_delete IN BOOLEAN DEFAULT TRUE
157 );
158
159 -- PROCEDURE Get
160 --
161 -- Usage Used to get message info from the global message table.
162 --
163 -- Desc Gets the next message from the message table.
164 -- This procedure utilizes the G_msg_index to keep track
165 -- of the last message fetched from the global table and
166 -- then fetches the next.
167 --
168 -- Parameters p_msg_index IN NUMBER := G_NEXT
169 -- Index of message to be fetched. the default is to
170 -- fetch the next message starting by the first
171 -- message. Possible values are :
172 --
173 -- G_FIRST
174 -- G_NEXT
175 -- G_LAST
176 -- G_PREVIOUS
177 -- Specific message index.
178 --
179 -- p_encoded IN VARCHAR2(1) := G_TRUE Optional
180 -- When set to TRUE retieves the message in an
181 -- encoded format. If FALSE, the function calls the
182 -- message dictionary utilities to translate the
183 -- message and do the token substitution, the message
184 -- text is then returned.
185 --
186 -- p_msg_data OUT VARCHAR2(2000)
187 -- p_msg_index_out OUT NUMBER
188
189 PROCEDURE Get
190 ( p_msg_index IN NUMBER := G_NEXT ,
191 p_encoded IN VARCHAR2 := 'T' ,
192 p_data OUT NOCOPY VARCHAR2 ,
193 p_msg_index_out OUT NOCOPY NUMBER
194 );
195
196 -- FUNCTION Get
197 --
198 -- Usage Used to get message info from the message table.
199 --
200 -- Desc Gets the next message from the message table.
201 -- This procedure utilizes the G_msg_index to keep track
202 -- of the last message fetched from the table and
203 -- then fetches the next or previous message depending on
204 -- the mode the function is being called in..
205 --
206 -- Parameters p_msg_index IN NUMBER := G_NEXT
207 -- Index of message to be fetched. the default is to
208 -- fetch the next message starting by the first
209 -- message. Possible values are :
210 --
211 -- G_FIRST
212 -- G_NEXT
213 -- G_LAST
214 -- G_PREVIOUS
215 -- Specific message index.
216 --
217 -- p_encoded IN VARCHAR2(1) := 'T' Optional
218 -- When set to TRUE Get retrieves the message in an
219 -- encoded format. If FALSE, the function calls the
220 -- message dictionary utilities to translate the
221 -- message and do the token substitution, the message
222 -- text is then returned.
223 --
224 -- Return VARCHAR2(2000) message data.
225 -- If there are no more messages it returns NULL.
226 --
227 -- Notes The function name Get is overloaded with another
228 -- procedure Get that performs the exact same function as
229 -- the function, the only difference is that the
230 -- procedure returns the message data as well as its
231 -- index i the message list.
232
233 FUNCTION Get
234 ( p_msg_index IN NUMBER := G_NEXT ,
235 p_encoded IN VARCHAR2 := 'T'
236 )
237 RETURN VARCHAR2;
238
239
240 END INV_ITEM_MSG;