66: -- Initialze variables
67:
68: l_amount := 16383;
69: l_offset := 1;
70: l_return_status := fnd_api.g_ret_sts_success;
71: l_msg_count := 0;
72:
73: /* check if to_amount is greater than or equal to from_amount */
74:
75: If (p_from_amount is not null and p_to_amount < p_from_amount ) then
76:
77: l_error_message := 'CST_INVALID_TO_AMOUNT';
78: fnd_message.set_name('BOM','CST_INVALID_TO_AMOUNT');
79: RAISE fnd_api.g_exc_error;
80: End If;
81:
82:
83: /* check if aging bucket is greater than zero */
85: If (p_aging_days < 0 ) then
86:
87: l_error_message := 'CST_INVALID_AGE';
88: fnd_message.set_name('BOM','CST_INVALID_AGE');
89: RAISE fnd_api.g_exc_error;
90: End If;
91:
92:
93: -- select the operating unit for which the program is launched.
145: -- XML data
146: /*========================================================================*/
147:
148: Add_Parameters (p_api_version => l_api_version,
149: p_init_msg_list => FND_API.G_FALSE,
150: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
151: x_return_status => l_return_status,
152: x_msg_count => l_msg_count,
153: x_msg_data => l_msg_data,
146: /*========================================================================*/
147:
148: Add_Parameters (p_api_version => l_api_version,
149: p_init_msg_list => FND_API.G_FALSE,
150: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
151: x_return_status => l_return_status,
152: x_msg_count => l_msg_count,
153: x_msg_data => l_msg_data,
154: i_title => p_title,
165: x_xml_doc => l_xml_doc);
166:
167: -- Standard call to check the return status from API called
168:
169: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
170: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
171: END IF;
172:
173:
166:
167: -- Standard call to check the return status from API called
168:
169: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
170: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
171: END IF;
172:
173:
174: l_stmt_num := 30;
177: -- Call to Procedure Add Parameters. To Add AP and PO data to XML data
178: /*========================================================================*/
179:
180: Add_ApPoData (p_api_version => l_api_version,
181: p_init_msg_list => FND_API.G_FALSE,
182: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
183: x_return_status => l_return_status,
184: x_msg_count => l_msg_count,
185: x_msg_data => l_msg_data,
178: /*========================================================================*/
179:
180: Add_ApPoData (p_api_version => l_api_version,
181: p_init_msg_list => FND_API.G_FALSE,
182: p_validation_level => FND_API.G_VALID_LEVEL_FULL,
183: x_return_status => l_return_status,
184: x_msg_count => l_msg_count,
185: x_msg_data => l_msg_data,
186: i_title => p_title,
197: x_xml_doc => l_xml_doc);
198:
199: -- Standard call to check the return status from API called
200:
201: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
202: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
203: END IF;
204:
205: -- write the closing tag to the XML data
198:
199: -- Standard call to check the return status from API called
200:
201: IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
202: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
203: END IF;
204:
205: -- write the closing tag to the XML data
206:
241: '<<< ' || l_api_name);
242: END IF;
243:
244: EXCEPTION
245: WHEN FND_API.G_EXC_ERROR THEN
246: ROLLBACK;
247: l_return_status := FND_API.g_ret_sts_error;
248: If l_errorLog then
249: fnd_log.message(FND_LOG.LEVEL_ERROR,
243:
244: EXCEPTION
245: WHEN FND_API.G_EXC_ERROR THEN
246: ROLLBACK;
247: l_return_status := FND_API.g_ret_sts_error;
248: If l_errorLog then
249: fnd_log.message(FND_LOG.LEVEL_ERROR,
250: G_LOG_HEADER || '.' || l_api_name || '(' ||to_char(l_stmt_num)||')',
251: FALSE
277: l_success := FND_CONCURRENT.SET_COMPLETION_STATUS('ERROR', l_msg_data);
278:
279: l_conc_request := fnd_concurrent.set_completion_status('ERROR',substr(fnd_message.get_string('BOM',l_error_message),1,240));
280:
281: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
282: FND_MSG_PUB.Count_And_Get
283: ( p_count => l_msg_count,
284: p_data => l_msg_data
285: );
377: END IF;
378:
379: -- Standard call to check for call compatibility.
380:
381: IF NOT FND_API.Compatible_API_Call ( l_api_version,
382: p_api_version,
383: l_api_name,
384: G_PKG_NAME )
385: THEN
382: p_api_version,
383: l_api_name,
384: G_PKG_NAME )
385: THEN
386: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
387: END IF;
388:
389: -- Initialize message list if p_init_msg_list is set to TRUE.
390:
387: END IF;
388:
389: -- Initialize message list if p_init_msg_list is set to TRUE.
390:
391: IF FND_API.to_Boolean( p_init_msg_list ) THEN
392: FND_MSG_PUB.initialize;
393: END IF;
394:
395: -- Initialize API return status to success
393: END IF;
394:
395: -- Initialize API return status to success
396:
397: x_return_status := FND_API.G_RET_STS_SUCCESS;
398:
399: -- Initialize temporary variable to hold xml data
400:
401: DBMS_LOB.createtemporary(l_xml_temp, TRUE);
525: '<<< ' || l_api_name);
526: END IF;
527:
528: EXCEPTION
529: WHEN FND_API.G_EXC_ERROR THEN
530: x_return_status := FND_API.G_RET_STS_ERROR ;
531: FND_MSG_PUB.Count_And_Get
532: ( p_count => x_msg_count,
533: p_data => x_msg_data
526: END IF;
527:
528: EXCEPTION
529: WHEN FND_API.G_EXC_ERROR THEN
530: x_return_status := FND_API.G_RET_STS_ERROR ;
531: FND_MSG_PUB.Count_And_Get
532: ( p_count => x_msg_count,
533: p_data => x_msg_data
534: );
532: ( p_count => x_msg_count,
533: p_data => x_msg_data
534: );
535:
536: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
537: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
538: FND_MSG_PUB.Count_And_Get
539: ( p_count => x_msg_count,
540: p_data => x_msg_data
533: p_data => x_msg_data
534: );
535:
536: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
537: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
538: FND_MSG_PUB.Count_And_Get
539: ( p_count => x_msg_count,
540: p_data => x_msg_data
541: );
540: p_data => x_msg_data
541: );
542:
543: WHEN OTHERS THEN
544: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
545: IF (l_uLog) THEN
546: FND_LOG.STRING(FND_LOG.LEVEL_UNEXPECTED,
547: l_module || '.' || l_stmt_num,
548: SUBSTRB (SQLERRM , 1 , 240));
626: END IF;
627:
628: -- Standard call to check for call compatibility.
629:
630: IF NOT FND_API.Compatible_API_Call ( l_api_version,
631: p_api_version,
632: l_api_name,
633: G_PKG_NAME )
634: THEN
631: p_api_version,
632: l_api_name,
633: G_PKG_NAME )
634: THEN
635: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
636: END IF;
637:
638: -- Initialize message list if p_init_msg_list is set to TRUE.
639:
636: END IF;
637:
638: -- Initialize message list if p_init_msg_list is set to TRUE.
639:
640: IF FND_API.to_Boolean( p_init_msg_list ) THEN
641: FND_MSG_PUB.initialize;
642: END IF;
643:
644: -- Initialize API return status to success
642: END IF;
643:
644: -- Initialize API return status to success
645:
646: x_return_status := FND_API.G_RET_STS_SUCCESS;
647:
648: -- Initialize temporary variable to hold xml data
649:
650: DBMS_LOB.createtemporary(l_xml_temp, TRUE);
1016: '<<< ' || l_api_name);
1017: END IF;
1018:
1019: EXCEPTION
1020: WHEN FND_API.G_EXC_ERROR THEN
1021: x_return_status := FND_API.G_RET_STS_ERROR ;
1022: FND_MSG_PUB.Count_And_Get
1023: ( p_count => x_msg_count,
1024: p_data => x_msg_data
1017: END IF;
1018:
1019: EXCEPTION
1020: WHEN FND_API.G_EXC_ERROR THEN
1021: x_return_status := FND_API.G_RET_STS_ERROR ;
1022: FND_MSG_PUB.Count_And_Get
1023: ( p_count => x_msg_count,
1024: p_data => x_msg_data
1025: );
1023: ( p_count => x_msg_count,
1024: p_data => x_msg_data
1025: );
1026:
1027: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1028: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1029: FND_MSG_PUB.Count_And_Get
1030: ( p_count => x_msg_count,
1031: p_data => x_msg_data);
1024: p_data => x_msg_data
1025: );
1026:
1027: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1028: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1029: FND_MSG_PUB.Count_And_Get
1030: ( p_count => x_msg_count,
1031: p_data => x_msg_data);
1032:
1030: ( p_count => x_msg_count,
1031: p_data => x_msg_data);
1032:
1033: WHEN OTHERS THEN
1034: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1035: IF (l_uLog) THEN
1036: FND_LOG.STRING (FND_LOG.LEVEL_UNEXPECTED,
1037: l_module || '.' || l_stmt_num,
1038: SUBSTRB (SQLERRM , 1 , 240));