DBA Data[Home] [Help]

PACKAGE BODY: APPS.OE_VALIDATE_PRICE_LIST_LINE

Source


1 PACKAGE BODY OE_Validate_Price_List_Line AS
2 /* $Header: OEXLPRLB.pls 115.5 1999/11/15 20:39:56 pkm ship      $ */
3 
4 --  Global constant holding the package name
5 
6 G_PKG_NAME                    CONSTANT VARCHAR2(30) := 'OE_Validate_Price_List_Line';
7 
8 --  Procedure Entity
9 
10 PROCEDURE Entity
11 (   x_return_status                 OUT VARCHAR2
12 ,   p_PRICE_LIST_LINE_rec           IN  OE_Price_List_PUB.Price_List_Line_Rec_Type
13 ,   p_old_PRICE_LIST_LINE_rec       IN  OE_Price_List_PUB.Price_List_Line_Rec_Type :=
14                                         OE_Price_List_PUB.G_MISS_PRICE_LIST_LINE_REC
15 )
16 IS
17 l_return_status               VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
18 BEGIN
19 
20     --  Check required attributes.
21 
22     IF  p_PRICE_LIST_LINE_rec.price_list_line_id IS NULL
23     THEN
24 
25         l_return_status := FND_API.G_RET_STS_ERROR;
26 
27         IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_ERROR)
28         THEN
29 
30             FND_MESSAGE.SET_NAME('OE','OE_ATTRIBUTE_REQUIRED');
31             FND_MESSAGE.SET_TOKEN('ATTRIBUTE','attribute1 Missing');
32             OE_MSG_PUB.Add;
33 
34         END IF;
35 
36     END IF;
37 
38     --
39     --  Check rest of required attributes here.
40     --
41 
42 
43     --  Return Error if a required attribute is missing.
44 
45     IF l_return_status = FND_API.G_RET_STS_ERROR THEN
46 
47         RAISE FND_API.G_EXC_ERROR;
48 
49     END IF;
50 
51     --
52     --  Check conditionally required attributes here.
53 
54 
55 -- Added by
56     if NOT OE_GLOBALS.Equal(p_PRICE_LIST_LINE_rec.revision , p_old_PRICE_LIST_LINE_rec.revision )
57     then
58           if OE_GLOBALS.Equal(p_PRICE_LIST_LINE_rec.customer_item_id ,
59 			p_old_PRICE_LIST_LINE_rec.customer_item_id )
60 	   AND
61           OE_GLOBALS.Equal(p_PRICE_LIST_LINE_rec.inventory_item_id ,
62 			p_old_PRICE_LIST_LINE_rec.inventory_item_id )
63 	   AND
64           OE_GLOBALS.Equal(p_PRICE_LIST_LINE_rec.list_price ,
65 			p_old_PRICE_LIST_LINE_rec.list_price )
66 	   AND
67           OE_GLOBALS.Equal(p_PRICE_LIST_LINE_rec.unit_code ,
68 			p_old_PRICE_LIST_LINE_rec.unit_code )
69 	   AND
70           OE_GLOBALS.Equal(p_PRICE_LIST_LINE_rec.pricing_attribute1 ,
71 			p_old_PRICE_LIST_LINE_rec.pricing_attribute1 )
72 	   AND
73           OE_GLOBALS.Equal(p_PRICE_LIST_LINE_rec.pricing_attribute2 ,
74 			p_old_PRICE_LIST_LINE_rec.pricing_attribute2 )
75 	   AND
76           OE_GLOBALS.Equal(p_PRICE_LIST_LINE_rec.start_date_active ,
77 			p_old_PRICE_LIST_LINE_rec.start_date_active )
78            AND
79           OE_GLOBALS.Equal(p_PRICE_LIST_LINE_rec.end_date_active ,
80 			p_old_PRICE_LIST_LINE_rec.end_date_active )
81 	  THEN
82 	     	l_return_status := FND_API.G_RET_STS_ERROR;
83 
84 	/*       	IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_ERROR)
85       		THEN
86        	  	FND_MESSAGE.SET_NAME('OE','OE_ATTRIBUTE_REQUIRED');
87        	 	FND_MESSAGE.SET_TOKEN('REVISION','revision');
88        		OE_MSG_PUB.Add;
89     		x_return_status := l_return_status;
90 
91        		END IF;
92 	*/
93 	  ELSE
94      -- attribute changed , revison changed
95 	     	l_return_status := FND_API.G_RET_STS_SUCCESS;
96 /*
97 	       	IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_ERROR)
98       		THEN
99        	  	FND_MESSAGE.SET_NAME('OE','Changed OE_ATTRIBUTE_REQUIRED');
100        	 	FND_MESSAGE.SET_TOKEN('REVISION','revision');
101        		OE_MSG_PUB.Add;
102     		x_return_status := l_return_status;
103 		END IF;
104 */
105 	  end if;
106 
107 	ELSE
108 	--  revison codes are equal
109 	     	l_return_status := FND_API.G_RET_STS_SUCCESS;
110 /*
111 	       	IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_ERROR)
112       		THEN
113        	  	FND_MESSAGE.SET_NAME('OE','Equal OE_ATTRIBUTE_REQUIRED');
114        	 	FND_MESSAGE.SET_TOKEN('REVISION','revision');
115        		OE_MSG_PUB.Add;
116 		END IF;
117 */
118 	end if;
119 
120         x_return_status := l_return_status;
121 
122 	if l_return_status  = FND_API.G_RET_STS_UNEXP_ERROR THEN
123  		RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
124 	elsif l_return_status = FND_API.G_RET_STS_ERROR THEN
125 		RAISE FND_API.G_EXC_ERROR;
126 	end if;
127 
128 -- end added by
129 
130 	Check_PLL_Duplicates( l_return_status,
131 			      p_PRICE_LIST_LINE_rec ,
132 			      p_old_PRICE_LIST_LINE_rec );
133 
134 	if l_return_status  = FND_API.G_RET_STS_UNEXP_ERROR THEN
135 	 	RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
136 	elsif l_return_status = FND_API.G_RET_STS_ERROR THEN
137 		RAISE FND_API.G_EXC_ERROR;
138 	end if;
139 
140     --
141     --  Validate attribute dependencies here.
142     --
143 
144 
145     --  Done validating entity
146 
147     x_return_status := l_return_status;
148 
149 EXCEPTION
150 
151     WHEN FND_API.G_EXC_ERROR THEN
152 
153         x_return_status := FND_API.G_RET_STS_ERROR;
154 
155     WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
156 
157         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
158 
159     WHEN OTHERS THEN
160 
161         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
162 
163         IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
164         THEN
165             OE_MSG_PUB.Add_Exc_Msg
166             (   G_PKG_NAME
167             ,   'Entity'
168             );
169         END IF;
170 
171 END Entity;
172 
173 
174 -- Geresh Added to check dupliacates
175 Procedure Check_PLL_Duplicates
176 (    x_return_status		OUT  varchar2
177 ,	p_PRICE_LIST_LINE_rec   IN   OE_Price_List_PUB.Price_List_Line_Rec_Type
178 ,	p_old_PRICE_LIST_LINE_rec IN OE_Price_List_PUB.Price_List_Line_Rec_Type
179 )
180 IS
181 l_Count NUMBER := 0;
182 l_return_status    VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
183 PLL_Duplicates EXCEPTION;
184 BEGIN
185 
186 /*      if ( p_PRICE_LIST_LINE_rec.revision is NOT NULL )
187        AND (p_PRICE_LIST_LINE_rec.customer_item_id is NOT NULL )
188        AND ( p_PRICE_LIST_LINE_rec.inventory_item_id is NOT NULL )
189        AND ( p_PRICE_LIST_LINE_rec.unit_code is NOT NULL )
190        AND ( p_PRICE_LIST_LINE_rec.start_date_active is NOT NULL )
191        AND ( p_PRICE_LIST_LINE_rec.end_date_active is NOT NULL )
192        AND ( p_PRICE_LIST_LINE_rec.pricing_attribute1 is NOT NULL )
193        AND ( p_PRICE_LIST_LINE_rec.pricing_attribute2 is NOT NULL )
194        AND ( p_PRICE_LIST_LINE_rec.list_price is NOT NULL )
195       then
196 	    and  list_price = p_PRICE_LIST_LINE_rec.list_price
197 */
198 
199 /*
200 	    SELECT count(*)
201 	    into   l_Count
202 	    from oe_price_list_lines
203 	    where price_list_id = p_PRICE_LIST_LINE_rec.price_list_id
204 	    and   unit_code = p_PRICE_LIST_LINE_rec.unit_code
205 	    and  pricing_attribute1 = p_PRICE_LIST_LINE_rec.pricing_attribute1
206 	    and  pricing_attribute2 = p_PRICE_LIST_LINE_rec.pricing_attribute2
207 	    and (
208 		( p_PRICE_LIST_LINE_rec.start_date_active between
209 			start_date_active and end_date_active)
210 		OR
211 		(p_PRICE_LIST_LINE_rec.end_date_active  between
212 			start_date_active and end_date_active ));
213 
214 
215 
216 	   if l_Count <> 0  then
217 		l_return_status := FND_API.G_RET_STS_ERROR;
218 	       	IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_ERROR)
219       		THEN
220        	  	FND_MESSAGE.SET_NAME('OE','ATTRIBUTE_REQUIRED');
221        	 	FND_MESSAGE.SET_TOKEN('REVISION','revision');
222        		OE_MSG_PUB.Add;
223 		END IF;
224 		RAISE PLL_DUPLICATES;
225 	   end if;
226 
227 */
228 
229 NULL;
230 
231 /*
232       end if;
233 */
234 
235       x_return_status := l_return_status ;
236 
237 
238 EXCEPTION
239 	WHEN PLL_DUPLICATES OR NO_DATA_FOUND then
240             x_return_status := l_return_status ;
241 
242 END Check_PLL_Duplicates;
243 
244 
245 
246 --  Procedure Attributes
247 
248 PROCEDURE Attributes
249 (   x_return_status                 OUT VARCHAR2
250 ,   p_PRICE_LIST_LINE_rec           IN  OE_Price_List_PUB.Price_List_Line_Rec_Type
251 ,   p_old_PRICE_LIST_LINE_rec       IN  OE_Price_List_PUB.Price_List_Line_Rec_Type :=
252                                         OE_Price_List_PUB.G_MISS_PRICE_LIST_LINE_REC
253 )
254 IS
255 l_primary_exists BOOLEAN;
256 BEGIN
257 
258     x_return_status := FND_API.G_RET_STS_SUCCESS;
259 
260     --  Validate PRICE_LIST_LINE attributes
261 
262     IF  p_PRICE_LIST_LINE_rec.comments IS NOT NULL AND
263         (   p_PRICE_LIST_LINE_rec.comments <>
264             p_old_PRICE_LIST_LINE_rec.comments OR
265             p_old_PRICE_LIST_LINE_rec.comments IS NULL )
266     THEN
267         IF NOT OE_Validate_Attr.Comments(p_PRICE_LIST_LINE_rec.comments) THEN
268             x_return_status := FND_API.G_RET_STS_ERROR;
269         END IF;
270     END IF;
271 
272 
273     IF  p_PRICE_LIST_LINE_rec.created_by IS NOT NULL AND
274         (   p_PRICE_LIST_LINE_rec.created_by <>
275             p_old_PRICE_LIST_LINE_rec.created_by OR
276             p_old_PRICE_LIST_LINE_rec.created_by IS NULL )
277     THEN
278         IF NOT OE_Validate_Attr.Created_By(p_PRICE_LIST_LINE_rec.created_by) THEN
279             x_return_status := FND_API.G_RET_STS_ERROR;
280         END IF;
281     END IF;
282 
283     IF  p_PRICE_LIST_LINE_rec.creation_date IS NOT NULL AND
284         (   p_PRICE_LIST_LINE_rec.creation_date <>
285             p_old_PRICE_LIST_LINE_rec.creation_date OR
286             p_old_PRICE_LIST_LINE_rec.creation_date IS NULL )
287     THEN
288         IF NOT OE_Validate_Attr.Creation_Date(p_PRICE_LIST_LINE_rec.creation_date) THEN
289             x_return_status := FND_API.G_RET_STS_ERROR;
290         END IF;
291     END IF;
292 
293     IF  p_PRICE_LIST_LINE_rec.customer_item_id IS NOT NULL AND
294         (   p_PRICE_LIST_LINE_rec.customer_item_id <>
295             p_old_PRICE_LIST_LINE_rec.customer_item_id OR
296             p_old_PRICE_LIST_LINE_rec.customer_item_id IS NULL )
297     THEN
298         IF NOT OE_Validate_Attr.Customer_Item(p_PRICE_LIST_LINE_rec.customer_item_id) THEN
299             x_return_status := FND_API.G_RET_STS_ERROR;
300         END IF;
301     END IF;
302 
303     IF  p_PRICE_LIST_LINE_rec.end_date_active IS NOT NULL AND
304         (   p_PRICE_LIST_LINE_rec.end_date_active <>
305             p_old_PRICE_LIST_LINE_rec.end_date_active OR
306             p_old_PRICE_LIST_LINE_rec.end_date_active IS NULL )
307     THEN
308         IF NOT OE_Validate_Attr.End_Date_Active(p_Price_List_Line_rec.end_date_active) THEN
309             x_return_status := FND_API.G_RET_STS_ERROR;
310 
311          ELSIF NOT OE_Validate_Attr.Start_Date_End_Date(
312                        p_Price_List_Line_rec.start_date_active,
313                        p_Price_List_Line_rec.end_date_active) THEN
314             x_return_status := FND_API.G_RET_STS_ERROR;
315 
316         END IF;
317     END IF;
318 
319     IF  p_PRICE_LIST_LINE_rec.inventory_item_id IS NOT NULL AND
320         (   p_PRICE_LIST_LINE_rec.inventory_item_id <>
321             p_old_PRICE_LIST_LINE_rec.inventory_item_id OR
322             p_old_PRICE_LIST_LINE_rec.inventory_item_id IS NULL )
323     THEN
324         IF NOT OE_Validate_Attr.Inventory_Item(p_PRICE_LIST_LINE_rec.inventory_item_id) THEN
325             x_return_status := FND_API.G_RET_STS_ERROR;
326         END IF;
327     END IF;
328 
329     IF  p_PRICE_LIST_LINE_rec.last_updated_by IS NOT NULL AND
330         (   p_PRICE_LIST_LINE_rec.last_updated_by <>
331             p_old_PRICE_LIST_LINE_rec.last_updated_by OR
332             p_old_PRICE_LIST_LINE_rec.last_updated_by IS NULL )
333     THEN
334         IF NOT OE_Validate_Attr.Last_Updated_By(p_PRICE_LIST_LINE_rec.last_updated_by) THEN
335             x_return_status := FND_API.G_RET_STS_ERROR;
336         END IF;
337     END IF;
338 
339     IF  p_PRICE_LIST_LINE_rec.last_update_date IS NOT NULL AND
340         (   p_PRICE_LIST_LINE_rec.last_update_date <>
341             p_old_PRICE_LIST_LINE_rec.last_update_date OR
342             p_old_PRICE_LIST_LINE_rec.last_update_date IS NULL )
343     THEN
344         IF NOT OE_Validate_Attr.Last_Update_Date(p_PRICE_LIST_LINE_rec.last_update_date) THEN
345             x_return_status := FND_API.G_RET_STS_ERROR;
346         END IF;
347     END IF;
348 
349     IF  p_PRICE_LIST_LINE_rec.last_update_login IS NOT NULL AND
350         (   p_PRICE_LIST_LINE_rec.last_update_login <>
351             p_old_PRICE_LIST_LINE_rec.last_update_login OR
352             p_old_PRICE_LIST_LINE_rec.last_update_login IS NULL )
353     THEN
354         IF NOT OE_Validate_Attr.Last_Update_Login(p_PRICE_LIST_LINE_rec.last_update_login) THEN
355             x_return_status := FND_API.G_RET_STS_ERROR;
356         END IF;
357     END IF;
358 
359     IF  p_PRICE_LIST_LINE_rec.list_price IS NOT NULL AND
360         (   p_PRICE_LIST_LINE_rec.list_price <>
361             p_old_PRICE_LIST_LINE_rec.list_price OR
362             p_old_PRICE_LIST_LINE_rec.list_price IS NULL )
363     THEN
364         IF NOT OE_Validate_Attr.List_Price(p_PRICE_LIST_LINE_rec.list_price) THEN
365             x_return_status := FND_API.G_RET_STS_ERROR;
366         END IF;
367     END IF;
368 
369     IF  p_PRICE_LIST_LINE_rec.method_code IS NOT NULL AND
370         (   p_PRICE_LIST_LINE_rec.method_code <>
371             p_old_PRICE_LIST_LINE_rec.method_code OR
372             p_old_PRICE_LIST_LINE_rec.method_code IS NULL )
373     THEN
374         IF NOT OE_Validate_Attr.Method(p_PRICE_LIST_LINE_rec.method_code) THEN
375             x_return_status := FND_API.G_RET_STS_ERROR;
376         END IF;
377     END IF;
378 
379     IF  p_PRICE_LIST_LINE_rec.price_list_id IS NOT NULL AND
380         (   p_PRICE_LIST_LINE_rec.price_list_id <>
381             p_old_PRICE_LIST_LINE_rec.price_list_id OR
382             p_old_PRICE_LIST_LINE_rec.price_list_id IS NULL )
383     THEN
384         IF NOT OE_Validate_Attr.Price_List(p_PRICE_LIST_LINE_rec.price_list_id) THEN
385             x_return_status := FND_API.G_RET_STS_ERROR;
386         END IF;
387     END IF;
388 
389     IF  p_PRICE_LIST_LINE_rec.price_list_line_id IS NOT NULL AND
390         (   p_PRICE_LIST_LINE_rec.price_list_line_id <>
391             p_old_PRICE_LIST_LINE_rec.price_list_line_id OR
392             p_old_PRICE_LIST_LINE_rec.price_list_line_id IS NULL )
393     THEN
394         IF NOT OE_Validate_Attr.Price_List_Line(p_PRICE_LIST_LINE_rec.price_list_line_id) THEN
395             x_return_status := FND_API.G_RET_STS_ERROR;
396         END IF;
397     END IF;
398 
399     IF  p_PRICE_LIST_LINE_rec.pricing_attribute1 IS NOT NULL AND
400         (   p_PRICE_LIST_LINE_rec.pricing_attribute1 <>
401             p_old_PRICE_LIST_LINE_rec.pricing_attribute1 OR
402             p_old_PRICE_LIST_LINE_rec.pricing_attribute1 IS NULL )
403     THEN
404         IF NOT OE_Validate_Attr.Pricing_Attribute1(p_PRICE_LIST_LINE_rec.pricing_attribute1) THEN
405             x_return_status := FND_API.G_RET_STS_ERROR;
406         END IF;
407     END IF;
408 
409     IF  p_PRICE_LIST_LINE_rec.pricing_attribute11 IS NOT NULL AND
410         (   p_PRICE_LIST_LINE_rec.pricing_attribute11 <>
411             p_old_PRICE_LIST_LINE_rec.pricing_attribute11 OR
412             p_old_PRICE_LIST_LINE_rec.pricing_attribute11 IS NULL )
413     THEN
414         IF NOT OE_Validate_Attr.Pricing_Attribute11(p_PRICE_LIST_LINE_rec.pricing_attribute11) THEN
415             x_return_status := FND_API.G_RET_STS_ERROR;
416         END IF;
417     END IF;
418 
419     IF  p_PRICE_LIST_LINE_rec.pricing_attribute12 IS NOT NULL AND
420         (   p_PRICE_LIST_LINE_rec.pricing_attribute12 <>
421             p_old_PRICE_LIST_LINE_rec.pricing_attribute12 OR
422             p_old_PRICE_LIST_LINE_rec.pricing_attribute12 IS NULL )
423     THEN
424         IF NOT OE_Validate_Attr.Pricing_Attribute12(p_PRICE_LIST_LINE_rec.pricing_attribute12) THEN
425             x_return_status := FND_API.G_RET_STS_ERROR;
426         END IF;
427     END IF;
428 
429     IF  p_PRICE_LIST_LINE_rec.pricing_attribute13 IS NOT NULL AND
430         (   p_PRICE_LIST_LINE_rec.pricing_attribute13 <>
431             p_old_PRICE_LIST_LINE_rec.pricing_attribute13 OR
432             p_old_PRICE_LIST_LINE_rec.pricing_attribute13 IS NULL )
433     THEN
434         IF NOT OE_Validate_Attr.Pricing_Attribute13(p_PRICE_LIST_LINE_rec.pricing_attribute13) THEN
435             x_return_status := FND_API.G_RET_STS_ERROR;
436         END IF;
437     END IF;
438 
439     IF  p_PRICE_LIST_LINE_rec.pricing_attribute14 IS NOT NULL AND
440         (   p_PRICE_LIST_LINE_rec.pricing_attribute14 <>
441             p_old_PRICE_LIST_LINE_rec.pricing_attribute14 OR
442             p_old_PRICE_LIST_LINE_rec.pricing_attribute14 IS NULL )
443     THEN
444         IF NOT OE_Validate_Attr.Pricing_Attribute14(p_PRICE_LIST_LINE_rec.pricing_attribute14) THEN
445             x_return_status := FND_API.G_RET_STS_ERROR;
446         END IF;
447     END IF;
448 
449     IF  p_PRICE_LIST_LINE_rec.pricing_attribute15 IS NOT NULL AND
450         (   p_PRICE_LIST_LINE_rec.pricing_attribute15 <>
451             p_old_PRICE_LIST_LINE_rec.pricing_attribute15 OR
452             p_old_PRICE_LIST_LINE_rec.pricing_attribute15 IS NULL )
453     THEN
454         IF NOT OE_Validate_Attr.Pricing_Attribute15(p_PRICE_LIST_LINE_rec.pricing_attribute15) THEN
455             x_return_status := FND_API.G_RET_STS_ERROR;
456         END IF;
457     END IF;
458 
459 
460     IF  p_PRICE_LIST_LINE_rec.pricing_attribute2 IS NOT NULL AND
461         (   p_PRICE_LIST_LINE_rec.pricing_attribute2 <>
462             p_old_PRICE_LIST_LINE_rec.pricing_attribute2 OR
463             p_old_PRICE_LIST_LINE_rec.pricing_attribute2 IS NULL )
464     THEN
465         IF NOT OE_Validate_Attr.Pricing_Attribute2(p_PRICE_LIST_LINE_rec.pricing_attribute2) THEN
466             x_return_status := FND_API.G_RET_STS_ERROR;
467         END IF;
468     END IF;
469 
470     IF  p_PRICE_LIST_LINE_rec.pricing_attribute3 IS NOT NULL AND
471         (   p_PRICE_LIST_LINE_rec.pricing_attribute3 <>
472             p_old_PRICE_LIST_LINE_rec.pricing_attribute3 OR
473             p_old_PRICE_LIST_LINE_rec.pricing_attribute3 IS NULL )
474     THEN
475         IF NOT OE_Validate_Attr.Pricing_Attribute3(p_PRICE_LIST_LINE_rec.pricing_attribute3) THEN
476             x_return_status := FND_API.G_RET_STS_ERROR;
477         END IF;
478     END IF;
479 
480     IF  p_PRICE_LIST_LINE_rec.pricing_attribute4 IS NOT NULL AND
481         (   p_PRICE_LIST_LINE_rec.pricing_attribute4 <>
482             p_old_PRICE_LIST_LINE_rec.pricing_attribute4 OR
483             p_old_PRICE_LIST_LINE_rec.pricing_attribute4 IS NULL )
484     THEN
485         IF NOT OE_Validate_Attr.Pricing_Attribute4(p_PRICE_LIST_LINE_rec.pricing_attribute4) THEN
486             x_return_status := FND_API.G_RET_STS_ERROR;
487         END IF;
488     END IF;
489 
490     IF  p_PRICE_LIST_LINE_rec.pricing_attribute5 IS NOT NULL AND
491         (   p_PRICE_LIST_LINE_rec.pricing_attribute5 <>
492             p_old_PRICE_LIST_LINE_rec.pricing_attribute5 OR
493             p_old_PRICE_LIST_LINE_rec.pricing_attribute5 IS NULL )
494     THEN
495         IF NOT OE_Validate_Attr.Pricing_Attribute5(p_PRICE_LIST_LINE_rec.pricing_attribute5) THEN
496             x_return_status := FND_API.G_RET_STS_ERROR;
497         END IF;
498     END IF;
499 
500 
501     IF  p_PRICE_LIST_LINE_rec.pricing_attribute6 IS NOT NULL AND
502         (   p_PRICE_LIST_LINE_rec.pricing_attribute6 <>
503             p_old_PRICE_LIST_LINE_rec.pricing_attribute6 OR
504             p_old_PRICE_LIST_LINE_rec.pricing_attribute6 IS NULL )
505     THEN
506         IF NOT OE_Validate_Attr.Pricing_Attribute6(p_PRICE_LIST_LINE_rec.pricing_attribute6) THEN
507             x_return_status := FND_API.G_RET_STS_ERROR;
508         END IF;
509     END IF;
510 
511     IF  p_PRICE_LIST_LINE_rec.pricing_attribute7 IS NOT NULL AND
512         (   p_PRICE_LIST_LINE_rec.pricing_attribute7 <>
513             p_old_PRICE_LIST_LINE_rec.pricing_attribute7 OR
514             p_old_PRICE_LIST_LINE_rec.pricing_attribute7 IS NULL )
515     THEN
516         IF NOT OE_Validate_Attr.Pricing_Attribute7(p_PRICE_LIST_LINE_rec.pricing_attribute7) THEN
517             x_return_status := FND_API.G_RET_STS_ERROR;
518         END IF;
519     END IF;
520 
521     IF  p_PRICE_LIST_LINE_rec.pricing_attribute8 IS NOT NULL AND
522         (   p_PRICE_LIST_LINE_rec.pricing_attribute8 <>
523             p_old_PRICE_LIST_LINE_rec.pricing_attribute8 OR
524             p_old_PRICE_LIST_LINE_rec.pricing_attribute8 IS NULL )
525     THEN
526         IF NOT OE_Validate_Attr.Pricing_Attribute8(p_PRICE_LIST_LINE_rec.pricing_attribute8) THEN
527             x_return_status := FND_API.G_RET_STS_ERROR;
528         END IF;
529     END IF;
530 
531     IF  p_PRICE_LIST_LINE_rec.pricing_attribute9 IS NOT NULL AND
532         (   p_PRICE_LIST_LINE_rec.pricing_attribute9 <>
533             p_old_PRICE_LIST_LINE_rec.pricing_attribute9 OR
534             p_old_PRICE_LIST_LINE_rec.pricing_attribute9 IS NULL )
535     THEN
536         IF NOT OE_Validate_Attr.Pricing_Attribute9(p_PRICE_LIST_LINE_rec.pricing_attribute9) THEN
537             x_return_status := FND_API.G_RET_STS_ERROR;
538         END IF;
539     END IF;
540 
541     IF  p_PRICE_LIST_LINE_rec.pricing_context IS NOT NULL AND
542         (   p_PRICE_LIST_LINE_rec.pricing_context <>
543             p_old_PRICE_LIST_LINE_rec.pricing_context OR
544             p_old_PRICE_LIST_LINE_rec.pricing_context IS NULL )
545     THEN
546         IF NOT OE_Validate_Attr.Pricing_Context(p_PRICE_LIST_LINE_rec.pricing_context) THEN
547             x_return_status := FND_API.G_RET_STS_ERROR;
548         END IF;
549     END IF;
550 
551     IF  p_PRICE_LIST_LINE_rec.pricing_rule_id IS NOT NULL AND
552         (   p_PRICE_LIST_LINE_rec.pricing_rule_id <>
553             p_old_PRICE_LIST_LINE_rec.pricing_rule_id OR
554             p_old_PRICE_LIST_LINE_rec.pricing_rule_id IS NULL )
555     THEN
556         IF NOT OE_Validate_Attr.Pricing_Rule(p_PRICE_LIST_LINE_rec.pricing_rule_id) THEN
557             x_return_status := FND_API.G_RET_STS_ERROR;
558         END IF;
559     END IF;
560 
561     IF  p_PRICE_LIST_LINE_rec.primary IS NOT NULL AND
562         (   p_PRICE_LIST_LINE_rec.primary <>
563             p_old_PRICE_LIST_LINE_rec.primary OR
564             p_old_PRICE_LIST_LINE_rec.primary IS NULL )
565     THEN
566         IF NOT OE_Validate_Attr.Primary(p_PRICE_LIST_LINE_rec.primary) THEN
567             x_return_status := FND_API.G_RET_STS_ERROR;
568         END IF;
569     END IF;
570 
571     IF  p_PRICE_LIST_LINE_rec.program_application_id IS NOT NULL AND
572         (   p_PRICE_LIST_LINE_rec.program_application_id <>
573             p_old_PRICE_LIST_LINE_rec.program_application_id OR
574             p_old_PRICE_LIST_LINE_rec.program_application_id IS NULL )
575     THEN
576         IF NOT OE_Validate_Attr.Program_Application(p_PRICE_LIST_LINE_rec.program_application_id) THEN
577             x_return_status := FND_API.G_RET_STS_ERROR;
578         END IF;
579     END IF;
580 
581     IF  p_PRICE_LIST_LINE_rec.program_id IS NOT NULL AND
582         (   p_PRICE_LIST_LINE_rec.program_id <>
583             p_old_PRICE_LIST_LINE_rec.program_id OR
584             p_old_PRICE_LIST_LINE_rec.program_id IS NULL )
585     THEN
586         IF NOT OE_Validate_Attr.Program(p_PRICE_LIST_LINE_rec.program_id) THEN
587             x_return_status := FND_API.G_RET_STS_ERROR;
588         END IF;
589     END IF;
590 
591     IF  p_PRICE_LIST_LINE_rec.program_update_date IS NOT NULL AND
592         (   p_PRICE_LIST_LINE_rec.program_update_date <>
593             p_old_PRICE_LIST_LINE_rec.program_update_date OR
594             p_old_PRICE_LIST_LINE_rec.program_update_date IS NULL )
595     THEN
596         IF NOT OE_Validate_Attr.Program_Update_Date(p_PRICE_LIST_LINE_rec.program_update_date) THEN
597             x_return_status := FND_API.G_RET_STS_ERROR;
598         END IF;
599     END IF;
600 
601     IF  p_PRICE_LIST_LINE_rec.reprice_flag IS NOT NULL AND
602         (   p_PRICE_LIST_LINE_rec.reprice_flag <>
603             p_old_PRICE_LIST_LINE_rec.reprice_flag OR
604             p_old_PRICE_LIST_LINE_rec.reprice_flag IS NULL )
605     THEN
606         IF NOT OE_Validate_Attr.Reprice(p_PRICE_LIST_LINE_rec.reprice_flag) THEN
607             x_return_status := FND_API.G_RET_STS_ERROR;
608         END IF;
609     END IF;
610 
611     IF  p_PRICE_LIST_LINE_rec.request_id IS NOT NULL AND
612         (   p_PRICE_LIST_LINE_rec.request_id <>
613             p_old_PRICE_LIST_LINE_rec.request_id OR
614             p_old_PRICE_LIST_LINE_rec.request_id IS NULL )
615     THEN
616         IF NOT OE_Validate_Attr.Request(p_PRICE_LIST_LINE_rec.request_id) THEN
617             x_return_status := FND_API.G_RET_STS_ERROR;
618         END IF;
619     END IF;
620 
621     IF  p_PRICE_LIST_LINE_rec.revision IS NOT NULL AND
622         (   p_PRICE_LIST_LINE_rec.revision <>
623             p_old_PRICE_LIST_LINE_rec.revision OR
624             p_old_PRICE_LIST_LINE_rec.revision IS NULL )
625     THEN
626         IF NOT OE_Validate_Attr.Revision(p_PRICE_LIST_LINE_rec.revision) THEN
627             x_return_status := FND_API.G_RET_STS_ERROR;
628         END IF;
629     END IF;
630 
631     IF  p_PRICE_LIST_LINE_rec.revision_date IS NOT NULL AND
632         (   p_PRICE_LIST_LINE_rec.revision_date <>
633             p_old_PRICE_LIST_LINE_rec.revision_date OR
634             p_old_PRICE_LIST_LINE_rec.revision_date IS NULL )
635     THEN
636         IF NOT OE_Validate_Attr.Revision_Date(p_PRICE_LIST_LINE_rec.revision_date) THEN
637             x_return_status := FND_API.G_RET_STS_ERROR;
638         END IF;
639     END IF;
640 
641     IF  p_PRICE_LIST_LINE_rec.revision_reason_code IS NOT NULL AND
642         (   p_PRICE_LIST_LINE_rec.revision_reason_code <>
643             p_old_PRICE_LIST_LINE_rec.revision_reason_code OR
644             p_old_PRICE_LIST_LINE_rec.revision_reason_code IS NULL )
645     THEN
646         IF NOT OE_Validate_Attr.Revision_Reason(p_PRICE_LIST_LINE_rec.revision_reason_code) THEN
647             x_return_status := FND_API.G_RET_STS_ERROR;
648         END IF;
649     END IF;
650 
651     IF  p_PRICE_LIST_LINE_rec.start_date_active IS NOT NULL AND
652         (   p_PRICE_LIST_LINE_rec.start_date_active <>
653             p_old_PRICE_LIST_LINE_rec.start_date_active OR
654             p_old_PRICE_LIST_LINE_rec.start_date_active IS NULL )
655     THEN
656         IF NOT OE_Validate_Attr.Start_Date_Active(p_PRICE_LIST_LINE_rec.start_date_active) THEN
657             x_return_status := FND_API.G_RET_STS_ERROR;
658         ELSIF NOT OE_Validate_Attr.Start_Date_End_Date(
659                        p_Price_List_Line_rec.start_date_active,
660                        p_Price_List_Line_rec.end_date_active) THEN
661             x_return_status := FND_API.G_RET_STS_ERROR;
662         END IF;
663     END IF;
664 
665     IF  p_PRICE_LIST_LINE_rec.unit_code IS NOT NULL AND
666         (   p_PRICE_LIST_LINE_rec.unit_code <>
667             p_old_PRICE_LIST_LINE_rec.unit_code OR
668             p_old_PRICE_LIST_LINE_rec.unit_code IS NULL )
669     THEN
670         IF NOT OE_Validate_Attr.Unit(p_PRICE_LIST_LINE_rec.unit_code) THEN
671             x_return_status := FND_API.G_RET_STS_ERROR;
672         END IF;
673     END IF;
674 
675     IF  p_PRICE_LIST_LINE_rec.list_line_type_code IS NOT NULL AND
676         (   p_PRICE_LIST_LINE_rec.list_line_type_code <>
677             p_old_PRICE_LIST_LINE_rec.list_line_type_code OR
678             p_old_PRICE_LIST_LINE_rec.list_line_type_code IS NULL )
679     THEN
680         IF NOT OE_Validate_Attr.List_Line_Type(p_PRICE_LIST_LINE_rec.list_line_type_code) THEN
681             x_return_status := FND_API.G_RET_STS_ERROR;
682         END IF;
683     END IF;
684 
685 
686     IF  (p_PRICE_LIST_LINE_rec.attribute1 IS NOT NULL AND
687         (   p_PRICE_LIST_LINE_rec.attribute1 <>
688             p_old_PRICE_LIST_LINE_rec.attribute1 OR
689             p_old_PRICE_LIST_LINE_rec.attribute1 IS NULL ))
690     OR  (p_PRICE_LIST_LINE_rec.attribute10 IS NOT NULL AND
691         (   p_PRICE_LIST_LINE_rec.attribute10 <>
692             p_old_PRICE_LIST_LINE_rec.attribute10 OR
693             p_old_PRICE_LIST_LINE_rec.attribute10 IS NULL ))
694     OR  (p_PRICE_LIST_LINE_rec.attribute11 IS NOT NULL AND
695         (   p_PRICE_LIST_LINE_rec.attribute11 <>
696             p_old_PRICE_LIST_LINE_rec.attribute11 OR
697             p_old_PRICE_LIST_LINE_rec.attribute11 IS NULL ))
698     OR  (p_PRICE_LIST_LINE_rec.attribute12 IS NOT NULL AND
699         (   p_PRICE_LIST_LINE_rec.attribute12 <>
700             p_old_PRICE_LIST_LINE_rec.attribute12 OR
701             p_old_PRICE_LIST_LINE_rec.attribute12 IS NULL ))
702     OR  (p_PRICE_LIST_LINE_rec.attribute13 IS NOT NULL AND
703         (   p_PRICE_LIST_LINE_rec.attribute13 <>
704             p_old_PRICE_LIST_LINE_rec.attribute13 OR
705             p_old_PRICE_LIST_LINE_rec.attribute13 IS NULL ))
706     OR  (p_PRICE_LIST_LINE_rec.attribute14 IS NOT NULL AND
707         (   p_PRICE_LIST_LINE_rec.attribute14 <>
708             p_old_PRICE_LIST_LINE_rec.attribute14 OR
709             p_old_PRICE_LIST_LINE_rec.attribute14 IS NULL ))
710     OR  (p_PRICE_LIST_LINE_rec.attribute15 IS NOT NULL AND
711         (   p_PRICE_LIST_LINE_rec.attribute15 <>
712             p_old_PRICE_LIST_LINE_rec.attribute15 OR
713             p_old_PRICE_LIST_LINE_rec.attribute15 IS NULL ))
714     OR  (p_PRICE_LIST_LINE_rec.attribute2 IS NOT NULL AND
715         (   p_PRICE_LIST_LINE_rec.attribute2 <>
716             p_old_PRICE_LIST_LINE_rec.attribute2 OR
717             p_old_PRICE_LIST_LINE_rec.attribute2 IS NULL ))
718     OR  (p_PRICE_LIST_LINE_rec.attribute3 IS NOT NULL AND
719         (   p_PRICE_LIST_LINE_rec.attribute3 <>
720             p_old_PRICE_LIST_LINE_rec.attribute3 OR
721             p_old_PRICE_LIST_LINE_rec.attribute3 IS NULL ))
722     OR  (p_PRICE_LIST_LINE_rec.attribute4 IS NOT NULL AND
723         (   p_PRICE_LIST_LINE_rec.attribute4 <>
724             p_old_PRICE_LIST_LINE_rec.attribute4 OR
725             p_old_PRICE_LIST_LINE_rec.attribute4 IS NULL ))
726     OR  (p_PRICE_LIST_LINE_rec.attribute5 IS NOT NULL AND
727         (   p_PRICE_LIST_LINE_rec.attribute5 <>
728             p_old_PRICE_LIST_LINE_rec.attribute5 OR
729             p_old_PRICE_LIST_LINE_rec.attribute5 IS NULL ))
730     OR  (p_PRICE_LIST_LINE_rec.attribute6 IS NOT NULL AND
731         (   p_PRICE_LIST_LINE_rec.attribute6 <>
732             p_old_PRICE_LIST_LINE_rec.attribute6 OR
733             p_old_PRICE_LIST_LINE_rec.attribute6 IS NULL ))
734     OR  (p_PRICE_LIST_LINE_rec.attribute7 IS NOT NULL AND
735         (   p_PRICE_LIST_LINE_rec.attribute7 <>
736             p_old_PRICE_LIST_LINE_rec.attribute7 OR
737             p_old_PRICE_LIST_LINE_rec.attribute7 IS NULL ))
738     OR  (p_PRICE_LIST_LINE_rec.attribute8 IS NOT NULL AND
739         (   p_PRICE_LIST_LINE_rec.attribute8 <>
740             p_old_PRICE_LIST_LINE_rec.attribute8 OR
741             p_old_PRICE_LIST_LINE_rec.attribute8 IS NULL ))
742     OR  (p_PRICE_LIST_LINE_rec.attribute9 IS NOT NULL AND
743         (   p_PRICE_LIST_LINE_rec.attribute9 <>
744             p_old_PRICE_LIST_LINE_rec.attribute9 OR
745             p_old_PRICE_LIST_LINE_rec.attribute9 IS NULL ))
746     OR  (p_PRICE_LIST_LINE_rec.context IS NOT NULL AND
747         (   p_PRICE_LIST_LINE_rec.context <>
748             p_old_PRICE_LIST_LINE_rec.context OR
749             p_old_PRICE_LIST_LINE_rec.context IS NULL ))
750     THEN
751 
752     --  These calls are temporarily commented out
753  NULL;
754 /*
755         FND_FLEX_DESC_VAL.Set_Column_Value
756         (   column_name                   => 'ATTRIBUTE1'
757         ,   column_value                  => p_PRICE_LIST_LINE_rec.attribute1
758         );
759         FND_FLEX_DESC_VAL.Set_Column_Value
760         (   column_name                   => 'ATTRIBUTE10'
761         ,   column_value                  => p_PRICE_LIST_LINE_rec.attribute10
762         );
763         FND_FLEX_DESC_VAL.Set_Column_Value
764         (   column_name                   => 'ATTRIBUTE11'
765         ,   column_value                  => p_PRICE_LIST_LINE_rec.attribute11
766         );
767         FND_FLEX_DESC_VAL.Set_Column_Value
768         (   column_name                   => 'ATTRIBUTE12'
769         ,   column_value                  => p_PRICE_LIST_LINE_rec.attribute12
770         );
771         FND_FLEX_DESC_VAL.Set_Column_Value
772         (   column_name                   => 'ATTRIBUTE13'
773         ,   column_value                  => p_PRICE_LIST_LINE_rec.attribute13
774         );
775         FND_FLEX_DESC_VAL.Set_Column_Value
776         (   column_name                   => 'ATTRIBUTE14'
777         ,   column_value                  => p_PRICE_LIST_LINE_rec.attribute14
778         );
779         FND_FLEX_DESC_VAL.Set_Column_Value
780         (   column_name                   => 'ATTRIBUTE15'
781         ,   column_value                  => p_PRICE_LIST_LINE_rec.attribute15
782         );
783         FND_FLEX_DESC_VAL.Set_Column_Value
784         (   column_name                   => 'ATTRIBUTE2'
785         ,   column_value                  => p_PRICE_LIST_LINE_rec.attribute2
786         );
787         FND_FLEX_DESC_VAL.Set_Column_Value
788         (   column_name                   => 'ATTRIBUTE3'
789         ,   column_value                  => p_PRICE_LIST_LINE_rec.attribute3
790         );
791         FND_FLEX_DESC_VAL.Set_Column_Value
792         (   column_name                   => 'ATTRIBUTE4'
793         ,   column_value                  => p_PRICE_LIST_LINE_rec.attribute4
794         );
795         FND_FLEX_DESC_VAL.Set_Column_Value
796         (   column_name                   => 'ATTRIBUTE5'
797         ,   column_value                  => p_PRICE_LIST_LINE_rec.attribute5
798         );
799         FND_FLEX_DESC_VAL.Set_Column_Value
800         (   column_name                   => 'ATTRIBUTE6'
801         ,   column_value                  => p_PRICE_LIST_LINE_rec.attribute6
802         );
803         FND_FLEX_DESC_VAL.Set_Column_Value
804         (   column_name                   => 'ATTRIBUTE7'
805         ,   column_value                  => p_PRICE_LIST_LINE_rec.attribute7
806         );
807         FND_FLEX_DESC_VAL.Set_Column_Value
808         (   column_name                   => 'ATTRIBUTE8'
809         ,   column_value                  => p_PRICE_LIST_LINE_rec.attribute8
810         );
811         FND_FLEX_DESC_VAL.Set_Column_Value
812         (   column_name                   => 'ATTRIBUTE9'
813         ,   column_value                  => p_PRICE_LIST_LINE_rec.attribute9
814         );
815         FND_FLEX_DESC_VAL.Set_Column_Value
816         (   column_name                   => 'CONTEXT'
817         ,   column_value                  => p_PRICE_LIST_LINE_rec.context
818         );
819 */
820 
821         --  Validate descriptive flexfield.
822 
823         IF NOT OE_Validate_Attr.Desc_Flex( 'SO_PRICE_LIST_LINES' ) THEN
824             x_return_status := FND_API.G_RET_STS_ERROR;
825         END IF;
826 
827     END IF;
828 
829     IF  (p_PRICE_LIST_LINE_rec.pricing_attribute1 IS NOT NULL AND
830         (   p_PRICE_LIST_LINE_rec.pricing_attribute1 <>
831             p_old_PRICE_LIST_LINE_rec.pricing_attribute1 OR
832             p_old_PRICE_LIST_LINE_rec.pricing_attribute1 IS NULL ))
833     OR  (p_PRICE_LIST_LINE_rec.pricing_attribute10 IS NOT NULL AND
834         (   p_PRICE_LIST_LINE_rec.pricing_attribute10 <>
835             p_old_PRICE_LIST_LINE_rec.pricing_attribute10 OR
836             p_old_PRICE_LIST_LINE_rec.pricing_attribute10 IS NULL ))
837     OR  (p_PRICE_LIST_LINE_rec.pricing_attribute2 IS NOT NULL AND
838         (   p_PRICE_LIST_LINE_rec.pricing_attribute2 <>
839             p_old_PRICE_LIST_LINE_rec.pricing_attribute2 OR
840             p_old_PRICE_LIST_LINE_rec.pricing_attribute2 IS NULL ))
841     OR  (p_PRICE_LIST_LINE_rec.pricing_attribute3 IS NOT NULL AND
842         (   p_PRICE_LIST_LINE_rec.pricing_attribute3 <>
843             p_old_PRICE_LIST_LINE_rec.pricing_attribute3 OR
844             p_old_PRICE_LIST_LINE_rec.pricing_attribute3 IS NULL ))
845     OR  (p_PRICE_LIST_LINE_rec.pricing_attribute4 IS NOT NULL AND
846         (   p_PRICE_LIST_LINE_rec.pricing_attribute4 <>
847             p_old_PRICE_LIST_LINE_rec.pricing_attribute4 OR
848             p_old_PRICE_LIST_LINE_rec.pricing_attribute4 IS NULL ))
849     OR  (p_PRICE_LIST_LINE_rec.pricing_attribute5 IS NOT NULL AND
850         (   p_PRICE_LIST_LINE_rec.pricing_attribute5 <>
851             p_old_PRICE_LIST_LINE_rec.pricing_attribute5 OR
852             p_old_PRICE_LIST_LINE_rec.pricing_attribute5 IS NULL ))
853     OR  (p_PRICE_LIST_LINE_rec.pricing_attribute6 IS NOT NULL AND
854         (   p_PRICE_LIST_LINE_rec.pricing_attribute6 <>
855             p_old_PRICE_LIST_LINE_rec.pricing_attribute6 OR
856             p_old_PRICE_LIST_LINE_rec.pricing_attribute6 IS NULL ))
857     OR  (p_PRICE_LIST_LINE_rec.pricing_attribute7 IS NOT NULL AND
858         (   p_PRICE_LIST_LINE_rec.pricing_attribute7 <>
859             p_old_PRICE_LIST_LINE_rec.pricing_attribute7 OR
860             p_old_PRICE_LIST_LINE_rec.pricing_attribute7 IS NULL ))
861     OR  (p_PRICE_LIST_LINE_rec.pricing_attribute8 IS NOT NULL AND
862         (   p_PRICE_LIST_LINE_rec.pricing_attribute8 <>
863             p_old_PRICE_LIST_LINE_rec.pricing_attribute8 OR
864             p_old_PRICE_LIST_LINE_rec.pricing_attribute8 IS NULL ))
865     OR  (p_PRICE_LIST_LINE_rec.pricing_attribute9 IS NOT NULL AND
866         (   p_PRICE_LIST_LINE_rec.pricing_attribute9 <>
867             p_old_PRICE_LIST_LINE_rec.pricing_attribute9 OR
868             p_old_PRICE_LIST_LINE_rec.pricing_attribute9 IS NULL ))
869     OR  (p_PRICE_LIST_LINE_rec.pricing_context IS NOT NULL AND
870         (   p_PRICE_LIST_LINE_rec.pricing_context <>
871             p_old_PRICE_LIST_LINE_rec.pricing_context OR
872             p_old_PRICE_LIST_LINE_rec.pricing_context IS NULL ))
873     THEN
874 
875     --  These calls are temporarily commented out
876 NULL;
877 /*
878         FND_FLEX_DESC_VAL.Set_Column_Value
879         (   column_name                   => 'PRICING_ATTRIBUTE1'
880         ,   column_value                  => p_PRICE_LIST_LINE_rec.pricing_attribute1
881         );
882         FND_FLEX_DESC_VAL.Set_Column_Value
883         (   column_name                   => 'PRICING_ATTRIBUTE10'
884         ,   column_value                  => p_PRICE_LIST_LINE_rec.pricing_attribute10
885         );
886         FND_FLEX_DESC_VAL.Set_Column_Value
887         (   column_name                   => 'PRICING_ATTRIBUTE2'
888         ,   column_value                  => p_PRICE_LIST_LINE_rec.pricing_attribute2
889         );
890         FND_FLEX_DESC_VAL.Set_Column_Value
891         (   column_name                   => 'PRICING_ATTRIBUTE3'
892         ,   column_value                  => p_PRICE_LIST_LINE_rec.pricing_attribute3
893         );
894         FND_FLEX_DESC_VAL.Set_Column_Value
895         (   column_name                   => 'PRICING_ATTRIBUTE4'
896         ,   column_value                  => p_PRICE_LIST_LINE_rec.pricing_attribute4
897         );
898         FND_FLEX_DESC_VAL.Set_Column_Value
899         (   column_name                   => 'PRICING_ATTRIBUTE5'
900         ,   column_value                  => p_PRICE_LIST_LINE_rec.pricing_attribute5
901         );
902         FND_FLEX_DESC_VAL.Set_Column_Value
903         (   column_name                   => 'PRICING_ATTRIBUTE6'
904         ,   column_value                  => p_PRICE_LIST_LINE_rec.pricing_attribute6
905         );
906         FND_FLEX_DESC_VAL.Set_Column_Value
907         (   column_name                   => 'PRICING_ATTRIBUTE7'
908         ,   column_value                  => p_PRICE_LIST_LINE_rec.pricing_attribute7
909         );
910         FND_FLEX_DESC_VAL.Set_Column_Value
911         (   column_name                   => 'PRICING_ATTRIBUTE8'
912         ,   column_value                  => p_PRICE_LIST_LINE_rec.pricing_attribute8
913         );
914         FND_FLEX_DESC_VAL.Set_Column_Value
915         (   column_name                   => 'PRICING_ATTRIBUTE9'
916         ,   column_value                  => p_PRICE_LIST_LINE_rec.pricing_attribute9
917         );
918         FND_FLEX_DESC_VAL.Set_Column_Value
919         (   column_name                   => 'PRICING_CONTEXT'
920         ,   column_value                  => p_PRICE_LIST_LINE_rec.pricing_context
921         );
922 */
923 
924         --  Validate descriptive flexfield.
925 
926         IF NOT OE_Validate_Attr.Desc_Flex( 'PRICING_ATTRIBUTES' ) THEN
927             x_return_status := FND_API.G_RET_STS_ERROR;
928         END IF;
929 
930     END IF;
931 
932     IF  p_Price_List_Line_rec.primary IS NOT NULL AND
933         (   p_Price_List_Line_rec.primary <>
934             p_old_Price_List_Line_rec.primary OR
935             p_old_Price_List_Line_rec.primary IS NULL )
936     THEN
937 
938 -- Passing start date and end date to primary exists function
939 -- Geresh
940        l_primary_exists :=
941                  OE_VALIDATE_ATTR.PRIMARY_EXISTS(
942                  p_PRICE_LIST_LINE_rec.price_list_id,
943                  p_Price_List_Line_rec.inventory_item_id,
944                  p_Price_List_Line_rec.customer_item_id,
945                  p_Price_List_Line_rec.pricing_attribute1,
946                  p_Price_List_Line_rec.pricing_attribute2,
947                  p_Price_List_Line_rec.pricing_attribute3,
948                  p_Price_List_Line_rec.pricing_attribute4,
949                  p_Price_List_Line_rec.pricing_attribute5,
950                  p_Price_List_Line_rec.pricing_attribute6,
951                  p_Price_List_Line_rec.pricing_attribute7,
952                  p_Price_List_Line_rec.pricing_attribute8,
953                  p_Price_List_Line_rec.pricing_attribute9,
954                  p_Price_List_Line_rec.pricing_attribute10,
955                  p_Price_List_Line_rec.pricing_attribute11,
956                  p_Price_List_Line_rec.pricing_attribute12,
957                  p_Price_List_Line_rec.pricing_attribute13,
958                  p_Price_List_Line_rec.pricing_attribute14,
959                  p_Price_List_Line_rec.pricing_attribute15,
960 		 p_Price_List_Line_rec.start_date_active,
961 		 p_Price_List_Line_rec.end_date_active );
962 
963 
964       IF p_Price_List_Line_rec.primary = 'Y' THEN
965 
966          IF l_primary_exists THEN
967             x_return_status := FND_API.G_RET_STS_ERROR;
968 
969          END IF;
970 
971       ELSIF p_Price_List_Line_rec.primary = 'N' THEN
972 
973          IF (NOT l_primary_exists) THEN
974              x_return_status := FND_API.G_RET_STS_ERROR;
975          END IF;
976 
977       END IF;
978 
979 
980 /*
981         ELSIF NOT OE_Validate_Attr.PRIMARY(p_Price_List_Line_rec.primary) THEN
982             x_return_status := FND_API.G_RET_STS_ERROR;
983         END IF;
984 */
985 
986     END IF;
987 
988 
989 
990     --  Done validating attributes
991 
992 EXCEPTION
993 
994     WHEN FND_API.G_EXC_ERROR THEN
995 
996         x_return_status := FND_API.G_RET_STS_ERROR;
997 
998     WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
999 
1000         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1001 
1002     WHEN OTHERS THEN
1003 
1004         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1005 
1006         IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1007         THEN
1008             OE_MSG_PUB.Add_Exc_Msg
1009             (   G_PKG_NAME
1010             ,   'Attributes'
1011             );
1012         END IF;
1013 
1014 END Attributes;
1015 
1016 --  Procedure Entity_Delete
1017 
1018 PROCEDURE Entity_Delete
1019 (   x_return_status                 OUT VARCHAR2
1020 ,   p_PRICE_LIST_LINE_rec           IN  OE_Price_List_PUB.Price_List_Line_Rec_Type
1021 )
1022 IS
1023 l_return_status               VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
1024 BEGIN
1025 
1026     --  Validate entity delete.
1027 
1028     NULL;
1029 
1030     --  Done.
1031 
1032     x_return_status := l_return_status;
1033 
1034 EXCEPTION
1035 
1036     WHEN FND_API.G_EXC_ERROR THEN
1037 
1038         x_return_status := FND_API.G_RET_STS_ERROR;
1039 
1040     WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1041 
1042         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1043 
1044     WHEN OTHERS THEN
1045 
1046         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1047 
1048         IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1049         THEN
1050             OE_MSG_PUB.Add_Exc_Msg
1051             (   G_PKG_NAME
1052             ,   'Entity_Delete'
1053             );
1054         END IF;
1055 
1056 END Entity_Delete;
1057 
1058 END OE_Validate_Price_List_Line;