93: WHERE header_id = l_header_id;
94:
95: BEGIN
96:
97: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
98: IBE_Util.Debug('Begin IBE_CANCEL_ORDER_PVT.CANCEL_ORDER()');
99: END IF;
100:
101: -- Standard Start of API savepoint
94:
95: BEGIN
96:
97: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
98: IBE_Util.Debug('Begin IBE_CANCEL_ORDER_PVT.CANCEL_ORDER()');
99: END IF;
100:
101: -- Standard Start of API savepoint
102: SAVEPOINT CANCEL_Order_PUB;
115: IF FND_API.To_Boolean(p_init_msg_list) THEN
116: FND_Msg_Pub.initialize;
117: END IF;
118:
119: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
120: IBE_UTIL.DEBUG('IBE_CANCEL_ORDER_PVT.CANCEL_ORDER:START');
121: END IF;
122:
123:
116: FND_Msg_Pub.initialize;
117: END IF;
118:
119: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
120: IBE_UTIL.DEBUG('IBE_CANCEL_ORDER_PVT.CANCEL_ORDER:START');
121: END IF;
122:
123:
124:
140: OPEN c_ord(p_order_header_id);
141: FETCH c_ord into l_order_orgid;
142: CLOSE c_ord;
143:
144: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
145: IBE_UTIL.DEBUG('User Context - ORG_ID : '||TO_CHAR(l_user_orgid));
146: IBE_UTIL.DEBUG('OrderContext - ORG_ID : '||TO_CHAR(l_order_orgid));
147: END IF;
148:
141: FETCH c_ord into l_order_orgid;
142: CLOSE c_ord;
143:
144: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
145: IBE_UTIL.DEBUG('User Context - ORG_ID : '||TO_CHAR(l_user_orgid));
146: IBE_UTIL.DEBUG('OrderContext - ORG_ID : '||TO_CHAR(l_order_orgid));
147: END IF;
148:
149: IF l_order_orgid <> l_user_orgid THEN
142: CLOSE c_ord;
143:
144: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
145: IBE_UTIL.DEBUG('User Context - ORG_ID : '||TO_CHAR(l_user_orgid));
146: IBE_UTIL.DEBUG('OrderContext - ORG_ID : '||TO_CHAR(l_order_orgid));
147: END IF;
148:
149: IF l_order_orgid <> l_user_orgid THEN
150:
147: END IF;
148:
149: IF l_order_orgid <> l_user_orgid THEN
150:
151: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
152: IBE_UTIL.DEBUG('Before ORG_ID Switch to Orders ORG_ID');
153: END IF;
154:
155: -- Set the Session's ORGID to the Order's ORG_ID, before calling the Process_Order() API
148:
149: IF l_order_orgid <> l_user_orgid THEN
150:
151: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
152: IBE_UTIL.DEBUG('Before ORG_ID Switch to Orders ORG_ID');
153: END IF;
154:
155: -- Set the Session's ORGID to the Order's ORG_ID, before calling the Process_Order() API
156: -- i.e Set the Global Security Context to that of the original Order Creator's ORG_ID
155: -- Set the Session's ORGID to the Order's ORG_ID, before calling the Process_Order() API
156: -- i.e Set the Global Security Context to that of the original Order Creator's ORG_ID
157: mo_global.set_policy_context('S', l_order_orgid);
158:
159: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
160: IBE_UTIL.DEBUG('After ORG_ID Switch to Orders ORG_ID : '|| mo_global.GET_CURRENT_ORG_ID());
161: END IF;
162:
163: END IF; -- End of (l_order_orgid <> l_user_orgid) condition
156: -- i.e Set the Global Security Context to that of the original Order Creator's ORG_ID
157: mo_global.set_policy_context('S', l_order_orgid);
158:
159: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
160: IBE_UTIL.DEBUG('After ORG_ID Switch to Orders ORG_ID : '|| mo_global.GET_CURRENT_ORG_ID());
161: END IF;
162:
163: END IF; -- End of (l_order_orgid <> l_user_orgid) condition
164:
181: l_header_rec.operation := OE_Globals.G_OPR_UPDATE;
182: --
183: -- API body
184: --
185: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
186: IBE_UTIL.DEBUG('OE_Order_GRP.Process_Order:START');
187: END IF;
188: OE_Order_GRP.Process_Order
189: (p_api_version_number => 1.0,
182: --
183: -- API body
184: --
185: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
186: IBE_UTIL.DEBUG('OE_Order_GRP.Process_Order:START');
187: END IF;
188: OE_Order_GRP.Process_Order
189: (p_api_version_number => 1.0,
190: p_init_msg_list => FND_API.G_TRUE,
215: x_Lot_Serial_tbl => l_lot_serial_tbl,
216: x_Lot_Serial_val_tbl => l_lot_serial_val_tbl,
217: x_action_request_tbl => l_action_request_tbl
218: );
219: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
220: IBE_UTIL.DEBUG('OE_Order_GRP.Process_Order:Finishes');
221: END IF;
222:
223: -- Check return status from the above procedure call
216: x_Lot_Serial_val_tbl => l_lot_serial_val_tbl,
217: x_action_request_tbl => l_action_request_tbl
218: );
219: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
220: IBE_UTIL.DEBUG('OE_Order_GRP.Process_Order:Finishes');
221: END IF;
222:
223: -- Check return status from the above procedure call
224:
228: raise FND_API.G_EXC_UNEXPECTED_ERROR;
229: END IF;
230: if x_return_status = FND_API.G_RET_STS_SUCCESS then
231: -- call Notification api.
232: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
233: IBE_UTIL.DEBUG('Ready to call Notification API:IBE_WORKFLOW_PVT.Notify_cancel_order');
234: IBE_UTIL.DEBUG('Input order id to notification API is: '||p_order_header_id);
235: END IF;
236: IBE_WORKFLOW_PVT.Notify_cancel_order(
229: END IF;
230: if x_return_status = FND_API.G_RET_STS_SUCCESS then
231: -- call Notification api.
232: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
233: IBE_UTIL.DEBUG('Ready to call Notification API:IBE_WORKFLOW_PVT.Notify_cancel_order');
234: IBE_UTIL.DEBUG('Input order id to notification API is: '||p_order_header_id);
235: END IF;
236: IBE_WORKFLOW_PVT.Notify_cancel_order(
237: p_api_version => 1.0,
230: if x_return_status = FND_API.G_RET_STS_SUCCESS then
231: -- call Notification api.
232: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
233: IBE_UTIL.DEBUG('Ready to call Notification API:IBE_WORKFLOW_PVT.Notify_cancel_order');
234: IBE_UTIL.DEBUG('Input order id to notification API is: '||p_order_header_id);
235: END IF;
236: IBE_WORKFLOW_PVT.Notify_cancel_order(
237: p_api_version => 1.0,
238: p_init_msg_list => FND_API.G_FALSE,
240: x_return_status => x_return_status,
241: x_msg_count => x_msg_count,
242: x_msg_data => x_msg_data
243: );
244: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
245: IBE_UTIL.DEBUG('Done Notification API:IBE_WORKFLOW_PVT.Notify_cancel_order');
246: END IF;
247: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
248: RAISE FND_API.G_EXC_ERROR;
241: x_msg_count => x_msg_count,
242: x_msg_data => x_msg_data
243: );
244: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
245: IBE_UTIL.DEBUG('Done Notification API:IBE_WORKFLOW_PVT.Notify_cancel_order');
246: END IF;
247: IF x_return_status = FND_API.G_RET_STS_ERROR THEN
248: RAISE FND_API.G_EXC_ERROR;
249: END IF;
258: IF l_order_orgid <> l_user_orgid THEN
259:
260: mo_global.set_policy_context('S', l_user_orgid);
261:
262: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
263: IBE_UTIL.DEBUG('Restored the ORG_ID to the Users ORG_ID: '|| mo_global.GET_CURRENT_ORG_ID());
264: END IF;
265:
266: END IF;
259:
260: mo_global.set_policy_context('S', l_user_orgid);
261:
262: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
263: IBE_UTIL.DEBUG('Restored the ORG_ID to the Users ORG_ID: '|| mo_global.GET_CURRENT_ORG_ID());
264: END IF;
265:
266: END IF;
267:
273: IF FND_API.to_Boolean( l_commit ) THEN
274: COMMIT WORK;
275: END IF;
276:
277: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
278: IBE_UTIL.DEBUG('IBE_CANCEL_ORDER_PVT.CANCEL_ORDER:DONE');
279: END IF;
280:
281: -- Standard call to get message count and if count is 1, get message info.
274: COMMIT WORK;
275: END IF;
276:
277: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
278: IBE_UTIL.DEBUG('IBE_CANCEL_ORDER_PVT.CANCEL_ORDER:DONE');
279: END IF;
280:
281: -- Standard call to get message count and if count is 1, get message info.
282: FND_MSG_PUB.Count_And_Get ( p_count => x_msg_count,
295: IF l_order_orgid <> l_user_orgid THEN
296:
297: mo_global.set_policy_context('S', l_user_orgid);
298:
299: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
300: IBE_UTIL.DEBUG('Restored the ORG_ID to the Users ORG_ID: '|| mo_global.GET_CURRENT_ORG_ID());
301: END IF;
302:
303: END IF;
296:
297: mo_global.set_policy_context('S', l_user_orgid);
298:
299: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
300: IBE_UTIL.DEBUG('Restored the ORG_ID to the Users ORG_ID: '|| mo_global.GET_CURRENT_ORG_ID());
301: END IF;
302:
303: END IF;
304:
301: END IF;
302:
303: END IF;
304:
305: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
306: IBE_Util.Debug('End IBE_CANCEL_ORDER_PVT.CANCEL_ORDER()');
307: END IF;
308:
309: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
302:
303: END IF;
304:
305: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
306: IBE_Util.Debug('End IBE_CANCEL_ORDER_PVT.CANCEL_ORDER()');
307: END IF;
308:
309: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
310: ROLLBACK TO CANCEL_Order_PUB;
316: IF l_order_orgid <> l_user_orgid THEN
317:
318: mo_global.set_policy_context('S', l_user_orgid);
319:
320: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
321: IBE_UTIL.DEBUG('Restored the ORG_ID to the Users ORG_ID: '|| mo_global.GET_CURRENT_ORG_ID());
322: END IF;
323:
324: END IF;
317:
318: mo_global.set_policy_context('S', l_user_orgid);
319:
320: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
321: IBE_UTIL.DEBUG('Restored the ORG_ID to the Users ORG_ID: '|| mo_global.GET_CURRENT_ORG_ID());
322: END IF;
323:
324: END IF;
325:
322: END IF;
323:
324: END IF;
325:
326: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
327: IBE_Util.Debug('End IBE_CANCEL_ORDER_PVT.CANCEL_ORDER()');
328: END IF;
329:
330: WHEN OTHERS THEN
323:
324: END IF;
325:
326: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
327: IBE_Util.Debug('End IBE_CANCEL_ORDER_PVT.CANCEL_ORDER()');
328: END IF;
329:
330: WHEN OTHERS THEN
331: -- changes for retrieving OM messages
345: IF l_order_orgid <> l_user_orgid THEN
346:
347: mo_global.set_policy_context('S', l_user_orgid);
348:
349: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
350: IBE_UTIL.DEBUG('Restored the ORG_ID to the Users ORG_ID: '|| mo_global.GET_CURRENT_ORG_ID());
351: END IF;
352:
353: END IF;
346:
347: mo_global.set_policy_context('S', l_user_orgid);
348:
349: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
350: IBE_UTIL.DEBUG('Restored the ORG_ID to the Users ORG_ID: '|| mo_global.GET_CURRENT_ORG_ID());
351: END IF;
352:
353: END IF;
354:
351: END IF;
352:
353: END IF;
354:
355: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
356: IBE_Util.Debug('End IBE_CANCEL_ORDER_PVT.CANCEL_ORDER()');
357: END IF;
358:
359:
352:
353: END IF;
354:
355: IF (IBE_UTIL.G_DEBUGON = l_true) THEN
356: IBE_Util.Debug('End IBE_CANCEL_ORDER_PVT.CANCEL_ORDER()');
357: END IF;
358:
359:
360: END CANCEL_ORDER;