67: * tables for processing
68: * Effects: This procedure runs the document submission checks on passed in
69: * document.
70: * Returns:
71: * x_return_status: FND_API.G_RET_STS_SUCCESS if API succeeds
72: * FND_API.G_RET_STS_ERROR if API fails
73: * FND_API.G_RET_STS_UNEXP_ERROR if unexpected error occurs
74: * x_sub_check_status: FND_API.G_RET_STS_SUCCESS if document passes all
75: * submission checks, even if warnings are found
68: * Effects: This procedure runs the document submission checks on passed in
69: * document.
70: * Returns:
71: * x_return_status: FND_API.G_RET_STS_SUCCESS if API succeeds
72: * FND_API.G_RET_STS_ERROR if API fails
73: * FND_API.G_RET_STS_UNEXP_ERROR if unexpected error occurs
74: * x_sub_check_status: FND_API.G_RET_STS_SUCCESS if document passes all
75: * submission checks, even if warnings are found
76: * FND_API.G_RET_STS_ERROR if document fails atleast one
69: * document.
70: * Returns:
71: * x_return_status: FND_API.G_RET_STS_SUCCESS if API succeeds
72: * FND_API.G_RET_STS_ERROR if API fails
73: * FND_API.G_RET_STS_UNEXP_ERROR if unexpected error occurs
74: * x_sub_check_status: FND_API.G_RET_STS_SUCCESS if document passes all
75: * submission checks, even if warnings are found
76: * FND_API.G_RET_STS_ERROR if document fails atleast one
77: * submission check (returns at least one error)
70: * Returns:
71: * x_return_status: FND_API.G_RET_STS_SUCCESS if API succeeds
72: * FND_API.G_RET_STS_ERROR if API fails
73: * FND_API.G_RET_STS_UNEXP_ERROR if unexpected error occurs
74: * x_sub_check_status: FND_API.G_RET_STS_SUCCESS if document passes all
75: * submission checks, even if warnings are found
76: * FND_API.G_RET_STS_ERROR if document fails atleast one
77: * submission check (returns at least one error)
78: * x_has_warnings: FND_API.G_TRUE if submission check returns warnings
72: * FND_API.G_RET_STS_ERROR if API fails
73: * FND_API.G_RET_STS_UNEXP_ERROR if unexpected error occurs
74: * x_sub_check_status: FND_API.G_RET_STS_SUCCESS if document passes all
75: * submission checks, even if warnings are found
76: * FND_API.G_RET_STS_ERROR if document fails atleast one
77: * submission check (returns at least one error)
78: * x_has_warnings: FND_API.G_TRUE if submission check returns warnings
79: * FND_API.G_FALSE if no warnings are found
80: * x_msg_data: Contains error msg in case x_return_status returned
74: * x_sub_check_status: FND_API.G_RET_STS_SUCCESS if document passes all
75: * submission checks, even if warnings are found
76: * FND_API.G_RET_STS_ERROR if document fails atleast one
77: * submission check (returns at least one error)
78: * x_has_warnings: FND_API.G_TRUE if submission check returns warnings
79: * FND_API.G_FALSE if no warnings are found
80: * x_msg_data: Contains error msg in case x_return_status returned
81: * FND_API.G_RET_STS_ERROR or FND_API.G_RET_STS_UNEXP_ERROR
82: * x_online_report_id: This id can be used to get all submission check errors
75: * submission checks, even if warnings are found
76: * FND_API.G_RET_STS_ERROR if document fails atleast one
77: * submission check (returns at least one error)
78: * x_has_warnings: FND_API.G_TRUE if submission check returns warnings
79: * FND_API.G_FALSE if no warnings are found
80: * x_msg_data: Contains error msg in case x_return_status returned
81: * FND_API.G_RET_STS_ERROR or FND_API.G_RET_STS_UNEXP_ERROR
82: * x_online_report_id: This id can be used to get all submission check errors
83: * for given document from online_report_text table
77: * submission check (returns at least one error)
78: * x_has_warnings: FND_API.G_TRUE if submission check returns warnings
79: * FND_API.G_FALSE if no warnings are found
80: * x_msg_data: Contains error msg in case x_return_status returned
81: * FND_API.G_RET_STS_ERROR or FND_API.G_RET_STS_UNEXP_ERROR
82: * x_online_report_id: This id can be used to get all submission check errors
83: * for given document from online_report_text table
84: * x_doc_check_error_record: If x_sub_check_status returned G_RET_STS_ERROR
85: * then this object of tables will contain information about
135: END IF;
136: END IF;
137:
138: -- Standard call to check for call compatibility
139: IF NOT FND_API.Compatible_API_Call(l_api_version, p_api_version, l_api_name, G_PKG_NAME)
140: THEN
141: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
142: END IF;
143:
137:
138: -- Standard call to check for call compatibility
139: IF NOT FND_API.Compatible_API_Call(l_api_version, p_api_version, l_api_name, G_PKG_NAME)
140: THEN
141: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
142: END IF;
143:
144: PO_CORE_S.get_document_ids(
145: p_doc_type => p_document_type
158: THEN
159: FND_MESSAGE.set_name('PO', 'PO_SUB_GENERAL_ERROR');
160: FND_MESSAGE.set_token('ERROR_TEXT','Invalid Action Requested');
161: FND_MSG_PUB.Add;
162: RAISE FND_API.G_EXC_ERROR;
163: END IF;
164:
165: l_progress := '002';
166: --check p_document_type
167: IF p_document_type NOT IN ('REQUISITION', 'RELEASE', 'PO', 'PA') THEN
168: FND_MESSAGE.set_name('PO', 'PO_SUB_GENERAL_ERROR');
169: FND_MESSAGE.set_token('ERROR_TEXT', 'Invalid Document TYpe');
170: FND_MSG_PUB.Add;
171: RAISE FND_API.G_EXC_ERROR;
172: END IF;
173:
174: l_progress := '003';
175:
178: IF p_document_type NOT IN ('PO', 'RELEASE') THEN
179: FND_MESSAGE.set_name('PO', 'PO_SUB_GENERAL_ERROR');
180: FND_MESSAGE.set_token('ERROR_TEXT', 'UNRESERVE Action Requested for invalid document type');
181: FND_MSG_PUB.Add;
182: RAISE FND_API.G_EXC_ERROR;
183: END IF;
184: --
185: ELSIF (p_action_requested = g_action_FINAL_CLOSE_CHECK) THEN
186: IF p_document_type NOT IN ('PO', 'PA', 'RELEASE') THEN
186: IF p_document_type NOT IN ('PO', 'PA', 'RELEASE') THEN
187: FND_MESSAGE.set_name('PO', 'PO_SUB_GENERAL_ERROR');
188: FND_MESSAGE.set_token('ERROR_TEXT', 'FINAL_CLOSE Action Requested for invalid document type');
189: FND_MSG_PUB.Add;
190: RAISE FND_API.G_EXC_ERROR;
191: END IF;
192: --
193: ELSE
194: IF p_document_level <> g_document_level_HEADER THEN
194: IF p_document_level <> g_document_level_HEADER THEN
195: FND_MESSAGE.set_name('PO', 'PO_SUB_GENERAL_ERROR');
196: FND_MESSAGE.set_token('ERROR_TEXT', 'Non-Header level only supported for UNRESERVE action');
197: FND_MSG_PUB.Add;
198: RAISE FND_API.G_EXC_ERROR;
199: END IF;
200: END IF;
201:
202: l_progress := '004';
205: IF p_document_subtype NOT IN ('STANDARD', 'PLANNED') THEN
206: FND_MESSAGE.set_name('PO', 'PO_SUB_GENERAL_ERROR');
207: FND_MESSAGE.set_token('ERROR_TEXT', 'Invalid document type for document type PO');
208: FND_MSG_PUB.Add;
209: RAISE FND_API.G_EXC_ERROR;
210: END IF;
211: ELSIF p_document_type = 'PA' THEN
212: IF p_document_subtype NOT IN ('BLANKET', 'CONTRACT') THEN
213: FND_MESSAGE.set_name('PO', 'PO_SUB_GENERAL_ERROR');
212: IF p_document_subtype NOT IN ('BLANKET', 'CONTRACT') THEN
213: FND_MESSAGE.set_name('PO', 'PO_SUB_GENERAL_ERROR');
214: FND_MESSAGE.set_token('ERROR_TEXT', 'Invalid document type for document type PA');
215: FND_MSG_PUB.Add;
216: RAISE FND_API.G_EXC_ERROR;
217: END IF;
218: END IF;
219:
220: l_progress := '005';
289: --
290: IF (l_consigned_flag = 'Y') AND (p_action_requested <> g_action_FINAL_CLOSE_CHECK)
291: THEN
292:
293: x_sub_check_status := FND_API.G_RET_STS_SUCCESS;
294: x_return_status := FND_API.G_RET_STS_SUCCESS;
295:
296: Return;
297: END IF;
290: IF (l_consigned_flag = 'Y') AND (p_action_requested <> g_action_FINAL_CLOSE_CHECK)
291: THEN
292:
293: x_sub_check_status := FND_API.G_RET_STS_SUCCESS;
294: x_return_status := FND_API.G_RET_STS_SUCCESS;
295:
296: Return;
297: END IF;
298:
325: END IF;
326: END IF;
327:
328: EXCEPTION
329: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
330: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
331: p_encoded => 'F');
332: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
333: x_sub_check_status := FND_API.G_RET_STS_ERROR;
328: EXCEPTION
329: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
330: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
331: p_encoded => 'F');
332: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
333: x_sub_check_status := FND_API.G_RET_STS_ERROR;
334: WHEN FND_API.G_EXC_ERROR THEN
335: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
336: p_encoded => 'F');
329: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
330: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
331: p_encoded => 'F');
332: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
333: x_sub_check_status := FND_API.G_RET_STS_ERROR;
334: WHEN FND_API.G_EXC_ERROR THEN
335: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
336: p_encoded => 'F');
337: x_return_status := FND_API.G_RET_STS_ERROR;
330: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
331: p_encoded => 'F');
332: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
333: x_sub_check_status := FND_API.G_RET_STS_ERROR;
334: WHEN FND_API.G_EXC_ERROR THEN
335: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
336: p_encoded => 'F');
337: x_return_status := FND_API.G_RET_STS_ERROR;
338: x_sub_check_status := FND_API.G_RET_STS_ERROR;
333: x_sub_check_status := FND_API.G_RET_STS_ERROR;
334: WHEN FND_API.G_EXC_ERROR THEN
335: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
336: p_encoded => 'F');
337: x_return_status := FND_API.G_RET_STS_ERROR;
338: x_sub_check_status := FND_API.G_RET_STS_ERROR;
339: WHEN OTHERS THEN
340: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error) THEN
341: FND_MSG_PUB.add_exc_msg(G_PKG_NAME, l_api_name);
334: WHEN FND_API.G_EXC_ERROR THEN
335: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
336: p_encoded => 'F');
337: x_return_status := FND_API.G_RET_STS_ERROR;
338: x_sub_check_status := FND_API.G_RET_STS_ERROR;
339: WHEN OTHERS THEN
340: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error) THEN
341: FND_MSG_PUB.add_exc_msg(G_PKG_NAME, l_api_name);
342: END IF;
350: END IF;
351:
352: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
353: p_encoded => 'F');
354: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
355: x_sub_check_status := FND_API.G_RET_STS_ERROR;
356: END po_submission_check;
357:
358: -- bug3574165 START
351:
352: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
353: p_encoded => 'F');
354: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
355: x_sub_check_status := FND_API.G_RET_STS_ERROR;
356: END po_submission_check;
357:
358: -- bug3574165 START
359: -- Overloaded procedure. This procedure does not take l_has_warnings
517: x_doc_check_error_record => l_doc_check_error_record);
518:
519: l_progress := '001';
520: EXCEPTION
521: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
522: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
523: p_encoded => 'F');
524: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
525: x_sub_check_status := FND_API.G_RET_STS_ERROR;
520: EXCEPTION
521: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
522: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
523: p_encoded => 'F');
524: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
525: x_sub_check_status := FND_API.G_RET_STS_ERROR;
526: WHEN FND_API.G_EXC_ERROR THEN
527: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
528: p_encoded => 'F');
521: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
522: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
523: p_encoded => 'F');
524: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
525: x_sub_check_status := FND_API.G_RET_STS_ERROR;
526: WHEN FND_API.G_EXC_ERROR THEN
527: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
528: p_encoded => 'F');
529: x_return_status := FND_API.G_RET_STS_ERROR;
522: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
523: p_encoded => 'F');
524: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
525: x_sub_check_status := FND_API.G_RET_STS_ERROR;
526: WHEN FND_API.G_EXC_ERROR THEN
527: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
528: p_encoded => 'F');
529: x_return_status := FND_API.G_RET_STS_ERROR;
530: x_sub_check_status := FND_API.G_RET_STS_ERROR;
525: x_sub_check_status := FND_API.G_RET_STS_ERROR;
526: WHEN FND_API.G_EXC_ERROR THEN
527: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
528: p_encoded => 'F');
529: x_return_status := FND_API.G_RET_STS_ERROR;
530: x_sub_check_status := FND_API.G_RET_STS_ERROR;
531: WHEN OTHERS THEN
532: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error) THEN
533: FND_MSG_PUB.add_exc_msg(G_PKG_NAME, l_api_name);
526: WHEN FND_API.G_EXC_ERROR THEN
527: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
528: p_encoded => 'F');
529: x_return_status := FND_API.G_RET_STS_ERROR;
530: x_sub_check_status := FND_API.G_RET_STS_ERROR;
531: WHEN OTHERS THEN
532: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error) THEN
533: FND_MSG_PUB.add_exc_msg(G_PKG_NAME, l_api_name);
534: END IF;
542: END IF;
543:
544: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
545: p_encoded => 'F');
546: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
547: x_sub_check_status := FND_API.G_RET_STS_ERROR;
548: END po_submission_check;
549:
550:
543:
544: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
545: p_encoded => 'F');
546: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
547: x_sub_check_status := FND_API.G_RET_STS_ERROR;
548: END po_submission_check;
549:
550:
551: -- bug3574165 START
612:
613: l_progress := '001';
614:
615: EXCEPTION
616: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
617: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
618: p_encoded => 'F');
619: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
620: x_sub_check_status := FND_API.G_RET_STS_ERROR;
615: EXCEPTION
616: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
617: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
618: p_encoded => 'F');
619: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
620: x_sub_check_status := FND_API.G_RET_STS_ERROR;
621:
622: WHEN FND_API.G_EXC_ERROR THEN
623: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
616: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
617: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
618: p_encoded => 'F');
619: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
620: x_sub_check_status := FND_API.G_RET_STS_ERROR;
621:
622: WHEN FND_API.G_EXC_ERROR THEN
623: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
624: p_encoded => 'F');
618: p_encoded => 'F');
619: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
620: x_sub_check_status := FND_API.G_RET_STS_ERROR;
621:
622: WHEN FND_API.G_EXC_ERROR THEN
623: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
624: p_encoded => 'F');
625: x_return_status := FND_API.G_RET_STS_ERROR;
626: x_sub_check_status := FND_API.G_RET_STS_ERROR;
621:
622: WHEN FND_API.G_EXC_ERROR THEN
623: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
624: p_encoded => 'F');
625: x_return_status := FND_API.G_RET_STS_ERROR;
626: x_sub_check_status := FND_API.G_RET_STS_ERROR;
627:
628: WHEN OTHERS THEN
629: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error)
622: WHEN FND_API.G_EXC_ERROR THEN
623: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
624: p_encoded => 'F');
625: x_return_status := FND_API.G_RET_STS_ERROR;
626: x_sub_check_status := FND_API.G_RET_STS_ERROR;
627:
628: WHEN OTHERS THEN
629: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error)
630: THEN
641: END IF;
642:
643: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
644: p_encoded => 'F');
645: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
646: x_sub_check_status := FND_API.G_RET_STS_ERROR;
647:
648: END po_submission_check;
649: -- bug3574165 END
642:
643: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
644: p_encoded => 'F');
645: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
646: x_sub_check_status := FND_API.G_RET_STS_ERROR;
647:
648: END po_submission_check;
649: -- bug3574165 END
650:
736: * Modifies: None
737: * Effects: This procedure builds dynamic WHERE clause fragments based on
738: * document security parameters.
739: * Returns:
740: * x_return_status: FND_API.G_RET_STS_SUCCESS if API succeeds
741: * FND_API.G_RET_STS_ERROR if API fails
742: * FND_API.G_RET_STS_UNEXP_ERROR if unexpected error
743: * x_msg_data: Contains error msg in case x_return_status returned
744: * FND_API.G_RET_STS_ERROR or
737: * Effects: This procedure builds dynamic WHERE clause fragments based on
738: * document security parameters.
739: * Returns:
740: * x_return_status: FND_API.G_RET_STS_SUCCESS if API succeeds
741: * FND_API.G_RET_STS_ERROR if API fails
742: * FND_API.G_RET_STS_UNEXP_ERROR if unexpected error
743: * x_msg_data: Contains error msg in case x_return_status returned
744: * FND_API.G_RET_STS_ERROR or
745: * FND_API.G_RET_STS_UNEXP_ERROR
738: * document security parameters.
739: * Returns:
740: * x_return_status: FND_API.G_RET_STS_SUCCESS if API succeeds
741: * FND_API.G_RET_STS_ERROR if API fails
742: * FND_API.G_RET_STS_UNEXP_ERROR if unexpected error
743: * x_msg_data: Contains error msg in case x_return_status returned
744: * FND_API.G_RET_STS_ERROR or
745: * FND_API.G_RET_STS_UNEXP_ERROR
746: * x_where_clause: The constructed where clause
740: * x_return_status: FND_API.G_RET_STS_SUCCESS if API succeeds
741: * FND_API.G_RET_STS_ERROR if API fails
742: * FND_API.G_RET_STS_UNEXP_ERROR if unexpected error
743: * x_msg_data: Contains error msg in case x_return_status returned
744: * FND_API.G_RET_STS_ERROR or
745: * FND_API.G_RET_STS_UNEXP_ERROR
746: * x_where_clause: The constructed where clause
747: */
748: PROCEDURE PO_SECURITY_CHECK (p_api_version IN NUMBER,
741: * FND_API.G_RET_STS_ERROR if API fails
742: * FND_API.G_RET_STS_UNEXP_ERROR if unexpected error
743: * x_msg_data: Contains error msg in case x_return_status returned
744: * FND_API.G_RET_STS_ERROR or
745: * FND_API.G_RET_STS_UNEXP_ERROR
746: * x_where_clause: The constructed where clause
747: */
748: PROCEDURE PO_SECURITY_CHECK (p_api_version IN NUMBER,
749: p_query_table IN VARCHAR2,
766: BEGIN
767:
768: l_progress := '000';
769: -- Standard call to check for call compatibility
770: IF NOT FND_API.Compatible_API_Call(l_api_version, p_api_version, l_api_name, G_PKG_NAME)
771: THEN
772: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
773: END IF;
774:
768: l_progress := '000';
769: -- Standard call to check for call compatibility
770: IF NOT FND_API.Compatible_API_Call(l_api_version, p_api_version, l_api_name, G_PKG_NAME)
771: THEN
772: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
773: END IF;
774:
775: l_progress := '010';
776:
788: (p_document_subtype is NULL) OR (p_type_clause is NULL)) THEN
789: FND_MESSAGE.set_name('PO', 'PO_SEC_GENERAL_ERROR');
790: FND_MESSAGE.set_token('ERROR_TEXT', 'Mandatory parameters are NULL');
791: FND_MSG_PUB.Add;
792: RAISE FND_API.G_EXC_ERROR;
793: END IF; /*(p_query_table is NULL) OR (p_owner_id_column is NULL)*/
794:
795: l_progress := '020';
796: --Check p_minimum_access_level
797: IF p_minimum_access_level NOT IN ('VIEW_ONLY', 'MODIFY', 'FULL') THEN
798: FND_MESSAGE.set_name('PO', 'PO_SEC_GENERAL_ERROR');
799: FND_MESSAGE.set_token('ERROR_TEXT', 'Invalid Minimum Access Level');
800: FND_MSG_PUB.Add;
801: RAISE FND_API.G_EXC_ERROR;
802: END IF; /*p_minimum_access_level NOT IN ('VIEW_ONLY', 'MODIFY', 'ALL')*/
803:
804: l_progress := '030';
805: --check p_document_type
808: 'RELEASE', 'PO', 'PA', 'PO_PA') THEN
809: FND_MESSAGE.set_name('PO', 'PO_SEC_GENERAL_ERROR');
810: FND_MESSAGE.set_token('ERROR_TEXT', 'Invalid Document Type');
811: FND_MSG_PUB.Add;
812: RAISE FND_API.G_EXC_ERROR;
813: END IF; /*p_document_type NOT IN ('RFQ', 'QUOTATION', 'REQUISITION',*/
814:
815: l_progress := '040';
816: --check that document_subtype matches
818: IF p_document_subtype NOT IN ('PURCHASE', 'INTERNAL') THEN
819: FND_MESSAGE.set_name('PO', 'PO_SEC_GENERAL_ERROR');
820: FND_MESSAGE.set_token('ERROR_TEXT', 'Invalid Document Subtype');
821: FND_MSG_PUB.Add;
822: RAISE FND_API.G_EXC_ERROR;
823: END IF;
824: ELSIF p_document_type = 'RELEASE' THEN
825: IF p_document_subtype NOT IN ('SCHEDULED', 'BLANKET') THEN
826: FND_MESSAGE.set_name('PO', 'PO_SEC_GENERAL_ERROR');
825: IF p_document_subtype NOT IN ('SCHEDULED', 'BLANKET') THEN
826: FND_MESSAGE.set_name('PO', 'PO_SEC_GENERAL_ERROR');
827: FND_MESSAGE.set_token('ERROR_TEXT', 'Invalid Document Subtype');
828: FND_MSG_PUB.Add;
829: RAISE FND_API.G_EXC_ERROR;
830: END IF;
831: ELSIF p_document_type = 'PO' THEN
832: IF p_document_subtype NOT IN ('STANDARD', 'PLANNED') THEN
833: FND_MESSAGE.set_name('PO', 'PO_SEC_GENERAL_ERROR');
832: IF p_document_subtype NOT IN ('STANDARD', 'PLANNED') THEN
833: FND_MESSAGE.set_name('PO', 'PO_SEC_GENERAL_ERROR');
834: FND_MESSAGE.set_token('ERROR_TEXT', 'Invalid Document Subtype');
835: FND_MSG_PUB.Add;
836: RAISE FND_API.G_EXC_ERROR;
837: END IF;
838: ELSIF p_document_type = 'PA' THEN
839: IF p_document_subtype NOT IN ('BLANKET', 'CONTRACT') THEN
840: FND_MESSAGE.set_name('PO', 'PO_SEC_GENERAL_ERROR');
839: IF p_document_subtype NOT IN ('BLANKET', 'CONTRACT') THEN
840: FND_MESSAGE.set_name('PO', 'PO_SEC_GENERAL_ERROR');
841: FND_MESSAGE.set_token('ERROR_TEXT', 'Invalid Document Subtype');
842: FND_MSG_PUB.Add;
843: RAISE FND_API.G_EXC_ERROR;
844: END IF;
845: -- Bug 5054685 Start: Performance issue. Collapsed multiple security
846: -- related where-clauses into one.
847: ELSIF p_document_type = 'PO_PA' THEN
848: IF p_document_subtype NOT IN ('ALL') THEN
849: FND_MESSAGE.set_name('PO', 'PO_SEC_GENERAL_ERROR');
850: FND_MESSAGE.set_token('ERROR_TEXT', 'Invalid Document Subtype');
851: FND_MSG_PUB.Add;
852: RAISE FND_API.G_EXC_ERROR;
853: END IF;
854: -- Bug 5054685 End
855: END IF; /*p_document_type = 'REQUISITION'*/
856:
876: x_where_clause => x_where_clause);
877:
878: l_progress := '100';
879: EXCEPTION
880: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
881: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
882: p_encoded => 'F');
883: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
884: x_where_clause := NULL;
879: EXCEPTION
880: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
881: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
882: p_encoded => 'F');
883: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
884: x_where_clause := NULL;
885: WHEN FND_API.G_EXC_ERROR THEN
886: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
887: p_encoded => 'F');
881: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
882: p_encoded => 'F');
883: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
884: x_where_clause := NULL;
885: WHEN FND_API.G_EXC_ERROR THEN
886: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
887: p_encoded => 'F');
888: x_return_status := FND_API.G_RET_STS_ERROR;
889: x_where_clause := NULL;
884: x_where_clause := NULL;
885: WHEN FND_API.G_EXC_ERROR THEN
886: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
887: p_encoded => 'F');
888: x_return_status := FND_API.G_RET_STS_ERROR;
889: x_where_clause := NULL;
890: WHEN OTHERS THEN
891: IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.g_msg_lvl_unexp_error) THEN
892: FND_MSG_PUB.add_exc_msg(G_PKG_NAME, l_api_name);
901: END IF;
902:
903: x_msg_data := FND_MSG_PUB.GET(p_msg_index => FND_MSG_PUB.G_LAST,
904: p_encoded => 'F');
905: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
906: x_where_clause := NULL;
907: END PO_SECURITY_CHECK;
908:
909: --
971: l_count := p_vendor_order_num.COUNT;
972: ELSE -- The required input table ID parameters are all null !
973: FND_MESSAGE.set_name('PO', 'PO_STATCHK_ERR_NULL_INPARAM');
974: FND_MSG_PUB.Add;
975: RAISE FND_API.G_EXC_ERROR;
976: END IF;
977:
978: --Initialize any null Tables to a dummy table of null values with length of p_header_id.COUNT
979: l_progress := '007';
1020:
1021: FND_MESSAGE.set_name('PO', 'PO_STATCHK_GENERAL_ERROR');
1022: FND_MESSAGE.set_token('ERROR_TEXT', 'The input table ID parameters are not of same size !');
1023: FND_MSG_PUB.Add;
1024: RAISE FND_API.G_EXC_ERROR;
1025: END IF;
1026:
1027: --Validate that a Header or Release is specified through any of the possible combinations
1028: -- Line/Shipment/Distribution are optional, but Header/Release should be specified.
1036: -- Means that no Header/Release is specified
1037: FND_MESSAGE.set_name('PO', 'PO_STATCHK_GENERAL_ERROR');
1038: FND_MESSAGE.set_token('ERROR_TEXT', 'There is no Header/Release specified at index ' || i);
1039: FND_MSG_PUB.Add;
1040: RAISE FND_API.G_EXC_ERROR;
1041: END IF;
1042:
1043: END LOOP;
1044:
1043: END LOOP;
1044:
1045: l_progress := '030';
1046:
1047: x_return_status := FND_API.G_RET_STS_SUCCESS;
1048:
1049: EXCEPTION
1050: WHEN FND_API.G_EXC_ERROR THEN
1051: x_return_status := FND_API.G_RET_STS_ERROR;
1046:
1047: x_return_status := FND_API.G_RET_STS_SUCCESS;
1048:
1049: EXCEPTION
1050: WHEN FND_API.G_EXC_ERROR THEN
1051: x_return_status := FND_API.G_RET_STS_ERROR;
1052: WHEN OTHERS THEN
1053: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1054: FND_MSG_PUB.add_exc_msg(G_PKG_NAME, l_api_name || '.' || l_progress);
1047: x_return_status := FND_API.G_RET_STS_SUCCESS;
1048:
1049: EXCEPTION
1050: WHEN FND_API.G_EXC_ERROR THEN
1051: x_return_status := FND_API.G_RET_STS_ERROR;
1052: WHEN OTHERS THEN
1053: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1054: FND_MSG_PUB.add_exc_msg(G_PKG_NAME, l_api_name || '.' || l_progress);
1055:
1049: EXCEPTION
1050: WHEN FND_API.G_EXC_ERROR THEN
1051: x_return_status := FND_API.G_RET_STS_ERROR;
1052: WHEN OTHERS THEN
1053: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1054: FND_MSG_PUB.add_exc_msg(G_PKG_NAME, l_api_name || '.' || l_progress);
1055:
1056: END validate_status_check_inputs;
1057:
1108:
1109: BEGIN
1110:
1111: --Standard call to check for call compatibility
1112: IF NOT FND_API.Compatible_API_Call(l_api_version, p_api_version, l_api_name, G_PKG_NAME) THEN
1113: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1114: END IF;
1115:
1116: --Validate Input Parameters and do any defaulting
1109: BEGIN
1110:
1111: --Standard call to check for call compatibility
1112: IF NOT FND_API.Compatible_API_Call(l_api_version, p_api_version, l_api_name, G_PKG_NAME) THEN
1113: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1114: END IF;
1115:
1116: --Validate Input Parameters and do any defaulting
1117: l_progress := '010';
1129: p_mode => p_mode,
1130: x_po_status_rec => x_po_status_rec,
1131: x_return_status => x_return_status);
1132:
1133: IF x_return_status <> FND_API.G_RET_STS_SUCCESS THEN
1134: return;
1135: END IF;
1136:
1137: --Call the private procedure to actually do po status check
1158:
1159: l_progress := '030';
1160:
1161: EXCEPTION
1162: WHEN FND_API.G_EXC_ERROR THEN
1163: x_return_status := FND_API.G_RET_STS_ERROR;
1164: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1165: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1166: WHEN OTHERS THEN
1159: l_progress := '030';
1160:
1161: EXCEPTION
1162: WHEN FND_API.G_EXC_ERROR THEN
1163: x_return_status := FND_API.G_RET_STS_ERROR;
1164: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1165: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1166: WHEN OTHERS THEN
1167: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1160:
1161: EXCEPTION
1162: WHEN FND_API.G_EXC_ERROR THEN
1163: x_return_status := FND_API.G_RET_STS_ERROR;
1164: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1165: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1166: WHEN OTHERS THEN
1167: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1168: FND_MSG_PUB.add_exc_msg(G_PKG_NAME, l_api_name || '.' || l_progress);
1161: EXCEPTION
1162: WHEN FND_API.G_EXC_ERROR THEN
1163: x_return_status := FND_API.G_RET_STS_ERROR;
1164: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1165: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1166: WHEN OTHERS THEN
1167: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1168: FND_MSG_PUB.add_exc_msg(G_PKG_NAME, l_api_name || '.' || l_progress);
1169:
1163: x_return_status := FND_API.G_RET_STS_ERROR;
1164: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1165: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1166: WHEN OTHERS THEN
1167: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1168: FND_MSG_PUB.add_exc_msg(G_PKG_NAME, l_api_name || '.' || l_progress);
1169:
1170: END po_status_check;
1171:
1212:
1213: BEGIN
1214:
1215: --Standard call to check for call compatibility
1216: IF NOT FND_API.Compatible_API_Call(l_api_version, p_api_version, l_api_name, G_PKG_NAME) THEN
1217: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1218: END IF;
1219:
1220: --Call the overloaded procedure that takes in Table IDs after
1213: BEGIN
1214:
1215: --Standard call to check for call compatibility
1216: IF NOT FND_API.Compatible_API_Call(l_api_version, p_api_version, l_api_name, G_PKG_NAME) THEN
1217: RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1218: END IF;
1219:
1220: --Call the overloaded procedure that takes in Table IDs after
1221: -- creating size=1 Tables of IDs 1 with value of the scalar input IDs
1241:
1242: l_progress := '020';
1243:
1244: EXCEPTION
1245: WHEN FND_API.G_EXC_ERROR THEN
1246: x_return_status := FND_API.G_RET_STS_ERROR;
1247: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1248: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1249: WHEN OTHERS THEN
1242: l_progress := '020';
1243:
1244: EXCEPTION
1245: WHEN FND_API.G_EXC_ERROR THEN
1246: x_return_status := FND_API.G_RET_STS_ERROR;
1247: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1248: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1249: WHEN OTHERS THEN
1250: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1243:
1244: EXCEPTION
1245: WHEN FND_API.G_EXC_ERROR THEN
1246: x_return_status := FND_API.G_RET_STS_ERROR;
1247: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1248: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1249: WHEN OTHERS THEN
1250: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1251: FND_MSG_PUB.add_exc_msg(G_PKG_NAME, l_api_name || '.' || l_progress);
1244: EXCEPTION
1245: WHEN FND_API.G_EXC_ERROR THEN
1246: x_return_status := FND_API.G_RET_STS_ERROR;
1247: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1248: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1249: WHEN OTHERS THEN
1250: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1251: FND_MSG_PUB.add_exc_msg(G_PKG_NAME, l_api_name || '.' || l_progress);
1252:
1246: x_return_status := FND_API.G_RET_STS_ERROR;
1247: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1248: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1249: WHEN OTHERS THEN
1250: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1251: FND_MSG_PUB.add_exc_msg(G_PKG_NAME, l_api_name || '.' || l_progress);
1252:
1253: END po_status_check;
1254:
1280: -- are not allowed to the standard API message list; otherwise, the API will not
1281: -- add the reasons to the message list.
1282: --OUT:
1283: --x_return_status
1284: -- FND_API.G_RET_STS_SUCCESS if the API completed successfully.
1285: -- FND_API.G_RET_STS_ERROR if there was an error.
1286: -- FND_API.G_RET_STS_UNEXP_ERROR if there was an unexpected error.
1287: --x_price_updateable
1288: -- PO_CORE_S.G_PARAMETER_YES if price updates are allowed on this shipment,
1281: -- add the reasons to the message list.
1282: --OUT:
1283: --x_return_status
1284: -- FND_API.G_RET_STS_SUCCESS if the API completed successfully.
1285: -- FND_API.G_RET_STS_ERROR if there was an error.
1286: -- FND_API.G_RET_STS_UNEXP_ERROR if there was an unexpected error.
1287: --x_price_updateable
1288: -- PO_CORE_S.G_PARAMETER_YES if price updates are allowed on this shipment,
1289: -- PO_CORE_S.G_PARAMETER_NO otherwise
1282: --OUT:
1283: --x_return_status
1284: -- FND_API.G_RET_STS_SUCCESS if the API completed successfully.
1285: -- FND_API.G_RET_STS_ERROR if there was an error.
1286: -- FND_API.G_RET_STS_UNEXP_ERROR if there was an unexpected error.
1287: --x_price_updateable
1288: -- PO_CORE_S.G_PARAMETER_YES if price updates are allowed on this shipment,
1289: -- PO_CORE_S.G_PARAMETER_NO otherwise
1290: --x_retroactive_price_change
1323: PO_DEBUG.debug_begin(l_log_head);
1324: END IF;
1325:
1326: -- Standard API initialization:
1327: IF NOT FND_API.compatible_api_call (
1328: p_current_version_number => l_api_version,
1329: p_caller_version_number => p_api_version,
1330: p_api_name => l_api_name,
1331: p_pkg_name => g_pkg_name ) THEN
1328: p_current_version_number => l_api_version,
1329: p_caller_version_number => p_api_version,
1330: p_api_name => l_api_name,
1331: p_pkg_name => g_pkg_name ) THEN
1332: RAISE FND_API.g_exc_unexpected_error;
1333: END IF;
1334: x_return_status := FND_API.G_RET_STS_SUCCESS;
1335:
1336: -- Default: price updates allowed, no retroactive price change.
1330: p_api_name => l_api_name,
1331: p_pkg_name => g_pkg_name ) THEN
1332: RAISE FND_API.g_exc_unexpected_error;
1333: END IF;
1334: x_return_status := FND_API.G_RET_STS_SUCCESS;
1335:
1336: -- Default: price updates allowed, no retroactive price change.
1337: x_price_updateable := PO_CORE_S.G_PARAMETER_YES;
1338: x_retroactive_price_change := PO_CORE_S.G_PARAMETER_NO;
1506: IF g_debug_stmt THEN
1507: PO_DEBUG.debug_end(l_log_head);
1508: END IF;
1509: EXCEPTION
1510: WHEN FND_API.G_EXC_ERROR THEN
1511: x_return_status := FND_API.G_RET_STS_ERROR;
1512: IF g_debug_unexp THEN
1513: PO_DEBUG.debug_exc(l_log_head, l_progress);
1514: END IF;
1507: PO_DEBUG.debug_end(l_log_head);
1508: END IF;
1509: EXCEPTION
1510: WHEN FND_API.G_EXC_ERROR THEN
1511: x_return_status := FND_API.G_RET_STS_ERROR;
1512: IF g_debug_unexp THEN
1513: PO_DEBUG.debug_exc(l_log_head, l_progress);
1514: END IF;
1515: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1511: x_return_status := FND_API.G_RET_STS_ERROR;
1512: IF g_debug_unexp THEN
1513: PO_DEBUG.debug_exc(l_log_head, l_progress);
1514: END IF;
1515: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1516: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1517: IF g_debug_unexp THEN
1518: PO_DEBUG.debug_exc(l_log_head, l_progress);
1519: END IF;
1512: IF g_debug_unexp THEN
1513: PO_DEBUG.debug_exc(l_log_head, l_progress);
1514: END IF;
1515: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1516: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1517: IF g_debug_unexp THEN
1518: PO_DEBUG.debug_exc(l_log_head, l_progress);
1519: END IF;
1520: WHEN OTHERS THEN
1517: IF g_debug_unexp THEN
1518: PO_DEBUG.debug_exc(l_log_head, l_progress);
1519: END IF;
1520: WHEN OTHERS THEN
1521: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1522: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name||'.'||l_progress);
1523: IF g_debug_unexp THEN
1524: PO_DEBUG.debug_exc(l_log_head, l_progress);
1525: END IF;
1552: -- are not allowed to the standard API message list; otherwise, the API will not
1553: -- add the reasons to the message list.
1554: --OUT:
1555: --x_return_status
1556: -- FND_API.G_RET_STS_SUCCESS if the API completed successfully.
1557: -- FND_API.G_RET_STS_ERROR if there was an error.
1558: -- FND_API.G_RET_STS_UNEXP_ERROR if there was an unexpected error.
1559: --x_price_updateable
1560: -- PO_CORE_S.G_PARAMETER_YES if price updates are allowed on this shipment,
1553: -- add the reasons to the message list.
1554: --OUT:
1555: --x_return_status
1556: -- FND_API.G_RET_STS_SUCCESS if the API completed successfully.
1557: -- FND_API.G_RET_STS_ERROR if there was an error.
1558: -- FND_API.G_RET_STS_UNEXP_ERROR if there was an unexpected error.
1559: --x_price_updateable
1560: -- PO_CORE_S.G_PARAMETER_YES if price updates are allowed on this shipment,
1561: -- PO_CORE_S.G_PARAMETER_NO otherwise
1554: --OUT:
1555: --x_return_status
1556: -- FND_API.G_RET_STS_SUCCESS if the API completed successfully.
1557: -- FND_API.G_RET_STS_ERROR if there was an error.
1558: -- FND_API.G_RET_STS_UNEXP_ERROR if there was an unexpected error.
1559: --x_price_updateable
1560: -- PO_CORE_S.G_PARAMETER_YES if price updates are allowed on this shipment,
1561: -- PO_CORE_S.G_PARAMETER_NO otherwise
1562: --x_retroactive_price_change
1593: PO_DEBUG.debug_begin(l_log_head);
1594: END IF;
1595:
1596: -- Standard API initialization:
1597: IF NOT FND_API.compatible_api_call (
1598: p_current_version_number => l_api_version,
1599: p_caller_version_number => p_api_version,
1600: p_api_name => l_api_name,
1601: p_pkg_name => g_pkg_name ) THEN
1598: p_current_version_number => l_api_version,
1599: p_caller_version_number => p_api_version,
1600: p_api_name => l_api_name,
1601: p_pkg_name => g_pkg_name ) THEN
1602: RAISE FND_API.g_exc_unexpected_error;
1603: END IF;
1604: x_return_status := FND_API.G_RET_STS_SUCCESS;
1605:
1606: -- Default: price updates allowed, no retroactive price change.
1600: p_api_name => l_api_name,
1601: p_pkg_name => g_pkg_name ) THEN
1602: RAISE FND_API.g_exc_unexpected_error;
1603: END IF;
1604: x_return_status := FND_API.G_RET_STS_SUCCESS;
1605:
1606: -- Default: price updates allowed, no retroactive price change.
1607: x_price_updateable := PO_CORE_S.G_PARAMETER_YES;
1608: x_retroactive_price_change := PO_CORE_S.G_PARAMETER_NO;
1725: IF g_debug_stmt THEN
1726: PO_DEBUG.debug_end(l_log_head);
1727: END IF;
1728: EXCEPTION
1729: WHEN FND_API.G_EXC_ERROR THEN
1730: x_return_status := FND_API.G_RET_STS_ERROR;
1731: IF g_debug_unexp THEN
1732: PO_DEBUG.debug_exc(l_log_head, l_progress);
1733: END IF;
1726: PO_DEBUG.debug_end(l_log_head);
1727: END IF;
1728: EXCEPTION
1729: WHEN FND_API.G_EXC_ERROR THEN
1730: x_return_status := FND_API.G_RET_STS_ERROR;
1731: IF g_debug_unexp THEN
1732: PO_DEBUG.debug_exc(l_log_head, l_progress);
1733: END IF;
1734: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1730: x_return_status := FND_API.G_RET_STS_ERROR;
1731: IF g_debug_unexp THEN
1732: PO_DEBUG.debug_exc(l_log_head, l_progress);
1733: END IF;
1734: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1735: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1736: IF g_debug_unexp THEN
1737: PO_DEBUG.debug_exc(l_log_head, l_progress);
1738: END IF;
1731: IF g_debug_unexp THEN
1732: PO_DEBUG.debug_exc(l_log_head, l_progress);
1733: END IF;
1734: WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1735: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1736: IF g_debug_unexp THEN
1737: PO_DEBUG.debug_exc(l_log_head, l_progress);
1738: END IF;
1739: WHEN OTHERS THEN
1736: IF g_debug_unexp THEN
1737: PO_DEBUG.debug_exc(l_log_head, l_progress);
1738: END IF;
1739: WHEN OTHERS THEN
1740: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1741: FND_MSG_PUB.add_exc_msg(g_pkg_name, l_api_name||'.'||l_progress);
1742: IF g_debug_unexp THEN
1743: PO_DEBUG.debug_exc(l_log_head, l_progress);
1744: END IF;
1769: END IF;
1770:
1771: d_progress := 10;
1772:
1773: x_return_status := FND_API.g_ret_sts_success;
1774:
1775: l_is_price_updateable := PO_DOCUMENT_CHECKS_PVT.is_pay_item_price_updateable(
1776: p_line_location_id => p_line_location_id
1777: , p_add_reasons_to_msg_list => p_add_reasons_to_msg_list);
1797: IF (PO_LOG.d_exc) THEN
1798: PO_LOG.exc(d_module, d_progress, SQLCODE || SQLERRM);
1799: PO_LOG.proc_end(d_module);
1800: END IF;
1801: x_return_status := FND_API.g_ret_sts_unexp_error;
1802: x_price_updateable := PO_CORE_S.g_parameter_no;
1803: END;
1804: --
1805:
2088: * tables for processing
2089: * Effects: This procedure runs the document submission checks on passed in
2090: * document.
2091: * Returns:
2092: * x_return_status: FND_API.G_RET_STS_SUCCESS if API succeeds
2093: * FND_API.G_RET_STS_ERROR if API fails
2094: * FND_API.G_RET_STS_UNEXP_ERROR if unexpected error occurs
2095: * x_sub_check_status: FND_API.G_RET_STS_SUCCESS if document passes all
2096: * submission checks, even if warnings are found
2089: * Effects: This procedure runs the document submission checks on passed in
2090: * document.
2091: * Returns:
2092: * x_return_status: FND_API.G_RET_STS_SUCCESS if API succeeds
2093: * FND_API.G_RET_STS_ERROR if API fails
2094: * FND_API.G_RET_STS_UNEXP_ERROR if unexpected error occurs
2095: * x_sub_check_status: FND_API.G_RET_STS_SUCCESS if document passes all
2096: * submission checks, even if warnings are found
2097: * FND_API.G_RET_STS_ERROR if document fails atleast one
2090: * document.
2091: * Returns:
2092: * x_return_status: FND_API.G_RET_STS_SUCCESS if API succeeds
2093: * FND_API.G_RET_STS_ERROR if API fails
2094: * FND_API.G_RET_STS_UNEXP_ERROR if unexpected error occurs
2095: * x_sub_check_status: FND_API.G_RET_STS_SUCCESS if document passes all
2096: * submission checks, even if warnings are found
2097: * FND_API.G_RET_STS_ERROR if document fails atleast one
2098: * submission check (returns at least one error)
2091: * Returns:
2092: * x_return_status: FND_API.G_RET_STS_SUCCESS if API succeeds
2093: * FND_API.G_RET_STS_ERROR if API fails
2094: * FND_API.G_RET_STS_UNEXP_ERROR if unexpected error occurs
2095: * x_sub_check_status: FND_API.G_RET_STS_SUCCESS if document passes all
2096: * submission checks, even if warnings are found
2097: * FND_API.G_RET_STS_ERROR if document fails atleast one
2098: * submission check (returns at least one error)
2099: * x_has_warnings: FND_API.G_TRUE if submission check returns warnings
2093: * FND_API.G_RET_STS_ERROR if API fails
2094: * FND_API.G_RET_STS_UNEXP_ERROR if unexpected error occurs
2095: * x_sub_check_status: FND_API.G_RET_STS_SUCCESS if document passes all
2096: * submission checks, even if warnings are found
2097: * FND_API.G_RET_STS_ERROR if document fails atleast one
2098: * submission check (returns at least one error)
2099: * x_has_warnings: FND_API.G_TRUE if submission check returns warnings
2100: * FND_API.G_FALSE if no warnings are found
2101: * x_msg_data: Contains error msg in case x_return_status returned
2095: * x_sub_check_status: FND_API.G_RET_STS_SUCCESS if document passes all
2096: * submission checks, even if warnings are found
2097: * FND_API.G_RET_STS_ERROR if document fails atleast one
2098: * submission check (returns at least one error)
2099: * x_has_warnings: FND_API.G_TRUE if submission check returns warnings
2100: * FND_API.G_FALSE if no warnings are found
2101: * x_msg_data: Contains error msg in case x_return_status returned
2102: * FND_API.G_RET_STS_ERROR or FND_API.G_RET_STS_UNEXP_ERROR
2103: * x_online_report_id: This id can be used to get all submission check (including
2096: * submission checks, even if warnings are found
2097: * FND_API.G_RET_STS_ERROR if document fails atleast one
2098: * submission check (returns at least one error)
2099: * x_has_warnings: FND_API.G_TRUE if submission check returns warnings
2100: * FND_API.G_FALSE if no warnings are found
2101: * x_msg_data: Contains error msg in case x_return_status returned
2102: * FND_API.G_RET_STS_ERROR or FND_API.G_RET_STS_UNEXP_ERROR
2103: * x_online_report_id: This id can be used to get all submission check (including
2104: * copydoc check and normal po submission check) errors
2098: * submission check (returns at least one error)
2099: * x_has_warnings: FND_API.G_TRUE if submission check returns warnings
2100: * FND_API.G_FALSE if no warnings are found
2101: * x_msg_data: Contains error msg in case x_return_status returned
2102: * FND_API.G_RET_STS_ERROR or FND_API.G_RET_STS_UNEXP_ERROR
2103: * x_online_report_id: This id can be used to get all submission check (including
2104: * copydoc check and normal po submission check) errors
2105: * for given document from online_report_text table.
2106: * x_doc_check_error_record: If x_sub_check_status returned G_RET_STS_ERROR
2259: -- Then merge all data of report 1 and report 2 and generate a new report with a new report id
2260: IF (NVL(l_report_id1_rownum, 0) > 0) THEN
2261:
2262: --Change the x_return_status to success if there is any error/warnings created in the first report(copydoc submission check)
2263: x_return_status := FND_API.G_RET_STS_SUCCESS;
2264: --Also change the x_sub_check_status to FND_API.G_RET_STS_ERROR if there is any error/warnings created in the first report(copydoc submission check)
2265: x_sub_check_status := FND_API.G_RET_STS_ERROR;
2266:
2267: IF ((NVL(l_report_id2_rownum, 0) > 0)) THEN
2260: IF (NVL(l_report_id1_rownum, 0) > 0) THEN
2261:
2262: --Change the x_return_status to success if there is any error/warnings created in the first report(copydoc submission check)
2263: x_return_status := FND_API.G_RET_STS_SUCCESS;
2264: --Also change the x_sub_check_status to FND_API.G_RET_STS_ERROR if there is any error/warnings created in the first report(copydoc submission check)
2265: x_sub_check_status := FND_API.G_RET_STS_ERROR;
2266:
2267: IF ((NVL(l_report_id2_rownum, 0) > 0)) THEN
2268: merge_online_report_id
2261:
2262: --Change the x_return_status to success if there is any error/warnings created in the first report(copydoc submission check)
2263: x_return_status := FND_API.G_RET_STS_SUCCESS;
2264: --Also change the x_sub_check_status to FND_API.G_RET_STS_ERROR if there is any error/warnings created in the first report(copydoc submission check)
2265: x_sub_check_status := FND_API.G_RET_STS_ERROR;
2266:
2267: IF ((NVL(l_report_id2_rownum, 0) > 0)) THEN
2268: merge_online_report_id
2269: (