DBA Data[Home] [Help]

PACKAGE BODY: APPS.IGC_CC_PO_DIST_ALL_PVT

Source


1 PACKAGE BODY IGC_CC_PO_DIST_ALL_PVT AS
2 /*$Header: IGCCPDTB.pls 120.4.12010000.2 2008/12/11 09:10:08 gaprasad ship $*/
3 
4   G_PKG_NAME CONSTANT VARCHAR2(30):= 'IGC_CC_PO_DIST_ALL_PVT';
5 
6   -- The flag determines whether to print debug information or not.
7   g_debug_flag        VARCHAR2(1) := 'N' ;
8 
9 
10 /*=======================================================================+
11  |                       PROCEDURE Insert_Row                            |
12  +=======================================================================*/
13 PROCEDURE Insert_Row
14 (
15   p_api_version               IN       NUMBER,
16   p_init_msg_list             IN       VARCHAR2 := FND_API.G_FALSE,
17   p_commit                    IN       VARCHAR2 := FND_API.G_FALSE,
18   p_validation_level          IN       NUMBER   := FND_API.G_VALID_LEVEL_FULL,
19   x_return_status             OUT NOCOPY      VARCHAR2,
20   x_msg_count                 OUT NOCOPY      NUMBER,
21   x_msg_data                  OUT NOCOPY      VARCHAR2,
22   ---------------------------------------------
23   p_po_dist_rec               IN       po_distributions_all%ROWTYPE
24 )
25 IS
26 
27 	l_api_name            CONSTANT VARCHAR2(30)   := 'Insert_Row';
28 	l_api_version         CONSTANT NUMBER         :=  1.0;
29 
30 BEGIN
31 
32 	SAVEPOINT Insert_Row_Pvt ;
33 
34 	IF NOT FND_API.Compatible_API_Call ( l_api_version,
35                                              p_api_version,
36                                              l_api_name,
37                                              G_PKG_NAME )
38 	THEN
39 		RAISE FND_API.G_EXC_UNEXPECTED_ERROR ;
40 	END IF;
41 
42 
43 	IF FND_API.to_Boolean ( p_init_msg_list )
44 	THEN
45 		FND_MSG_PUB.initialize ;
46 	END IF;
47 
48 	x_return_status := FND_API.G_RET_STS_SUCCESS ;
49 
50 
51         -- Added column distribution_type when inserting in
52         -- po_distributions_all. This as as part of the
53         -- changes PO have done in PRC.FP.J (3173178)
54         -- PO Standalone patch 3205071 is a pre-req for this change
55         -- Bidisha S, 23 Oct 2003
56 	INSERT INTO po_distributions_all (
57 	po_distribution_id,
58 	last_update_date,
59 	last_updated_by,
60 	po_header_id,
61 	po_line_id,
62 	line_location_id ,
63 	set_of_books_id ,
64 	code_combination_id,
65 	quantity_ordered,
66 	last_update_login,
67 	creation_date,
68 	created_by,
69 	po_release_id ,
70 	quantity_delivered,
71 	quantity_billed,
72 	quantity_cancelled ,
73 	req_header_reference_num ,
74 	req_line_reference_num ,
75 	req_distribution_id,
76 	deliver_to_location_id ,
77 	deliver_to_person_id ,
78 	rate_date ,
79 	rate,
80 	amount_billed ,
81 	accrued_flag ,
82 	encumbered_flag ,
83 	encumbered_amount ,
84 	unencumbered_quantity ,
85 	unencumbered_amount ,
86 	failed_funds_lookup_code ,
87 	gl_encumbered_date ,
88 	gl_encumbered_period_name ,
89 	gl_cancelled_date ,
90 	destination_type_code ,
91 	destination_organization_id ,
92 	destination_subinventory ,
93 	attribute_category ,
94 	attribute1 ,
95 	attribute2 ,
96 	attribute3 ,
97 	attribute4 ,
98 	attribute5 ,
99 	attribute6 ,
100 	attribute7 ,
101 	attribute8 ,
102 	attribute9  ,
103 	attribute10 ,
104 	attribute11 ,
105 	attribute12 ,
106 	attribute13 ,
107 	attribute14 ,
108 	attribute15 ,
109 	wip_entity_id ,
110 	wip_operation_seq_num ,
111 	wip_resource_seq_num ,
112 	wip_repetitive_schedule_id ,
113 	wip_line_id ,
114 	bom_resource_id ,
115 	budget_account_id ,
116 	accrual_account_id ,
117 	variance_account_id ,
118 	prevent_encumbrance_flag ,
119 	ussgl_transaction_code ,
120 	government_context  ,
121 	destination_context ,
122 	distribution_num  ,
123 	source_distribution_id ,
124 	request_id ,
125 	program_application_id ,
126 	program_id ,
127 	program_update_date ,
128 	project_id ,
129 	task_id ,
130 	expenditure_type ,
131 	project_accounting_context ,
132 	expenditure_organization_id ,
133 	gl_closed_date  ,
134 	accrue_on_receipt_flag  ,
135 	expenditure_item_date  ,
136 	org_id  ,
137 	kanban_card_id  ,
138 	award_id  ,
139 	mrc_rate_date  ,
140 	mrc_rate  ,
141 	mrc_encumbered_amount  ,
142 	mrc_unencumbered_amount  ,
143 	end_item_unit_number ,
144 	recoverable_tax  ,
145 	nonrecoverable_tax  ,
146 	recovery_rate ,
147 	tax_recovery_override_flag  ,
148         distribution_type
149         /*,
150 	base_amount_billed  ,
151 	tax_recovery_rate  ,
152 	mrc_base_amount_billed*/)
153 	VALUES
154 	(
155 	p_po_dist_rec.po_distribution_id,
156 	p_po_dist_rec.last_update_date,
157 	p_po_dist_rec.last_updated_by,
158 	p_po_dist_rec.po_header_id,
159 	p_po_dist_rec.po_line_id,
160 	p_po_dist_rec.line_location_id ,
161 	p_po_dist_rec.set_of_books_id ,
162 	p_po_dist_rec.code_combination_id,
163 	p_po_dist_rec.quantity_ordered,
164 	p_po_dist_rec.last_update_login,
165 	p_po_dist_rec.creation_date,
166 	p_po_dist_rec.created_by,
167 	p_po_dist_rec.po_release_id ,
168 	p_po_dist_rec.quantity_delivered,
169 	p_po_dist_rec.quantity_billed,
170 	p_po_dist_rec.quantity_cancelled ,
171 	p_po_dist_rec.req_header_reference_num ,
172 	p_po_dist_rec.req_line_reference_num ,
173 	p_po_dist_rec.req_distribution_id,
174 	p_po_dist_rec.deliver_to_location_id ,
175 	p_po_dist_rec.deliver_to_person_id ,
176 	p_po_dist_rec.rate_date ,
177 	p_po_dist_rec.rate,
178 	p_po_dist_rec.amount_billed ,
179 	p_po_dist_rec.accrued_flag ,
180 	p_po_dist_rec.encumbered_flag ,
181 	p_po_dist_rec.encumbered_amount ,
182 	p_po_dist_rec.unencumbered_quantity ,
183 	p_po_dist_rec.unencumbered_amount ,
184 	p_po_dist_rec.failed_funds_lookup_code ,
185 	p_po_dist_rec.gl_encumbered_date ,
186 	p_po_dist_rec.gl_encumbered_period_name ,
187 	p_po_dist_rec.gl_cancelled_date ,
188 	p_po_dist_rec.destination_type_code ,
189 	p_po_dist_rec.destination_organization_id ,
190 	p_po_dist_rec.destination_subinventory ,
191 	p_po_dist_rec.attribute_category ,
192 	p_po_dist_rec.attribute1 ,
193 	p_po_dist_rec.attribute2 ,
194 	p_po_dist_rec.attribute3 ,
195 	p_po_dist_rec.attribute4 ,
196 	p_po_dist_rec.attribute5 ,
197 	p_po_dist_rec.attribute6 ,
198 	p_po_dist_rec.attribute7 ,
199 	p_po_dist_rec.attribute8 ,
200 	p_po_dist_rec.attribute9  ,
201 	p_po_dist_rec.attribute10 ,
202 	p_po_dist_rec.attribute11 ,
203 	p_po_dist_rec.attribute12 ,
204 	p_po_dist_rec.attribute13 ,
205 	p_po_dist_rec.attribute14 ,
206 	p_po_dist_rec.attribute15 ,
207 	p_po_dist_rec.wip_entity_id ,
208 	p_po_dist_rec.wip_operation_seq_num ,
209 	p_po_dist_rec.wip_resource_seq_num ,
210 	p_po_dist_rec.wip_repetitive_schedule_id ,
211 	p_po_dist_rec.wip_line_id ,
212 	p_po_dist_rec.bom_resource_id ,
213 	p_po_dist_rec.budget_account_id ,
214 	p_po_dist_rec.accrual_account_id ,
215 	p_po_dist_rec.variance_account_id ,
216 	p_po_dist_rec.prevent_encumbrance_flag ,
217 	p_po_dist_rec.ussgl_transaction_code ,
218 	p_po_dist_rec.government_context  ,
219 	p_po_dist_rec.destination_context ,
220 	p_po_dist_rec.distribution_num  ,
221 	p_po_dist_rec.source_distribution_id ,
222 	p_po_dist_rec.request_id ,
223 	p_po_dist_rec.program_application_id ,
224 	p_po_dist_rec.program_id ,
225 	p_po_dist_rec.program_update_date ,
226 	p_po_dist_rec.project_id ,
227 	p_po_dist_rec.task_id ,
228 	p_po_dist_rec.expenditure_type ,
229 	p_po_dist_rec.project_accounting_context ,
230 	p_po_dist_rec.expenditure_organization_id ,
231 	p_po_dist_rec.gl_closed_date,
232 	p_po_dist_rec.accrue_on_receipt_flag  ,
233 	p_po_dist_rec.expenditure_item_date  ,
234 	p_po_dist_rec.org_id  ,
235 	p_po_dist_rec.kanban_card_id  ,
236 	p_po_dist_rec.award_id  ,
237 	p_po_dist_rec.mrc_rate_date  ,
238 	p_po_dist_rec.mrc_rate  ,
239 	p_po_dist_rec.mrc_encumbered_amount  ,
240 	p_po_dist_rec.mrc_unencumbered_amount  ,
241 	p_po_dist_rec.end_item_unit_number ,
242 	p_po_dist_rec.recoverable_tax  ,
243 	p_po_dist_rec.nonrecoverable_tax  ,
244 	p_po_dist_rec.recovery_rate ,
245 	p_po_dist_rec.tax_recovery_override_flag ,
246         p_po_dist_rec.distribution_type/* ,
247 	p_po_dist_rec.base_amount_billed  ,
248 	p_po_dist_rec.tax_recovery_rate  ,
249 	p_po_dist_rec.mrc_base_amount_billed*/);
250 
251 	IF FND_API.To_Boolean ( p_commit )
252 	THEN
253 		COMMIT WORK;
254 	END IF;
255 
256 	FND_MSG_PUB.Count_And_Get ( p_count => x_msg_count,
257                                     p_data  => x_msg_data );
258 
259 EXCEPTION
260 
261 	WHEN FND_API.G_EXC_ERROR
262 	THEN
263 
264 		ROLLBACK TO Insert_Row_Pvt ;
265 		x_return_status := FND_API.G_RET_STS_ERROR;
266 		FND_MSG_PUB.Count_And_Get ( p_count => x_msg_count,
267                                             p_data  => x_msg_data );
268 
269 	WHEN FND_API.G_EXC_UNEXPECTED_ERROR
270 	THEN
271 		ROLLBACK TO Insert_Row_Pvt ;
272 		x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
273 		FND_MSG_PUB.Count_And_Get ( p_count => x_msg_count,
274                                 	    p_data  => x_msg_data );
275 
276 	WHEN OTHERS
277 	THEN
278 		ROLLBACK TO Insert_Row_Pvt ;
279 		x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
280 
281 		IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
282 		THEN
283 			FND_MSG_PUB.Add_Exc_Msg ( G_PKG_NAME,
284                                                   l_api_name);
285 		END IF;
286 
287 		FND_MSG_PUB.Count_And_Get ( p_count => x_msg_count,
288                                             p_data  => x_msg_data );
289 
290 END Insert_Row;
291 /*-------------------------------------------------------------------------*/
292 
293 /*==========================================================================+
294  |                       PROCEDURE Update_Row                               |
295  +==========================================================================*/
296 PROCEDURE Update_Row
297 (
298   p_api_version               IN       NUMBER,
299   p_init_msg_list             IN       VARCHAR2 := FND_API.G_FALSE,
300   p_commit                    IN       VARCHAR2 := FND_API.G_FALSE,
301   p_validation_level          IN       NUMBER   := FND_API.G_VALID_LEVEL_FULL,
302   x_return_status             OUT NOCOPY      VARCHAR2,
303   x_msg_count                 OUT NOCOPY      NUMBER,
304   x_msg_data                  OUT NOCOPY      VARCHAR2,
305   ---------------------------------------------
306   p_po_dist_rec               IN       po_distributions_all%ROWTYPE
307 
308 )
309 IS
310 
311 	l_api_name            CONSTANT VARCHAR2(30)   := 'Update_Row';
312 	l_api_version         CONSTANT NUMBER         :=  1.0;
313 
314 BEGIN
315 
316 	SAVEPOINT Update_Row_Pvt ;
317 
318 	IF NOT FND_API.Compatible_API_Call ( l_api_version,
319                                              p_api_version,
320                                              l_api_name,
321                                              G_PKG_NAME )
322 	THEN
323 		RAISE FND_API.G_EXC_UNEXPECTED_ERROR ;
324 	END IF;
325 
326 
327 	IF FND_API.to_Boolean ( p_init_msg_list )
328 	THEN
329 		FND_MSG_PUB.initialize ;
330 	END IF;
331 
332 	x_return_status := FND_API.G_RET_STS_SUCCESS ;
333 
334         /* update */
335 	UPDATE po_distributions_all
336         SET
337 		last_update_date                    = p_po_dist_rec.last_update_date,
338 		last_updated_by                     = p_po_dist_rec.last_updated_by,
339 		po_header_id                        = p_po_dist_rec.po_header_id,
340 		po_line_id                          = p_po_dist_rec.po_line_id,
341 		line_location_id                    = p_po_dist_rec.line_location_id ,
342 		set_of_books_id                     = p_po_dist_rec.set_of_books_id ,
343 		code_combination_id                 = p_po_dist_rec.code_combination_id,
344 		quantity_ordered                    = p_po_dist_rec.quantity_ordered,
345 		last_update_login                   = p_po_dist_rec.last_update_login,
346 		creation_date                       = p_po_dist_rec.creation_date,
347 		created_by                          = p_po_dist_rec.created_by,
348 		po_release_id                       = p_po_dist_rec.po_release_id ,
349 		quantity_delivered                  = p_po_dist_rec.quantity_delivered,
350 		quantity_billed                     = p_po_dist_rec.quantity_billed,
351 		quantity_cancelled                  = p_po_dist_rec.quantity_cancelled ,
352 		req_header_reference_num            = p_po_dist_rec.req_header_reference_num ,
353 		req_line_reference_num              = p_po_dist_rec.req_line_reference_num ,
354 		req_distribution_id                 = p_po_dist_rec.req_distribution_id,
355 		deliver_to_location_id              = p_po_dist_rec.deliver_to_location_id ,
356 		deliver_to_person_id                = p_po_dist_rec.deliver_to_person_id ,
357 		rate_date                           = p_po_dist_rec.rate_date ,
358 		rate                                = p_po_dist_rec.rate,
359 		amount_billed                       = p_po_dist_rec.amount_billed ,
360 		accrued_flag                        = p_po_dist_rec.accrued_flag ,
361 		encumbered_flag                     = p_po_dist_rec.encumbered_flag ,
362 		encumbered_amount                   = p_po_dist_rec.encumbered_amount ,
363 		unencumbered_quantity               = p_po_dist_rec.unencumbered_quantity ,
364 		unencumbered_amount                 = p_po_dist_rec.unencumbered_amount ,
365 		failed_funds_lookup_code            = p_po_dist_rec.failed_funds_lookup_code ,
366 		gl_encumbered_date                  = p_po_dist_rec.gl_encumbered_date ,
367 		gl_encumbered_period_name           = p_po_dist_rec.gl_encumbered_period_name ,
368 		gl_cancelled_date                   = p_po_dist_rec.gl_cancelled_date ,
369 		destination_type_code               = p_po_dist_rec.destination_type_code ,
370 		destination_organization_id         = p_po_dist_rec.destination_organization_id ,
371 		destination_subinventory            = p_po_dist_rec.destination_subinventory ,
372 		attribute_category                  = p_po_dist_rec.attribute_category ,
373 		attribute1                          = p_po_dist_rec.attribute1 ,
374 		attribute2                          = p_po_dist_rec.attribute2 ,
375 		attribute3                          = p_po_dist_rec.attribute3 ,
376 		attribute4                          = p_po_dist_rec.attribute4 ,
377 		attribute5                          = p_po_dist_rec.attribute5 ,
378 		attribute6                          = p_po_dist_rec.attribute6 ,
379 		attribute7                          = p_po_dist_rec.attribute7 ,
380 		attribute8                          = p_po_dist_rec.attribute8 ,
381 		attribute9                          = p_po_dist_rec.attribute9  ,
382 		attribute10                         = p_po_dist_rec.attribute10 ,
383 		attribute11                         = p_po_dist_rec.attribute11 ,
384 		attribute12                         = p_po_dist_rec.attribute12 ,
385 		attribute13                         = p_po_dist_rec.attribute13 ,
386 		attribute14                         = p_po_dist_rec.attribute14 ,
387 		attribute15                         = p_po_dist_rec.attribute15 ,
388 		wip_entity_id                       = p_po_dist_rec.wip_entity_id ,
389 		wip_operation_seq_num               = p_po_dist_rec.wip_operation_seq_num ,
390 		wip_resource_seq_num                = p_po_dist_rec.wip_resource_seq_num ,
391 		wip_repetitive_schedule_id          = p_po_dist_rec.wip_repetitive_schedule_id ,
392 		wip_line_id                         = p_po_dist_rec.wip_line_id ,
393 		bom_resource_id                     = p_po_dist_rec.bom_resource_id ,
394 		budget_account_id                   = p_po_dist_rec.budget_account_id ,
395 		accrual_account_id                  = p_po_dist_rec.accrual_account_id ,
396 		variance_account_id                 = p_po_dist_rec.variance_account_id ,
397 		prevent_encumbrance_flag            = p_po_dist_rec.prevent_encumbrance_flag ,
398 		ussgl_transaction_code              = p_po_dist_rec.ussgl_transaction_code ,
399 		government_context                  = p_po_dist_rec.government_context  ,
400 		destination_context                 = p_po_dist_rec.destination_context ,
401 		distribution_num                    = p_po_dist_rec.distribution_num  ,
402 		source_distribution_id              = p_po_dist_rec.source_distribution_id ,
403 		request_id                          = p_po_dist_rec.request_id ,
404 		program_application_id              = p_po_dist_rec.program_application_id ,
405 		program_id                          = p_po_dist_rec.program_id ,
406 		program_update_date                 = p_po_dist_rec.program_update_date ,
407 		project_id                          = p_po_dist_rec.project_id ,
408 		task_id                             = p_po_dist_rec.task_id ,
409 		expenditure_type                    = p_po_dist_rec.expenditure_type ,
410 		project_accounting_context          = p_po_dist_rec.project_accounting_context ,
411 		expenditure_organization_id         = p_po_dist_rec.expenditure_organization_id ,
412 		gl_closed_date                      = p_po_dist_rec.gl_closed_date  ,
413 		accrue_on_receipt_flag              = p_po_dist_rec.accrue_on_receipt_flag  ,
414 		expenditure_item_date               = p_po_dist_rec.expenditure_item_date  ,
415 		org_id                              = p_po_dist_rec.org_id  ,
416 		kanban_card_id                      = p_po_dist_rec.kanban_card_id  ,
417 		award_id                            = p_po_dist_rec.award_id  ,
418 		mrc_rate_date                       = p_po_dist_rec.mrc_rate_date  ,
419 		mrc_rate                            = p_po_dist_rec.mrc_rate  ,
420 		mrc_encumbered_amount               = p_po_dist_rec.mrc_encumbered_amount  ,
421 		mrc_unencumbered_amount             = p_po_dist_rec.mrc_unencumbered_amount  ,
422 		end_item_unit_number                = p_po_dist_rec.end_item_unit_number ,
423 		recoverable_tax                     = p_po_dist_rec.recoverable_tax  ,
424 		nonrecoverable_tax                  = p_po_dist_rec.nonrecoverable_tax  ,
425 		recovery_rate                       = p_po_dist_rec.recovery_rate ,
426 		tax_recovery_override_flag          = p_po_dist_rec.tax_recovery_override_flag  /*,
427 		base_amount_billed                  = p_po_dist_rec.base_amount_billed  ,
428 		tax_recovery_rate                   = p_po_dist_rec.tax_recovery_rate  ,
429 		mrc_base_amount_billed              = p_po_dist_rec.mrc_base_amount_billed*/
430 	WHERE
431 		po_distribution_id = p_po_dist_rec.po_distribution_id;
432 
433 
434 	IF (SQL%NOTFOUND)
435 	THEN
436 		RAISE NO_DATA_FOUND ;
437 	END IF;
438 
439 
440 	IF FND_API.To_Boolean ( p_commit )
441 	THEN
442 		COMMIT WORK;
443 	END IF;
444 
445 	FND_MSG_PUB.Count_And_Get ( p_count => x_msg_count,
446                                     p_data  => x_msg_data );
447 
448 EXCEPTION
449 
450 	WHEN FND_API.G_EXC_ERROR
451 	THEN
452 		ROLLBACK TO Update_Row_Pvt ;
453 		x_return_status := FND_API.G_RET_STS_ERROR;
454 
455 		FND_MSG_PUB.Count_And_Get ( p_count => x_msg_count,
456                                             p_data  => x_msg_data );
457 
458 	WHEN FND_API.G_EXC_UNEXPECTED_ERROR
459 	THEN
460 
461 		ROLLBACK TO Update_Row_Pvt ;
462 		x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
463 		FND_MSG_PUB.Count_And_Get ( p_count => x_msg_count,
464                                             p_data  => x_msg_data );
465 
466 	WHEN OTHERS
467 	THEN
468 
469 		ROLLBACK TO Update_Row_Pvt ;
470 		x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
471 
472 		IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
473 		THEN
474 			FND_MSG_PUB.Add_Exc_Msg ( G_PKG_NAME,
475                                                   l_api_name);
476 		END IF;
477 
478 		FND_MSG_PUB.Count_And_Get ( p_count => x_msg_count,
479                                             p_data  => x_msg_data );
480 
481 END Update_Row;
482 
483 /*ADDED DELETE PROCEDURE FOR BUG 7492389 */
484 
485 /*==========================================================================+
486  |                       PROCEDURE Delete_Row                               |
487  +==========================================================================*/
488 PROCEDURE Delete_Row
489 (
490   p_api_version               IN       NUMBER,
491   p_init_msg_list             IN       VARCHAR2 := FND_API.G_FALSE,
492   p_commit                    IN       VARCHAR2 := FND_API.G_FALSE,
493   p_validation_level          IN       NUMBER   := FND_API.G_VALID_LEVEL_FULL,
494   x_return_status             OUT NOCOPY      VARCHAR2,
495   x_msg_count                 OUT NOCOPY      NUMBER,
496   x_msg_data                  OUT NOCOPY      VARCHAR2,
497   ---------------------------------------------
498   p_po_distribution_id        IN       po_distributions_all.po_distribution_id%TYPE
499 )
500 IS
501 
502 	l_api_name            CONSTANT VARCHAR2(30)   := 'Delete_Row';
503 	l_api_version         CONSTANT NUMBER         :=  1.0;
504 
505 BEGIN
506 
507 	SAVEPOINT Delete_Row_Pvt ;
508 
509 	IF NOT FND_API.Compatible_API_Call ( l_api_version,
510                                              p_api_version,
511                                              l_api_name,
512                                              G_PKG_NAME )
513 	THEN
514 		RAISE FND_API.G_EXC_UNEXPECTED_ERROR ;
515 	END IF;
516 
517 
518 	IF FND_API.to_Boolean ( p_init_msg_list )
519 	THEN
520 		FND_MSG_PUB.initialize ;
521 	END IF;
522 
523 	x_return_status := FND_API.G_RET_STS_SUCCESS ;
524 
525 	DELETE FROM po_distributions_all
526       WHERE
527       po_distribution_id = p_po_distribution_id;
528 
529 
530 	IF (SQL%NOTFOUND)
531 	THEN
532 		RAISE NO_DATA_FOUND ;
533 	END IF;
534 
535 
536 	IF FND_API.To_Boolean ( p_commit )
537 	THEN
538 		COMMIT WORK;
539 	END IF;
540 
541 	FND_MSG_PUB.Count_And_Get ( p_count => x_msg_count,
542                                     p_data  => x_msg_data );
543 
544 EXCEPTION
545 
546 	WHEN FND_API.G_EXC_ERROR
547 	THEN
548 		ROLLBACK TO Delete_Row_Pvt ;
549 		x_return_status := FND_API.G_RET_STS_ERROR;
550 
551 		FND_MSG_PUB.Count_And_Get ( p_count => x_msg_count,
552                                             p_data  => x_msg_data );
553 
554 	WHEN FND_API.G_EXC_UNEXPECTED_ERROR
555 	THEN
556 
557 		ROLLBACK TO Delete_Row_Pvt ;
558 		x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
559 		FND_MSG_PUB.Count_And_Get ( p_count => x_msg_count,
560                                             p_data  => x_msg_data );
561 
562 	WHEN OTHERS
563 	THEN
564 
565 		ROLLBACK TO Delete_Row_Pvt ;
566 		x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
567 
568 		IF FND_MSG_PUB.Check_Msg_Level (FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
569 		THEN
570 			FND_MSG_PUB.Add_Exc_Msg ( G_PKG_NAME,
571                                                   l_api_name);
572 		END IF;
573 
574 		FND_MSG_PUB.Count_And_Get ( p_count => x_msg_count,
575                                             p_data  => x_msg_data );
576 
577 END Delete_Row;
578 
579 /* ----------------------------------------------------------------------- */
580 
581 END IGC_CC_PO_DIST_ALL_PVT;