[Home] [Help]
PACKAGE BODY: APPS.WSH_CARRIER_SHIP_METHODS_PKG
Source
1 PACKAGE BODY WSH_CARRIER_SHIP_METHODS_PKG as
2 /* $Header: WSHCSTHB.pls 115.14 2002/11/18 20:12:26 nparikh ship $ */
3
4 --- Package Name: WSH_CARRIER_SHIP_METHODS_PKG
5 --- Pupose: Table Handlers for table WSH_CARRIER_SHIP_METHODS
6 --- Note: Please set tabstop=3 to read file with proper alignment
7
8 --
9 G_PKG_NAME CONSTANT VARCHAR2(50) := 'WSH_CARRIER_SHIP_METHODS_PKG';
10 --
11 PROCEDURE Create_Carrier_Ship_Method(
12 p_Carrier_Ship_Method_Info IN CSMRecType
13 , x_Rowid OUT NOCOPY VARCHAR2
14 , x_Carrier_Ship_Method_id OUT NOCOPY NUMBER
15 , x_Return_Status OUT NOCOPY VARCHAR2
16 )
17 IS
18
19 CURSOR C_Next_id
20 IS
21 SELECT wsh_carrier_ship_methods_s.nextval
22 FROM sys.dual;
23
24 CURSOR C_New_Rowid
25 IS
26 SELECT rowid
27 FROM WSH_CARRIER_SHIP_METHODS
28 WHERE carrier_ship_method_id = x_carrier_ship_method_id;
29
30 no_data_found EXCEPTION;
31 others EXCEPTION;
32 --
33 l_debug_on BOOLEAN;
34 --
35 l_module_name CONSTANT VARCHAR2(100) := 'wsh.plsql.' || G_PKG_NAME || '.' || 'CREATE_CARRIER_SHIP_METHOD';
36 --
37 BEGIN
38 --
39 --
40 l_debug_on := WSH_DEBUG_INTERFACE.g_debug;
41 --
42 IF l_debug_on IS NULL
43 THEN
44 l_debug_on := WSH_DEBUG_SV.is_debug_enabled;
45 END IF;
46 --
47 IF l_debug_on THEN
48 WSH_DEBUG_SV.push(l_module_name);
49 WSH_DEBUG_SV.log(l_module_name,'Carrier_Ship_Method_Id',
50 p_Carrier_Ship_Method_Info.Carrier_Ship_Method_Id);
51 WSH_DEBUG_SV.log(l_module_name,'Ship_Method_Code',
52 p_Carrier_Ship_Method_Info.Ship_Method_Code);
53 WSH_DEBUG_SV.log(l_module_name,'organization_id',
54 p_Carrier_Ship_Method_Info.organization_id);
55 WSH_DEBUG_SV.log(l_module_name,'carrier_site_id',
56 p_Carrier_Ship_Method_Info.carrier_site_id);
57 WSH_DEBUG_SV.log(l_module_name,'Freight_code',
58 p_Carrier_Ship_Method_Info.Freight_code);
59 WSH_DEBUG_SV.log(l_module_name,'Service_level',
60 p_Carrier_Ship_Method_Info.Service_level);
61 WSH_DEBUG_SV.log(l_module_name,'Enabled_Flag',
62 p_Carrier_Ship_Method_Info.Enabled_Flag);
63 WSH_DEBUG_SV.log(l_module_name,'Attribute_Category',
64 p_Carrier_Ship_Method_Info.Attribute_Category);
65 WSH_DEBUG_SV.log(l_module_name,'Attribute1',
66 p_Carrier_Ship_Method_Info.attribute1);
67 WSH_DEBUG_SV.log(l_module_name,'Attribute2',
68 p_Carrier_Ship_Method_Info.attribute2);
69 WSH_DEBUG_SV.log(l_module_name,'Attribute3',
70 p_Carrier_Ship_Method_Info.attribute3);
71 WSH_DEBUG_SV.log(l_module_name,'Attribute4',
72 p_Carrier_Ship_Method_Info.attribute4);
73 WSH_DEBUG_SV.log(l_module_name,'Attribute5',
74 p_Carrier_Ship_Method_Info.attribute5);
75 WSH_DEBUG_SV.log(l_module_name,'Attribute6',
76 p_Carrier_Ship_Method_Info.attribute6);
77 WSH_DEBUG_SV.log(l_module_name,'Attribute7',
78 p_Carrier_Ship_Method_Info.attribute7);
79 WSH_DEBUG_SV.log(l_module_name,'Attribute8',
80 p_Carrier_Ship_Method_Info.attribute8);
81 WSH_DEBUG_SV.log(l_module_name,'Attribute9',
82 p_Carrier_Ship_Method_Info.attribute9);
83 WSH_DEBUG_SV.log(l_module_name,'Attribute10',
84 p_Carrier_Ship_Method_Info.attribute10);
85 WSH_DEBUG_SV.log(l_module_name,'Attribute11',
86 p_Carrier_Ship_Method_Info.attribute11);
87 WSH_DEBUG_SV.log(l_module_name,'Attribute12',
88 p_Carrier_Ship_Method_Info.attribute12);
89 WSH_DEBUG_SV.log(l_module_name,'Attribute13',
90 p_Carrier_Ship_Method_Info.attribute13);
91 WSH_DEBUG_SV.log(l_module_name,'Attribute14',
92 p_Carrier_Ship_Method_Info.attribute14);
93 WSH_DEBUG_SV.log(l_module_name,'Attribute15',
94 p_Carrier_Ship_Method_Info.attribute15);
95 END IF;
96 --
97 x_return_status := WSH_UTIL_CORE.G_RET_STS_SUCCESS;
98 IF (X_Carrier_ship_method_id is NULL) THEN
99 OPEN C_Next_id;
100 FETCH C_Next_id INTO X_Carrier_Ship_Method_Id;
101 IF l_debug_on THEN
102 WSH_DEBUG_SV.log(l_module_name,'X_Carrier_Ship_Method_Id',
103 X_Carrier_Ship_Method_Id);
104 END IF;
105 CLOSE C_Next_id;
106 END IF;
107 INSERT INTO wsh_carrier_ship_methods(
108 carrier_ship_method_id,
109 carrier_id,
110 ship_method_code,
111 freight_code,
112 service_level,
113 carrier_site_id,
114 organization_id,
115 enabled_flag,
116 attribute_category,
117 attribute1,
118 attribute2,
119 attribute3,
120 attribute4,
121 attribute5,
122 attribute6,
123 attribute7,
124 attribute8,
125 attribute9,
126 attribute10,
127 attribute11,
128 attribute12,
129 attribute13,
130 attribute14,
131 attribute15,
132 creation_date,
133 created_by,
134 last_update_date,
135 last_updated_by,
136 last_update_login,
137 web_enabled
138 )
139 VALUES (
140 x_Carrier_Ship_Method_id,
141 p_Carrier_Ship_Method_Info.Carrier_Id,
142 p_Carrier_Ship_Method_Info.Ship_Method_Code,
143 p_Carrier_Ship_Method_Info.freight_code,
144 p_Carrier_Ship_Method_Info.service_level,
145 p_Carrier_Ship_Method_Info.carrier_site_id,
146 p_Carrier_Ship_Method_Info.organization_id,
147 p_Carrier_Ship_Method_Info.Enabled_Flag,
148 p_Carrier_Ship_Method_Info.Attribute_Category,
149 p_Carrier_Ship_Method_Info.Attribute1,
150 p_Carrier_Ship_Method_Info.Attribute2,
151 p_Carrier_Ship_Method_Info.Attribute3,
152 p_Carrier_Ship_Method_Info.Attribute4,
153 p_Carrier_Ship_Method_Info.Attribute5,
154 p_Carrier_Ship_Method_Info.Attribute6,
155 p_Carrier_Ship_Method_Info.Attribute7,
156 p_Carrier_Ship_Method_Info.Attribute8,
157 p_Carrier_Ship_Method_Info.Attribute9,
158 p_Carrier_Ship_Method_Info.Attribute10,
159 p_Carrier_Ship_Method_Info.Attribute11,
160 p_Carrier_Ship_Method_Info.Attribute12,
161 p_Carrier_Ship_Method_Info.Attribute13,
162 p_Carrier_Ship_Method_Info.Attribute14,
163 p_Carrier_Ship_Method_Info.Attribute15,
164 p_Carrier_Ship_Method_Info.Creation_date,
165 p_Carrier_Ship_Method_Info.Created_By,
166 p_Carrier_Ship_Method_Info.Last_Update_Date,
167 p_Carrier_Ship_Method_Info.Last_Updated_By,
168 p_Carrier_Ship_Method_Info.Last_Update_Login,
169 p_Carrier_Ship_Method_Info.web_enabled
170 );
171
172 IF l_debug_on THEN
173 WSH_DEBUG_SV.log(l_module_name,'After insert' );
174 END IF;
175 OPEN C_New_Rowid;
176 FETCH C_New_Rowid INTO x_rowid;
177 IF (C_New_Rowid%NOTFOUND) THEN
178 CLOSE C_New_Rowid;
179 IF l_debug_on THEN
180 WSH_DEBUG_SV.log(l_module_name,'C_New_Rowid%NOTFOUND');
181 END IF;
182 RAISE others;
183 END IF;
184 CLOSE C_New_Rowid;
185 --
186 IF l_debug_on THEN
187 WSH_DEBUG_SV.pop(l_module_name);
188 END IF;
189 --
190 EXCEPTION
191 WHEN others THEN
192 x_Return_Status := WSH_UTIL_CORE.G_RET_STS_UNEXP_ERROR;
193 WSH_UTIL_CORE.Default_Handler('WSH_CARRIER_SHIP_METHODS_PKG.Update_Carrier_Ship_Method', l_module_name);
194 --
195 IF l_debug_on THEN
196 WSH_DEBUG_SV.logmsg(l_module_name,'Unexpected error has occured. Oracle error message is '|| SQLERRM,WSH_DEBUG_SV.C_UNEXPEC_ERR_LEVEL);
197 WSH_DEBUG_SV.pop(l_module_name,'EXCEPTION:OTHERS');
198 END IF;
199 --
200 END Create_Carrier_Ship_Method;
201
202 PROCEDURE Lock_Carrier_Ship_Method (
203 p_rowid IN VARCHAR2
204 , p_Carrier_Ship_Method_Info IN CSMRecType
205 , x_Return_Status OUT NOCOPY VARCHAR2
206 )
207 IS
208
209 CURSOR C_lock_row IS
210 SELECT *
211 FROM wsh_carrier_ship_methods
212 WHERE rowid = p_rowid
213 FOR UPDATE of Carrier_Ship_Method_id NOWAIT;
214
215 Recinfo C_lock_row%ROWTYPE;
216 others Exception;
217
218 --
219 l_debug_on BOOLEAN;
220 --
221 l_module_name CONSTANT VARCHAR2(100) := 'wsh.plsql.' || G_PKG_NAME || '.' || 'LOCK_CARRIER_SHIP_METHOD';
222 --
223 BEGIN
224 --
225 l_debug_on := WSH_DEBUG_INTERFACE.g_debug;
226 --
227 IF l_debug_on IS NULL
228 THEN
229 l_debug_on := WSH_DEBUG_SV.is_debug_enabled;
230 END IF;
231 --
232 IF l_debug_on THEN
233 WSH_DEBUG_SV.push(l_module_name);
234 --
235 WSH_DEBUG_SV.log(l_module_name,'P_ROWID',P_ROWID);
236 WSH_DEBUG_SV.log(l_module_name,'Carrier_Ship_Method_Id',
237 p_Carrier_Ship_Method_Info.Carrier_Ship_Method_Id);
238 WSH_DEBUG_SV.log(l_module_name,'Ship_Method_Code',
239 p_Carrier_Ship_Method_Info.Ship_Method_Code);
240 WSH_DEBUG_SV.log(l_module_name,'organization_id',
241 p_Carrier_Ship_Method_Info.organization_id);
242 WSH_DEBUG_SV.log(l_module_name,'carrier_site_id',
243 p_Carrier_Ship_Method_Info.carrier_site_id);
244 WSH_DEBUG_SV.log(l_module_name,'Freight_code',
245 p_Carrier_Ship_Method_Info.Freight_code);
246 WSH_DEBUG_SV.log(l_module_name,'Service_level',
247 p_Carrier_Ship_Method_Info.Service_level);
248 WSH_DEBUG_SV.log(l_module_name,'Enabled_Flag',
249 p_Carrier_Ship_Method_Info.Enabled_Flag);
250 WSH_DEBUG_SV.log(l_module_name,'Attribute_Category',
251 p_Carrier_Ship_Method_Info.Attribute_Category);
252 WSH_DEBUG_SV.log(l_module_name,'Attribute1',
253 p_Carrier_Ship_Method_Info.attribute1);
254 WSH_DEBUG_SV.log(l_module_name,'Attribute2',
255 p_Carrier_Ship_Method_Info.attribute2);
256 WSH_DEBUG_SV.log(l_module_name,'Attribute3',
257 p_Carrier_Ship_Method_Info.attribute3);
258 WSH_DEBUG_SV.log(l_module_name,'Attribute4',
259 p_Carrier_Ship_Method_Info.attribute4);
260 WSH_DEBUG_SV.log(l_module_name,'Attribute5',
261 p_Carrier_Ship_Method_Info.attribute5);
262 WSH_DEBUG_SV.log(l_module_name,'Attribute6',
263 p_Carrier_Ship_Method_Info.attribute6);
264 WSH_DEBUG_SV.log(l_module_name,'Attribute7',
265 p_Carrier_Ship_Method_Info.attribute7);
266 WSH_DEBUG_SV.log(l_module_name,'Attribute8',
267 p_Carrier_Ship_Method_Info.attribute8);
268 WSH_DEBUG_SV.log(l_module_name,'Attribute9',
269 p_Carrier_Ship_Method_Info.attribute9);
270 WSH_DEBUG_SV.log(l_module_name,'Attribute10',
271 p_Carrier_Ship_Method_Info.attribute10);
272 WSH_DEBUG_SV.log(l_module_name,'Attribute11',
273 p_Carrier_Ship_Method_Info.attribute11);
274 WSH_DEBUG_SV.log(l_module_name,'Attribute12',
275 p_Carrier_Ship_Method_Info.attribute12);
276 WSH_DEBUG_SV.log(l_module_name,'Attribute13',
277 p_Carrier_Ship_Method_Info.attribute13);
278 WSH_DEBUG_SV.log(l_module_name,'Attribute14',
279 p_Carrier_Ship_Method_Info.attribute14);
280 WSH_DEBUG_SV.log(l_module_name,'Attribute15',
281 p_Carrier_Ship_Method_Info.attribute15);
282 END IF;
283 --
284 x_return_status := WSH_UTIL_CORE.G_RET_STS_SUCCESS;
285
286 OPEN C_lock_row;
287 FETCH C_lock_row INTO Recinfo;
288
289 IF (C_lock_row%NOTFOUND) THEN
290 CLOSE C_lock_row;
291 FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_DELETED');
292 x_return_status := WSH_UTIL_CORE.G_RET_STS_ERROR;
293 WSH_UTIL_CORE.Add_Message(x_return_status,l_module_name);
294 --
295 IF l_debug_on THEN
296 WSH_DEBUG_SV.log(l_module_name,'C_lock_row%NOTFOUND');
297 WSH_DEBUG_SV.pop(l_module_name);
298 END IF;
299 RETURN;
300 END IF;
301 CLOSE C_lock_row;
302 IF l_debug_on THEN
303 WSH_DEBUG_SV.log(l_module_name,'Carrier_Ship_Method_Id',
304 Recinfo.Carrier_Ship_Method_Id);
305 WSH_DEBUG_SV.log(l_module_name,'Ship_Method_Code',
306 Recinfo.Ship_Method_Code);
307 WSH_DEBUG_SV.log(l_module_name,'organization_id',
308 Recinfo.organization_id);
309 WSH_DEBUG_SV.log(l_module_name,'carrier_site_id',Recinfo.carrier_site_id);
310 WSH_DEBUG_SV.log(l_module_name,'Freight_code',Recinfo.Freight_code);
311 WSH_DEBUG_SV.log(l_module_name,'Service_level',Recinfo.Service_level);
312 WSH_DEBUG_SV.log(l_module_name,'Enabled_Flag',Recinfo.Enabled_Flag);
313 WSH_DEBUG_SV.log(l_module_name,'Attribute_Category',
314 Recinfo.Attribute_Category);
315 WSH_DEBUG_SV.log(l_module_name,'Attribute1',Recinfo.attribute1);
316 WSH_DEBUG_SV.log(l_module_name,'Attribute2',Recinfo.attribute2);
317 WSH_DEBUG_SV.log(l_module_name,'Attribute3',Recinfo.attribute3);
318 WSH_DEBUG_SV.log(l_module_name,'Attribute4',Recinfo.attribute4);
319 WSH_DEBUG_SV.log(l_module_name,'Attribute5',Recinfo.attribute5);
320 WSH_DEBUG_SV.log(l_module_name,'Attribute6',Recinfo.attribute6);
321 WSH_DEBUG_SV.log(l_module_name,'Attribute7',Recinfo.attribute7);
322 WSH_DEBUG_SV.log(l_module_name,'Attribute8',Recinfo.attribute8);
323 WSH_DEBUG_SV.log(l_module_name,'Attribute9',Recinfo.attribute9);
324 WSH_DEBUG_SV.log(l_module_name,'Attribute10',Recinfo.attribute10);
325 WSH_DEBUG_SV.log(l_module_name,'Attribute11',Recinfo.attribute11);
326 WSH_DEBUG_SV.log(l_module_name,'Attribute12',Recinfo.attribute12);
327 WSH_DEBUG_SV.log(l_module_name,'Attribute13',Recinfo.attribute13);
328 WSH_DEBUG_SV.log(l_module_name,'Attribute14',Recinfo.attribute14);
329 WSH_DEBUG_SV.log(l_module_name,'Attribute15',Recinfo.attribute15);
330 END IF;
331 IF ( (Recinfo.Carrier_Ship_Method_Id = p_Carrier_Ship_Method_Info.Carrier_Ship_Method_Id)
335 AND (p_Carrier_Ship_Method_Info.organization_id IS NULL)))
332 AND (Recinfo.Ship_Method_Code = p_Carrier_Ship_Method_Info.Ship_Method_Code)
333 AND ( (Recinfo.organization_id = p_Carrier_Ship_Method_Info.organization_id)
334 OR ( (Recinfo.organization_id is NULL)
336 AND ( (Recinfo.carrier_site_id = p_Carrier_Ship_Method_Info.carrier_site_id)
337 OR ( (Recinfo.carrier_site_id is NULL)
338 AND (p_Carrier_Ship_Method_Info.carrier_site_id IS NULL)))
339 AND ( (Recinfo.Freight_code = p_Carrier_Ship_Method_Info.Freight_code)
340 OR ( (Recinfo.Freight_code is NULL)
341 AND (p_Carrier_Ship_Method_Info.Freight_code IS NULL)))
342 AND ( (Recinfo.Service_level = p_Carrier_Ship_Method_Info.Service_level)
343 OR ( (Recinfo.Service_level is NULL)
344 AND (p_Carrier_Ship_Method_Info.Service_level IS NULL)))
345 AND (Recinfo.Enabled_Flag = p_Carrier_Ship_Method_Info.Enabled_Flag)
346 AND ( (Recinfo.Attribute_Category = p_Carrier_Ship_Method_Info.Attribute_Category)
347 OR ( (Recinfo.Attribute_Category is NULL)
348 AND (p_Carrier_Ship_Method_Info.Attribute_Category IS NULL)))
349 AND ( (Recinfo.Attribute1 = p_Carrier_Ship_Method_Info.Attribute1)
350 OR ( (Recinfo.Attribute1 IS NULL)
351 AND (p_Carrier_Ship_Method_Info.Attribute1 is NULL)))
352 AND ( (Recinfo.Attribute2 = p_Carrier_Ship_Method_Info.Attribute2)
353 OR ( (Recinfo.Attribute2 IS NULL)
354 AND (p_Carrier_Ship_Method_Info.Attribute2 is NULL)))
355 AND ( (Recinfo.Attribute3 = p_Carrier_Ship_Method_Info.Attribute3)
356 OR ( (Recinfo.Attribute3 IS NULL)
357 AND (p_Carrier_Ship_Method_Info.Attribute3 is NULL)))
358 AND ( (Recinfo.Attribute4 = p_Carrier_Ship_Method_Info.Attribute4)
359 OR ( (Recinfo.Attribute4 IS NULL)
360 AND (p_Carrier_Ship_Method_Info.Attribute4 is NULL)))
361 AND ( (Recinfo.Attribute5 = p_Carrier_Ship_Method_Info.Attribute5)
362 OR ( (Recinfo.Attribute5 IS NULL)
363 AND (p_Carrier_Ship_Method_Info.Attribute5 is NULL)))
364 AND ( (Recinfo.Attribute6 = p_Carrier_Ship_Method_Info.Attribute6)
365 OR ( (Recinfo.Attribute6 IS NULL)
366 AND (p_Carrier_Ship_Method_Info.Attribute6 is NULL)))
367 AND ( (Recinfo.Attribute7 = p_Carrier_Ship_Method_Info.Attribute7)
368 OR ( (Recinfo.Attribute7 IS NULL)
369 AND (p_Carrier_Ship_Method_Info.Attribute7 is NULL)))
370 AND ( (Recinfo.Attribute8 = p_Carrier_Ship_Method_Info.Attribute8)
371 OR ( (Recinfo.Attribute8 IS NULL)
372 AND (p_Carrier_Ship_Method_Info.Attribute8 is NULL)))
373 AND ( (Recinfo.Attribute9 = p_Carrier_Ship_Method_Info.Attribute9)
374 OR ( (Recinfo.Attribute9 IS NULL)
375 AND (p_Carrier_Ship_Method_Info.Attribute9 is NULL)))
376 AND ( (Recinfo.Attribute10 = p_Carrier_Ship_Method_Info.Attribute10)
377 OR ( (Recinfo.Attribute10 IS NULL)
378 AND (p_Carrier_Ship_Method_Info.Attribute10 is NULL)))
379 AND ( (Recinfo.Attribute11 = p_Carrier_Ship_Method_Info.Attribute11)
380 OR ( (Recinfo.Attribute11 IS NULL)
381 AND (p_Carrier_Ship_Method_Info.Attribute11 is NULL)))
382 AND ( (Recinfo.Attribute12 = p_Carrier_Ship_Method_Info.Attribute12)
383 OR ( (Recinfo.Attribute12 IS NULL)
384 AND (p_Carrier_Ship_Method_Info.Attribute12 is NULL)))
385 AND ( (Recinfo.Attribute13 = p_Carrier_Ship_Method_Info.Attribute13)
386 OR ( (Recinfo.Attribute13 IS NULL)
387 AND (p_Carrier_Ship_Method_Info.Attribute13 is NULL)))
388 AND ( (Recinfo.Attribute14 = p_Carrier_Ship_Method_Info.Attribute14)
389 OR ( (Recinfo.Attribute14 IS NULL)
390 AND (p_Carrier_Ship_Method_Info.Attribute14 is NULL)))
391 AND ( (Recinfo.Attribute15 = p_Carrier_Ship_Method_Info.Attribute15)
392 OR ( (Recinfo.Attribute15 IS NULL)
393 AND (p_Carrier_Ship_Method_Info.Attribute15 is NULL)))
394 AND (Recinfo.Web_Enabled = p_Carrier_Ship_Method_Info.Web_Enabled)
395 ) THEN
396 --
397 IF l_debug_on THEN
398 WSH_DEBUG_SV.log(l_module_name,'Matched');
399 WSH_DEBUG_SV.pop(l_module_name);
400 END IF;
401 --
402 RETURN;
403 ELSE
404 FND_MESSAGE.Set_Name('FND', 'FORM_RECORD_CHANGED');
405 IF l_debug_on THEN
406 WSH_DEBUG_SV.log(l_module_name,'APP_EXCEPTION.Raise_Exception');
407 END IF;
408 APP_EXCEPTION.Raise_Exception;
409 END IF;
410
411 IF l_debug_on THEN
412 WSH_DEBUG_SV.pop(l_module_name);
413 END IF;
414 --
415 EXCEPTION
416 WHEN others THEN
417 x_Return_Status := WSH_UTIL_CORE.G_RET_STS_UNEXP_ERROR;
418 WSH_UTIL_CORE.Default_Handler('WSH_CARRIER_SHIP_METHODS_PKG.Lock_Carrier_Ship_Method',l_module_name);
419 --
420 IF l_debug_on THEN
421 WSH_DEBUG_SV.logmsg(l_module_name,'Unexpected error has occured. Oracle error message is '|| SQLERRM,WSH_DEBUG_SV.C_UNEXPEC_ERR_LEVEL);
422 WSH_DEBUG_SV.pop(l_module_name,'EXCEPTION:OTHERS');
423 END IF;
424 --
425 END Lock_Carrier_Ship_Method;
426
427 PROCEDURE Update_Carrier_Ship_Method (
428 p_rowid IN VARCHAR2
429 , p_Carrier_Ship_Method_Info IN CSMRecType
430 , x_Return_Status OUT NOCOPY VARCHAR2
431 )
432 IS
433 others EXCEPTION;
434 --
435 l_debug_on BOOLEAN;
436 --
437 l_module_name CONSTANT VARCHAR2(100) := 'wsh.plsql.' || G_PKG_NAME || '.' || 'UPDATE_CARRIER_SHIP_METHOD';
438 --
439 BEGIN
440 --
441 --
442 l_debug_on := WSH_DEBUG_INTERFACE.g_debug;
443 --
444 IF l_debug_on IS NULL
445 THEN
446 l_debug_on := WSH_DEBUG_SV.is_debug_enabled;
447 END IF;
448 --
449 IF l_debug_on THEN
450 WSH_DEBUG_SV.push(l_module_name);
451 --
455 WSH_DEBUG_SV.log(l_module_name,'Ship_Method_Code',
452 WSH_DEBUG_SV.log(l_module_name,'P_ROWID',P_ROWID);
453 WSH_DEBUG_SV.log(l_module_name,'Carrier_Ship_Method_Id',
454 p_Carrier_Ship_Method_Info.Carrier_Ship_Method_Id);
456 p_Carrier_Ship_Method_Info.Ship_Method_Code);
457 WSH_DEBUG_SV.log(l_module_name,'organization_id',
458 p_Carrier_Ship_Method_Info.organization_id);
459 WSH_DEBUG_SV.log(l_module_name,'carrier_site_id',
460 p_Carrier_Ship_Method_Info.carrier_site_id);
461 WSH_DEBUG_SV.log(l_module_name,'Freight_code',
462 p_Carrier_Ship_Method_Info.Freight_code);
463 WSH_DEBUG_SV.log(l_module_name,'Service_level',
464 p_Carrier_Ship_Method_Info.Service_level);
465 WSH_DEBUG_SV.log(l_module_name,'Enabled_Flag',
466 p_Carrier_Ship_Method_Info.Enabled_Flag);
467 WSH_DEBUG_SV.log(l_module_name,'Attribute_Category',
468 p_Carrier_Ship_Method_Info.Attribute_Category);
469 WSH_DEBUG_SV.log(l_module_name,'Attribute1',
470 p_Carrier_Ship_Method_Info.attribute1);
471 WSH_DEBUG_SV.log(l_module_name,'Attribute2',
472 p_Carrier_Ship_Method_Info.attribute2);
473 WSH_DEBUG_SV.log(l_module_name,'Attribute3',
474 p_Carrier_Ship_Method_Info.attribute3);
475 WSH_DEBUG_SV.log(l_module_name,'Attribute4',
476 p_Carrier_Ship_Method_Info.attribute4);
477 WSH_DEBUG_SV.log(l_module_name,'Attribute5',
478 p_Carrier_Ship_Method_Info.attribute5);
479 WSH_DEBUG_SV.log(l_module_name,'Attribute6',
480 p_Carrier_Ship_Method_Info.attribute6);
481 WSH_DEBUG_SV.log(l_module_name,'Attribute7',
482 p_Carrier_Ship_Method_Info.attribute7);
483 WSH_DEBUG_SV.log(l_module_name,'Attribute8',
484 p_Carrier_Ship_Method_Info.attribute8);
485 WSH_DEBUG_SV.log(l_module_name,'Attribute9',
486 p_Carrier_Ship_Method_Info.attribute9);
487 WSH_DEBUG_SV.log(l_module_name,'Attribute10',
488 p_Carrier_Ship_Method_Info.attribute10);
489 WSH_DEBUG_SV.log(l_module_name,'Attribute11',
490 p_Carrier_Ship_Method_Info.attribute11);
491 WSH_DEBUG_SV.log(l_module_name,'Attribute12',
492 p_Carrier_Ship_Method_Info.attribute12);
493 WSH_DEBUG_SV.log(l_module_name,'Attribute13',
494 p_Carrier_Ship_Method_Info.attribute13);
495 WSH_DEBUG_SV.log(l_module_name,'Attribute14',
496 p_Carrier_Ship_Method_Info.attribute14);
497 WSH_DEBUG_SV.log(l_module_name,'Attribute15',
498 p_Carrier_Ship_Method_Info.attribute15);
499 END IF;
500 --
501 x_return_status := WSH_UTIL_CORE.G_RET_STS_SUCCESS;
502 UPDATE wsh_carrier_ship_methods
503 SET
504 carrier_id = p_Carrier_Ship_Method_Info.Carrier_id,
505 ship_method_code = p_Carrier_Ship_Method_Info.Ship_Method_Code,
506 freight_code = p_Carrier_Ship_Method_Info.Freight_code,
507 service_level = p_Carrier_Ship_Method_Info.Service_level,
508 carrier_site_id = p_Carrier_Ship_Method_Info.carrier_site_id,
509 organization_id = p_Carrier_Ship_Method_Info.organization_id,
510 enabled_flag = p_Carrier_Ship_Method_Info.Enabled_Flag,
511 attribute_category = p_Carrier_Ship_Method_Info.Attribute_Category,
512 attribute1 = p_Carrier_Ship_Method_Info.Attribute1,
513 attribute2 = p_Carrier_Ship_Method_Info.Attribute2,
514 attribute3 = p_Carrier_Ship_Method_Info.Attribute3,
515 attribute4 = p_Carrier_Ship_Method_Info.Attribute4,
516 attribute5 = p_Carrier_Ship_Method_Info.Attribute5,
517 attribute6 = p_Carrier_Ship_Method_Info.Attribute6,
518 attribute7 = p_Carrier_Ship_Method_Info.Attribute7,
519 attribute8 = p_Carrier_Ship_Method_Info.Attribute8,
520 attribute9 = p_Carrier_Ship_Method_Info.Attribute9,
521 attribute10 = p_Carrier_Ship_Method_Info.Attribute10,
522 attribute11 = p_Carrier_Ship_Method_Info.Attribute11,
523 attribute12 = p_Carrier_Ship_Method_Info.Attribute12,
524 attribute13 = p_Carrier_Ship_Method_Info.Attribute13,
525 attribute14 = p_Carrier_Ship_Method_Info.Attribute14,
526 attribute15 = p_Carrier_Ship_Method_Info.Attribute15,
527 last_update_date = p_Carrier_Ship_Method_Info.Last_Update_Date,
528 last_updated_by = p_Carrier_Ship_Method_Info.Last_Updated_By,
529 last_update_login = p_Carrier_Ship_Method_Info.Last_Update_Login,
530 web_enabled = p_Carrier_Ship_Method_Info.Web_Enabled
531 WHERE rowid = p_rowid;
532
533 IF (SQL%NOTFOUND) THEN
534 IF l_debug_on THEN
535 WSH_DEBUG_SV.log(l_module_name,'SQL%NOTFOUND');
536 END IF;
537 --
538 RAISE NO_DATA_FOUND;
539 x_return_status := WSH_UTIL_CORE.G_RET_STS_ERROR;
540 END IF;
541 --
542 IF l_debug_on THEN
543 WSH_DEBUG_SV.pop(l_module_name);
544 END IF;
545 --
546 EXCEPTION
547 WHEN NO_DATA_FOUND THEN
548 FND_MESSAGE.Set_Name('WSH', 'WSH_CSM_NOT_FOUND');
549 x_return_status := WSH_UTIL_CORE.G_RET_STS_ERROR;
550 WSH_UTIL_CORE.Add_Message(x_return_status,
551 l_module_name);
552 --
553 IF l_debug_on THEN
554 WSH_DEBUG_SV.logmsg(l_module_name,'NO_DATA_FOUND exception has occured.',WSH_DEBUG_SV.C_EXCEP_LEVEL);
555 WSH_DEBUG_SV.pop(l_module_name,'EXCEPTION:NO_DATA_FOUND');
556 END IF;
557 --
558 WHEN others THEN
562 IF l_debug_on THEN
559 WSH_UTIL_CORE.Default_Handler('WSH_CARRIER_SHIP_METHODS_PKG.Update_Carrier_Ship_Method', l_module_name);
560 x_return_status := WSH_UTIL_CORE.G_RET_STS_UNEXP_ERROR;
561 --
563 WSH_DEBUG_SV.logmsg(l_module_name,'Unexpected error has occured. Oracle error message is '|| SQLERRM,WSH_DEBUG_SV.C_UNEXPEC_ERR_LEVEL);
564 WSH_DEBUG_SV.pop(l_module_name,'EXCEPTION:OTHERS');
565 END IF;
566 --
567 END Update_Carrier_Ship_Method;
568
569 PROCEDURE Delete_Carrier_Ship_Method(
570 p_rowid IN VARCHAR2 := NULL
571 , p_Carrier_Ship_Method_id IN NUMBER
572 , x_Return_Status OUT NOCOPY VARCHAR2
573 )
574 IS
575
576 CURSOR C_CSM_id
577 IS
578 SELECT carrier_ship_method_id
579 FROM wsh_carrier_ship_methods
580 WHERE rowid = p_rowid;
581
582 l_csm_id NUMBER;
583 others EXCEPTION;
584
585 --
586 l_debug_on BOOLEAN;
587 --
588 l_module_name CONSTANT VARCHAR2(100) := 'wsh.plsql.' || G_PKG_NAME || '.' || 'DELETE_CARRIER_SHIP_METHOD';
589 --
590 BEGIN
591 --
592 --
593 l_debug_on := WSH_DEBUG_INTERFACE.g_debug;
594 --
595 IF l_debug_on IS NULL
596 THEN
597 l_debug_on := WSH_DEBUG_SV.is_debug_enabled;
598 END IF;
599 --
600 IF l_debug_on THEN
601 WSH_DEBUG_SV.push(l_module_name);
602 --
603 WSH_DEBUG_SV.log(l_module_name,'P_ROWID',P_ROWID);
604 WSH_DEBUG_SV.log(l_module_name,'P_CARRIER_SHIP_METHOD_ID',P_CARRIER_SHIP_METHOD_ID);
605 END IF;
606 --
607 x_return_status := WSH_UTIL_CORE.G_RET_STS_SUCCESS;
608 IF (p_rowid IS NOT NULL) THEN
609 OPEN C_CSM_id;
610 FETCH C_CSM_id INTO l_csm_id;
611 CLOSE C_CSM_ID;
612 END IF;
613 IF l_debug_on THEN
614 WSH_DEBUG_SV.log(l_module_name,'l_csm_id',l_csm_id);
615 END IF;
616 IF (l_csm_id IS NULL) THEN
617 l_csm_id := p_Carrier_Ship_Method_id;
618 END IF;
619
620 IF (p_Carrier_Ship_Method_id IS NOT NULL) THEN
621 DELETE FROM wsh_carrier_ship_methods
622 WHERE carrier_ship_method_id = l_csm_id;
623 x_return_status := WSH_UTIL_CORE.G_RET_STS_SUCCESS;
624 ELSE
625 RAISE others;
626 END IF;
627
628 IF l_debug_on THEN
629 WSH_DEBUG_SV.pop(l_module_name);
630 END IF;
631 --
632 EXCEPTION
633 WHEN others THEN
634 WSH_UTIL_CORE.Default_Handler('WSH_CARRIER_SHIP_METHODS_PKG.Delete_Carrier_Ship_Method',l_module_name);
635 x_return_status := WSH_UTIL_CORE.G_RET_STS_UNEXP_ERROR;
636 --
637 IF l_debug_on THEN
638 WSH_DEBUG_SV.logmsg(l_module_name,'Unexpected error has occured. Oracle error message is '|| SQLERRM,WSH_DEBUG_SV.C_UNEXPEC_ERR_LEVEL);
639 WSH_DEBUG_SV.pop(l_module_name,'EXCEPTION:OTHERS');
640 END IF;
641 --
642 END Delete_Carrier_Ship_Method;
643
644
645 END WSH_CARRIER_SHIP_METHODS_PKG;