23: l_return_status VARCHAR2(1);
24: l_msg_data VARCHAR2(2000);
25:
26: BEGIN
27: x_return_status := FND_API.G_RET_STS_SUCCESS;
28:
29: -- Validate DML Operation
30: IF ( p_route_rec.dml_operation IS NULL OR
31: (
36: THEN
37: FND_MESSAGE.set_name( 'AHL', 'AHL_COM_INVALID_DML_REC' );
38: FND_MESSAGE.set_token( 'FIELD', p_route_rec.dml_operation );
39: FND_MSG_PUB.add;
40: x_return_status := FND_API.G_RET_STS_ERROR;
41: RETURN;
42: END IF;
43:
44: END validate_api_inputs;
52:
53: BEGIN
54: IF ( p_x_route_rec.route_type IS NULL ) THEN
55: p_x_route_rec.route_type_code := NULL;
56: ELSIF ( p_x_route_rec.route_type = FND_API.G_MISS_CHAR ) THEN
57: p_x_route_rec.route_type_code := FND_API.G_MISS_CHAR;
58: END IF;
59:
60: --bachandr Enigma Phase I changes -- start
53: BEGIN
54: IF ( p_x_route_rec.route_type IS NULL ) THEN
55: p_x_route_rec.route_type_code := NULL;
56: ELSIF ( p_x_route_rec.route_type = FND_API.G_MISS_CHAR ) THEN
57: p_x_route_rec.route_type_code := FND_API.G_MISS_CHAR;
58: END IF;
59:
60: --bachandr Enigma Phase I changes -- start
61: IF ( p_x_route_rec.model_meaning IS NULL ) THEN
59:
60: --bachandr Enigma Phase I changes -- start
61: IF ( p_x_route_rec.model_meaning IS NULL ) THEN
62: p_x_route_rec.model_code := NULL;
63: ELSIF ( p_x_route_rec.model_meaning = FND_API.G_MISS_CHAR ) THEN
64: p_x_route_rec.model_code := FND_API.G_MISS_CHAR;
65: END IF;
66: --bachandr Enigma Phase I changes -- end
67:
60: --bachandr Enigma Phase I changes -- start
61: IF ( p_x_route_rec.model_meaning IS NULL ) THEN
62: p_x_route_rec.model_code := NULL;
63: ELSIF ( p_x_route_rec.model_meaning = FND_API.G_MISS_CHAR ) THEN
64: p_x_route_rec.model_code := FND_API.G_MISS_CHAR;
65: END IF;
66: --bachandr Enigma Phase I changes -- end
67:
68: IF ( p_x_route_rec.process IS NULL ) THEN
66: --bachandr Enigma Phase I changes -- end
67:
68: IF ( p_x_route_rec.process IS NULL ) THEN
69: p_x_route_rec.process_code := NULL;
70: ELSIF ( p_x_route_rec.process = FND_API.G_MISS_CHAR ) THEN
71: p_x_route_rec.process_code := FND_API.G_MISS_CHAR;
72: END IF;
73:
74: IF ( p_x_route_rec.product_type IS NULL ) THEN
67:
68: IF ( p_x_route_rec.process IS NULL ) THEN
69: p_x_route_rec.process_code := NULL;
70: ELSIF ( p_x_route_rec.process = FND_API.G_MISS_CHAR ) THEN
71: p_x_route_rec.process_code := FND_API.G_MISS_CHAR;
72: END IF;
73:
74: IF ( p_x_route_rec.product_type IS NULL ) THEN
75: p_x_route_rec.product_type_code := NULL;
72: END IF;
73:
74: IF ( p_x_route_rec.product_type IS NULL ) THEN
75: p_x_route_rec.product_type_code := NULL;
76: ELSIF ( p_x_route_rec.product_type = FND_API.G_MISS_CHAR ) THEN
77: p_x_route_rec.product_type_code := FND_API.G_MISS_CHAR;
78: END IF;
79:
80: IF ( p_x_route_rec.operator_name IS NULL ) THEN
73:
74: IF ( p_x_route_rec.product_type IS NULL ) THEN
75: p_x_route_rec.product_type_code := NULL;
76: ELSIF ( p_x_route_rec.product_type = FND_API.G_MISS_CHAR ) THEN
77: p_x_route_rec.product_type_code := FND_API.G_MISS_CHAR;
78: END IF;
79:
80: IF ( p_x_route_rec.operator_name IS NULL ) THEN
81: p_x_route_rec.operator_party_id := NULL;
78: END IF;
79:
80: IF ( p_x_route_rec.operator_name IS NULL ) THEN
81: p_x_route_rec.operator_party_id := NULL;
82: ELSIF ( p_x_route_rec.operator_name = FND_API.G_MISS_CHAR ) THEN
83: p_x_route_rec.operator_party_id := FND_API.G_MISS_NUM;
84: END IF;
85:
86: IF ( p_x_route_rec.zone IS NULL ) THEN
79:
80: IF ( p_x_route_rec.operator_name IS NULL ) THEN
81: p_x_route_rec.operator_party_id := NULL;
82: ELSIF ( p_x_route_rec.operator_name = FND_API.G_MISS_CHAR ) THEN
83: p_x_route_rec.operator_party_id := FND_API.G_MISS_NUM;
84: END IF;
85:
86: IF ( p_x_route_rec.zone IS NULL ) THEN
87: p_x_route_rec.zone_code := NULL;
84: END IF;
85:
86: IF ( p_x_route_rec.zone IS NULL ) THEN
87: p_x_route_rec.zone_code := NULL;
88: ELSIF ( p_x_route_rec.zone = FND_API.G_MISS_CHAR ) THEN
89: p_x_route_rec.zone_code := FND_API.G_MISS_CHAR;
90: END IF;
91:
92: IF ( p_x_route_rec.sub_zone IS NULL ) THEN
85:
86: IF ( p_x_route_rec.zone IS NULL ) THEN
87: p_x_route_rec.zone_code := NULL;
88: ELSIF ( p_x_route_rec.zone = FND_API.G_MISS_CHAR ) THEN
89: p_x_route_rec.zone_code := FND_API.G_MISS_CHAR;
90: END IF;
91:
92: IF ( p_x_route_rec.sub_zone IS NULL ) THEN
93: p_x_route_rec.sub_zone_code := NULL;
90: END IF;
91:
92: IF ( p_x_route_rec.sub_zone IS NULL ) THEN
93: p_x_route_rec.sub_zone_code := NULL;
94: ELSIF ( p_x_route_rec.sub_zone = FND_API.G_MISS_CHAR ) THEN
95: p_x_route_rec.sub_zone_code := FND_API.G_MISS_CHAR;
96: END IF;
97:
98: IF ( p_x_route_rec.service_item_number IS NULL ) THEN
91:
92: IF ( p_x_route_rec.sub_zone IS NULL ) THEN
93: p_x_route_rec.sub_zone_code := NULL;
94: ELSIF ( p_x_route_rec.sub_zone = FND_API.G_MISS_CHAR ) THEN
95: p_x_route_rec.sub_zone_code := FND_API.G_MISS_CHAR;
96: END IF;
97:
98: IF ( p_x_route_rec.service_item_number IS NULL ) THEN
99: p_x_route_rec.service_item_id := NULL;
97:
98: IF ( p_x_route_rec.service_item_number IS NULL ) THEN
99: p_x_route_rec.service_item_id := NULL;
100: p_x_route_rec.service_item_org_id := NULL;
101: ELSIF ( p_x_route_rec.service_item_number = FND_API.G_MISS_CHAR ) THEN
102: p_x_route_rec.service_item_id := FND_API.G_MISS_NUM;
103: p_x_route_rec.service_item_org_id := FND_API.G_MISS_NUM;
104: END IF;
105:
98: IF ( p_x_route_rec.service_item_number IS NULL ) THEN
99: p_x_route_rec.service_item_id := NULL;
100: p_x_route_rec.service_item_org_id := NULL;
101: ELSIF ( p_x_route_rec.service_item_number = FND_API.G_MISS_CHAR ) THEN
102: p_x_route_rec.service_item_id := FND_API.G_MISS_NUM;
103: p_x_route_rec.service_item_org_id := FND_API.G_MISS_NUM;
104: END IF;
105:
106: IF ( p_x_route_rec.accounting_class IS NULL ) THEN
99: p_x_route_rec.service_item_id := NULL;
100: p_x_route_rec.service_item_org_id := NULL;
101: ELSIF ( p_x_route_rec.service_item_number = FND_API.G_MISS_CHAR ) THEN
102: p_x_route_rec.service_item_id := FND_API.G_MISS_NUM;
103: p_x_route_rec.service_item_org_id := FND_API.G_MISS_NUM;
104: END IF;
105:
106: IF ( p_x_route_rec.accounting_class IS NULL ) THEN
107: p_x_route_rec.accounting_class_code := NULL;
105:
106: IF ( p_x_route_rec.accounting_class IS NULL ) THEN
107: p_x_route_rec.accounting_class_code := NULL;
108: p_x_route_rec.accounting_class_org_id := NULL;
109: ELSIF ( p_x_route_rec.accounting_class = FND_API.G_MISS_CHAR ) THEN
110: p_x_route_rec.accounting_class_code := FND_API.G_MISS_CHAR;
111: p_x_route_rec.accounting_class_org_id := FND_API.G_MISS_NUM;
112: END IF;
113:
106: IF ( p_x_route_rec.accounting_class IS NULL ) THEN
107: p_x_route_rec.accounting_class_code := NULL;
108: p_x_route_rec.accounting_class_org_id := NULL;
109: ELSIF ( p_x_route_rec.accounting_class = FND_API.G_MISS_CHAR ) THEN
110: p_x_route_rec.accounting_class_code := FND_API.G_MISS_CHAR;
111: p_x_route_rec.accounting_class_org_id := FND_API.G_MISS_NUM;
112: END IF;
113:
114: IF ( p_x_route_rec.task_template_group IS NULL ) THEN
107: p_x_route_rec.accounting_class_code := NULL;
108: p_x_route_rec.accounting_class_org_id := NULL;
109: ELSIF ( p_x_route_rec.accounting_class = FND_API.G_MISS_CHAR ) THEN
110: p_x_route_rec.accounting_class_code := FND_API.G_MISS_CHAR;
111: p_x_route_rec.accounting_class_org_id := FND_API.G_MISS_NUM;
112: END IF;
113:
114: IF ( p_x_route_rec.task_template_group IS NULL ) THEN
115: p_x_route_rec.task_template_group_id := NULL;
112: END IF;
113:
114: IF ( p_x_route_rec.task_template_group IS NULL ) THEN
115: p_x_route_rec.task_template_group_id := NULL;
116: ELSIF ( p_x_route_rec.task_template_group = FND_API.G_MISS_CHAR ) THEN
117: p_x_route_rec.task_template_group_id := FND_API.G_MISS_NUM;
118: END IF;
119:
120: IF ( p_x_route_rec.qa_inspection_type_desc IS NULL ) THEN
113:
114: IF ( p_x_route_rec.task_template_group IS NULL ) THEN
115: p_x_route_rec.task_template_group_id := NULL;
116: ELSIF ( p_x_route_rec.task_template_group = FND_API.G_MISS_CHAR ) THEN
117: p_x_route_rec.task_template_group_id := FND_API.G_MISS_NUM;
118: END IF;
119:
120: IF ( p_x_route_rec.qa_inspection_type_desc IS NULL ) THEN
121: p_x_route_rec.qa_inspection_type := NULL;
118: END IF;
119:
120: IF ( p_x_route_rec.qa_inspection_type_desc IS NULL ) THEN
121: p_x_route_rec.qa_inspection_type := NULL;
122: ELSIF ( p_x_route_rec.qa_inspection_type_desc = FND_API.G_MISS_CHAR ) THEN
123: p_x_route_rec.qa_inspection_type := FND_API.G_MISS_CHAR;
124: END IF;
125:
126: IF ( p_x_route_rec.revision_status IS NULL ) THEN
119:
120: IF ( p_x_route_rec.qa_inspection_type_desc IS NULL ) THEN
121: p_x_route_rec.qa_inspection_type := NULL;
122: ELSIF ( p_x_route_rec.qa_inspection_type_desc = FND_API.G_MISS_CHAR ) THEN
123: p_x_route_rec.qa_inspection_type := FND_API.G_MISS_CHAR;
124: END IF;
125:
126: IF ( p_x_route_rec.revision_status IS NULL ) THEN
127: p_x_route_rec.revision_status_code := NULL;
124: END IF;
125:
126: IF ( p_x_route_rec.revision_status IS NULL ) THEN
127: p_x_route_rec.revision_status_code := NULL;
128: ELSIF ( p_x_route_rec.revision_status = FND_API.G_MISS_CHAR ) THEN
129: p_x_route_rec.revision_status_code := FND_API.G_MISS_CHAR;
130: END IF;
131:
132: END clear_lov_attribute_ids;
125:
126: IF ( p_x_route_rec.revision_status IS NULL ) THEN
127: p_x_route_rec.revision_status_code := NULL;
128: ELSIF ( p_x_route_rec.revision_status = FND_API.G_MISS_CHAR ) THEN
129: p_x_route_rec.revision_status_code := FND_API.G_MISS_CHAR;
130: END IF;
131:
132: END clear_lov_attribute_ids;
133:
142: l_return_status VARCHAR2(1);
143: l_msg_data VARCHAR2(2000);
144:
145: BEGIN
146: x_return_status := FND_API.G_RET_STS_SUCCESS;
147:
148: -- Convert / Validate Route Type
149: IF ( ( p_x_route_rec.route_type_code IS NOT NULL AND
150: p_x_route_rec.route_type_code <> FND_API.G_MISS_CHAR ) OR
146: x_return_status := FND_API.G_RET_STS_SUCCESS;
147:
148: -- Convert / Validate Route Type
149: IF ( ( p_x_route_rec.route_type_code IS NOT NULL AND
150: p_x_route_rec.route_type_code <> FND_API.G_MISS_CHAR ) OR
151: ( p_x_route_rec.route_type IS NOT NULL AND
152: p_x_route_rec.route_type <> FND_API.G_MISS_CHAR ) ) THEN
153:
154: AHL_RM_ROUTE_UTIL.validate_lookup
148: -- Convert / Validate Route Type
149: IF ( ( p_x_route_rec.route_type_code IS NOT NULL AND
150: p_x_route_rec.route_type_code <> FND_API.G_MISS_CHAR ) OR
151: ( p_x_route_rec.route_type IS NOT NULL AND
152: p_x_route_rec.route_type <> FND_API.G_MISS_CHAR ) ) THEN
153:
154: AHL_RM_ROUTE_UTIL.validate_lookup
155: (
156: x_return_status => l_return_status,
159: p_lookup_meaning => p_x_route_rec.route_type,
160: p_x_lookup_code => p_x_route_rec.route_type_code
161: );
162:
163: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
164: IF ( l_msg_data = 'AHL_COM_INVALID_LOOKUP' ) THEN
165: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_INVALID_ROUTE_TYPE' );
166: ELSIF ( l_msg_data = 'AHL_COM_TOO_MANY_LOOKUPS' ) THEN
167: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_TOO_MANY_ROUTE_TYPES' );
169: FND_MESSAGE.set_name( 'AHL', l_msg_data );
170: END IF;
171:
172: IF ( p_x_route_rec.route_type IS NULL OR
173: p_x_route_rec.route_type = FND_API.G_MISS_CHAR ) THEN
174: FND_MESSAGE.set_token( 'FIELD', p_x_route_rec.route_type_code );
175: ELSE
176: FND_MESSAGE.set_token( 'FIELD', p_x_route_rec.route_type );
177: END IF;
183:
184: --bachandr Enigma Phase I changes -- start
185: -- Convert / Validate Model
186: IF ( ( p_x_route_rec.model_code IS NOT NULL AND
187: p_x_route_rec.model_code <> FND_API.G_MISS_CHAR ) OR
188: ( p_x_route_rec.model_meaning IS NOT NULL AND
189: p_x_route_rec.model_meaning <> FND_API.G_MISS_CHAR ) ) THEN
190:
191: AHL_RM_ROUTE_UTIL.validate_lookup
185: -- Convert / Validate Model
186: IF ( ( p_x_route_rec.model_code IS NOT NULL AND
187: p_x_route_rec.model_code <> FND_API.G_MISS_CHAR ) OR
188: ( p_x_route_rec.model_meaning IS NOT NULL AND
189: p_x_route_rec.model_meaning <> FND_API.G_MISS_CHAR ) ) THEN
190:
191: AHL_RM_ROUTE_UTIL.validate_lookup
192: (
193: x_return_status => l_return_status,
196: p_lookup_meaning => p_x_route_rec.model_meaning,
197: p_x_lookup_code => p_x_route_rec.model_code
198: );
199:
200: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
201: IF ( l_msg_data = 'AHL_COM_INVALID_LOOKUP' ) THEN
202: FND_MESSAGE.set_name( 'AHL', 'AHL_CM_INVALID_MODEL' );
203: ELSIF ( l_msg_data = 'AHL_COM_TOO_MANY_LOOKUPS' ) THEN
204: FND_MESSAGE.set_name( 'AHL', 'AHL_CM_TOO_MANY_MODELS' );
206: FND_MESSAGE.set_name( 'AHL', l_msg_data );
207: END IF;
208:
209: IF ( p_x_route_rec.model_meaning IS NULL OR
210: p_x_route_rec.model_meaning = FND_API.G_MISS_CHAR ) THEN
211: FND_MESSAGE.set_token( 'FIELD', p_x_route_rec.model_code );
212: ELSE
213: FND_MESSAGE.set_token( 'FIELD', p_x_route_rec.model_meaning );
214: END IF;
220: --bachandr Enigma Phase I changes -- end
221:
222: -- Convert / Validate Process
223: IF ( ( p_x_route_rec.process_code IS NOT NULL AND
224: p_x_route_rec.process_code <> FND_API.G_MISS_CHAR ) OR
225: ( p_x_route_rec.process IS NOT NULL AND
226: p_x_route_rec.process <> FND_API.G_MISS_CHAR ) ) THEN
227:
228: AHL_RM_ROUTE_UTIL.validate_lookup
222: -- Convert / Validate Process
223: IF ( ( p_x_route_rec.process_code IS NOT NULL AND
224: p_x_route_rec.process_code <> FND_API.G_MISS_CHAR ) OR
225: ( p_x_route_rec.process IS NOT NULL AND
226: p_x_route_rec.process <> FND_API.G_MISS_CHAR ) ) THEN
227:
228: AHL_RM_ROUTE_UTIL.validate_lookup
229: (
230: x_return_status => l_return_status,
233: p_lookup_meaning => p_x_route_rec.process,
234: p_x_lookup_code => p_x_route_rec.process_code
235: );
236:
237: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
238: IF ( l_msg_data = 'AHL_COM_INVALID_LOOKUP' ) THEN
239: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_INVALID_PROCESS' );
240: ELSIF ( l_msg_data = 'AHL_COM_TOO_MANY_LOOKUPS' ) THEN
241: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_TOO_MANY_PROCESSES' );
243: FND_MESSAGE.set_name( 'AHL', l_msg_data );
244: END IF;
245:
246: IF ( p_x_route_rec.process IS NULL OR
247: p_x_route_rec.process = FND_API.G_MISS_CHAR ) THEN
248: FND_MESSAGE.set_token( 'FIELD', p_x_route_rec.process_code );
249: ELSE
250: FND_MESSAGE.set_token( 'FIELD', p_x_route_rec.process );
251: END IF;
256: END IF;
257:
258: -- Convert / Validate Product Type
259: IF ( ( p_x_route_rec.product_type_code IS NOT NULL AND
260: p_x_route_rec.product_type_code <> FND_API.G_MISS_CHAR ) OR
261: ( p_x_route_rec.product_type IS NOT NULL AND
262: p_x_route_rec.product_type <> FND_API.G_MISS_CHAR ) ) THEN
263:
264: AHL_RM_ROUTE_UTIL.validate_lookup
258: -- Convert / Validate Product Type
259: IF ( ( p_x_route_rec.product_type_code IS NOT NULL AND
260: p_x_route_rec.product_type_code <> FND_API.G_MISS_CHAR ) OR
261: ( p_x_route_rec.product_type IS NOT NULL AND
262: p_x_route_rec.product_type <> FND_API.G_MISS_CHAR ) ) THEN
263:
264: AHL_RM_ROUTE_UTIL.validate_lookup
265: (
266: x_return_status => l_return_status,
269: p_lookup_meaning => p_x_route_rec.product_type,
270: p_x_lookup_code => p_x_route_rec.product_type_code
271: );
272:
273: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
274: IF ( l_msg_data = 'AHL_COM_INVALID_LOOKUP' ) THEN
275: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_INVALID_PRODUCT_TYPE' );
276: ELSIF ( l_msg_data = 'AHL_COM_TOO_MANY_LOOKUPS' ) THEN
277: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_TOO_MANY_PRODUCT_TYPES' );
279: FND_MESSAGE.set_name( 'AHL', l_msg_data );
280: END IF;
281:
282: IF ( p_x_route_rec.product_type IS NULL OR
283: p_x_route_rec.product_type = FND_API.G_MISS_CHAR ) THEN
284: FND_MESSAGE.set_token( 'FIELD', p_x_route_rec.product_type_code );
285: ELSE
286: FND_MESSAGE.set_token( 'FIELD', p_x_route_rec.product_type );
287: END IF;
292: END IF;
293:
294: -- Convert / Validate Operator
295: IF ( ( p_x_route_rec.operator_name IS NOT NULL AND
296: p_x_route_rec.operator_name <> FND_API.G_MISS_CHAR ) OR
297: ( p_x_route_rec.operator_party_id IS NOT NULL AND
298: p_x_route_rec.operator_party_id <> FND_API.G_MISS_NUM ) ) THEN
299:
300: AHL_RM_ROUTE_UTIL.validate_operator
294: -- Convert / Validate Operator
295: IF ( ( p_x_route_rec.operator_name IS NOT NULL AND
296: p_x_route_rec.operator_name <> FND_API.G_MISS_CHAR ) OR
297: ( p_x_route_rec.operator_party_id IS NOT NULL AND
298: p_x_route_rec.operator_party_id <> FND_API.G_MISS_NUM ) ) THEN
299:
300: AHL_RM_ROUTE_UTIL.validate_operator
301: (
302: x_return_status => l_return_status,
304: p_operator_name => p_x_route_rec.operator_name,
305: p_x_operator_party_id => p_x_route_rec.operator_party_id
306: );
307:
308: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
309: FND_MESSAGE.set_name( 'AHL', l_msg_data );
310:
311: IF ( p_x_route_rec.operator_name IS NULL OR
312: p_x_route_rec.operator_name = FND_API.G_MISS_CHAR ) THEN
308: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
309: FND_MESSAGE.set_name( 'AHL', l_msg_data );
310:
311: IF ( p_x_route_rec.operator_name IS NULL OR
312: p_x_route_rec.operator_name = FND_API.G_MISS_CHAR ) THEN
313: FND_MESSAGE.set_token( 'FIELD', TO_CHAR( p_x_route_rec.operator_party_id ) );
314: ELSE
315: FND_MESSAGE.set_token( 'FIELD', p_x_route_rec.operator_name );
316: END IF;
321: END IF;
322:
323: -- Convert / Validate Zone
324: IF ( ( p_x_route_rec.zone_code IS NOT NULL AND
325: p_x_route_rec.zone_code <> FND_API.G_MISS_CHAR ) OR
326: ( p_x_route_rec.zone IS NOT NULL AND
327: p_x_route_rec.zone <> FND_API.G_MISS_CHAR ) ) THEN
328:
329: AHL_RM_ROUTE_UTIL.validate_lookup
323: -- Convert / Validate Zone
324: IF ( ( p_x_route_rec.zone_code IS NOT NULL AND
325: p_x_route_rec.zone_code <> FND_API.G_MISS_CHAR ) OR
326: ( p_x_route_rec.zone IS NOT NULL AND
327: p_x_route_rec.zone <> FND_API.G_MISS_CHAR ) ) THEN
328:
329: AHL_RM_ROUTE_UTIL.validate_lookup
330: (
331: x_return_status => l_return_status,
334: p_lookup_meaning => p_x_route_rec.zone,
335: p_x_lookup_code => p_x_route_rec.zone_code
336: );
337:
338: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
339: IF ( l_msg_data = 'AHL_COM_INVALID_LOOKUP' ) THEN
340: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_INVALID_ZONE' );
341: ELSIF ( l_msg_data = 'AHL_COM_TOO_MANY_LOOKUPS' ) THEN
342: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_TOO_MANY_ZONES' );
344: FND_MESSAGE.set_name( 'AHL', l_msg_data );
345: END IF;
346:
347: IF ( p_x_route_rec.zone IS NULL OR
348: p_x_route_rec.zone = FND_API.G_MISS_CHAR ) THEN
349: FND_MESSAGE.set_token( 'FIELD', p_x_route_rec.zone_code );
350: ELSE
351: FND_MESSAGE.set_token( 'FIELD', p_x_route_rec.zone );
352: END IF;
357: END IF;
358:
359: -- Convert / Validate Sub Zone
360: IF ( ( p_x_route_rec.sub_zone_code IS NOT NULL AND
361: p_x_route_rec.sub_zone_code <> FND_API.G_MISS_CHAR ) OR
362: ( p_x_route_rec.sub_zone IS NOT NULL AND
363: p_x_route_rec.sub_zone <> FND_API.G_MISS_CHAR ) ) THEN
364:
365: AHL_RM_ROUTE_UTIL.validate_lookup
359: -- Convert / Validate Sub Zone
360: IF ( ( p_x_route_rec.sub_zone_code IS NOT NULL AND
361: p_x_route_rec.sub_zone_code <> FND_API.G_MISS_CHAR ) OR
362: ( p_x_route_rec.sub_zone IS NOT NULL AND
363: p_x_route_rec.sub_zone <> FND_API.G_MISS_CHAR ) ) THEN
364:
365: AHL_RM_ROUTE_UTIL.validate_lookup
366: (
367: x_return_status => l_return_status,
370: p_lookup_meaning => p_x_route_rec.sub_zone,
371: p_x_lookup_code => p_x_route_rec.sub_zone_code
372: );
373:
374: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
375: IF ( l_msg_data = 'AHL_COM_INVALID_LOOKUP' ) THEN
376: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_INVALID_SUB_ZONE' );
377: ELSIF ( l_msg_data = 'AHL_COM_TOO_MANY_LOOKUPS' ) THEN
378: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_TOO_MANY_SUB_ZONES' );
380: FND_MESSAGE.set_name( 'AHL', l_msg_data );
381: END IF;
382:
383: IF ( p_x_route_rec.sub_zone IS NULL OR
384: p_x_route_rec.sub_zone = FND_API.G_MISS_CHAR ) THEN
385: FND_MESSAGE.set_token( 'FIELD', p_x_route_rec.sub_zone_code );
386: ELSE
387: FND_MESSAGE.set_token( 'FIELD', p_x_route_rec.sub_zone );
388: END IF;
393: END IF;
394:
395: -- Convert / Validate Service Item
396: IF ( ( p_x_route_rec.service_item_number IS NOT NULL AND
397: p_x_route_rec.service_item_number <> FND_API.G_MISS_CHAR ) OR
398: ( p_x_route_rec.service_item_id IS NOT NULL AND
399: p_x_route_rec.service_item_id <> FND_API.G_MISS_NUM AND
400: p_x_route_rec.service_item_org_id IS NOT NULL AND
401: p_x_route_rec.service_item_org_id <> FND_API.G_MISS_NUM ) ) THEN
395: -- Convert / Validate Service Item
396: IF ( ( p_x_route_rec.service_item_number IS NOT NULL AND
397: p_x_route_rec.service_item_number <> FND_API.G_MISS_CHAR ) OR
398: ( p_x_route_rec.service_item_id IS NOT NULL AND
399: p_x_route_rec.service_item_id <> FND_API.G_MISS_NUM AND
400: p_x_route_rec.service_item_org_id IS NOT NULL AND
401: p_x_route_rec.service_item_org_id <> FND_API.G_MISS_NUM ) ) THEN
402:
403: AHL_RM_ROUTE_UTIL.validate_service_item
397: p_x_route_rec.service_item_number <> FND_API.G_MISS_CHAR ) OR
398: ( p_x_route_rec.service_item_id IS NOT NULL AND
399: p_x_route_rec.service_item_id <> FND_API.G_MISS_NUM AND
400: p_x_route_rec.service_item_org_id IS NOT NULL AND
401: p_x_route_rec.service_item_org_id <> FND_API.G_MISS_NUM ) ) THEN
402:
403: AHL_RM_ROUTE_UTIL.validate_service_item
404: (
405: x_return_status => l_return_status,
408: p_x_inventory_item_id => p_x_route_rec.service_item_id,
409: p_x_inventory_org_id => p_x_route_rec.service_item_org_id
410: );
411:
412: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
413: FND_MESSAGE.set_name( 'AHL', l_msg_data );
414:
415: IF ( p_x_route_rec.service_item_number IS NULL OR
416: p_x_route_rec.service_item_number = FND_API.G_MISS_CHAR ) THEN
412: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
413: FND_MESSAGE.set_name( 'AHL', l_msg_data );
414:
415: IF ( p_x_route_rec.service_item_number IS NULL OR
416: p_x_route_rec.service_item_number = FND_API.G_MISS_CHAR ) THEN
417: FND_MESSAGE.set_token( 'FIELD', TO_CHAR( p_x_route_rec.service_item_id ) || TO_CHAR( p_x_route_rec.service_item_org_id ) );
418: ELSE
419: FND_MESSAGE.set_token( 'FIELD', p_x_route_rec.service_item_number );
420: END IF;
425: END IF;
426:
427: -- Convert / Validate Accounting Class
428: IF ( ( p_x_route_rec.accounting_class_code IS NOT NULL AND
429: p_x_route_rec.accounting_class_code <> FND_API.G_MISS_CHAR AND
430: p_x_route_rec.accounting_class_org_id IS NOT NULL AND
431: p_x_route_rec.accounting_class_org_id <> FND_API.G_MISS_NUM ) OR
432: ( p_x_route_rec.accounting_class IS NOT NULL AND
433: p_x_route_rec.accounting_class <> FND_API.G_MISS_CHAR ) ) THEN
427: -- Convert / Validate Accounting Class
428: IF ( ( p_x_route_rec.accounting_class_code IS NOT NULL AND
429: p_x_route_rec.accounting_class_code <> FND_API.G_MISS_CHAR AND
430: p_x_route_rec.accounting_class_org_id IS NOT NULL AND
431: p_x_route_rec.accounting_class_org_id <> FND_API.G_MISS_NUM ) OR
432: ( p_x_route_rec.accounting_class IS NOT NULL AND
433: p_x_route_rec.accounting_class <> FND_API.G_MISS_CHAR ) ) THEN
434:
435: AHL_RM_ROUTE_UTIL.validate_accounting_class
429: p_x_route_rec.accounting_class_code <> FND_API.G_MISS_CHAR AND
430: p_x_route_rec.accounting_class_org_id IS NOT NULL AND
431: p_x_route_rec.accounting_class_org_id <> FND_API.G_MISS_NUM ) OR
432: ( p_x_route_rec.accounting_class IS NOT NULL AND
433: p_x_route_rec.accounting_class <> FND_API.G_MISS_CHAR ) ) THEN
434:
435: AHL_RM_ROUTE_UTIL.validate_accounting_class
436: (
437: x_return_status => l_return_status,
440: p_x_accounting_class_code => p_x_route_rec.accounting_class_code,
441: p_x_accounting_class_org_id => p_x_route_rec.accounting_class_org_id
442: );
443:
444: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
445: FND_MESSAGE.set_name( 'AHL', l_msg_data );
446:
447: IF ( p_x_route_rec.accounting_class IS NULL OR
448: p_x_route_rec.accounting_class = FND_API.G_MISS_CHAR ) THEN
444: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
445: FND_MESSAGE.set_name( 'AHL', l_msg_data );
446:
447: IF ( p_x_route_rec.accounting_class IS NULL OR
448: p_x_route_rec.accounting_class = FND_API.G_MISS_CHAR ) THEN
449: FND_MESSAGE.set_token( 'FIELD', p_x_route_rec.accounting_class_code || '-' || TO_CHAR( p_x_route_rec.accounting_class_org_id ) );
450: ELSE
451: FND_MESSAGE.set_token( 'FIELD', p_x_route_rec.accounting_class );
452: END IF;
457: END IF;
458:
459: -- Convert / Validate Task Template Group
460: IF ( ( p_x_route_rec.task_template_group IS NOT NULL AND
461: p_x_route_rec.task_template_group <> FND_API.G_MISS_CHAR ) OR
462: ( p_x_route_rec.task_template_group_id IS NOT NULL AND
463: p_x_route_rec.task_template_group_id <> FND_API.G_MISS_NUM ) ) THEN
464:
465: AHL_RM_ROUTE_UTIL.validate_task_template_group
459: -- Convert / Validate Task Template Group
460: IF ( ( p_x_route_rec.task_template_group IS NOT NULL AND
461: p_x_route_rec.task_template_group <> FND_API.G_MISS_CHAR ) OR
462: ( p_x_route_rec.task_template_group_id IS NOT NULL AND
463: p_x_route_rec.task_template_group_id <> FND_API.G_MISS_NUM ) ) THEN
464:
465: AHL_RM_ROUTE_UTIL.validate_task_template_group
466: (
467: x_return_status => l_return_status,
469: p_task_template_group => p_x_route_rec.task_template_group,
470: p_x_task_template_group_id => p_x_route_rec.task_template_group_id
471: );
472:
473: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
474: FND_MESSAGE.set_name( 'AHL', l_msg_data );
475:
476: IF ( p_x_route_rec.task_template_group IS NULL OR
477: p_x_route_rec.task_template_group = FND_API.G_MISS_CHAR ) THEN
473: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
474: FND_MESSAGE.set_name( 'AHL', l_msg_data );
475:
476: IF ( p_x_route_rec.task_template_group IS NULL OR
477: p_x_route_rec.task_template_group = FND_API.G_MISS_CHAR ) THEN
478: FND_MESSAGE.set_token( 'FIELD', TO_CHAR( p_x_route_rec.task_template_group_id ) );
479: ELSE
480: FND_MESSAGE.set_token( 'FIELD', p_x_route_rec.task_template_group );
481: END IF;
486: END IF;
487:
488: -- Convert / Validate QA Plan
489: IF ( ( p_x_route_rec.qa_inspection_type_desc IS NOT NULL AND
490: p_x_route_rec.qa_inspection_type_desc <> FND_API.G_MISS_CHAR ) OR
491: ( p_x_route_rec.qa_inspection_type IS NOT NULL AND
492: p_x_route_rec.qa_inspection_type <> FND_API.G_MISS_CHAR ) ) THEN
493:
494: AHL_RM_ROUTE_UTIL.validate_qa_inspection_type
488: -- Convert / Validate QA Plan
489: IF ( ( p_x_route_rec.qa_inspection_type_desc IS NOT NULL AND
490: p_x_route_rec.qa_inspection_type_desc <> FND_API.G_MISS_CHAR ) OR
491: ( p_x_route_rec.qa_inspection_type IS NOT NULL AND
492: p_x_route_rec.qa_inspection_type <> FND_API.G_MISS_CHAR ) ) THEN
493:
494: AHL_RM_ROUTE_UTIL.validate_qa_inspection_type
495: (
496: x_return_status => l_return_status,
498: p_qa_inspection_type_desc => p_x_route_rec.qa_inspection_type_desc,
499: p_x_qa_inspection_type => p_x_route_rec.qa_inspection_type
500: );
501:
502: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
503: FND_MESSAGE.set_name( 'AHL', l_msg_data );
504:
505: IF ( p_x_route_rec.qa_inspection_type_desc IS NULL OR
506: p_x_route_rec.qa_inspection_type_desc = FND_API.G_MISS_CHAR ) THEN
502: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
503: FND_MESSAGE.set_name( 'AHL', l_msg_data );
504:
505: IF ( p_x_route_rec.qa_inspection_type_desc IS NULL OR
506: p_x_route_rec.qa_inspection_type_desc = FND_API.G_MISS_CHAR ) THEN
507: FND_MESSAGE.set_token( 'FIELD', p_x_route_rec.qa_inspection_type );
508: ELSE
509: FND_MESSAGE.set_token( 'FIELD', p_x_route_rec.qa_inspection_type_desc );
510: END IF;
515: END IF;
516:
517: -- Convert / Validate Revision Status
518: IF ( ( p_x_route_rec.revision_status_code IS NOT NULL AND
519: p_x_route_rec.revision_status_code <> FND_API.G_MISS_CHAR ) OR
520: ( p_x_route_rec.revision_status IS NOT NULL AND
521: p_x_route_rec.revision_status <> FND_API.G_MISS_CHAR ) ) THEN
522:
523: AHL_RM_ROUTE_UTIL.validate_lookup
517: -- Convert / Validate Revision Status
518: IF ( ( p_x_route_rec.revision_status_code IS NOT NULL AND
519: p_x_route_rec.revision_status_code <> FND_API.G_MISS_CHAR ) OR
520: ( p_x_route_rec.revision_status IS NOT NULL AND
521: p_x_route_rec.revision_status <> FND_API.G_MISS_CHAR ) ) THEN
522:
523: AHL_RM_ROUTE_UTIL.validate_lookup
524: (
525: x_return_status => l_return_status,
528: p_lookup_meaning => p_x_route_rec.revision_status,
529: p_x_lookup_code => p_x_route_rec.revision_status_code
530: );
531:
532: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
533: IF ( l_msg_data = 'AHL_COM_INVALID_LOOKUP' ) THEN
534: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_INVALID_STATUS' );
535: ELSIF ( l_msg_data = 'AHL_COM_TOO_MANY_LOOKUPS' ) THEN
536: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_TOO_MANY_STATUSES' );
538: FND_MESSAGE.set_name( 'AHL', l_msg_data );
539: END IF;
540:
541: IF ( p_x_route_rec.revision_status IS NULL OR
542: p_x_route_rec.revision_status = FND_API.G_MISS_CHAR ) THEN
543: FND_MESSAGE.set_token( 'FIELD', p_x_route_rec.revision_status_code );
544: ELSE
545: FND_MESSAGE.set_token( 'FIELD', p_x_route_rec.revision_status );
546: END IF;
552:
553: -- pdoki added for Bug 6504159
554: -- Convert / Validate unit receipt update
555: IF ( ( p_x_route_rec.unit_receipt_update_flag IS NOT NULL AND
556: p_x_route_rec.unit_receipt_update_flag <> FND_API.G_MISS_CHAR ) OR
557: ( p_x_route_rec.unit_receipt_update IS NOT NULL AND
558: p_x_route_rec.unit_receipt_update <> FND_API.G_MISS_CHAR ) ) THEN
559:
560: AHL_RM_ROUTE_UTIL.validate_lookup
554: -- Convert / Validate unit receipt update
555: IF ( ( p_x_route_rec.unit_receipt_update_flag IS NOT NULL AND
556: p_x_route_rec.unit_receipt_update_flag <> FND_API.G_MISS_CHAR ) OR
557: ( p_x_route_rec.unit_receipt_update IS NOT NULL AND
558: p_x_route_rec.unit_receipt_update <> FND_API.G_MISS_CHAR ) ) THEN
559:
560: AHL_RM_ROUTE_UTIL.validate_lookup
561: (
562: x_return_status => l_return_status,
565: p_lookup_meaning => p_x_route_rec.unit_receipt_update,
566: p_x_lookup_code => p_x_route_rec.unit_receipt_update_flag
567: );
568:
569: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
570: IF ( l_msg_data = 'AHL_COM_INVALID_LOOKUP' ) THEN
571: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_INVALID_UNIT_RECEIPT' );
572: ELSIF ( l_msg_data = 'AHL_COM_TOO_MANY_LOOKUPS' ) THEN
573: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_TOO_MANY_UNIT_RECEIPTS' );
575: FND_MESSAGE.set_name( 'AHL', l_msg_data );
576: END IF;
577:
578: IF ( p_x_route_rec.unit_receipt_update IS NULL OR
579: p_x_route_rec.unit_receipt_update = FND_API.G_MISS_CHAR ) THEN
580: FND_MESSAGE.set_token( 'FIELD', p_x_route_rec.unit_receipt_update_flag );
581: ELSE
582: FND_MESSAGE.set_token( 'FIELD', p_x_route_rec.unit_receipt_update );
583: END IF;
621:
622: BEGIN
623:
624: -- Convert G_MISS values to NULL
625: IF ( p_x_route_rec.route_type_code = FND_API.G_MISS_CHAR ) THEN
626: p_x_route_rec.route_type_code := null;
627: END IF;
628:
629: IF ( p_x_route_rec.route_type = FND_API.G_MISS_CHAR ) THEN
625: IF ( p_x_route_rec.route_type_code = FND_API.G_MISS_CHAR ) THEN
626: p_x_route_rec.route_type_code := null;
627: END IF;
628:
629: IF ( p_x_route_rec.route_type = FND_API.G_MISS_CHAR ) THEN
630: p_x_route_rec.route_type := null;
631: END IF;
632:
633: IF ( p_x_route_rec.process_code = FND_API.G_MISS_CHAR ) THEN
629: IF ( p_x_route_rec.route_type = FND_API.G_MISS_CHAR ) THEN
630: p_x_route_rec.route_type := null;
631: END IF;
632:
633: IF ( p_x_route_rec.process_code = FND_API.G_MISS_CHAR ) THEN
634: p_x_route_rec.process_code := null;
635: END IF;
636:
637: IF ( p_x_route_rec.process = FND_API.G_MISS_CHAR ) THEN
633: IF ( p_x_route_rec.process_code = FND_API.G_MISS_CHAR ) THEN
634: p_x_route_rec.process_code := null;
635: END IF;
636:
637: IF ( p_x_route_rec.process = FND_API.G_MISS_CHAR ) THEN
638: p_x_route_rec.process := null;
639: END IF;
640:
641: IF ( p_x_route_rec.product_type_code = FND_API.G_MISS_CHAR ) THEN
637: IF ( p_x_route_rec.process = FND_API.G_MISS_CHAR ) THEN
638: p_x_route_rec.process := null;
639: END IF;
640:
641: IF ( p_x_route_rec.product_type_code = FND_API.G_MISS_CHAR ) THEN
642: p_x_route_rec.product_type_code := null;
643: END IF;
644:
645: IF ( p_x_route_rec.product_type = FND_API.G_MISS_CHAR ) THEN
641: IF ( p_x_route_rec.product_type_code = FND_API.G_MISS_CHAR ) THEN
642: p_x_route_rec.product_type_code := null;
643: END IF;
644:
645: IF ( p_x_route_rec.product_type = FND_API.G_MISS_CHAR ) THEN
646: p_x_route_rec.product_type := null;
647: END IF;
648:
649: --bachandr Enigma Phase I changes -- start
649: --bachandr Enigma Phase I changes -- start
650: -- Default the model code and meaning to null only
651: -- when the route in a non-Enigma route.
652:
653: IF ( p_x_route_rec.enigma_doc_id IS NULL OR p_x_route_rec.enigma_doc_id = FND_API.G_MISS_CHAR ) THEN
654: IF ( p_x_route_rec.model_code = FND_API.G_MISS_CHAR ) THEN
655: p_x_route_rec.model_code := null;
656: END IF;
657:
650: -- Default the model code and meaning to null only
651: -- when the route in a non-Enigma route.
652:
653: IF ( p_x_route_rec.enigma_doc_id IS NULL OR p_x_route_rec.enigma_doc_id = FND_API.G_MISS_CHAR ) THEN
654: IF ( p_x_route_rec.model_code = FND_API.G_MISS_CHAR ) THEN
655: p_x_route_rec.model_code := null;
656: END IF;
657:
658: IF ( p_x_route_rec.model_meaning = FND_API.G_MISS_CHAR ) THEN
654: IF ( p_x_route_rec.model_code = FND_API.G_MISS_CHAR ) THEN
655: p_x_route_rec.model_code := null;
656: END IF;
657:
658: IF ( p_x_route_rec.model_meaning = FND_API.G_MISS_CHAR ) THEN
659: p_x_route_rec.model_meaning := null;
660: END IF;
661: END IF;
662:
659: p_x_route_rec.model_meaning := null;
660: END IF;
661: END IF;
662:
663: IF ( p_x_route_rec.time_span = FND_API.G_MISS_NUM ) THEN
664: p_x_route_rec.time_span := null;
665: END IF;
666:
667: --bachandr Enigma Phase I changes -- end
665: END IF;
666:
667: --bachandr Enigma Phase I changes -- end
668:
669: IF ( p_x_route_rec.operator_party_id = FND_API.G_MISS_NUM ) THEN
670: p_x_route_rec.operator_party_id := null;
671: END IF;
672:
673: IF ( p_x_route_rec.operator_name = FND_API.G_MISS_CHAR ) THEN
669: IF ( p_x_route_rec.operator_party_id = FND_API.G_MISS_NUM ) THEN
670: p_x_route_rec.operator_party_id := null;
671: END IF;
672:
673: IF ( p_x_route_rec.operator_name = FND_API.G_MISS_CHAR ) THEN
674: p_x_route_rec.operator_name := null;
675: END IF;
676:
677: IF ( p_x_route_rec.zone_code = FND_API.G_MISS_CHAR ) THEN
673: IF ( p_x_route_rec.operator_name = FND_API.G_MISS_CHAR ) THEN
674: p_x_route_rec.operator_name := null;
675: END IF;
676:
677: IF ( p_x_route_rec.zone_code = FND_API.G_MISS_CHAR ) THEN
678: p_x_route_rec.zone_code := null;
679: END IF;
680:
681: IF ( p_x_route_rec.zone = FND_API.G_MISS_CHAR ) THEN
677: IF ( p_x_route_rec.zone_code = FND_API.G_MISS_CHAR ) THEN
678: p_x_route_rec.zone_code := null;
679: END IF;
680:
681: IF ( p_x_route_rec.zone = FND_API.G_MISS_CHAR ) THEN
682: p_x_route_rec.zone := null;
683: END IF;
684:
685: IF ( p_x_route_rec.sub_zone_code = FND_API.G_MISS_CHAR ) THEN
681: IF ( p_x_route_rec.zone = FND_API.G_MISS_CHAR ) THEN
682: p_x_route_rec.zone := null;
683: END IF;
684:
685: IF ( p_x_route_rec.sub_zone_code = FND_API.G_MISS_CHAR ) THEN
686: p_x_route_rec.sub_zone_code := null;
687: END IF;
688:
689: IF ( p_x_route_rec.sub_zone = FND_API.G_MISS_CHAR ) THEN
685: IF ( p_x_route_rec.sub_zone_code = FND_API.G_MISS_CHAR ) THEN
686: p_x_route_rec.sub_zone_code := null;
687: END IF;
688:
689: IF ( p_x_route_rec.sub_zone = FND_API.G_MISS_CHAR ) THEN
690: p_x_route_rec.sub_zone := null;
691: END IF;
692:
693: IF ( p_x_route_rec.service_item_id = FND_API.G_MISS_NUM ) THEN
689: IF ( p_x_route_rec.sub_zone = FND_API.G_MISS_CHAR ) THEN
690: p_x_route_rec.sub_zone := null;
691: END IF;
692:
693: IF ( p_x_route_rec.service_item_id = FND_API.G_MISS_NUM ) THEN
694: p_x_route_rec.service_item_id := null;
695: END IF;
696:
697: IF ( p_x_route_rec.service_item_org_id = FND_API.G_MISS_NUM ) THEN
693: IF ( p_x_route_rec.service_item_id = FND_API.G_MISS_NUM ) THEN
694: p_x_route_rec.service_item_id := null;
695: END IF;
696:
697: IF ( p_x_route_rec.service_item_org_id = FND_API.G_MISS_NUM ) THEN
698: p_x_route_rec.service_item_org_id := null;
699: END IF;
700:
701: IF ( p_x_route_rec.service_item_number = FND_API.G_MISS_CHAR ) THEN
697: IF ( p_x_route_rec.service_item_org_id = FND_API.G_MISS_NUM ) THEN
698: p_x_route_rec.service_item_org_id := null;
699: END IF;
700:
701: IF ( p_x_route_rec.service_item_number = FND_API.G_MISS_CHAR ) THEN
702: p_x_route_rec.service_item_number := null;
703: END IF;
704:
705: IF ( p_x_route_rec.accounting_class_code = FND_API.G_MISS_CHAR ) THEN
701: IF ( p_x_route_rec.service_item_number = FND_API.G_MISS_CHAR ) THEN
702: p_x_route_rec.service_item_number := null;
703: END IF;
704:
705: IF ( p_x_route_rec.accounting_class_code = FND_API.G_MISS_CHAR ) THEN
706: p_x_route_rec.accounting_class_code := null;
707: END IF;
708:
709: IF ( p_x_route_rec.accounting_class_org_id = FND_API.G_MISS_NUM ) THEN
705: IF ( p_x_route_rec.accounting_class_code = FND_API.G_MISS_CHAR ) THEN
706: p_x_route_rec.accounting_class_code := null;
707: END IF;
708:
709: IF ( p_x_route_rec.accounting_class_org_id = FND_API.G_MISS_NUM ) THEN
710: p_x_route_rec.accounting_class_org_id := null;
711: END IF;
712:
713: IF ( p_x_route_rec.accounting_class = FND_API.G_MISS_CHAR ) THEN
709: IF ( p_x_route_rec.accounting_class_org_id = FND_API.G_MISS_NUM ) THEN
710: p_x_route_rec.accounting_class_org_id := null;
711: END IF;
712:
713: IF ( p_x_route_rec.accounting_class = FND_API.G_MISS_CHAR ) THEN
714: p_x_route_rec.accounting_class := null;
715: END IF;
716:
717: IF ( p_x_route_rec.task_template_group_id = FND_API.G_MISS_NUM ) THEN
713: IF ( p_x_route_rec.accounting_class = FND_API.G_MISS_CHAR ) THEN
714: p_x_route_rec.accounting_class := null;
715: END IF;
716:
717: IF ( p_x_route_rec.task_template_group_id = FND_API.G_MISS_NUM ) THEN
718: p_x_route_rec.task_template_group_id := null;
719: END IF;
720:
721: IF ( p_x_route_rec.task_template_group = FND_API.G_MISS_CHAR ) THEN
717: IF ( p_x_route_rec.task_template_group_id = FND_API.G_MISS_NUM ) THEN
718: p_x_route_rec.task_template_group_id := null;
719: END IF;
720:
721: IF ( p_x_route_rec.task_template_group = FND_API.G_MISS_CHAR ) THEN
722: p_x_route_rec.task_template_group := null;
723: END IF;
724:
725: IF ( p_x_route_rec.qa_inspection_type = FND_API.G_MISS_CHAR ) THEN
721: IF ( p_x_route_rec.task_template_group = FND_API.G_MISS_CHAR ) THEN
722: p_x_route_rec.task_template_group := null;
723: END IF;
724:
725: IF ( p_x_route_rec.qa_inspection_type = FND_API.G_MISS_CHAR ) THEN
726: p_x_route_rec.qa_inspection_type := null;
727: END IF;
728:
729: IF ( p_x_route_rec.qa_inspection_type_desc = FND_API.G_MISS_CHAR ) THEN
725: IF ( p_x_route_rec.qa_inspection_type = FND_API.G_MISS_CHAR ) THEN
726: p_x_route_rec.qa_inspection_type := null;
727: END IF;
728:
729: IF ( p_x_route_rec.qa_inspection_type_desc = FND_API.G_MISS_CHAR ) THEN
730: p_x_route_rec.qa_inspection_type_desc := null;
731: END IF;
732:
733: IF ( p_x_route_rec.remarks = FND_API.G_MISS_CHAR ) THEN
729: IF ( p_x_route_rec.qa_inspection_type_desc = FND_API.G_MISS_CHAR ) THEN
730: p_x_route_rec.qa_inspection_type_desc := null;
731: END IF;
732:
733: IF ( p_x_route_rec.remarks = FND_API.G_MISS_CHAR ) THEN
734: p_x_route_rec.remarks := null;
735: END IF;
736:
737: IF ( p_x_route_rec.revision_notes = FND_API.G_MISS_CHAR ) THEN
733: IF ( p_x_route_rec.remarks = FND_API.G_MISS_CHAR ) THEN
734: p_x_route_rec.remarks := null;
735: END IF;
736:
737: IF ( p_x_route_rec.revision_notes = FND_API.G_MISS_CHAR ) THEN
738: p_x_route_rec.revision_notes := null;
739: END IF;
740:
741: IF ( p_x_route_rec.segment1 = FND_API.G_MISS_CHAR ) THEN
737: IF ( p_x_route_rec.revision_notes = FND_API.G_MISS_CHAR ) THEN
738: p_x_route_rec.revision_notes := null;
739: END IF;
740:
741: IF ( p_x_route_rec.segment1 = FND_API.G_MISS_CHAR ) THEN
742: p_x_route_rec.segment1 := null;
743: END IF;
744:
745: IF ( p_x_route_rec.segment2 = FND_API.G_MISS_CHAR ) THEN
741: IF ( p_x_route_rec.segment1 = FND_API.G_MISS_CHAR ) THEN
742: p_x_route_rec.segment1 := null;
743: END IF;
744:
745: IF ( p_x_route_rec.segment2 = FND_API.G_MISS_CHAR ) THEN
746: p_x_route_rec.segment2 := null;
747: END IF;
748:
749: IF ( p_x_route_rec.segment3 = FND_API.G_MISS_CHAR ) THEN
745: IF ( p_x_route_rec.segment2 = FND_API.G_MISS_CHAR ) THEN
746: p_x_route_rec.segment2 := null;
747: END IF;
748:
749: IF ( p_x_route_rec.segment3 = FND_API.G_MISS_CHAR ) THEN
750: p_x_route_rec.segment3 := null;
751: END IF;
752:
753: IF ( p_x_route_rec.segment4 = FND_API.G_MISS_CHAR ) THEN
749: IF ( p_x_route_rec.segment3 = FND_API.G_MISS_CHAR ) THEN
750: p_x_route_rec.segment3 := null;
751: END IF;
752:
753: IF ( p_x_route_rec.segment4 = FND_API.G_MISS_CHAR ) THEN
754: p_x_route_rec.segment4 := null;
755: END IF;
756:
757: IF ( p_x_route_rec.segment5 = FND_API.G_MISS_CHAR ) THEN
753: IF ( p_x_route_rec.segment4 = FND_API.G_MISS_CHAR ) THEN
754: p_x_route_rec.segment4 := null;
755: END IF;
756:
757: IF ( p_x_route_rec.segment5 = FND_API.G_MISS_CHAR ) THEN
758: p_x_route_rec.segment5 := null;
759: END IF;
760:
761: IF ( p_x_route_rec.segment6 = FND_API.G_MISS_CHAR ) THEN
757: IF ( p_x_route_rec.segment5 = FND_API.G_MISS_CHAR ) THEN
758: p_x_route_rec.segment5 := null;
759: END IF;
760:
761: IF ( p_x_route_rec.segment6 = FND_API.G_MISS_CHAR ) THEN
762: p_x_route_rec.segment6 := null;
763: END IF;
764:
765: IF ( p_x_route_rec.segment7 = FND_API.G_MISS_CHAR ) THEN
761: IF ( p_x_route_rec.segment6 = FND_API.G_MISS_CHAR ) THEN
762: p_x_route_rec.segment6 := null;
763: END IF;
764:
765: IF ( p_x_route_rec.segment7 = FND_API.G_MISS_CHAR ) THEN
766: p_x_route_rec.segment7 := null;
767: END IF;
768:
769: IF ( p_x_route_rec.segment8 = FND_API.G_MISS_CHAR ) THEN
765: IF ( p_x_route_rec.segment7 = FND_API.G_MISS_CHAR ) THEN
766: p_x_route_rec.segment7 := null;
767: END IF;
768:
769: IF ( p_x_route_rec.segment8 = FND_API.G_MISS_CHAR ) THEN
770: p_x_route_rec.segment8 := null;
771: END IF;
772:
773: IF ( p_x_route_rec.segment9 = FND_API.G_MISS_CHAR ) THEN
769: IF ( p_x_route_rec.segment8 = FND_API.G_MISS_CHAR ) THEN
770: p_x_route_rec.segment8 := null;
771: END IF;
772:
773: IF ( p_x_route_rec.segment9 = FND_API.G_MISS_CHAR ) THEN
774: p_x_route_rec.segment9 := null;
775: END IF;
776:
777: IF ( p_x_route_rec.segment10 = FND_API.G_MISS_CHAR ) THEN
773: IF ( p_x_route_rec.segment9 = FND_API.G_MISS_CHAR ) THEN
774: p_x_route_rec.segment9 := null;
775: END IF;
776:
777: IF ( p_x_route_rec.segment10 = FND_API.G_MISS_CHAR ) THEN
778: p_x_route_rec.segment10 := null;
779: END IF;
780:
781: IF ( p_x_route_rec.segment11 = FND_API.G_MISS_CHAR ) THEN
777: IF ( p_x_route_rec.segment10 = FND_API.G_MISS_CHAR ) THEN
778: p_x_route_rec.segment10 := null;
779: END IF;
780:
781: IF ( p_x_route_rec.segment11 = FND_API.G_MISS_CHAR ) THEN
782: p_x_route_rec.segment11 := null;
783: END IF;
784:
785: IF ( p_x_route_rec.segment12 = FND_API.G_MISS_CHAR ) THEN
781: IF ( p_x_route_rec.segment11 = FND_API.G_MISS_CHAR ) THEN
782: p_x_route_rec.segment11 := null;
783: END IF;
784:
785: IF ( p_x_route_rec.segment12 = FND_API.G_MISS_CHAR ) THEN
786: p_x_route_rec.segment12 := null;
787: END IF;
788:
789: IF ( p_x_route_rec.segment13 = FND_API.G_MISS_CHAR ) THEN
785: IF ( p_x_route_rec.segment12 = FND_API.G_MISS_CHAR ) THEN
786: p_x_route_rec.segment12 := null;
787: END IF;
788:
789: IF ( p_x_route_rec.segment13 = FND_API.G_MISS_CHAR ) THEN
790: p_x_route_rec.segment13 := null;
791: END IF;
792:
793: IF ( p_x_route_rec.segment14 = FND_API.G_MISS_CHAR ) THEN
789: IF ( p_x_route_rec.segment13 = FND_API.G_MISS_CHAR ) THEN
790: p_x_route_rec.segment13 := null;
791: END IF;
792:
793: IF ( p_x_route_rec.segment14 = FND_API.G_MISS_CHAR ) THEN
794: p_x_route_rec.segment14 := null;
795: END IF;
796:
797: IF ( p_x_route_rec.segment15 = FND_API.G_MISS_CHAR ) THEN
793: IF ( p_x_route_rec.segment14 = FND_API.G_MISS_CHAR ) THEN
794: p_x_route_rec.segment14 := null;
795: END IF;
796:
797: IF ( p_x_route_rec.segment15 = FND_API.G_MISS_CHAR ) THEN
798: p_x_route_rec.segment15 := null;
799: END IF;
800:
801: IF ( p_x_route_rec.attribute_category = FND_API.G_MISS_CHAR ) THEN
797: IF ( p_x_route_rec.segment15 = FND_API.G_MISS_CHAR ) THEN
798: p_x_route_rec.segment15 := null;
799: END IF;
800:
801: IF ( p_x_route_rec.attribute_category = FND_API.G_MISS_CHAR ) THEN
802: p_x_route_rec.attribute_category := null;
803: END IF;
804:
805: IF ( p_x_route_rec.attribute1 = FND_API.G_MISS_CHAR ) THEN
801: IF ( p_x_route_rec.attribute_category = FND_API.G_MISS_CHAR ) THEN
802: p_x_route_rec.attribute_category := null;
803: END IF;
804:
805: IF ( p_x_route_rec.attribute1 = FND_API.G_MISS_CHAR ) THEN
806: p_x_route_rec.attribute1 := null;
807: END IF;
808:
809: IF ( p_x_route_rec.attribute2 = FND_API.G_MISS_CHAR ) THEN
805: IF ( p_x_route_rec.attribute1 = FND_API.G_MISS_CHAR ) THEN
806: p_x_route_rec.attribute1 := null;
807: END IF;
808:
809: IF ( p_x_route_rec.attribute2 = FND_API.G_MISS_CHAR ) THEN
810: p_x_route_rec.attribute2 := null;
811: END IF;
812:
813: IF ( p_x_route_rec.attribute3 = FND_API.G_MISS_CHAR ) THEN
809: IF ( p_x_route_rec.attribute2 = FND_API.G_MISS_CHAR ) THEN
810: p_x_route_rec.attribute2 := null;
811: END IF;
812:
813: IF ( p_x_route_rec.attribute3 = FND_API.G_MISS_CHAR ) THEN
814: p_x_route_rec.attribute3 := null;
815: END IF;
816:
817: IF ( p_x_route_rec.attribute4 = FND_API.G_MISS_CHAR ) THEN
813: IF ( p_x_route_rec.attribute3 = FND_API.G_MISS_CHAR ) THEN
814: p_x_route_rec.attribute3 := null;
815: END IF;
816:
817: IF ( p_x_route_rec.attribute4 = FND_API.G_MISS_CHAR ) THEN
818: p_x_route_rec.attribute4 := null;
819: END IF;
820:
821: IF ( p_x_route_rec.attribute5 = FND_API.G_MISS_CHAR ) THEN
817: IF ( p_x_route_rec.attribute4 = FND_API.G_MISS_CHAR ) THEN
818: p_x_route_rec.attribute4 := null;
819: END IF;
820:
821: IF ( p_x_route_rec.attribute5 = FND_API.G_MISS_CHAR ) THEN
822: p_x_route_rec.attribute5 := null;
823: END IF;
824:
825: IF ( p_x_route_rec.attribute6 = FND_API.G_MISS_CHAR ) THEN
821: IF ( p_x_route_rec.attribute5 = FND_API.G_MISS_CHAR ) THEN
822: p_x_route_rec.attribute5 := null;
823: END IF;
824:
825: IF ( p_x_route_rec.attribute6 = FND_API.G_MISS_CHAR ) THEN
826: p_x_route_rec.attribute6 := null;
827: END IF;
828:
829: IF ( p_x_route_rec.attribute7 = FND_API.G_MISS_CHAR ) THEN
825: IF ( p_x_route_rec.attribute6 = FND_API.G_MISS_CHAR ) THEN
826: p_x_route_rec.attribute6 := null;
827: END IF;
828:
829: IF ( p_x_route_rec.attribute7 = FND_API.G_MISS_CHAR ) THEN
830: p_x_route_rec.attribute7 := null;
831: END IF;
832:
833: IF ( p_x_route_rec.attribute8 = FND_API.G_MISS_CHAR ) THEN
829: IF ( p_x_route_rec.attribute7 = FND_API.G_MISS_CHAR ) THEN
830: p_x_route_rec.attribute7 := null;
831: END IF;
832:
833: IF ( p_x_route_rec.attribute8 = FND_API.G_MISS_CHAR ) THEN
834: p_x_route_rec.attribute8 := null;
835: END IF;
836:
837: IF ( p_x_route_rec.attribute9 = FND_API.G_MISS_CHAR ) THEN
833: IF ( p_x_route_rec.attribute8 = FND_API.G_MISS_CHAR ) THEN
834: p_x_route_rec.attribute8 := null;
835: END IF;
836:
837: IF ( p_x_route_rec.attribute9 = FND_API.G_MISS_CHAR ) THEN
838: p_x_route_rec.attribute9 := null;
839: END IF;
840:
841: IF ( p_x_route_rec.attribute10 = FND_API.G_MISS_CHAR ) THEN
837: IF ( p_x_route_rec.attribute9 = FND_API.G_MISS_CHAR ) THEN
838: p_x_route_rec.attribute9 := null;
839: END IF;
840:
841: IF ( p_x_route_rec.attribute10 = FND_API.G_MISS_CHAR ) THEN
842: p_x_route_rec.attribute10 := null;
843: END IF;
844:
845: IF ( p_x_route_rec.attribute11 = FND_API.G_MISS_CHAR ) THEN
841: IF ( p_x_route_rec.attribute10 = FND_API.G_MISS_CHAR ) THEN
842: p_x_route_rec.attribute10 := null;
843: END IF;
844:
845: IF ( p_x_route_rec.attribute11 = FND_API.G_MISS_CHAR ) THEN
846: p_x_route_rec.attribute11 := null;
847: END IF;
848:
849: IF ( p_x_route_rec.attribute12 = FND_API.G_MISS_CHAR ) THEN
845: IF ( p_x_route_rec.attribute11 = FND_API.G_MISS_CHAR ) THEN
846: p_x_route_rec.attribute11 := null;
847: END IF;
848:
849: IF ( p_x_route_rec.attribute12 = FND_API.G_MISS_CHAR ) THEN
850: p_x_route_rec.attribute12 := null;
851: END IF;
852:
853: IF ( p_x_route_rec.attribute13 = FND_API.G_MISS_CHAR ) THEN
849: IF ( p_x_route_rec.attribute12 = FND_API.G_MISS_CHAR ) THEN
850: p_x_route_rec.attribute12 := null;
851: END IF;
852:
853: IF ( p_x_route_rec.attribute13 = FND_API.G_MISS_CHAR ) THEN
854: p_x_route_rec.attribute13 := null;
855: END IF;
856:
857: IF ( p_x_route_rec.attribute14 = FND_API.G_MISS_CHAR ) THEN
853: IF ( p_x_route_rec.attribute13 = FND_API.G_MISS_CHAR ) THEN
854: p_x_route_rec.attribute13 := null;
855: END IF;
856:
857: IF ( p_x_route_rec.attribute14 = FND_API.G_MISS_CHAR ) THEN
858: p_x_route_rec.attribute14 := null;
859: END IF;
860:
861: IF ( p_x_route_rec.attribute15 = FND_API.G_MISS_CHAR ) THEN
857: IF ( p_x_route_rec.attribute14 = FND_API.G_MISS_CHAR ) THEN
858: p_x_route_rec.attribute14 := null;
859: END IF;
860:
861: IF ( p_x_route_rec.attribute15 = FND_API.G_MISS_CHAR ) THEN
862: p_x_route_rec.attribute15 := null;
863: END IF;
864:
865: --pdoki added for Bug 6504159
862: p_x_route_rec.attribute15 := null;
863: END IF;
864:
865: --pdoki added for Bug 6504159
866: IF ( p_x_route_rec.unit_receipt_update_flag = FND_API.G_MISS_CHAR ) THEN
867: p_x_route_rec.unit_receipt_update_flag := 'N';
868: END IF;
869: END default_missing_attributes;
870:
956: FROM AHL_ROUTES_V
957: WHERE route_id = c_route_id;
958:
959: BEGIN
960: x_return_status := FND_API.G_RET_STS_SUCCESS;
961:
962: -- Get the old record from AHL_ROUTES_V.
963: OPEN get_old_rec( p_route_id );
964:
1037: p_x_route_rec.attribute15;
1038:
1039: IF ( get_old_rec%NOTFOUND ) THEN
1040: x_msg_data := 'AHL_RM_INVALID_ROUTE';
1041: x_return_status := FND_API.G_RET_STS_ERROR;
1042: END IF;
1043:
1044: IF ( p_x_route_rec.object_version_number <> p_object_version_number ) THEN
1045: x_msg_data := 'AHL_COM_RECORD_CHANGED';
1042: END IF;
1043:
1044: IF ( p_x_route_rec.object_version_number <> p_object_version_number ) THEN
1045: x_msg_data := 'AHL_COM_RECORD_CHANGED';
1046: x_return_status := FND_API.G_RET_STS_ERROR;
1047: END IF;
1048:
1049: CLOSE get_old_rec;
1050:
1072: p_object_version_number => p_x_route_rec.object_version_number,
1073: p_x_route_rec => l_old_route_rec
1074: );
1075:
1076: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
1077: FND_MESSAGE.set_name( 'AHL', l_msg_data );
1078: FND_MSG_PUB.add;
1079: RAISE FND_API.G_EXC_ERROR;
1080: END IF;
1075:
1076: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
1077: FND_MESSAGE.set_name( 'AHL', l_msg_data );
1078: FND_MSG_PUB.add;
1079: RAISE FND_API.G_EXC_ERROR;
1080: END IF;
1081:
1082: -- Convert G_MISS values to NULL and NULL values to Old values
1083: IF ( p_x_route_rec.revision_status_code IS NULL ) THEN
1122:
1123:
1124: IF ( l_old_route_rec.enigma_doc_id IS NOT NULL AND p_x_route_rec.file_id IS NULL ) THEN
1125: p_x_route_rec.file_id := l_old_route_rec.file_id;
1126: ELSIF ( p_x_route_rec.file_id = FND_API.G_MISS_NUM) THEN
1127: p_x_route_rec.file_id := null;
1128: END IF;
1129: --bachandr Enigma Phase I changes -- end
1130:
1162: ELSE
1163: IF ( l_read_only_flag = 'Y' ) THEN
1164: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_ST_DATE_RO' );
1165: FND_MSG_PUB.add;
1166: ELSIF ( p_x_route_rec.active_start_date = FND_API.G_MISS_DATE ) THEN
1167: p_x_route_rec.active_start_date := NULL;
1168: END IF;
1169: END IF;
1170:
1178: END IF;
1179:
1180: IF ( p_x_route_rec.route_type_code IS NULL ) THEN
1181: p_x_route_rec.route_type_code := l_old_route_rec.route_type_code;
1182: ELSIF ( p_x_route_rec.route_type_code = FND_API.G_MISS_CHAR ) THEN
1183: p_x_route_rec.route_type_code := null;
1184: END IF;
1185:
1186: IF ( p_x_route_rec.route_type IS NULL ) THEN
1184: END IF;
1185:
1186: IF ( p_x_route_rec.route_type IS NULL ) THEN
1187: p_x_route_rec.route_type := l_old_route_rec.route_type;
1188: ELSIF ( p_x_route_rec.route_type = FND_API.G_MISS_CHAR ) THEN
1189: p_x_route_rec.route_type := null;
1190: END IF;
1191: --pdoki added for Bug 6504159
1192: IF ( p_x_route_rec.unit_receipt_update_flag IS NULL ) THEN
1190: END IF;
1191: --pdoki added for Bug 6504159
1192: IF ( p_x_route_rec.unit_receipt_update_flag IS NULL ) THEN
1193: p_x_route_rec.unit_receipt_update_flag := l_old_route_rec.unit_receipt_update_flag;
1194: ELSIF ( p_x_route_rec.unit_receipt_update_flag = FND_API.G_MISS_CHAR ) THEN
1195: p_x_route_rec.unit_receipt_update_flag := 'N';
1196: END IF;
1197:
1198: --bachandr Enigma Phase I changes -- start
1200:
1201: IF ( l_old_route_rec.enigma_doc_id IS NULL ) THEN
1202: IF ( p_x_route_rec.model_code IS NULL ) THEN
1203: p_x_route_rec.model_code := l_old_route_rec.model_code;
1204: ELSIF ( p_x_route_rec.model_code = FND_API.G_MISS_CHAR ) THEN
1205: p_x_route_rec.model_code := null;
1206: END IF;
1207:
1208: IF ( p_x_route_rec.model_meaning IS NULL ) THEN
1206: END IF;
1207:
1208: IF ( p_x_route_rec.model_meaning IS NULL ) THEN
1209: p_x_route_rec.model_meaning := l_old_route_rec.model_meaning;
1210: ELSIF ( p_x_route_rec.model_meaning = FND_API.G_MISS_CHAR ) THEN
1211: p_x_route_rec.model_meaning := null;
1212: END IF;
1213: END IF;
1214: --bachandr Enigma Phase I changes -- end
1214: --bachandr Enigma Phase I changes -- end
1215:
1216: IF ( p_x_route_rec.process_code IS NULL ) THEN
1217: p_x_route_rec.process_code := l_old_route_rec.process_code;
1218: ELSIF ( p_x_route_rec.process_code = FND_API.G_MISS_CHAR ) THEN
1219: p_x_route_rec.process_code := null;
1220: END IF;
1221:
1222: IF ( p_x_route_rec.process IS NULL ) THEN
1220: END IF;
1221:
1222: IF ( p_x_route_rec.process IS NULL ) THEN
1223: p_x_route_rec.process := l_old_route_rec.process;
1224: ELSIF ( p_x_route_rec.process = FND_API.G_MISS_CHAR ) THEN
1225: p_x_route_rec.process := null;
1226: END IF;
1227:
1228: IF ( p_x_route_rec.product_type_code IS NULL ) THEN
1226: END IF;
1227:
1228: IF ( p_x_route_rec.product_type_code IS NULL ) THEN
1229: p_x_route_rec.product_type_code := l_old_route_rec.product_type_code;
1230: ELSIF ( p_x_route_rec.product_type_code = FND_API.G_MISS_CHAR ) THEN
1231: p_x_route_rec.product_type_code := null;
1232: END IF;
1233:
1234: IF ( p_x_route_rec.product_type IS NULL ) THEN
1232: END IF;
1233:
1234: IF ( p_x_route_rec.product_type IS NULL ) THEN
1235: p_x_route_rec.product_type := l_old_route_rec.product_type;
1236: ELSIF ( p_x_route_rec.product_type = FND_API.G_MISS_CHAR ) THEN
1237: p_x_route_rec.product_type := null;
1238: END IF;
1239:
1240: IF ( p_x_route_rec.operator_party_id IS NULL ) THEN
1243: IF ( l_read_only_flag = 'Y' ) THEN
1244: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_ROUTE_OPERATOR_RO' );
1245: FND_MSG_PUB.add;
1246: ELSE
1247: IF ( p_x_route_rec.operator_party_id = FND_API.G_MISS_NUM ) THEN
1248: p_x_route_rec.operator_party_id := null;
1249: END IF;
1250: END IF;
1251: END IF;
1256: IF ( l_read_only_flag = 'Y' ) THEN
1257: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_ROUTE_OPERATOR_RO' );
1258: FND_MSG_PUB.add;
1259: ELSE
1260: IF ( p_x_route_rec.operator_name = FND_API.G_MISS_CHAR ) THEN
1261: p_x_route_rec.operator_name := null;
1262: END IF;
1263: END IF;
1264: END IF;
1264: END IF;
1265:
1266: IF ( p_x_route_rec.zone_code IS NULL ) THEN
1267: p_x_route_rec.zone_code := l_old_route_rec.zone_code;
1268: ELSIF ( p_x_route_rec.zone_code = FND_API.G_MISS_CHAR ) THEN
1269: p_x_route_rec.zone_code := null;
1270: END IF;
1271:
1272: IF ( p_x_route_rec.zone IS NULL ) THEN
1270: END IF;
1271:
1272: IF ( p_x_route_rec.zone IS NULL ) THEN
1273: p_x_route_rec.zone := l_old_route_rec.zone;
1274: ELSIF ( p_x_route_rec.zone = FND_API.G_MISS_CHAR ) THEN
1275: p_x_route_rec.zone := null;
1276: END IF;
1277:
1278: IF ( p_x_route_rec.sub_zone_code IS NULL ) THEN
1276: END IF;
1277:
1278: IF ( p_x_route_rec.sub_zone_code IS NULL ) THEN
1279: p_x_route_rec.sub_zone_code := l_old_route_rec.sub_zone_code;
1280: ELSIF ( p_x_route_rec.sub_zone_code = FND_API.G_MISS_CHAR ) THEN
1281: p_x_route_rec.sub_zone_code := null;
1282: END IF;
1283:
1284: IF ( p_x_route_rec.sub_zone IS NULL ) THEN
1282: END IF;
1283:
1284: IF ( p_x_route_rec.sub_zone IS NULL ) THEN
1285: p_x_route_rec.sub_zone := l_old_route_rec.sub_zone;
1286: ELSIF ( p_x_route_rec.sub_zone = FND_API.G_MISS_CHAR ) THEN
1287: p_x_route_rec.sub_zone := null;
1288: END IF;
1289:
1290: IF ( p_x_route_rec.service_item_id IS NULL ) THEN
1293: IF ( l_read_only_flag = 'Y' ) THEN
1294: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_ROUTE_SVC_ITEM_RO' );
1295: FND_MSG_PUB.add;
1296: ELSE
1297: IF ( p_x_route_rec.service_item_id = FND_API.G_MISS_NUM ) THEN
1298: p_x_route_rec.service_item_id := null;
1299: END IF;
1300: END IF;
1301: END IF;
1306: IF ( l_read_only_flag = 'Y' ) THEN
1307: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_ROUTE_SVC_ITEM_RO' );
1308: FND_MSG_PUB.add;
1309: ELSE
1310: IF ( p_x_route_rec.service_item_org_id = FND_API.G_MISS_NUM ) THEN
1311: p_x_route_rec.service_item_org_id := null;
1312: END IF;
1313: END IF;
1314: END IF;
1319: IF ( l_read_only_flag = 'Y' ) THEN
1320: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_ROUTE_SVC_ITEM_RO' );
1321: FND_MSG_PUB.add;
1322: ELSE
1323: IF ( p_x_route_rec.service_item_number = FND_API.G_MISS_CHAR ) THEN
1324: p_x_route_rec.service_item_number := null;
1325: END IF;
1326: END IF;
1327: END IF;
1327: END IF;
1328:
1329: IF ( p_x_route_rec.accounting_class_code IS NULL ) THEN
1330: p_x_route_rec.accounting_class_code := l_old_route_rec.accounting_class_code;
1331: ELSIF ( p_x_route_rec.accounting_class_code = FND_API.G_MISS_CHAR ) THEN
1332: p_x_route_rec.accounting_class_code := null;
1333: END IF;
1334:
1335: IF ( p_x_route_rec.accounting_class_org_id IS NULL ) THEN
1333: END IF;
1334:
1335: IF ( p_x_route_rec.accounting_class_org_id IS NULL ) THEN
1336: p_x_route_rec.accounting_class_org_id := l_old_route_rec.accounting_class_org_id;
1337: ELSIF ( p_x_route_rec.accounting_class_org_id = FND_API.G_MISS_NUM ) THEN
1338: p_x_route_rec.accounting_class_org_id := null;
1339: END IF;
1340:
1341: IF ( p_x_route_rec.accounting_class IS NULL ) THEN
1339: END IF;
1340:
1341: IF ( p_x_route_rec.accounting_class IS NULL ) THEN
1342: p_x_route_rec.accounting_class := l_old_route_rec.accounting_class;
1343: ELSIF ( p_x_route_rec.accounting_class = FND_API.G_MISS_CHAR ) THEN
1344: p_x_route_rec.accounting_class := null;
1345: END IF;
1346:
1347: IF ( p_x_route_rec.task_template_group_id IS NULL ) THEN
1350: IF ( l_read_only_flag = 'Y' ) THEN
1351: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_ROUTE_TASK_TEMP_RO' );
1352: FND_MSG_PUB.add;
1353: ELSE
1354: IF ( p_x_route_rec.task_template_group_id = FND_API.G_MISS_NUM ) THEN
1355: p_x_route_rec.task_template_group_id := null;
1356: END IF;
1357: END IF;
1358: END IF;
1363: IF ( l_read_only_flag = 'Y' ) THEN
1364: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_ROUTE_TASK_TEMP_RO' );
1365: FND_MSG_PUB.add;
1366: ELSE
1367: IF ( p_x_route_rec.task_template_group = FND_API.G_MISS_CHAR ) THEN
1368: p_x_route_rec.task_template_group := null;
1369: END IF;
1370: END IF;
1371: END IF;
1376: IF ( l_read_only_flag = 'Y' ) THEN
1377: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_QA_INSP_TYPE_RO' );
1378: FND_MSG_PUB.add;
1379: ELSE
1380: IF ( p_x_route_rec.qa_inspection_type = FND_API.G_MISS_CHAR ) THEN
1381: p_x_route_rec.qa_inspection_type := null;
1382: END IF;
1383: END IF;
1384: END IF;
1389: IF ( l_read_only_flag = 'Y' ) THEN
1390: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_QA_INSP_TYPE_RO' );
1391: FND_MSG_PUB.add;
1392: ELSE
1393: IF ( p_x_route_rec.qa_inspection_type_desc = FND_API.G_MISS_CHAR ) THEN
1394: p_x_route_rec.qa_inspection_type_desc := null;
1395: END IF;
1396: END IF;
1397: END IF;
1397: END IF;
1398:
1399: IF ( p_x_route_rec.time_span IS NULL ) THEN
1400: p_x_route_rec.time_span := l_old_route_rec.time_span;
1401: ELSIF ( p_x_route_rec.time_span = FND_API.G_MISS_NUM ) THEN
1402: p_x_route_rec.time_span := null;
1403: END IF;
1404:
1405: IF ( p_x_route_rec.remarks IS NULL ) THEN
1403: END IF;
1404:
1405: IF ( p_x_route_rec.remarks IS NULL ) THEN
1406: p_x_route_rec.remarks := l_old_route_rec.remarks;
1407: ELSIF ( p_x_route_rec.remarks = FND_API.G_MISS_CHAR ) THEN
1408: p_x_route_rec.remarks := null;
1409: END IF;
1410:
1411: IF ( p_x_route_rec.revision_notes IS NULL ) THEN
1409: END IF;
1410:
1411: IF ( p_x_route_rec.revision_notes IS NULL ) THEN
1412: p_x_route_rec.revision_notes := l_old_route_rec.revision_notes;
1413: ELSIF ( p_x_route_rec.revision_notes = FND_API.G_MISS_CHAR ) THEN
1414: p_x_route_rec.revision_notes := null;
1415: END IF;
1416:
1417: IF ( p_x_route_rec.segment1 IS NULL ) THEN
1415: END IF;
1416:
1417: IF ( p_x_route_rec.segment1 IS NULL ) THEN
1418: p_x_route_rec.segment1 := l_old_route_rec.segment1;
1419: ELSIF ( p_x_route_rec.segment1 = FND_API.G_MISS_CHAR ) THEN
1420: p_x_route_rec.segment1 := null;
1421: END IF;
1422:
1423: IF ( p_x_route_rec.segment2 IS NULL ) THEN
1421: END IF;
1422:
1423: IF ( p_x_route_rec.segment2 IS NULL ) THEN
1424: p_x_route_rec.segment2 := l_old_route_rec.segment2;
1425: ELSIF ( p_x_route_rec.segment2 = FND_API.G_MISS_CHAR ) THEN
1426: p_x_route_rec.segment2 := null;
1427: END IF;
1428:
1429: IF ( p_x_route_rec.segment3 IS NULL ) THEN
1427: END IF;
1428:
1429: IF ( p_x_route_rec.segment3 IS NULL ) THEN
1430: p_x_route_rec.segment3 := l_old_route_rec.segment3;
1431: ELSIF ( p_x_route_rec.segment3 = FND_API.G_MISS_CHAR ) THEN
1432: p_x_route_rec.segment3 := null;
1433: END IF;
1434:
1435: IF ( p_x_route_rec.segment4 IS NULL ) THEN
1433: END IF;
1434:
1435: IF ( p_x_route_rec.segment4 IS NULL ) THEN
1436: p_x_route_rec.segment4 := l_old_route_rec.segment4;
1437: ELSIF ( p_x_route_rec.segment4 = FND_API.G_MISS_CHAR ) THEN
1438: p_x_route_rec.segment4 := null;
1439: END IF;
1440:
1441: IF ( p_x_route_rec.segment5 IS NULL ) THEN
1439: END IF;
1440:
1441: IF ( p_x_route_rec.segment5 IS NULL ) THEN
1442: p_x_route_rec.segment5 := l_old_route_rec.segment5;
1443: ELSIF ( p_x_route_rec.segment5 = FND_API.G_MISS_CHAR ) THEN
1444: p_x_route_rec.segment5 := null;
1445: END IF;
1446:
1447: IF ( p_x_route_rec.segment6 IS NULL ) THEN
1445: END IF;
1446:
1447: IF ( p_x_route_rec.segment6 IS NULL ) THEN
1448: p_x_route_rec.segment6 := l_old_route_rec.segment6;
1449: ELSIF ( p_x_route_rec.segment6 = FND_API.G_MISS_CHAR ) THEN
1450: p_x_route_rec.segment6 := null;
1451: END IF;
1452:
1453: IF ( p_x_route_rec.segment7 IS NULL ) THEN
1451: END IF;
1452:
1453: IF ( p_x_route_rec.segment7 IS NULL ) THEN
1454: p_x_route_rec.segment7 := l_old_route_rec.segment7;
1455: ELSIF ( p_x_route_rec.segment7 = FND_API.G_MISS_CHAR ) THEN
1456: p_x_route_rec.segment7 := null;
1457: END IF;
1458:
1459: IF ( p_x_route_rec.segment8 IS NULL ) THEN
1457: END IF;
1458:
1459: IF ( p_x_route_rec.segment8 IS NULL ) THEN
1460: p_x_route_rec.segment8 := l_old_route_rec.segment8;
1461: ELSIF ( p_x_route_rec.segment8 = FND_API.G_MISS_CHAR ) THEN
1462: p_x_route_rec.segment8 := null;
1463: END IF;
1464:
1465: IF ( p_x_route_rec.segment9 IS NULL ) THEN
1463: END IF;
1464:
1465: IF ( p_x_route_rec.segment9 IS NULL ) THEN
1466: p_x_route_rec.segment9 := l_old_route_rec.segment9;
1467: ELSIF ( p_x_route_rec.segment9 = FND_API.G_MISS_CHAR ) THEN
1468: p_x_route_rec.segment9 := null;
1469: END IF;
1470:
1471: IF ( p_x_route_rec.segment10 IS NULL ) THEN
1469: END IF;
1470:
1471: IF ( p_x_route_rec.segment10 IS NULL ) THEN
1472: p_x_route_rec.segment10 := l_old_route_rec.segment10;
1473: ELSIF ( p_x_route_rec.segment10 = FND_API.G_MISS_CHAR ) THEN
1474: p_x_route_rec.segment10 := null;
1475: END IF;
1476:
1477: IF ( p_x_route_rec.segment11 IS NULL ) THEN
1475: END IF;
1476:
1477: IF ( p_x_route_rec.segment11 IS NULL ) THEN
1478: p_x_route_rec.segment11 := l_old_route_rec.segment11;
1479: ELSIF ( p_x_route_rec.segment11 = FND_API.G_MISS_CHAR ) THEN
1480: p_x_route_rec.segment11 := null;
1481: END IF;
1482:
1483: IF ( p_x_route_rec.segment12 IS NULL ) THEN
1481: END IF;
1482:
1483: IF ( p_x_route_rec.segment12 IS NULL ) THEN
1484: p_x_route_rec.segment12 := l_old_route_rec.segment12;
1485: ELSIF ( p_x_route_rec.segment12 = FND_API.G_MISS_CHAR ) THEN
1486: p_x_route_rec.segment12 := null;
1487: END IF;
1488:
1489: IF ( p_x_route_rec.segment13 IS NULL ) THEN
1487: END IF;
1488:
1489: IF ( p_x_route_rec.segment13 IS NULL ) THEN
1490: p_x_route_rec.segment13 := l_old_route_rec.segment13;
1491: ELSIF ( p_x_route_rec.segment13 = FND_API.G_MISS_CHAR ) THEN
1492: p_x_route_rec.segment13 := null;
1493: END IF;
1494:
1495: IF ( p_x_route_rec.segment14 IS NULL ) THEN
1493: END IF;
1494:
1495: IF ( p_x_route_rec.segment14 IS NULL ) THEN
1496: p_x_route_rec.segment14 := l_old_route_rec.segment14;
1497: ELSIF ( p_x_route_rec.segment14 = FND_API.G_MISS_CHAR ) THEN
1498: p_x_route_rec.segment14 := null;
1499: END IF;
1500:
1501: IF ( p_x_route_rec.segment15 IS NULL ) THEN
1499: END IF;
1500:
1501: IF ( p_x_route_rec.segment15 IS NULL ) THEN
1502: p_x_route_rec.segment15 := l_old_route_rec.segment15;
1503: ELSIF ( p_x_route_rec.segment15 = FND_API.G_MISS_CHAR ) THEN
1504: p_x_route_rec.segment15 := null;
1505: END IF;
1506:
1507: IF ( p_x_route_rec.attribute_category IS NULL ) THEN
1505: END IF;
1506:
1507: IF ( p_x_route_rec.attribute_category IS NULL ) THEN
1508: p_x_route_rec.attribute_category := l_old_route_rec.attribute_category;
1509: ELSIF ( p_x_route_rec.attribute_category = FND_API.G_MISS_CHAR ) THEN
1510: p_x_route_rec.attribute_category := null;
1511: END IF;
1512:
1513: IF ( p_x_route_rec.attribute1 IS NULL ) THEN
1511: END IF;
1512:
1513: IF ( p_x_route_rec.attribute1 IS NULL ) THEN
1514: p_x_route_rec.attribute1 := l_old_route_rec.attribute1;
1515: ELSIF ( p_x_route_rec.attribute1 = FND_API.G_MISS_CHAR ) THEN
1516: p_x_route_rec.attribute1 := null;
1517: END IF;
1518:
1519: IF ( p_x_route_rec.attribute2 IS NULL ) THEN
1517: END IF;
1518:
1519: IF ( p_x_route_rec.attribute2 IS NULL ) THEN
1520: p_x_route_rec.attribute2 := l_old_route_rec.attribute2;
1521: ELSIF ( p_x_route_rec.attribute2 = FND_API.G_MISS_CHAR ) THEN
1522: p_x_route_rec.attribute2 := null;
1523: END IF;
1524:
1525: IF ( p_x_route_rec.attribute3 IS NULL ) THEN
1523: END IF;
1524:
1525: IF ( p_x_route_rec.attribute3 IS NULL ) THEN
1526: p_x_route_rec.attribute3 := l_old_route_rec.attribute3;
1527: ELSIF ( p_x_route_rec.attribute3 = FND_API.G_MISS_CHAR ) THEN
1528: p_x_route_rec.attribute3 := null;
1529: END IF;
1530:
1531: IF ( p_x_route_rec.attribute4 IS NULL ) THEN
1529: END IF;
1530:
1531: IF ( p_x_route_rec.attribute4 IS NULL ) THEN
1532: p_x_route_rec.attribute4 := l_old_route_rec.attribute4;
1533: ELSIF ( p_x_route_rec.attribute4 = FND_API.G_MISS_CHAR ) THEN
1534: p_x_route_rec.attribute4 := null;
1535: END IF;
1536:
1537: IF ( p_x_route_rec.attribute5 IS NULL ) THEN
1535: END IF;
1536:
1537: IF ( p_x_route_rec.attribute5 IS NULL ) THEN
1538: p_x_route_rec.attribute5 := l_old_route_rec.attribute5;
1539: ELSIF ( p_x_route_rec.attribute5 = FND_API.G_MISS_CHAR ) THEN
1540: p_x_route_rec.attribute5 := null;
1541: END IF;
1542:
1543: IF ( p_x_route_rec.attribute6 IS NULL ) THEN
1541: END IF;
1542:
1543: IF ( p_x_route_rec.attribute6 IS NULL ) THEN
1544: p_x_route_rec.attribute6 := l_old_route_rec.attribute6;
1545: ELSIF ( p_x_route_rec.attribute6 = FND_API.G_MISS_CHAR ) THEN
1546: p_x_route_rec.attribute6 := null;
1547: END IF;
1548:
1549: IF ( p_x_route_rec.attribute7 IS NULL ) THEN
1547: END IF;
1548:
1549: IF ( p_x_route_rec.attribute7 IS NULL ) THEN
1550: p_x_route_rec.attribute7 := l_old_route_rec.attribute7;
1551: ELSIF ( p_x_route_rec.attribute7 = FND_API.G_MISS_CHAR ) THEN
1552: p_x_route_rec.attribute7 := null;
1553: END IF;
1554:
1555: IF ( p_x_route_rec.attribute8 IS NULL ) THEN
1553: END IF;
1554:
1555: IF ( p_x_route_rec.attribute8 IS NULL ) THEN
1556: p_x_route_rec.attribute8 := l_old_route_rec.attribute8;
1557: ELSIF ( p_x_route_rec.attribute8 = FND_API.G_MISS_CHAR ) THEN
1558: p_x_route_rec.attribute8 := null;
1559: END IF;
1560:
1561: IF ( p_x_route_rec.attribute9 IS NULL ) THEN
1559: END IF;
1560:
1561: IF ( p_x_route_rec.attribute9 IS NULL ) THEN
1562: p_x_route_rec.attribute9 := l_old_route_rec.attribute9;
1563: ELSIF ( p_x_route_rec.attribute9 = FND_API.G_MISS_CHAR ) THEN
1564: p_x_route_rec.attribute9 := null;
1565: END IF;
1566:
1567: IF ( p_x_route_rec.attribute10 IS NULL ) THEN
1565: END IF;
1566:
1567: IF ( p_x_route_rec.attribute10 IS NULL ) THEN
1568: p_x_route_rec.attribute10 := l_old_route_rec.attribute10;
1569: ELSIF ( p_x_route_rec.attribute10 = FND_API.G_MISS_CHAR ) THEN
1570: p_x_route_rec.attribute10 := null;
1571: END IF;
1572:
1573: IF ( p_x_route_rec.attribute11 IS NULL ) THEN
1571: END IF;
1572:
1573: IF ( p_x_route_rec.attribute11 IS NULL ) THEN
1574: p_x_route_rec.attribute11 := l_old_route_rec.attribute11;
1575: ELSIF ( p_x_route_rec.attribute11 = FND_API.G_MISS_CHAR ) THEN
1576: p_x_route_rec.attribute11 := null;
1577: END IF;
1578:
1579: IF ( p_x_route_rec.attribute12 IS NULL ) THEN
1577: END IF;
1578:
1579: IF ( p_x_route_rec.attribute12 IS NULL ) THEN
1580: p_x_route_rec.attribute12 := l_old_route_rec.attribute12;
1581: ELSIF ( p_x_route_rec.attribute12 = FND_API.G_MISS_CHAR ) THEN
1582: p_x_route_rec.attribute12 := null;
1583: END IF;
1584:
1585: IF ( p_x_route_rec.attribute13 IS NULL ) THEN
1583: END IF;
1584:
1585: IF ( p_x_route_rec.attribute13 IS NULL ) THEN
1586: p_x_route_rec.attribute13 := l_old_route_rec.attribute13;
1587: ELSIF ( p_x_route_rec.attribute13 = FND_API.G_MISS_CHAR ) THEN
1588: p_x_route_rec.attribute13 := null;
1589: END IF;
1590:
1591: IF ( p_x_route_rec.attribute14 IS NULL ) THEN
1589: END IF;
1590:
1591: IF ( p_x_route_rec.attribute14 IS NULL ) THEN
1592: p_x_route_rec.attribute14 := l_old_route_rec.attribute14;
1593: ELSIF ( p_x_route_rec.attribute14 = FND_API.G_MISS_CHAR ) THEN
1594: p_x_route_rec.attribute14 := null;
1595: END IF;
1596:
1597: IF ( p_x_route_rec.attribute15 IS NULL ) THEN
1595: END IF;
1596:
1597: IF ( p_x_route_rec.attribute15 IS NULL ) THEN
1598: p_x_route_rec.attribute15 := l_old_route_rec.attribute15;
1599: ELSIF ( p_x_route_rec.attribute15 = FND_API.G_MISS_CHAR ) THEN
1600: p_x_route_rec.attribute15 := null;
1601: END IF;
1602:
1603: END default_unchanged_attributes;
1626: l_enigma_avail varchar2(80);
1627: --bachandr Enigma Phase I changes -- end
1628:
1629: BEGIN
1630: x_return_status := FND_API.G_RET_STS_SUCCESS;
1631:
1632: -- Check if the Revision Status code does not column contains a null value.
1633: /*
1634: * Removing this as revision status for a newly created route is always DRAFT and need not be passed from
1637: */
1638: /*
1639: IF ( ( p_route_rec.dml_operation = 'C' AND
1640: p_route_rec.revision_status_code IS NULL ) OR
1641: p_route_rec.revision_status_code = FND_API.G_MISS_CHAR ) THEN
1642: FND_MESSAGE.set_name( 'AHL','AHL_RM_STATUS_NULL' );
1643: FND_MSG_PUB.add;
1644: END IF;
1645: */
1646:
1647: -- Check if the Route Number does not column contains a null value.
1648: IF ( ( p_route_rec.dml_operation = 'C' AND
1649: p_route_rec.route_no IS NULL ) OR
1650: p_route_rec.route_no = FND_API.G_MISS_CHAR ) THEN
1651: FND_MESSAGE.set_name( 'AHL','AHL_RM_ROUTE_NO_NULL' );
1652: FND_MSG_PUB.add;
1653: END IF;
1654:
1654:
1655: -- Check if the Route Title does not column contains a null value.
1656: IF ( ( p_route_rec.dml_operation = 'C' AND
1657: p_route_rec.title IS NULL ) OR
1658: p_route_rec.title = FND_API.G_MISS_CHAR ) THEN
1659: FND_MESSAGE.set_name( 'AHL','AHL_RM_ROUTE_TITLE_NULL' );
1660: FND_MSG_PUB.add;
1661: END IF;
1662:
1662:
1663: -- Check if the Route Start Date does not column contains a null value.
1664: IF ( ( p_route_rec.dml_operation = 'C' AND
1665: p_route_rec.active_start_date IS NULL ) OR
1666: p_route_rec.active_start_date = FND_API.G_MISS_DATE ) THEN
1667: FND_MESSAGE.set_name( 'AHL','AHL_RM_ST_DATE_NULL' );
1668: FND_MSG_PUB.add;
1669: END IF;
1670:
1675: SELECT trim(fnd_profile.value('AHL_ENIGMA_3C_URL')) INTO l_enigma_avail FROM dual;
1676: IF l_enigma_avail = 'N' THEN
1677: IF ( ( p_route_rec.dml_operation = 'C' AND
1678: p_route_rec.time_span IS NULL ) OR
1679: p_route_rec.time_span = FND_API.G_MISS_NUM ) THEN
1680: FND_MESSAGE.set_name( 'AHL','AHL_RM_TIME_SPAN_NULL' );
1681: FND_MSG_PUB.add;
1682: END IF;
1683: END IF;
1684:
1685: -- Check if the model code or meaning is not null for create
1686: -- when the route is created from Enigma
1687: IF ( p_route_rec.dml_operation = 'C' AND p_route_rec.enigma_doc_id IS NOT NULL
1688: AND p_route_rec.enigma_doc_id <> FND_API.G_MISS_CHAR) THEN
1689: IF (( p_route_rec.model_code IS NULL OR p_route_rec.model_code = FND_API.G_MISS_CHAR ) AND
1690: ( p_route_rec.model_meaning IS NULL OR p_route_rec.model_meaning = FND_API.G_MISS_CHAR ) )THEN
1691: FND_MESSAGE.set_name( 'AHL','AHL_RM_MODEL_CODE_NULL' );
1692: FND_MSG_PUB.add;
1685: -- Check if the model code or meaning is not null for create
1686: -- when the route is created from Enigma
1687: IF ( p_route_rec.dml_operation = 'C' AND p_route_rec.enigma_doc_id IS NOT NULL
1688: AND p_route_rec.enigma_doc_id <> FND_API.G_MISS_CHAR) THEN
1689: IF (( p_route_rec.model_code IS NULL OR p_route_rec.model_code = FND_API.G_MISS_CHAR ) AND
1690: ( p_route_rec.model_meaning IS NULL OR p_route_rec.model_meaning = FND_API.G_MISS_CHAR ) )THEN
1691: FND_MESSAGE.set_name( 'AHL','AHL_RM_MODEL_CODE_NULL' );
1692: FND_MSG_PUB.add;
1693: END IF;
1686: -- when the route is created from Enigma
1687: IF ( p_route_rec.dml_operation = 'C' AND p_route_rec.enigma_doc_id IS NOT NULL
1688: AND p_route_rec.enigma_doc_id <> FND_API.G_MISS_CHAR) THEN
1689: IF (( p_route_rec.model_code IS NULL OR p_route_rec.model_code = FND_API.G_MISS_CHAR ) AND
1690: ( p_route_rec.model_meaning IS NULL OR p_route_rec.model_meaning = FND_API.G_MISS_CHAR ) )THEN
1691: FND_MESSAGE.set_name( 'AHL','AHL_RM_MODEL_CODE_NULL' );
1692: FND_MSG_PUB.add;
1693: END IF;
1694: END IF;
1695: --bachandr Enigma Phase I changes -- end
1696:
1697: -- Check if Time Span is not less than or equal to zero
1698: IF ( p_route_rec.time_span IS NOT NULL AND
1699: p_route_rec.time_span <> FND_API.G_MISS_NUM AND
1700: p_route_rec.time_span <= 0 ) THEN
1701: FND_MESSAGE.set_name( 'AHL','AHL_RM_INVALID_TIME_SPAN' );
1702: FND_MESSAGE.set_token( 'FIELD', p_route_rec.time_span );
1703: FND_MSG_PUB.add;
1708: END IF;
1709:
1710: -- Check if the mandatory Route ID column contains a null value.
1711: IF ( p_route_rec.route_id IS NULL OR
1712: p_route_rec.route_id = FND_API.G_MISS_NUM ) THEN
1713: FND_MESSAGE.set_name( 'AHL','AHL_RM_ROUTE_ID_NULL' );
1714: FND_MSG_PUB.add;
1715: RETURN;
1716: END IF;
1716: END IF;
1717:
1718: -- Check if the mandatory Object Version Number column contains a null value.
1719: IF ( p_route_rec.object_version_number IS NULL OR
1720: p_route_rec.object_version_number = FND_API.G_MISS_NUM ) THEN
1721: FND_MESSAGE.set_name( 'AHL','AHL_RM_OBJ_VERSION_NULL' );
1722: FND_MSG_PUB.add;
1723: RETURN;
1724: END IF;
1724: END IF;
1725:
1726: -- Validate whether the Time Span of the Route is Greater than the Longest Resource Duration for the Same Route and all the Associated Operations
1727: IF ( p_route_rec.time_span IS NOT NULL AND
1728: p_route_rec.time_span <> FND_API.G_MISS_NUM AND
1729: p_route_rec.time_span > 0 ) THEN
1730:
1731: AHL_RM_ROUTE_UTIL.validate_route_time_span
1732: (
1736: p_time_span => p_route_rec.time_span,
1737: x_res_max_duration => l_res_max_duration
1738: );
1739:
1740: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
1741: FND_MESSAGE.set_name( 'AHL', l_msg_data );
1742: FND_MESSAGE.set_token( 'FIELD1', l_res_max_duration );
1743: FND_MESSAGE.set_token( 'FIELD2', p_route_rec.time_span );
1744: FND_MSG_PUB.add;
1749: IF (p_route_rec.dml_operation = 'U' AND p_route_rec.revision_status_code IN ('COMPLETE', 'APPROVAL_PENDING', 'TERMINATION_PENDING', 'TERMINATED'))
1750: THEN
1751: FND_MESSAGE.set_name( 'AHL','AHL_RM_RT_STS_NO_UPD' );
1752: FND_MSG_PUB.add;
1753: x_return_status := FND_API.G_RET_STS_ERROR;
1754: END IF;
1755: -- Added by Tamal for Bug #3854052
1756:
1757: IF (p_route_rec.dml_operation IN ('U','D'))
1788: WHERE UPPER(TRIM(route_no)) = UPPER(TRIM(c_route_no))
1789: AND revision_number = nvl(c_revision_number,1);
1790:
1791: BEGIN
1792: --x_return_status := FND_API.G_RET_STS_SUCCESS;
1793:
1794: -- Check if Duplicate Route Number exists
1795: OPEN get_dup_rec( p_route_rec.route_no , p_route_rec.revision_number );
1796:
1801: -- if its create then p_route_rec.route_id = null and any duplicate record should make you throw an err.
1802: IF ( get_dup_rec%FOUND ) THEN
1803: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_ROUTE_NO_DUP' );
1804: FND_MSG_PUB.add;
1805: x_return_status := FND_API.G_RET_STS_ERROR;
1806: END IF;
1807: ELSIF ( p_route_rec.dml_operation = 'U' )
1808: THEN
1809: IF ( l_route_id <> p_route_rec.route_id ) THEN
1808: THEN
1809: IF ( l_route_id <> p_route_rec.route_id ) THEN
1810: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_ROUTE_NO_DUP' );
1811: FND_MSG_PUB.add;
1812: x_return_status := FND_API.G_RET_STS_ERROR;
1813: END IF;
1814: END IF;
1815:
1816: CLOSE get_dup_rec;
1819: /*
1820: IF ( ( p_route_rec.revision_status_code = 'DRAFT' OR
1821: p_route_rec.revision_status_code = 'APPROVAL_REJECTED' ) AND
1822: p_route_rec.active_start_date IS NOT NULL AND
1823: p_route_rec.active_start_date <> FND_API.G_MISS_DATE AND
1824: TRUNC( p_route_rec.active_start_date ) < TRUNC( SYSDATE ) ) THEN
1825: FND_MESSAGE.set_name( 'AHL','AHL_RM_INVALID_ST_DATE' );
1826: FND_MESSAGE.set_token( 'FIELD', SYSDATE );
1827: FND_MSG_PUB.add;
1843: p_start_date => p_route_rec.active_start_date,
1844: x_start_date => l_start_date
1845: );
1846:
1847: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
1848: FND_MESSAGE.set_name( 'AHL', l_msg_data );
1849: FND_MESSAGE.set_token( 'FIELD', l_start_date );
1850: FND_MSG_PUB.add;
1851: x_return_status := FND_API.G_RET_STS_ERROR;
1847: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
1848: FND_MESSAGE.set_name( 'AHL', l_msg_data );
1849: FND_MESSAGE.set_token( 'FIELD', l_start_date );
1850: FND_MSG_PUB.add;
1851: x_return_status := FND_API.G_RET_STS_ERROR;
1852: END IF;
1853: END IF;
1854:
1855: -- Check if Zone contains a value but, the Product Type is NULL
1858: ( p_route_rec.product_type IS NULL AND
1859: p_route_rec.product_type_code IS NULL ) ) THEN
1860: FND_MESSAGE.set_name( 'AHL','AHL_RM_PT_NULL_ZONE_NOTNULL' );
1861: FND_MSG_PUB.add;
1862: x_return_status := FND_API.G_RET_STS_ERROR;
1863: END IF;
1864:
1865: -- Check if Sub Zone contains a value but, the Product Type or Zone are NULL
1866: IF ( ( p_route_rec.sub_zone IS NOT NULL OR
1870: ( p_route_rec.zone IS NULL AND
1871: p_route_rec.zone_code IS NULL ) ) ) THEN
1872: FND_MESSAGE.set_name( 'AHL','AHL_RM_PT_NULL_SUBZONE_NOTNULL' );
1873: FND_MSG_PUB.add;
1874: x_return_status := FND_API.G_RET_STS_ERROR;
1875: END IF;
1876:
1877: -- Check if the Zone is valid for the Product Type
1878: IF ( p_route_rec.product_type_code IS NOT NULL AND
1885: p_product_type_code => p_route_rec.product_type_code,
1886: p_zone_code => p_route_rec.zone_code
1887: );
1888:
1889: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
1890: FND_MESSAGE.set_name( 'AHL', l_msg_data );
1891: IF ( p_route_rec.zone IS NULL ) THEN
1892: FND_MESSAGE.set_token( 'FIELD1', p_route_rec.zone_code );
1893: ELSE
1900: FND_MESSAGE.set_token( 'FIELD2', p_route_rec.product_type );
1901: END IF;
1902:
1903: FND_MSG_PUB.add;
1904: x_return_status := FND_API.G_RET_STS_ERROR;
1905: END IF;
1906: END IF;
1907:
1908: -- Check if the Sub Zone is valid for the Product Type and Zone
1918: p_zone_code => p_route_rec.zone_code,
1919: p_sub_zone_code => p_route_rec.sub_zone_code
1920: );
1921:
1922: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
1923: FND_MESSAGE.set_name( 'AHL', l_msg_data );
1924: IF ( p_route_rec.sub_zone IS NULL ) THEN
1925: FND_MESSAGE.set_token( 'FIELD1', p_route_rec.sub_zone_code );
1926: ELSE
1939: FND_MESSAGE.set_token( 'FIELD3', p_route_rec.product_type );
1940: END IF;
1941:
1942: FND_MSG_PUB.add;
1943: x_return_status := FND_API.G_RET_STS_ERROR;
1944: END IF;
1945: END IF;
1946:
1947: END validate_record;
1948:
1949: PROCEDURE process_route
1950: (
1951: p_api_version IN NUMBER := '1.0',
1952: p_init_msg_list IN VARCHAR2 := FND_API.G_TRUE,
1953: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1954: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1955: p_default IN VARCHAR2 := FND_API.G_FALSE,
1956: p_module_type IN VARCHAR2 := NULL,
1949: PROCEDURE process_route
1950: (
1951: p_api_version IN NUMBER := '1.0',
1952: p_init_msg_list IN VARCHAR2 := FND_API.G_TRUE,
1953: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1954: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1955: p_default IN VARCHAR2 := FND_API.G_FALSE,
1956: p_module_type IN VARCHAR2 := NULL,
1957: x_return_status OUT NOCOPY VARCHAR2,
1950: (
1951: p_api_version IN NUMBER := '1.0',
1952: p_init_msg_list IN VARCHAR2 := FND_API.G_TRUE,
1953: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1954: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1955: p_default IN VARCHAR2 := FND_API.G_FALSE,
1956: p_module_type IN VARCHAR2 := NULL,
1957: x_return_status OUT NOCOPY VARCHAR2,
1958: x_msg_count OUT NOCOPY NUMBER,
1951: p_api_version IN NUMBER := '1.0',
1952: p_init_msg_list IN VARCHAR2 := FND_API.G_TRUE,
1953: p_commit IN VARCHAR2 := FND_API.G_FALSE,
1954: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
1955: p_default IN VARCHAR2 := FND_API.G_FALSE,
1956: p_module_type IN VARCHAR2 := NULL,
1957: x_return_status OUT NOCOPY VARCHAR2,
1958: x_msg_count OUT NOCOPY NUMBER,
1959: x_msg_data OUT NOCOPY VARCHAR2,
1991: --amsriniv. End
1992:
1993: BEGIN
1994: -- Initialize API return status to success
1995: x_return_status := FND_API.G_RET_STS_SUCCESS;
1996:
1997: -- Standard Start of API savepoint
1998: SAVEPOINT process_route_PVT;
1999:
1997: -- Standard Start of API savepoint
1998: SAVEPOINT process_route_PVT;
1999:
2000: -- Standard call to check for call compatibility.
2001: IF NOT FND_API.compatible_api_call
2002: (
2003: l_api_version,
2004: p_api_version,
2005: l_api_name,
2005: l_api_name,
2006: G_PKG_NAME
2007: )
2008: THEN
2009: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2010: END IF;
2011:
2012: -- Initialize message list if p_init_msg_list is set to TRUE.
2013: IF FND_API.to_boolean( p_init_msg_list ) THEN
2009: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2010: END IF;
2011:
2012: -- Initialize message list if p_init_msg_list is set to TRUE.
2013: IF FND_API.to_boolean( p_init_msg_list ) THEN
2014: FND_MSG_PUB.initialize;
2015: END IF;
2016:
2017: -- Enable Debug (optional)
2024: END IF;
2025:
2026: -- Generate route_id from route_number and revision_number if it is not provided.
2027: IF (p_x_route_rec.dml_operation <> 'C' AND p_x_route_rec.dml_operation <> 'c') AND
2028: (p_x_route_rec.route_id IS NULL OR p_x_route_rec.route_id = FND_API.G_MISS_NUM)
2029: THEN
2030: -- Function to convert route_number, route_revision to id
2031: AHL_RM_ROUTE_UTIL.Route_Number_To_Id(
2032: p_route_number => p_x_route_rec.route_no,
2034: x_route_id => p_x_route_rec.route_id,
2035: x_return_status => x_return_status
2036: );
2037:
2038: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2039: IF (fnd_log.level_statement >= fnd_log.g_current_runtime_level)THEN
2040: fnd_log.string
2041: (
2042: fnd_log.level_statement,
2043: 'ahl.plsql.'||g_pkg_name||'.'||l_api_name||':',
2044: 'Error in converting Route Number, Route Revision to ID'
2045: );
2046: END IF;
2047: RAISE FND_API.G_EXC_ERROR;
2048: END IF;
2049: END IF;
2050:
2051: --This is to be added before calling validate_api_inputs
2060: x_msg_data => x_msg_data
2061: );
2062:
2063: -- If any severe error occurs, then, abort API.
2064: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2065: RAISE FND_API.G_EXC_ERROR;
2066: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2067: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2068: END IF;
2061: );
2062:
2063: -- If any severe error occurs, then, abort API.
2064: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2065: RAISE FND_API.G_EXC_ERROR;
2066: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2067: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2068: END IF;
2069:
2062:
2063: -- If any severe error occurs, then, abort API.
2064: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2065: RAISE FND_API.G_EXC_ERROR;
2066: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2067: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2068: END IF;
2069:
2070: END IF ;
2063: -- If any severe error occurs, then, abort API.
2064: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2065: RAISE FND_API.G_EXC_ERROR;
2066: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2067: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2068: END IF;
2069:
2070: END IF ;
2071:
2076: l_return_status -- OUT
2077: );
2078:
2079: -- If any severe error occurs, then, abort API.
2080: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
2081: RAISE FND_API.G_EXC_ERROR;
2082: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2083: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2084: END IF;
2077: );
2078:
2079: -- If any severe error occurs, then, abort API.
2080: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
2081: RAISE FND_API.G_EXC_ERROR;
2082: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2083: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2084: END IF;
2085:
2078:
2079: -- If any severe error occurs, then, abort API.
2080: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
2081: RAISE FND_API.G_EXC_ERROR;
2082: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2083: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2084: END IF;
2085:
2086: -- If the module type is JSP, then default values for ID columns of LOV attributes
2079: -- If any severe error occurs, then, abort API.
2080: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
2081: RAISE FND_API.G_EXC_ERROR;
2082: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2083: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2084: END IF;
2085:
2086: -- If the module type is JSP, then default values for ID columns of LOV attributes
2087: IF ( p_module_type = 'JSP' ) THEN
2092: END IF;
2093:
2094: -- Convert Values into Ids.
2095: -- Balaji removed p_validation_level check in 11510+ as a part of public api cleanup.
2096: --IF ( p_validation_level = FND_API.G_VALID_LEVEL_FULL ) THEN
2097: convert_values_to_ids
2098: (
2099: p_x_route_rec , -- IN OUT Record with Values and Ids
2100: l_return_status -- OUT
2100: l_return_status -- OUT
2101: );
2102:
2103: -- If any severe error occurs, then, abort API.
2104: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
2105: RAISE FND_API.G_EXC_ERROR;
2106: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2107: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2108: END IF;
2101: );
2102:
2103: -- If any severe error occurs, then, abort API.
2104: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
2105: RAISE FND_API.G_EXC_ERROR;
2106: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2107: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2108: END IF;
2109: --END IF;
2102:
2103: -- If any severe error occurs, then, abort API.
2104: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
2105: RAISE FND_API.G_EXC_ERROR;
2106: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2107: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2108: END IF;
2109: --END IF;
2110:
2103: -- If any severe error occurs, then, abort API.
2104: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
2105: RAISE FND_API.G_EXC_ERROR;
2106: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2107: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2108: END IF;
2109: --END IF;
2110:
2111: IF G_DEBUG = 'Y' THEN
2113: END IF;
2114:
2115: /* Balaji removed it as a part of public API cleanup as this defaulting logic should not be bound by p_default value. Instead the logic is moved to DML.
2116: -- Default route attributes.
2117: IF FND_API.to_boolean( p_default ) THEN
2118: default_attributes
2119: (
2120: p_x_route_rec -- IN OUT
2121: );
2144: END IF;
2145:
2146: -- Validate all attributes (Item level validation)
2147: -- Balaji removed p_validation_level check in 11510+ as a part of public api cleanup.
2148: --IF ( p_validation_level = FND_API.G_VALID_LEVEL_FULL ) THEN
2149: validate_attributes
2150: (
2151: p_x_route_rec, -- IN
2152: l_return_status -- OUT
2152: l_return_status -- OUT
2153: );
2154:
2155: -- If any severe error occurs, then, abort API.
2156: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
2157: RAISE FND_API.G_EXC_ERROR;
2158: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2159: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2160: END IF;
2153: );
2154:
2155: -- If any severe error occurs, then, abort API.
2156: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
2157: RAISE FND_API.G_EXC_ERROR;
2158: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2159: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2160: END IF;
2161: --END IF;
2154:
2155: -- If any severe error occurs, then, abort API.
2156: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
2157: RAISE FND_API.G_EXC_ERROR;
2158: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2159: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2160: END IF;
2161: --END IF;
2162:
2155: -- If any severe error occurs, then, abort API.
2156: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
2157: RAISE FND_API.G_EXC_ERROR;
2158: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2159: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2160: END IF;
2161: --END IF;
2162:
2163: IF G_DEBUG = 'Y' THEN
2165: END IF;
2166:
2167: -- Perform cross attribute validation and missing attribute checks (Record level validation)
2168: -- Balaji removed p_validation_level check in 11510+ as a part of public api cleanup.
2169: --IF ( p_validation_level = FND_API.G_VALID_LEVEL_FULL ) THEN
2170: validate_record
2171: (
2172: p_x_route_rec, -- IN
2173: l_return_status -- OUT
2173: l_return_status -- OUT
2174: );
2175:
2176: -- If any severe error occurs, then, abort API.
2177: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
2178: RAISE FND_API.G_EXC_ERROR;
2179: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2180: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2181: END IF;
2174: );
2175:
2176: -- If any severe error occurs, then, abort API.
2177: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
2178: RAISE FND_API.G_EXC_ERROR;
2179: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2180: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2181: END IF;
2182: --END IF;
2175:
2176: -- If any severe error occurs, then, abort API.
2177: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
2178: RAISE FND_API.G_EXC_ERROR;
2179: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2180: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2181: END IF;
2182: --END IF;
2183:
2176: -- If any severe error occurs, then, abort API.
2177: IF l_return_status = FND_API.G_RET_STS_ERROR THEN
2178: RAISE FND_API.G_EXC_ERROR;
2179: ELSIF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2180: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2181: END IF;
2182: --END IF;
2183:
2184: IF G_DEBUG = 'Y' THEN
2188: -- Get all the error messages from the previous steps (if any) and raise the appropriate Exception
2189: l_msg_count := FND_MSG_PUB.count_msg;
2190: IF l_msg_count > 0 THEN
2191: x_msg_count := l_msg_count;
2192: RAISE FND_API.G_EXC_ERROR;
2193: END IF;
2194:
2195: -- Perform the DML by invoking the Table Handler.
2196: IF ( p_x_route_rec.dml_operation = 'C' ) THEN
2203: FROM DUAL;
2204:
2205: --bachandr Enigma Phase I changes -- start
2206: -- Append the model code if any to the route No
2207: IF ( (p_x_route_rec.model_code IS NOT NULL ) AND (p_x_route_rec.model_code <> FND_API.G_MISS_CHAR ) ) THEN
2208: --AND (p_x_route_rec.model_meaning IS NOT NULL ) AND (p_x_route_rec.model_meaning <> FND_API.G_MISS_CHAR )) THEN
2209: p_x_route_rec.route_no := p_x_route_rec.model_code || concat || p_x_route_rec.route_no ;
2210:
2211: --dbms_output.put_line('Inside If');
2204:
2205: --bachandr Enigma Phase I changes -- start
2206: -- Append the model code if any to the route No
2207: IF ( (p_x_route_rec.model_code IS NOT NULL ) AND (p_x_route_rec.model_code <> FND_API.G_MISS_CHAR ) ) THEN
2208: --AND (p_x_route_rec.model_meaning IS NOT NULL ) AND (p_x_route_rec.model_meaning <> FND_API.G_MISS_CHAR )) THEN
2209: p_x_route_rec.route_no := p_x_route_rec.model_code || concat || p_x_route_rec.route_no ;
2210:
2211: --dbms_output.put_line('Inside If');
2212: END IF;
2430: -- Get all the error messages from the previous steps (if any) and raise the appropriate Exception
2431: l_msg_count := FND_MSG_PUB.count_msg;
2432: IF l_msg_count > 0 THEN
2433: x_msg_count := l_msg_count;
2434: RAISE FND_API.G_EXC_ERROR;
2435: END IF;
2436:
2437: -- Perform the Commit (if requested)
2438: IF FND_API.to_boolean( p_commit ) THEN
2434: RAISE FND_API.G_EXC_ERROR;
2435: END IF;
2436:
2437: -- Perform the Commit (if requested)
2438: IF FND_API.to_boolean( p_commit ) THEN
2439: COMMIT WORK;
2440: END IF;
2441:
2442: -- Count and Get messages (optional)
2441:
2442: -- Count and Get messages (optional)
2443: FND_MSG_PUB.count_and_get
2444: (
2445: p_encoded => FND_API.G_FALSE,
2446: p_count => x_msg_count,
2447: p_data => x_msg_data
2448: );
2449:
2453: END IF;
2454:
2455: EXCEPTION
2456:
2457: WHEN FND_API.G_EXC_ERROR THEN
2458: ROLLBACK TO process_route_PVT;
2459: x_return_status := FND_API.G_RET_STS_ERROR ;
2460: FND_MSG_PUB.count_and_get
2461: (
2455: EXCEPTION
2456:
2457: WHEN FND_API.G_EXC_ERROR THEN
2458: ROLLBACK TO process_route_PVT;
2459: x_return_status := FND_API.G_RET_STS_ERROR ;
2460: FND_MSG_PUB.count_and_get
2461: (
2462: p_encoded => FND_API.G_FALSE,
2463: p_count => x_msg_count,
2458: ROLLBACK TO process_route_PVT;
2459: x_return_status := FND_API.G_RET_STS_ERROR ;
2460: FND_MSG_PUB.count_and_get
2461: (
2462: p_encoded => FND_API.G_FALSE,
2463: p_count => x_msg_count,
2464: p_data => x_msg_data
2465: );
2466:
2468: IF ( G_DEBUG = 'Y' ) THEN
2469: AHL_DEBUG_PUB.disable_debug;
2470: END IF;
2471:
2472: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2473: ROLLBACK TO process_route_PVT;
2474: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2475: FND_MSG_PUB.count_and_get
2476: (
2470: END IF;
2471:
2472: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2473: ROLLBACK TO process_route_PVT;
2474: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2475: FND_MSG_PUB.count_and_get
2476: (
2477: p_encoded => FND_API.G_FALSE,
2478: p_count => x_msg_count,
2473: ROLLBACK TO process_route_PVT;
2474: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2475: FND_MSG_PUB.count_and_get
2476: (
2477: p_encoded => FND_API.G_FALSE,
2478: p_count => x_msg_count,
2479: p_data => x_msg_data
2480: );
2481:
2485: END IF;
2486:
2487: WHEN OTHERS THEN
2488: ROLLBACK TO process_route_PVT;
2489: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2490: IF FND_MSG_PUB.check_msg_level( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )
2491: THEN
2492: FND_MSG_PUB.add_exc_msg
2493: (
2497: );
2498: END IF;
2499: FND_MSG_PUB.count_and_get
2500: (
2501: p_encoded => FND_API.G_FALSE,
2502: p_count => x_msg_count,
2503: p_data => x_msg_data
2504: );
2505:
2512:
2513: PROCEDURE delete_route
2514: (
2515: p_api_version IN NUMBER := '1.0',
2516: p_init_msg_list IN VARCHAR2 := FND_API.G_TRUE,
2517: p_commit IN VARCHAR2 := FND_API.G_FALSE,
2518: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
2519: p_default IN VARCHAR2 := FND_API.G_FALSE,
2520: p_module_type IN VARCHAR2 := NULL,
2513: PROCEDURE delete_route
2514: (
2515: p_api_version IN NUMBER := '1.0',
2516: p_init_msg_list IN VARCHAR2 := FND_API.G_TRUE,
2517: p_commit IN VARCHAR2 := FND_API.G_FALSE,
2518: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
2519: p_default IN VARCHAR2 := FND_API.G_FALSE,
2520: p_module_type IN VARCHAR2 := NULL,
2521: x_return_status OUT NOCOPY VARCHAR2,
2514: (
2515: p_api_version IN NUMBER := '1.0',
2516: p_init_msg_list IN VARCHAR2 := FND_API.G_TRUE,
2517: p_commit IN VARCHAR2 := FND_API.G_FALSE,
2518: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
2519: p_default IN VARCHAR2 := FND_API.G_FALSE,
2520: p_module_type IN VARCHAR2 := NULL,
2521: x_return_status OUT NOCOPY VARCHAR2,
2522: x_msg_count OUT NOCOPY NUMBER,
2515: p_api_version IN NUMBER := '1.0',
2516: p_init_msg_list IN VARCHAR2 := FND_API.G_TRUE,
2517: p_commit IN VARCHAR2 := FND_API.G_FALSE,
2518: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
2519: p_default IN VARCHAR2 := FND_API.G_FALSE,
2520: p_module_type IN VARCHAR2 := NULL,
2521: x_return_status OUT NOCOPY VARCHAR2,
2522: x_msg_count OUT NOCOPY NUMBER,
2523: x_msg_data OUT NOCOPY VARCHAR2,
2561:
2562: BEGIN
2563:
2564: -- Initialize API return status to success
2565: x_return_status := FND_API.G_RET_STS_SUCCESS;
2566:
2567: -- Standard Start of API savepoint
2568: SAVEPOINT delete_route_PVT;
2569:
2567: -- Standard Start of API savepoint
2568: SAVEPOINT delete_route_PVT;
2569:
2570: -- Standard call to check for call compatibility.
2571: IF NOT FND_API.compatible_api_call
2572: (
2573: l_api_version,
2574: p_api_version,
2575: l_api_name,
2575: l_api_name,
2576: G_PKG_NAME
2577: )
2578: THEN
2579: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2580: END IF;
2581:
2582: -- Initialize message list if p_init_msg_list is set to TRUE.
2583: IF FND_API.to_boolean( p_init_msg_list ) THEN
2579: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2580: END IF;
2581:
2582: -- Initialize message list if p_init_msg_list is set to TRUE.
2583: IF FND_API.to_boolean( p_init_msg_list ) THEN
2584: FND_MSG_PUB.initialize;
2585: END IF;
2586:
2587: -- Enable Debug (optional)
2603: x_msg_data => x_msg_data
2604: );
2605:
2606: -- If any severe error occurs, then, abort API.
2607: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2608: RAISE FND_API.G_EXC_ERROR;
2609: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2610: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2611: END IF;
2604: );
2605:
2606: -- If any severe error occurs, then, abort API.
2607: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2608: RAISE FND_API.G_EXC_ERROR;
2609: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2610: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2611: END IF;
2612:
2605:
2606: -- If any severe error occurs, then, abort API.
2607: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2608: RAISE FND_API.G_EXC_ERROR;
2609: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2610: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2611: END IF;
2612:
2613: IF ( p_route_id IS NULL OR
2606: -- If any severe error occurs, then, abort API.
2607: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
2608: RAISE FND_API.G_EXC_ERROR;
2609: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2610: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2611: END IF;
2612:
2613: IF ( p_route_id IS NULL OR
2614: p_route_id = FND_API.G_MISS_NUM OR
2610: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2611: END IF;
2612:
2613: IF ( p_route_id IS NULL OR
2614: p_route_id = FND_API.G_MISS_NUM OR
2615: p_object_version_number IS NULL OR
2616: p_object_version_number = FND_API.G_MISS_NUM ) THEN
2617: FND_MESSAGE.set_name( 'AHL', 'AHL_COM_INVALID_PROCEDURE_CALL' );
2618: FND_MESSAGE.set_token( 'PROCEDURE', l_api_name );
2612:
2613: IF ( p_route_id IS NULL OR
2614: p_route_id = FND_API.G_MISS_NUM OR
2615: p_object_version_number IS NULL OR
2616: p_object_version_number = FND_API.G_MISS_NUM ) THEN
2617: FND_MESSAGE.set_name( 'AHL', 'AHL_COM_INVALID_PROCEDURE_CALL' );
2618: FND_MESSAGE.set_token( 'PROCEDURE', l_api_name );
2619: FND_MSG_PUB.add;
2620: RAISE FND_API.G_EXC_ERROR;
2616: p_object_version_number = FND_API.G_MISS_NUM ) THEN
2617: FND_MESSAGE.set_name( 'AHL', 'AHL_COM_INVALID_PROCEDURE_CALL' );
2618: FND_MESSAGE.set_token( 'PROCEDURE', l_api_name );
2619: FND_MSG_PUB.add;
2620: RAISE FND_API.G_EXC_ERROR;
2621: END IF;
2622:
2623: OPEN validate_route_ovn;
2624: FETCH validate_route_ovn INTO l_dummy;
2625: IF (validate_route_ovn%NOTFOUND)
2626: THEN
2627: FND_MESSAGE.set_name('AHL', 'AHL_COM_RECORD_CHANGED');
2628: FND_MSG_PUB.add;
2629: x_return_status := FND_API.G_RET_STS_ERROR;
2630: RAISE FND_API.G_EXC_ERROR;
2631: END IF;
2632:
2633: --bachandr Enigma Phase I changes -- start
2626: THEN
2627: FND_MESSAGE.set_name('AHL', 'AHL_COM_RECORD_CHANGED');
2628: FND_MSG_PUB.add;
2629: x_return_status := FND_API.G_RET_STS_ERROR;
2630: RAISE FND_API.G_EXC_ERROR;
2631: END IF;
2632:
2633: --bachandr Enigma Phase I changes -- start
2634: -- Fetch the doc_id and if the doc_id is not null( ie an Enigma Route) then
2640: IF (get_doc_id%FOUND AND l_doc_id IS NOT NULL)
2641: THEN
2642: FND_MESSAGE.set_name('AHL', 'AHL_RM_ROUTE_ENIG_DEL');
2643: FND_MSG_PUB.add;
2644: x_return_status := FND_API.G_RET_STS_ERROR;
2645: RAISE FND_API.G_EXC_ERROR;
2646: END IF;
2647: END IF;
2648: --bachandr Enigma Phase I changes -- end
2641: THEN
2642: FND_MESSAGE.set_name('AHL', 'AHL_RM_ROUTE_ENIG_DEL');
2643: FND_MSG_PUB.add;
2644: x_return_status := FND_API.G_RET_STS_ERROR;
2645: RAISE FND_API.G_EXC_ERROR;
2646: END IF;
2647: END IF;
2648: --bachandr Enigma Phase I changes -- end
2649:
2653: x_msg_data => l_msg_data,
2654: x_return_status => l_return_status
2655: );
2656:
2657: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
2658: IF ( l_msg_data = 'AHL_RM_INVALID_ROUTE_STATUS' ) THEN
2659: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_RT_STATUS_NOT_DRAFT' );
2660: ELSE
2661: FND_MESSAGE.set_name( 'AHL', l_msg_data );
2661: FND_MESSAGE.set_name( 'AHL', l_msg_data );
2662: END IF;
2663:
2664: FND_MSG_PUB.add;
2665: RAISE FND_API.G_EXC_ERROR;
2666: END IF;
2667:
2668:
2669: IF G_DEBUG = 'Y' THEN
2763: EXCEPTION
2764: WHEN NO_DATA_FOUND THEN
2765: FND_MESSAGE.set_name( 'AHL', 'AHL_COM_RECORD_CHANGED' );
2766: FND_MSG_PUB.add;
2767: RAISE FND_API.G_EXC_ERROR;
2768: WHEN OTHERS THEN
2769: RAISE;
2770: END;
2771:
2773: AHL_DEBUG_PUB.debug( G_PKG_NAME || '.' || l_api_name || ' : after Deleting Associated Operations' );
2774: END IF;
2775:
2776: -- Perform the Commit (if requested)
2777: IF FND_API.to_boolean( p_commit ) THEN
2778: COMMIT WORK;
2779: END IF;
2780:
2781: -- Count and Get messages (optional)
2780:
2781: -- Count and Get messages (optional)
2782: FND_MSG_PUB.count_and_get
2783: (
2784: p_encoded => FND_API.G_FALSE,
2785: p_count => x_msg_count,
2786: p_data => x_msg_data
2787: );
2788:
2792: END IF;
2793:
2794: EXCEPTION
2795:
2796: WHEN FND_API.G_EXC_ERROR THEN
2797: ROLLBACK TO delete_route_PVT;
2798: x_return_status := FND_API.G_RET_STS_ERROR ;
2799: FND_MSG_PUB.count_and_get
2800: (
2794: EXCEPTION
2795:
2796: WHEN FND_API.G_EXC_ERROR THEN
2797: ROLLBACK TO delete_route_PVT;
2798: x_return_status := FND_API.G_RET_STS_ERROR ;
2799: FND_MSG_PUB.count_and_get
2800: (
2801: p_encoded => FND_API.G_FALSE,
2802: p_count => x_msg_count,
2797: ROLLBACK TO delete_route_PVT;
2798: x_return_status := FND_API.G_RET_STS_ERROR ;
2799: FND_MSG_PUB.count_and_get
2800: (
2801: p_encoded => FND_API.G_FALSE,
2802: p_count => x_msg_count,
2803: p_data => x_msg_data
2804: );
2805:
2807: IF ( G_DEBUG = 'Y' ) THEN
2808: AHL_DEBUG_PUB.disable_debug;
2809: END IF;
2810:
2811: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2812: ROLLBACK TO delete_route_PVT;
2813: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2814: FND_MSG_PUB.count_and_get
2815: (
2809: END IF;
2810:
2811: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
2812: ROLLBACK TO delete_route_PVT;
2813: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2814: FND_MSG_PUB.count_and_get
2815: (
2816: p_encoded => FND_API.G_FALSE,
2817: p_count => x_msg_count,
2812: ROLLBACK TO delete_route_PVT;
2813: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2814: FND_MSG_PUB.count_and_get
2815: (
2816: p_encoded => FND_API.G_FALSE,
2817: p_count => x_msg_count,
2818: p_data => x_msg_data
2819: );
2820:
2824: END IF;
2825:
2826: WHEN OTHERS THEN
2827: ROLLBACK TO delete_route_PVT;
2828: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
2829: IF FND_MSG_PUB.check_msg_level( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )
2830: THEN
2831: FND_MSG_PUB.add_exc_msg
2832: (
2836: );
2837: END IF;
2838: FND_MSG_PUB.count_and_get
2839: (
2840: p_encoded => FND_API.G_FALSE,
2841: p_count => x_msg_count,
2842: p_data => x_msg_data
2843: );
2844:
2851:
2852: PROCEDURE create_route_revision
2853: (
2854: p_api_version IN NUMBER := '1.0',
2855: p_init_msg_list IN VARCHAR2 := FND_API.G_TRUE,
2856: p_commit IN VARCHAR2 := FND_API.G_FALSE,
2857: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
2858: p_default IN VARCHAR2 := FND_API.G_FALSE,
2859: p_module_type IN VARCHAR2 := NULL,
2852: PROCEDURE create_route_revision
2853: (
2854: p_api_version IN NUMBER := '1.0',
2855: p_init_msg_list IN VARCHAR2 := FND_API.G_TRUE,
2856: p_commit IN VARCHAR2 := FND_API.G_FALSE,
2857: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
2858: p_default IN VARCHAR2 := FND_API.G_FALSE,
2859: p_module_type IN VARCHAR2 := NULL,
2860: x_return_status OUT NOCOPY VARCHAR2,
2853: (
2854: p_api_version IN NUMBER := '1.0',
2855: p_init_msg_list IN VARCHAR2 := FND_API.G_TRUE,
2856: p_commit IN VARCHAR2 := FND_API.G_FALSE,
2857: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
2858: p_default IN VARCHAR2 := FND_API.G_FALSE,
2859: p_module_type IN VARCHAR2 := NULL,
2860: x_return_status OUT NOCOPY VARCHAR2,
2861: x_msg_count OUT NOCOPY NUMBER,
2854: p_api_version IN NUMBER := '1.0',
2855: p_init_msg_list IN VARCHAR2 := FND_API.G_TRUE,
2856: p_commit IN VARCHAR2 := FND_API.G_FALSE,
2857: p_validation_level IN NUMBER := FND_API.G_VALID_LEVEL_FULL,
2858: p_default IN VARCHAR2 := FND_API.G_FALSE,
2859: p_module_type IN VARCHAR2 := NULL,
2860: x_return_status OUT NOCOPY VARCHAR2,
2861: x_msg_count OUT NOCOPY NUMBER,
2862: x_msg_data OUT NOCOPY VARCHAR2,
2991: ;
2992:
2993: BEGIN
2994: -- Initialize API return status to success
2995: x_return_status := FND_API.G_RET_STS_SUCCESS;
2996:
2997: -- Standard Start of API savepoint
2998: SAVEPOINT create_route_revision_PVT;
2999:
2997: -- Standard Start of API savepoint
2998: SAVEPOINT create_route_revision_PVT;
2999:
3000: -- Standard call to check for call compatibility.
3001: IF NOT FND_API.compatible_api_call
3002: (
3003: l_api_version,
3004: p_api_version,
3005: l_api_name,
3005: l_api_name,
3006: G_PKG_NAME
3007: )
3008: THEN
3009: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3010: END IF;
3011:
3012: -- Initialize message list if p_init_msg_list is set to TRUE.
3013: IF FND_API.to_boolean( p_init_msg_list ) THEN
3009: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3010: END IF;
3011:
3012: -- Initialize message list if p_init_msg_list is set to TRUE.
3013: IF FND_API.to_boolean( p_init_msg_list ) THEN
3014: FND_MSG_PUB.initialize;
3015: END IF;
3016:
3017: -- Enable Debug (optional)
3033: x_msg_data => x_msg_data
3034: );
3035:
3036: -- If any severe error occurs, then, abort API.
3037: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
3038: RAISE FND_API.G_EXC_ERROR;
3039: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
3040: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3041: END IF;
3034: );
3035:
3036: -- If any severe error occurs, then, abort API.
3037: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
3038: RAISE FND_API.G_EXC_ERROR;
3039: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
3040: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3041: END IF;
3042:
3035:
3036: -- If any severe error occurs, then, abort API.
3037: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
3038: RAISE FND_API.G_EXC_ERROR;
3039: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
3040: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3041: END IF;
3042:
3043:
3036: -- If any severe error occurs, then, abort API.
3037: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
3038: RAISE FND_API.G_EXC_ERROR;
3039: ELSIF x_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
3040: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
3041: END IF;
3042:
3043:
3044: IF ( p_route_id IS NULL OR
3041: END IF;
3042:
3043:
3044: IF ( p_route_id IS NULL OR
3045: p_route_id = FND_API.G_MISS_NUM OR
3046: p_object_version_number IS NULL OR
3047: p_object_version_number = FND_API.G_MISS_NUM ) THEN
3048: FND_MESSAGE.set_name( 'AHL', 'AHL_COM_INVALID_PROCEDURE_CALL' );
3049: FND_MSG_PUB.add;
3043:
3044: IF ( p_route_id IS NULL OR
3045: p_route_id = FND_API.G_MISS_NUM OR
3046: p_object_version_number IS NULL OR
3047: p_object_version_number = FND_API.G_MISS_NUM ) THEN
3048: FND_MESSAGE.set_name( 'AHL', 'AHL_COM_INVALID_PROCEDURE_CALL' );
3049: FND_MSG_PUB.add;
3050: RAISE FND_API.G_EXC_ERROR;
3051: END IF;
3046: p_object_version_number IS NULL OR
3047: p_object_version_number = FND_API.G_MISS_NUM ) THEN
3048: FND_MESSAGE.set_name( 'AHL', 'AHL_COM_INVALID_PROCEDURE_CALL' );
3049: FND_MSG_PUB.add;
3050: RAISE FND_API.G_EXC_ERROR;
3051: END IF;
3052:
3053: get_route_record
3054: (
3058: p_object_version_number => p_object_version_number,
3059: p_x_route_rec => l_old_route_rec
3060: );
3061:
3062: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
3063: FND_MESSAGE.set_name( 'AHL', l_msg_data );
3064: FND_MSG_PUB.add;
3065: RAISE FND_API.G_EXC_ERROR;
3066: END IF;
3061:
3062: IF ( NVL( l_return_status, 'X' ) <> FND_API.G_RET_STS_SUCCESS ) THEN
3063: FND_MESSAGE.set_name( 'AHL', l_msg_data );
3064: FND_MSG_PUB.add;
3065: RAISE FND_API.G_EXC_ERROR;
3066: END IF;
3067:
3068: -- Check if the Status is COMPLETE
3069: IF ( l_old_route_rec.revision_status_code <> 'COMPLETE' ) THEN
3069: IF ( l_old_route_rec.revision_status_code <> 'COMPLETE' ) THEN
3070: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_RT_STATUS_NOT_COMPLETE' );
3071: FND_MESSAGE.set_token( 'RECORD', l_old_route_rec.route_no );
3072: FND_MSG_PUB.add;
3073: RAISE FND_API.G_EXC_ERROR;
3074: END IF;
3075:
3076: -- Check if this revision is not Terminated
3077: IF ( l_old_route_rec.active_end_date IS NOT NULL ) THEN
3077: IF ( l_old_route_rec.active_end_date IS NOT NULL ) THEN
3078: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_END_DATE_NOT_NULL' );
3079: FND_MESSAGE.set_token( 'RECORD', l_old_route_rec.route_no );
3080: FND_MSG_PUB.add;
3081: RAISE FND_API.G_EXC_ERROR;
3082: END IF;
3083:
3084: -- Check if this revision is the latest complete revision of this Route
3085: OPEN get_latest_revision( l_old_route_rec.route_no );
3091: FND_MESSAGE.set_name( 'AHL', 'AHL_RM_RT_REVISION_NOT_LATEST' );
3092: FND_MESSAGE.set_token( 'RECORD', l_old_route_rec.route_no );
3093: FND_MSG_PUB.add;
3094: CLOSE get_latest_revision;
3095: RAISE FND_API.G_EXC_ERROR;
3096: END IF;
3097:
3098: CLOSE get_latest_revision;
3099:
3749: -- Set the OUT values.
3750: x_route_id := l_route_id;
3751:
3752: -- Perform the Commit (if requested)
3753: IF FND_API.to_boolean( p_commit ) THEN
3754: COMMIT WORK;
3755: END IF;
3756:
3757: -- Count and Get messages (optional)
3756:
3757: -- Count and Get messages (optional)
3758: FND_MSG_PUB.count_and_get
3759: (
3760: p_encoded => FND_API.G_FALSE,
3761: p_count => x_msg_count,
3762: p_data => x_msg_data
3763: );
3764:
3768: END IF;
3769:
3770: EXCEPTION
3771:
3772: WHEN FND_API.G_EXC_ERROR THEN
3773: ROLLBACK TO create_route_revision_PVT;
3774: x_return_status := FND_API.G_RET_STS_ERROR ;
3775: FND_MSG_PUB.count_and_get
3776: (
3770: EXCEPTION
3771:
3772: WHEN FND_API.G_EXC_ERROR THEN
3773: ROLLBACK TO create_route_revision_PVT;
3774: x_return_status := FND_API.G_RET_STS_ERROR ;
3775: FND_MSG_PUB.count_and_get
3776: (
3777: p_encoded => FND_API.G_FALSE,
3778: p_count => x_msg_count,
3773: ROLLBACK TO create_route_revision_PVT;
3774: x_return_status := FND_API.G_RET_STS_ERROR ;
3775: FND_MSG_PUB.count_and_get
3776: (
3777: p_encoded => FND_API.G_FALSE,
3778: p_count => x_msg_count,
3779: p_data => x_msg_data
3780: );
3781:
3783: IF ( G_DEBUG = 'Y' ) THEN
3784: AHL_DEBUG_PUB.disable_debug;
3785: END IF;
3786:
3787: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3788: ROLLBACK TO create_route_revision_PVT;
3789: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
3790: FND_MSG_PUB.count_and_get
3791: (
3785: END IF;
3786:
3787: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3788: ROLLBACK TO create_route_revision_PVT;
3789: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
3790: FND_MSG_PUB.count_and_get
3791: (
3792: p_encoded => FND_API.G_FALSE,
3793: p_count => x_msg_count,
3788: ROLLBACK TO create_route_revision_PVT;
3789: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
3790: FND_MSG_PUB.count_and_get
3791: (
3792: p_encoded => FND_API.G_FALSE,
3793: p_count => x_msg_count,
3794: p_data => x_msg_data
3795: );
3796:
3800: END IF;
3801:
3802: WHEN OTHERS THEN
3803: ROLLBACK TO create_route_revision_PVT;
3804: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
3805: IF FND_MSG_PUB.check_msg_level( FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR )
3806: THEN
3807: FND_MSG_PUB.add_exc_msg
3808: (
3812: );
3813: END IF;
3814: FND_MSG_PUB.count_and_get
3815: (
3816: p_encoded => FND_API.G_FALSE,
3817: p_count => x_msg_count,
3818: p_data => x_msg_data
3819: );
3820: