73: p_Item_Orderability_Import_Rec.msg_count := 0;
74:
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;
74:
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;
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:
84: IF p_Item_Orderability_Import_Rec.ITEM_LEVEL is NULL then
81: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
82: END IF;
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;
82: END IF;
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;
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:
92: IF p_Item_Orderability_Import_Rec.generally_available is NULL then
89: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
90: END IF;
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;
90: END IF;
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;
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:
100: IF p_Item_Orderability_Import_Rec.rule_level is NULL then
97: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
98: END IF;
99:
100: IF p_Item_Orderability_Import_Rec.rule_level is NULL then
101: fnd_message.set_name('ONT','OE_ATTRIBUTE_REQUIRED');
102: fnd_message.set_token('ATTRIBUTE','RULE_LEVEL');
103: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
104: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
105: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
98: END IF;
99:
100: IF p_Item_Orderability_Import_Rec.rule_level is NULL then
101: fnd_message.set_name('ONT','OE_ATTRIBUTE_REQUIRED');
102: fnd_message.set_token('ATTRIBUTE','RULE_LEVEL');
103: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
104: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
105: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
106: END IF;
100: IF p_Item_Orderability_Import_Rec.rule_level is NULL then
101: fnd_message.set_name('ONT','OE_ATTRIBUTE_REQUIRED');
102: fnd_message.set_token('ATTRIBUTE','RULE_LEVEL');
103: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
104: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
105: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
106: END IF;
107:
108:
106: END IF;
107:
108:
109: IF p_Item_Orderability_Import_Rec.created_by is NULL then
110: fnd_message.set_name('ONT','OE_ATTRIBUTE_REQUIRED');
111: fnd_message.set_token('ATTRIBUTE','CREATED_BY');
112: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
113: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
114: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
107:
108:
109: IF p_Item_Orderability_Import_Rec.created_by is NULL then
110: fnd_message.set_name('ONT','OE_ATTRIBUTE_REQUIRED');
111: fnd_message.set_token('ATTRIBUTE','CREATED_BY');
112: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
113: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
114: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
115: END IF;
109: IF p_Item_Orderability_Import_Rec.created_by is NULL then
110: fnd_message.set_name('ONT','OE_ATTRIBUTE_REQUIRED');
111: fnd_message.set_token('ATTRIBUTE','CREATED_BY');
112: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
113: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
114: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
115: END IF;
116:
117: IF p_Item_Orderability_Import_Rec.creation_date is NULL then
114: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
115: END IF;
116:
117: IF p_Item_Orderability_Import_Rec.creation_date is NULL then
118: fnd_message.set_name('ONT','OE_ATTRIBUTE_REQUIRED');
119: fnd_message.set_token('ATTRIBUTE','CREATION_DATE');
120: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
121: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
122: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
115: END IF;
116:
117: IF p_Item_Orderability_Import_Rec.creation_date is NULL then
118: fnd_message.set_name('ONT','OE_ATTRIBUTE_REQUIRED');
119: fnd_message.set_token('ATTRIBUTE','CREATION_DATE');
120: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
121: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
122: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
123:
117: IF p_Item_Orderability_Import_Rec.creation_date is NULL then
118: fnd_message.set_name('ONT','OE_ATTRIBUTE_REQUIRED');
119: fnd_message.set_token('ATTRIBUTE','CREATION_DATE');
120: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
121: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
122: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
123:
124: END IF;
125:
123:
124: END IF;
125:
126: IF p_Item_Orderability_Import_Rec.last_updated_by is NULL then
127: fnd_message.set_name('ONT','OE_ATTRIBUTE_REQUIRED');
128: fnd_message.set_token('ATTRIBUTE','LAST_UPDATED_BY');
129: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
130: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
131: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
124: END IF;
125:
126: IF p_Item_Orderability_Import_Rec.last_updated_by is NULL then
127: fnd_message.set_name('ONT','OE_ATTRIBUTE_REQUIRED');
128: fnd_message.set_token('ATTRIBUTE','LAST_UPDATED_BY');
129: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
130: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
131: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
132: END IF;
126: IF p_Item_Orderability_Import_Rec.last_updated_by is NULL then
127: fnd_message.set_name('ONT','OE_ATTRIBUTE_REQUIRED');
128: fnd_message.set_token('ATTRIBUTE','LAST_UPDATED_BY');
129: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
130: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
131: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
132: END IF;
133:
134: IF p_Item_Orderability_Import_Rec.last_update_date is NULL then
131: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
132: END IF;
133:
134: IF p_Item_Orderability_Import_Rec.last_update_date is NULL then
135: fnd_message.set_name('ONT','OE_ATTRIBUTE_REQUIRED');
136: fnd_message.set_token('ATTRIBUTE','LAST_UPDATE_DATE');
137: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
138: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
139: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
132: END IF;
133:
134: IF p_Item_Orderability_Import_Rec.last_update_date is NULL then
135: fnd_message.set_name('ONT','OE_ATTRIBUTE_REQUIRED');
136: fnd_message.set_token('ATTRIBUTE','LAST_UPDATE_DATE');
137: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
138: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
139: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
140: END IF;
134: IF p_Item_Orderability_Import_Rec.last_update_date is NULL then
135: fnd_message.set_name('ONT','OE_ATTRIBUTE_REQUIRED');
136: fnd_message.set_token('ATTRIBUTE','LAST_UPDATE_DATE');
137: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
138: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
139: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
140: END IF;
141:
142:
172: where organization_id = p_Item_Orderability_Import_Rec.org_id
173: and rownum = 1;
174: Exception
175: when no_data_found then
176: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
177: fnd_message.set_token('ATTRIBUTE','ORG_ID');
178: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
179: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
180: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
173: and rownum = 1;
174: Exception
175: when no_data_found then
176: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
177: fnd_message.set_token('ATTRIBUTE','ORG_ID');
178: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
179: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
180: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
181: End;
175: when no_data_found then
176: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
177: fnd_message.set_token('ATTRIBUTE','ORG_ID');
178: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
179: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
180: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
181: End;
182: END IF;
183:
183:
184: IF p_Item_Orderability_Import_Rec.ITEM_LEVEL is NOT NULL then
185:
186: IF p_Item_Orderability_Import_Rec.ITEM_LEVEL NOT IN ('I','C') then
187: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
188: fnd_message.set_token('ATTRIBUTE','ITEM_LEVEL');
189: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
190: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
191: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
184: IF p_Item_Orderability_Import_Rec.ITEM_LEVEL is NOT NULL then
185:
186: IF p_Item_Orderability_Import_Rec.ITEM_LEVEL NOT IN ('I','C') then
187: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
188: fnd_message.set_token('ATTRIBUTE','ITEM_LEVEL');
189: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
190: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
191: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
192: END IF;
186: IF p_Item_Orderability_Import_Rec.ITEM_LEVEL NOT IN ('I','C') then
187: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
188: fnd_message.set_token('ATTRIBUTE','ITEM_LEVEL');
189: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
190: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
191: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
192: END IF;
193:
194: END IF;
208: 'BILL_TO_LOC',
209: 'DELIVER_TO_LOC'
210:
211: ) then
212: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
213: fnd_message.set_token('ATTRIBUTE','RULE_LEVEL');
214: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
215: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
216: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
209: 'DELIVER_TO_LOC'
210:
211: ) then
212: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
213: fnd_message.set_token('ATTRIBUTE','RULE_LEVEL');
214: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
215: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
216: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
217:
211: ) then
212: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
213: fnd_message.set_token('ATTRIBUTE','RULE_LEVEL');
214: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
215: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
216: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
217:
218: END IF;
219:
222:
223:
224: IF p_Item_Orderability_Import_Rec.generally_available is NOT NULL then
225: IF p_Item_Orderability_Import_Rec.generally_available NOT IN ('Y' ,'N' ) then
226: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
227: fnd_message.set_token('ATTRIBUTE','GENERALLY_AVAILABLE');
228: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
229: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
230: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
223:
224: IF p_Item_Orderability_Import_Rec.generally_available is NOT NULL then
225: IF p_Item_Orderability_Import_Rec.generally_available NOT IN ('Y' ,'N' ) then
226: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
227: fnd_message.set_token('ATTRIBUTE','GENERALLY_AVAILABLE');
228: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
229: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
230: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
231:
225: IF p_Item_Orderability_Import_Rec.generally_available NOT IN ('Y' ,'N' ) then
226: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
227: fnd_message.set_token('ATTRIBUTE','GENERALLY_AVAILABLE');
228: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
229: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
230: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
231:
232: END IF;
233: END IF;
241: and end_date is NULL;
242:
243: Exception
244: when others then
245: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
246: fnd_message.set_token('ATTRIBUTE','CREATED_BY');
247: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
248: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
249: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
242:
243: Exception
244: when others then
245: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
246: fnd_message.set_token('ATTRIBUTE','CREATED_BY');
247: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
248: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
249: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
250:
244: when others then
245: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
246: fnd_message.set_token('ATTRIBUTE','CREATED_BY');
247: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
248: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
249: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
250:
251: End;
252:
259: and end_date is NULL;
260:
261: Exception
262: when others then
263: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
264: fnd_message.set_token('ATTRIBUTE','LAST_UPDATED_BY');
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;
260:
261: Exception
262: when others then
263: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
264: fnd_message.set_token('ATTRIBUTE','LAST_UPDATED_BY');
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:
262: when others then
263: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
264: fnd_message.set_token('ATTRIBUTE','LAST_UPDATED_BY');
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;
270: END IF;
300:
301: IF p_Item_Orderability_Import_Rec.RULE_LEVEL = 'CUSTOMER' THEN
302:
303: IF p_Item_Orderability_Import_Rec.customer_id IS NULL then
304: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
305: fnd_message.set_token('FIELD','Rule Level Value');
306: fnd_message.set_token('CRITERIA','CUSTOMER_ID');
307: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
308: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
301: IF p_Item_Orderability_Import_Rec.RULE_LEVEL = 'CUSTOMER' THEN
302:
303: IF p_Item_Orderability_Import_Rec.customer_id IS NULL then
304: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
305: fnd_message.set_token('FIELD','Rule Level Value');
306: fnd_message.set_token('CRITERIA','CUSTOMER_ID');
307: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
308: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
309: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
302:
303: IF p_Item_Orderability_Import_Rec.customer_id IS NULL then
304: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
305: fnd_message.set_token('FIELD','Rule Level Value');
306: fnd_message.set_token('CRITERIA','CUSTOMER_ID');
307: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
308: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
309: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
310:
304: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
305: fnd_message.set_token('FIELD','Rule Level Value');
306: fnd_message.set_token('CRITERIA','CUSTOMER_ID');
307: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
308: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
309: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
310:
311: ELSE
312: begin
318: AND acct.status = 'A'
319: AND acct.cust_account_id = p_Item_Orderability_Import_Rec.customer_id ;
320: Exception
321: when no_data_found then
322: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
323: fnd_message.set_token('ATTRIBUTE','CUSTOMER_ID');
324: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
325: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
326: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
319: AND acct.cust_account_id = p_Item_Orderability_Import_Rec.customer_id ;
320: Exception
321: when no_data_found then
322: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
323: fnd_message.set_token('ATTRIBUTE','CUSTOMER_ID');
324: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
325: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
326: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
327:
321: when no_data_found then
322: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
323: fnd_message.set_token('ATTRIBUTE','CUSTOMER_ID');
324: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
325: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
326: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
327:
328: End;
329: END IF;
345:
346: IF p_Item_Orderability_Import_Rec.RULE_LEVEL = 'CUSTOMER_CLASS' THEN
347:
348: IF p_Item_Orderability_Import_Rec.CUSTOMER_CLASS_ID IS NULL then
349: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
350: fnd_message.set_token('FIELD','Rule Level Value');
351: fnd_message.set_token('CRITERIA','CUSTOMER_CLASS_ID');
352: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
353: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
346: IF p_Item_Orderability_Import_Rec.RULE_LEVEL = 'CUSTOMER_CLASS' THEN
347:
348: IF p_Item_Orderability_Import_Rec.CUSTOMER_CLASS_ID IS NULL then
349: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
350: fnd_message.set_token('FIELD','Rule Level Value');
351: fnd_message.set_token('CRITERIA','CUSTOMER_CLASS_ID');
352: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
353: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
354: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
347:
348: IF p_Item_Orderability_Import_Rec.CUSTOMER_CLASS_ID IS NULL then
349: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
350: fnd_message.set_token('FIELD','Rule Level Value');
351: fnd_message.set_token('CRITERIA','CUSTOMER_CLASS_ID');
352: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
353: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
354: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
355:
349: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
350: fnd_message.set_token('FIELD','Rule Level Value');
351: fnd_message.set_token('CRITERIA','CUSTOMER_CLASS_ID');
352: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
353: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
354: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
355:
356: ELSE
357: begin
360: FROM hz_cust_profile_classes cpc
361: WHERE profile_class_id = p_Item_Orderability_Import_Rec.customer_class_id ;
362: Exception
363: when no_data_found then
364: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
365: fnd_message.set_token('ATTRIBUTE','CUSTOMER_CLASS_ID');
366: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
367: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
368: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
361: WHERE profile_class_id = p_Item_Orderability_Import_Rec.customer_class_id ;
362: Exception
363: when no_data_found then
364: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
365: fnd_message.set_token('ATTRIBUTE','CUSTOMER_CLASS_ID');
366: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
367: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
368: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
369:
363: when no_data_found then
364: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
365: fnd_message.set_token('ATTRIBUTE','CUSTOMER_CLASS_ID');
366: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
367: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
368: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
369:
370: End;
371: END IF;
389: IF p_Item_Orderability_Import_Rec.RULE_LEVEL ='CUST_CATEGORY' then
390:
391: IF p_Item_Orderability_Import_Rec.customer_category_code IS NULL THEN
392:
393: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
394: fnd_message.set_token('FIELD','Rule Level Value');
395: fnd_message.set_token('CRITERIA','CUSTOMER_CATEGORY_CODE');
396: P_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
397: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
390:
391: IF p_Item_Orderability_Import_Rec.customer_category_code IS NULL THEN
392:
393: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
394: fnd_message.set_token('FIELD','Rule Level Value');
395: fnd_message.set_token('CRITERIA','CUSTOMER_CATEGORY_CODE');
396: P_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
397: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
398: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
391: IF p_Item_Orderability_Import_Rec.customer_category_code IS NULL THEN
392:
393: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
394: fnd_message.set_token('FIELD','Rule Level Value');
395: fnd_message.set_token('CRITERIA','CUSTOMER_CATEGORY_CODE');
396: P_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
397: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
398: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
399:
393: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
394: fnd_message.set_token('FIELD','Rule Level Value');
395: fnd_message.set_token('CRITERIA','CUSTOMER_CATEGORY_CODE');
396: P_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
397: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
398: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
399:
400:
401: ELSE
406: WHERE lookup_type = 'CUSTOMER_CATEGORY'
407: AND lookup_code = p_Item_Orderability_Import_Rec.customer_category_code ;
408: Exception
409: when no_data_found then
410: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
411: fnd_message.set_token('ATTRIBUTE','CUSTOMER_CATEGORY_CODE');
412: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
413: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
414: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
407: AND lookup_code = p_Item_Orderability_Import_Rec.customer_category_code ;
408: Exception
409: when no_data_found then
410: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
411: fnd_message.set_token('ATTRIBUTE','CUSTOMER_CATEGORY_CODE');
412: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
413: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
414: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
415:
409: when no_data_found then
410: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
411: fnd_message.set_token('ATTRIBUTE','CUSTOMER_CATEGORY_CODE');
412: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
413: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
414: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
415:
416: End;
417:
430:
431: IF p_Item_Orderability_Import_Rec.RULE_LEVEL ='REGIONS' then
432:
433: IF p_Item_Orderability_Import_Rec.region_id IS NULL THEN
434: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
435: fnd_message.set_token('FIELD','Rule Level Value');
436: fnd_message.set_token('CRITERIA','REGION_ID');
437: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
438: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
431: IF p_Item_Orderability_Import_Rec.RULE_LEVEL ='REGIONS' then
432:
433: IF p_Item_Orderability_Import_Rec.region_id IS NULL THEN
434: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
435: fnd_message.set_token('FIELD','Rule Level Value');
436: fnd_message.set_token('CRITERIA','REGION_ID');
437: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
438: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
439: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
432:
433: IF p_Item_Orderability_Import_Rec.region_id IS NULL THEN
434: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
435: fnd_message.set_token('FIELD','Rule Level Value');
436: fnd_message.set_token('CRITERIA','REGION_ID');
437: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
438: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
439: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
440: ELSE
434: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
435: fnd_message.set_token('FIELD','Rule Level Value');
436: fnd_message.set_token('CRITERIA','REGION_ID');
437: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
438: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
439: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
440: ELSE
441: begin
442: SELECT 'Y'
444: FROM wsh_regions_v
445: WHERE region_id = p_Item_Orderability_Import_Rec.region_id;
446: Exception
447: when no_data_found then
448: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
449: fnd_message.set_token('ATTRIBUTE','REGION_ID');
450: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
451: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
452: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
445: WHERE region_id = p_Item_Orderability_Import_Rec.region_id;
446: Exception
447: when no_data_found then
448: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
449: fnd_message.set_token('ATTRIBUTE','REGION_ID');
450: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
451: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
452: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
453:
447: when no_data_found then
448: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
449: fnd_message.set_token('ATTRIBUTE','REGION_ID');
450: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
451: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
452: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
453:
454: End;
455: END IF;
468:
469: IF p_Item_Orderability_Import_Rec.RULE_LEVEL ='ORDER_TYPE' then
470:
471: IF p_Item_Orderability_Import_Rec.order_type_id IS NULL THEN
472: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
473: fnd_message.set_token('FIELD','Rule Level Value');
474: fnd_message.set_token('CRITERIA','ORDER_TYPE_ID');
475: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
476: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
469: IF p_Item_Orderability_Import_Rec.RULE_LEVEL ='ORDER_TYPE' then
470:
471: IF p_Item_Orderability_Import_Rec.order_type_id IS NULL THEN
472: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
473: fnd_message.set_token('FIELD','Rule Level Value');
474: fnd_message.set_token('CRITERIA','ORDER_TYPE_ID');
475: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
476: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
477: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
470:
471: IF p_Item_Orderability_Import_Rec.order_type_id IS NULL THEN
472: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
473: fnd_message.set_token('FIELD','Rule Level Value');
474: fnd_message.set_token('CRITERIA','ORDER_TYPE_ID');
475: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
476: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
477: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
478: ELSE
472: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
473: fnd_message.set_token('FIELD','Rule Level Value');
474: fnd_message.set_token('CRITERIA','ORDER_TYPE_ID');
475: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
476: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
477: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
478: ELSE
479: begin
480: SELECT 'Y'
482: FROM oe_order_types_v
483: WHERE order_type_id = p_Item_Orderability_Import_Rec.order_type_id ;
484: Exception
485: when no_data_found then
486: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
487: fnd_message.set_token('ATTRIBUTE','ORDER_TYPE_ID');
488: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
489: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
490: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
483: WHERE order_type_id = p_Item_Orderability_Import_Rec.order_type_id ;
484: Exception
485: when no_data_found then
486: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
487: fnd_message.set_token('ATTRIBUTE','ORDER_TYPE_ID');
488: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
489: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
490: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
491: End;
485: when no_data_found then
486: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
487: fnd_message.set_token('ATTRIBUTE','ORDER_TYPE_ID');
488: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
489: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
490: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
491: End;
492: END IF;
493:
507: IF p_Item_Orderability_Import_Rec.RULE_LEVEL ='SHIP_TO_LOC' then
508:
509:
510: IF p_Item_Orderability_Import_Rec.SHIP_TO_LOCATION_ID IS NULL THEN
511: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
512: fnd_message.set_token('FIELD','Rule Level Value');
513: fnd_message.set_token('CRITERIA','SHIP_TO_LOCATION_ID');
514: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
515: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
508:
509:
510: IF p_Item_Orderability_Import_Rec.SHIP_TO_LOCATION_ID IS NULL THEN
511: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
512: fnd_message.set_token('FIELD','Rule Level Value');
513: fnd_message.set_token('CRITERIA','SHIP_TO_LOCATION_ID');
514: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
515: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
516: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
509:
510: IF p_Item_Orderability_Import_Rec.SHIP_TO_LOCATION_ID IS NULL THEN
511: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
512: fnd_message.set_token('FIELD','Rule Level Value');
513: fnd_message.set_token('CRITERIA','SHIP_TO_LOCATION_ID');
514: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
515: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
516: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
517: ELSE
511: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
512: fnd_message.set_token('FIELD','Rule Level Value');
513: fnd_message.set_token('CRITERIA','SHIP_TO_LOCATION_ID');
514: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
515: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
516: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
517: ELSE
518: begin
519: SELECT 'Y'
522: WHERE site.site_use_code = 'SHIP_TO'
523: AND site.site_use_id= p_Item_Orderability_Import_Rec.SHIP_TO_LOCATION_ID;
524: Exception
525: when no_data_found then
526: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
527: fnd_message.set_token('ATTRIBUTE','SHIP_TO_LOCATION_ID');
528: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
529: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
530: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
523: AND site.site_use_id= p_Item_Orderability_Import_Rec.SHIP_TO_LOCATION_ID;
524: Exception
525: when no_data_found then
526: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
527: fnd_message.set_token('ATTRIBUTE','SHIP_TO_LOCATION_ID');
528: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
529: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
530: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
531: End;
525: when no_data_found then
526: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
527: fnd_message.set_token('ATTRIBUTE','SHIP_TO_LOCATION_ID');
528: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
529: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
530: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
531: End;
532: END IF;
533:
546:
547: IF p_Item_Orderability_Import_Rec.RULE_LEVEL ='SALES_CHANNEL' then
548:
549: IF p_Item_Orderability_Import_Rec.SALES_CHANNEL_CODE IS NULL THEN
550: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
551: fnd_message.set_token('FIELD','Rule Level Value');
552: fnd_message.set_token('CRITERIA','SALES_CHANNEL_CODE');
553: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
554: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
547: IF p_Item_Orderability_Import_Rec.RULE_LEVEL ='SALES_CHANNEL' then
548:
549: IF p_Item_Orderability_Import_Rec.SALES_CHANNEL_CODE IS NULL THEN
550: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
551: fnd_message.set_token('FIELD','Rule Level Value');
552: fnd_message.set_token('CRITERIA','SALES_CHANNEL_CODE');
553: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
554: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
555: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
548:
549: IF p_Item_Orderability_Import_Rec.SALES_CHANNEL_CODE IS NULL THEN
550: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
551: fnd_message.set_token('FIELD','Rule Level Value');
552: fnd_message.set_token('CRITERIA','SALES_CHANNEL_CODE');
553: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
554: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
555: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
556: ELSE
550: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
551: fnd_message.set_token('FIELD','Rule Level Value');
552: fnd_message.set_token('CRITERIA','SALES_CHANNEL_CODE');
553: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
554: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
555: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
556: ELSE
557: begin
558: SELECT 'Y'
561: WHERE lookup_type = 'SALES_CHANNEL'
562: AND lookup_code =p_Item_Orderability_Import_Rec.sales_channel_code;
563: Exception
564: when no_data_found then
565: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
566: fnd_message.set_token('ATTRIBUTE','SALES_CHANNEL_CODE');
567: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
568: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
569: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
562: AND lookup_code =p_Item_Orderability_Import_Rec.sales_channel_code;
563: Exception
564: when no_data_found then
565: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
566: fnd_message.set_token('ATTRIBUTE','SALES_CHANNEL_CODE');
567: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
568: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
569: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
570: End;
564: when no_data_found then
565: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
566: fnd_message.set_token('ATTRIBUTE','SALES_CHANNEL_CODE');
567: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
568: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
569: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
570: End;
571: END IF;
572:
586: --check
587: IF p_Item_Orderability_Import_Rec.RULE_LEVEL ='SALES_REP' then
588:
589: IF p_Item_Orderability_Import_Rec.SALES_PERSON_ID IS NULL THEN
590: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
591: fnd_message.set_token('FIELD','Rule Level Value');
592: fnd_message.set_token('CRITERIA','SALES_PERSON_ID');
593: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
594: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
587: IF p_Item_Orderability_Import_Rec.RULE_LEVEL ='SALES_REP' then
588:
589: IF p_Item_Orderability_Import_Rec.SALES_PERSON_ID IS NULL THEN
590: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
591: fnd_message.set_token('FIELD','Rule Level Value');
592: fnd_message.set_token('CRITERIA','SALES_PERSON_ID');
593: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
594: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
595: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
588:
589: IF p_Item_Orderability_Import_Rec.SALES_PERSON_ID IS NULL THEN
590: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
591: fnd_message.set_token('FIELD','Rule Level Value');
592: fnd_message.set_token('CRITERIA','SALES_PERSON_ID');
593: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
594: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
595: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
596: ELSE
590: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
591: fnd_message.set_token('FIELD','Rule Level Value');
592: fnd_message.set_token('CRITERIA','SALES_PERSON_ID');
593: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
594: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
595: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
596: ELSE
597:
598: begin
602: WHERE salesrep_id = p_Item_Orderability_Import_Rec.SALES_PERSON_ID;
603:
604: Exception
605: when no_data_found then
606: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
607: fnd_message.set_token('ATTRIBUTE','SALES_PERSON_ID');
608: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
609: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
610: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
603:
604: Exception
605: when no_data_found then
606: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
607: fnd_message.set_token('ATTRIBUTE','SALES_PERSON_ID');
608: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
609: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
610: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
611: End;
605: when no_data_found then
606: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
607: fnd_message.set_token('ATTRIBUTE','SALES_PERSON_ID');
608: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
609: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
610: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
611: End;
612:
613: END IF;
626:
627: IF p_Item_Orderability_Import_Rec.RULE_LEVEL = 'END_CUST' then
628:
629: IF p_Item_Orderability_Import_Rec.end_customer_id IS NULL THEN
630: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
631: fnd_message.set_token('FIELD','Rule Level Value');
632: fnd_message.set_token('CRITERIA','END_CUSTOMER_ID');
633: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
634: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
627: IF p_Item_Orderability_Import_Rec.RULE_LEVEL = 'END_CUST' then
628:
629: IF p_Item_Orderability_Import_Rec.end_customer_id IS NULL THEN
630: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
631: fnd_message.set_token('FIELD','Rule Level Value');
632: fnd_message.set_token('CRITERIA','END_CUSTOMER_ID');
633: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
634: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
635: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
628:
629: IF p_Item_Orderability_Import_Rec.end_customer_id IS NULL THEN
630: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
631: fnd_message.set_token('FIELD','Rule Level Value');
632: fnd_message.set_token('CRITERIA','END_CUSTOMER_ID');
633: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
634: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
635: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
636: ELSE
630: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
631: fnd_message.set_token('FIELD','Rule Level Value');
632: fnd_message.set_token('CRITERIA','END_CUSTOMER_ID');
633: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
634: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
635: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
636: ELSE
637:
638: begin
643: WHERE acct.party_id = party.party_id
644: AND acct.cust_account_id = p_Item_Orderability_Import_Rec.end_customer_id ;
645: Exception
646: when no_data_found then
647: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
648: fnd_message.set_token('ATTRIBUTE','END_CUSTOMER_ID');
649: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
650: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
651: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
644: AND acct.cust_account_id = p_Item_Orderability_Import_Rec.end_customer_id ;
645: Exception
646: when no_data_found then
647: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
648: fnd_message.set_token('ATTRIBUTE','END_CUSTOMER_ID');
649: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
650: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
651: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
652: End;
646: when no_data_found then
647: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
648: fnd_message.set_token('ATTRIBUTE','END_CUSTOMER_ID');
649: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
650: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
651: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
652: End;
653:
654: END IF;
668:
669: IF p_Item_Orderability_Import_Rec.RULE_LEVEL = 'BILL_TO_LOC' then
670:
671: IF p_Item_Orderability_Import_Rec.BILL_TO_LOCATION_ID IS NULL THEN
672: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
673: fnd_message.set_token('FIELD','Rule Level Value');
674: fnd_message.set_token('CRITERIA','BILL_TO_LOCATION_ID');
675: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
676: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
669: IF p_Item_Orderability_Import_Rec.RULE_LEVEL = 'BILL_TO_LOC' then
670:
671: IF p_Item_Orderability_Import_Rec.BILL_TO_LOCATION_ID IS NULL THEN
672: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
673: fnd_message.set_token('FIELD','Rule Level Value');
674: fnd_message.set_token('CRITERIA','BILL_TO_LOCATION_ID');
675: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
676: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
677: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
670:
671: IF p_Item_Orderability_Import_Rec.BILL_TO_LOCATION_ID IS NULL THEN
672: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
673: fnd_message.set_token('FIELD','Rule Level Value');
674: fnd_message.set_token('CRITERIA','BILL_TO_LOCATION_ID');
675: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
676: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
677: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
678: ELSE
672: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
673: fnd_message.set_token('FIELD','Rule Level Value');
674: fnd_message.set_token('CRITERIA','BILL_TO_LOCATION_ID');
675: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
676: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
677: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
678: ELSE
679: begin
680: SELECT 'Y'
683: WHERE site.site_use_code = 'BILL_TO'
684: AND site.site_use_id= p_Item_Orderability_Import_Rec.BILL_TO_LOCATION_ID ;
685: Exception
686: when no_data_found then
687: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
688: fnd_message.set_token('ATTRIBUTE','BILL_TO_LOCATION_ID');
689: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
690: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
691: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
684: AND site.site_use_id= p_Item_Orderability_Import_Rec.BILL_TO_LOCATION_ID ;
685: Exception
686: when no_data_found then
687: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
688: fnd_message.set_token('ATTRIBUTE','BILL_TO_LOCATION_ID');
689: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
690: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
691: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
692:
686: when no_data_found then
687: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
688: fnd_message.set_token('ATTRIBUTE','BILL_TO_LOCATION_ID');
689: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
690: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
691: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
692:
693: End;
694:
709:
710: IF p_Item_Orderability_Import_Rec.RULE_LEVEL = 'DELIVER_TO_LOC' then
711:
712: IF p_Item_Orderability_Import_Rec.DELIVER_TO_LOCATION_ID IS NULL THEN
713: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
714: fnd_message.set_token('FIELD','Rule Level Value');
715: fnd_message.set_token('CRITERIA','DELIVER_TO_LOCATION_ID');
716: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
717: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
710: IF p_Item_Orderability_Import_Rec.RULE_LEVEL = 'DELIVER_TO_LOC' then
711:
712: IF p_Item_Orderability_Import_Rec.DELIVER_TO_LOCATION_ID IS NULL THEN
713: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
714: fnd_message.set_token('FIELD','Rule Level Value');
715: fnd_message.set_token('CRITERIA','DELIVER_TO_LOCATION_ID');
716: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
717: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
718: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
711:
712: IF p_Item_Orderability_Import_Rec.DELIVER_TO_LOCATION_ID IS NULL THEN
713: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
714: fnd_message.set_token('FIELD','Rule Level Value');
715: fnd_message.set_token('CRITERIA','DELIVER_TO_LOCATION_ID');
716: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
717: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
718: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
719: ELSE
713: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
714: fnd_message.set_token('FIELD','Rule Level Value');
715: fnd_message.set_token('CRITERIA','DELIVER_TO_LOCATION_ID');
716: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
717: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
718: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
719: ELSE
720:
721: begin
725: WHERE site.site_use_code = 'DELIVER_TO'
726: AND site.site_use_id= p_Item_Orderability_Import_Rec.DELIVER_TO_LOCATION_ID;
727: Exception
728: when no_data_found then
729: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
730: fnd_message.set_token('ATTRIBUTE','DELIVER_TO_LOCATION_ID');
731: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
732: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
733: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
726: AND site.site_use_id= p_Item_Orderability_Import_Rec.DELIVER_TO_LOCATION_ID;
727: Exception
728: when no_data_found then
729: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
730: fnd_message.set_token('ATTRIBUTE','DELIVER_TO_LOCATION_ID');
731: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
732: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
733: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
734:
728: when no_data_found then
729: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
730: fnd_message.set_token('ATTRIBUTE','DELIVER_TO_LOCATION_ID');
731: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
732: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
733: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
734:
735: End;
736: END IF;
752: IF p_Item_Orderability_Import_Rec.Item_level = 'I' then
753:
754: IF p_Item_Orderability_Import_Rec.inventory_item_id IS NULL then
755:
756: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
757: fnd_message.set_token('FIELD','Inventory Item');
758: fnd_message.set_token('CRITERIA','Item');
759: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
760: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
753:
754: IF p_Item_Orderability_Import_Rec.inventory_item_id IS NULL then
755:
756: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
757: fnd_message.set_token('FIELD','Inventory Item');
758: fnd_message.set_token('CRITERIA','Item');
759: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
760: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
761: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
754: IF p_Item_Orderability_Import_Rec.inventory_item_id IS NULL then
755:
756: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
757: fnd_message.set_token('FIELD','Inventory Item');
758: fnd_message.set_token('CRITERIA','Item');
759: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
760: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
761: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
762:
756: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
757: fnd_message.set_token('FIELD','Inventory Item');
758: fnd_message.set_token('CRITERIA','Item');
759: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
760: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
761: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
762:
763: ELSE
764: begin
767: where inventory_item_id = p_Item_Orderability_Import_Rec.inventory_item_id
768: and organization_id = oe_sys_parameters.value('MASTER_ORGANIZATION_ID',p_Item_Orderability_Import_Rec.org_id );
769: Exception
770: when no_data_found then
771: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
772: fnd_message.set_token('ATTRIBUTE','INVENTORY_ITEM_ID');
773: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
774: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
775: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
768: and organization_id = oe_sys_parameters.value('MASTER_ORGANIZATION_ID',p_Item_Orderability_Import_Rec.org_id );
769: Exception
770: when no_data_found then
771: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
772: fnd_message.set_token('ATTRIBUTE','INVENTORY_ITEM_ID');
773: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
774: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
775: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
776:
770: when no_data_found then
771: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
772: fnd_message.set_token('ATTRIBUTE','INVENTORY_ITEM_ID');
773: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
774: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
775: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
776:
777: End;
778:
782:
783: ELSIF p_Item_Orderability_Import_Rec.Item_level = 'C' then
784:
785: If p_Item_Orderability_Import_Rec.item_category_id IS NULL then
786: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
787: fnd_message.set_token('FIELD','Item Category');
788: fnd_message.set_token('CRITERIA','Category');
789: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
790: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
783: ELSIF p_Item_Orderability_Import_Rec.Item_level = 'C' then
784:
785: If p_Item_Orderability_Import_Rec.item_category_id IS NULL then
786: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
787: fnd_message.set_token('FIELD','Item Category');
788: fnd_message.set_token('CRITERIA','Category');
789: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
790: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
791: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
784:
785: If p_Item_Orderability_Import_Rec.item_category_id IS NULL then
786: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
787: fnd_message.set_token('FIELD','Item Category');
788: fnd_message.set_token('CRITERIA','Category');
789: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
790: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
791: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
792:
786: fnd_message.set_name('ONT','OE_ITORD_FIELD_REQUIRED');
787: fnd_message.set_token('FIELD','Item Category');
788: fnd_message.set_token('CRITERIA','Category');
789: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
790: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
791: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
792:
793: Else
794: begin
796: from mtl_categories
797: where category_id = p_Item_Orderability_Import_Rec.item_category_id ;
798: Exception
799: when others then
800: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
801: fnd_message.set_token('ATTRIBUTE','ITEM_CATEGORY_ID');
802: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
803: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
804: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
797: where category_id = p_Item_Orderability_Import_Rec.item_category_id ;
798: Exception
799: when others then
800: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
801: fnd_message.set_token('ATTRIBUTE','ITEM_CATEGORY_ID');
802: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
803: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
804: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
805:
799: when others then
800: fnd_message.set_name('ONT','OE_INVALID_ATTRIBUTE');
801: fnd_message.set_token('ATTRIBUTE','ITEM_CATEGORY_ID');
802: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
803: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
804: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
805:
806: End ;
807:
858: AND ic.category_id = oei.item_category_id
859: and org_id = p_Item_Orderability_Import_Rec.org_id
860: AND rownum = 1;
861:
862: fnd_message.set_name('ONT','OE_ITORD_RULE_EXISTS');
863: fnd_message.SET_TOKEN('CRITERIA','Item Category');
864: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
865: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
866: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
859: and org_id = p_Item_Orderability_Import_Rec.org_id
860: AND rownum = 1;
861:
862: fnd_message.set_name('ONT','OE_ITORD_RULE_EXISTS');
863: fnd_message.SET_TOKEN('CRITERIA','Item Category');
864: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
865: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
866: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
867: Exception
861:
862: fnd_message.set_name('ONT','OE_ITORD_RULE_EXISTS');
863: fnd_message.SET_TOKEN('CRITERIA','Item Category');
864: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
865: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
866: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
867: Exception
868: when no_data_found then
869: NULL;
891:
892:
893: IF NOT OE_ITORD_UTIL.Check_Duplicate_Rules(sql_stmt)
894: THEN
895: fnd_message.set_name('ONT','OE_ITORD_DUP_RULE_EXISTS');
896: fnd_message.set_token('RULE_LEVEL',l_rule_level_coulmn);
897: fnd_message.set_token('RULE_LEVEL_VALUE',l_rule_level_value);
898: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
899: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
892:
893: IF NOT OE_ITORD_UTIL.Check_Duplicate_Rules(sql_stmt)
894: THEN
895: fnd_message.set_name('ONT','OE_ITORD_DUP_RULE_EXISTS');
896: fnd_message.set_token('RULE_LEVEL',l_rule_level_coulmn);
897: fnd_message.set_token('RULE_LEVEL_VALUE',l_rule_level_value);
898: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
899: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
900: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
893: IF NOT OE_ITORD_UTIL.Check_Duplicate_Rules(sql_stmt)
894: THEN
895: fnd_message.set_name('ONT','OE_ITORD_DUP_RULE_EXISTS');
896: fnd_message.set_token('RULE_LEVEL',l_rule_level_coulmn);
897: fnd_message.set_token('RULE_LEVEL_VALUE',l_rule_level_value);
898: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
899: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
900: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
901: END IF;
895: fnd_message.set_name('ONT','OE_ITORD_DUP_RULE_EXISTS');
896: fnd_message.set_token('RULE_LEVEL',l_rule_level_coulmn);
897: fnd_message.set_token('RULE_LEVEL_VALUE',l_rule_level_value);
898: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
899: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
900: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
901: END IF;
902:
903:
920: AND ic.category_id = p_Item_Orderability_Import_Rec.ITEM_CATEGORY_ID
921: and org_id = p_Item_Orderability_Import_Rec.org_id
922: AND rownum = 1;
923:
924: fnd_message.set_name('ONT','OE_ITORD_RULE_EXISTS');
925: fnd_message.SET_TOKEN('CRITERIA','Item');
926: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
927: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
928: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
921: and org_id = p_Item_Orderability_Import_Rec.org_id
922: AND rownum = 1;
923:
924: fnd_message.set_name('ONT','OE_ITORD_RULE_EXISTS');
925: fnd_message.SET_TOKEN('CRITERIA','Item');
926: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
927: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
928: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
929: Exception
923:
924: fnd_message.set_name('ONT','OE_ITORD_RULE_EXISTS');
925: fnd_message.SET_TOKEN('CRITERIA','Item');
926: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
927: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
928: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
929: Exception
930: when no_data_found then
931: NULL;
954:
955:
956: IF NOT OE_ITORD_UTIL.Check_Duplicate_Rules(sql_stmt)
957: THEN
958: fnd_message.set_name('ONT','OE_ITORD_DUP_RULE_EXISTS');
959: fnd_message.set_token('RULE_LEVEL',l_rule_level_coulmn);
960: fnd_message.set_token('RULE_LEVEL_VALUE',l_rule_level_value);
961: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
962: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
955:
956: IF NOT OE_ITORD_UTIL.Check_Duplicate_Rules(sql_stmt)
957: THEN
958: fnd_message.set_name('ONT','OE_ITORD_DUP_RULE_EXISTS');
959: fnd_message.set_token('RULE_LEVEL',l_rule_level_coulmn);
960: fnd_message.set_token('RULE_LEVEL_VALUE',l_rule_level_value);
961: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
962: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
963: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
956: IF NOT OE_ITORD_UTIL.Check_Duplicate_Rules(sql_stmt)
957: THEN
958: fnd_message.set_name('ONT','OE_ITORD_DUP_RULE_EXISTS');
959: fnd_message.set_token('RULE_LEVEL',l_rule_level_coulmn);
960: fnd_message.set_token('RULE_LEVEL_VALUE',l_rule_level_value);
961: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
962: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
963: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
964: END IF;
958: fnd_message.set_name('ONT','OE_ITORD_DUP_RULE_EXISTS');
959: fnd_message.set_token('RULE_LEVEL',l_rule_level_coulmn);
960: fnd_message.set_token('RULE_LEVEL_VALUE',l_rule_level_value);
961: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
962: p_Item_Orderability_Import_Rec.msg_data := p_Item_Orderability_Import_Rec.msg_data ||fnd_global.local_chr(59)||fnd_message.get;
963: p_Item_Orderability_Import_Rec.msg_count := p_Item_Orderability_Import_Rec.msg_count + 1;
964: END IF;
965:
966:
1252: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_SUCCESS;
1253: p_Item_Orderability_Import_Rec.msg_data := 'VALID';
1254: p_Item_Orderability_Import_Rec.msg_count := 1;
1255: ELSE
1256: FND_MESSAGE.Set_Encoded(FND_FLEX_DESCVAL.Encoded_Error_Message);
1257: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
1258: p_Item_Orderability_Import_Rec.msg_data := fnd_message.get;
1259: p_Item_Orderability_Import_Rec.msg_count := 1;
1260: END IF;
1254: p_Item_Orderability_Import_Rec.msg_count := 1;
1255: ELSE
1256: FND_MESSAGE.Set_Encoded(FND_FLEX_DESCVAL.Encoded_Error_Message);
1257: p_Item_Orderability_Import_Rec.status := FND_API.G_RET_STS_ERROR;
1258: p_Item_Orderability_Import_Rec.msg_data := fnd_message.get;
1259: p_Item_Orderability_Import_Rec.msg_count := 1;
1260: END IF;
1261:
1262: