54: l_msg_text VARCHAR2(1000);
55: l_org_id NUMBER;
56: BEGIN
57: -- Sets the debug mode to be FILE
58: --l_debug_mode := cln_debug_pub.Set_Debug_Mode('FILE');
59:
60: -- Initialize API return status to success
61: x_return_status := 'S';
62: FND_MESSAGE.SET_NAME('CLN','CLN_G_RET_MSG_SUCCESS');
62: FND_MESSAGE.SET_NAME('CLN','CLN_G_RET_MSG_SUCCESS');
63: x_msg_data := FND_MESSAGE.GET;
64:
65: IF (l_Debug_Level <= 2) THEN
66: cln_debug_pub.Add('ENTERING PROCESS_HEADER', 2);
67: END IF;
68:
69: IF (l_Debug_Level <= 1) THEN
70: cln_debug_pub.Add('With the following parameters:', 1);
66: cln_debug_pub.Add('ENTERING PROCESS_HEADER', 2);
67: END IF;
68:
69: IF (l_Debug_Level <= 1) THEN
70: cln_debug_pub.Add('With the following parameters:', 1);
71: cln_debug_pub.Add('p_app_ref_id:' || p_app_ref_id, 1);
72: cln_debug_pub.Add('p_int_cont_num:' || p_int_cont_num, 1);
73: cln_debug_pub.Add('p_ctg_sync_id:' || p_ctg_sync_id, 1);
74: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
67: END IF;
68:
69: IF (l_Debug_Level <= 1) THEN
70: cln_debug_pub.Add('With the following parameters:', 1);
71: cln_debug_pub.Add('p_app_ref_id:' || p_app_ref_id, 1);
72: cln_debug_pub.Add('p_int_cont_num:' || p_int_cont_num, 1);
73: cln_debug_pub.Add('p_ctg_sync_id:' || p_ctg_sync_id, 1);
74: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
75: cln_debug_pub.Add('p_batch_id:' || p_batch_id, 1);
68:
69: IF (l_Debug_Level <= 1) THEN
70: cln_debug_pub.Add('With the following parameters:', 1);
71: cln_debug_pub.Add('p_app_ref_id:' || p_app_ref_id, 1);
72: cln_debug_pub.Add('p_int_cont_num:' || p_int_cont_num, 1);
73: cln_debug_pub.Add('p_ctg_sync_id:' || p_ctg_sync_id, 1);
74: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
75: cln_debug_pub.Add('p_batch_id:' || p_batch_id, 1);
76: cln_debug_pub.Add('p_doc_type:' || p_doc_type, 1);
69: IF (l_Debug_Level <= 1) THEN
70: cln_debug_pub.Add('With the following parameters:', 1);
71: cln_debug_pub.Add('p_app_ref_id:' || p_app_ref_id, 1);
72: cln_debug_pub.Add('p_int_cont_num:' || p_int_cont_num, 1);
73: cln_debug_pub.Add('p_ctg_sync_id:' || p_ctg_sync_id, 1);
74: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
75: cln_debug_pub.Add('p_batch_id:' || p_batch_id, 1);
76: cln_debug_pub.Add('p_doc_type:' || p_doc_type, 1);
77: cln_debug_pub.Add('p_tp_id:' || p_tp_id, 1);
70: cln_debug_pub.Add('With the following parameters:', 1);
71: cln_debug_pub.Add('p_app_ref_id:' || p_app_ref_id, 1);
72: cln_debug_pub.Add('p_int_cont_num:' || p_int_cont_num, 1);
73: cln_debug_pub.Add('p_ctg_sync_id:' || p_ctg_sync_id, 1);
74: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
75: cln_debug_pub.Add('p_batch_id:' || p_batch_id, 1);
76: cln_debug_pub.Add('p_doc_type:' || p_doc_type, 1);
77: cln_debug_pub.Add('p_tp_id:' || p_tp_id, 1);
78: cln_debug_pub.Add('p_tp_site_id:' || p_tp_site_id, 1);
71: cln_debug_pub.Add('p_app_ref_id:' || p_app_ref_id, 1);
72: cln_debug_pub.Add('p_int_cont_num:' || p_int_cont_num, 1);
73: cln_debug_pub.Add('p_ctg_sync_id:' || p_ctg_sync_id, 1);
74: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
75: cln_debug_pub.Add('p_batch_id:' || p_batch_id, 1);
76: cln_debug_pub.Add('p_doc_type:' || p_doc_type, 1);
77: cln_debug_pub.Add('p_tp_id:' || p_tp_id, 1);
78: cln_debug_pub.Add('p_tp_site_id:' || p_tp_site_id, 1);
79: cln_debug_pub.Add('p_ctg_name:' || p_ctg_name, 1);
72: cln_debug_pub.Add('p_int_cont_num:' || p_int_cont_num, 1);
73: cln_debug_pub.Add('p_ctg_sync_id:' || p_ctg_sync_id, 1);
74: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
75: cln_debug_pub.Add('p_batch_id:' || p_batch_id, 1);
76: cln_debug_pub.Add('p_doc_type:' || p_doc_type, 1);
77: cln_debug_pub.Add('p_tp_id:' || p_tp_id, 1);
78: cln_debug_pub.Add('p_tp_site_id:' || p_tp_site_id, 1);
79: cln_debug_pub.Add('p_ctg_name:' || p_ctg_name, 1);
80: cln_debug_pub.Add('p_eff_date:' || p_eff_date, 1);
73: cln_debug_pub.Add('p_ctg_sync_id:' || p_ctg_sync_id, 1);
74: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
75: cln_debug_pub.Add('p_batch_id:' || p_batch_id, 1);
76: cln_debug_pub.Add('p_doc_type:' || p_doc_type, 1);
77: cln_debug_pub.Add('p_tp_id:' || p_tp_id, 1);
78: cln_debug_pub.Add('p_tp_site_id:' || p_tp_site_id, 1);
79: cln_debug_pub.Add('p_ctg_name:' || p_ctg_name, 1);
80: cln_debug_pub.Add('p_eff_date:' || p_eff_date, 1);
81: cln_debug_pub.Add('p_exp_date:' || p_exp_date, 1);
74: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
75: cln_debug_pub.Add('p_batch_id:' || p_batch_id, 1);
76: cln_debug_pub.Add('p_doc_type:' || p_doc_type, 1);
77: cln_debug_pub.Add('p_tp_id:' || p_tp_id, 1);
78: cln_debug_pub.Add('p_tp_site_id:' || p_tp_site_id, 1);
79: cln_debug_pub.Add('p_ctg_name:' || p_ctg_name, 1);
80: cln_debug_pub.Add('p_eff_date:' || p_eff_date, 1);
81: cln_debug_pub.Add('p_exp_date:' || p_exp_date, 1);
82: cln_debug_pub.Add('p_currency:' || p_currency, 1);
75: cln_debug_pub.Add('p_batch_id:' || p_batch_id, 1);
76: cln_debug_pub.Add('p_doc_type:' || p_doc_type, 1);
77: cln_debug_pub.Add('p_tp_id:' || p_tp_id, 1);
78: cln_debug_pub.Add('p_tp_site_id:' || p_tp_site_id, 1);
79: cln_debug_pub.Add('p_ctg_name:' || p_ctg_name, 1);
80: cln_debug_pub.Add('p_eff_date:' || p_eff_date, 1);
81: cln_debug_pub.Add('p_exp_date:' || p_exp_date, 1);
82: cln_debug_pub.Add('p_currency:' || p_currency, 1);
83: END IF;
76: cln_debug_pub.Add('p_doc_type:' || p_doc_type, 1);
77: cln_debug_pub.Add('p_tp_id:' || p_tp_id, 1);
78: cln_debug_pub.Add('p_tp_site_id:' || p_tp_site_id, 1);
79: cln_debug_pub.Add('p_ctg_name:' || p_ctg_name, 1);
80: cln_debug_pub.Add('p_eff_date:' || p_eff_date, 1);
81: cln_debug_pub.Add('p_exp_date:' || p_exp_date, 1);
82: cln_debug_pub.Add('p_currency:' || p_currency, 1);
83: END IF;
84:
77: cln_debug_pub.Add('p_tp_id:' || p_tp_id, 1);
78: cln_debug_pub.Add('p_tp_site_id:' || p_tp_site_id, 1);
79: cln_debug_pub.Add('p_ctg_name:' || p_ctg_name, 1);
80: cln_debug_pub.Add('p_eff_date:' || p_eff_date, 1);
81: cln_debug_pub.Add('p_exp_date:' || p_exp_date, 1);
82: cln_debug_pub.Add('p_currency:' || p_currency, 1);
83: END IF;
84:
85: -- No need to create collaboration since XMLGateway Event handler will create
78: cln_debug_pub.Add('p_tp_site_id:' || p_tp_site_id, 1);
79: cln_debug_pub.Add('p_ctg_name:' || p_ctg_name, 1);
80: cln_debug_pub.Add('p_eff_date:' || p_eff_date, 1);
81: cln_debug_pub.Add('p_exp_date:' || p_exp_date, 1);
82: cln_debug_pub.Add('p_currency:' || p_currency, 1);
83: END IF;
84:
85: -- No need to create collaboration since XMLGateway Event handler will create
86: -- a collaboration if XMLGateway receives an inbound CLN document otherthan CBOD
89: -- l_ctg_name := substr(p_ctg_name, 1, instr(p_ctg_name, ':', 1, 3)-1);
90:
91: l_ctg_name := p_ctg_name;
92: IF (l_Debug_Level <= 1) THEN
93: cln_debug_pub.Add('l_ctg_name:' || l_ctg_name, 1);
94: END IF;
95:
96:
97: -- If the sysnc id is anything other than A,R,U error out
99: IF (l_ctg_sync_id IS NULL) OR ( l_ctg_sync_id <> 'A'
100: AND l_ctg_sync_id <> 'U'
101: AND l_ctg_sync_id <> 'R') THEN
102: IF (l_Debug_Level <= 1) THEN
103: cln_debug_pub.Add('Invalid Transaction Code - ' || l_ctg_sync_id, 1);
104: END IF;
105:
106: -- Invalid Transaction Code - "CODE"
107: FND_MESSAGE.SET_NAME('CLN','CLN_INVALID_TXN_CODE');
120: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
121: END IF;
122: x_return_status := FND_API.G_RET_STS_ERROR;
123: IF (l_Debug_Level <= 1) THEN
124: cln_debug_pub.Add(x_msg_data, 1);
125: END IF;
126:
127: IF (l_Debug_Level <= 2) THEN
128: cln_debug_pub.Add('EXITING PROCESS_HEADER', 2);
124: cln_debug_pub.Add(x_msg_data, 1);
125: END IF;
126:
127: IF (l_Debug_Level <= 2) THEN
128: cln_debug_pub.Add('EXITING PROCESS_HEADER', 2);
129: END IF;
130:
131: RETURN;
132: END IF;
146: WHEN NO_DATA_FOUND THEN
147: x_operation := 'INSERT';
148: WHEN OTHERS THEN
149: IF (l_Debug_Level <= 5) THEN
150: cln_debug_pub.Add('Exception while trying to obtain the BPO number',5);
151: END IF;
152: x_return_status := FND_API.G_RET_STS_ERROR;
153: l_error_code := SQLCODE;
154: l_error_msg := SQLERRM;
153: l_error_code := SQLCODE;
154: l_error_msg := SQLERRM;
155: x_msg_data := l_error_code||' : '||l_error_msg;
156: IF (l_Debug_Level <= 5) THEN
157: cln_debug_pub.Add(x_msg_data, 5);
158: END IF;
159:
160: x_msg_data := 'While trying to obtain BPO number'
161: || ' for the inbound sync catalog#'
163: || ', the following error is encountered:'
164: || x_msg_data;
165: CLN_NP_PROCESSOR_PKG.NOTIFY_ADMINISTRATOR(x_msg_data);
166: IF (l_Debug_Level <= 5) THEN
167: cln_debug_pub.Add('EXITING PROCESS_HEADER', 2);
168: END IF;
169: RETURN;
170: END;
171:
173: FND_MESSAGE.SET_NAME('CLN','CLN_DOCUMENT_PROCESSED');
174: -- Document Processed
175: l_msg_text := FND_MESSAGE.GET;
176: IF (l_Debug_Level <= 1) THEN
177: cln_debug_pub.Add('l_msg_text:' || l_msg_text, 1);
178: END IF;
179:
180:
181: RAISE_UPDATE_COLLABORATION(
188: p_status_code => 0,
189: p_int_ctl_num => p_int_cont_num);
190: IF l_return_status <> 'S' THEN
191: IF (l_Debug_Level <= 1) THEN
192: cln_debug_pub.Add('RAISE_UPDATE_COLLABORATION CALL FAILED',1);
193: END IF;
194:
195: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
196: END IF;
201: WHERE vendor_site_id = p_tp_site_id;
202:
203:
204: IF (l_Debug_Level <= 1) THEN
205: cln_debug_pub.Add('x_operation:' || x_operation, 1);
206: END IF;
207:
208: SAVEPOINT PO_UPDATE_TXN;
209:
270: l_org_id,
271: 0);
272: END IF;
273: IF (l_Debug_Level <= 2) THEN
274: cln_debug_pub.Add('EXITING PROCESS_HEADER', 2);
275: END IF;
276:
277: EXCEPTION
278: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
277: EXCEPTION
278: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
279: ROLLBACK TO PO_UPDATE_TXN;
280: IF (l_Debug_Level <= 5) THEN
281: cln_debug_pub.Add('Rolledback PO_UPDATE_TXN transaction',5);
282: END IF;
283:
284: -- Assaign global error info and set return values
285: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
284: -- Assaign global error info and set return values
285: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
286: x_msg_data := l_return_msg;
287: IF (l_Debug_Level <= 5) THEN
288: cln_debug_pub.Add(x_msg_data, 5);
289: END IF;
290:
291: x_msg_data := 'While trying to process header details'
292: || ' for the inbound sync catalog#'
294: || ', the following error is encountered:'
295: || x_msg_data;
296: CLN_NP_PROCESSOR_PKG.NOTIFY_ADMINISTRATOR(x_msg_data);
297: IF (l_Debug_Level <= 5) THEN
298: cln_debug_pub.Add('EXITING PROCESS_HEADER', 2);
299: END IF;
300:
301: WHEN OTHERS THEN
302: ROLLBACK TO PO_UPDATE_TXN;
300:
301: WHEN OTHERS THEN
302: ROLLBACK TO PO_UPDATE_TXN;
303: IF (l_Debug_Level <= 5) THEN
304: cln_debug_pub.Add('Rolledback PO_UPDATE_TXN transaction',5);
305: END IF;
306:
307: x_return_status := FND_API.G_RET_STS_ERROR;
308: l_error_code := SQLCODE;
308: l_error_code := SQLCODE;
309: l_error_msg := SQLERRM;
310: x_msg_data := l_error_code||' : '||l_error_msg;
311: IF (l_Debug_Level <= 5) THEN
312: cln_debug_pub.Add(x_msg_data, 5);
313: END IF;
314:
315: x_msg_data := 'While trying to process header details'
316: || ' for the inbound sync catalog#'
318: || ', the following error is encountered:'
319: || x_msg_data;
320: CLN_NP_PROCESSOR_PKG.NOTIFY_ADMINISTRATOR(x_msg_data);
321: IF (l_Debug_Level <= 5) THEN
322: cln_debug_pub.Add('EXITING PROCESS_HEADER', 2);
323: END IF;
324:
325: END PROCESS_HEADER;
326:
386: l_uom_code VARCHAR2(500);
387: BEGIN
388:
389: -- Sets the debug mode to be FILE
390: --l_debug_mode := cln_debug_pub.Set_Debug_Mode('FILE');
391:
392: -- Initialize API return status to success
393: x_return_status := 'S';
394: FND_MESSAGE.SET_NAME('CLN','CLN_G_RET_MSG_SUCCESS');
394: FND_MESSAGE.SET_NAME('CLN','CLN_G_RET_MSG_SUCCESS');
395: x_msg_data := FND_MESSAGE.GET;
396:
397: IF (l_Debug_Level <= 2) THEN
398: cln_debug_pub.Add('ENTERING PROCESS_LINE', 2);
399: END IF;
400:
401: IF (l_Debug_Level <= 1) THEN
402: cln_debug_pub.Add('With the following parameters:', 1);
398: cln_debug_pub.Add('ENTERING PROCESS_LINE', 2);
399: END IF;
400:
401: IF (l_Debug_Level <= 1) THEN
402: cln_debug_pub.Add('With the following parameters:', 1);
403: cln_debug_pub.Add('p_operation:' || p_operation, 1);
404: cln_debug_pub.Add('p_hdr_id:' || p_hdr_id, 1);
405: cln_debug_pub.Add('p_app_ref_id:' || p_app_ref_id, 1);
406: cln_debug_pub.Add('p_int_cont_num:' || p_int_cont_num, 1);
399: END IF;
400:
401: IF (l_Debug_Level <= 1) THEN
402: cln_debug_pub.Add('With the following parameters:', 1);
403: cln_debug_pub.Add('p_operation:' || p_operation, 1);
404: cln_debug_pub.Add('p_hdr_id:' || p_hdr_id, 1);
405: cln_debug_pub.Add('p_app_ref_id:' || p_app_ref_id, 1);
406: cln_debug_pub.Add('p_int_cont_num:' || p_int_cont_num, 1);
407: cln_debug_pub.Add('p_ctg_name:' || p_ctg_name, 1);
400:
401: IF (l_Debug_Level <= 1) THEN
402: cln_debug_pub.Add('With the following parameters:', 1);
403: cln_debug_pub.Add('p_operation:' || p_operation, 1);
404: cln_debug_pub.Add('p_hdr_id:' || p_hdr_id, 1);
405: cln_debug_pub.Add('p_app_ref_id:' || p_app_ref_id, 1);
406: cln_debug_pub.Add('p_int_cont_num:' || p_int_cont_num, 1);
407: cln_debug_pub.Add('p_ctg_name:' || p_ctg_name, 1);
408: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
401: IF (l_Debug_Level <= 1) THEN
402: cln_debug_pub.Add('With the following parameters:', 1);
403: cln_debug_pub.Add('p_operation:' || p_operation, 1);
404: cln_debug_pub.Add('p_hdr_id:' || p_hdr_id, 1);
405: cln_debug_pub.Add('p_app_ref_id:' || p_app_ref_id, 1);
406: cln_debug_pub.Add('p_int_cont_num:' || p_int_cont_num, 1);
407: cln_debug_pub.Add('p_ctg_name:' || p_ctg_name, 1);
408: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
409: cln_debug_pub.Add('p_itf_lin_id:' || p_itf_lin_id, 1);
402: cln_debug_pub.Add('With the following parameters:', 1);
403: cln_debug_pub.Add('p_operation:' || p_operation, 1);
404: cln_debug_pub.Add('p_hdr_id:' || p_hdr_id, 1);
405: cln_debug_pub.Add('p_app_ref_id:' || p_app_ref_id, 1);
406: cln_debug_pub.Add('p_int_cont_num:' || p_int_cont_num, 1);
407: cln_debug_pub.Add('p_ctg_name:' || p_ctg_name, 1);
408: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
409: cln_debug_pub.Add('p_itf_lin_id:' || p_itf_lin_id, 1);
410: cln_debug_pub.Add('p_vdr_part_num:' || p_vdr_part_num, 1);
403: cln_debug_pub.Add('p_operation:' || p_operation, 1);
404: cln_debug_pub.Add('p_hdr_id:' || p_hdr_id, 1);
405: cln_debug_pub.Add('p_app_ref_id:' || p_app_ref_id, 1);
406: cln_debug_pub.Add('p_int_cont_num:' || p_int_cont_num, 1);
407: cln_debug_pub.Add('p_ctg_name:' || p_ctg_name, 1);
408: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
409: cln_debug_pub.Add('p_itf_lin_id:' || p_itf_lin_id, 1);
410: cln_debug_pub.Add('p_vdr_part_num:' || p_vdr_part_num, 1);
411: cln_debug_pub.Add('p_item_desc:' || p_item_desc, 1);
404: cln_debug_pub.Add('p_hdr_id:' || p_hdr_id, 1);
405: cln_debug_pub.Add('p_app_ref_id:' || p_app_ref_id, 1);
406: cln_debug_pub.Add('p_int_cont_num:' || p_int_cont_num, 1);
407: cln_debug_pub.Add('p_ctg_name:' || p_ctg_name, 1);
408: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
409: cln_debug_pub.Add('p_itf_lin_id:' || p_itf_lin_id, 1);
410: cln_debug_pub.Add('p_vdr_part_num:' || p_vdr_part_num, 1);
411: cln_debug_pub.Add('p_item_desc:' || p_item_desc, 1);
412: cln_debug_pub.Add('p_item:' || p_item, 1);
405: cln_debug_pub.Add('p_app_ref_id:' || p_app_ref_id, 1);
406: cln_debug_pub.Add('p_int_cont_num:' || p_int_cont_num, 1);
407: cln_debug_pub.Add('p_ctg_name:' || p_ctg_name, 1);
408: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
409: cln_debug_pub.Add('p_itf_lin_id:' || p_itf_lin_id, 1);
410: cln_debug_pub.Add('p_vdr_part_num:' || p_vdr_part_num, 1);
411: cln_debug_pub.Add('p_item_desc:' || p_item_desc, 1);
412: cln_debug_pub.Add('p_item:' || p_item, 1);
413: cln_debug_pub.Add('p_item_rev:' || p_item_rev, 1);
406: cln_debug_pub.Add('p_int_cont_num:' || p_int_cont_num, 1);
407: cln_debug_pub.Add('p_ctg_name:' || p_ctg_name, 1);
408: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
409: cln_debug_pub.Add('p_itf_lin_id:' || p_itf_lin_id, 1);
410: cln_debug_pub.Add('p_vdr_part_num:' || p_vdr_part_num, 1);
411: cln_debug_pub.Add('p_item_desc:' || p_item_desc, 1);
412: cln_debug_pub.Add('p_item:' || p_item, 1);
413: cln_debug_pub.Add('p_item_rev:' || p_item_rev, 1);
414: cln_debug_pub.Add('p_category:' || p_category, 1);
407: cln_debug_pub.Add('p_ctg_name:' || p_ctg_name, 1);
408: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
409: cln_debug_pub.Add('p_itf_lin_id:' || p_itf_lin_id, 1);
410: cln_debug_pub.Add('p_vdr_part_num:' || p_vdr_part_num, 1);
411: cln_debug_pub.Add('p_item_desc:' || p_item_desc, 1);
412: cln_debug_pub.Add('p_item:' || p_item, 1);
413: cln_debug_pub.Add('p_item_rev:' || p_item_rev, 1);
414: cln_debug_pub.Add('p_category:' || p_category, 1);
415: cln_debug_pub.Add('p_uom:' || p_uom, 1);
408: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
409: cln_debug_pub.Add('p_itf_lin_id:' || p_itf_lin_id, 1);
410: cln_debug_pub.Add('p_vdr_part_num:' || p_vdr_part_num, 1);
411: cln_debug_pub.Add('p_item_desc:' || p_item_desc, 1);
412: cln_debug_pub.Add('p_item:' || p_item, 1);
413: cln_debug_pub.Add('p_item_rev:' || p_item_rev, 1);
414: cln_debug_pub.Add('p_category:' || p_category, 1);
415: cln_debug_pub.Add('p_uom:' || p_uom, 1);
416: cln_debug_pub.Add('p_item_min_ord_quan:' || p_item_min_ord_quan, 1);
409: cln_debug_pub.Add('p_itf_lin_id:' || p_itf_lin_id, 1);
410: cln_debug_pub.Add('p_vdr_part_num:' || p_vdr_part_num, 1);
411: cln_debug_pub.Add('p_item_desc:' || p_item_desc, 1);
412: cln_debug_pub.Add('p_item:' || p_item, 1);
413: cln_debug_pub.Add('p_item_rev:' || p_item_rev, 1);
414: cln_debug_pub.Add('p_category:' || p_category, 1);
415: cln_debug_pub.Add('p_uom:' || p_uom, 1);
416: cln_debug_pub.Add('p_item_min_ord_quan:' || p_item_min_ord_quan, 1);
417: cln_debug_pub.Add('p_price:' || p_price, 1);
410: cln_debug_pub.Add('p_vdr_part_num:' || p_vdr_part_num, 1);
411: cln_debug_pub.Add('p_item_desc:' || p_item_desc, 1);
412: cln_debug_pub.Add('p_item:' || p_item, 1);
413: cln_debug_pub.Add('p_item_rev:' || p_item_rev, 1);
414: cln_debug_pub.Add('p_category:' || p_category, 1);
415: cln_debug_pub.Add('p_uom:' || p_uom, 1);
416: cln_debug_pub.Add('p_item_min_ord_quan:' || p_item_min_ord_quan, 1);
417: cln_debug_pub.Add('p_price:' || p_price, 1);
418: cln_debug_pub.Add('p_price_uom:' || p_price_uom, 1);
411: cln_debug_pub.Add('p_item_desc:' || p_item_desc, 1);
412: cln_debug_pub.Add('p_item:' || p_item, 1);
413: cln_debug_pub.Add('p_item_rev:' || p_item_rev, 1);
414: cln_debug_pub.Add('p_category:' || p_category, 1);
415: cln_debug_pub.Add('p_uom:' || p_uom, 1);
416: cln_debug_pub.Add('p_item_min_ord_quan:' || p_item_min_ord_quan, 1);
417: cln_debug_pub.Add('p_price:' || p_price, 1);
418: cln_debug_pub.Add('p_price_uom:' || p_price_uom, 1);
419: cln_debug_pub.Add('p_price_currency:' || p_price_currency, 1);
412: cln_debug_pub.Add('p_item:' || p_item, 1);
413: cln_debug_pub.Add('p_item_rev:' || p_item_rev, 1);
414: cln_debug_pub.Add('p_category:' || p_category, 1);
415: cln_debug_pub.Add('p_uom:' || p_uom, 1);
416: cln_debug_pub.Add('p_item_min_ord_quan:' || p_item_min_ord_quan, 1);
417: cln_debug_pub.Add('p_price:' || p_price, 1);
418: cln_debug_pub.Add('p_price_uom:' || p_price_uom, 1);
419: cln_debug_pub.Add('p_price_currency:' || p_price_currency, 1);
420: END IF;
413: cln_debug_pub.Add('p_item_rev:' || p_item_rev, 1);
414: cln_debug_pub.Add('p_category:' || p_category, 1);
415: cln_debug_pub.Add('p_uom:' || p_uom, 1);
416: cln_debug_pub.Add('p_item_min_ord_quan:' || p_item_min_ord_quan, 1);
417: cln_debug_pub.Add('p_price:' || p_price, 1);
418: cln_debug_pub.Add('p_price_uom:' || p_price_uom, 1);
419: cln_debug_pub.Add('p_price_currency:' || p_price_currency, 1);
420: END IF;
421:
414: cln_debug_pub.Add('p_category:' || p_category, 1);
415: cln_debug_pub.Add('p_uom:' || p_uom, 1);
416: cln_debug_pub.Add('p_item_min_ord_quan:' || p_item_min_ord_quan, 1);
417: cln_debug_pub.Add('p_price:' || p_price, 1);
418: cln_debug_pub.Add('p_price_uom:' || p_price_uom, 1);
419: cln_debug_pub.Add('p_price_currency:' || p_price_currency, 1);
420: END IF;
421:
422:
415: cln_debug_pub.Add('p_uom:' || p_uom, 1);
416: cln_debug_pub.Add('p_item_min_ord_quan:' || p_item_min_ord_quan, 1);
417: cln_debug_pub.Add('p_price:' || p_price, 1);
418: cln_debug_pub.Add('p_price_uom:' || p_price_uom, 1);
419: cln_debug_pub.Add('p_price_currency:' || p_price_currency, 1);
420: END IF;
421:
422:
423: -- Need to reomve the sysdate
433: */
434:
435: l_uom_code := p_uom;
436: IF (l_Debug_Level <= 1) THEN
437: cln_debug_pub.Add('l_uom_code:' || l_uom_code, 1);
438: END IF;
439:
440: -- Need to find if it a duplicate item
441: BEGIN
452: END;
453:
454: IF l_line_num IS NOT NULL THEN
455: IF (l_Debug_Level <= 1) THEN
456: cln_debug_pub.Add('Duplicate item:' || p_item, 1);
457: cln_debug_pub.Add('UOM - ' || l_uom_code, 1);
458: cln_debug_pub.Add('Line number found : ' || l_line_num, 1);
459: END IF;
460: x_line_num := l_line_num;
453:
454: IF l_line_num IS NOT NULL THEN
455: IF (l_Debug_Level <= 1) THEN
456: cln_debug_pub.Add('Duplicate item:' || p_item, 1);
457: cln_debug_pub.Add('UOM - ' || l_uom_code, 1);
458: cln_debug_pub.Add('Line number found : ' || l_line_num, 1);
459: END IF;
460: x_line_num := l_line_num;
461:
454: IF l_line_num IS NOT NULL THEN
455: IF (l_Debug_Level <= 1) THEN
456: cln_debug_pub.Add('Duplicate item:' || p_item, 1);
457: cln_debug_pub.Add('UOM - ' || l_uom_code, 1);
458: cln_debug_pub.Add('Line number found : ' || l_line_num, 1);
459: END IF;
460: x_line_num := l_line_num;
461:
462: /****** Need not throw error as per bug 3430538
465: FND_MESSAGE.SET_TOKEN('ITEM', p_item);
466: FND_MESSAGE.SET_TOKEN('CODE', l_uom_code);
467: x_msg_data := FND_MESSAGE.GET;
468: IF (l_Debug_Level <= 1) THEN
469: cln_debug_pub.Add('x_msg_data:' || x_msg_data, 1);
470: END IF;
471:
472: RAISE_UPDATE_COLLABORATION(
473: x_return_status => l_return_status,
482: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
483: END IF;
484: x_return_status := 'DIE';
485: IF (l_Debug_Level <= 1) THEN
486: cln_debug_pub.Add(x_msg_data, 1);
487: END IF;
488: ********* End of commenting*/
489:
490: IF (l_Debug_Level <= 2) THEN
487: END IF;
488: ********* End of commenting*/
489:
490: IF (l_Debug_Level <= 2) THEN
491: cln_debug_pub.Add('EXITING PROCESS_ORDER_HEADER, WITHOUT CREATION LINE', 2);
492: END IF;
493:
494: RETURN;
495:
499: INTO l_line_num
500: FROM DUAL;
501:
502: IF (l_Debug_Level <= 1) THEN
503: cln_debug_pub.Add('l_line_num:' || l_line_num, 1);
504: END IF;
505:
506: x_line_num := l_line_num;
507:
558: p_attribute14,
559: p_attribute15);
560:
561: IF (l_Debug_Level <= 1) THEN
562: cln_debug_pub.Add('Inserted a row into for the line', 1);
563: END IF;
564:
565:
566: /*
641: -- NO need to compare category
642: -- AND MCT.CATEGORY_ID = POL.CATEGORY_ID
643: -- AND upper(MCT.CONCATENATED_SEGMENTS) = upper(p_category);
644:
645: cln_debug_pub.Add('x_line_num:' || x_line_num, 1);
646: -- Insert the line if necessary ?
647:
648: EXCEPTION
649: WHEN NO_DATA_FOUND THEN
647:
648: EXCEPTION
649: WHEN NO_DATA_FOUND THEN
650: -- Line does not exist, create a new line
651: cln_debug_pub.Add('Line number does not exist, creating a new row', 1);
652: SELECT cln_generic_s.nextval
653: INTO l_line_num
654: FROM DUAL;
655: x_line_num := l_line_num;
652: SELECT cln_generic_s.nextval
653: INTO l_line_num
654: FROM DUAL;
655: x_line_num := l_line_num;
656: cln_debug_pub.Add('x_line_num:' || x_line_num, 1);
657: INSERT INTO po_lines_interface(interface_header_id,
658: interface_line_id,
659: item,
660: line_num)
678: p_ref5 => p_vdr_part_num,
679: p_dtl_msg => NULL);
680: IF l_return_status <> 'S' THEN
681: IF (l_Debug_Level <= 1) THEN
682: cln_debug_pub.Add('RAISE_ADD_MESSAGE CALL FAILED', 1);
683: END IF;
684:
685: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
686: END IF;
685: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
686: END IF;
687:
688: IF (l_Debug_Level <= 2) THEN
689: cln_debug_pub.Add('EXITING PROCESS_LINE', 2);
690: END IF;
691:
692: EXCEPTION
693: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
692: EXCEPTION
693: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
694: ROLLBACK TO PO_UPDATE_TXN;
695: IF (l_Debug_Level <= 5) THEN
696: cln_debug_pub.Add('Rolledback PO_UPDATE_TXN transaction',5);
697: END IF;
698:
699: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
700: x_msg_data := l_return_msg;
698:
699: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
700: x_msg_data := l_return_msg;
701: IF (l_Debug_Level <= 5) THEN
702: cln_debug_pub.Add(x_msg_data, 5);
703: END IF;
704:
705: x_msg_data := 'While trying to process line details'
706: || ' for the inbound sync catalog#'
708: || ', the following error is encountered:'
709: || x_msg_data;
710: CLN_NP_PROCESSOR_PKG.NOTIFY_ADMINISTRATOR(x_msg_data);
711: IF (l_Debug_Level <= 2) THEN
712: cln_debug_pub.Add('EXITING PROCESS_LINE', 2);
713: END IF;
714:
715: WHEN OTHERS THEN
716: ROLLBACK TO PO_UPDATE_TXN;
715: WHEN OTHERS THEN
716: ROLLBACK TO PO_UPDATE_TXN;
717: -- More descriptive line details ?
718: IF (l_Debug_Level <= 5) THEN
719: cln_debug_pub.Add('Rolledback PO_UPDATE_TXN transaction',5);
720: END IF;
721:
722: x_return_status := FND_API.G_RET_STS_ERROR;
723: l_error_code := SQLCODE;
723: l_error_code := SQLCODE;
724: l_error_msg := SQLERRM;
725: x_msg_data := l_error_code||' : '||l_error_msg;
726: IF (l_Debug_Level <= 5) THEN
727: cln_debug_pub.Add(x_msg_data, 5);
728: END IF;
729:
730: x_msg_data := 'While trying to process line details'
731: || ' for the inbound sync catalog#'
733: || ', the following error is encountered:'
734: || x_msg_data;
735: CLN_NP_PROCESSOR_PKG.NOTIFY_ADMINISTRATOR(x_msg_data);
736: IF (l_Debug_Level <= 5) THEN
737: cln_debug_pub.Add('EXITING PROCESS_LINE', 2);
738: END IF;
739:
740: END PROCESS_LINE;
741:
784: l_count NUMBER;
785: BEGIN
786:
787: -- Sets the debug mode to be FILE
788: --l_debug_mode := cln_debug_pub.Set_Debug_Mode('FILE');
789:
790: -- Initialize API return status to success
791: x_return_status := 'S';
792: FND_MESSAGE.SET_NAME('CLN','CLN_G_RET_MSG_SUCCESS');
792: FND_MESSAGE.SET_NAME('CLN','CLN_G_RET_MSG_SUCCESS');
793: x_msg_data := FND_MESSAGE.GET;
794:
795: IF (l_Debug_Level <= 2) THEN
796: cln_debug_pub.Add('ENTERING PROCESS_PRICE_BREAKS', 2);
797: END IF;
798:
799: IF (l_Debug_Level <= 1) THEN
800: cln_debug_pub.Add('With the following parameters:', 1);
796: cln_debug_pub.Add('ENTERING PROCESS_PRICE_BREAKS', 2);
797: END IF;
798:
799: IF (l_Debug_Level <= 1) THEN
800: cln_debug_pub.Add('With the following parameters:', 1);
801: cln_debug_pub.Add('p_app_ref_id:' || p_app_ref_id, 1);
802: cln_debug_pub.Add('p_int_cont_num:' || p_int_cont_num, 1);
803: cln_debug_pub.Add('p_ctg_name:' || p_ctg_name, 1);
804: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
797: END IF;
798:
799: IF (l_Debug_Level <= 1) THEN
800: cln_debug_pub.Add('With the following parameters:', 1);
801: cln_debug_pub.Add('p_app_ref_id:' || p_app_ref_id, 1);
802: cln_debug_pub.Add('p_int_cont_num:' || p_int_cont_num, 1);
803: cln_debug_pub.Add('p_ctg_name:' || p_ctg_name, 1);
804: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
805: cln_debug_pub.Add('p_itf_lin_id:' || p_itf_lin_id, 1);
798:
799: IF (l_Debug_Level <= 1) THEN
800: cln_debug_pub.Add('With the following parameters:', 1);
801: cln_debug_pub.Add('p_app_ref_id:' || p_app_ref_id, 1);
802: cln_debug_pub.Add('p_int_cont_num:' || p_int_cont_num, 1);
803: cln_debug_pub.Add('p_ctg_name:' || p_ctg_name, 1);
804: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
805: cln_debug_pub.Add('p_itf_lin_id:' || p_itf_lin_id, 1);
806: cln_debug_pub.Add('p_line_num:' || p_line_num, 1);
799: IF (l_Debug_Level <= 1) THEN
800: cln_debug_pub.Add('With the following parameters:', 1);
801: cln_debug_pub.Add('p_app_ref_id:' || p_app_ref_id, 1);
802: cln_debug_pub.Add('p_int_cont_num:' || p_int_cont_num, 1);
803: cln_debug_pub.Add('p_ctg_name:' || p_ctg_name, 1);
804: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
805: cln_debug_pub.Add('p_itf_lin_id:' || p_itf_lin_id, 1);
806: cln_debug_pub.Add('p_line_num:' || p_line_num, 1);
807: cln_debug_pub.Add('p_item:' || p_item, 1);
800: cln_debug_pub.Add('With the following parameters:', 1);
801: cln_debug_pub.Add('p_app_ref_id:' || p_app_ref_id, 1);
802: cln_debug_pub.Add('p_int_cont_num:' || p_int_cont_num, 1);
803: cln_debug_pub.Add('p_ctg_name:' || p_ctg_name, 1);
804: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
805: cln_debug_pub.Add('p_itf_lin_id:' || p_itf_lin_id, 1);
806: cln_debug_pub.Add('p_line_num:' || p_line_num, 1);
807: cln_debug_pub.Add('p_item:' || p_item, 1);
808: cln_debug_pub.Add('p_item_rev:' || p_item_rev, 1);
801: cln_debug_pub.Add('p_app_ref_id:' || p_app_ref_id, 1);
802: cln_debug_pub.Add('p_int_cont_num:' || p_int_cont_num, 1);
803: cln_debug_pub.Add('p_ctg_name:' || p_ctg_name, 1);
804: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
805: cln_debug_pub.Add('p_itf_lin_id:' || p_itf_lin_id, 1);
806: cln_debug_pub.Add('p_line_num:' || p_line_num, 1);
807: cln_debug_pub.Add('p_item:' || p_item, 1);
808: cln_debug_pub.Add('p_item_rev:' || p_item_rev, 1);
809: cln_debug_pub.Add('p_eff_date:' || p_eff_date, 1);
802: cln_debug_pub.Add('p_int_cont_num:' || p_int_cont_num, 1);
803: cln_debug_pub.Add('p_ctg_name:' || p_ctg_name, 1);
804: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
805: cln_debug_pub.Add('p_itf_lin_id:' || p_itf_lin_id, 1);
806: cln_debug_pub.Add('p_line_num:' || p_line_num, 1);
807: cln_debug_pub.Add('p_item:' || p_item, 1);
808: cln_debug_pub.Add('p_item_rev:' || p_item_rev, 1);
809: cln_debug_pub.Add('p_eff_date:' || p_eff_date, 1);
810: cln_debug_pub.Add('p_exp_date:' || p_exp_date, 1);
803: cln_debug_pub.Add('p_ctg_name:' || p_ctg_name, 1);
804: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
805: cln_debug_pub.Add('p_itf_lin_id:' || p_itf_lin_id, 1);
806: cln_debug_pub.Add('p_line_num:' || p_line_num, 1);
807: cln_debug_pub.Add('p_item:' || p_item, 1);
808: cln_debug_pub.Add('p_item_rev:' || p_item_rev, 1);
809: cln_debug_pub.Add('p_eff_date:' || p_eff_date, 1);
810: cln_debug_pub.Add('p_exp_date:' || p_exp_date, 1);
811: cln_debug_pub.Add('p_quantity:' || p_quantity, 1);
804: cln_debug_pub.Add('p_itf_hdr_id:' || p_itf_hdr_id, 1);
805: cln_debug_pub.Add('p_itf_lin_id:' || p_itf_lin_id, 1);
806: cln_debug_pub.Add('p_line_num:' || p_line_num, 1);
807: cln_debug_pub.Add('p_item:' || p_item, 1);
808: cln_debug_pub.Add('p_item_rev:' || p_item_rev, 1);
809: cln_debug_pub.Add('p_eff_date:' || p_eff_date, 1);
810: cln_debug_pub.Add('p_exp_date:' || p_exp_date, 1);
811: cln_debug_pub.Add('p_quantity:' || p_quantity, 1);
812: cln_debug_pub.Add('p_price:' || p_price, 1);
805: cln_debug_pub.Add('p_itf_lin_id:' || p_itf_lin_id, 1);
806: cln_debug_pub.Add('p_line_num:' || p_line_num, 1);
807: cln_debug_pub.Add('p_item:' || p_item, 1);
808: cln_debug_pub.Add('p_item_rev:' || p_item_rev, 1);
809: cln_debug_pub.Add('p_eff_date:' || p_eff_date, 1);
810: cln_debug_pub.Add('p_exp_date:' || p_exp_date, 1);
811: cln_debug_pub.Add('p_quantity:' || p_quantity, 1);
812: cln_debug_pub.Add('p_price:' || p_price, 1);
813: cln_debug_pub.Add('p_price_uom:' || p_price_uom, 1);
806: cln_debug_pub.Add('p_line_num:' || p_line_num, 1);
807: cln_debug_pub.Add('p_item:' || p_item, 1);
808: cln_debug_pub.Add('p_item_rev:' || p_item_rev, 1);
809: cln_debug_pub.Add('p_eff_date:' || p_eff_date, 1);
810: cln_debug_pub.Add('p_exp_date:' || p_exp_date, 1);
811: cln_debug_pub.Add('p_quantity:' || p_quantity, 1);
812: cln_debug_pub.Add('p_price:' || p_price, 1);
813: cln_debug_pub.Add('p_price_uom:' || p_price_uom, 1);
814: cln_debug_pub.Add('p_price_currency:' || p_price_currency, 1);
807: cln_debug_pub.Add('p_item:' || p_item, 1);
808: cln_debug_pub.Add('p_item_rev:' || p_item_rev, 1);
809: cln_debug_pub.Add('p_eff_date:' || p_eff_date, 1);
810: cln_debug_pub.Add('p_exp_date:' || p_exp_date, 1);
811: cln_debug_pub.Add('p_quantity:' || p_quantity, 1);
812: cln_debug_pub.Add('p_price:' || p_price, 1);
813: cln_debug_pub.Add('p_price_uom:' || p_price_uom, 1);
814: cln_debug_pub.Add('p_price_currency:' || p_price_currency, 1);
815: cln_debug_pub.Add('x_bpo_cur_updated:' || x_bpo_cur_updated, 1);
808: cln_debug_pub.Add('p_item_rev:' || p_item_rev, 1);
809: cln_debug_pub.Add('p_eff_date:' || p_eff_date, 1);
810: cln_debug_pub.Add('p_exp_date:' || p_exp_date, 1);
811: cln_debug_pub.Add('p_quantity:' || p_quantity, 1);
812: cln_debug_pub.Add('p_price:' || p_price, 1);
813: cln_debug_pub.Add('p_price_uom:' || p_price_uom, 1);
814: cln_debug_pub.Add('p_price_currency:' || p_price_currency, 1);
815: cln_debug_pub.Add('x_bpo_cur_updated:' || x_bpo_cur_updated, 1);
816: END IF;
809: cln_debug_pub.Add('p_eff_date:' || p_eff_date, 1);
810: cln_debug_pub.Add('p_exp_date:' || p_exp_date, 1);
811: cln_debug_pub.Add('p_quantity:' || p_quantity, 1);
812: cln_debug_pub.Add('p_price:' || p_price, 1);
813: cln_debug_pub.Add('p_price_uom:' || p_price_uom, 1);
814: cln_debug_pub.Add('p_price_currency:' || p_price_currency, 1);
815: cln_debug_pub.Add('x_bpo_cur_updated:' || x_bpo_cur_updated, 1);
816: END IF;
817:
810: cln_debug_pub.Add('p_exp_date:' || p_exp_date, 1);
811: cln_debug_pub.Add('p_quantity:' || p_quantity, 1);
812: cln_debug_pub.Add('p_price:' || p_price, 1);
813: cln_debug_pub.Add('p_price_uom:' || p_price_uom, 1);
814: cln_debug_pub.Add('p_price_currency:' || p_price_currency, 1);
815: cln_debug_pub.Add('x_bpo_cur_updated:' || x_bpo_cur_updated, 1);
816: END IF;
817:
818:
811: cln_debug_pub.Add('p_quantity:' || p_quantity, 1);
812: cln_debug_pub.Add('p_price:' || p_price, 1);
813: cln_debug_pub.Add('p_price_uom:' || p_price_uom, 1);
814: cln_debug_pub.Add('p_price_currency:' || p_price_currency, 1);
815: cln_debug_pub.Add('x_bpo_cur_updated:' || x_bpo_cur_updated, 1);
816: END IF;
817:
818:
819: -- Need to reomve the sysdate
845: WHERE interface_header_id = p_itf_hdr_id
846: AND interface_line_id = interface_line_id
847: AND line_num = p_line_num;
848: IF (l_Debug_Level <= 1) THEN
849: cln_debug_pub.Add('l_count:' || l_count, 1);
850: END IF;
851:
852:
853: IF l_count = 1 THEN -- First timephase price break
859: WHERE interface_header_id = p_itf_hdr_id
860: AND interface_line_id = interface_line_id
861: AND line_num = p_line_num;
862: IF (l_Debug_Level <= 1) THEN
863: cln_debug_pub.Add('l_line_price:' || l_line_price, 1);
864: END IF;
865:
866:
867: IF l_line_price IS NULL OR l_line_price = 0 THEN
915: p_ref5 => p_item_rev,
916: p_dtl_msg => NULL);
917: IF l_return_status <> 'S' THEN
918: IF (l_Debug_Level <= 1) THEN
919: cln_debug_pub.Add('RAISE_ADD_MESSAGE CALL FAILED', 1);
920: END IF;
921:
922: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
923: END IF;
923: END IF;
924:
925:
926: IF (l_Debug_Level <= 2) THEN
927: cln_debug_pub.Add('EXITING PROCESS_PRICE_BREAKS', 2);
928: END IF;
929:
930: EXCEPTION
931: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
930: EXCEPTION
931: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
932: ROLLBACK TO PO_UPDATE_TXN;
933: IF (l_Debug_Level <= 5) THEN
934: cln_debug_pub.Add('Rolledback PO_UPDATE_TXN transaction',5);
935: END IF;
936:
937: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
938: x_msg_data := l_return_msg;
936:
937: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
938: x_msg_data := l_return_msg;
939: IF (l_Debug_Level <= 5) THEN
940: cln_debug_pub.Add(x_msg_data, 5);
941: END IF;
942:
943: x_msg_data := 'While trying to process line price break details'
944: || ' for the inbound sync catalog#'
946: || ', the following error is encountered:'
947: || x_msg_data;
948: CLN_NP_PROCESSOR_PKG.NOTIFY_ADMINISTRATOR(x_msg_data);
949: IF (l_Debug_Level <= 5) THEN
950: cln_debug_pub.Add('EXITING PROCESS_PRICE_BREAKS', 2);
951: END IF;
952:
953: WHEN OTHERS THEN
954: ROLLBACK TO PO_UPDATE_TXN;
953: WHEN OTHERS THEN
954: ROLLBACK TO PO_UPDATE_TXN;
955: -- More descriptive line details ?
956: IF (l_Debug_Level <= 5) THEN
957: cln_debug_pub.Add('Rolledback PO_UPDATE_TXN transaction',5);
958: END IF;
959:
960: x_return_status := FND_API.G_RET_STS_ERROR;
961: l_error_code := SQLCODE;
961: l_error_code := SQLCODE;
962: l_error_msg := SQLERRM;
963: x_msg_data := l_error_code||' : '||l_error_msg;
964: IF (l_Debug_Level <= 5) THEN
965: cln_debug_pub.Add(x_msg_data, 5);
966: END IF;
967:
968: x_msg_data := 'While trying to process line price break details'
969: || ' for the inbound sync catalog#'
971: || ', the following error is encountered:'
972: || x_msg_data;
973: CLN_NP_PROCESSOR_PKG.NOTIFY_ADMINISTRATOR(x_msg_data);
974: IF (l_Debug_Level <= 5) THEN
975: cln_debug_pub.Add('EXITING PROCESS_PRICE_BREAKS', 2);
976: END IF;
977:
978: END PROCESS_PRICE_BREAKS;
979:
1016: l_int_ctl_num NUMBER;
1017: BEGIN
1018:
1019: -- Sets the debug mode to be FILE
1020: --l_debug_mode :=cln_debug_pub.Set_Debug_Mode('FILE');
1021:
1022: x_resultout:='Yes';
1023:
1024: IF (l_Debug_Level <= 2) THEN
1021:
1022: x_resultout:='Yes';
1023:
1024: IF (l_Debug_Level <= 2) THEN
1025: cln_debug_pub.Add('ENTERING CALL_TAKE_ACTIONS API', 2);
1026: END IF;
1027:
1028: IF (l_Debug_Level <= 1) THEN
1029: cln_debug_pub.Add('Parameters:', 1);
1025: cln_debug_pub.Add('ENTERING CALL_TAKE_ACTIONS API', 2);
1026: END IF;
1027:
1028: IF (l_Debug_Level <= 1) THEN
1029: cln_debug_pub.Add('Parameters:', 1);
1030: END IF;
1031:
1032:
1033: -- Should be S for sucess
1032:
1033: -- Should be S for sucess
1034: l_ret_status := wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER6', TRUE);
1035: IF (l_Debug_Level <= 1) THEN
1036: cln_debug_pub.Add('l_ret_status:' || l_ret_status, 1);
1037: END IF;
1038:
1039: l_int_hdr_id := to_number(wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER9', TRUE));
1040: IF (l_Debug_Level <= 1) THEN
1037: END IF;
1038:
1039: l_int_hdr_id := to_number(wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER9', TRUE));
1040: IF (l_Debug_Level <= 1) THEN
1041: cln_debug_pub.Add('l_int_hdr_id:' || l_int_hdr_id, 1);
1042: END IF;
1043:
1044: l_int_ctl_num := to_number(wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER1', TRUE));
1045: IF (l_Debug_Level <= 1) THEN
1042: END IF;
1043:
1044: l_int_ctl_num := to_number(wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER1', TRUE));
1045: IF (l_Debug_Level <= 1) THEN
1046: cln_debug_pub.Add('l_int_ctl_num:' || l_int_ctl_num, 1);
1047: END IF;
1048:
1049: IF (l_ret_status = 'S') THEN
1050: l_doc_status := 'SUCCESS';
1057: ELSE
1058: l_doc_status := 'ERROR';
1059: l_msg_data := wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER7', TRUE);
1060: IF (l_Debug_Level <= 1) THEN
1061: cln_debug_pub.Add('l_msg_data:' || l_msg_data, 1);
1062: END IF;
1063:
1064: -- Error while processing product catalog
1065: FND_MESSAGE.SET_NAME('CLN','CLN_PO_CATALOG_SYNC_ERROR');
1071: END IF;
1072:
1073: l_trp_id := wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER10', TRUE);
1074: IF (l_Debug_Level <= 1) THEN
1075: cln_debug_pub.Add('l_tp_id:' || l_trp_id, 1);
1076: END IF;
1077:
1078: l_app_ref_id := wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER4', TRUE);
1079: IF (l_Debug_Level <= 1) THEN
1076: END IF;
1077:
1078: l_app_ref_id := wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER4', TRUE);
1079: IF (l_Debug_Level <= 1) THEN
1080: cln_debug_pub.Add('l_app_ref_id:' || l_app_ref_id, 1);
1081: END IF;
1082:
1083: CLN_UTILS.GET_TRADING_PARTNER(l_trp_id, l_tp_id);
1084: IF (l_Debug_Level <= 1) THEN
1081: END IF;
1082:
1083: CLN_UTILS.GET_TRADING_PARTNER(l_trp_id, l_tp_id);
1084: IF (l_Debug_Level <= 1) THEN
1085: cln_debug_pub.Add('Trading Partner ID:' || l_tp_id, 1);
1086: END IF;
1087:
1088: l_ctg_sync_id := wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER8', TRUE);
1089: IF (l_Debug_Level <= 1) THEN
1086: END IF;
1087:
1088: l_ctg_sync_id := wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER8', TRUE);
1089: IF (l_Debug_Level <= 1) THEN
1090: cln_debug_pub.Add('l_ctg_sync_id:' || l_ctg_sync_id, 1);
1091: END IF;
1092:
1093:
1094: -- All situations and codes ?
1101: FND_MESSAGE.SET_NAME('CLN','CLN_INVALID_TXN_CODE');
1102: FND_MESSAGE.SET_TOKEN('CODE', l_ctg_sync_id);
1103: l_msg_data := FND_MESSAGE.GET;
1104: IF (l_Debug_Level <= 1) THEN
1105: cln_debug_pub.Add('Invalid Trnsaction Code',1);
1106: END IF;
1107:
1108: CLN_NP_PROCESSOR_PKG.TAKE_ACTIONS(
1109: x_ret_code => l_return_status,
1116: p_coll_point => 'APPS',
1117: p_int_con_no => NULL);
1118: IF l_return_status <> 'S' THEN
1119: IF (l_Debug_Level <= 1) THEN
1120: cln_debug_pub.Add('CALL_TAKE_ACTIONS CALL FAILED', 1);
1121: END IF;
1122:
1123: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1124: END IF;
1128:
1129: -- Duplicate Item Error
1130: IF l_ret_status = 'DIE' THEN
1131: IF (l_Debug_Level <= 1) THEN
1132: cln_debug_pub.Add('Duplicate Item Error',1);
1133: END IF;
1134:
1135: FND_MESSAGE.SET_NAME('CLN','CLN_DUPLICATE_ITEM');
1136: l_msg_data := FND_MESSAGE.GET;
1145: p_coll_point => 'APPS',
1146: p_int_con_no => NULL);
1147: IF l_return_status <> 'S' THEN
1148: IF (l_Debug_Level <= 1) THEN
1149: cln_debug_pub.Add('CALL_TAKE_ACTIONS CALL FAILED', 1);
1150: END IF;
1151:
1152: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1153: END IF;
1156:
1157:
1158: -- Error
1159: IF (l_Debug_Level <= 1) THEN
1160: cln_debug_pub.Add('Global Error' || l_description,1);
1161: END IF;
1162:
1163: CLN_NP_PROCESSOR_PKG.TAKE_ACTIONS(
1164: x_ret_code => l_return_status,
1171: p_coll_point => 'APPS',
1172: p_int_con_no => NULL);
1173: IF l_return_status <> 'S' THEN
1174: IF (l_Debug_Level <= 1) THEN
1175: cln_debug_pub.Add('CALL_TAKE_ACTIONS CALL FAILED', 1);
1176: END IF;
1177:
1178: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1179: END IF;
1194: p_coll_point => 'APPS',
1195: p_int_con_no => NULL);
1196: IF l_return_status <> 'S' THEN
1197: IF (l_Debug_Level <= 1) THEN
1198: cln_debug_pub.Add('CALL_TAKE_ACTIONS CALL FAILED', 1);
1199: END IF;
1200:
1201: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1202: END IF;
1201: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1202: END IF;
1203:
1204: IF (l_Debug_Level <= 2) THEN
1205: cln_debug_pub.Add('EXITING CALL_TAKE_ACTIONS API', 2);
1206: END IF;
1207:
1208: EXCEPTION
1209: WHEN OTHERS THEN
1211: l_error_msg := SQLERRM;
1212:
1213: x_resultout := 'ERROR:' || l_error_code || ':' || l_error_msg;
1214: IF (l_Debug_Level <= 5) THEN
1215: cln_debug_pub.Add( l_error_code || ':' || l_error_msg, 5);
1216: END IF;
1217:
1218: IF (l_Debug_Level <= 2) THEN
1219: cln_debug_pub.Add('EXITING CALL_TAKE_ACTIONS API', 2);
1215: cln_debug_pub.Add( l_error_code || ':' || l_error_msg, 5);
1216: END IF;
1217:
1218: IF (l_Debug_Level <= 2) THEN
1219: cln_debug_pub.Add('EXITING CALL_TAKE_ACTIONS API', 2);
1220: END IF;
1221: END CALL_TAKE_ACTIONS;
1222:
1223:
1251: l_org_id NUMBER;
1252: BEGIN
1253:
1254: -- Sets the debug mode to be FILE
1255: --l_debug_mode :=cln_debug_pub.Set_Debug_Mode('FILE');
1256:
1257: x_resultout:='Yes';
1258:
1259: IF (l_Debug_Level <= 2) THEN
1256:
1257: x_resultout:='Yes';
1258:
1259: IF (l_Debug_Level <= 2) THEN
1260: cln_debug_pub.Add('ENTERING SET_ITEM_ATTRIBUTES API', 2);
1261: END IF;
1262:
1263: IF (l_Debug_Level <= 1) THEN
1264: cln_debug_pub.Add('Parameters:', 1);
1260: cln_debug_pub.Add('ENTERING SET_ITEM_ATTRIBUTES API', 2);
1261: END IF;
1262:
1263: IF (l_Debug_Level <= 1) THEN
1264: cln_debug_pub.Add('Parameters:', 1);
1265: END IF;
1266:
1267:
1268: -- Get Profile Option values
1267:
1268: -- Get Profile Option values
1269: l_approval_status := FND_PROFILE.VALUE('CLN_2A1_PO_APPROVAL_STATUS');
1270: IF (l_Debug_Level <= 1) THEN
1271: cln_debug_pub.Add('l_approval_status:' || l_approval_status, 1);
1272: END IF;
1273:
1274: l_create_src_rules := FND_PROFILE.VALUE('CLN_2A1_PO_CREATE_SOURCING_RULES');
1275: IF (l_Debug_Level <= 1) THEN
1272: END IF;
1273:
1274: l_create_src_rules := FND_PROFILE.VALUE('CLN_2A1_PO_CREATE_SOURCING_RULES');
1275: IF (l_Debug_Level <= 1) THEN
1276: cln_debug_pub.Add('l_create_src_rules:' || l_create_src_rules, 1);
1277: END IF;
1278:
1279: l_create_upd_items := FND_PROFILE.VALUE('CLN_2A1_PO_CREATE_UPDATE_ITEMS');
1280: IF (l_Debug_Level <= 1) THEN
1277: END IF;
1278:
1279: l_create_upd_items := FND_PROFILE.VALUE('CLN_2A1_PO_CREATE_UPDATE_ITEMS');
1280: IF (l_Debug_Level <= 1) THEN
1281: cln_debug_pub.Add('l_create_upd_items:' || l_create_upd_items, 1);
1282: END IF;
1283:
1284: l_doc_types := FND_PROFILE.VALUE('CLN_2A1_PO_PDOI_DOCUMENT_TYPES');
1285: IF (l_Debug_Level <= 1) THEN
1282: END IF;
1283:
1284: l_doc_types := FND_PROFILE.VALUE('CLN_2A1_PO_PDOI_DOCUMENT_TYPES');
1285: IF (l_Debug_Level <= 1) THEN
1286: cln_debug_pub.Add('l_doc_types:' || l_doc_types, 1);
1287: END IF;
1288:
1289: l_rel_gen_method := FND_PROFILE.VALUE('CLN_2A1_PO_PDOI_REL_GEN_METHOD');
1290: IF (l_Debug_Level <= 1) THEN
1287: END IF;
1288:
1289: l_rel_gen_method := FND_PROFILE.VALUE('CLN_2A1_PO_PDOI_REL_GEN_METHOD');
1290: IF (l_Debug_Level <= 1) THEN
1291: cln_debug_pub.Add('l_rel_gen_method:' || l_rel_gen_method, 1);
1292: END IF;
1293:
1294: l_def_buyer := FND_PROFILE.VALUE('CLN_2A1_PO_PDOI_VALID_AGENTS');
1295: IF (l_Debug_Level <= 1) THEN
1292: END IF;
1293:
1294: l_def_buyer := FND_PROFILE.VALUE('CLN_2A1_PO_PDOI_VALID_AGENTS');
1295: IF (l_Debug_Level <= 1) THEN
1296: cln_debug_pub.Add('l_def_buyer:' || l_def_buyer, 1);
1297: END IF;
1298:
1299: l_tp_header_id := to_number(wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER10', TRUE));
1300: IF (l_Debug_Level <= 1) THEN
1297: END IF;
1298:
1299: l_tp_header_id := to_number(wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER10', TRUE));
1300: IF (l_Debug_Level <= 1) THEN
1301: cln_debug_pub.Add('l_tp_header_id:' || l_tp_header_id, 1);
1302: END IF;
1303:
1304: -- The following statement should not throw any exception
1305: SELECT org_id
1308: WHERE eth.tp_header_id = l_tp_header_id
1309: and povs.vendor_site_id = eth.party_site_id;
1310:
1311: IF (l_Debug_Level <= 1) THEN
1312: cln_debug_pub.Add('l_org_id:' || l_org_id, 1);
1313: END IF;
1314:
1315: wf_engine.SetItemAttrText(p_itemtype, p_itemkey, 'ARG1', l_def_buyer);
1316: wf_engine.SetItemAttrText(p_itemtype, p_itemkey, 'ARG3', l_create_upd_items);
1321: -- Global Agreement ?
1322: -- wf_engine.SetItemAttrText(p_itemtype, p_itemkey, 'ARG7', TRUE);
1323:
1324: IF (l_Debug_Level <= 2) THEN
1325: cln_debug_pub.Add('EXITING SET_ITEM_ATTRIBUTES API', 2);
1326: END IF;
1327:
1328: EXCEPTION
1329: WHEN OTHERS THEN
1331: l_error_msg := SQLERRM;
1332:
1333: x_resultout := 'ERROR:' || l_error_code || ':' || l_error_msg;
1334: IF (l_Debug_Level <= 5) THEN
1335: cln_debug_pub.Add( l_error_code || ':' || l_error_msg, 5);
1336: END IF;
1337:
1338: IF (l_Debug_Level <= 5) THEN
1339: cln_debug_pub.Add('EXITING SET_ITEM_ATTRIBUTES API', 2);
1335: cln_debug_pub.Add( l_error_code || ':' || l_error_msg, 5);
1336: END IF;
1337:
1338: IF (l_Debug_Level <= 5) THEN
1339: cln_debug_pub.Add('EXITING SET_ITEM_ATTRIBUTES API', 2);
1340: END IF;
1341:
1342: END SET_ITEM_ATTRIBUTES;
1343:
1366: l_interface_hdr_rec_count NUMBER;
1367: BEGIN
1368:
1369: IF (l_Debug_Level <= 2) THEN
1370: cln_debug_pub.Add('ENTERING SET_ACTION_INTERNAL API', 2);
1371: cln_debug_pub.Add('p_catalog_name:'||p_catalog_name, 2);
1372: cln_debug_pub.Add('p_batch_id:'||p_batch_id, 2);
1373: cln_debug_pub.Add('p_vendor_id:'||p_vendor_id, 2);
1374:
1367: BEGIN
1368:
1369: IF (l_Debug_Level <= 2) THEN
1370: cln_debug_pub.Add('ENTERING SET_ACTION_INTERNAL API', 2);
1371: cln_debug_pub.Add('p_catalog_name:'||p_catalog_name, 2);
1372: cln_debug_pub.Add('p_batch_id:'||p_batch_id, 2);
1373: cln_debug_pub.Add('p_vendor_id:'||p_vendor_id, 2);
1374:
1375: END IF;
1368:
1369: IF (l_Debug_Level <= 2) THEN
1370: cln_debug_pub.Add('ENTERING SET_ACTION_INTERNAL API', 2);
1371: cln_debug_pub.Add('p_catalog_name:'||p_catalog_name, 2);
1372: cln_debug_pub.Add('p_batch_id:'||p_batch_id, 2);
1373: cln_debug_pub.Add('p_vendor_id:'||p_vendor_id, 2);
1374:
1375: END IF;
1376: -- To lock the rows
1369: IF (l_Debug_Level <= 2) THEN
1370: cln_debug_pub.Add('ENTERING SET_ACTION_INTERNAL API', 2);
1371: cln_debug_pub.Add('p_catalog_name:'||p_catalog_name, 2);
1372: cln_debug_pub.Add('p_batch_id:'||p_batch_id, 2);
1373: cln_debug_pub.Add('p_vendor_id:'||p_vendor_id, 2);
1374:
1375: END IF;
1376: -- To lock the rows
1377: UPDATE po_headers_interface
1380: AND vendor_id = p_vendor_id
1381: AND ACTION is NULL;
1382:
1383: IF (l_Debug_Level <= 1) THEN
1384: cln_debug_pub.Add('Locked the pending rows of interface tables of the same catalog', 1);
1385: END IF;
1386:
1387: BEGIN
1388: SELECT po_header_id
1393: EXCEPTION
1394: WHEN NO_DATA_FOUND THEN
1395: l_po_header_id := NULL;
1396: IF (l_Debug_Level <= 1) THEN
1397: cln_debug_pub.Add('PO not found in po_headers_all', 1);
1398: END IF;
1399: END;
1400:
1401: IF (l_Debug_Level <= 1) THEN
1398: END IF;
1399: END;
1400:
1401: IF (l_Debug_Level <= 1) THEN
1402: cln_debug_pub.Add('l_po_header_id:' || l_po_header_id, 1);
1403: END IF;
1404:
1405: IF (l_po_header_id > 0 ) THEN
1406: --There is an existing PO, set the action to UPDATE and retrun from this procedure
1409: WHERE batch_id = p_batch_id;
1410: x_resultout := 'Y';
1411: COMMIT;
1412: IF (l_Debug_Level <= 5) THEN
1413: cln_debug_pub.Add('EXITING SET_ACTION_INTERNAL API', 2);
1414: END IF;
1415: RETURN;
1416: END IF;
1417:
1428: EXCEPTION
1429: WHEN NO_DATA_FOUND THEN
1430: l_interface_hdr_rec_count := 0;
1431: IF (l_Debug_Level <= 1) THEN
1432: cln_debug_pub.Add('No catalogs found', 1);
1433: END IF;
1434: END;
1435:
1436: IF (l_Debug_Level <= 1) THEN
1433: END IF;
1434: END;
1435:
1436: IF (l_Debug_Level <= 1) THEN
1437: cln_debug_pub.Add('l_interface_hdr_rec_count:' || l_interface_hdr_rec_count, 1);
1438: END IF;
1439:
1440: IF l_interface_hdr_rec_count > 0 THEN
1441: --There is already a row which is in process. So wait for some time
1450: EXCEPTION
1451: WHEN NO_DATA_FOUND THEN
1452: l_po_header_id := NULL;
1453: IF (l_Debug_Level <= 1) THEN
1454: cln_debug_pub.Add('PO not found in po_headers_all', 1);
1455: END IF;
1456: END;
1457:
1458: IF (l_Debug_Level <= 1) THEN
1455: END IF;
1456: END;
1457:
1458: IF (l_Debug_Level <= 1) THEN
1459: cln_debug_pub.Add('l_po_header_id:' || l_po_header_id, 1);
1460: END IF;
1461:
1462: IF (l_po_header_id > 0 ) THEN
1463: --There is an existing PO, set the action to UPDATE and retrun from this procedure
1473: END IF;
1474:
1475: COMMIT;
1476: IF (l_Debug_Level <= 2) THEN
1477: cln_debug_pub.Add('EXITING SET_ACTION_INTERNAL API', 2);
1478: END IF;
1479:
1480: EXCEPTION
1481: WHEN OTHERS THEN
1482: l_error_code := SQLCODE;
1483: l_error_msg := SQLERRM;
1484: x_resultout := 'ERROR:' || l_error_code || ':' || l_error_msg;
1485: IF (l_Debug_Level <= 5) THEN
1486: cln_debug_pub.Add( l_error_code || ':' || l_error_msg, 5);
1487: END IF;
1488: ROLLBACK;
1489: IF (l_Debug_Level <= 5) THEN
1490: cln_debug_pub.Add('EXITING SET_ACTION_INTERNAL API', 2);
1486: cln_debug_pub.Add( l_error_code || ':' || l_error_msg, 5);
1487: END IF;
1488: ROLLBACK;
1489: IF (l_Debug_Level <= 5) THEN
1490: cln_debug_pub.Add('EXITING SET_ACTION_INTERNAL API', 2);
1491: END IF;
1492: END SET_ACTION_INTERNAL;
1493:
1494:
1522:
1523: BEGIN
1524:
1525: -- Sets the debug mode to be FILE
1526: --l_debug_mode :=cln_debug_pub.Set_Debug_Mode('FILE');
1527:
1528:
1529: IF (l_Debug_Level <= 2) THEN
1530: cln_debug_pub.Add('ENTERING SET_ACTION_CREATE_OR_UPDATE API', 2);
1526: --l_debug_mode :=cln_debug_pub.Set_Debug_Mode('FILE');
1527:
1528:
1529: IF (l_Debug_Level <= 2) THEN
1530: cln_debug_pub.Add('ENTERING SET_ACTION_CREATE_OR_UPDATE API', 2);
1531: END IF;
1532:
1533: -- Get the batch ID, which is being imported
1534: l_operation := wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER3', TRUE);
1532:
1533: -- Get the batch ID, which is being imported
1534: l_operation := wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER3', TRUE);
1535: IF (l_Debug_Level <= 1) THEN
1536: cln_debug_pub.Add('l_operation:' || l_operation, 1);
1537: END IF;
1538:
1539: IF (l_operation = 'UPDATE') THEN
1540: --If the operation is already update, then need not do anything
1538:
1539: IF (l_operation = 'UPDATE') THEN
1540: --If the operation is already update, then need not do anything
1541: IF (l_Debug_Level <= 1) THEN
1542: cln_debug_pub.Add('Operation is update. Nothing to do.', 1);
1543: END IF;
1544: IF (l_Debug_Level <= 2) THEN
1545: cln_debug_pub.Add('EXITING SET_ACTION_CREATE_OR_UPDATE API', 2);
1546: END IF;
1541: IF (l_Debug_Level <= 1) THEN
1542: cln_debug_pub.Add('Operation is update. Nothing to do.', 1);
1543: END IF;
1544: IF (l_Debug_Level <= 2) THEN
1545: cln_debug_pub.Add('EXITING SET_ACTION_CREATE_OR_UPDATE API', 2);
1546: END IF;
1547: x_resultout:='Y';
1548: RETURN;
1549: END IF;
1550:
1551: -- Get the batch ID, which is being imported
1552: l_batch_id := to_number(wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER9', TRUE));
1553: IF (l_Debug_Level <= 1) THEN
1554: cln_debug_pub.Add('l_batch_id:' || l_batch_id, 1);
1555: END IF;
1556:
1557: l_catalog_name :=wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER5', TRUE);
1558: IF (l_Debug_Level <= 1) THEN
1555: END IF;
1556:
1557: l_catalog_name :=wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER5', TRUE);
1558: IF (l_Debug_Level <= 1) THEN
1559: cln_debug_pub.Add('l_catalog_name:' || l_catalog_name, 1);
1560: END IF;
1561:
1562: l_tp_hdr_id :=to_number(wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER10', TRUE));
1563: IF (l_Debug_Level <= 1) THEN
1560: END IF;
1561:
1562: l_tp_hdr_id :=to_number(wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER10', TRUE));
1563: IF (l_Debug_Level <= 1) THEN
1564: cln_debug_pub.Add('l_tp_hdr_id:' || l_tp_hdr_id, 1);
1565: cln_debug_pub.Add('About to call CLN_UTILS.GET_TRADING_PARTNER', 1);
1566: END IF;
1567:
1568: CLN_UTILS.GET_TRADING_PARTNER(l_tp_hdr_id, l_vendor_id);
1561:
1562: l_tp_hdr_id :=to_number(wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER10', TRUE));
1563: IF (l_Debug_Level <= 1) THEN
1564: cln_debug_pub.Add('l_tp_hdr_id:' || l_tp_hdr_id, 1);
1565: cln_debug_pub.Add('About to call CLN_UTILS.GET_TRADING_PARTNER', 1);
1566: END IF;
1567:
1568: CLN_UTILS.GET_TRADING_PARTNER(l_tp_hdr_id, l_vendor_id);
1569:
1567:
1568: CLN_UTILS.GET_TRADING_PARTNER(l_tp_hdr_id, l_vendor_id);
1569:
1570: IF (l_Debug_Level <= 1) THEN
1571: cln_debug_pub.Add('Out of CLN_UTILS.GET_TRADING_PARTNER', 1);
1572: cln_debug_pub.Add('Vendor ID:' || l_vendor_id, 1);
1573: END IF;
1574:
1575: SET_ACTION_INTERNAL( x_resultout => x_resultout,
1568: CLN_UTILS.GET_TRADING_PARTNER(l_tp_hdr_id, l_vendor_id);
1569:
1570: IF (l_Debug_Level <= 1) THEN
1571: cln_debug_pub.Add('Out of CLN_UTILS.GET_TRADING_PARTNER', 1);
1572: cln_debug_pub.Add('Vendor ID:' || l_vendor_id, 1);
1573: END IF;
1574:
1575: SET_ACTION_INTERNAL( x_resultout => x_resultout,
1576: p_catalog_name => l_catalog_name,
1577: p_batch_id => l_batch_id,
1578: p_vendor_id => l_vendor_id);
1579:
1580: IF (l_Debug_Level <= 1) THEN
1581: cln_debug_pub.Add('Returned from SET_ACTION_INTERNAL', 1);
1582: END IF;
1583:
1584: IF (l_Debug_Level <= 2) THEN
1585: cln_debug_pub.Add('EXITING SET_ACTION_CREATE_OR_UPDATE API', 2);
1581: cln_debug_pub.Add('Returned from SET_ACTION_INTERNAL', 1);
1582: END IF;
1583:
1584: IF (l_Debug_Level <= 2) THEN
1585: cln_debug_pub.Add('EXITING SET_ACTION_CREATE_OR_UPDATE API', 2);
1586: END IF;
1587:
1588: EXCEPTION
1589: WHEN OTHERS THEN
1590: l_error_code := SQLCODE;
1591: l_error_msg := SQLERRM;
1592: x_resultout := 'ERROR:' || l_error_code || ':' || l_error_msg;
1593: IF (l_Debug_Level <= 5) THEN
1594: cln_debug_pub.Add( l_error_code || ':' || l_error_msg, 5);
1595: END IF;
1596:
1597: IF (l_Debug_Level <= 5) THEN
1598: cln_debug_pub.Add('EXITING SET_ACTION_CREATE_OR_UPDATE API', 2);
1594: cln_debug_pub.Add( l_error_code || ':' || l_error_msg, 5);
1595: END IF;
1596:
1597: IF (l_Debug_Level <= 5) THEN
1598: cln_debug_pub.Add('EXITING SET_ACTION_CREATE_OR_UPDATE API', 2);
1599: END IF;
1600:
1601: END SET_ACTION_CREATE_OR_UPDATE;
1602:
1624: l_debug_mode VARCHAR2(255);
1625: BEGIN
1626:
1627: -- Sets the debug mode to be FILE
1628: --l_debug_mode :=cln_debug_pub.Set_Debug_Mode('FILE');
1629:
1630: x_resultout := 'COMPLETE:F';
1631:
1632: IF (l_Debug_Level <= 2) THEN
1629:
1630: x_resultout := 'COMPLETE:F';
1631:
1632: IF (l_Debug_Level <= 2) THEN
1633: cln_debug_pub.Add('ENTERING IS_PROCESSING_ERROR API', 2);
1634: END IF;
1635:
1636: IF (l_Debug_Level <= 1) THEN
1637: cln_debug_pub.Add('Parameters:', 1);
1633: cln_debug_pub.Add('ENTERING IS_PROCESSING_ERROR API', 2);
1634: END IF;
1635:
1636: IF (l_Debug_Level <= 1) THEN
1637: cln_debug_pub.Add('Parameters:', 1);
1638: END IF;
1639:
1640: -- Should be S for sucess
1641: l_ret_status := wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER6', TRUE);
1639:
1640: -- Should be S for sucess
1641: l_ret_status := wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER6', TRUE);
1642: IF (l_Debug_Level <= 1) THEN
1643: cln_debug_pub.Add('l_ret_status:' || l_ret_status, 1);
1644: END IF;
1645:
1646: IF l_ret_status <> 'S' THEN
1647: x_resultout := 'COMPLETE:T';
1647: x_resultout := 'COMPLETE:T';
1648: END IF;
1649:
1650: IF (l_Debug_Level <= 1) THEN
1651: cln_debug_pub.Add('x_resultout:' || x_resultout, 1);
1652: END IF;
1653:
1654:
1655: IF (l_Debug_Level <= 2) THEN
1652: END IF;
1653:
1654:
1655: IF (l_Debug_Level <= 2) THEN
1656: cln_debug_pub.Add('EXITING IS_PROCESSING_ERROR API', 2);
1657: END IF;
1658:
1659: EXCEPTION
1660: WHEN OTHERS THEN
1662: l_error_code := SQLCODE;
1663: l_error_msg := SQLERRM;
1664: x_resultout := 'ERROR:' || l_error_code || ':' || l_error_msg;
1665: IF (l_Debug_Level <= 5) THEN
1666: cln_debug_pub.Add( l_error_code || ':' || l_error_msg, 5);
1667: END IF;
1668: IF (l_Debug_Level <= 5) THEN
1669: cln_debug_pub.Add('EXITING IS_PROCESSING_ERROR API', 2);
1670: END IF;
1665: IF (l_Debug_Level <= 5) THEN
1666: cln_debug_pub.Add( l_error_code || ':' || l_error_msg, 5);
1667: END IF;
1668: IF (l_Debug_Level <= 5) THEN
1669: cln_debug_pub.Add('EXITING IS_PROCESSING_ERROR API', 2);
1670: END IF;
1671:
1672: END IS_PROCESSING_ERROR;
1673:
1713: WHERE INTERFACE_HEADER_ID = p_int_hdr_id;
1714: BEGIN
1715:
1716: -- Sets the debug mode to be FILE
1717: --l_debug_mode :=cln_debug_pub.Set_Debug_Mode('FILE');
1718: x_resultout:='Yes';
1719:
1720: IF (l_Debug_Level <= 2) THEN
1721: cln_debug_pub.Add('ENTERING LOG_PO_OI_ERRORS API', 2);
1717: --l_debug_mode :=cln_debug_pub.Set_Debug_Mode('FILE');
1718: x_resultout:='Yes';
1719:
1720: IF (l_Debug_Level <= 2) THEN
1721: cln_debug_pub.Add('ENTERING LOG_PO_OI_ERRORS API', 2);
1722: END IF;
1723:
1724: IF (l_Debug_Level <= 1) THEN
1725: cln_debug_pub.Add('Parameters:', 1);
1721: cln_debug_pub.Add('ENTERING LOG_PO_OI_ERRORS API', 2);
1722: END IF;
1723:
1724: IF (l_Debug_Level <= 1) THEN
1725: cln_debug_pub.Add('Parameters:', 1);
1726: END IF;
1727:
1728:
1729: l_int_hdr_id := to_number(wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER9', TRUE));
1727:
1728:
1729: l_int_hdr_id := to_number(wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER9', TRUE));
1730: IF (l_Debug_Level <= 1) THEN
1731: cln_debug_pub.Add('l_int_hdr_id:' || l_int_hdr_id, 1);
1732: END IF;
1733:
1734:
1735: l_app_ref_id := wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER4', TRUE);
1733:
1734:
1735: l_app_ref_id := wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER4', TRUE);
1736: IF (l_Debug_Level <= 1) THEN
1737: cln_debug_pub.Add('l_app_ref_id:' || l_app_ref_id, 1);
1738: END IF;
1739:
1740:
1741: l_int_ctl_num := to_number(wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER1', TRUE));
1739:
1740:
1741: l_int_ctl_num := to_number(wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER1', TRUE));
1742: IF (l_Debug_Level <= 1) THEN
1743: cln_debug_pub.Add('l_int_ctl_num:' || l_int_ctl_num, 1);
1744: END IF;
1745:
1746: -- Does PO Open Interface errored out
1747: select count(*)
1755:
1756: --Bug : 3732150
1757: --Get BPO Number from po headers all
1758: IF (l_Debug_Level <= 1) THEN
1759: cln_debug_pub.Add('Trying to get BPO Number from PO Headers All', 1);
1760: END IF;
1761:
1762: l_catalog_name := wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER5', TRUE);
1763: IF (l_Debug_Level <= 1) THEN
1760: END IF;
1761:
1762: l_catalog_name := wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER5', TRUE);
1763: IF (l_Debug_Level <= 1) THEN
1764: cln_debug_pub.Add('l_catalog_name:' || l_catalog_name, 1);
1765: END IF;
1766:
1767: l_tp_hdr_id :=to_number(wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER10', TRUE));
1768: IF (l_Debug_Level <= 1) THEN
1765: END IF;
1766:
1767: l_tp_hdr_id :=to_number(wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER10', TRUE));
1768: IF (l_Debug_Level <= 1) THEN
1769: cln_debug_pub.Add('l_tp_hdr_id:' || l_tp_hdr_id, 1);
1770: cln_debug_pub.Add('About to call CLN_UTILS.GET_TRADING_PARTNER', 1);
1771: END IF;
1772:
1773: CLN_UTILS.GET_TRADING_PARTNER(l_tp_hdr_id, l_vendor_id);
1766:
1767: l_tp_hdr_id :=to_number(wf_engine.GetItemAttrText(p_itemtype, p_itemkey, 'PARAMETER10', TRUE));
1768: IF (l_Debug_Level <= 1) THEN
1769: cln_debug_pub.Add('l_tp_hdr_id:' || l_tp_hdr_id, 1);
1770: cln_debug_pub.Add('About to call CLN_UTILS.GET_TRADING_PARTNER', 1);
1771: END IF;
1772:
1773: CLN_UTILS.GET_TRADING_PARTNER(l_tp_hdr_id, l_vendor_id);
1774:
1772:
1773: CLN_UTILS.GET_TRADING_PARTNER(l_tp_hdr_id, l_vendor_id);
1774:
1775: IF (l_Debug_Level <= 1) THEN
1776: cln_debug_pub.Add('Out of CLN_UTILS.GET_TRADING_PARTNER', 1);
1777: cln_debug_pub.Add('Vendor ID:' || l_vendor_id, 1);
1778: END IF;
1779:
1780: -- Query for BPO number based on Catalog name
1773: CLN_UTILS.GET_TRADING_PARTNER(l_tp_hdr_id, l_vendor_id);
1774:
1775: IF (l_Debug_Level <= 1) THEN
1776: cln_debug_pub.Add('Out of CLN_UTILS.GET_TRADING_PARTNER', 1);
1777: cln_debug_pub.Add('Vendor ID:' || l_vendor_id, 1);
1778: END IF;
1779:
1780: -- Query for BPO number based on Catalog name
1781: -- BUG 3155860 - MULTIPLE BPO FOR THE SAME VENDOR DOC NUMBER CAN ALSO BE TAKEN CARE
1793: l_bpo_number := NULL;
1794: WHEN OTHERS THEN
1795: l_bpo_number := NULL;
1796: IF (l_Debug_Level <= 5) THEN
1797: cln_debug_pub.Add('Exception while trying to obtain the BPO number',5);
1798: END IF;
1799: l_error_code := SQLCODE;
1800: l_error_msg := SQLERRM;
1801: l_msg_data := l_error_code||' : '||l_error_msg;
1799: l_error_code := SQLCODE;
1800: l_error_msg := SQLERRM;
1801: l_msg_data := l_error_code||' : '||l_error_msg;
1802: IF (l_Debug_Level <= 5) THEN
1803: cln_debug_pub.Add(l_msg_data, 5);
1804: END IF;
1805:
1806: l_msg_data := 'While trying to obtain BPO number'
1807: || ' for the inbound sync catalog#'
1808: || l_catalog_name
1809: || ', the following error is encountered:'
1810: || l_msg_data;
1811: IF (l_Debug_Level <= 5) THEN
1812: cln_debug_pub.Add(l_msg_data, 5);
1813: END IF;
1814: END;
1815:
1816: IF (l_Debug_Level <= 1) THEN
1813: END IF;
1814: END;
1815:
1816: IF (l_Debug_Level <= 1) THEN
1817: cln_debug_pub.Add('l_bpo_number:' || l_bpo_number, 1);
1818: END IF;
1819:
1820: FND_MESSAGE.SET_NAME('CLN','CLN_OPEN_IF_SUCCESS');-- Imported product catalog
1821: l_msg_data := FND_MESSAGE.GET;
1850: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1851: END IF;
1852: FOR ERRORS IN PO_OPI_ERRORS(l_int_hdr_id) LOOP
1853: IF (l_Debug_Level <= 1) THEN
1854: cln_debug_pub.Add('Obtained cursor row for each error', 1);
1855: END IF;
1856:
1857: RAISE_ADD_MESSAGE(
1858: x_return_status => l_return_status,
1865: p_ref5 => ERRORS.COLUMN_NAME,
1866: p_dtl_msg => ERRORS.ERROR_MESSAGE);
1867: IF l_return_status <> 'S' THEN
1868: IF (l_Debug_Level <= 1) THEN
1869: cln_debug_pub.Add('RAISE_ADD_MESSAGE CALL FAILED', 1);
1870: END IF;
1871:
1872: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1873: END IF;
1874: END LOOP;
1875: END IF;
1876:
1877: IF (l_Debug_Level <= 2) THEN
1878: cln_debug_pub.Add('EXITING LOG_PO_OI_ERRORS API', 2);
1879: END IF;
1880:
1881: EXCEPTION
1882: WHEN OTHERS THEN
1883: l_error_code := SQLCODE;
1884: l_error_msg := SQLERRM;
1885: x_resultout := 'ERROR:' || l_error_code || ':' || l_error_msg;
1886: IF (l_Debug_Level <= 5) THEN
1887: cln_debug_pub.Add( l_error_code || ':' || l_error_msg, 5);
1888: END IF;
1889: IF (l_Debug_Level <= 5) THEN
1890: cln_debug_pub.Add('EXITING LOG_PO_OI_ERRORS API', 2);
1891: END IF;
1886: IF (l_Debug_Level <= 5) THEN
1887: cln_debug_pub.Add( l_error_code || ':' || l_error_msg, 5);
1888: END IF;
1889: IF (l_Debug_Level <= 5) THEN
1890: cln_debug_pub.Add('EXITING LOG_PO_OI_ERRORS API', 2);
1891: END IF;
1892:
1893: END LOG_PO_OI_ERRORS;
1894:
1913: l_tp_id NUMBER;
1914: l_tp_site_id NUMBER;
1915: BEGIN
1916: -- Sets the debug mode to be FILE
1917: --l_debug_mode := cln_debug_pub.Set_Debug_Mode('FILE');
1918: IF (l_Debug_Level <= 2) THEN
1919: cln_debug_pub.Add('ENTERING GET_TRADING_PARTNER_DETAILS', 2);
1920: END IF;
1921:
1915: BEGIN
1916: -- Sets the debug mode to be FILE
1917: --l_debug_mode := cln_debug_pub.Set_Debug_Mode('FILE');
1918: IF (l_Debug_Level <= 2) THEN
1919: cln_debug_pub.Add('ENTERING GET_TRADING_PARTNER_DETAILS', 2);
1920: END IF;
1921:
1922:
1923: IF (l_Debug_Level <= 1) THEN
1920: END IF;
1921:
1922:
1923: IF (l_Debug_Level <= 1) THEN
1924: cln_debug_pub.Add('p_tp_header_id:' || p_tp_header_id, 1);
1925: END IF;
1926:
1927:
1928: SELECT PARTY_ID, PARTY_SITE_ID
1930: FROM ECX_TP_HEADERS
1931: WHERE TP_HEADER_ID = p_tp_header_id;
1932:
1933: IF (l_Debug_Level <= 1) THEN
1934: cln_debug_pub.Add('l_tp_id:' || l_tp_id, 1);
1935: END IF;
1936:
1937: IF (l_Debug_Level <= 1) THEN
1938: cln_debug_pub.Add('l_tp_site_id:' || l_tp_site_id, 1);
1934: cln_debug_pub.Add('l_tp_id:' || l_tp_id, 1);
1935: END IF;
1936:
1937: IF (l_Debug_Level <= 1) THEN
1938: cln_debug_pub.Add('l_tp_site_id:' || l_tp_site_id, 1);
1939: END IF;
1940:
1941:
1942: x_tp_id := l_tp_id;
1942: x_tp_id := l_tp_id;
1943: x_tp_site_id := l_tp_site_id;
1944:
1945: IF (l_Debug_Level <= 2) THEN
1946: cln_debug_pub.Add('GET_TRADING_PARTNER_DETAILS', 2);
1947: END IF;
1948:
1949: END GET_TRADING_PARTNER_DETAILS;
1950:
1976: l_debug_mode VARCHAR2(255);
1977: l_doc_status VARCHAR2(255);
1978: BEGIN
1979: -- Sets the debug mode to be FILE
1980: --l_debug_mode := cln_debug_pub.Set_Debug_Mode('FILE');
1981: IF (l_Debug_Level <= 2) THEN
1982: cln_debug_pub.Add('ENTERING RAISE_UPDATE_COLLABORATION', 2);
1983: END IF;
1984:
1978: BEGIN
1979: -- Sets the debug mode to be FILE
1980: --l_debug_mode := cln_debug_pub.Set_Debug_Mode('FILE');
1981: IF (l_Debug_Level <= 2) THEN
1982: cln_debug_pub.Add('ENTERING RAISE_UPDATE_COLLABORATION', 2);
1983: END IF;
1984:
1985:
1986: -- Initialize API return status to success
1992:
1993: SELECT cln_generic_s.nextval INTO l_event_key FROM dual;
1994:
1995: IF (l_Debug_Level <= 1) THEN
1996: cln_debug_pub.Add('With the following parameters', 1);
1997: cln_debug_pub.Add('p_ref_id' || p_ref_id, 1);
1998: cln_debug_pub.Add('p_doc_no:' || p_doc_no, 1);
1999: cln_debug_pub.Add('p_status_code:' || p_status_code, 1);
2000: cln_debug_pub.Add('p_msg_text:' || p_msg_text, 1);
1993: SELECT cln_generic_s.nextval INTO l_event_key FROM dual;
1994:
1995: IF (l_Debug_Level <= 1) THEN
1996: cln_debug_pub.Add('With the following parameters', 1);
1997: cln_debug_pub.Add('p_ref_id' || p_ref_id, 1);
1998: cln_debug_pub.Add('p_doc_no:' || p_doc_no, 1);
1999: cln_debug_pub.Add('p_status_code:' || p_status_code, 1);
2000: cln_debug_pub.Add('p_msg_text:' || p_msg_text, 1);
2001: cln_debug_pub.Add('p_part_doc_no:' || p_part_doc_no, 1);
1994:
1995: IF (l_Debug_Level <= 1) THEN
1996: cln_debug_pub.Add('With the following parameters', 1);
1997: cln_debug_pub.Add('p_ref_id' || p_ref_id, 1);
1998: cln_debug_pub.Add('p_doc_no:' || p_doc_no, 1);
1999: cln_debug_pub.Add('p_status_code:' || p_status_code, 1);
2000: cln_debug_pub.Add('p_msg_text:' || p_msg_text, 1);
2001: cln_debug_pub.Add('p_part_doc_no:' || p_part_doc_no, 1);
2002: cln_debug_pub.Add('p_int_ctl_num:' || p_int_ctl_num, 1);
1995: IF (l_Debug_Level <= 1) THEN
1996: cln_debug_pub.Add('With the following parameters', 1);
1997: cln_debug_pub.Add('p_ref_id' || p_ref_id, 1);
1998: cln_debug_pub.Add('p_doc_no:' || p_doc_no, 1);
1999: cln_debug_pub.Add('p_status_code:' || p_status_code, 1);
2000: cln_debug_pub.Add('p_msg_text:' || p_msg_text, 1);
2001: cln_debug_pub.Add('p_part_doc_no:' || p_part_doc_no, 1);
2002: cln_debug_pub.Add('p_int_ctl_num:' || p_int_ctl_num, 1);
2003: END IF;
1996: cln_debug_pub.Add('With the following parameters', 1);
1997: cln_debug_pub.Add('p_ref_id' || p_ref_id, 1);
1998: cln_debug_pub.Add('p_doc_no:' || p_doc_no, 1);
1999: cln_debug_pub.Add('p_status_code:' || p_status_code, 1);
2000: cln_debug_pub.Add('p_msg_text:' || p_msg_text, 1);
2001: cln_debug_pub.Add('p_part_doc_no:' || p_part_doc_no, 1);
2002: cln_debug_pub.Add('p_int_ctl_num:' || p_int_ctl_num, 1);
2003: END IF;
2004:
1997: cln_debug_pub.Add('p_ref_id' || p_ref_id, 1);
1998: cln_debug_pub.Add('p_doc_no:' || p_doc_no, 1);
1999: cln_debug_pub.Add('p_status_code:' || p_status_code, 1);
2000: cln_debug_pub.Add('p_msg_text:' || p_msg_text, 1);
2001: cln_debug_pub.Add('p_part_doc_no:' || p_part_doc_no, 1);
2002: cln_debug_pub.Add('p_int_ctl_num:' || p_int_ctl_num, 1);
2003: END IF;
2004:
2005:
1998: cln_debug_pub.Add('p_doc_no:' || p_doc_no, 1);
1999: cln_debug_pub.Add('p_status_code:' || p_status_code, 1);
2000: cln_debug_pub.Add('p_msg_text:' || p_msg_text, 1);
2001: cln_debug_pub.Add('p_part_doc_no:' || p_part_doc_no, 1);
2002: cln_debug_pub.Add('p_int_ctl_num:' || p_int_ctl_num, 1);
2003: END IF;
2004:
2005:
2006: IF p_status_code = 0 THEN
2009: l_doc_status := 'ERROR';
2010: END IF;
2011:
2012: IF (l_Debug_Level <= 1) THEN
2013: cln_debug_pub.Add('l_doc_status:' || l_doc_status, 1);
2014: END IF;
2015:
2016:
2017: l_cln_ch_parameters := wf_parameter_list_t();
2029:
2030: WF_EVENT.Raise('oracle.apps.cln.ch.collaboration.update',
2031: l_event_key, NULL, l_cln_ch_parameters, NULL);
2032: IF (l_Debug_Level <= 1) THEN
2033: cln_debug_pub.Add('Workflow event- oracle.apps.cln.ch.collaboration.update raised', 1);
2034: END IF;
2035:
2036:
2037: IF (l_Debug_Level <= 2) THEN
2034: END IF;
2035:
2036:
2037: IF (l_Debug_Level <= 2) THEN
2038: cln_debug_pub.Add('EXITING RAISE_UPDATE_COLLABORATION', 2);
2039: END IF;
2040:
2041: EXCEPTION
2042: WHEN OTHERS THEN
2044: l_error_msg := SQLERRM;
2045: x_return_status := FND_API.G_RET_STS_ERROR;
2046: x_msg_data := l_error_code || ':' || l_error_msg;
2047: IF (l_Debug_Level <= 5) THEN
2048: cln_debug_pub.Add(x_msg_data, 4);
2049: cln_debug_pub.Add('EXITING RAISE_UPDATE_COLLABORATION', 2);
2050: END IF;
2051:
2052: END RAISE_UPDATE_COLLABORATION;
2045: x_return_status := FND_API.G_RET_STS_ERROR;
2046: x_msg_data := l_error_code || ':' || l_error_msg;
2047: IF (l_Debug_Level <= 5) THEN
2048: cln_debug_pub.Add(x_msg_data, 4);
2049: cln_debug_pub.Add('EXITING RAISE_UPDATE_COLLABORATION', 2);
2050: END IF;
2051:
2052: END RAISE_UPDATE_COLLABORATION;
2053:
2081: l_dtl_coll_id NUMBER;
2082: l_msg_data VARCHAR2(2000);
2083: BEGIN
2084: -- Sets the debug mode to be FILE
2085: --l_debug_mode :=cln_debug_pub.Set_Debug_Mode('FILE');
2086: IF (l_Debug_Level <= 2) THEN
2087: cln_debug_pub.Add('ENTERING RAISE_ADD_MESSAGE', 2);
2088: END IF;
2089:
2083: BEGIN
2084: -- Sets the debug mode to be FILE
2085: --l_debug_mode :=cln_debug_pub.Set_Debug_Mode('FILE');
2086: IF (l_Debug_Level <= 2) THEN
2087: cln_debug_pub.Add('ENTERING RAISE_ADD_MESSAGE', 2);
2088: END IF;
2089:
2090: -- Parameters received
2091: IF (l_Debug_Level <= 1) THEN
2088: END IF;
2089:
2090: -- Parameters received
2091: IF (l_Debug_Level <= 1) THEN
2092: cln_debug_pub.Add('With the following parameters',1);
2093: cln_debug_pub.Add('p_ictrl_no - ' || p_ictrl_no,1);
2094: cln_debug_pub.Add('p_ref1 - ' || p_ref1,1);
2095: cln_debug_pub.Add('p_ref2 - ' || p_ref2,1);
2096: cln_debug_pub.Add('p_ref3 - ' || p_ref3,1);
2089:
2090: -- Parameters received
2091: IF (l_Debug_Level <= 1) THEN
2092: cln_debug_pub.Add('With the following parameters',1);
2093: cln_debug_pub.Add('p_ictrl_no - ' || p_ictrl_no,1);
2094: cln_debug_pub.Add('p_ref1 - ' || p_ref1,1);
2095: cln_debug_pub.Add('p_ref2 - ' || p_ref2,1);
2096: cln_debug_pub.Add('p_ref3 - ' || p_ref3,1);
2097: cln_debug_pub.Add('p_ref4 - ' || p_ref4,1);
2090: -- Parameters received
2091: IF (l_Debug_Level <= 1) THEN
2092: cln_debug_pub.Add('With the following parameters',1);
2093: cln_debug_pub.Add('p_ictrl_no - ' || p_ictrl_no,1);
2094: cln_debug_pub.Add('p_ref1 - ' || p_ref1,1);
2095: cln_debug_pub.Add('p_ref2 - ' || p_ref2,1);
2096: cln_debug_pub.Add('p_ref3 - ' || p_ref3,1);
2097: cln_debug_pub.Add('p_ref4 - ' || p_ref4,1);
2098: cln_debug_pub.Add('p_ref5 - ' || p_ref5,1);
2091: IF (l_Debug_Level <= 1) THEN
2092: cln_debug_pub.Add('With the following parameters',1);
2093: cln_debug_pub.Add('p_ictrl_no - ' || p_ictrl_no,1);
2094: cln_debug_pub.Add('p_ref1 - ' || p_ref1,1);
2095: cln_debug_pub.Add('p_ref2 - ' || p_ref2,1);
2096: cln_debug_pub.Add('p_ref3 - ' || p_ref3,1);
2097: cln_debug_pub.Add('p_ref4 - ' || p_ref4,1);
2098: cln_debug_pub.Add('p_ref5 - ' || p_ref5,1);
2099: cln_debug_pub.Add('p_dtl_msg - ' || p_dtl_msg,1);
2092: cln_debug_pub.Add('With the following parameters',1);
2093: cln_debug_pub.Add('p_ictrl_no - ' || p_ictrl_no,1);
2094: cln_debug_pub.Add('p_ref1 - ' || p_ref1,1);
2095: cln_debug_pub.Add('p_ref2 - ' || p_ref2,1);
2096: cln_debug_pub.Add('p_ref3 - ' || p_ref3,1);
2097: cln_debug_pub.Add('p_ref4 - ' || p_ref4,1);
2098: cln_debug_pub.Add('p_ref5 - ' || p_ref5,1);
2099: cln_debug_pub.Add('p_dtl_msg - ' || p_dtl_msg,1);
2100: END IF;
2093: cln_debug_pub.Add('p_ictrl_no - ' || p_ictrl_no,1);
2094: cln_debug_pub.Add('p_ref1 - ' || p_ref1,1);
2095: cln_debug_pub.Add('p_ref2 - ' || p_ref2,1);
2096: cln_debug_pub.Add('p_ref3 - ' || p_ref3,1);
2097: cln_debug_pub.Add('p_ref4 - ' || p_ref4,1);
2098: cln_debug_pub.Add('p_ref5 - ' || p_ref5,1);
2099: cln_debug_pub.Add('p_dtl_msg - ' || p_dtl_msg,1);
2100: END IF;
2101:
2094: cln_debug_pub.Add('p_ref1 - ' || p_ref1,1);
2095: cln_debug_pub.Add('p_ref2 - ' || p_ref2,1);
2096: cln_debug_pub.Add('p_ref3 - ' || p_ref3,1);
2097: cln_debug_pub.Add('p_ref4 - ' || p_ref4,1);
2098: cln_debug_pub.Add('p_ref5 - ' || p_ref5,1);
2099: cln_debug_pub.Add('p_dtl_msg - ' || p_dtl_msg,1);
2100: END IF;
2101:
2102:
2095: cln_debug_pub.Add('p_ref2 - ' || p_ref2,1);
2096: cln_debug_pub.Add('p_ref3 - ' || p_ref3,1);
2097: cln_debug_pub.Add('p_ref4 - ' || p_ref4,1);
2098: cln_debug_pub.Add('p_ref5 - ' || p_ref5,1);
2099: cln_debug_pub.Add('p_dtl_msg - ' || p_dtl_msg,1);
2100: END IF;
2101:
2102:
2103: -- Initialize API return status to success
2124:
2125: WF_EVENT.Raise('oracle.apps.cln.ch.collaboration.addmessage',
2126: l_event_key, NULL, l_cln_ch_parameters, NULL);
2127: IF (l_Debug_Level <= 1) THEN
2128: cln_debug_pub.Add('Workflow event- oracle.apps.cln.ch.collaboration.addmessage', 1);
2129: END IF;
2130:
2131:
2132: IF (l_Debug_Level <= 2) THEN
2129: END IF;
2130:
2131:
2132: IF (l_Debug_Level <= 2) THEN
2133: cln_debug_pub.Add('EXITING RAISE_ADD_MESSAGE', 2);
2134: END IF;
2135:
2136: EXCEPTION
2137: WHEN OTHERS THEN
2139: l_error_msg := SQLERRM;
2140: x_return_status := FND_API.G_RET_STS_ERROR;
2141: x_msg_data := l_error_code || ':' || l_error_msg;
2142: IF (l_Debug_Level <= 5) THEN
2143: cln_debug_pub.Add(x_msg_data, 4);
2144: cln_debug_pub.Add('EXITING RAISE_ADD_MESSAGE', 2);
2145: END IF;
2146:
2147: END RAISE_ADD_MESSAGE;
2140: x_return_status := FND_API.G_RET_STS_ERROR;
2141: x_msg_data := l_error_code || ':' || l_error_msg;
2142: IF (l_Debug_Level <= 5) THEN
2143: cln_debug_pub.Add(x_msg_data, 4);
2144: cln_debug_pub.Add('EXITING RAISE_ADD_MESSAGE', 2);
2145: END IF;
2146:
2147: END RAISE_ADD_MESSAGE;
2148: