11: -- p_api_version IN NUMBER (required)
12: -- API Version of this procedure
13: --
14: -- p_init_msg_list IN VARCHAR2 (optional)
15: -- DEFAULT = FND_API.G_FALSE,
16: --
17: -- p_commit IN VARCHAR2 (optional)
18: -- DEFAULT = FND_API.G_FALSE
19: --
14: -- p_init_msg_list IN VARCHAR2 (optional)
15: -- DEFAULT = FND_API.G_FALSE,
16: --
17: -- p_commit IN VARCHAR2 (optional)
18: -- DEFAULT = FND_API.G_FALSE
19: --
20: --
21: -- OUT :
22: -- x_return_status OUT NUMBER
35: -- Notes :
36: -- END OF comments
37: PROCEDURE ExecCheck (
38: p_api_version IN NUMBER ,
39: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
40: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
41: x_return_status IN OUT NOCOPY VARCHAR2,
42: x_msg_count IN OUT NOCOPY NUMBER,
43: x_msg_data IN OUT NOCOPY VARCHAR2,
36: -- END OF comments
37: PROCEDURE ExecCheck (
38: p_api_version IN NUMBER ,
39: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
40: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
41: x_return_status IN OUT NOCOPY VARCHAR2,
42: x_msg_count IN OUT NOCOPY NUMBER,
43: x_msg_data IN OUT NOCOPY VARCHAR2,
44: p_sum_detail_flag IN NUMBER,
62: AND organization_id = p_organization_id;
63: --
64: BEGIN
65: -- Standard Call to check for call compatibility
66: IF NOT FND_API.Compatible_API_Call(l_api_version
67: , p_api_version
68: , l_api_name
69: , G_PKG_NAME) THEN
70: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
66: IF NOT FND_API.Compatible_API_Call(l_api_version
67: , p_api_version
68: , l_api_name
69: , G_PKG_NAME) THEN
70: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
71: END IF;
72: --
73: -- Initialize message list if p_init_msg_list is set to true
74: IF FND_API.to_Boolean(p_init_msg_list) THEN
70: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
71: END IF;
72: --
73: -- Initialize message list if p_init_msg_list is set to true
74: IF FND_API.to_Boolean(p_init_msg_list) THEN
75: FND_MSG_PUB.initialize;
76: END IF;
77: --
78: -- Initialize API return status to access
75: FND_MSG_PUB.initialize;
76: END IF;
77: --
78: -- Initialize API return status to access
79: x_return_status := FND_API.G_RET_STS_SUCCESS;
80: --
81: -- Validate p_inventory_item_id if not null or statement type is summary
82: IF p_inventory_item_id IS NOT NULL OR p_sum_detail_flag = 2 THEN
83: OPEN L_Item_crs ( p_organization_id,
86: IF L_Item_crs%NOTFOUND THEN
87: FND_MESSAGE.SET_NAME('INV','INV_SHORT_ITEM_NOT_FOUND');
88: FND_MESSAGE.SET_TOKEN('INVENTORY_ITEM_ID',TO_CHAR(p_inventory_item_id));
89: FND_MSG_PUB.Add;
90: RAISE FND_API.G_EXC_ERROR;
91: END IF;
92: CLOSE L_Item_crs;
93: END IF;
94: --
108: x_check_result => x_check_result
109: );
110: --
111: -- Standard check of p_commit
112: IF FND_API.to_Boolean(p_commit) THEN
113: COMMIT;
114: END IF;
115: -- Standard call to get message count and if count is 1, get message info
116: FND_MSG_PUB.Count_And_Get
116: FND_MSG_PUB.Count_And_Get
117: (p_count => x_msg_count
118: , p_data => x_msg_data);
119: EXCEPTION
120: WHEN FND_API.G_EXC_ERROR THEN
121: --
122: x_return_status := FND_API.G_RET_STS_ERROR;
123: --
124: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
118: , p_data => x_msg_data);
119: EXCEPTION
120: WHEN FND_API.G_EXC_ERROR THEN
121: --
122: x_return_status := FND_API.G_RET_STS_ERROR;
123: --
124: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
125: , p_data => x_msg_data);
126: --
123: --
124: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
125: , p_data => x_msg_data);
126: --
127: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
128: --
129: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
130: --
131: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
125: , p_data => x_msg_data);
126: --
127: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
128: --
129: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
130: --
131: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
132: , p_data => x_msg_data);
133: --
132: , p_data => x_msg_data);
133: --
134: WHEN OTHERS THEN
135: --
136: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
137: --
138: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
139: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
140: END IF;
152: -- p_api_version IN NUMBER (required)
153: -- API Version of this procedure
154: --
155: -- p_init_msg_list IN VARCHAR2 (optional)
156: -- DEFAULT = FND_API.G_FALSE,
157: --
158: -- p_commit IN VARCHAR2 (optional)
159: -- DEFAULT = FND_API.G_FALSE
160: --
155: -- p_init_msg_list IN VARCHAR2 (optional)
156: -- DEFAULT = FND_API.G_FALSE,
157: --
158: -- p_commit IN VARCHAR2 (optional)
159: -- DEFAULT = FND_API.G_FALSE
160: --
161: --
162: -- OUT :
163: -- x_return_status OUT NUMBER
174: -- Notes :
175: -- END OF comments
176: PROCEDURE CheckPrerequisites (
177: p_api_version IN NUMBER ,
178: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
179: x_return_status IN OUT NOCOPY VARCHAR2,
180: x_msg_count IN OUT NOCOPY NUMBER,
181: x_msg_data IN OUT NOCOPY VARCHAR2,
182: p_sum_detail_flag IN NUMBER,
203: WHERE transaction_type_id = p_transaction_type_id;
204: --
205: BEGIN
206: -- Standard Call to check for call compatibility
207: IF NOT FND_API.Compatible_API_Call(l_api_version
208: , p_api_version
209: , l_api_name
210: , G_PKG_NAME) THEN
211: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
207: IF NOT FND_API.Compatible_API_Call(l_api_version
208: , p_api_version
209: , l_api_name
210: , G_PKG_NAME) THEN
211: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
212: END IF;
213: --
214: -- Initialize message list if p_init_msg_list is set to true
215: IF FND_API.to_Boolean(p_init_msg_list) THEN
211: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
212: END IF;
213: --
214: -- Initialize message list if p_init_msg_list is set to true
215: IF FND_API.to_Boolean(p_init_msg_list) THEN
216: FND_MSG_PUB.initialize;
217: END IF;
218: --
219: -- Initialize API return status to access
216: FND_MSG_PUB.initialize;
217: END IF;
218: --
219: -- Initialize API return status to access
220: x_return_status := FND_API.G_RET_STS_SUCCESS;
221: --
222: -- Validate p_inventory_item_id
223: OPEN L_Item_crs ( p_organization_id,
224: p_inventory_item_id );
226: IF L_Item_crs%NOTFOUND THEN
227: FND_MESSAGE.SET_NAME('INV','INV_ITEM_NOT_FOUND');
228: FND_MESSAGE.SET_TOKEN('INVENTORY_ITEM_ID',TO_CHAR(p_inventory_item_id));
229: FND_MSG_PUB.Add;
230: RAISE FND_API.G_EXC_ERROR;
231: END IF;
232: CLOSE L_Item_crs;
233: --
234: -- Validate p_transaction_type_id
239: FND_MESSAGE.SET_NAME('INV','INV_TRANSACTION_TYPE_NOT_FOUND');
240: FND_MESSAGE.SET_TOKEN('TRANSACTION_TYPE_ID',
241: TO_CHAR(p_transaction_type_id));
242: FND_MSG_PUB.Add;
243: RAISE FND_API.G_EXC_ERROR;
244: END IF;
245: CLOSE L_TransType_crs;
246: END IF;
247: --
262: FND_MSG_PUB.Count_And_Get
263: (p_count => x_msg_count
264: , p_data => x_msg_data);
265: EXCEPTION
266: WHEN FND_API.G_EXC_ERROR THEN
267: --
268: x_return_status := FND_API.G_RET_STS_ERROR;
269: --
270: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
264: , p_data => x_msg_data);
265: EXCEPTION
266: WHEN FND_API.G_EXC_ERROR THEN
267: --
268: x_return_status := FND_API.G_RET_STS_ERROR;
269: --
270: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
271: , p_data => x_msg_data);
272: --
269: --
270: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
271: , p_data => x_msg_data);
272: --
273: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
274: --
275: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
276: --
277: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
271: , p_data => x_msg_data);
272: --
273: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
274: --
275: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
276: --
277: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
278: , p_data => x_msg_data);
279: --
278: , p_data => x_msg_data);
279: --
280: WHEN OTHERS THEN
281: --
282: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
283: --
284: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
285: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
286: END IF;
298: -- p_api_version IN NUMBER (required)
299: -- API Version of this procedure
300: --
301: -- p_init_msg_list IN VARCHAR2 (optional)
302: -- DEFAULT = FND_API.G_FALSE,
303: --
304: -- p_commit IN VARCHAR2 (optional)
305: -- DEFAULT = FND_API.G_FALSE
306: --
301: -- p_init_msg_list IN VARCHAR2 (optional)
302: -- DEFAULT = FND_API.G_FALSE,
303: --
304: -- p_commit IN VARCHAR2 (optional)
305: -- DEFAULT = FND_API.G_FALSE
306: --
307: -- p_seq_num IN NUMBER
308: -- Sequence number of rows which have to be deleted
309: --
324: -- Notes :
325: -- END OF comments
326: PROCEDURE PurgeTempTable (
327: p_api_version IN NUMBER ,
328: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
329: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
330: x_return_status IN OUT NOCOPY VARCHAR2,
331: x_msg_count IN OUT NOCOPY NUMBER,
332: x_msg_data IN OUT NOCOPY VARCHAR2,
325: -- END OF comments
326: PROCEDURE PurgeTempTable (
327: p_api_version IN NUMBER ,
328: p_init_msg_list IN VARCHAR2 DEFAULT FND_API.G_FALSE,
329: p_commit IN VARCHAR2 DEFAULT FND_API.G_FALSE,
330: x_return_status IN OUT NOCOPY VARCHAR2,
331: x_msg_count IN OUT NOCOPY NUMBER,
332: x_msg_data IN OUT NOCOPY VARCHAR2,
333: p_seq_num IN NUMBER
336: L_api_version CONSTANT NUMBER := 1.0;
337: L_api_name CONSTANT VARCHAR2(30) := 'PurgeTempTable';
338: BEGIN
339: -- Standard Call to check for call compatibility
340: IF NOT FND_API.Compatible_API_Call(l_api_version
341: , p_api_version
342: , l_api_name
343: , G_PKG_NAME) THEN
344: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
340: IF NOT FND_API.Compatible_API_Call(l_api_version
341: , p_api_version
342: , l_api_name
343: , G_PKG_NAME) THEN
344: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
345: END IF;
346: --
347: -- Initialize message list if p_init_msg_list is set to true
348: IF FND_API.to_Boolean(p_init_msg_list) THEN
344: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
345: END IF;
346: --
347: -- Initialize message list if p_init_msg_list is set to true
348: IF FND_API.to_Boolean(p_init_msg_list) THEN
349: FND_MSG_PUB.initialize;
350: END IF;
351: --
352: -- Initialize API return status to access
349: FND_MSG_PUB.initialize;
350: END IF;
351: --
352: -- Initialize API return status to access
353: x_return_status := FND_API.G_RET_STS_SUCCESS;
354: --
355: INV_ShortCheckExec_PVT.PurgeTempTable (
356: p_api_version => 1.0,
357: p_init_msg_list => p_init_msg_list,
362: p_seq_num => p_seq_num
363: );
364: --
365: -- Standard check of p_commit
366: IF FND_API.to_Boolean(p_commit) THEN
367: COMMIT;
368: END IF;
369: -- Standard call to get message count and if count is 1, get message info
370: FND_MSG_PUB.Count_And_Get
370: FND_MSG_PUB.Count_And_Get
371: (p_count => x_msg_count
372: , p_data => x_msg_data);
373: EXCEPTION
374: WHEN FND_API.G_EXC_ERROR THEN
375: --
376: x_return_status := FND_API.G_RET_STS_ERROR;
377: --
378: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
372: , p_data => x_msg_data);
373: EXCEPTION
374: WHEN FND_API.G_EXC_ERROR THEN
375: --
376: x_return_status := FND_API.G_RET_STS_ERROR;
377: --
378: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
379: , p_data => x_msg_data);
380: --
377: --
378: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
379: , p_data => x_msg_data);
380: --
381: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
382: --
383: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
384: --
385: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
379: , p_data => x_msg_data);
380: --
381: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
382: --
383: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
384: --
385: FND_MSG_PUB.Count_And_Get(p_count => x_msg_count
386: , p_data => x_msg_data);
387: --
386: , p_data => x_msg_data);
387: --
388: WHEN OTHERS THEN
389: --
390: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
391: --
392: IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
393: FND_MSG_PUB.Add_Exc_Msg(G_PKG_NAME, l_api_name);
394: END IF;