18:
19: for i in 1..p_Item_Orderability_Import_Tbl.count loop
20:
21: OE_ITORD_PUB.Check_required_fields( p_Item_Orderability_Import_Tbl(i));
22: IF p_Item_Orderability_Import_Tbl(i).status = FND_API.G_RET_STS_SUCCESS then
23: OE_ITORD_PUB.Validate_required_fields ( p_Item_Orderability_Import_Tbl(i));
24: IF p_Item_Orderability_Import_Tbl(i).status = FND_API.G_RET_STS_SUCCESS then
25: OE_ITORD_PUB.Validate_conditional_fields ( p_Item_Orderability_Import_Tbl(i));
26: IF p_Item_Orderability_Import_Tbl(i).status = FND_API.G_RET_STS_SUCCESS then
20:
21: OE_ITORD_PUB.Check_required_fields( p_Item_Orderability_Import_Tbl(i));
22: IF p_Item_Orderability_Import_Tbl(i).status = FND_API.G_RET_STS_SUCCESS then
23: OE_ITORD_PUB.Validate_required_fields ( p_Item_Orderability_Import_Tbl(i));
24: IF p_Item_Orderability_Import_Tbl(i).status = FND_API.G_RET_STS_SUCCESS then
25: OE_ITORD_PUB.Validate_conditional_fields ( p_Item_Orderability_Import_Tbl(i));
26: IF p_Item_Orderability_Import_Tbl(i).status = FND_API.G_RET_STS_SUCCESS then
27: OE_ITORD_PUB.check_duplicate_rules ( p_Item_Orderability_Import_Tbl(i) );
28: IF p_Item_Orderability_Import_Tbl(i).status = FND_API.G_RET_STS_SUCCESS then
22: IF p_Item_Orderability_Import_Tbl(i).status = FND_API.G_RET_STS_SUCCESS then
23: OE_ITORD_PUB.Validate_required_fields ( p_Item_Orderability_Import_Tbl(i));
24: IF p_Item_Orderability_Import_Tbl(i).status = FND_API.G_RET_STS_SUCCESS then
25: OE_ITORD_PUB.Validate_conditional_fields ( p_Item_Orderability_Import_Tbl(i));
26: IF p_Item_Orderability_Import_Tbl(i).status = FND_API.G_RET_STS_SUCCESS then
27: OE_ITORD_PUB.check_duplicate_rules ( p_Item_Orderability_Import_Tbl(i) );
28: IF p_Item_Orderability_Import_Tbl(i).status = FND_API.G_RET_STS_SUCCESS then
29: OE_ITORD_PUB.Validate_rules_DFF (p_Item_Orderability_Import_Tbl(i));
30: IF p_Item_Orderability_Import_Tbl(i).status = FND_API.G_RET_STS_SUCCESS then
24: IF p_Item_Orderability_Import_Tbl(i).status = FND_API.G_RET_STS_SUCCESS then
25: OE_ITORD_PUB.Validate_conditional_fields ( p_Item_Orderability_Import_Tbl(i));
26: IF p_Item_Orderability_Import_Tbl(i).status = FND_API.G_RET_STS_SUCCESS then
27: OE_ITORD_PUB.check_duplicate_rules ( p_Item_Orderability_Import_Tbl(i) );
28: IF p_Item_Orderability_Import_Tbl(i).status = FND_API.G_RET_STS_SUCCESS then
29: OE_ITORD_PUB.Validate_rules_DFF (p_Item_Orderability_Import_Tbl(i));
30: IF p_Item_Orderability_Import_Tbl(i).status = FND_API.G_RET_STS_SUCCESS then
31: OE_ITORD_PUB.insert_rules(p_Item_Orderability_Import_Tbl(i));
32: END IF;
26: IF p_Item_Orderability_Import_Tbl(i).status = FND_API.G_RET_STS_SUCCESS then
27: OE_ITORD_PUB.check_duplicate_rules ( p_Item_Orderability_Import_Tbl(i) );
28: IF p_Item_Orderability_Import_Tbl(i).status = FND_API.G_RET_STS_SUCCESS then
29: OE_ITORD_PUB.Validate_rules_DFF (p_Item_Orderability_Import_Tbl(i));
30: IF p_Item_Orderability_Import_Tbl(i).status = FND_API.G_RET_STS_SUCCESS then
31: OE_ITORD_PUB.insert_rules(p_Item_Orderability_Import_Tbl(i));
32: END IF;
33:
34: END IF;
67: IF l_debug_level > 0 then
68: oe_debug_pub.add('Entering OE_ITORD_PUB.Check_required_fields');
69: End If;
70:
71: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_SUCCESS;
72: p_Item_Orderability_Import_Rec.msg_data := NULL;
73: p_Item_Orderability_Import_Rec.msg_count := 0;
74:
75: IF p_Item_Orderability_Import_Rec.org_id is NULL then
75: IF p_Item_Orderability_Import_Rec.org_id is NULL then
76:
77: fnd_message.set_name('ONT','OE_ATTRIBUTE_REQUIRED');
78: fnd_message.set_token('ATTRIBUTE','ORG_ID');
79: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
80: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
81: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
82: END IF;
83:
83:
84: IF p_Item_Orderability_Import_Rec.ITEM_LEVEL is NULL then
85: fnd_message.set_name('ONT','OE_ATTRIBUTE_REQUIRED');
86: fnd_message.set_token('ATTRIBUTE','ITEM_LEVEL');
87: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
88: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get ;
89: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
90: END IF;
91:
91:
92: IF p_Item_Orderability_Import_Rec.generally_available is NULL then
93: fnd_message.set_name('ONT','OE_ATTRIBUTE_REQUIRED');
94: fnd_message.set_token('ATTRIBUTE','GENERALLY_AVAILABLE');
95: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
96: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get ;
97: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
98: END IF;
99:
135: THEN
136:
137: fnd_message.set_name('ONT','OE_ATTRIBUTE_REQUIRED');
138: fnd_message.set_token('ATTRIBUTE','RULE_LEVEL');
139: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
140: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
141: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
142: END IF;
143: END IF;
145:
146: IF p_Item_Orderability_Import_Rec.created_by is NULL then
147: fnd_message.set_name('ONT','OE_ATTRIBUTE_REQUIRED');
148: fnd_message.set_token('ATTRIBUTE','CREATED_BY');
149: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
150: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
151: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
152: END IF;
153:
153:
154: IF p_Item_Orderability_Import_Rec.creation_date is NULL then
155: fnd_message.set_name('ONT','OE_ATTRIBUTE_REQUIRED');
156: fnd_message.set_token('ATTRIBUTE','CREATION_DATE');
157: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
158: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
159: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
160:
161: END IF;
162:
163: IF p_Item_Orderability_Import_Rec.last_updated_by is NULL then
164: fnd_message.set_name('ONT','OE_ATTRIBUTE_REQUIRED');
165: fnd_message.set_token('ATTRIBUTE','LAST_UPDATED_BY');
166: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
167: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
168: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
169: END IF;
170:
170:
171: IF p_Item_Orderability_Import_Rec.last_update_date is NULL then
172: fnd_message.set_name('ONT','OE_ATTRIBUTE_REQUIRED');
173: fnd_message.set_token('ATTRIBUTE','LAST_UPDATE_DATE');
174: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
175: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
176: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
177: END IF;
178:
197: IF l_debug_level > 0 then
198: oe_debug_pub.add('Entering OE_ITORD_PUB.Validate_required_fields');
199: End If;
200:
201: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_SUCCESS;
202: p_Item_Orderability_Import_Rec.msg_data := NULL;
203: p_Item_Orderability_Import_Rec.msg_count := 0;
204:
205: IF p_Item_Orderability_Import_Rec.org_id is NOT NULL then
211: Exception
212: when no_data_found then
213: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
214: fnd_message.set_token('ATTRIBUTE','ORG_ID');
215: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
216: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
217: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
218: End;
219: END IF;
222:
223: IF p_Item_Orderability_Import_Rec.ITEM_LEVEL NOT IN ('I','C') then
224: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
225: fnd_message.set_token('ATTRIBUTE','ITEM_LEVEL');
226: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
227: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
228: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
229: END IF;
230:
247:
248: ) then
249: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
250: fnd_message.set_token('ATTRIBUTE','RULE_LEVEL');
251: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
252: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
253: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
254:
255: END IF;
261: IF p_Item_Orderability_Import_Rec.generally_available is NOT NULL then
262: IF p_Item_Orderability_Import_Rec.generally_available NOT IN ('Y' ,'N' ) then
263: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
264: fnd_message.set_token('ATTRIBUTE','GENERALLY_AVAILABLE');
265: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
266: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
267: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
268:
269: END IF;
280: Exception
281: when others then
282: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
283: fnd_message.set_token('ATTRIBUTE','CREATED_BY');
284: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
285: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
286: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
287:
288: End;
298: Exception
299: when others then
300: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
301: fnd_message.set_token('ATTRIBUTE','LAST_UPDATED_BY');
302: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
303: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
304: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
305:
306: End;
312: End If;
313:
314: Exception
315: when others then
316: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_UNEXP_ERROR;
317: p_Item_Orderability_Import_Rec.msg_data := SQLERRM;
318: p_Item_Orderability_Import_Rec.msg_count := 1;
319: End Validate_required_fields;
320:
329: IF l_debug_level > 0 then
330: oe_debug_pub.add('Entering OE_ITORD_PUB.Validate_conditional_fields');
331: End If;
332:
333: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_SUCCESS;
334: p_Item_Orderability_Import_Rec.msg_data := NULL;
335: p_Item_Orderability_Import_Rec.msg_count := 0;
336:
337:
340: IF p_Item_Orderability_Import_Rec.customer_id IS NULL then
341: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
342: fnd_message.set_token('FIELD','Rule Level Value');
343: fnd_message.set_token('CRITERIA','CUSTOMER_ID');
344: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
345: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
346: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
347:
348: ELSE
357: Exception
358: when no_data_found then
359: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
360: fnd_message.set_token('ATTRIBUTE','CUSTOMER_ID');
361: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
362: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
363: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
364:
365: End;
385: IF p_Item_Orderability_Import_Rec.CUSTOMER_CLASS_ID IS NULL then
386: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
387: fnd_message.set_token('FIELD','Rule Level Value');
388: fnd_message.set_token('CRITERIA','CUSTOMER_CLASS_ID');
389: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
390: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
391: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
392:
393: ELSE
399: Exception
400: when no_data_found then
401: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
402: fnd_message.set_token('ATTRIBUTE','CUSTOMER_CLASS_ID');
403: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
404: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
405: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
406:
407: End;
429:
430: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
431: fnd_message.set_token('FIELD','Rule Level Value');
432: fnd_message.set_token('CRITERIA','CUSTOMER_CATEGORY_CODE');
433: P_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
434: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
435: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
436:
437:
445: Exception
446: when no_data_found then
447: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
448: fnd_message.set_token('ATTRIBUTE','CUSTOMER_CATEGORY_CODE');
449: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
450: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
451: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
452:
453: End;
470: IF p_Item_Orderability_Import_Rec.region_id IS NULL THEN
471: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
472: fnd_message.set_token('FIELD','Rule Level Value');
473: fnd_message.set_token('CRITERIA','REGION_ID');
474: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
475: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
476: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
477: ELSE
478: begin
483: Exception
484: when no_data_found then
485: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
486: fnd_message.set_token('ATTRIBUTE','REGION_ID');
487: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
488: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
489: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
490:
491: End;
508: IF p_Item_Orderability_Import_Rec.order_type_id IS NULL THEN
509: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
510: fnd_message.set_token('FIELD','Rule Level Value');
511: fnd_message.set_token('CRITERIA','ORDER_TYPE_ID');
512: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
513: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
514: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
515: ELSE
516: begin
521: Exception
522: when no_data_found then
523: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
524: fnd_message.set_token('ATTRIBUTE','ORDER_TYPE_ID');
525: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
526: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
527: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
528: End;
529: END IF;
547: IF p_Item_Orderability_Import_Rec.SHIP_TO_LOCATION_ID IS NULL THEN
548: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
549: fnd_message.set_token('FIELD','Rule Level Value');
550: fnd_message.set_token('CRITERIA','SHIP_TO_LOCATION_ID');
551: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
552: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
553: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
554: ELSE
555: begin
561: Exception
562: when no_data_found then
563: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
564: fnd_message.set_token('ATTRIBUTE','SHIP_TO_LOCATION_ID');
565: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
566: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
567: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
568: End;
569: END IF;
586: IF p_Item_Orderability_Import_Rec.SALES_CHANNEL_CODE IS NULL THEN
587: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
588: fnd_message.set_token('FIELD','Rule Level Value');
589: fnd_message.set_token('CRITERIA','SALES_CHANNEL_CODE');
590: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
591: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
592: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
593: ELSE
594: begin
600: Exception
601: when no_data_found then
602: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
603: fnd_message.set_token('ATTRIBUTE','SALES_CHANNEL_CODE');
604: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
605: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
606: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
607: End;
608: END IF;
626: IF p_Item_Orderability_Import_Rec.SALES_PERSON_ID IS NULL THEN
627: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
628: fnd_message.set_token('FIELD','Rule Level Value');
629: fnd_message.set_token('CRITERIA','SALES_PERSON_ID');
630: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
631: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
632: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
633: ELSE
634:
641: Exception
642: when no_data_found then
643: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
644: fnd_message.set_token('ATTRIBUTE','SALES_PERSON_ID');
645: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
646: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
647: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
648: End;
649:
666: IF p_Item_Orderability_Import_Rec.end_customer_id IS NULL THEN
667: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
668: fnd_message.set_token('FIELD','Rule Level Value');
669: fnd_message.set_token('CRITERIA','END_CUSTOMER_ID');
670: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
671: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
672: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
673: ELSE
674:
682: Exception
683: when no_data_found then
684: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
685: fnd_message.set_token('ATTRIBUTE','END_CUSTOMER_ID');
686: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
687: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
688: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
689: End;
690:
708: IF p_Item_Orderability_Import_Rec.BILL_TO_LOCATION_ID IS NULL THEN
709: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
710: fnd_message.set_token('FIELD','Rule Level Value');
711: fnd_message.set_token('CRITERIA','BILL_TO_LOCATION_ID');
712: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
713: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
714: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
715: ELSE
716: begin
722: Exception
723: when no_data_found then
724: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
725: fnd_message.set_token('ATTRIBUTE','BILL_TO_LOCATION_ID');
726: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
727: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
728: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
729:
730: End;
749: IF p_Item_Orderability_Import_Rec.DELIVER_TO_LOCATION_ID IS NULL THEN
750: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
751: fnd_message.set_token('FIELD','Rule Level Value');
752: fnd_message.set_token('CRITERIA','DELIVER_TO_LOCATION_ID');
753: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
754: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
755: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
756: ELSE
757:
764: Exception
765: when no_data_found then
766: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
767: fnd_message.set_token('ATTRIBUTE','DELIVER_TO_LOCATION_ID');
768: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
769: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
770: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
771:
772: End;
792:
793: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
794: fnd_message.set_token('FIELD','Inventory Item');
795: fnd_message.set_token('CRITERIA','Item');
796: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
797: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
798: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
799:
800: ELSE
806: Exception
807: when no_data_found then
808: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
809: fnd_message.set_token('ATTRIBUTE','INVENTORY_ITEM_ID');
810: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
811: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
812: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
813:
814: End;
822: If p_Item_Orderability_Import_Rec.item_category_id IS NULL then
823: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
824: fnd_message.set_token('FIELD','Item Category');
825: fnd_message.set_token('CRITERIA','Category');
826: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
827: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
828: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
829:
830: Else
835: Exception
836: when others then
837: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
838: fnd_message.set_token('ATTRIBUTE','ITEM_CATEGORY_ID');
839: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
840: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
841: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
842:
843: End ;
852: End If;
853:
854: Exception
855: when others then
856: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_UNEXP_ERROR;
857: p_Item_Orderability_Import_Rec.msg_data := SQLERRM;
858: p_Item_Orderability_Import_Rec.msg_count := 1;
859: End Validate_conditional_fields;
860:
874: IF l_debug_level > 0 then
875: oe_debug_pub.add('Entering OE_ITORD_PUB.check_duplicate_rules');
876: End If;
877:
878: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_SUCCESS;
879: p_Item_Orderability_Import_Rec.msg_data := NULL;
880: p_Item_Orderability_Import_Rec.msg_count := 0;
881:
882: IF p_Item_Orderability_Import_Rec.item_level = 'I' then
901: AND rownum = 1;
902:
903: fnd_message.set_name('ONT','OE_ITORD_RULE_EXISTS');
904: fnd_message.SET_TOKEN('CRITERIA','Item Category');
905: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
906: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
907: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
908: Exception
909: when no_data_found then
937: THEN
938: fnd_message.set_name('ONT','OE_ITORD_DUP_RULE_EXISTS');
939: fnd_message.set_token('RULE_LEVEL',l_rule_level_coulmn);
940: fnd_message.set_token('RULE_LEVEL_VALUE',l_rule_level_value);
941: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
942: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
943: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
944: END IF;
945: END IF; -- Added for bug 10055559
966: AND rownum = 1;
967:
968: fnd_message.set_name('ONT','OE_ITORD_RULE_EXISTS');
969: fnd_message.SET_TOKEN('CRITERIA','Item');
970: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
971: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
972: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
973: Exception
974: when no_data_found then
1002: THEN
1003: fnd_message.set_name('ONT','OE_ITORD_DUP_RULE_EXISTS');
1004: fnd_message.set_token('RULE_LEVEL',l_rule_level_coulmn);
1005: fnd_message.set_token('RULE_LEVEL_VALUE',l_rule_level_value);
1006: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
1007: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
1008: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
1009: END IF;
1010:
1017: End If;
1018:
1019: Exception
1020: when others then
1021: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_UNEXP_ERROR;
1022: p_Item_Orderability_Import_Rec.msg_data := SQLERRM;
1023: p_Item_Orderability_Import_Rec.msg_count := 1;
1024: End check_duplicate_rules;
1025:
1102: IF l_debug_level > 0 then
1103: oe_debug_pub.add('Entering OE_ITORD_PUB.insert_rules');
1104: End If;
1105:
1106: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_SUCCESS;
1107: p_Item_Orderability_Import_Rec.msg_data := NULL;
1108: p_Item_Orderability_Import_Rec.msg_count := 0;
1109:
1110:
1196:
1197: select orderability_id into l_orderability_id
1198: from oe_item_orderability_rules where rowid = l_rowid ;
1199:
1200: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_SUCCESS;
1201: p_Item_Orderability_Import_Rec.msg_data := 'Rule Created Successfully .Orderability_id ='||l_orderability_id;
1202: p_Item_Orderability_Import_Rec.msg_count := 1;
1203:
1204: End If;
1209: End If;
1210:
1211: Exception
1212: when others then
1213: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_UNEXP_ERROR;
1214: p_Item_Orderability_Import_Rec.msg_data := SQLERRM;
1215: p_Item_Orderability_Import_Rec.msg_count := 1;
1216:
1217:
1298: IF FND_FLEX_DESCVAL.Validate_Desccols( appl_short_name => 'ONT' ,
1299: desc_flex_name =>'OE_ITORD_ATTRIBUTES'
1300: )
1301: THEN
1302: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_SUCCESS;
1303: p_Item_Orderability_Import_Rec.msg_data := 'VALID';
1304: p_Item_Orderability_Import_Rec.msg_count := 1;
1305: ELSE
1306: FND_MESSAGE.Set_Encoded(FND_FLEX_DESCVAL.Encoded_Error_Message);
1303: p_Item_Orderability_Import_Rec.msg_data := 'VALID';
1304: p_Item_Orderability_Import_Rec.msg_count := 1;
1305: ELSE
1306: FND_MESSAGE.Set_Encoded(FND_FLEX_DESCVAL.Encoded_Error_Message);
1307: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
1308: p_Item_Orderability_Import_Rec.msg_data := fnd_message.get;
1309: p_Item_Orderability_Import_Rec.msg_count := 1;
1310: END IF;
1311:
1318:
1319: EXCEPTION
1320:
1321: WHEN OTHERS THEN
1322: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_UNEXP_ERROR;
1323: P_Item_Orderability_Import_Rec.msg_data := SQLERRM;
1324: p_Item_Orderability_Import_Rec.msg_count := 1;
1325:
1326: END Validate_rules_DFF;