The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT distinct 'Y'
INTO x_valid_flag
FROM PO_LINE_TYPES
WHERE line_type_id = x_line_type_id
AND SYSDATE < nvl(inactive_date, SYSDATE+1)
AND ((nvl(outside_operation_flag,'N') = 'Y' AND x_wip_install_status = 'I')
OR (nvl(outside_operation_flag, 'N') <> 'Y'));
SELECT distinct 'Y'
INTO x_valid_flag
FROM PO_LOOKUP_CODES
WHERE lookup_type = 'TRANSACTION REASON'
AND lookup_code = x_transaction_reason_code
AND SYSDATE < nvl(inactive_date, SYSDATE+1);
** Nullify some attributes which will be inserted from other places
** Validate for correct line_type_id (may not need it ?)
** Validate individual item on line
** Validate transaction reason code
** Get next po_line_id
*************************************************************/
PROCEDURE validate_line(
x_action_code IN VARCHAR2,
x_to_doc_subtype IN po_headers.type_lookup_code%TYPE,
x_po_line_record IN OUT NOCOPY po_lines%ROWTYPE,
x_orig_po_line_id IN po_lines.po_line_id%TYPE,
x_wip_install_status IN VARCHAR2,
x_sob_id IN financials_system_parameters.set_of_books_id%TYPE,
x_inv_org_id IN financials_system_parameters.inventory_organization_id%TYPE,
x_po_header_id IN po_lines.po_header_id%TYPE,
x_online_report_id IN po_online_report_text.online_report_id%TYPE,
x_sequence IN OUT NOCOPY po_online_report_text.sequence%TYPE,
x_copy_price IN BOOLEAN,
x_return_code OUT NOCOPY NUMBER,
p_is_complex_work_po IN BOOLEAN, --
p_is_clm_doc IN VARCHAR2 DEFAULT 'N'--
) IS
COPYDOC_LINE_FAILURE EXCEPTION;
SELECT validate_flag,
category_set_id
INTO l_validate_flag,
l_category_set_id
FROM MTL_DEFAULT_SETS_VIEW MDSV
WHERE MDSV.functional_area_id = 2;
SELECT distinct 'Y'
INTO x_valid_flag
FROM MTL_CATEGORY_SET_VALID_CATS MCSVC,
MTL_CATEGORIES_VL MCV
WHERE MCSVC.category_id = x_po_line_record.category_id
AND MCSVC.category_set_id = l_category_set_id
AND MCV.category_id = MCSVC.category_id
AND sysdate < nvl(MCV.disable_date, sysdate+1)
AND MCV.enabled_flag = 'Y';
SELECT distinct 'Y'
INTO x_valid_flag
FROM MTL_CATEGORIES_VL MCV
WHERE MCV.category_id = x_po_line_record.category_id
AND sysdate < nvl(MCV.disable_date, sysdate+1)
AND MCV.enabled_flag = 'Y';
SELECT po_header_id
INTO x_orig_po_header_id
FROM po_lines
WHERE po_line_id = x_orig_po_line_id;
select quote_type_lookup_code,
type_lookup_code
into x_quote_sub_type,
x_quote_type
from po_headers
where po_header_id = x_orig_po_header_id;
SELECT quotation_class_code
INTO x_quotation_class_code
FROM po_headers
WHERE po_header_id = x_orig_po_header_id;
SELECT unit_price
INTO x_blanket_price
FROM po_lines
WHERE po_header_id = x_orig_po_header_id
AND po_line_id = x_orig_po_line_id;
SELECT order_type_lookup_code
INTO x_order_type_lookup_code
FROM po_line_types
WHERE line_type_id = x_po_line_record.line_type_id;
x_po_line_record.last_updated_by := fnd_global.user_id;
x_po_line_record.last_update_date := SYSDATE;
x_po_line_record.last_update_login := fnd_global.login_id;
x_po_line_record.program_update_date := NULL;
select nvl(sum(poll.quantity), x_po_line_record.quantity)
into x_qty
from po_line_locations poll
where poll.po_line_id = x_po_line_record.po_line_id
and poll.po_release_id is null
and poll.payment_type <> 'PREPAYMENT'; --
SELECT po_lines_s.nextval
INTO x_po_line_record.po_line_id
FROM SYS.DUAL;