2: /* $Header: PO_MODIFY_REQUISITION_PVT.plb 120.7 2006/11/13 05:52:04 asista noship $ */
3:
4: -- Logging global constants
5: G_PKG_NAME CONSTANT VARCHAR2(30) := 'PO_MODIFY_REQUISITION_PVT';
6: D_PACKAGE_BASE CONSTANT VARCHAR2(100) := PO_LOG.get_package_base(G_PKG_NAME);
7:
8: --Other constants used in code
9: g_REQ_LINES_ENTITY CONSTANT VARCHAR2(20) := 'REQ_LINES';
10: g_EXPLODE_REQ_ACTION CONSTANT VARCHAR2(20) :='Explode_Req';
66: x_error_msg_tbl OUT NOCOPY PO_TBL_VARCHAR2000
67: ) IS
68:
69: l_module CONSTANT VARCHAR2(100) := 'split_requisition_lines';
70: d_module_base CONSTANT VARCHAR2(100) := PO_LOG.get_subprogram_base(d_PACKAGE_BASE,l_module);
71:
72: l_api_version CONSTANT NUMBER := 1.0;
73: d_progress NUMBER;
74: l_old_org_id NUMBER;
77: SAVEPOINT split_requisition_lines_PVT;
78:
79: d_progress := 10;
80:
81: IF PO_LOG.d_event THEN
82: PO_LOG.event(d_module_base,d_progress,'Starting Requisition Split ');
83: END IF;
84: --Initialize the error messages table
85: x_error_msg_tbl :=po_tbl_varchar2000();
78:
79: d_progress := 10;
80:
81: IF PO_LOG.d_event THEN
82: PO_LOG.event(d_module_base,d_progress,'Starting Requisition Split ');
83: END IF;
84: --Initialize the error messages table
85: x_error_msg_tbl :=po_tbl_varchar2000();
86: IF NOT FND_API.Compatible_API_Call(l_api_version,
95: --org context back to this value before leaving the
96: --program.
97: l_old_org_id := PO_MOAC_UTILS_PVT.get_current_org_id;
98:
99: IF PO_LOG.d_stmt THEN
100: PO_LOG.stmt(d_module_base,d_progress,'l_old_org_id ', l_old_org_id);
101: PO_LOG.stmt(d_module_base,d_progress,'Retrieved the value of current orgId');
102: END IF;
103:
96: --program.
97: l_old_org_id := PO_MOAC_UTILS_PVT.get_current_org_id;
98:
99: IF PO_LOG.d_stmt THEN
100: PO_LOG.stmt(d_module_base,d_progress,'l_old_org_id ', l_old_org_id);
101: PO_LOG.stmt(d_module_base,d_progress,'Retrieved the value of current orgId');
102: END IF;
103:
104: d_progress := 20;
97: l_old_org_id := PO_MOAC_UTILS_PVT.get_current_org_id;
98:
99: IF PO_LOG.d_stmt THEN
100: PO_LOG.stmt(d_module_base,d_progress,'l_old_org_id ', l_old_org_id);
101: PO_LOG.stmt(d_module_base,d_progress,'Retrieved the value of current orgId');
102: END IF;
103:
104: d_progress := 20;
105:
116: p_calling_program => p_calling_program,
117: x_new_line_ids_tbl => x_new_line_ids_tbl,
118: x_error_msg_tbl => x_error_msg_tbl);
119:
120: IF PO_LOG.d_stmt THEN
121: PO_LOG.stmt(d_module_base,d_progress,'x_return_status',x_return_status);
122: END IF;
123:
124: IF (x_return_status = FND_API.g_ret_sts_error)
117: x_new_line_ids_tbl => x_new_line_ids_tbl,
118: x_error_msg_tbl => x_error_msg_tbl);
119:
120: IF PO_LOG.d_stmt THEN
121: PO_LOG.stmt(d_module_base,d_progress,'x_return_status',x_return_status);
122: END IF;
123:
124: IF (x_return_status = FND_API.g_ret_sts_error)
125: THEN
144:
145:
146: d_progress:=40;
147:
148: IF PO_LOG.d_stmt THEN
149: PO_LOG.stmt(d_module_base,d_progress,'x_return_status',x_return_status);
150: END IF;
151:
152: IF (x_return_status = FND_API.g_ret_sts_error)
145:
146: d_progress:=40;
147:
148: IF PO_LOG.d_stmt THEN
149: PO_LOG.stmt(d_module_base,d_progress,'x_return_status',x_return_status);
150: END IF;
151:
152: IF (x_return_status = FND_API.g_ret_sts_error)
153: THEN
156: THEN
157: RAISE FND_API.g_exc_unexpected_error;
158: END IF; --x_return_status
159:
160: IF PO_LOG.d_stmt THEN
161: PO_LOG.stmt(d_module_base,d_progress,'Reset the org context to old value');
162: END IF;
163:
164: --Set the org context back to the original org context
157: RAISE FND_API.g_exc_unexpected_error;
158: END IF; --x_return_status
159:
160: IF PO_LOG.d_stmt THEN
161: PO_LOG.stmt(d_module_base,d_progress,'Reset the org context to old value');
162: END IF;
163:
164: --Set the org context back to the original org context
165: po_moac_utils_pvt.set_org_context(l_old_org_id);
163:
164: --Set the org context back to the original org context
165: po_moac_utils_pvt.set_org_context(l_old_org_id);
166:
167: IF PO_LOG.d_stmt THEN
168: PO_LOG.stmt(d_module_base,d_progress,'l_old_org_id',l_old_org_id);
169: END IF;
170:
171: d_progress:=50;
164: --Set the org context back to the original org context
165: po_moac_utils_pvt.set_org_context(l_old_org_id);
166:
167: IF PO_LOG.d_stmt THEN
168: PO_LOG.stmt(d_module_base,d_progress,'l_old_org_id',l_old_org_id);
169: END IF;
170:
171: d_progress:=50;
172: x_return_status := FND_API.g_ret_sts_success;
169: END IF;
170:
171: d_progress:=50;
172: x_return_status := FND_API.g_ret_sts_success;
173: IF (PO_LOG.d_proc)
174: THEN
175: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
176: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
177: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
171: d_progress:=50;
172: x_return_status := FND_API.g_ret_sts_success;
173: IF (PO_LOG.d_proc)
174: THEN
175: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
176: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
177: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
178: END IF;
179: EXCEPTION
172: x_return_status := FND_API.g_ret_sts_success;
173: IF (PO_LOG.d_proc)
174: THEN
175: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
176: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
177: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
178: END IF;
179: EXCEPTION
180: WHEN FND_API.g_exc_error THEN
173: IF (PO_LOG.d_proc)
174: THEN
175: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
176: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
177: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
178: END IF;
179: EXCEPTION
180: WHEN FND_API.g_exc_error THEN
181: ROLLBACK TO split_requisition_lines_PVT;
180: WHEN FND_API.g_exc_error THEN
181: ROLLBACK TO split_requisition_lines_PVT;
182: x_return_status := FND_API.g_ret_sts_error;
183: po_moac_utils_pvt.set_org_context(l_old_org_id);
184: IF (PO_LOG.d_exc)
185: THEN
186: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
187: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
188: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
182: x_return_status := FND_API.g_ret_sts_error;
183: po_moac_utils_pvt.set_org_context(l_old_org_id);
184: IF (PO_LOG.d_exc)
185: THEN
186: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
187: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
188: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
189: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
190: END IF;
183: po_moac_utils_pvt.set_org_context(l_old_org_id);
184: IF (PO_LOG.d_exc)
185: THEN
186: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
187: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
188: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
189: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
190: END IF;
191: WHEN FND_API.g_exc_unexpected_error THEN
184: IF (PO_LOG.d_exc)
185: THEN
186: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
187: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
188: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
189: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
190: END IF;
191: WHEN FND_API.g_exc_unexpected_error THEN
192: ROLLBACK TO split_requisition_lines_PVT;
185: THEN
186: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
187: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
188: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
189: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
190: END IF;
191: WHEN FND_API.g_exc_unexpected_error THEN
192: ROLLBACK TO split_requisition_lines_PVT;
193: po_moac_utils_pvt.set_org_context(l_old_org_id);
199: x_error_msg_tbl.extend(1);
200: x_error_msg_tbl(x_error_msg_tbl.count) := x_msg_data;
201: x_return_status := FND_API.g_ret_sts_error;
202:
203: IF (PO_LOG.d_exc)
204: THEN
205: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
206: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
207: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
201: x_return_status := FND_API.g_ret_sts_error;
202:
203: IF (PO_LOG.d_exc)
204: THEN
205: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
206: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
207: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
208: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
209: END IF;
202:
203: IF (PO_LOG.d_exc)
204: THEN
205: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
206: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
207: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
208: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
209: END IF;
210: WHEN OTHERS THEN
203: IF (PO_LOG.d_exc)
204: THEN
205: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
206: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
207: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
208: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
209: END IF;
210: WHEN OTHERS THEN
211: ROLLBACK TO split_requisition_lines_PVT;
204: THEN
205: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
206: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
207: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
208: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
209: END IF;
210: WHEN OTHERS THEN
211: ROLLBACK TO split_requisition_lines_PVT;
212: po_moac_utils_pvt.set_org_context(l_old_org_id);
220: x_error_msg_tbl.extend(1);
221: x_error_msg_tbl(x_error_msg_tbl.count) := x_msg_data;
222:
223: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
224: IF (PO_LOG.d_exc)
225: THEN
226: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
227: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
228: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
222:
223: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
224: IF (PO_LOG.d_exc)
225: THEN
226: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
227: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
228: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
229: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
230: END IF;
223: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
224: IF (PO_LOG.d_exc)
225: THEN
226: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
227: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
228: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
229: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
230: END IF;
231:
224: IF (PO_LOG.d_exc)
225: THEN
226: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
227: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
228: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
229: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
230: END IF;
231:
232: EXCEPTION
225: THEN
226: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
227: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
228: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
229: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
230: END IF;
231:
232: EXCEPTION
233: WHEN OTHERS THEN
231:
232: EXCEPTION
233: WHEN OTHERS THEN
234: po_moac_utils_pvt.set_org_context(l_old_org_id);
235: IF (PO_LOG.d_exc)
236: THEN
237: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
238: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
239: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
233: WHEN OTHERS THEN
234: po_moac_utils_pvt.set_org_context(l_old_org_id);
235: IF (PO_LOG.d_exc)
236: THEN
237: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
238: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
239: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
240: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
241: END IF;
234: po_moac_utils_pvt.set_org_context(l_old_org_id);
235: IF (PO_LOG.d_exc)
236: THEN
237: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
238: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
239: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
240: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
241: END IF;
242: RAISE;
235: IF (PO_LOG.d_exc)
236: THEN
237: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
238: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
239: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
240: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
241: END IF;
242: RAISE;
243: END;
236: THEN
237: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
238: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
239: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
240: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
241: END IF;
242: RAISE;
243: END;
244: END split_requisition_lines;
258: x_error_msg_tbl OUT NOCOPY PO_TBL_VARCHAR2000
259: ) IS
260:
261: l_module CONSTANT VARCHAR2(100) := 'create_requisition_lines';
262: d_module_base CONSTANT VARCHAR2(100) := PO_LOG.get_subprogram_base(d_PACKAGE_BASE, l_module);
263: l_api_version CONSTANT NUMBER := 1.0;
264: d_progress NUMBER;
265: --declare the result tables.
266: new_req_line_id_rslt_tbl PO_TBL_NUMBER;
287: SAVEPOINT create_requisition_lines_PVT;
288:
289: d_progress := 10;
290:
291: IF PO_LOG.d_event THEN
292: PO_LOG.event(d_module_base,d_progress,'Starting Requisition Split ');
293: END IF;
294: --Initialize the error messages table
295: x_error_msg_tbl :=po_tbl_varchar2000();
288:
289: d_progress := 10;
290:
291: IF PO_LOG.d_event THEN
292: PO_LOG.event(d_module_base,d_progress,'Starting Requisition Split ');
293: END IF;
294: --Initialize the error messages table
295: x_error_msg_tbl :=po_tbl_varchar2000();
296: IF NOT FND_API.Compatible_API_Call(l_api_version,
300: THEN
301: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
302: END IF;
303:
304: IF (PO_LOG.d_proc)
305: THEN
306: PO_LOG.proc_begin(d_module_base);
307: PO_LOG.proc_begin(d_module_base,'p_api_version', p_api_version );
308: PO_LOG.proc_begin(d_module_base,'p_init_msg_list', p_init_msg_list);
302: END IF;
303:
304: IF (PO_LOG.d_proc)
305: THEN
306: PO_LOG.proc_begin(d_module_base);
307: PO_LOG.proc_begin(d_module_base,'p_api_version', p_api_version );
308: PO_LOG.proc_begin(d_module_base,'p_init_msg_list', p_init_msg_list);
309: PO_LOG.proc_begin(d_module_base,'p_commit', p_commit );
310: PO_LOG.proc_begin(d_module_base,'p_req_line_id', p_req_line_id );
303:
304: IF (PO_LOG.d_proc)
305: THEN
306: PO_LOG.proc_begin(d_module_base);
307: PO_LOG.proc_begin(d_module_base,'p_api_version', p_api_version );
308: PO_LOG.proc_begin(d_module_base,'p_init_msg_list', p_init_msg_list);
309: PO_LOG.proc_begin(d_module_base,'p_commit', p_commit );
310: PO_LOG.proc_begin(d_module_base,'p_req_line_id', p_req_line_id );
311: PO_LOG.proc_begin(d_module_base,'p_quantity_tbl', p_quantity_tbl );
304: IF (PO_LOG.d_proc)
305: THEN
306: PO_LOG.proc_begin(d_module_base);
307: PO_LOG.proc_begin(d_module_base,'p_api_version', p_api_version );
308: PO_LOG.proc_begin(d_module_base,'p_init_msg_list', p_init_msg_list);
309: PO_LOG.proc_begin(d_module_base,'p_commit', p_commit );
310: PO_LOG.proc_begin(d_module_base,'p_req_line_id', p_req_line_id );
311: PO_LOG.proc_begin(d_module_base,'p_quantity_tbl', p_quantity_tbl );
312: PO_LOG.proc_begin(d_module_base,'p_agent_id', p_agent_id );
305: THEN
306: PO_LOG.proc_begin(d_module_base);
307: PO_LOG.proc_begin(d_module_base,'p_api_version', p_api_version );
308: PO_LOG.proc_begin(d_module_base,'p_init_msg_list', p_init_msg_list);
309: PO_LOG.proc_begin(d_module_base,'p_commit', p_commit );
310: PO_LOG.proc_begin(d_module_base,'p_req_line_id', p_req_line_id );
311: PO_LOG.proc_begin(d_module_base,'p_quantity_tbl', p_quantity_tbl );
312: PO_LOG.proc_begin(d_module_base,'p_agent_id', p_agent_id );
313: END IF;
306: PO_LOG.proc_begin(d_module_base);
307: PO_LOG.proc_begin(d_module_base,'p_api_version', p_api_version );
308: PO_LOG.proc_begin(d_module_base,'p_init_msg_list', p_init_msg_list);
309: PO_LOG.proc_begin(d_module_base,'p_commit', p_commit );
310: PO_LOG.proc_begin(d_module_base,'p_req_line_id', p_req_line_id );
311: PO_LOG.proc_begin(d_module_base,'p_quantity_tbl', p_quantity_tbl );
312: PO_LOG.proc_begin(d_module_base,'p_agent_id', p_agent_id );
313: END IF;
314:
307: PO_LOG.proc_begin(d_module_base,'p_api_version', p_api_version );
308: PO_LOG.proc_begin(d_module_base,'p_init_msg_list', p_init_msg_list);
309: PO_LOG.proc_begin(d_module_base,'p_commit', p_commit );
310: PO_LOG.proc_begin(d_module_base,'p_req_line_id', p_req_line_id );
311: PO_LOG.proc_begin(d_module_base,'p_quantity_tbl', p_quantity_tbl );
312: PO_LOG.proc_begin(d_module_base,'p_agent_id', p_agent_id );
313: END IF;
314:
315: IF PO_LOG.d_stmt THEN
308: PO_LOG.proc_begin(d_module_base,'p_init_msg_list', p_init_msg_list);
309: PO_LOG.proc_begin(d_module_base,'p_commit', p_commit );
310: PO_LOG.proc_begin(d_module_base,'p_req_line_id', p_req_line_id );
311: PO_LOG.proc_begin(d_module_base,'p_quantity_tbl', p_quantity_tbl );
312: PO_LOG.proc_begin(d_module_base,'p_agent_id', p_agent_id );
313: END IF;
314:
315: IF PO_LOG.d_stmt THEN
316: PO_LOG.stmt(d_module_base,d_progress,'Attempting to lock the requisition line ');
311: PO_LOG.proc_begin(d_module_base,'p_quantity_tbl', p_quantity_tbl );
312: PO_LOG.proc_begin(d_module_base,'p_agent_id', p_agent_id );
313: END IF;
314:
315: IF PO_LOG.d_stmt THEN
316: PO_LOG.stmt(d_module_base,d_progress,'Attempting to lock the requisition line ');
317: END IF;
318:
319: -- Lock the requisition lines the api is going to process
312: PO_LOG.proc_begin(d_module_base,'p_agent_id', p_agent_id );
313: END IF;
314:
315: IF PO_LOG.d_stmt THEN
316: PO_LOG.stmt(d_module_base,d_progress,'Attempting to lock the requisition line ');
317: END IF;
318:
319: -- Lock the requisition lines the api is going to process
320: -- Retrieve the value of requisition org id so that the org
327: l_current_org_id;
328:
329: CLOSE lock_req_lines_cs;
330:
331: IF PO_LOG.d_stmt THEN
332: PO_LOG.stmt(d_module_base,d_progress,'Locked the requisition Line Successfully ');
333: END IF;
334:
335: d_progress := 20;
328:
329: CLOSE lock_req_lines_cs;
330:
331: IF PO_LOG.d_stmt THEN
332: PO_LOG.stmt(d_module_base,d_progress,'Locked the requisition Line Successfully ');
333: END IF;
334:
335: d_progress := 20;
336: --Set the org context to the org id of the parent req line.
335: d_progress := 20;
336: --Set the org context to the org id of the parent req line.
337: po_moac_utils_pvt.set_org_context(l_current_org_id);
338:
339: IF PO_LOG.d_stmt THEN
340: PO_LOG.stmt(d_module_base,d_progress,'l_current_org_id',l_current_org_id);
341: PO_LOG.stmt(d_module_base,d_progress,'Set the org context to the organization in which Requisition was raised.');
342: END IF;
343:
336: --Set the org context to the org id of the parent req line.
337: po_moac_utils_pvt.set_org_context(l_current_org_id);
338:
339: IF PO_LOG.d_stmt THEN
340: PO_LOG.stmt(d_module_base,d_progress,'l_current_org_id',l_current_org_id);
341: PO_LOG.stmt(d_module_base,d_progress,'Set the org context to the organization in which Requisition was raised.');
342: END IF;
343:
344: d_progress := 30;
337: po_moac_utils_pvt.set_org_context(l_current_org_id);
338:
339: IF PO_LOG.d_stmt THEN
340: PO_LOG.stmt(d_module_base,d_progress,'l_current_org_id',l_current_org_id);
341: PO_LOG.stmt(d_module_base,d_progress,'Set the org context to the organization in which Requisition was raised.');
342: END IF;
343:
344: d_progress := 30;
345:
342: END IF;
343:
344: d_progress := 30;
345:
346: IF PO_LOG.d_stmt THEN
347: PO_LOG.stmt(d_module_base,d_progress,'Calculating value of max line number for the given requisition');
348: END IF;
349: --SQL What:Retrieve the max line number for the given requisition
350: -- to which the requisition line belongs
343:
344: d_progress := 30;
345:
346: IF PO_LOG.d_stmt THEN
347: PO_LOG.stmt(d_module_base,d_progress,'Calculating value of max line number for the given requisition');
348: END IF;
349: --SQL What:Retrieve the max line number for the given requisition
350: -- to which the requisition line belongs
351: --SQL Why :This is required to calculate the line numbers when creating
358: (SELECT requisition_header_id
359: FROM po_requisition_lines_all
360: WHERE requisition_line_id = p_req_Line_id);
361:
362: IF PO_LOG.d_stmt THEN
363: PO_LOG.stmt(d_module_base,d_progress,'l_max_line_num',l_max_line_num);
364: END IF;
365:
366: d_progress := 40;
359: FROM po_requisition_lines_all
360: WHERE requisition_line_id = p_req_Line_id);
361:
362: IF PO_LOG.d_stmt THEN
363: PO_LOG.stmt(d_module_base,d_progress,'l_max_line_num',l_max_line_num);
364: END IF;
365:
366: d_progress := 40;
367:
382: END IF;
383: --x_new_line_ids_tbl(l_line_num_index):=l_serial_num;
384: --Insert appropriate data into requisition lines all
385:
386: IF PO_LOG.d_stmt THEN
387: PO_LOG.stmt(d_module_base,d_progress,'Inserting a new row');
388: PO_LOG.stmt(d_module_base,d_progress,'l_serial_num',l_serial_num);
389: END IF;
390:
383: --x_new_line_ids_tbl(l_line_num_index):=l_serial_num;
384: --Insert appropriate data into requisition lines all
385:
386: IF PO_LOG.d_stmt THEN
387: PO_LOG.stmt(d_module_base,d_progress,'Inserting a new row');
388: PO_LOG.stmt(d_module_base,d_progress,'l_serial_num',l_serial_num);
389: END IF;
390:
391:
384: --Insert appropriate data into requisition lines all
385:
386: IF PO_LOG.d_stmt THEN
387: PO_LOG.stmt(d_module_base,d_progress,'Inserting a new row');
388: PO_LOG.stmt(d_module_base,d_progress,'l_serial_num',l_serial_num);
389: END IF;
390:
391:
392: INSERT INTO po_requisition_lines_all
666: END LOOP;
667:
668: d_progress := 50;
669:
670: IF PO_LOG.d_stmt THEN
671: PO_LOG.stmt(d_module_base,d_progress,'Updating the old requisition line to mark it as modified and to push it out of pool');
672: END IF;
673:
674: -- SQL What:Mark all the parent requisition lines which are split
667:
668: d_progress := 50;
669:
670: IF PO_LOG.d_stmt THEN
671: PO_LOG.stmt(d_module_base,d_progress,'Updating the old requisition line to mark it as modified and to push it out of pool');
672: END IF;
673:
674: -- SQL What:Mark all the parent requisition lines which are split
675: -- with modified_by_agent_flag setting 'Y'.
730: WHERE PRL1.requisition_header_id = PRL2.requisition_header_id
731: AND PRL1.parent_req_line_id = p_req_line_id
732: AND PRL2.requisition_line_id = p_req_line_id;
733:
734: IF PO_LOG.d_stmt THEN
735: FOR i in 1..new_req_line_id_rslt_tbl.count LOOP
736: PO_LOG.stmt(d_module_base,d_progress,'new_req_line_id_rslt_tbl('||i||')',new_req_line_id_rslt_tbl(i));
737: END LOOP;
738: END IF;
732: AND PRL2.requisition_line_id = p_req_line_id;
733:
734: IF PO_LOG.d_stmt THEN
735: FOR i in 1..new_req_line_id_rslt_tbl.count LOOP
736: PO_LOG.stmt(d_module_base,d_progress,'new_req_line_id_rslt_tbl('||i||')',new_req_line_id_rslt_tbl(i));
737: END LOOP;
738: END IF;
739: x_new_line_ids_tbl := new_req_line_id_rslt_tbl;
740:
741: d_progress := 60;
742:
743: IF FND_API.To_Boolean(p_commit)
744: THEN
745: IF PO_LOG.d_event THEN
746: PO_LOG.event(d_module_base,d_progress,'Commiting work');
747: END IF;
748: COMMIT WORK;
749: END IF; --FND_API
742:
743: IF FND_API.To_Boolean(p_commit)
744: THEN
745: IF PO_LOG.d_event THEN
746: PO_LOG.event(d_module_base,d_progress,'Commiting work');
747: END IF;
748: COMMIT WORK;
749: END IF; --FND_API
750:
750:
751: d_progress := 70;
752: x_return_status := FND_API.g_ret_sts_success;
753:
754: IF PO_LOG.d_stmt THEN
755: PO_LOG.stmt(d_module_base,d_progress,'l_old_org_id',l_old_org_id);
756: END IF;
757:
758: IF (PO_LOG.d_proc)
751: d_progress := 70;
752: x_return_status := FND_API.g_ret_sts_success;
753:
754: IF PO_LOG.d_stmt THEN
755: PO_LOG.stmt(d_module_base,d_progress,'l_old_org_id',l_old_org_id);
756: END IF;
757:
758: IF (PO_LOG.d_proc)
759: THEN
754: IF PO_LOG.d_stmt THEN
755: PO_LOG.stmt(d_module_base,d_progress,'l_old_org_id',l_old_org_id);
756: END IF;
757:
758: IF (PO_LOG.d_proc)
759: THEN
760: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
761: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
762: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
756: END IF;
757:
758: IF (PO_LOG.d_proc)
759: THEN
760: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
761: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
762: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
763: END IF;
764: EXCEPTION
757:
758: IF (PO_LOG.d_proc)
759: THEN
760: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
761: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
762: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
763: END IF;
764: EXCEPTION
765: WHEN OTHERS THEN
758: IF (PO_LOG.d_proc)
759: THEN
760: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
761: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
762: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
763: END IF;
764: EXCEPTION
765: WHEN OTHERS THEN
766: ROLLBACK TO create_requisition_lines_PVT;
772: x_msg_data := FND_MESSAGE.get;
773: x_error_msg_tbl.extend(1);
774: x_error_msg_tbl(x_error_msg_tbl.count) := x_msg_data;
775: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
776: IF (PO_LOG.d_exc)
777: THEN
778: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
779: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
780: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
774: x_error_msg_tbl(x_error_msg_tbl.count) := x_msg_data;
775: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
776: IF (PO_LOG.d_exc)
777: THEN
778: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
779: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
780: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
781: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
782: END IF;
775: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
776: IF (PO_LOG.d_exc)
777: THEN
778: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
779: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
780: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
781: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
782: END IF;
783:
776: IF (PO_LOG.d_exc)
777: THEN
778: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
779: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
780: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
781: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
782: END IF;
783:
784: EXCEPTION
777: THEN
778: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
779: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
780: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
781: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
782: END IF;
783:
784: EXCEPTION
785: WHEN OTHERS THEN
783:
784: EXCEPTION
785: WHEN OTHERS THEN
786: po_moac_utils_pvt.set_org_context(l_old_org_id);
787: IF (PO_LOG.d_exc)
788: THEN
789: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
790: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
791: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
785: WHEN OTHERS THEN
786: po_moac_utils_pvt.set_org_context(l_old_org_id);
787: IF (PO_LOG.d_exc)
788: THEN
789: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
790: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
791: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
792: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
793: END IF;
786: po_moac_utils_pvt.set_org_context(l_old_org_id);
787: IF (PO_LOG.d_exc)
788: THEN
789: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
790: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
791: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
792: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
793: END IF;
794: RAISE;
787: IF (PO_LOG.d_exc)
788: THEN
789: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
790: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
791: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
792: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
793: END IF;
794: RAISE;
795: END;
788: THEN
789: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
790: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
791: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
792: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
793: END IF;
794: RAISE;
795: END;
796: END create_requisition_lines;
808: p_new_line_ids_tbl IN PO_TBL_NUMBER,
809: x_error_msg_tbl OUT NOCOPY PO_TBL_VARCHAR2000) IS
810:
811: l_module CONSTANT VARCHAR2(100) := 'post_modify_requisition_lines';
812: d_module_base CONSTANT VARCHAR2(100) := PO_LOG.get_subprogram_base(d_PACKAGE_BASE, l_module);
813: l_api_version CONSTANT NUMBER := 1.0;
814: d_progress NUMBER;
815: --declare the result tables.
816: l_return_status VARCHAR2(1);
827: SAVEPOINT post_requisition_lines_PVT;
828:
829: d_progress := 10;
830:
831: IF PO_LOG.d_event THEN
832: PO_LOG.event(d_module_base,d_progress,'Post Modify Requisition ');
833: END IF;
834:
835: --Initialize the error messages table
828:
829: d_progress := 10;
830:
831: IF PO_LOG.d_event THEN
832: PO_LOG.event(d_module_base,d_progress,'Post Modify Requisition ');
833: END IF;
834:
835: --Initialize the error messages table
836: x_error_msg_tbl :=po_tbl_varchar2000();
842: THEN
843: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
844: END IF;
845:
846: IF (PO_LOG.d_proc)
847: THEN
848: PO_LOG.proc_begin(d_module_base);
849: PO_LOG.proc_begin(d_module_base,'p_api_version', p_api_version );
850: PO_LOG.proc_begin(d_module_base,'p_init_msg_list', p_init_msg_list);
844: END IF;
845:
846: IF (PO_LOG.d_proc)
847: THEN
848: PO_LOG.proc_begin(d_module_base);
849: PO_LOG.proc_begin(d_module_base,'p_api_version', p_api_version );
850: PO_LOG.proc_begin(d_module_base,'p_init_msg_list', p_init_msg_list);
851: PO_LOG.proc_begin(d_module_base,'p_commit', p_commit );
852: PO_LOG.proc_begin(d_module_base,'p_req_line_id', p_req_line_id );
845:
846: IF (PO_LOG.d_proc)
847: THEN
848: PO_LOG.proc_begin(d_module_base);
849: PO_LOG.proc_begin(d_module_base,'p_api_version', p_api_version );
850: PO_LOG.proc_begin(d_module_base,'p_init_msg_list', p_init_msg_list);
851: PO_LOG.proc_begin(d_module_base,'p_commit', p_commit );
852: PO_LOG.proc_begin(d_module_base,'p_req_line_id', p_req_line_id );
853: END IF;
846: IF (PO_LOG.d_proc)
847: THEN
848: PO_LOG.proc_begin(d_module_base);
849: PO_LOG.proc_begin(d_module_base,'p_api_version', p_api_version );
850: PO_LOG.proc_begin(d_module_base,'p_init_msg_list', p_init_msg_list);
851: PO_LOG.proc_begin(d_module_base,'p_commit', p_commit );
852: PO_LOG.proc_begin(d_module_base,'p_req_line_id', p_req_line_id );
853: END IF;
854:
847: THEN
848: PO_LOG.proc_begin(d_module_base);
849: PO_LOG.proc_begin(d_module_base,'p_api_version', p_api_version );
850: PO_LOG.proc_begin(d_module_base,'p_init_msg_list', p_init_msg_list);
851: PO_LOG.proc_begin(d_module_base,'p_commit', p_commit );
852: PO_LOG.proc_begin(d_module_base,'p_req_line_id', p_req_line_id );
853: END IF;
854:
855: --update the supply for existing requisition line and create
848: PO_LOG.proc_begin(d_module_base);
849: PO_LOG.proc_begin(d_module_base,'p_api_version', p_api_version );
850: PO_LOG.proc_begin(d_module_base,'p_init_msg_list', p_init_msg_list);
851: PO_LOG.proc_begin(d_module_base,'p_commit', p_commit );
852: PO_LOG.proc_begin(d_module_base,'p_req_line_id', p_req_line_id );
853: END IF;
854:
855: --update the supply for existing requisition line and create
856: --supply for the new lines
856: --supply for the new lines
857:
858: d_progress := 20;
859:
860: IF PO_LOG.d_stmt THEN
861: PO_LOG.stmt(d_module_base,d_progress,'Updating the requisition supply');
862: END IF;
863:
864: l_success := po_supply.po_req_supply(NULL,
857:
858: d_progress := 20;
859:
860: IF PO_LOG.d_stmt THEN
861: PO_LOG.stmt(d_module_base,d_progress,'Updating the requisition supply');
862: END IF;
863:
864: l_success := po_supply.po_req_supply(NULL,
865: p_req_line_id,
885: AND PRL2.requisition_line_id = p_req_line_id;
886:
887: FOR l_req_line_index IN 1 .. P_new_line_ids_tbl.COUNT
888: LOOP
889: IF PO_LOG.d_stmt THEN
890: PO_LOG.stmt(d_module_base,d_progress,'l_req_line_index',l_req_line_index);
891: PO_LOG.stmt(d_module_base,d_progress,'Coping attachments from old line to newly created lines');
892: END IF;
893:
886:
887: FOR l_req_line_index IN 1 .. P_new_line_ids_tbl.COUNT
888: LOOP
889: IF PO_LOG.d_stmt THEN
890: PO_LOG.stmt(d_module_base,d_progress,'l_req_line_index',l_req_line_index);
891: PO_LOG.stmt(d_module_base,d_progress,'Coping attachments from old line to newly created lines');
892: END IF;
893:
894: fnd_attached_documents2_pkg.copy_attachments(
887: FOR l_req_line_index IN 1 .. P_new_line_ids_tbl.COUNT
888: LOOP
889: IF PO_LOG.d_stmt THEN
890: PO_LOG.stmt(d_module_base,d_progress,'l_req_line_index',l_req_line_index);
891: PO_LOG.stmt(d_module_base,d_progress,'Coping attachments from old line to newly created lines');
892: END IF;
893:
894: fnd_attached_documents2_pkg.copy_attachments(
895: X_from_entity_name => g_REQ_LINES_ENTITY,
910: X_program_id => NULL,
911: X_request_id => NULL,
912: X_automatically_added_flag => NULL);
913:
914: IF PO_LOG.d_stmt THEN
915: PO_LOG.stmt(d_module_base,d_progress,'Creating a new distribution for ',p_new_line_ids_tbl(l_req_line_index));
916: END IF;
917: d_progress := 50;
918: --Create req distributions for the newly created line
911: X_request_id => NULL,
912: X_automatically_added_flag => NULL);
913:
914: IF PO_LOG.d_stmt THEN
915: PO_LOG.stmt(d_module_base,d_progress,'Creating a new distribution for ',p_new_line_ids_tbl(l_req_line_index));
916: END IF;
917: d_progress := 50;
918: --Create req distributions for the newly created line
919: PO_REQ_DIST_SV.create_dist_for_modify(
920: p_new_line_ids_tbl(l_req_line_index),
921: p_req_line_id,
922: l_quantity_table(l_req_line_index));
923:
924: IF PO_LOG.d_stmt THEN
925: PO_LOG.stmt(d_module_base,d_progress,'Succesfully created a new distribution for',p_new_line_ids_tbl(l_req_line_index));
926: END IF;
927: END LOOP;
928:
921: p_req_line_id,
922: l_quantity_table(l_req_line_index));
923:
924: IF PO_LOG.d_stmt THEN
925: PO_LOG.stmt(d_module_base,d_progress,'Succesfully created a new distribution for',p_new_line_ids_tbl(l_req_line_index));
926: END IF;
927: END LOOP;
928:
929: d_progress := 60;
932: into l_requisition_header_id
933: from po_requisition_lines_all
934: where requisition_line_id = p_req_line_id;
935:
936: IF PO_LOG.d_stmt THEN
937: PO_LOG.stmt(d_module_base,d_progress,'l_requisition_header_id',l_requisition_header_id);
938: END IF;
939: --Calculate the tax for the entire document again. The recoverable and non recoverable
940: --tax fields need to be updated appropriately.
933: from po_requisition_lines_all
934: where requisition_line_id = p_req_line_id;
935:
936: IF PO_LOG.d_stmt THEN
937: PO_LOG.stmt(d_module_base,d_progress,'l_requisition_header_id',l_requisition_header_id);
938: END IF;
939: --Calculate the tax for the entire document again. The recoverable and non recoverable
940: --tax fields need to be updated appropriately.
941: PO_TAX_INTERFACE_PVT.calculate_tax_requisition(
967: --Check if the current org has req encumbrance enabled.
968: --If it is enabled then handle funds reversal for the parent
969: --line and encumber the newly created line
970: d_progress := 70;
971: IF PO_LOG.d_stmt THEN
972: PO_LOG.stmt(d_module_base,d_progress,'Checking if requisition encumbrance is switched on');
973: END IF;
974:
975: SELECT nvl(req_encumbrance_flag, 'N')
968: --If it is enabled then handle funds reversal for the parent
969: --line and encumber the newly created line
970: d_progress := 70;
971: IF PO_LOG.d_stmt THEN
972: PO_LOG.stmt(d_module_base,d_progress,'Checking if requisition encumbrance is switched on');
973: END IF;
974:
975: SELECT nvl(req_encumbrance_flag, 'N')
976: INTO l_req_encumbrance_flag
975: SELECT nvl(req_encumbrance_flag, 'N')
976: INTO l_req_encumbrance_flag
977: FROM financials_system_parameters;
978:
979: IF PO_LOG.d_stmt THEN
980: PO_LOG.stmt(d_module_base,d_progress,'l_req_encumbrance_flag',l_req_encumbrance_flag);
981: END IF;
982:
983: --Select all the distribution lines which are to be reserved and
976: INTO l_req_encumbrance_flag
977: FROM financials_system_parameters;
978:
979: IF PO_LOG.d_stmt THEN
980: PO_LOG.stmt(d_module_base,d_progress,'l_req_encumbrance_flag',l_req_encumbrance_flag);
981: END IF;
982:
983: --Select all the distribution lines which are to be reserved and
984: --unreserved into a plsql table
995: end;
996:
997: if(l_req_encumbered_flag = 'Y')THEN
998: d_progress := 80;
999: IF PO_LOG.d_stmt THEN
1000: PO_LOG.stmt(d_module_base,d_progress,'Calling funds reversal');
1001: END IF;
1002: --Pass the distribution ids of the newly created lines to the
1003: --encumbrance api to reserve funds
996:
997: if(l_req_encumbered_flag = 'Y')THEN
998: d_progress := 80;
999: IF PO_LOG.d_stmt THEN
1000: PO_LOG.stmt(d_module_base,d_progress,'Calling funds reversal');
1001: END IF;
1002: --Pass the distribution ids of the newly created lines to the
1003: --encumbrance api to reserve funds
1004: call_funds_reversal(p_api_version => 1.0,
1009: p_req_line_id => p_req_line_id,
1010: p_handle_tax_flag => p_handle_tax_diff_if_enc,
1011: x_online_report_id => l_online_report_id);
1012:
1013: IF PO_LOG.d_stmt THEN
1014: PO_LOG.stmt(d_module_base,d_progress,'l_return_status'||l_return_status);
1015: END IF;
1016:
1017: IF (l_return_status = FND_API.g_ret_sts_error)
1010: p_handle_tax_flag => p_handle_tax_diff_if_enc,
1011: x_online_report_id => l_online_report_id);
1012:
1013: IF PO_LOG.d_stmt THEN
1014: PO_LOG.stmt(d_module_base,d_progress,'l_return_status'||l_return_status);
1015: END IF;
1016:
1017: IF (l_return_status = FND_API.g_ret_sts_error)
1018: THEN
1027: d_progress := 90;
1028:
1029: IF FND_API.To_Boolean(p_commit)
1030: THEN
1031: IF PO_LOG.d_event THEN
1032: PO_LOG.event(d_module_base,d_progress,'Commiting work');
1033: END IF;
1034: COMMIT WORK;
1035: END IF; --FND_API
1028:
1029: IF FND_API.To_Boolean(p_commit)
1030: THEN
1031: IF PO_LOG.d_event THEN
1032: PO_LOG.event(d_module_base,d_progress,'Commiting work');
1033: END IF;
1034: COMMIT WORK;
1035: END IF; --FND_API
1036:
1035: END IF; --FND_API
1036:
1037: x_return_status := FND_API.g_ret_sts_success;
1038:
1039: IF (PO_LOG.d_proc)
1040: THEN
1041: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
1042: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
1043: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
1037: x_return_status := FND_API.g_ret_sts_success;
1038:
1039: IF (PO_LOG.d_proc)
1040: THEN
1041: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
1042: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
1043: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
1044: END IF;
1045: EXCEPTION
1038:
1039: IF (PO_LOG.d_proc)
1040: THEN
1041: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
1042: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
1043: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
1044: END IF;
1045: EXCEPTION
1046: WHEN FND_API.g_exc_unexpected_error THEN
1039: IF (PO_LOG.d_proc)
1040: THEN
1041: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
1042: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
1043: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
1044: END IF;
1045: EXCEPTION
1046: WHEN FND_API.g_exc_unexpected_error THEN
1047: ROLLBACK TO post_requisition_lines_PVT;
1060: x_error_msg_tbl(x_error_msg_tbl.COUNT) := x_msg_data;
1061:
1062: x_return_status := FND_API.g_ret_sts_unexp_error;
1063:
1064: IF (PO_LOG.d_exc)
1065: THEN
1066: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
1067: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
1068: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
1062: x_return_status := FND_API.g_ret_sts_unexp_error;
1063:
1064: IF (PO_LOG.d_exc)
1065: THEN
1066: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
1067: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
1068: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
1069: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
1070: END IF;
1063:
1064: IF (PO_LOG.d_exc)
1065: THEN
1066: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
1067: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
1068: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
1069: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
1070: END IF;
1071: WHEN FND_API.g_exc_error THEN
1064: IF (PO_LOG.d_exc)
1065: THEN
1066: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
1067: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
1068: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
1069: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
1070: END IF;
1071: WHEN FND_API.g_exc_error THEN
1072: ROLLBACK TO post_requisition_lines_PVT;
1065: THEN
1066: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
1067: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
1068: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
1069: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
1070: END IF;
1071: WHEN FND_API.g_exc_error THEN
1072: ROLLBACK TO post_requisition_lines_PVT;
1073:
1094: --online report msgs onto the stack doesn't override the value set
1095: --by the exception handler.
1096: x_return_status := FND_API.g_ret_sts_error;
1097: --
1098: IF (PO_LOG.d_exc)
1099: THEN
1100: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
1101: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
1102: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
1096: x_return_status := FND_API.g_ret_sts_error;
1097: --
1098: IF (PO_LOG.d_exc)
1099: THEN
1100: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
1101: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
1102: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
1103: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
1104: END IF;
1097: --
1098: IF (PO_LOG.d_exc)
1099: THEN
1100: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
1101: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
1102: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
1103: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
1104: END IF;
1105: WHEN OTHERS THEN
1098: IF (PO_LOG.d_exc)
1099: THEN
1100: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
1101: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
1102: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
1103: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
1104: END IF;
1105: WHEN OTHERS THEN
1106: ROLLBACK TO post_requisition_lines_PVT;
1099: THEN
1100: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
1101: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
1102: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
1103: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
1104: END IF;
1105: WHEN OTHERS THEN
1106: ROLLBACK TO post_requisition_lines_PVT;
1107: BEGIN
1112: x_msg_data := FND_MESSAGE.get;
1113: x_error_msg_tbl.extend(1);
1114: x_error_msg_tbl(1) := x_msg_data;
1115: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1116: IF (PO_LOG.d_exc)
1117: THEN
1118: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
1119: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
1120: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
1114: x_error_msg_tbl(1) := x_msg_data;
1115: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1116: IF (PO_LOG.d_exc)
1117: THEN
1118: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
1119: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
1120: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
1121: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
1122: END IF;
1115: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1116: IF (PO_LOG.d_exc)
1117: THEN
1118: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
1119: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
1120: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
1121: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
1122: END IF;
1123: EXCEPTION
1116: IF (PO_LOG.d_exc)
1117: THEN
1118: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
1119: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
1120: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
1121: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
1122: END IF;
1123: EXCEPTION
1124: WHEN OTHERS THEN
1117: THEN
1118: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
1119: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
1120: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
1121: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
1122: END IF;
1123: EXCEPTION
1124: WHEN OTHERS THEN
1125: IF (PO_LOG.d_exc)
1121: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
1122: END IF;
1123: EXCEPTION
1124: WHEN OTHERS THEN
1125: IF (PO_LOG.d_exc)
1126: THEN
1127: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
1128: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
1129: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
1123: EXCEPTION
1124: WHEN OTHERS THEN
1125: IF (PO_LOG.d_exc)
1126: THEN
1127: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
1128: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
1129: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
1130: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
1131: END IF;
1124: WHEN OTHERS THEN
1125: IF (PO_LOG.d_exc)
1126: THEN
1127: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
1128: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
1129: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
1130: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
1131: END IF;
1132: RAISE;
1125: IF (PO_LOG.d_exc)
1126: THEN
1127: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
1128: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
1129: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
1130: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
1131: END IF;
1132: RAISE;
1133: END;
1126: THEN
1127: PO_LOG.exc(d_module_base,d_progress, SQLCODE || SQLERRM);
1128: PO_LOG.proc_end(d_module_base,'x_return_status', x_return_status);
1129: PO_LOG.proc_end(d_module_base,'x_msg_count', x_msg_count );
1130: PO_LOG.proc_end(d_module_base,'x_msg_data', x_msg_data );
1131: END IF;
1132: RAISE;
1133: END;
1134: END post_modify_requisition_lines;
1147: x_online_report_id OUT NOCOPY NUMBER) IS
1148: l_module CONSTANT VARCHAR2(30) := 'CALL_FUNDS_REVERSAL';
1149: l_api_version CONSTANT NUMBER := 1.0;
1150: d_progress NUMBER;
1151: d_module_base CONSTANT VARCHAR2(100) := PO_LOG.get_subprogram_base(d_PACKAGE_BASE,
1152: l_module);
1153: --define object type variable for calling encumbrance api.
1154: l_po_return_code VARCHAR2(20);
1155:
1158: d_progress := 10;
1159:
1160: SAVEPOINT CALL_FUNDS_REVERSAL_PVT;
1161:
1162: IF (PO_LOG.d_event) THEN
1163: PO_LOG.event(d_module_base,d_progress,'Starting calculate CALL_FUNDS_REVERSAL');
1164: END IF;
1165:
1166: IF (PO_LOG.d_proc) THEN
1159:
1160: SAVEPOINT CALL_FUNDS_REVERSAL_PVT;
1161:
1162: IF (PO_LOG.d_event) THEN
1163: PO_LOG.event(d_module_base,d_progress,'Starting calculate CALL_FUNDS_REVERSAL');
1164: END IF;
1165:
1166: IF (PO_LOG.d_proc) THEN
1167: PO_LOG.proc_begin(d_module_base, 'p_api_version', p_api_version);
1162: IF (PO_LOG.d_event) THEN
1163: PO_LOG.event(d_module_base,d_progress,'Starting calculate CALL_FUNDS_REVERSAL');
1164: END IF;
1165:
1166: IF (PO_LOG.d_proc) THEN
1167: PO_LOG.proc_begin(d_module_base, 'p_api_version', p_api_version);
1168: PO_LOG.proc_begin(d_module_base, 'p_commit', p_commit);
1169: PO_LOG.proc_begin(d_module_base, 'p_req_line_id', p_req_line_id);
1170: END IF;
1163: PO_LOG.event(d_module_base,d_progress,'Starting calculate CALL_FUNDS_REVERSAL');
1164: END IF;
1165:
1166: IF (PO_LOG.d_proc) THEN
1167: PO_LOG.proc_begin(d_module_base, 'p_api_version', p_api_version);
1168: PO_LOG.proc_begin(d_module_base, 'p_commit', p_commit);
1169: PO_LOG.proc_begin(d_module_base, 'p_req_line_id', p_req_line_id);
1170: END IF;
1171:
1164: END IF;
1165:
1166: IF (PO_LOG.d_proc) THEN
1167: PO_LOG.proc_begin(d_module_base, 'p_api_version', p_api_version);
1168: PO_LOG.proc_begin(d_module_base, 'p_commit', p_commit);
1169: PO_LOG.proc_begin(d_module_base, 'p_req_line_id', p_req_line_id);
1170: END IF;
1171:
1172: d_progress := 20;
1165:
1166: IF (PO_LOG.d_proc) THEN
1167: PO_LOG.proc_begin(d_module_base, 'p_api_version', p_api_version);
1168: PO_LOG.proc_begin(d_module_base, 'p_commit', p_commit);
1169: PO_LOG.proc_begin(d_module_base, 'p_req_line_id', p_req_line_id);
1170: END IF;
1171:
1172: d_progress := 20;
1173: IF NOT FND_API.Compatible_API_Call(l_api_version,
1173: IF NOT FND_API.Compatible_API_Call(l_api_version,
1174: p_api_version,
1175: l_module,
1176: G_PKG_NAME) THEN
1177: IF (PO_LOG.d_event) THEN
1178: PO_LOG.event(d_module_base, d_progress, 'Api versions incompatible. Throwing an exception');
1179: END IF;
1180: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1181: END IF;
1174: p_api_version,
1175: l_module,
1176: G_PKG_NAME) THEN
1177: IF (PO_LOG.d_event) THEN
1178: PO_LOG.event(d_module_base, d_progress, 'Api versions incompatible. Throwing an exception');
1179: END IF;
1180: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1181: END IF;
1182:
1181: END IF;
1182:
1183: d_progress := 30;
1184:
1185: IF PO_LOG.d_stmt THEN
1186: PO_LOG.stmt(d_module_base,d_progress,'Inserting values into po_req_split_lines_gt');
1187: END IF;
1188:
1189: -- Performance fix for bug 4930487
1182:
1183: d_progress := 30;
1184:
1185: IF PO_LOG.d_stmt THEN
1186: PO_LOG.stmt(d_module_base,d_progress,'Inserting values into po_req_split_lines_gt');
1187: END IF;
1188:
1189: -- Performance fix for bug 4930487
1190: -- Prevented FTS on po_requisition_lines_all by adding an exists clause
1212: AND PRL1.requisition_line_id = p_req_line_id);
1213:
1214:
1215: IF SQL%ROWCOUNT < 1 THEN
1216: IF PO_LOG.d_stmt THEN
1217: PO_LOG.stmt(d_module_base,d_progress,'No rows inserted into PO_REQ_SPLIT_LINES_GT');
1218: END IF;
1219:
1220: po_message_s.sql_error('No rows inserted into PO_REQ_SPLIT_LINES_GT', d_progress, sqlcode);
1213:
1214:
1215: IF SQL%ROWCOUNT < 1 THEN
1216: IF PO_LOG.d_stmt THEN
1217: PO_LOG.stmt(d_module_base,d_progress,'No rows inserted into PO_REQ_SPLIT_LINES_GT');
1218: END IF;
1219:
1220: po_message_s.sql_error('No rows inserted into PO_REQ_SPLIT_LINES_GT', d_progress, sqlcode);
1221: FND_MSG_PUB.add;
1222: RAISE FND_API.g_exc_unexpected_error;
1223: END IF;
1224:
1225: d_progress := 40;
1226: IF PO_LOG.d_stmt THEN
1227: PO_LOG.stmt(d_module_base,d_progress,'Handle Tax Adjustments');
1228: END IF;
1229:
1230: IF (p_handle_tax_flag = 'Y') THEN
1223: END IF;
1224:
1225: d_progress := 40;
1226: IF PO_LOG.d_stmt THEN
1227: PO_LOG.stmt(d_module_base,d_progress,'Handle Tax Adjustments');
1228: END IF;
1229:
1230: IF (p_handle_tax_flag = 'Y') THEN
1231: PO_NEGOTIATIONS4_PVT.handle_tax_adjustments(p_api_version => 1.0,
1233: x_return_status => x_return_status,
1234: x_msg_count => x_msg_count,
1235: x_msg_data => x_msg_data);
1236: IF (x_return_status <> 'S') THEN
1237: IF PO_LOG.d_stmt THEN
1238: PO_LOG.stmt(d_module_base,d_progress,'x_return_status',x_return_status);
1239: END IF;
1240: RAISE FND_API.g_exc_unexpected_error;
1241: END IF;
1234: x_msg_count => x_msg_count,
1235: x_msg_data => x_msg_data);
1236: IF (x_return_status <> 'S') THEN
1237: IF PO_LOG.d_stmt THEN
1238: PO_LOG.stmt(d_module_base,d_progress,'x_return_status',x_return_status);
1239: END IF;
1240: RAISE FND_API.g_exc_unexpected_error;
1241: END IF;
1242: END IF; /*IF (p_handle_tax_flag = 'Y')*/
1249: x_msg_count => x_msg_count,
1250: x_msg_data => x_msg_data,
1251: x_online_report_id => x_online_report_id);
1252:
1253: IF PO_LOG.d_stmt THEN
1254: PO_LOG.stmt(d_module_base, d_progress,'x_return_status',x_return_status);
1255: PO_LOG.stmt(d_module_base, d_progress,'l_po_return_code', l_po_return_code);
1256: PO_LOG.stmt(d_module_base, d_progress,'x_online_report_id', x_online_report_id);
1257: END IF;
1250: x_msg_data => x_msg_data,
1251: x_online_report_id => x_online_report_id);
1252:
1253: IF PO_LOG.d_stmt THEN
1254: PO_LOG.stmt(d_module_base, d_progress,'x_return_status',x_return_status);
1255: PO_LOG.stmt(d_module_base, d_progress,'l_po_return_code', l_po_return_code);
1256: PO_LOG.stmt(d_module_base, d_progress,'x_online_report_id', x_online_report_id);
1257: END IF;
1258:
1251: x_online_report_id => x_online_report_id);
1252:
1253: IF PO_LOG.d_stmt THEN
1254: PO_LOG.stmt(d_module_base, d_progress,'x_return_status',x_return_status);
1255: PO_LOG.stmt(d_module_base, d_progress,'l_po_return_code', l_po_return_code);
1256: PO_LOG.stmt(d_module_base, d_progress,'x_online_report_id', x_online_report_id);
1257: END IF;
1258:
1259: IF (x_return_status = FND_API.g_ret_sts_error) THEN
1252:
1253: IF PO_LOG.d_stmt THEN
1254: PO_LOG.stmt(d_module_base, d_progress,'x_return_status',x_return_status);
1255: PO_LOG.stmt(d_module_base, d_progress,'l_po_return_code', l_po_return_code);
1256: PO_LOG.stmt(d_module_base, d_progress,'x_online_report_id', x_online_report_id);
1257: END IF;
1258:
1259: IF (x_return_status = FND_API.g_ret_sts_error) THEN
1260: RAISE FND_API.g_exc_error;
1264:
1265: d_progress := 60;
1266:
1267: IF FND_API.To_Boolean(p_commit) THEN
1268: IF PO_LOG.d_event THEN
1269: PO_LOG.event(d_module_base, d_progress, 'Commiting work');
1270: END IF;
1271: COMMIT WORK;
1272: END IF;
1265: d_progress := 60;
1266:
1267: IF FND_API.To_Boolean(p_commit) THEN
1268: IF PO_LOG.d_event THEN
1269: PO_LOG.event(d_module_base, d_progress, 'Commiting work');
1270: END IF;
1271: COMMIT WORK;
1272: END IF;
1273:
1277: x_return_status := FND_API.G_RET_STS_SUCCESS;
1278:
1279: d_progress := 70;
1280:
1281: IF (PO_LOG.d_proc) THEN
1282: PO_LOG.proc_end(d_module_base, 'x_return_status', x_return_status);
1283: PO_LOG.proc_end(d_module_base, 'x_msg_count', x_msg_count);
1284: PO_LOG.proc_end(d_module_base, 'x_msg_data', x_msg_data);
1285: PO_LOG.proc_end(d_module_base,'x_online_report_id',x_online_report_id);
1278:
1279: d_progress := 70;
1280:
1281: IF (PO_LOG.d_proc) THEN
1282: PO_LOG.proc_end(d_module_base, 'x_return_status', x_return_status);
1283: PO_LOG.proc_end(d_module_base, 'x_msg_count', x_msg_count);
1284: PO_LOG.proc_end(d_module_base, 'x_msg_data', x_msg_data);
1285: PO_LOG.proc_end(d_module_base,'x_online_report_id',x_online_report_id);
1286: END IF;
1279: d_progress := 70;
1280:
1281: IF (PO_LOG.d_proc) THEN
1282: PO_LOG.proc_end(d_module_base, 'x_return_status', x_return_status);
1283: PO_LOG.proc_end(d_module_base, 'x_msg_count', x_msg_count);
1284: PO_LOG.proc_end(d_module_base, 'x_msg_data', x_msg_data);
1285: PO_LOG.proc_end(d_module_base,'x_online_report_id',x_online_report_id);
1286: END IF;
1287:
1280:
1281: IF (PO_LOG.d_proc) THEN
1282: PO_LOG.proc_end(d_module_base, 'x_return_status', x_return_status);
1283: PO_LOG.proc_end(d_module_base, 'x_msg_count', x_msg_count);
1284: PO_LOG.proc_end(d_module_base, 'x_msg_data', x_msg_data);
1285: PO_LOG.proc_end(d_module_base,'x_online_report_id',x_online_report_id);
1286: END IF;
1287:
1288: EXCEPTION
1281: IF (PO_LOG.d_proc) THEN
1282: PO_LOG.proc_end(d_module_base, 'x_return_status', x_return_status);
1283: PO_LOG.proc_end(d_module_base, 'x_msg_count', x_msg_count);
1284: PO_LOG.proc_end(d_module_base, 'x_msg_data', x_msg_data);
1285: PO_LOG.proc_end(d_module_base,'x_online_report_id',x_online_report_id);
1286: END IF;
1287:
1288: EXCEPTION
1289:
1293:
1294: x_msg_data := FND_MSG_PUB.GET();
1295: x_return_status := FND_API.g_ret_sts_unexp_error;
1296:
1297: IF (PO_LOG.d_exc) THEN
1298: PO_LOG.exc(d_module_base, d_progress, SQLCODE || SQLERRM);
1299: PO_LOG.proc_end(d_module_base, 'x_return_status', x_return_status);
1300: PO_LOG.proc_end(d_module_base, 'x_msg_count', x_msg_count);
1301: PO_LOG.proc_end(d_module_base, 'x_msg_data', x_msg_data);
1294: x_msg_data := FND_MSG_PUB.GET();
1295: x_return_status := FND_API.g_ret_sts_unexp_error;
1296:
1297: IF (PO_LOG.d_exc) THEN
1298: PO_LOG.exc(d_module_base, d_progress, SQLCODE || SQLERRM);
1299: PO_LOG.proc_end(d_module_base, 'x_return_status', x_return_status);
1300: PO_LOG.proc_end(d_module_base, 'x_msg_count', x_msg_count);
1301: PO_LOG.proc_end(d_module_base, 'x_msg_data', x_msg_data);
1302: PO_LOG.proc_end(d_module_base,'x_online_report_id',x_online_report_id);
1295: x_return_status := FND_API.g_ret_sts_unexp_error;
1296:
1297: IF (PO_LOG.d_exc) THEN
1298: PO_LOG.exc(d_module_base, d_progress, SQLCODE || SQLERRM);
1299: PO_LOG.proc_end(d_module_base, 'x_return_status', x_return_status);
1300: PO_LOG.proc_end(d_module_base, 'x_msg_count', x_msg_count);
1301: PO_LOG.proc_end(d_module_base, 'x_msg_data', x_msg_data);
1302: PO_LOG.proc_end(d_module_base,'x_online_report_id',x_online_report_id);
1303: END IF;
1296:
1297: IF (PO_LOG.d_exc) THEN
1298: PO_LOG.exc(d_module_base, d_progress, SQLCODE || SQLERRM);
1299: PO_LOG.proc_end(d_module_base, 'x_return_status', x_return_status);
1300: PO_LOG.proc_end(d_module_base, 'x_msg_count', x_msg_count);
1301: PO_LOG.proc_end(d_module_base, 'x_msg_data', x_msg_data);
1302: PO_LOG.proc_end(d_module_base,'x_online_report_id',x_online_report_id);
1303: END IF;
1304:
1297: IF (PO_LOG.d_exc) THEN
1298: PO_LOG.exc(d_module_base, d_progress, SQLCODE || SQLERRM);
1299: PO_LOG.proc_end(d_module_base, 'x_return_status', x_return_status);
1300: PO_LOG.proc_end(d_module_base, 'x_msg_count', x_msg_count);
1301: PO_LOG.proc_end(d_module_base, 'x_msg_data', x_msg_data);
1302: PO_LOG.proc_end(d_module_base,'x_online_report_id',x_online_report_id);
1303: END IF;
1304:
1305: WHEN FND_API.g_exc_error THEN
1298: PO_LOG.exc(d_module_base, d_progress, SQLCODE || SQLERRM);
1299: PO_LOG.proc_end(d_module_base, 'x_return_status', x_return_status);
1300: PO_LOG.proc_end(d_module_base, 'x_msg_count', x_msg_count);
1301: PO_LOG.proc_end(d_module_base, 'x_msg_data', x_msg_data);
1302: PO_LOG.proc_end(d_module_base,'x_online_report_id',x_online_report_id);
1303: END IF;
1304:
1305: WHEN FND_API.g_exc_error THEN
1306:
1310:
1311: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
1312: p_data => x_msg_data);
1313:
1314: IF (PO_LOG.d_exc) THEN
1315: PO_LOG.exc(d_module_base, d_progress, SQLCODE || SQLERRM);
1316: PO_LOG.proc_end(d_module_base, 'x_return_status', x_return_status);
1317: PO_LOG.proc_end(d_module_base, 'x_msg_count', x_msg_count);
1318: PO_LOG.proc_end(d_module_base, 'x_msg_data', x_msg_data);
1311: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
1312: p_data => x_msg_data);
1313:
1314: IF (PO_LOG.d_exc) THEN
1315: PO_LOG.exc(d_module_base, d_progress, SQLCODE || SQLERRM);
1316: PO_LOG.proc_end(d_module_base, 'x_return_status', x_return_status);
1317: PO_LOG.proc_end(d_module_base, 'x_msg_count', x_msg_count);
1318: PO_LOG.proc_end(d_module_base, 'x_msg_data', x_msg_data);
1319: PO_LOG.proc_end(d_module_base,'x_online_report_id', x_online_report_id);
1312: p_data => x_msg_data);
1313:
1314: IF (PO_LOG.d_exc) THEN
1315: PO_LOG.exc(d_module_base, d_progress, SQLCODE || SQLERRM);
1316: PO_LOG.proc_end(d_module_base, 'x_return_status', x_return_status);
1317: PO_LOG.proc_end(d_module_base, 'x_msg_count', x_msg_count);
1318: PO_LOG.proc_end(d_module_base, 'x_msg_data', x_msg_data);
1319: PO_LOG.proc_end(d_module_base,'x_online_report_id', x_online_report_id);
1320: END IF;
1313:
1314: IF (PO_LOG.d_exc) THEN
1315: PO_LOG.exc(d_module_base, d_progress, SQLCODE || SQLERRM);
1316: PO_LOG.proc_end(d_module_base, 'x_return_status', x_return_status);
1317: PO_LOG.proc_end(d_module_base, 'x_msg_count', x_msg_count);
1318: PO_LOG.proc_end(d_module_base, 'x_msg_data', x_msg_data);
1319: PO_LOG.proc_end(d_module_base,'x_online_report_id', x_online_report_id);
1320: END IF;
1321:
1314: IF (PO_LOG.d_exc) THEN
1315: PO_LOG.exc(d_module_base, d_progress, SQLCODE || SQLERRM);
1316: PO_LOG.proc_end(d_module_base, 'x_return_status', x_return_status);
1317: PO_LOG.proc_end(d_module_base, 'x_msg_count', x_msg_count);
1318: PO_LOG.proc_end(d_module_base, 'x_msg_data', x_msg_data);
1319: PO_LOG.proc_end(d_module_base,'x_online_report_id', x_online_report_id);
1320: END IF;
1321:
1322: WHEN OTHERS THEN
1315: PO_LOG.exc(d_module_base, d_progress, SQLCODE || SQLERRM);
1316: PO_LOG.proc_end(d_module_base, 'x_return_status', x_return_status);
1317: PO_LOG.proc_end(d_module_base, 'x_msg_count', x_msg_count);
1318: PO_LOG.proc_end(d_module_base, 'x_msg_data', x_msg_data);
1319: PO_LOG.proc_end(d_module_base,'x_online_report_id', x_online_report_id);
1320: END IF;
1321:
1322: WHEN OTHERS THEN
1323:
1331:
1332: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
1333: p_data => x_msg_data);
1334:
1335: IF (PO_LOG.d_exc) THEN
1336: PO_LOG.exc(d_module_base, d_progress, SQLCODE || SQLERRM);
1337: PO_LOG.proc_end(d_module_base, 'x_return_status', x_return_status);
1338: PO_LOG.proc_end(d_module_base, 'x_msg_count', x_msg_count);
1339: PO_LOG.proc_end(d_module_base, 'x_msg_data', x_msg_data);
1332: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count,
1333: p_data => x_msg_data);
1334:
1335: IF (PO_LOG.d_exc) THEN
1336: PO_LOG.exc(d_module_base, d_progress, SQLCODE || SQLERRM);
1337: PO_LOG.proc_end(d_module_base, 'x_return_status', x_return_status);
1338: PO_LOG.proc_end(d_module_base, 'x_msg_count', x_msg_count);
1339: PO_LOG.proc_end(d_module_base, 'x_msg_data', x_msg_data);
1340: PO_LOG.proc_end(d_module_base, 'x_online_report_id', x_online_report_id);
1333: p_data => x_msg_data);
1334:
1335: IF (PO_LOG.d_exc) THEN
1336: PO_LOG.exc(d_module_base, d_progress, SQLCODE || SQLERRM);
1337: PO_LOG.proc_end(d_module_base, 'x_return_status', x_return_status);
1338: PO_LOG.proc_end(d_module_base, 'x_msg_count', x_msg_count);
1339: PO_LOG.proc_end(d_module_base, 'x_msg_data', x_msg_data);
1340: PO_LOG.proc_end(d_module_base, 'x_online_report_id', x_online_report_id);
1341:
1334:
1335: IF (PO_LOG.d_exc) THEN
1336: PO_LOG.exc(d_module_base, d_progress, SQLCODE || SQLERRM);
1337: PO_LOG.proc_end(d_module_base, 'x_return_status', x_return_status);
1338: PO_LOG.proc_end(d_module_base, 'x_msg_count', x_msg_count);
1339: PO_LOG.proc_end(d_module_base, 'x_msg_data', x_msg_data);
1340: PO_LOG.proc_end(d_module_base, 'x_online_report_id', x_online_report_id);
1341:
1342: END IF;
1335: IF (PO_LOG.d_exc) THEN
1336: PO_LOG.exc(d_module_base, d_progress, SQLCODE || SQLERRM);
1337: PO_LOG.proc_end(d_module_base, 'x_return_status', x_return_status);
1338: PO_LOG.proc_end(d_module_base, 'x_msg_count', x_msg_count);
1339: PO_LOG.proc_end(d_module_base, 'x_msg_data', x_msg_data);
1340: PO_LOG.proc_end(d_module_base, 'x_online_report_id', x_online_report_id);
1341:
1342: END IF;
1343:
1336: PO_LOG.exc(d_module_base, d_progress, SQLCODE || SQLERRM);
1337: PO_LOG.proc_end(d_module_base, 'x_return_status', x_return_status);
1338: PO_LOG.proc_end(d_module_base, 'x_msg_count', x_msg_count);
1339: PO_LOG.proc_end(d_module_base, 'x_msg_data', x_msg_data);
1340: PO_LOG.proc_end(d_module_base, 'x_online_report_id', x_online_report_id);
1341:
1342: END IF;
1343:
1344: END call_funds_reversal;