DBA Data[Home] [Help]

APPS.PO_PDOI_LINE_PROCESS_PVT SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 370

  SELECT intf_headers.interface_header_id,
         intf_lines.interface_line_id,
         intf_lines.line_num
  FROM   po_lines_interface intf_lines,
         po_headers_interface intf_headers,
         po_lines txn_lines
  WHERE  intf_lines.interface_header_id = intf_headers.interface_header_id
  AND    intf_headers.po_header_id = txn_lines.po_header_id
  AND    intf_lines.processing_id = p_request_processing_id
  AND    intf_headers.processing_round_num = p_request_processing_round_num
  AND    intf_headers.processing_id = p_request_processing_id
  AND    intf_lines.line_num = txn_lines.line_num
  AND    intf_headers.action = PO_PDOI_CONSTANTS.g_ACTION_UPDATE;
Line: 387

  SELECT intf_headers.interface_header_id,
         intf_lines.interface_line_id,
         intf_lines.line_num
  FROM   po_headers_interface intf_headers,
         po_lines_interface intf_lines,
         po_lines_draft_all draft_lines
  WHERE  intf_lines.interface_header_id = intf_headers.interface_header_id
  AND    intf_headers.draft_id = draft_lines.draft_id
  AND    intf_headers.po_header_id = draft_lines.po_header_id
  AND    intf_lines.processing_id = p_request_processing_id
  AND    intf_headers.processing_round_num = p_request_processing_round_num
  AND    intf_headers.processing_id = p_request_processing_id
  AND    intf_lines.line_num = draft_lines.line_num
  AND    intf_headers.action = PO_PDOI_CONSTANTS.g_ACTION_UPDATE;
Line: 589

  SELECT intf_lines.interface_line_id,
         intf_headers.interface_header_id,
         intf_lines.action
  FROM   po_lines_interface intf_lines,
         po_headers_interface intf_headers
  WHERE  intf_lines.interface_header_id = intf_headers.interface_header_id
  AND    intf_lines.processing_id = p_request_processing_id
  AND    intf_headers.processing_round_num = p_request_processing_round_num
  AND    intf_headers.processing_id = p_request_processing_id
  AND    NVL(intf_lines.action, PO_PDOI_CONSTANTS.g_ACTION_ADD) <>
         PO_PDOI_CONSTANTS.g_ACTION_ADD;
Line: 723

      SELECT intf_lines.interface_line_id,
             intf_lines.interface_header_id,
             intf_lines.po_header_id,
             NULL, -- intf_lines.po_line_id,
             intf_lines.action,
             intf_lines.document_num,
             intf_lines.item,
             intf_lines.vendor_product_num,
             intf_lines.supplier_part_auxid,
             intf_lines.item_id,
             intf_lines.item_revision,
             intf_lines.job_business_group_name,
             intf_lines.job_business_group_id,
             intf_lines.job_name,
             intf_lines.job_id,
             intf_lines.category,
             intf_lines.category_id,
             intf_lines.ip_category_name,
             intf_lines.ip_category_id,
             intf_lines.uom_code,
             intf_lines.unit_of_measure,
             intf_lines.line_type,
             intf_lines.line_type_id,
             intf_lines.un_number,
             intf_lines.un_number_id,
             intf_lines.hazard_class,
             intf_lines.hazard_class_id,
             intf_lines.template_name,
             intf_lines.template_id,
             intf_lines.item_description,
             intf_lines.unit_price,
             intf_lines.base_unit_price,
             intf_lines.from_header_id,
             intf_lines.from_line_id,
             intf_lines.list_price_per_unit,
             intf_lines.market_price,
             intf_lines.capital_expense_flag,
             intf_lines.min_release_amount,
             intf_lines.allow_price_override_flag,
             intf_lines.price_type,
             intf_lines.price_break_lookup_code,
             intf_lines.closed_code,
             intf_lines.quantity,
             intf_lines.line_num,
             intf_lines.shipment_num,
             intf_lines.price_chg_accept_flag,
             intf_lines.effective_date,
             intf_lines.expiration_date,
             intf_lines.line_attribute14,
             intf_lines.price_update_tolerance,
             intf_lines.line_loc_populated_flag,
             -- << PDOI for Complex PO Project: Start >>
             intf_lines.retainage_rate,
             intf_lines.max_retainage_amount,
             intf_lines.progress_payment_rate,
             intf_lines.recoupment_rate,
             intf_lines.advance_amount,
             -- << PDOI for Complex PO Project: End >>
             intf_lines.negotiated_by_preparer_flag,
             intf_lines.amount,
             intf_lines.contractor_last_name,
             intf_lines.contractor_first_name,
             intf_lines.over_tolerance_error_flag,
             intf_lines.not_to_exceed_price,
             intf_lines.po_release_id,
             intf_lines.release_num,
             intf_lines.source_shipment_id,
             intf_lines.contract_num,
             intf_lines.contract_id,
             intf_lines.type_1099,
             intf_lines.closed_by,
             intf_lines.closed_date,
             intf_lines.committed_amount,
             intf_lines.qty_rcv_exception_code,
             intf_lines.weight_uom_code,
             intf_lines.volume_uom_code,
             intf_lines.secondary_unit_of_measure,
             intf_lines.secondary_quantity,
             intf_lines.preferred_grade,
             intf_lines.process_code,
             NULL, -- parent_interface_line_id -- bug5149827
             intf_lines.file_line_language, -- bug 5489942

             -- standard who columns
             intf_lines.last_updated_by,
             intf_lines.last_update_date,
             intf_lines.last_update_login,
             intf_lines.creation_date,
             intf_lines.created_by,
             intf_lines.request_id,
             intf_lines.program_application_id,
             intf_lines.program_id,
             intf_lines.program_update_date,

             -- attributes read from headers
             intf_headers.draft_id,
             intf_headers.action,
             intf_headers.po_header_id,
             draft_headers.vendor_id,
             draft_headers.min_release_amount,
             draft_headers.start_date,
             draft_headers.end_date,
             draft_headers.global_agreement_flag,
             draft_headers.currency_code,
             draft_headers.created_language,
             draft_headers.style_id,
             draft_headers.rate_type,
	         draft_headers.rate,   -- bug 9194215

             -- txn table columns
             NULL, -- order_type_lookup_code
             NULL, -- purchase_basis
             NULL, -- matching_basis
             NULL, -- unordered_flag
             NULL, -- cancel_flag
             NULL, -- quantity_committed
             NULL, -- tax_attribute_update_code
             intf_lines.clm_info_flag,   /* 10354034 */
             intf_lines.group_line_id, --PDOI CLM Integration

             DECODE(intf_lines.process_code,
                    PO_PDOI_CONSTANTS.g_PROCESS_CODE_VAL_AND_REJECT,
                    FND_API.g_TRUE, FND_API.g_FALSE), -- error_flag_tbl
             FND_API.g_FALSE,                    -- need_to_reject_flag_tbl
             FND_API.g_FALSE,                    -- create_line_loc_tbl
             -1,                                 -- group_num
             NULL,                               -- origin_line_num
             FND_API.g_FALSE,                    -- match_line_found
             NULL,                                -- allow_desc_update_flag_tbl
             --CLM PDOI Integration
             intf_lines.contract_type,
             intf_lines.cost_constraint,
             intf_lines.note_to_vendor,
             intf_lines.oke_contract_version_id,
             intf_lines.oke_contract_header_id,
             intf_lines.clm_option_indicator,
             intf_lines.clm_base_line_num,
             intf_lines.clm_option_num,
             intf_lines.clm_option_from_date,
             intf_lines.clm_option_to_date,
             Decode(PO_PDOI_PARAMS.g_request.document_type,
                    PO_PDOI_CONSTANTS.g_DOC_TYPE_STANDARD, Nvl(intf_lines.clm_idc_type,'IDC_NA'),
                    intf_lines.clm_idc_type),
             intf_lines.line_num_display,
             intf_lines.clm_funded_flag,
             intf_lines.user_document_status,
             intf_lines.clm_exercised_flag,
             intf_lines.clm_exercised_date,
             intf_lines.clm_min_total_amount,
             intf_lines.clm_max_total_amount,
             intf_lines.clm_min_total_quantity,
             intf_lines.clm_max_total_quantity,
             intf_lines.clm_min_order_amount,
             intf_lines.clm_max_order_amount,
             intf_lines.clm_min_order_quantity,
             intf_lines.clm_max_order_quantity,
             intf_lines.clm_total_amount_ordered,
             intf_lines.clm_total_quantity_ordered,
             intf_lines.clm_period_perf_end_date,
             intf_lines.clm_period_perf_start_date,
             intf_lines.contract_type_display,
             intf_lines.cost_constraint_display,
             intf_lines.clm_idc_type_display,
             intf_lines.clm_base_line_num_disp,
             intf_lines.from_header_disp,
             intf_lines.from_line_disp

      FROM   po_lines_interface intf_lines,
             po_headers_interface intf_headers,
             po_headers_draft_all draft_headers
      WHERE  intf_lines.interface_header_id = intf_headers.interface_header_id
      AND    intf_headers.draft_id = draft_headers.draft_id
      AND    intf_headers.po_header_id = draft_headers.po_header_id
      AND    intf_lines.processing_id = PO_PDOI_PARAMS.g_processing_id
      AND    intf_headers.processing_round_num = PO_PDOI_PARAMS.g_current_round_num
      AND    intf_headers.processing_id = PO_PDOI_PARAMS.g_processing_id
      AND    intf_lines.interface_line_id > p_max_intf_line_id
      AND    intf_headers.action IN (PO_PDOI_CONSTANTS.g_ACTION_ORIGINAL,
                                     PO_PDOI_CONSTANTS.g_ACTION_REPLACE)
      --PDOI CLM Integration
      --Process only priced lines which in commercial flow are normal lines
      AND    Nvl(intf_lines.clm_info_flag,'N') = 'N'

      UNION ALL

      SELECT intf_lines.interface_line_id,
             intf_lines.interface_header_id,
             intf_lines.po_header_id,
             NULL, -- intf_lines.po_line_id,
             intf_lines.action,
             intf_lines.document_num,
             intf_lines.item,
             intf_lines.vendor_product_num,
             intf_lines.supplier_part_auxid,
             intf_lines.item_id,
             intf_lines.item_revision,
             intf_lines.job_business_group_name,
             intf_lines.job_business_group_id,
             intf_lines.job_name,
             intf_lines.job_id,
             intf_lines.category,
             intf_lines.category_id,
             intf_lines.ip_category_name,
             intf_lines.ip_category_id,
             intf_lines.uom_code,
             intf_lines.unit_of_measure,
             intf_lines.line_type,
             intf_lines.line_type_id,
             intf_lines.un_number,
             intf_lines.un_number_id,
             intf_lines.hazard_class,
             intf_lines.hazard_class_id,
             intf_lines.template_name,
             intf_lines.template_id,
             intf_lines.item_description,
             intf_lines.unit_price,
             intf_lines.base_unit_price,
             intf_lines.from_header_id,
             intf_lines.from_line_id,
             intf_lines.list_price_per_unit,
             intf_lines.market_price,
             intf_lines.capital_expense_flag,
             intf_lines.min_release_amount,
             intf_lines.allow_price_override_flag,
             intf_lines.price_type,
             intf_lines.price_break_lookup_code,
             intf_lines.closed_code,
             intf_lines.quantity,
             intf_lines.line_num,
             intf_lines.shipment_num,
             intf_lines.price_chg_accept_flag,
             intf_lines.effective_date,
             intf_lines.expiration_date,
             intf_lines.line_attribute14,
             intf_lines.price_update_tolerance,
             intf_lines.line_loc_populated_flag,
             -- << PDOI for Complex PO Project: Start >>
             intf_lines.retainage_rate,
             intf_lines.max_retainage_amount,
             intf_lines.progress_payment_rate,
             intf_lines.recoupment_rate,
             intf_lines.advance_amount,
             -- << PDOI for Complex PO Project: End >>
             intf_lines.negotiated_by_preparer_flag,
             intf_lines.amount,
             intf_lines.contractor_last_name,
             intf_lines.contractor_first_name,
             intf_lines.over_tolerance_error_flag,
             intf_lines.not_to_exceed_price,
             intf_lines.po_release_id,
             intf_lines.release_num,
             intf_lines.source_shipment_id,
             intf_lines.contract_num,
             intf_lines.contract_id,
             intf_lines.type_1099,
             intf_lines.closed_by,
             intf_lines.closed_date,
             intf_lines.committed_amount,
             intf_lines.qty_rcv_exception_code,
             intf_lines.weight_uom_code,
             intf_lines.volume_uom_code,
             intf_lines.secondary_unit_of_measure,
             intf_lines.secondary_quantity,
             intf_lines.preferred_grade,
             intf_lines.process_code,
             NULL, -- parent_interface_line_id -- bug5149827
             intf_lines.file_line_language, -- bug 5489942

             -- standard who columns
             intf_lines.last_updated_by,
             intf_lines.last_update_date,
             intf_lines.last_update_login,
             intf_lines.creation_date,
             intf_lines.created_by,
             intf_lines.request_id,
             intf_lines.program_application_id,
             intf_lines.program_id,
             intf_lines.program_update_date,

             -- attributes read from header
             intf_headers.draft_id,
             intf_headers.action,
             intf_headers.po_header_id,
             txn_headers.vendor_id,
             txn_headers.min_release_amount,
             txn_headers.start_date,
             txn_headers.end_date,
             txn_headers.global_agreement_flag,
             txn_headers.currency_code,
             txn_headers.created_language,
             txn_headers.style_id,
             txn_headers.rate_type,
	         txn_headers.rate,  -- bug 9194215

             -- txn table columns
             NULL, -- order_type_lookup_code
             NULL, -- purchase_basis
             NULL, -- matching_basis
             NULL, -- unordered_flag
             NULL, -- cancel_flag
             NULL, -- quantity_committed
             NULL, -- tax_attribute_update_code
             intf_lines.clm_info_flag, /* 10354034 */
             intf_lines.group_line_id, --CLM PDOI Integration

             DECODE(intf_lines.process_code, PO_PDOI_CONSTANTS.g_PROCESS_CODE_VAL_AND_REJECT,
               FND_API.g_TRUE, FND_API.g_FALSE),  -- error_flag_tbl
             FND_API.G_FALSE,                     -- need_to_reject_flag_tbl
             FND_API.g_FALSE,                     -- create_line_loc_tbl
             -1,                                  -- group_num
             NULL,                               -- origin_line_num
             FND_API.g_FALSE,                    -- match_line_found
             NULL,                                -- allow_desc_update_flag_tbl
             --CLM PDOI Integration
             intf_lines.contract_type,
             intf_lines.cost_constraint,
             intf_lines.note_to_vendor,
             intf_lines.oke_contract_version_id,
             intf_lines.oke_contract_header_id,
             intf_lines.clm_option_indicator,
             intf_lines.clm_base_line_num,
             intf_lines.clm_option_num,
             intf_lines.clm_option_from_date,
             intf_lines.clm_option_to_date,
             Decode(PO_PDOI_PARAMS.g_request.document_type,
                    PO_PDOI_CONSTANTS.g_DOC_TYPE_STANDARD, Nvl(intf_lines.clm_idc_type,'IDC_NA'),
                    intf_lines.clm_idc_type),
             intf_lines.line_num_display,
             intf_lines.clm_funded_flag,
             intf_lines.user_document_status,
             intf_lines.clm_exercised_flag,
             intf_lines.clm_exercised_date,
             intf_lines.clm_min_total_amount,
             intf_lines.clm_max_total_amount,
             intf_lines.clm_min_total_quantity,
             intf_lines.clm_max_total_quantity,
             intf_lines.clm_min_order_amount,
             intf_lines.clm_max_order_amount,
             intf_lines.clm_min_order_quantity,
             intf_lines.clm_max_order_quantity,
             intf_lines.clm_total_amount_ordered,
             intf_lines.clm_total_quantity_ordered,
             intf_lines.clm_period_perf_end_date,
             intf_lines.clm_period_perf_start_date,
             intf_lines.contract_type_display,
             intf_lines.cost_constraint_display,
             intf_lines.clm_idc_type_display,
             intf_lines.clm_base_line_num_disp,
             intf_lines.from_header_disp,
             intf_lines.from_line_disp


      FROM   po_lines_interface intf_lines,
             po_headers_interface intf_headers,
             po_headers txn_headers
      WHERE  intf_lines.interface_header_id = intf_headers.interface_header_id
      AND    intf_headers.po_header_id = txn_headers.po_header_id
      AND    intf_lines.processing_id = PO_PDOI_PARAMS.g_processing_id
      AND    intf_headers.processing_round_num = PO_PDOI_PARAMS.g_current_round_num
      AND    intf_headers.processing_id = PO_PDOI_PARAMS.g_processing_id
      AND    intf_lines.interface_line_id > p_max_intf_line_id
      AND    intf_headers.action = PO_PDOI_CONSTANTS.g_ACTION_UPDATE
      AND    PO_PDOI_PARAMS.g_request.document_type = PO_PDOI_CONSTANTS.g_DOC_TYPE_STANDARD
      --PDOI CLM Integration
      --Process only priced lines which in commercial flow are normal lines
      AND    Nvl(intf_lines.clm_info_flag,'N') = 'N'
      ORDER BY 1;
Line: 1094

      SELECT intf_lines.interface_line_id,
             intf_lines.interface_header_id,
             intf_lines.po_header_id,
             NULL, -- intf_lines.po_line_id,
             intf_lines.action,
             intf_lines.document_num,
             intf_lines.item,
             intf_lines.vendor_product_num,
             intf_lines.supplier_part_auxid,
             intf_lines.item_id,
             intf_lines.item_revision,
             intf_lines.job_business_group_name,
             intf_lines.job_business_group_id,
             intf_lines.job_name,
             intf_lines.job_id,
             intf_lines.category,
             intf_lines.category_id,
             intf_lines.ip_category_name,
             intf_lines.ip_category_id,
             intf_lines.uom_code,
             intf_lines.unit_of_measure,
             intf_lines.line_type,
             intf_lines.line_type_id,
             intf_lines.un_number,
             intf_lines.un_number_id,
             intf_lines.hazard_class,
             intf_lines.hazard_class_id,
             intf_lines.template_name,
             intf_lines.template_id,
             intf_lines.item_description,
             intf_lines.unit_price,
             intf_lines.base_unit_price,
             intf_lines.from_header_id,
             intf_lines.from_line_id,
             intf_lines.list_price_per_unit,
             intf_lines.market_price,
             intf_lines.capital_expense_flag,
             intf_lines.min_release_amount,
             intf_lines.allow_price_override_flag,
             intf_lines.price_type,
             intf_lines.price_break_lookup_code,
             intf_lines.closed_code,
             intf_lines.quantity,
             intf_lines.line_num,
             intf_lines.shipment_num,
             intf_lines.price_chg_accept_flag,
             intf_lines.effective_date,
             intf_lines.expiration_date,
             intf_lines.line_attribute14,
             intf_lines.price_update_tolerance,
             intf_lines.line_loc_populated_flag,
             -- << PDOI for Complex PO Project: Start >>
             intf_lines.retainage_rate,
             intf_lines.max_retainage_amount,
             intf_lines.progress_payment_rate,
             intf_lines.recoupment_rate,
             intf_lines.advance_amount,
             -- << PDOI for Complex PO Project: End >>
             intf_lines.negotiated_by_preparer_flag,
             intf_lines.amount,
             intf_lines.contractor_last_name,
             intf_lines.contractor_first_name,
             intf_lines.over_tolerance_error_flag,
             intf_lines.not_to_exceed_price,
             intf_lines.po_release_id,
             intf_lines.release_num,
             intf_lines.source_shipment_id,
             intf_lines.contract_num,
             intf_lines.contract_id,
             intf_lines.type_1099,
             intf_lines.closed_by,
             intf_lines.closed_date,
             intf_lines.committed_amount,
             intf_lines.qty_rcv_exception_code,
             intf_lines.weight_uom_code,
             intf_lines.volume_uom_code,
             intf_lines.secondary_unit_of_measure,
             intf_lines.secondary_quantity,
             intf_lines.preferred_grade,
             intf_lines.process_code,
             NULL, -- parent_interface_line_id -- bug5149827
             intf_lines.file_line_language, -- bug 5489942

             -- standard who columns
             intf_lines.last_updated_by,
             intf_lines.last_update_date,
             intf_lines.last_update_login,
             intf_lines.creation_date,
             intf_lines.created_by,
             intf_lines.request_id,
             intf_lines.program_application_id,
             intf_lines.program_id,
             intf_lines.program_update_date,

             -- attributes read from header
             intf_headers.draft_id,
             intf_headers.action,
             intf_headers.po_header_id,
             txn_headers.vendor_id,
             txn_headers.min_release_amount,
             txn_headers.start_date,
             txn_headers.end_date,
             txn_headers.global_agreement_flag,
             txn_headers.currency_code,
             txn_headers.created_language,
             txn_headers.style_id,
             txn_headers.rate_type,
	         txn_headers.rate,  -- bug 9194215

             -- txn table columns
             NULL, -- order_type_lookup_code
             NULL, -- purchase_basis
             NULL, -- matching_basis
             NULL, -- unordered_flag
             NULL, -- cancel_flag
             NULL, -- quantity_committed
             NULL, -- tax_attribute_update_code
             intf_lines.clm_info_flag, /* 10354034 */
             intf_lines.group_line_id, --CLM PDOI Integration

             DECODE(intf_lines.process_code, PO_PDOI_CONSTANTS.g_PROCESS_CODE_VAL_AND_REJECT,
               FND_API.g_TRUE, FND_API.g_FALSE),   -- error_flag_tbl
             FND_API.G_FALSE,                      -- need_to_reject_flag_tbl
             FND_API.g_FALSE,                      -- create_line_loc_tbl
             -1,                                   -- group_num
             NULL,                                 -- origin_line_num
             FND_API.g_FALSE,                      -- match_line_found
             NULL,                                 -- allow_desc_update_flag_tbl
             --CLM PDOI Integration
             intf_lines.contract_type,
             intf_lines.cost_constraint,
             intf_lines.note_to_vendor,
             intf_lines.oke_contract_version_id,
             intf_lines.oke_contract_header_id,
             intf_lines.clm_option_indicator,
             intf_lines.clm_base_line_num,
             intf_lines.clm_option_num,
             intf_lines.clm_option_from_date,
             intf_lines.clm_option_to_date,
             Decode(PO_PDOI_PARAMS.g_request.document_type,
                    PO_PDOI_CONSTANTS.g_DOC_TYPE_STANDARD, Nvl(intf_lines.clm_idc_type,'IDC_NA'),
                    intf_lines.clm_idc_type),
             intf_lines.line_num_display,
             intf_lines.clm_funded_flag,
             intf_lines.user_document_status,
             intf_lines.clm_exercised_flag,
             intf_lines.clm_exercised_date,
             intf_lines.clm_min_total_amount,
             intf_lines.clm_max_total_amount,
             intf_lines.clm_min_total_quantity,
             intf_lines.clm_max_total_quantity,
             intf_lines.clm_min_order_amount,
             intf_lines.clm_max_order_amount,
             intf_lines.clm_min_order_quantity,
             intf_lines.clm_max_order_quantity,
             intf_lines.clm_total_amount_ordered,
             intf_lines.clm_total_quantity_ordered,
             intf_lines.clm_period_perf_end_date,
             intf_lines.clm_period_perf_start_date,
             intf_lines.contract_type_display,
             intf_lines.cost_constraint_display,
             intf_lines.clm_idc_type_display,
             intf_lines.clm_base_line_num_disp,
             intf_lines.from_header_disp,
             intf_lines.from_line_disp

      FROM   po_lines_interface intf_lines,
             po_headers_interface intf_headers,
             po_headers txn_headers
      WHERE  intf_lines.interface_header_id = intf_headers.interface_header_id
      AND    intf_headers.po_header_id = txn_headers.po_header_id
      AND    intf_lines.processing_id = PO_PDOI_PARAMS.g_processing_id
      AND    intf_headers.processing_round_num = PO_PDOI_PARAMS.g_current_round_num
      AND    intf_headers.processing_id = PO_PDOI_PARAMS.g_processing_id
      AND    intf_lines.interface_line_id > p_max_intf_line_id
      AND    intf_headers.action = PO_PDOI_CONSTANTS.g_ACTION_UPDATE
      AND    PO_PDOI_PARAMS.g_request.document_type IN
               (PO_PDOI_CONSTANTS.g_DOC_TYPE_BLANKET,
                PO_PDOI_CONSTANTS.g_DOC_TYPE_QUOTATION)
      AND    intf_lines.action = PO_PDOI_CONSTANTS.g_ACTION_ADD
      --PDOI CLM Integration
      --Process only priced lines which in commercial flow are normal lines
      AND    Nvl(intf_lines.clm_info_flag,'N') = 'N'

      ORDER BY intf_lines.interface_line_id;
Line: 1283

      SELECT intf_lines.interface_line_id,
             intf_lines.interface_header_id,
             intf_lines.po_header_id,
             NULL, -- intf_lines.po_line_id,
             intf_lines.action,
             intf_lines.document_num,
             intf_lines.item,
             intf_lines.vendor_product_num,
             intf_lines.supplier_part_auxid,
             intf_lines.item_id,
             intf_lines.item_revision,
             intf_lines.job_business_group_name,
             intf_lines.job_business_group_id,
             intf_lines.job_name,
             intf_lines.job_id,
             intf_lines.category,
             intf_lines.category_id,
             intf_lines.ip_category_name,
             intf_lines.ip_category_id,
             intf_lines.uom_code,
             intf_lines.unit_of_measure,
             intf_lines.line_type,
             intf_lines.line_type_id,
             intf_lines.un_number,
             intf_lines.un_number_id,
             intf_lines.hazard_class,
             intf_lines.hazard_class_id,
             intf_lines.template_name,
             intf_lines.template_id,
             intf_lines.item_description,
             intf_lines.unit_price,
             intf_lines.base_unit_price,
             intf_lines.from_header_id,
             intf_lines.from_line_id,
             intf_lines.list_price_per_unit,
             intf_lines.market_price,
             intf_lines.capital_expense_flag,
             intf_lines.min_release_amount,
             intf_lines.allow_price_override_flag,
             intf_lines.price_type,
             intf_lines.price_break_lookup_code,
             intf_lines.closed_code,
             intf_lines.quantity,
             intf_lines.line_num,
             intf_lines.shipment_num,
             intf_lines.price_chg_accept_flag,
             intf_lines.effective_date,
             intf_lines.expiration_date,
             intf_lines.line_attribute14,
             intf_lines.price_update_tolerance,
             intf_lines.line_loc_populated_flag,
             -- << PDOI for Complex PO Project: Start >>
             intf_lines.retainage_rate,
             intf_lines.max_retainage_amount,
             intf_lines.progress_payment_rate,
             intf_lines.recoupment_rate,
             intf_lines.advance_amount,
             -- << PDOI for Complex PO Project: End >>
             intf_lines.negotiated_by_preparer_flag,
             intf_lines.amount,
             intf_lines.contractor_last_name,
             intf_lines.contractor_first_name,
             intf_lines.over_tolerance_error_flag,
             intf_lines.not_to_exceed_price,
             intf_lines.po_release_id,
             intf_lines.release_num,
             intf_lines.source_shipment_id,
             intf_lines.contract_num,
             intf_lines.contract_id,
             intf_lines.type_1099,
             intf_lines.closed_by,
             intf_lines.closed_date,
             intf_lines.committed_amount,
             intf_lines.qty_rcv_exception_code,
             intf_lines.weight_uom_code,
             intf_lines.volume_uom_code,
             intf_lines.secondary_unit_of_measure,
             intf_lines.secondary_quantity,
             intf_lines.preferred_grade,
             intf_lines.process_code,
             NULL, -- parent_interface_line_id -- bug5149827
             intf_lines.file_line_language, -- bug 5489942

             -- standard who columns
             intf_lines.last_updated_by,
             intf_lines.last_update_date,
             intf_lines.last_update_login,
             intf_lines.creation_date,
             intf_lines.created_by,
             intf_lines.request_id,
             intf_lines.program_application_id,
             intf_lines.program_id,
             intf_lines.program_update_date,

             -- attributes read from header
             intf_headers.draft_id,
             intf_headers.action,
             intf_headers.po_header_id,
             txn_headers.vendor_id,
             txn_headers.min_release_amount,
             txn_headers.start_date,
             txn_headers.end_date,
             txn_headers.global_agreement_flag,
             txn_headers.currency_code,
             txn_headers.created_language,
             txn_headers.style_id,
             txn_headers.rate_type,
	         txn_headers.rate,  -- bug 9194215

             -- txn table columns
             NULL, -- order_type_lookup_code
             NULL, -- purchase_basis
             NULL, -- matching_basis
             NULL, -- unordered_flag
             NULL, -- cancel_flag
             NULL, -- quantity_committed
             NULL, -- tax_attribute_update_code
             intf_lines.clm_info_flag,   /* 10354034 */
             intf_lines.group_line_id, --CLM PDOI Integration


             DECODE(intf_lines.process_code, PO_PDOI_CONSTANTS.g_PROCESS_CODE_VAL_AND_REJECT,
               FND_API.g_TRUE, FND_API.g_FALSE),   -- error_flag_tbl
             FND_API.G_FALSE,                      -- need_to_reject_flag_tbl
             FND_API.g_FALSE,                      -- create_line_loc_tbl
             -1,                                   -- group_num
             NULL,                                 -- origin_line_num
             FND_API.g_FALSE,                      -- match_line_found
             NULL,                                -- allow_desc_update_flag_tbl
             --clm pdoi integration
             intf_lines.contract_type,
             intf_lines.cost_constraint,
             intf_lines.note_to_vendor,
             intf_lines.oke_contract_version_id,
             intf_lines.oke_contract_header_id,
             intf_lines.clm_option_indicator,
             intf_lines.clm_base_line_num,
             intf_lines.clm_option_num,
             intf_lines.clm_option_from_date,
             intf_lines.clm_option_to_date,
             Decode(PO_PDOI_PARAMS.g_request.document_type,
                    PO_PDOI_CONSTANTS.g_DOC_TYPE_STANDARD, Nvl(intf_lines.clm_idc_type,'IDC_NA'),
                    intf_lines.clm_idc_type),
             intf_lines.line_num_display,
             intf_lines.clm_funded_flag,
             intf_lines.user_document_status,
             intf_lines.clm_exercised_flag,
             intf_lines.clm_exercised_date,
             intf_lines.clm_min_total_amount,
             intf_lines.clm_max_total_amount,
             intf_lines.clm_min_total_quantity,
             intf_lines.clm_max_total_quantity,
             intf_lines.clm_min_order_amount,
             intf_lines.clm_max_order_amount,
             intf_lines.clm_min_order_quantity,
             intf_lines.clm_max_order_quantity,
             intf_lines.clm_total_amount_ordered,
             intf_lines.clm_total_quantity_ordered,
             intf_lines.clm_period_perf_end_date,
             intf_lines.clm_period_perf_start_date,
             intf_lines.contract_type_display,
             intf_lines.cost_constraint_display,
             intf_lines.clm_idc_type_display,
             intf_lines.clm_base_line_num_disp,
             intf_lines.from_header_disp,
             intf_lines.from_line_disp

      FROM   po_lines_interface intf_lines,
             po_headers_interface intf_headers,
             po_headers txn_headers
      WHERE  intf_lines.interface_header_id = intf_headers.interface_header_id
      AND    intf_headers.po_header_id = txn_headers.po_header_id
      AND    intf_lines.processing_id = PO_PDOI_PARAMS.g_processing_id
      AND    intf_headers.processing_round_num = PO_PDOI_PARAMS.g_current_round_num
      AND    intf_headers.processing_id = PO_PDOI_PARAMS.g_processing_id
      AND    intf_lines.interface_line_id > p_max_intf_line_id
      AND    intf_headers.action = PO_PDOI_CONSTANTS.g_ACTION_UPDATE
      AND    PO_PDOI_PARAMS.g_request.document_type IN
               (PO_PDOI_CONSTANTS.g_DOC_TYPE_BLANKET,
                PO_PDOI_CONSTANTS.g_DOC_TYPE_QUOTATION)
      AND    intf_lines.action IS NULL
      AND    NOT (intf_lines.item IS NULL AND
                  intf_lines.vendor_product_num IS NULL AND
                  intf_lines.job_name IS NULL AND
                  intf_lines.item_description IS NOT NULL)
      --PDOI CLM Integration
      --Process only priced lines which in commercial flow are normal lines
      AND    Nvl(intf_lines.clm_info_flag,'N') = 'N'

      ORDER BY intf_lines.interface_line_id;
Line: 1477

      SELECT intf_lines.interface_line_id,
             intf_lines.interface_header_id,
             intf_lines.po_header_id,
             NULL, -- intf_lines.po_line_id,
             intf_lines.action,
             intf_lines.document_num,
             intf_lines.item,
             intf_lines.vendor_product_num,
             intf_lines.supplier_part_auxid,
             intf_lines.item_id,
             intf_lines.item_revision,
             intf_lines.job_business_group_name,
             intf_lines.job_business_group_id,
             intf_lines.job_name,
             intf_lines.job_id,
             intf_lines.category,
             intf_lines.category_id,
             intf_lines.ip_category_name,
             intf_lines.ip_category_id,
             intf_lines.uom_code,
             intf_lines.unit_of_measure,
             intf_lines.line_type,
             intf_lines.line_type_id,
             intf_lines.un_number,
             intf_lines.un_number_id,
             intf_lines.hazard_class,
             intf_lines.hazard_class_id,
             intf_lines.template_name,
             intf_lines.template_id,
             intf_lines.item_description,
             intf_lines.unit_price,
             intf_lines.base_unit_price,
             intf_lines.from_header_id,
             intf_lines.from_line_id,
             intf_lines.list_price_per_unit,
             intf_lines.market_price,
             intf_lines.capital_expense_flag,
             intf_lines.min_release_amount,
             intf_lines.allow_price_override_flag,
             intf_lines.price_type,
             intf_lines.price_break_lookup_code,
             intf_lines.closed_code,
             intf_lines.quantity,
             intf_lines.line_num,
             intf_lines.shipment_num,
             intf_lines.price_chg_accept_flag,
             intf_lines.effective_date,
             intf_lines.expiration_date,
             intf_lines.line_attribute14,
             intf_lines.price_update_tolerance,
             intf_lines.line_loc_populated_flag,
             -- << PDOI for Complex PO Project: Start >>
             intf_lines.retainage_rate,
             intf_lines.max_retainage_amount,
             intf_lines.progress_payment_rate,
             intf_lines.recoupment_rate,
             intf_lines.advance_amount,
             -- << PDOI for Complex PO Project: End >>
             intf_lines.negotiated_by_preparer_flag,
             intf_lines.amount,
             intf_lines.contractor_last_name,
             intf_lines.contractor_first_name,
             intf_lines.over_tolerance_error_flag,
             intf_lines.not_to_exceed_price,
             intf_lines.po_release_id,
             intf_lines.release_num,
             intf_lines.source_shipment_id,
             intf_lines.contract_num,
             intf_lines.contract_id,
             intf_lines.type_1099,
             intf_lines.closed_by,
             intf_lines.closed_date,
             intf_lines.committed_amount,
             intf_lines.qty_rcv_exception_code,
             intf_lines.weight_uom_code,
             intf_lines.volume_uom_code,
             intf_lines.secondary_unit_of_measure,
             intf_lines.secondary_quantity,
             intf_lines.preferred_grade,
             intf_lines.process_code,
             NULL, -- parent_interface_line_id -- bug5149827
             intf_lines.file_line_language, -- bug 5489942

             -- standard who columns
             intf_lines.last_updated_by,
             intf_lines.last_update_date,
             intf_lines.last_update_login,
             intf_lines.creation_date,
             intf_lines.created_by,
             intf_lines.request_id,
             intf_lines.program_application_id,
             intf_lines.program_id,
             intf_lines.program_update_date,

             -- attributes read from header
             intf_headers.draft_id,
             intf_headers.action,
             intf_headers.po_header_id,
             txn_headers.vendor_id,
             txn_headers.min_release_amount,
             txn_headers.start_date,
             txn_headers.end_date,
             txn_headers.global_agreement_flag,
             txn_headers.currency_code,
             txn_headers.created_language,
             txn_headers.style_id,
             txn_headers.rate_type,
   	         txn_headers.rate,  -- bug 9194215

             -- txn table columns
             NULL, -- order_type_lookup_code
             NULL, -- purchase_basis
             NULL, -- matching_basis
             NULL, -- unordered_flag
             NULL, -- cancel_flag
             NULL, -- quantity_committed
             NULL, -- tax_attribute_update_code
             intf_lines.clm_info_flag,   /* 10354034 */
             intf_lines.group_line_id, --CLM PDOI Integration

             DECODE(intf_lines.process_code, PO_PDOI_CONSTANTS.g_PROCESS_CODE_VAL_AND_REJECT,
               FND_API.g_TRUE, FND_API.g_FALSE),   -- error_flag_tbl
             FND_API.G_FALSE,                      -- need_to_reject_flag_tbl
             FND_API.g_FALSE,                      -- create_line_loc_tbl
             -1,                                   -- group_num
             NULL,                                 -- origin_line_num
             FND_API.g_FALSE,                      -- match_line_found
             NULL,                                -- allow_desc_update_flag_tbl
             --clm pdoi integration
             intf_lines.contract_type,
             intf_lines.cost_constraint,
             intf_lines.note_to_vendor,
             intf_lines.oke_contract_version_id,
             intf_lines.oke_contract_header_id,
             intf_lines.clm_option_indicator,
             intf_lines.clm_base_line_num,
             intf_lines.clm_option_num,
             intf_lines.clm_option_from_date,
             intf_lines.clm_option_to_date,
             Decode(PO_PDOI_PARAMS.g_request.document_type,
                    PO_PDOI_CONSTANTS.g_DOC_TYPE_STANDARD, Nvl(intf_lines.clm_idc_type,'IDC_NA'),
                    intf_lines.clm_idc_type),
             intf_lines.line_num_display,
             intf_lines.clm_funded_flag,
             intf_lines.user_document_status,
             intf_lines.clm_exercised_flag,
             intf_lines.clm_exercised_date,
             intf_lines.clm_min_total_amount,
             intf_lines.clm_max_total_amount,
             intf_lines.clm_min_total_quantity,
             intf_lines.clm_max_total_quantity,
             intf_lines.clm_min_order_amount,
             intf_lines.clm_max_order_amount,
             intf_lines.clm_min_order_quantity,
             intf_lines.clm_max_order_quantity,
             intf_lines.clm_total_amount_ordered,
             intf_lines.clm_total_quantity_ordered,
             intf_lines.clm_period_perf_end_date,
             intf_lines.clm_period_perf_start_date,
             intf_lines.contract_type_display,
             intf_lines.cost_constraint_display,
             intf_lines.clm_idc_type_display,
             intf_lines.clm_base_line_num_disp,
             intf_lines.from_header_disp,
             intf_lines.from_line_disp

      FROM   po_lines_interface intf_lines,
             po_headers_interface intf_headers,
             po_headers txn_headers
      WHERE  intf_lines.interface_header_id = intf_headers.interface_header_id
      AND    intf_headers.po_header_id = txn_headers.po_header_id
      AND    intf_lines.processing_id = PO_PDOI_PARAMS.g_processing_id
      AND    intf_headers.processing_round_num = PO_PDOI_PARAMS.g_current_round_num
      AND    intf_headers.processing_id = PO_PDOI_PARAMS.g_processing_id
      AND    intf_lines.interface_line_id > p_max_intf_line_id
      AND    intf_headers.action = PO_PDOI_CONSTANTS.g_ACTION_UPDATE
      AND    PO_PDOI_PARAMS.g_request.document_type IN
               (PO_PDOI_CONSTANTS.g_DOC_TYPE_BLANKET,
                PO_PDOI_CONSTANTS.g_DOC_TYPE_QUOTATION)
      AND    intf_lines.action IS NULL
      AND    intf_lines.item IS NULL
      AND    intf_lines.vendor_product_num IS NULL
      AND    intf_lines.job_name IS NULL
      AND    intf_lines.item_description IS NOT NULL
      --PDOI CLM Integration
      --Process only priced lines which in commercial flow are normal lines
      AND    Nvl(intf_lines.clm_info_flag,'N') = 'N'

      ORDER BY intf_lines.interface_line_id;
Line: 1672

     SELECT intf_lines.interface_line_id,
             intf_lines.interface_header_id,
             intf_lines.po_header_id,
             NULL, -- intf_lines.po_line_id,
             intf_lines.action,
             intf_lines.document_num,
             NULL,--intf_lines.item,
             intf_lines.vendor_product_num,
             intf_lines.supplier_part_auxid,
             NULL,--intf_lines.item_id,
             intf_lines.item_revision,
             intf_lines.job_business_group_name,
             intf_lines.job_business_group_id,
             intf_lines.job_name,
             intf_lines.job_id,
             intf_lines.category,
             intf_lines.category_id,
             intf_lines.ip_category_name,
             intf_lines.ip_category_id,
             NULL,--intf_lines.uom_code,
             NULL,--intf_lines.unit_of_measure,
             NULL,--intf_lines.line_type,
             NULL,--intf_lines.line_type_id,
             intf_lines.un_number,
             intf_lines.un_number_id,
             intf_lines.hazard_class,
             intf_lines.hazard_class_id,
             intf_lines.template_name,
             intf_lines.template_id,
             intf_lines.item_description,
             NULL,--intf_lines.unit_price,
             NULL,--intf_lines.base_unit_price,
             intf_lines.from_header_id,
             intf_lines.from_line_id,
             intf_lines.list_price_per_unit,
             intf_lines.market_price,
             intf_lines.capital_expense_flag,
             intf_lines.min_release_amount,
             intf_lines.allow_price_override_flag,
             intf_lines.price_type,
             intf_lines.price_break_lookup_code,
             intf_lines.closed_code,
             NULL,--intf_lines.quantity,
             intf_lines.line_num,
             intf_lines.shipment_num,
             intf_lines.price_chg_accept_flag,
             intf_lines.effective_date,
             intf_lines.expiration_date,
             intf_lines.line_attribute14,
             intf_lines.price_update_tolerance,
             intf_lines.line_loc_populated_flag,
             -- << PDOI for Complex PO Project: Start >>
             intf_lines.retainage_rate,
             intf_lines.max_retainage_amount,
             intf_lines.progress_payment_rate,
             intf_lines.recoupment_rate,
             intf_lines.advance_amount,
             -- << PDOI for Complex PO Project: End >>
             intf_lines.negotiated_by_preparer_flag,
             intf_lines.amount,
             intf_lines.contractor_last_name,
             intf_lines.contractor_first_name,
             intf_lines.over_tolerance_error_flag,
             intf_lines.not_to_exceed_price,
             intf_lines.po_release_id,
             intf_lines.release_num,
             intf_lines.source_shipment_id,
             intf_lines.contract_num,
             intf_lines.contract_id,
             intf_lines.type_1099,
             intf_lines.closed_by,
             intf_lines.closed_date,
             intf_lines.committed_amount,
             intf_lines.qty_rcv_exception_code,
             intf_lines.weight_uom_code,
             intf_lines.volume_uom_code,
             intf_lines.secondary_unit_of_measure,
             intf_lines.secondary_quantity,
             intf_lines.preferred_grade,
             intf_lines.process_code,
             NULL, -- parent_interface_line_id
             intf_lines.file_line_language,

             -- standard who columns
             intf_lines.last_updated_by,
             intf_lines.last_update_date,
             intf_lines.last_update_login,
             intf_lines.creation_date,
             intf_lines.created_by,
             intf_lines.request_id,
             intf_lines.program_application_id,
             intf_lines.program_id,
             intf_lines.program_update_date,

             -- attributes read from headers
             intf_headers.draft_id,
             intf_headers.action,
             intf_headers.po_header_id,
             draft_headers.vendor_id,
             draft_headers.min_release_amount,
             draft_headers.start_date,
             draft_headers.end_date,
             draft_headers.global_agreement_flag,
             draft_headers.currency_code,
             draft_headers.created_language,
             draft_headers.style_id,
             draft_headers.rate_type,
	         draft_headers.rate,

             -- txn table columns
             NULL, -- order_type_lookup_code
             NULL, -- purchase_basis
             NULL, -- matching_basis
             NULL, -- unordered_flag
             NULL, -- cancel_flag
             NULL, -- quantity_committed
             NULL, -- tax_attribute_update_code
             intf_lines.clm_info_flag,
             intf_lines.group_line_id,

             DECODE(intf_lines.process_code,
                    PO_PDOI_CONSTANTS.g_PROCESS_CODE_VAL_AND_REJECT,
                    FND_API.g_TRUE, FND_API.g_FALSE), -- error_flag_tbl
             FND_API.g_FALSE,                    -- need_to_reject_flag_tbl
             FND_API.g_FALSE,                    -- create_line_loc_tbl
             -1,                                 -- group_num
             NULL,                               -- origin_line_num
             FND_API.g_FALSE,                    -- match_line_found
             NULL,
             intf_lines.contract_type,
             intf_lines.cost_constraint,
             intf_lines.note_to_vendor,
             intf_lines.oke_contract_version_id,
             intf_lines.oke_contract_header_id,
             intf_lines.clm_option_indicator,
             intf_lines.clm_base_line_num,
             intf_lines.clm_option_num,
             intf_lines.clm_option_from_date,
             intf_lines.clm_option_to_date,
             intf_lines.clm_idc_type,
             intf_lines.line_num_display,
             intf_lines.clm_funded_flag,
             intf_lines.user_document_status,
             intf_lines.clm_exercised_flag,
             intf_lines.clm_exercised_date,
             intf_lines.clm_min_total_amount,
             intf_lines.clm_max_total_amount,
             intf_lines.clm_min_total_quantity,
             intf_lines.clm_max_total_quantity,
             intf_lines.clm_min_order_amount,
             intf_lines.clm_max_order_amount,
             intf_lines.clm_min_order_quantity,
             intf_lines.clm_max_order_quantity,
             intf_lines.clm_total_amount_ordered,
             intf_lines.clm_total_quantity_ordered,
             intf_lines.clm_period_perf_end_date,
             intf_lines.clm_period_perf_start_date,
             intf_lines.contract_type_display,
             intf_lines.cost_constraint_display,
             intf_lines.clm_idc_type_display,
             intf_lines.clm_base_line_num_disp,
             intf_lines.from_header_disp,
             intf_lines.from_line_disp

      FROM   po_lines_interface intf_lines,
             po_headers_interface intf_headers,
             po_headers_draft_all draft_headers
      WHERE  intf_lines.interface_header_id = intf_headers.interface_header_id
      AND    intf_headers.draft_id = draft_headers.draft_id
      AND    intf_headers.po_header_id = draft_headers.po_header_id
      AND    intf_lines.processing_id = PO_PDOI_PARAMS.g_processing_id
      AND    intf_headers.processing_round_num = PO_PDOI_PARAMS.g_current_round_num
      AND    intf_headers.processing_id = PO_PDOI_PARAMS.g_processing_id
      AND    intf_lines.interface_line_id > p_max_intf_line_id
      AND    intf_headers.action IN (PO_PDOI_CONSTANTS.g_ACTION_ORIGINAL,
                                     PO_PDOI_CONSTANTS.g_ACTION_REPLACE)
      and    nvl(intf_lines.clm_info_flag,'N') = 'Y'
      ORDER BY intf_lines.interface_line_id;
Line: 1951

    x_lines.price_update_tolerance_tbl,
    x_lines.line_loc_populated_flag_tbl,
    -- << PDOI for Complex PO Project: Start >>
    x_lines.retainage_rate_tbl,
    x_lines.max_retainage_amount_tbl,
    x_lines.progress_payment_rate_tbl,
    x_lines.recoupment_rate_tbl,
    x_lines.advance_amount_tbl,
    -- << PDOI for Complex PO Project: End >>
    x_lines.negotiated_flag_tbl,
    x_lines.amount_tbl,
    x_lines.contractor_last_name_tbl,
    x_lines.contractor_first_name_tbl,
    x_lines.over_tolerance_err_flag_tbl,
    x_lines.not_to_exceed_price_tbl,
    x_lines.po_release_id_tbl,
    x_lines.release_num_tbl,
    x_lines.source_shipment_id_tbl,
    x_lines.contract_num_tbl,
    x_lines.contract_id_tbl,
    x_lines.type_1099_tbl,
    x_lines.closed_by_tbl,
    x_lines.closed_date_tbl,
    x_lines.committed_amount_tbl,
    x_lines.qty_rcv_exception_code_tbl,
    x_lines.weight_uom_code_tbl,
    x_lines.volume_uom_code_tbl,
    x_lines.secondary_unit_of_meas_tbl,
    x_lines.secondary_quantity_tbl,
    x_lines.preferred_grade_tbl,
    x_lines.process_code_tbl,
    x_lines.parent_interface_line_id_tbl, -- bug5149827
    x_lines.file_line_language_tbl, -- bug 5489942

    -- standard who columns
    x_lines.last_updated_by_tbl,
    x_lines.last_update_date_tbl,
    x_lines.last_update_login_tbl,
    x_lines.creation_date_tbl,
    x_lines.created_by_tbl,
    x_lines.request_id_tbl,
    x_lines.program_application_id_tbl,
    x_lines.program_id_tbl,
    x_lines.program_update_date_tbl,

    -- attributes read from headers
    x_lines.draft_id_tbl,
    x_lines.hd_action_tbl,
    x_lines.hd_po_header_id_tbl,
    x_lines.hd_vendor_id_tbl,
    x_lines.hd_min_release_amount_tbl,
    x_lines.hd_start_date_tbl,
    x_lines.hd_end_date_tbl,
    x_lines.hd_global_agreement_flag_tbl,
    x_lines.hd_currency_code_tbl,
    x_lines.hd_created_language_tbl,
    x_lines.hd_style_id_tbl,
    x_lines.hd_rate_type_tbl,
    x_lines.hd_rate_tbl,     -- bug 9194215

    -- txn table columns
    x_lines.order_type_lookup_code_tbl,
    x_lines.purchase_basis_tbl,
    x_lines.matching_basis_tbl,
    x_lines.unordered_flag_tbl,
    x_lines.cancel_flag_tbl,
    x_lines.quantity_committed_tbl,
    x_lines.tax_attribute_update_code_tbl,
    x_lines.clm_info_flag_tbl,   /* 10354034 */
    x_lines.group_line_id_tbl, --CLM PDOI Integration Project
    x_lines.error_flag_tbl,
    x_lines.need_to_reject_flag_tbl,
    x_lines.create_line_loc_tbl,
    x_lines.group_num_tbl,
    x_lines.origin_line_num_tbl,
    x_lines.match_line_found_tbl,
    x_lines.allow_desc_update_flag_tbl,   -- bug5107324
    --CLM PDOI Integration Starts
    x_lines.contract_type_tbl,
    x_lines.cost_constraint_tbl,
    x_lines.note_to_vendor_tbl,
    x_lines.oke_contract_version_id_tbl,
    x_lines.oke_contract_header_id_tbl,
    x_lines.clm_option_indicator_tbl,
    x_lines.clm_base_line_num_tbl,
    x_lines.clm_option_num_tbl,
    x_lines.clm_option_from_date_tbl,
    x_lines.clm_option_to_date_tbl,
    x_lines.clm_idc_type_tbl,
    x_lines.line_num_display_tbl,
    x_lines.clm_funded_flag_tbl,
    x_lines.user_document_status_tbl,
    x_lines.clm_exercised_flag_tbl,
    x_lines.clm_exercised_date_tbl,
    x_lines.clm_min_total_amount_tbl,
    x_lines.clm_max_total_amount_tbl,
    x_lines.clm_min_total_quantity_tbl,
    x_lines.clm_max_total_quantity_tbl,
    x_lines.clm_min_order_amount_tbl,
    x_lines.clm_max_order_amount_tbl,
    x_lines.clm_min_order_quantity_tbl,
    x_lines.clm_max_order_quantity_tbl,
    x_lines.clm_total_amount_ordered_tbl,
    x_lines.clm_total_quantity_ordered_tbl,
    x_lines.clm_period_perf_end_date_tbl,
    x_lines.clm_period_perf_start_date_tbl,
    x_lines.contract_type_display_tbl,
    x_lines.cost_constraint_display_tbl,
    x_lines.clm_idc_type_display_tbl,
    x_lines.clm_base_line_num_disp_tbl,
    x_lines.from_header_disp_tbl,
    x_lines.from_line_disp_tbl
    --CLM PDOI Integration Ends
  LIMIT PO_PDOI_CONSTANTS.g_DEF_BATCH_SIZE;
Line: 2812

PROCEDURE derive_lines_for_update
(
  x_lines       IN OUT NOCOPY PO_PDOI_TYPES.lines_rec_type
) IS

  d_api_name CONSTANT VARCHAR2(30) := 'derive_lines_for_update';
Line: 2856

 	                    action is update for updatable attributes */

    -- derive un_number_id from un_number
  derive_un_number_id
  (
    p_key                  => l_key,
    p_index_tbl            => l_index_tbl,
    p_un_number_tbl        => x_lines.un_number_tbl,
    x_un_number_id_tbl     => x_lines.un_number_id_tbl
  );
Line: 3034

END derive_lines_for_update;
Line: 3376

        x_lines.tax_attribute_update_code_tbl(i) := 'CREATE';
Line: 3453

    x_last_update_date_tbl       => x_lines.last_update_date_tbl,
    x_last_updated_by_tbl        => x_lines.last_updated_by_tbl,
    x_last_update_login_tbl      => x_lines.last_update_login_tbl,
    x_creation_date_tbl          => x_lines.creation_date_tbl,
    x_created_by_tbl             => x_lines.created_by_tbl,
    x_request_id_tbl             => x_lines.request_id_tbl,
    x_program_application_id_tbl => x_lines.program_application_id_tbl,
    x_program_id_tbl             => x_lines.program_id_tbl,
    x_program_update_date_tbl    => x_lines.program_update_date_tbl
  );
Line: 3533

PROCEDURE default_lines_for_update
(
  x_lines       IN OUT NOCOPY PO_PDOI_TYPES.lines_rec_type
) IS

  d_api_name CONSTANT VARCHAR2(30) := 'default_lines_for_update';
Line: 3583

    INSERT INTO po_session_gt(key, num1, char1, num2, num3, num4) --num4 is added by vegajula for bugno:9531925
    SELECT l_key,
           l_num_list(i),
           order_type_lookup_code,
           item_id,
           job_id,
	   po_header_id  --vegajula  bugno:9531925
    FROM   po_lines_draft_all
    WHERE  po_line_id = x_lines.po_line_id_tbl(i)
    AND    draft_id = x_lines.draft_id_tbl(i);
Line: 3598

     INSERT INTO po_session_gt(key, num1, char1, num2, num3, num4)  --num4 is added by vegajula for bugno:9531925
    SELECT l_key,
           l_num_list(i),
           order_type_lookup_code,
           item_id,
           job_id,
	   po_header_id  --vegajula  bugno:9531925
    FROM   po_lines_all
    WHERE  po_line_id = x_lines.po_line_id_tbl(i)
    AND    NOT EXISTS (SELECT 1
                       FROM   po_lines_draft_all
                       WHERE  po_line_id = x_lines.po_line_id_tbl(i)
                       AND    draft_id = x_lines.draft_id_tbl(i));
Line: 3614

  DELETE FROM po_session_gt
  WHERE key = l_key
  RETURNING num1, char1, num2, num3, num4 BULK COLLECT INTO   ---num4 added by vegajula for bugno:9531925
   l_index_tbl, l_order_type_tbl, l_item_id_tbl, l_job_id_tbl, l_po_header_id_tbl ; --l_po_header_id_tbl added by vegajula for bugno:9531925
Line: 3651

END default_lines_for_update;
Line: 3680

  l_update_lines PO_PDOI_TYPES.lines_rec_type;
Line: 3765

    x_update_lines   => l_update_lines
  );
Line: 3770

    PO_LOG.stmt(d_module, d_position, 'num of updated lines', l_update_lines.rec_count);
Line: 3780

  FORALL i IN 1..l_update_lines.rec_count
    UPDATE po_lines_interface
    SET    po_line_id = l_update_lines.po_line_id_tbl(i),
           price_break_flag = 'Y'
    WHERE  interface_line_id = l_update_lines.intf_line_id_tbl(i);
Line: 3790

  FOR i IN 1..l_update_lines.rec_count
  LOOP
    IF (PO_LOG.d_stmt) THEN
      PO_LOG.stmt(d_module, d_position, 'index', i);
Line: 3795

                  l_update_lines.create_line_loc_tbl(i));
Line: 3799

    IF (l_update_lines.create_line_loc_tbl(i) = FND_API.g_FALSE) THEN
      PO_PDOI_ERR_UTL.add_fatal_error
      (
        p_interface_header_id  => l_update_lines.intf_header_id_tbl(i),
        p_interface_line_id    => l_update_lines.intf_line_id_tbl(i),
        p_error_message_name   => 'PO_PDOI_INVALID_INTER_LINE_REC',
        p_table_name           => 'PO_LINES_INTERFACE',
        p_column_name          => 'CREATE_PO_LINES_FLAG',
        p_column_value         => 'N',
        p_token1_name          => 'COLUMN_NAME',
        p_token1_value         => 'CREATE_PO_LINES_FLAG',
        p_token2_name          => 'VALUE',
        p_token2_value         => 'N'
      );
Line: 3815

      l_rej_intf_line_id_tbl(l_rej_intf_line_id_tbl.COUNT) := l_update_lines.intf_line_id_tbl(i);
Line: 3818

                    l_update_lines.intf_line_id_tbl(i));
Line: 3918

            x_lines.action_tbl(i) = PO_PDOI_CONSTANTS.g_ACTION_UPDATE AND
            (x_lines.quantity_tbl(i) > 0 OR x_lines.shipment_num_tbl(i) IS NOT NULL)) THEN
          x_lines.create_line_loc_tbl(i) := FND_API.g_TRUE;
Line: 3961

    UPDATE po_line_locations_interface
    SET    process_code = PO_PDOI_CONSTANTS.g_PROCESS_CODE_OBSOLETE
    WHERE interface_line_id = l_obsoleted_loc_tbl(i);
Line: 4000

PROCEDURE update_line_intf_tbl
(
  x_lines    IN OUT NOCOPY PO_PDOI_TYPES.lines_rec_type
) IS

  d_api_name CONSTANT VARCHAR2(30) := 'update_line_intf_tbl';
Line: 4033

          PO_LOG.stmt(d_module, d_position, 'update line process code to ACCEPTED. Index = ', i);
Line: 4044

    UPDATE po_lines_interface
    SET    po_line_id = x_lines.po_line_id_tbl(i),
	   po_header_id = x_lines.po_header_id_tbl(i),   --vegajula line for bug 9531925
           price_update_tolerance = x_lines.price_update_tolerance_tbl(i),
           action = x_lines.action_tbl(i),
           price_break_flag = DECODE(x_lines.action_tbl(i), 'UPDATE',
                                DECODE(x_lines.create_line_loc_tbl(i), FND_API.g_TRUE, 'Y', NULL), NULL),
           process_code = x_lines.process_code_tbl(i),
           parent_interface_line_id = x_lines.parent_interface_line_id_tbl(i), -- bug5149827
           --CLM PDOI Integration
           clm_base_line_num = x_lines.clm_base_line_num_tbl(i)
    WHERE  interface_line_id = x_lines.intf_line_id_tbl(i);
Line: 4071

END update_line_intf_tbl;
Line: 4220

        x_processing_row_tbl.DELETE(i);
Line: 4263

      INSERT INTO po_session_gt(key, num1)
      SELECT l_key,
             l_index_tbl(i)
      FROM   po_lines txn_lines
      WHERE  txn_lines.po_line_id = x_lines.po_line_id_tbl(i)
      AND    x_lines.unit_of_measure_tbl(i) IS NOT NULL
      AND    txn_lines.unit_meas_lookup_code IS NOT NULL
      AND    txn_lines.unit_meas_lookup_code <>
             x_lines.unit_of_measure_tbl(i)
      AND    (EXISTS (SELECT 1
                      FROM   po_line_locations
                      WHERE  po_line_id = txn_lines.po_line_id
                      AND    shipment_type = 'BLANKET')
              OR
              EXISTS (SELECT 1
                      FROM   po_lines_all
                      WHERE  from_line_id = txn_lines.po_line_id)
             );
Line: 4282

    DELETE FROM po_session_gt
    WHERE key = l_key
    RETURNING num1 BULK COLLECT INTO l_expire_line_index_tbl;
Line: 4360

  x_update_lines          IN OUT NOCOPY PO_PDOI_TYPES.lines_rec_type
) IS

  d_api_name CONSTANT VARCHAR2(30) := 'split_lines';
Line: 4369

  l_update_index_tbl   DBMS_SQL.NUMBER_TABLE;
Line: 4390

      ELSIF (p_lines.action_tbl(i) = PO_PDOI_CONSTANTS.g_ACTION_UPDATE) THEN
        IF (PO_LOG.d_stmt) THEN
          PO_LOG.stmt(d_module, d_position, 'lines to update', i);
Line: 4395

        l_update_index_tbl(i) := i;
Line: 4416

    p_source_index_tbl => l_update_index_tbl,
    x_target_lines     => x_update_lines
  );
Line: 4573

  l_parameter_name_tbl(1)                 := 'CREATE_OR_UPDATE_ITEM';
Line: 4748

    INSERT INTO po_session_gt(key, num1, num2)
    SELECT p_key,
           p_index_tbl(i),
           inventory_item_id
    FROM   mtl_system_items_kfv
    WHERE  p_item_tbl(i) IS NOT NULL
    AND    x_item_id_tbl(i) IS NULL
    AND    concatenated_segments = p_item_tbl(i)
    AND    organization_id = PO_PDOI_PARAMS.g_sys.def_inv_org_id;
Line: 4766

    INSERT INTO po_session_gt(key, num1, num2)
    SELECT DISTINCT
           p_key,
           p_index_tbl(i),
           txn_lines.item_id
    FROM   po_headers txn_headers, po_lines txn_lines
    WHERE  txn_headers.po_header_id = txn_lines.po_header_id
    AND    p_item_tbl(i) IS NULL
    AND    x_item_id_tbl(i) IS NULL
    AND    p_vendor_product_num_tbl(i) IS NOT NULL
    AND    txn_lines.vendor_product_num = p_vendor_product_num_tbl(i)
    AND    txn_headers.vendor_id = p_vendor_id_tbl(i)
    AND    txn_lines.item_id IS NOT NULL
    AND    ( (p_category_id_tbl(i) IS NOT NULL                   --bug 7374337 
            AND txn_lines.category_id = p_category_id_tbl(i))
            OR (p_category_id_tbl(i) IS NULL )                   --bug 7374337 
           );
Line: 4787

  DELETE FROM po_session_gt
  WHERE  key = p_key
  RETURNING num1, num2 BULK COLLECT INTO l_index_tbl, l_result_tbl;
Line: 4955

    INSERT INTO po_session_gt(key, num1, num2)
    SELECT p_key,
           p_index_tbl(i),
           business_group_id
    FROM   per_business_groups_perf
    WHERE  p_job_business_group_name_tbl(i) IS NOT NULL
    AND    x_job_business_group_id_tbl(i) IS NULL
    AND    name = p_job_business_group_name_tbl(i)
    AND    TRUNC(sysdate) BETWEEN TRUNC(NVL(date_from, sysdate))
           AND TRUNC(NVL(date_to, sysdate));
Line: 4969

  DELETE FROM po_session_gt
  WHERE  key = p_key
  RETURNING num1, num2 BULK COLLECT INTO l_index_tbl, l_result_tbl;
Line: 5083

      INSERT INTO po_session_gt(key, num1, num2)
      SELECT p_key,
             p_index_tbl(i),
             jobs_b.job_id
      FROM   per_jobs jobs_b,
             per_jobs_tl jobs_tl
      WHERE  p_job_name_tbl(i) IS NOT NULL
      AND    x_job_id_tbl(i) IS NULL
      AND    jobs_b.job_id = jobs_tl.job_id
      AND    jobs_tl.language = NVL(p_file_line_language_tbl(i), userenv('LANG'))
      AND    jobs_tl.name = p_job_name_tbl(i)
      AND    jobs_b.business_group_id = PO_PDOI_PARAMS.g_sys.def_business_group_id
      AND    PO_PDOI_PARAMS.g_sys.def_business_group_id =
               DECODE(p_job_business_group_name_tbl(i), NULL,
               DECODE(x_job_business_group_id_tbl(i), NULL,
               PO_PDOI_PARAMS.g_sys.def_business_group_id,
               x_job_business_group_id_tbl(i)), x_job_business_group_id_tbl(i))
      AND    TRUNC(sysdate) BETWEEN TRUNC(NVL(jobs_b.date_from, sysdate))
             AND TRUNC(NVL(jobs_b.date_to, sysdate));
Line: 5107

    select job_id, name, business_group_id
    bulk collect into d_job_id_tbl, d_job_name_tbl, d_bg_id_tbl
    from per_jobs_vl
    where TRUNC(sysdate) BETWEEN TRUNC(NVL(date_from, sysdate))
             AND TRUNC(NVL(date_to, sysdate));
Line: 5128

      INSERT INTO po_session_gt(key, num1, num2)
      SELECT p_key,
             p_index_tbl(i),
             jobs_b.job_id
      FROM   per_jobs jobs_b,
             per_jobs_tl jobs_tl
      WHERE  p_job_name_tbl(i) IS NOT NULL
      AND    x_job_id_tbl(i) IS NULL
      AND    x_job_business_group_id_tbl(i) IS NULL
      AND    jobs_b.job_id = jobs_tl.job_id
      AND    jobs_tl.language = NVL(p_file_line_language_tbl(i), userenv('LANG'))
      AND    jobs_tl.name = p_job_name_tbl(i)
      AND    jobs_b.business_group_id = PO_PDOI_PARAMS.g_sys.def_business_group_id
      AND    PO_PDOI_PARAMS.g_sys.def_business_group_id =
               DECODE(p_job_business_group_name_tbl(i), NULL,
               PO_PDOI_PARAMS.g_sys.def_business_group_id,
               x_job_business_group_id_tbl(i))
      AND    TRUNC(sysdate) BETWEEN TRUNC(NVL(jobs_b.date_from, sysdate))
             AND TRUNC(NVL(jobs_b.date_to, sysdate));
Line: 5152

      INSERT INTO po_session_gt(key, num1, num2)
      SELECT p_key,
             p_index_tbl(i),
             jobs_b.job_id
      FROM   per_jobs jobs_b,
             per_jobs_tl jobs_tl,
             per_business_groups_perf groups
      WHERE  p_job_name_tbl(i) IS NOT NULL
      AND    x_job_id_tbl(i) IS NULL
      AND    x_job_business_group_id_tbl(i) IS NOT NULL
      AND    jobs_b.job_id = jobs_tl.job_id
      AND    jobs_tl.language = NVL(p_file_line_language_tbl(i), userenv('LANG'))
      AND    jobs_tl.name = p_job_name_tbl(i)
      AND    jobs_b.business_group_id = x_job_business_group_id_tbl(i)
      AND    jobs_b.business_group_id = groups.business_group_id
      AND    TRUNC(sysdate) BETWEEN NVL(jobs_b.date_from, TRUNC(sysdate))
             AND NVL(jobs_b.date_to, TRUNC(sysdate))
      AND    TRUNC(sysdate) BETWEEN NVL(groups.date_from, TRUNC(sysdate))
             AND NVL(groups.date_to, TRUNC(sysdate));
Line: 5176

  DELETE FROM po_session_gt
  WHERE  key = p_key
  RETURNING num1, num2 BULK COLLECT INTO l_index_tbl, l_result_tbl;
Line: 5357

    INSERT INTO po_session_gt(key, num1, char1)
    SELECT p_key,
           p_index_tbl(i),
           cat.rt_category_id
    FROM   icx_cat_categories_v cat
    WHERE  p_ip_category_tbl(i) IS NOT NULL
    AND    x_ip_category_id_tbl(i) IS NULL
    AND    cat.key = p_ip_category_tbl(i);
Line: 5369

  DELETE FROM po_session_gt
  WHERE  key = p_key
  RETURNING num1, char1 BULK COLLECT INTO l_index_tbl, l_result_tbl;
Line: 5393

    INSERT INTO po_session_gt(key, num1, char1)
    SELECT p_key,
           p_index_tbl(i),
           rt_category_id
    FROM   icx_cat_categories_v
    WHERE  p_ip_category_tbl(i) IS NOT NULL
    AND    x_ip_category_id_tbl(i) IS NULL
    AND    category_name = p_ip_category_tbl(i)
    AND    language = NVL(p_file_line_language_tbl(i),
                          userenv('LANG'));
Line: 5407

  DELETE FROM po_session_gt
  WHERE  key = p_key
  RETURNING num1, char1 BULK COLLECT INTO l_index_tbl, l_result_tbl;
Line: 5485

    INSERT INTO po_session_gt(key, num1, char1)
    SELECT p_key,
           p_index_tbl(i),
           unit_of_measure
    FROM   po_units_of_measure_val_v
    WHERE  p_uom_code_tbl(i) IS NOT NULL
    AND    x_unit_of_measure_tbl(i) IS NULL
    AND    uom_code = p_uom_code_tbl(i);
Line: 5497

  DELETE FROM po_session_gt
  WHERE  key = p_key
  RETURNING num1, char1 BULK COLLECT INTO l_index_tbl, l_result_tbl;
Line: 5580

    INSERT INTO po_session_gt(key, num1, num2)
    SELECT p_key,
           p_index_tbl(i),
           b.line_type_id
    FROM   po_line_types_b b,
           po_line_types_tl tl
    WHERE  p_line_type_tbl(i) IS NOT NULL
    AND    x_line_type_id_tbl(i) IS NULL
    AND    b.line_type_id = tl.line_type_id
    AND    tl.language = NVL(p_file_line_language_tbl(i),
                             userenv('LANG'))
    AND    SYSDATE < NVL(b.inactive_date, SYSDATE +1)
    AND    tl.line_type = p_line_type_tbl(i);
Line: 5597

  DELETE FROM po_session_gt
  WHERE  key = p_key
  RETURNING num1, num2 BULK COLLECT INTO l_index_tbl, l_result_tbl;
Line: 5674

    INSERT INTO po_session_gt(key, num1, num2)
    SELECT p_key,
           p_index_tbl(i),
           un_number_id
    FROM   po_un_numbers_vl
    WHERE  p_un_number_tbl(i) IS NOT NULL
    AND    x_un_number_id_tbl(i) IS NULL
    AND    sysdate < nvl(inactive_date, sysdate +1)
    AND    un_number = p_un_number_tbl(i);
Line: 5687

  DELETE FROM po_session_gt
  WHERE  key = p_key
  RETURNING num1, num2 BULK COLLECT INTO l_index_tbl, l_result_tbl;
Line: 5764

    INSERT INTO po_session_gt(key, num1, num2)
    SELECT p_key,
           p_index_tbl(i),
           hazard_class_id
    FROM   po_hazard_classes_val_v
    WHERE  p_hazard_class_tbl(i) IS NOT NULL
    AND    x_hazard_class_id_tbl(i) IS NULL
    AND    hazard_class = p_hazard_class_tbl(i);
Line: 5776

  DELETE FROM po_session_gt
  WHERE  key = p_key
  RETURNING num1, num2 BULK COLLECT INTO l_index_tbl, l_result_tbl;
Line: 5853

    INSERT INTO po_session_gt(key, num1, num2)
    SELECT p_key,
           p_index_tbl(i),
           template_id
    FROM   mtl_item_templates
    WHERE  p_template_name_tbl(i) IS NOT NULL
    AND    x_template_id_tbl(i) IS NULL
    AND    template_name = p_template_name_tbl(i)
    AND    NVL(context_organization_id,
           PO_PDOI_PARAMS.g_sys.def_inv_org_id) =
           PO_PDOI_PARAMS.g_sys.def_inv_org_id;
Line: 5868

  DELETE FROM po_session_gt
  WHERE  key = p_key
  RETURNING num1, num2 BULK COLLECT INTO l_index_tbl, l_result_tbl;
Line: 5979

    INSERT INTO po_session_gt(key, num1, char1, char2, char3, num2, char4, num3)
    SELECT p_key,
           p_index_tbl(i),
           order_type_lookup_code,
           purchase_basis,
           matching_basis,
           category_id,
           unit_of_measure,
           unit_price
    FROM   po_line_types_b
    WHERE  line_type_id = p_line_type_id_tbl(i);
Line: 5994

  DELETE FROM po_session_gt
  WHERE  key = p_key
  RETURNING num1, char1, char2, char3, num2, char4, num3
  BULK COLLECT INTO
    l_index_tbl,
    l_order_type_lookup_code_tbl,
    l_purchase_basis_tbl,
    l_matching_basis_tbl,
    l_category_id_tbl,
    l_unit_of_measure_tbl,
    l_unit_price_tbl;
Line: 6154

    INSERT INTO po_session_gt(key, num1, char1, char2, num2, num3,
                              num4, num5, num6, char3)
    SELECT p_key,
           p_index_tbl(i),
           item_tl.description,
           item.primary_unit_of_measure,
           item.list_price_per_unit,
           item_cat.category_id,
           item.un_number_id,
           item.hazard_class_id,
           item.market_price,
           decode(item.tracking_quantity_ind, 'PS', uom.unit_of_measure, NULL)
    FROM   mtl_item_categories item_cat,
           mtl_system_items item,
           mtl_system_items_tl item_tl,
           mtl_units_of_measure uom
    WHERE  item.inventory_item_id = p_item_id_tbl(i)
    AND    item_tl.inventory_item_id = item.inventory_item_id
    AND    item_cat.inventory_item_id = item.inventory_item_id
    AND    item.organization_id = PO_PDOI_PARAMS.g_sys.def_inv_org_id
    AND    item_tl.language = USERENV('LANG')
    AND    item_tl.organization_id = PO_PDOI_PARAMS.g_sys.def_inv_org_id
    AND    item_cat.category_set_id = PO_PDOI_PARAMS.g_sys.def_cat_set_id
    AND    item_cat.organization_id = PO_PDOI_PARAMS.g_sys.def_inv_org_id
    AND    item.secondary_uom_code = uom.uom_code(+);
Line: 6183

  DELETE FROM po_session_gt
  WHERE  key = p_key
  RETURNING num1, char1, char2, num2, num3, num4, num5, num6, char3
  BULK COLLECT INTO
    l_index_tbl,
    l_item_desc_tbl,
    l_unit_of_measure_tbl,
    l_unit_price_tbl,
    l_category_id_tbl,
    l_un_number_id_tbl,
    l_hazard_class_id_tbl,
    l_market_price_tbl,
    l_secondary_unit_of_meas_tbl;
Line: 6306

    INSERT INTO po_session_gt(key, num1, char1, num2)
    SELECT p_key,
           p_index_tbl(i),
           association.job_description,
           association.category_id
    FROM   po_job_associations association,
           per_jobs_vl job
    WHERE  job.job_id = p_job_id_tbl(i)
    AND    association.job_id = job.job_id
    AND    TRUNC(sysdate) < TRUNC(NVL(association.inactive_date, sysdate+1))
    AND    TRUNC(sysdate) BETWEEN TRUNC(NVL(job.date_from, sysdate))
           AND TRUNC(NVL(job.date_to, sysdate+1));
Line: 6322

  DELETE FROM po_session_gt
  WHERE  key = p_key
  RETURNING num1, char1, num2
  BULK COLLECT INTO
    l_index_tbl,
    l_item_desc_tbl,
    l_category_id_tbl;
Line: 6405

    INSERT INTO po_session_gt(key, num1, num2)
    SELECT p_key,
           p_index_tbl(i),
           po_category_id
    FROM   icx_cat_shopping_cat_map_v
    WHERE  p_ip_category_id_tbl(i) IS NOT NULL
    AND    x_po_category_id_tbl(i) IS NULL
    AND    shopping_category_id = p_ip_category_id_tbl(i);
Line: 6417

  DELETE FROM po_session_gt
  WHERE  key = p_key
  RETURNING num1, num2
  BULK COLLECT INTO l_index_tbl, l_result_tbl;
Line: 6493

    INSERT INTO po_session_gt(key, num1, num2)
    SELECT p_key,
           p_index_tbl(i),
           shopping_category_id
    FROM   icx_cat_purchasing_cat_map_v
    WHERE  p_po_category_id_tbl(i) IS NOT NULL
    AND    x_ip_category_id_tbl(i) IS NULL
    AND    po_category_id = p_po_category_id_tbl(i);
Line: 6505

  DELETE FROM po_session_gt
  WHERE  key = p_key
  RETURNING num1, num2
  BULK COLLECT INTO l_index_tbl, l_result_tbl;
Line: 6581

    INSERT INTO po_session_gt(key, num1, num2)
    SELECT p_key,
           p_index_tbl(i),
           hazard_class_id
    FROM   po_un_numbers_vl
    WHERE  p_un_number_tbl(i) IS NOT NULL
    AND    x_hazard_class_id_tbl(i) IS NULL
    AND    sysdate < nvl(inactive_date, sysdate +1)
    AND    un_number = p_un_number_tbl(i);
Line: 6594

  DELETE FROM po_session_gt
  WHERE  key = p_key
  RETURNING num1, num2
  BULK COLLECT INTO l_index_tbl, l_result_tbl;
Line: 6686

  INSERT INTO po_session_gt(key, num1, num2)
  SELECT l_key,
         p_index_tbl(i),
         po_line_id
  FROM   po_lines_draft_all
  WHERE  draft_id = x_lines.draft_id_tbl(i)
  AND    po_header_id = x_lines.po_header_id_tbl(i)
  AND    line_num = x_lines.line_num_tbl(i)
  AND    NVL(delete_flag, 'N') <> 'Y';
Line: 6698

  DELETE FROM po_session_gt
  WHERE  key = l_key
  RETURNING num1, num2
  BULK COLLECT INTO l_index_tbl, l_result_tbl;
Line: 6713

    x_lines.action_tbl(l_index) := PO_PDOI_CONSTANTS.g_ACTION_UPDATE;
Line: 6738

        x_lines.action_tbl(i) := PO_PDOI_CONSTANTS.g_ACTION_UPDATE;
Line: 6839

      IF (x_lines.hd_action_tbl(i) <> PO_PDOI_CONSTANTS.g_ACTION_UPDATE AND
          x_lines.error_flag_tbl(i) = FND_API.g_FALSE AND
          NOT (x_lines.order_type_lookup_code_tbl(i) = 'AMOUNT' AND
               PO_PDOI_PARAMS.g_request.document_type =
               PO_PDOI_CONSTANTS.g_DOC_TYPE_BLANKET)) THEN
        IF (PO_LOG.d_stmt) THEN
          PO_LOG.stmt(d_module, d_position, 'processing index', i);
Line: 6870

    INSERT INTO po_session_gt(key, num1, num2, num3)
    SELECT l_key,
           l_processing_line_tbl(i),
           po_line_id,
           line_num
    FROM   po_lines_draft_all
    WHERE  x_lines.item_id_tbl(i) IS NOT NULL
    AND    draft_id = x_lines.draft_id_tbl(i)
    AND    po_header_id = x_lines.po_header_id_tbl(i)
    AND    item_id = x_lines.item_id_tbl(i)
    AND    (item_revision = x_lines.item_revision_tbl(i) OR
            item_revision IS NULL OR
            x_Lines.item_revision_tbl(i) IS NULL)
    AND     unit_meas_lookup_code = x_lines.unit_of_measure_tbl(i)
    AND     line_type_id = x_lines.line_type_id_tbl(i)
    AND     category_id = x_lines.category_id_tbl(i)
    AND    NVL(delete_flag, 'N') <> 'Y';
Line: 6892

    INSERT INTO po_session_gt(key, num1, num2, num3)
    SELECT l_key,
           l_processing_line_tbl(i),
           po_line_id,
           line_num
    FROM   po_lines_draft_all
    WHERE  x_lines.item_id_tbl(i) IS NULL
    AND    draft_id = x_lines.draft_id_tbl(i)
    AND    po_header_id = x_lines.po_header_id_tbl(i)
    AND    item_description = x_lines.item_desc_tbl(i)
    AND    unit_meas_lookup_code = x_lines.unit_of_measure_tbl(i)
    AND    line_type_id = x_lines.line_type_id_tbl(i)
    AND    category_id = x_lines.category_id_tbl(i)
    AND    NVL(delete_flag, 'N') <> 'Y';
Line: 6910

  DELETE FROM po_session_gt
  WHERE key = l_key
  RETURNING num1, num2, num3
  BULK COLLECT INTO l_index_tbl, l_po_line_id_tbl, l_line_num_tbl;
Line: 6929

    x_lines.action_tbl(l_index) := PO_PDOI_CONSTANTS.g_ACTION_UPDATE;
Line: 6931

    l_processing_line_tbl.DELETE(i);
Line: 6946

    INSERT INTO po_session_gt(key, num1, num2, num3, char1, char2,
                              num4, num5, char3, char4, num6)
    VALUES (l_data_key,
            x_lines.intf_line_id_tbl(i),           -- num1
            x_lines.po_header_id_tbl(i),           -- num2
            x_lines.item_id_tbl(i),                -- num3
            x_lines.item_revision_tbl(i),          -- char1
            x_lines.unit_of_measure_tbl(i),        -- char2
            x_lines.line_type_id_tbl(i),           -- num4
            x_lines.category_id_tbl(i),            -- num5
            x_lines.item_desc_tbl(i),              -- char3
            x_lines.order_type_lookup_code_tbl(i), -- char4
            l_num_list(i)                          -- num6
           );
Line: 6966

    INSERT INTO po_session_gt(key, num1)
    SELECT l_key,
           l_processing_line_tbl(i)
    FROM   DUAL
    WHERE  x_lines.item_id_tbl(i) IS NOT NULL
    AND    NOT EXISTS(
            SELECT 1
            FROM   po_session_gt gt
            WHERE  gt.num2 = x_lines.po_header_id_tbl(i)
            AND    gt.num1 < x_lines.intf_line_id_tbl(i)
            AND    gt.num3 = x_lines.item_id_tbl(i)
            AND    (gt.char1 = x_lines.item_revision_tbl(i) OR
                    gt.char1 IS NULL OR
                    x_lines.item_revision_tbl(i) IS NULL)
            AND    gt.char2 = x_lines.unit_of_measure_tbl(i)
            AND    gt.num4 = x_lines.line_type_id_tbl(i)
            AND    gt.num5 = x_lines.category_id_tbl(i)
           );
Line: 6989

    INSERT INTO po_session_gt(key, num1)
    SELECT l_key,
           l_processing_line_tbl(i)
    FROM   DUAL
    WHERE  x_lines.item_id_tbl(i) IS NULL
    AND    NOT EXISTS(
            SELECT 1
            FROM   po_session_gt gt
            WHERE  gt.num2 = x_lines.po_header_id_tbl(i)
            AND    gt.num1 < x_lines.intf_line_id_tbl(i)
            AND    gt.char3 = x_lines.item_desc_tbl(i)
            AND    gt.char2 = x_lines.unit_of_measure_tbl(i)
            AND    gt.num4 = x_lines.line_type_id_tbl(i)
            AND    gt.num5 = x_lines.category_id_tbl(i)
           );
Line: 7008

  DELETE FROM po_session_gt
  WHERE key = l_key
  RETURNING num1 BULK COLLECT INTO l_index_tbl;
Line: 7013

  /* bug 8295593 changed the value from 'i' to 'l_index' in the below assignment statement and delete node statement.
   When 'i' value in place, the two statements where fix is done, fetching value for the next i value instead next index value*/

  FOR i IN 1..l_index_tbl.COUNT
  LOOP
    l_index := l_index_tbl(i);
Line: 7024

    l_processing_line_tbl.DELETE(l_index);  --bug 8295593
Line: 7039

    INSERT INTO po_session_gt(key, num1, num2)
    SELECT l_key,
           l_processing_line_tbl(i),
           v.min_index
    FROM   (SELECT min(num6) AS min_index
            FROM   po_session_gt
            WHERE  x_lines.item_id_tbl(i) IS NOT NULL
            AND    num2  = x_lines.po_header_id_tbl(i)
            AND    num1 < x_lines.intf_line_id_tbl(i)
            AND    num3 = x_lines.item_id_tbl(i)
            AND    (char1 = x_lines.item_revision_tbl(i) OR
                    char1 IS NULL OR
                    x_lines.item_revision_tbl(i) IS NULL)
            AND    char2 = x_lines.unit_of_measure_tbl(i)
            AND    num4 = x_lines.line_type_id_tbl(i)
            AND    num5 = x_lines.category_id_tbl(i)) v
    WHERE  v.min_index IS NOT NULL;
Line: 7060

    INSERT INTO po_session_gt(key, num1, num2)
    SELECT l_key,
           l_processing_line_tbl(i),
           v.min_index
    FROM   (SELECT min(num6) AS min_index
            FROM   po_session_gt
            WHERE  x_lines.item_id_tbl(i) IS NULL
            AND    num2 = x_lines.po_header_id_tbl(i)
            AND    num1 < x_lines.intf_line_id_tbl(i)
            AND    char3 = x_lines.item_desc_tbl(i)
            AND    char2 = x_lines.unit_of_measure_tbl(i)
            AND    num4 = x_lines.line_type_id_tbl(i)
            AND    num5 = x_lines.category_id_tbl(i)) v
    WHERE   v.min_index IS NOT NULL;
Line: 7077

  DELETE FROM po_session_gt
  WHERE key = l_key
  RETURNING num1, num2 BULK COLLECT INTO l_index_tbl, l_match_index_tbl;
Line: 7093

    x_lines.action_tbl(l_index) := PO_PDOI_CONSTANTS.g_ACTION_UPDATE;
Line: 7242

    x_target_lines.price_update_tolerance_tbl(l_target_index) := p_source_lines.price_update_tolerance_tbl(l_source_index);
Line: 7281

    x_target_lines.last_updated_by_tbl(l_target_index) := p_source_lines.last_updated_by_tbl(l_source_index);
Line: 7282

    x_target_lines.last_update_date_tbl(l_target_index) := p_source_lines.last_update_date_tbl(l_source_index);
Line: 7283

    x_target_lines.last_update_login_tbl(l_target_index) := p_source_lines.last_update_login_tbl(l_source_index);
Line: 7289

    x_target_lines.program_update_date_tbl(l_target_index) := p_source_lines.program_update_date_tbl(l_source_index);
Line: 7315

    x_target_lines.tax_attribute_update_code_tbl(l_target_index) := p_source_lines.tax_attribute_update_code_tbl(l_source_index);
Line: 7316

    x_target_lines.allow_desc_update_flag_tbl(l_target_index) := p_source_lines.allow_desc_update_flag_tbl(l_source_index); -- bug5107324
Line: 7424

    INSERT INTO po_session_gt
    (
      key,
      num1,
      num2,
      num3
    )
    SELECT
      p_key,
      x_processing_row_tbl(i),
      draft_lines.po_line_id,
      draft_lines.line_num
    FROM  po_lines_draft_all draft_lines
    WHERE draft_lines.po_header_id = x_lines.hd_po_header_id_tbl(i)
    AND   draft_lines.draft_id = x_lines.draft_id_tbl(i)
    AND   NVL(draft_lines.expiration_date, TRUNC(sysdate)) >= TRUNC(sysdate)
    AND   draft_lines.item_description = x_lines.item_desc_tbl(i)
    AND   (x_lines.category_tbl(i) IS NULL OR
           EXISTS ( SELECT 1
                    FROM   mtl_categories_kfv mck
                    WHERE  mck.concatenated_segments = x_lines.category_tbl(i)
                    AND    mck.category_id = draft_lines.category_id));
Line: 7451

    INSERT INTO po_session_gt
    (
      key,
      num1,
      num2,
      num3
    )
    SELECT
      p_key,
      x_processing_row_tbl(i),
      txn_lines.po_line_id,
      txn_lines.line_num
    FROM  po_lines txn_lines
    WHERE txn_lines.po_header_id = x_lines.hd_po_header_id_tbl(i)
    AND   NOT EXISTS ( SELECT 1
                       FROM   po_lines_draft_all draft_lines
                       WHERE  draft_lines.po_line_id = txn_lines.po_line_id
                       AND    draft_lines.draft_id = x_lines.draft_id_tbl(i))
    AND   txn_lines.item_description = x_lines.item_desc_tbl(i)
    AND   (x_lines.category_tbl(i) IS NULL OR
           EXISTS ( SELECT 1
                    FROM   mtl_categories_kfv mck
                    WHERE  mck.concatenated_segments = x_lines.category_tbl(i)
                    AND    mck.category_id = txn_lines.category_id))
    AND   NVL(txn_lines.expiration_date, TRUNC(sysdate)) >= TRUNC(sysdate)
    AND   NVL(txn_lines.closed_code, 'OPEN') <> 'FINALLY CLOSED'
    AND   NVL(txn_lines.cancel_flag, 'N') <> 'Y';
Line: 7481

  DELETE FROM po_session_gt
  WHERE key = p_key
  RETURNING num1, num2, num3 BULK COLLECT INTO
    l_index_tbl, l_po_line_id_tbl, l_line_num_tbl;
Line: 7504

      x_lines.action_tbl(l_index) := PO_PDOI_CONSTANTS.g_ACTION_UPDATE;
Line: 7508

      x_processing_row_tbl.DELETE(l_index);
Line: 7553

    INSERT INTO po_session_gt
    (
      key,
      num1,
      num2,
      char1,
      char2
    )
  SELECT
    l_data_key,
    x_lines.intf_line_id_tbl(i),       -- num1
    x_lines.hd_po_header_id_tbl(i),    -- num2
    x_lines.item_desc_tbl(i),          -- char1
    x_lines.category_tbl(i)            -- char2
  FROM DUAL;
Line: 7572

    INSERT INTO po_session_gt
    (
      key,
      num1
    )
    SELECT p_key,
           x_processing_row_tbl(i)
    FROM   DUAL
    WHERE  NOT EXISTS(
           SELECT 1
           FROM   po_session_gt gt
           WHERE  key = l_data_key
           AND    gt.num1 < x_lines.intf_line_id_tbl(i)
           AND    gt.num2 = x_lines.hd_po_header_id_tbl(i)
           AND    gt.char1 = x_lines.item_desc_tbl(i)
           AND    NVL(x_lines.category_tbl(i), NVL(gt.char2, -99))=
                    NVL(gt.char2, -99));
Line: 7592

  DELETE FROM po_session_gt
  WHERE key = p_key
  RETURNING num1 BULK COLLECT INTO l_index_tbl;
Line: 7698

    INSERT INTO po_session_gt
    (
      key,
      num1,
      num2,
      num3
    )
    SELECT
      p_key,
      x_processing_row_tbl(i),
      draft_lines.po_line_id,
      draft_lines.line_num
    FROM  po_lines_draft_all draft_lines
    WHERE x_lines.item_tbl(i) IS NOT NULL
    AND   draft_lines.po_header_id = x_lines.hd_po_header_id_tbl(i)
    AND   draft_lines.draft_id = x_lines.draft_id_tbl(i)
    AND   NVL(draft_lines.expiration_date, TRUNC(sysdate)) >= TRUNC(sysdate)
    AND   EXISTS (SELECT 1
                  FROM   mtl_system_items items
                  WHERE  items.inventory_item_id = draft_lines.item_id
                  AND    items.segment1 = x_lines.item_tbl(i)
                  AND    items.organization_id =
                           NVL(l_def_master_org_id, items.organization_id))
    AND    NVL(x_lines.item_revision_tbl(i), NVL(draft_lines.item_revision, -99)) =
             NVL(draft_lines.item_revision, -99)
    AND    NVL(x_lines.vendor_product_num_tbl(i), NVL(draft_lines.vendor_product_num, -99)) =
             NVL(draft_lines.vendor_product_num, -99)
    AND    NVL(x_lines.supplier_part_auxid_tbl(i),
               NVL(draft_lines.supplier_part_auxid, FND_API.g_NULL_CHAR))=
           NVL(draft_lines.supplier_part_auxid, FND_API.g_NULL_CHAR);
Line: 7733

    INSERT INTO po_session_gt
    (
      key,
      num1,
      num2,
      num3
    )
    SELECT
      p_key,
      x_processing_row_tbl(i),
      txn_lines.po_line_id,
      txn_lines.line_num
    FROM  po_lines txn_lines
    WHERE x_lines.item_tbl(i) IS NOT NULL
    AND   txn_lines.po_header_id = x_lines.hd_po_header_id_tbl(i)
    AND   NOT EXISTS ( SELECT 1
                       FROM   po_lines_draft_all draft_lines
                       WHERE  draft_lines.po_line_id = txn_lines.po_line_id
                       AND    draft_lines.draft_id = x_lines.draft_id_tbl(i))
    AND   EXISTS (SELECT 1
                  FROM   mtl_system_items items
                  WHERE  items.inventory_item_id = txn_lines.item_id
                  AND    items.segment1 = x_lines.item_tbl(i)
                  AND    items.organization_id =
                           NVL(l_def_master_org_id, items.organization_id))
    AND   NVL(x_lines.item_revision_tbl(i), NVL(txn_lines.item_revision, -99)) =
            NVL(txn_lines.item_revision, -99)
    AND   NVL(x_lines.vendor_product_num_tbl(i), NVL(txn_lines.vendor_product_num, -99)) =
            NVL(txn_lines.vendor_product_num, -99)
    AND   NVL(x_lines.supplier_part_auxid_tbl(i),
              NVL(txn_lines.supplier_part_auxid, FND_API.g_NULL_CHAR)) =
          NVL(txn_lines.supplier_part_auxid, FND_API.g_NULL_CHAR)
    AND   NVL(txn_lines.expiration_date, TRUNC(sysdate)) >= TRUNC(sysdate)
    AND   NVL(txn_lines.closed_code, 'OPEN') <> 'FINALLY CLOSED'
    AND   NVL(txn_lines.cancel_flag, 'N') <> 'Y';
Line: 7771

  DELETE FROM po_session_gt
  WHERE key = p_key
  RETURNING num1, num2, num3 BULK COLLECT INTO
    l_index_tbl, l_po_line_id_tbl, l_line_num_tbl;
Line: 7794

      x_lines.action_tbl(l_index) := PO_PDOI_CONSTANTS.g_ACTION_UPDATE;
Line: 7798

      x_processing_row_tbl.DELETE(l_index);
Line: 7843

    INSERT INTO po_session_gt
    (
      key,
      num1,
      num2,
      char1,
      char2,
      char3,
      char4
    )
  SELECT
    l_data_key,
    x_lines.intf_line_id_tbl(i),       -- num1
    x_lines.hd_po_header_id_tbl(i),    -- num2
    x_lines.item_tbl(i),               -- char1
    x_lines.item_revision_tbl(i),      -- char2
    x_lines.vendor_product_num_tbl(i), -- char3
    x_lines.supplier_part_auxid_tbl(i) -- char4
  FROM DUAL;
Line: 7869

    INSERT INTO po_session_gt
    (
      key,
      num1
    )
    SELECT p_key,
           x_processing_row_tbl(i)
    FROM   DUAL
    WHERE  x_lines.item_tbl(i) IS NOT NULL
    AND    NOT EXISTS(
           SELECT 1
           FROM   po_session_gt gt
           WHERE  key = l_data_key
           AND    gt.num1 < x_lines.intf_line_id_tbl(i)
           AND    gt.num2 = x_lines.hd_po_header_id_tbl(i)
           AND    gt.char1 = x_lines.item_tbl(i)
           AND    NVL(x_lines.item_revision_tbl(i), NVL(gt.char2, -99)) =
                    NVL(gt.char2, -99)
           AND    NVL(x_lines.vendor_product_num_tbl(i), NVL(gt.char3, -99)) =
                    NVL(gt.char3, -99)
           AND    NVL(x_lines.supplier_part_auxid_tbl(i),
                      NVL(gt.char4, FND_API.g_NULL_CHAR))=
                  NVL(gt.char4, FND_API.g_NULL_CHAR));
Line: 7895

  DELETE FROM po_session_gt
  WHERE key = p_key
  RETURNING num1 BULK COLLECT INTO l_index_tbl;
Line: 7980

    INSERT INTO po_session_gt
    (
      key,
      num1,
      num2,
      num3
    )
    SELECT
      p_key,
      x_processing_row_tbl(i),
      draft_lines.po_line_id,
      draft_lines.line_num
    FROM  po_lines_draft_all draft_lines
    WHERE x_lines.item_tbl(i) IS NULL
    AND   x_lines.vendor_product_num_tbl(i) IS NOT NULL
    AND   draft_lines.po_header_id = x_lines.hd_po_header_id_tbl(i)
    AND   draft_lines.draft_id = x_lines.draft_id_tbl(i)
    AND   NVL(draft_lines.expiration_date, TRUNC(sysdate)) >= TRUNC(sysdate)
    AND   draft_lines.vendor_product_num = x_lines.vendor_product_num_tbl(i)
    AND   NVL(x_lines.supplier_part_auxid_tbl(i),
              NVL(draft_lines.supplier_part_auxid, FND_API.g_NULL_CHAR))=
          NVL(draft_lines.supplier_part_auxid, FND_API.g_NULL_CHAR);
Line: 8007

    INSERT INTO po_session_gt
    (
      key,
      num1,
      num2,
      num3
    )
    SELECT
      p_key,
      x_processing_row_tbl(i),
      txn_lines.po_line_id,
      txn_lines.line_num
    FROM  po_lines txn_lines
    WHERE x_lines.item_tbl(i) IS NULL
    AND   x_lines.vendor_product_num_tbl(i) IS NOT NULL
    AND   txn_lines.po_header_id = x_lines.hd_po_header_id_tbl(i)
    AND   NOT EXISTS ( SELECT 1
                       FROM   po_lines_draft_all draft_lines
                       WHERE  draft_lines.po_line_id = txn_lines.po_line_id
                       AND    draft_lines.draft_id = x_lines.draft_id_tbl(i))
    AND   txn_lines.vendor_product_num = x_lines.vendor_product_num_tbl(i)
    AND   NVL(x_lines.supplier_part_auxid_tbl(i),
              NVL(txn_lines.supplier_part_auxid, FND_API.g_NULL_CHAR))=
          NVL(txn_lines.supplier_part_auxid, FND_API.g_NULL_CHAR)
    AND   NVL(txn_lines.expiration_date, TRUNC(sysdate)) >= TRUNC(sysdate)
    AND   NVL(txn_lines.closed_code, 'OPEN') <> 'FINALLY CLOSED'
    AND   NVL(txn_lines.cancel_flag, 'N') <> 'Y';
Line: 8037

  DELETE FROM po_session_gt
  WHERE key = p_key
  RETURNING num1, num2, num3 BULK COLLECT INTO
    l_index_tbl, l_po_line_id_tbl, l_line_num_tbl;
Line: 8060

      x_lines.action_tbl(l_index) := PO_PDOI_CONSTANTS.g_ACTION_UPDATE;
Line: 8064

      x_processing_row_tbl.DELETE(l_index);
Line: 8109

    INSERT INTO po_session_gt
    (
      key,
      num1,
      num2,
      char1,
      char2
    )
  SELECT
    l_data_key,
    x_lines.intf_line_id_tbl(i),       -- num1
    x_lines.hd_po_header_id_tbl(i),    -- num2
    x_lines.vendor_product_num_tbl(i), -- char1
    x_lines.supplier_part_auxid_tbl(i) -- char2
  FROM DUAL;
Line: 8128

    INSERT INTO po_session_gt
    (
      key,
      num1
    )
    SELECT p_key,
           x_processing_row_tbl(i)
    FROM   DUAL
    WHERE  x_lines.item_tbl(i) IS NULL
    AND    x_lines.vendor_product_num_tbl(i) IS NOT NULL
    AND    NOT EXISTS(
           SELECT 1
           FROM   po_session_gt gt
           WHERE  key = l_data_key
           AND    gt.num1 < x_lines.intf_line_id_tbl(i)
           AND    gt.num2 = x_lines.hd_po_header_id_tbl(i)
           AND    gt.char1 = x_lines.vendor_product_num_tbl(i)
           AND    NVL(x_lines.supplier_part_auxid_tbl(i),
                      NVL(gt.char2, FND_API.g_NULL_CHAR))=
                  NVL(gt.char2, FND_API.g_NULL_CHAR));
Line: 8151

  DELETE FROM po_session_gt
  WHERE key = p_key
  RETURNING num1 BULK COLLECT INTO l_index_tbl;
Line: 8238

    INSERT INTO po_session_gt
    (
      key,
      num1,
      num2,
      num3
    )
    SELECT
      p_key,
      x_processing_row_tbl(i),
      draft_lines.po_line_id,
      draft_lines.line_num
    FROM  po_lines_draft_all draft_lines
    WHERE x_lines.item_tbl(i) IS NULL
    AND   x_lines.vendor_product_num_tbl(i) IS NULL
    AND   x_lines.job_name_tbl(i) IS NOT NULL
    AND   draft_lines.po_header_id = x_lines.hd_po_header_id_tbl(i)
    AND   draft_lines.draft_id = x_lines.draft_id_tbl(i)
    AND   NVL(draft_lines.expiration_date, TRUNC(sysdate)) >= TRUNC(sysdate)
    AND   EXISTS (SELECT 1
                  FROM   per_jobs_vl
                  WHERE  name = x_lines.job_name_tbl(i)
                  AND    job_id = draft_lines.job_id)
    AND   NVL(draft_lines.expiration_date, TRUNC(sysdate)) >= TRUNC(sysdate);
Line: 8267

    INSERT INTO po_session_gt
    (
      key,
      num1,
      num2,
      num3
    )
    SELECT
      p_key,
      x_processing_row_tbl(i),
      txn_lines.po_line_id,
      txn_lines.line_num
    FROM  po_lines txn_lines
    WHERE x_lines.item_tbl(i) IS NULL
    AND   x_lines.vendor_product_num_tbl(i) IS NULL
    AND   x_lines.job_name_tbl(i) IS NOT NULL
    AND   txn_lines.po_header_id = x_lines.hd_po_header_id_tbl(i)
    AND   NOT EXISTS ( SELECT 1
                       FROM   po_lines_draft_all draft_lines
                       WHERE  draft_lines.po_line_id = txn_lines.po_line_id
                       AND    draft_lines.draft_id = x_lines.draft_id_tbl(i))
    AND   EXISTS (SELECT 1
                  FROM   per_jobs_vl
                  WHERE  name = x_lines.job_name_tbl(i)
                  AND    job_id = txn_lines.job_id)
    AND   NVL(txn_lines.expiration_date, TRUNC(sysdate)) >= TRUNC(sysdate)
    AND   NVL(txn_lines.closed_code, 'OPEN') <> 'FINALLY CLOSED'
    AND   NVL(txn_lines.cancel_flag, 'N') <> 'Y';
Line: 8298

  DELETE FROM po_session_gt
  WHERE key = p_key
  RETURNING num1, num2, num3 BULK COLLECT INTO
    l_index_tbl, l_po_line_id_tbl, l_line_num_tbl;
Line: 8321

      x_lines.action_tbl(l_index) := PO_PDOI_CONSTANTS.g_ACTION_UPDATE;
Line: 8325

      x_processing_row_tbl.DELETE(l_index);
Line: 8370

    INSERT INTO po_session_gt
    (
      key,
      num1,
      num2,
      char1
    )
  SELECT
    l_data_key,
    x_lines.intf_line_id_tbl(i),       -- num1
    x_lines.hd_po_header_id_tbl(i),    -- num2
    x_lines.job_name_tbl(i)            -- char1
  FROM DUAL;
Line: 8387

    INSERT INTO po_session_gt
    (
      key,
      num1
    )
    SELECT p_key,
           x_processing_row_tbl(i)
    FROM   DUAL
    WHERE  x_lines.item_tbl(i) IS NULL
    AND    x_lines.vendor_product_num_tbl(i) IS NULL
    AND    x_lines.job_name_tbl(i) IS NOT NULL
    AND    NOT EXISTS(
           SELECT 1
           FROM   po_session_gt gt
           WHERE  key = l_data_key
           AND    gt.num1 < x_lines.intf_line_id_tbl(i)
           AND    gt.num2 = x_lines.hd_po_header_id_tbl(i)
           AND    gt.char1 = x_lines.job_name_tbl(i));
Line: 8408

  DELETE FROM po_session_gt
  WHERE key = p_key
  RETURNING num1 BULK COLLECT INTO l_index_tbl;
Line: 8493

    INSERT INTO po_session_gt
    (
      key,
      num1,
      num2,
      num3
    )
    SELECT
      p_key,
      x_processing_row_tbl(i),
      draft_lines.po_line_id,
      draft_lines.line_num
    FROM  po_lines_draft_all draft_lines
    WHERE x_lines.item_tbl(i) IS NULL
    AND   x_lines.vendor_product_num_tbl(i) IS NULL
    AND   x_lines.job_name_tbl(i) IS NULL
    AND   x_lines.line_num_tbl(i) IS NOT NULL
    AND   draft_lines.po_header_id = x_lines.hd_po_header_id_tbl(i)
    AND   draft_lines.draft_id = x_lines.draft_id_tbl(i)
    AND   NVL(draft_lines.expiration_date, TRUNC(sysdate)) >= TRUNC(sysdate)
    AND   draft_lines.line_num = x_lines.line_num_tbl(i);
Line: 8519

    INSERT INTO po_session_gt
    (
      key,
      num1,
      num2,
      num3
    )
    SELECT
      p_key,
      x_processing_row_tbl(i),
      txn_lines.po_line_id,
      txn_lines.line_num
    FROM  po_lines txn_lines
    WHERE x_lines.item_tbl(i) IS NULL
    AND   x_lines.vendor_product_num_tbl(i) IS NULL
    AND   x_lines.job_name_tbl(i) IS NULL
    AND   x_lines.line_num_tbl(i) IS NOT NULL
    AND   txn_lines.po_header_id = x_lines.hd_po_header_id_tbl(i)
    AND   NOT EXISTS ( SELECT 1
                       FROM   po_lines_draft_all draft_lines
                       WHERE  draft_lines.po_line_id = txn_lines.po_line_id
                       AND    draft_lines.draft_id = x_lines.draft_id_tbl(i))
    AND   txn_lines.line_num = x_lines.line_num_tbl(i)
    AND   NVL(txn_lines.expiration_date, TRUNC(sysdate)) >= TRUNC(sysdate)
    AND   NVL(txn_lines.closed_code, 'OPEN') <> 'FINALLY CLOSED'
    AND   NVL(txn_lines.cancel_flag, 'N') <> 'Y';
Line: 8548

  DELETE FROM po_session_gt
  WHERE key = p_key
  RETURNING num1, num2, num3 BULK COLLECT INTO
    l_index_tbl, l_po_line_id_tbl, l_line_num_tbl;
Line: 8560

    x_lines.action_tbl(l_index) := PO_PDOI_CONSTANTS.g_ACTION_UPDATE;
Line: 8563

    x_processing_row_tbl.DELETE(l_index);
Line: 8580

    INSERT INTO po_session_gt
    (
      key,
      num1,
      num2,
      num3
    )
  SELECT
    l_data_key,
    x_lines.intf_line_id_tbl(i),       -- num1
    x_lines.hd_po_header_id_tbl(i),    -- num2
    x_lines.line_num_tbl(i)            -- num3
  FROM DUAL;
Line: 8597

    INSERT INTO po_session_gt
    (
      key,
      num1
    )
    SELECT p_key,
           x_processing_row_tbl(i)
    FROM   DUAL
    WHERE  x_lines.item_tbl(i) IS NULL
    AND    x_lines.vendor_product_num_tbl(i) IS NULL
    AND    x_lines.job_name_tbl(i) IS NULL
    AND    x_lines.line_num_tbl(i) IS NOT NULL
    AND    NOT EXISTS(
           SELECT 1
           FROM   po_session_gt gt
           WHERE  key = l_data_key
           AND    gt.num1 < x_lines.intf_line_id_tbl(i)
           AND    gt.num2 = x_lines.hd_po_header_id_tbl(i)
           AND    gt.num3 = x_lines.line_num_tbl(i));
Line: 8619

  DELETE FROM po_session_gt
  WHERE key = p_key
  RETURNING num1 BULK COLLECT INTO l_index_tbl;
Line: 8743

    x_processing_row_tbl.DELETE(l_index);
Line: 8820

    INSERT INTO po_session_gt
    (
      key,
      num1
    )
    SELECT
      l_key,
      l_index_tbl(i)
    FROM   DUAL
    WHERE  NOT EXISTS
           (
             SELECT 1
             FROM   po_attr_values_tlp_interface
             WHERE  interface_line_id = x_lines.intf_line_id_tbl(i)
             AND    language = x_lines.hd_created_language_tbl(i)
           )
    AND    EXISTS
           (
             SELECT 1
             FROM   po_attr_values_tlp_interface
             WHERE  interface_line_id = x_lines.intf_line_id_tbl(i)
             AND    language <> x_lines.hd_created_language_tbl(i)
           );
Line: 8846

  DELETE FROM po_session_gt
  WHERE key = l_key
  RETURNING num1 BULK COLLECT INTO l_index_tbl;
Line: 9078

    DELETE FROM PO_INTERFACE_ERRORS
    WHERE interface_line_id = l_remove_err_line_tbl(i);
Line: 9125

    INSERT INTO po_session_gt(key, num1, char1)
    SELECT p_key,
           p_index_tbl(i),
           lookup_code
    FROM   PO_LOOKUP_CODES
    WHERE  p_contract_type_display_tbl(i) IS NOT NULL
    AND    x_contract_type_tbl(i) IS null
    AND    LOOKUP_TYPE IN ('PO_FEDERAL_CONTRACT_TYPES_AMT','PO_FEDERAL_CONTRACT_TYPES_QTY')
    AND    displayed_field = p_contract_type_display_tbl(i)
    AND    ROWNUM < 2;
Line: 9139

  DELETE FROM po_session_gt
  WHERE  key = p_key
  RETURNING num1, char1 BULK COLLECT INTO l_index_tbl, l_result_tbl;
Line: 9196

    INSERT INTO po_session_gt(key, num1, char1)
    SELECT p_key,
           p_index_tbl(i),
           lookup_code
    FROM   PO_LOOKUP_CODES
    WHERE  p_cost_constraint_display_tbl(i) IS NOT NULL
    AND    x_cost_constraint_tbl(i) IS null
    AND    LOOKUP_TYPE = 'PO_FEDERAL_COST_CONSTRAINTS'
    AND    displayed_field = p_cost_constraint_display_tbl(i);
Line: 9209

  DELETE FROM po_session_gt
  WHERE  key = p_key
  RETURNING num1, char1 BULK COLLECT INTO l_index_tbl, l_result_tbl;
Line: 9266

    INSERT INTO po_session_gt(key, num1, char1)
    SELECT p_key,
           p_index_tbl(i),
           lookup_code
    FROM   PO_LOOKUP_CODES
    WHERE  p_clm_idc_type_display_tbl(i) IS NOT NULL
    AND    x_clm_idc_type_tbl(i) IS null
    AND    LOOKUP_TYPE = 'PO_FEDERAL_IDC_TYPES'
    AND    displayed_field = p_clm_idc_type_display_tbl(i);
Line: 9279

  DELETE FROM po_session_gt
  WHERE  key = p_key
  RETURNING num1, char1 BULK COLLECT INTO l_index_tbl, l_result_tbl;
Line: 9340

    INSERT INTO po_session_gt(key, num1, num2, num3, char1, char2, char3, num4)
    SELECT p_key,
           p_index_tbl(i),
           p_intf_header_id_tbl(i),
           p_intf_line_id_tbl(i),
           p_line_num_display_tbl(i),
           p_clm_base_line_num_disp_tbl(i),
           p_clm_option_indicator(i),
           x_clm_base_line_num_tbl(i)
    FROM dual;
Line: 9352

  UPDATE po_session_gt psg1
  SET psg1.num4 = ( SELECT psg2.num3 FROM po_session_gt psg2
                    WHERE  psg1.char2 = psg2.char1
                    AND    psg1.num2  = psg2.num2
                  )
  WHERE psg1.char2 IS NOT NULL
  AND   psg1.num4 IS NULL
  AND   Nvl(psg1.char3,'*') = 'O';
Line: 9362

  DELETE FROM po_session_gt
  WHERE  key = p_key
  RETURNING num1, num4 BULK COLLECT INTO l_index_tbl, l_result_tbl;
Line: 9417

    INSERT INTO po_session_gt(key, num1, char1, num2)
    SELECT p_key,
           p_index_tbl(i),
           p_from_header_disp_tbl(i),
           x_from_header_id_tbl(i)
    FROM dual;
Line: 9424

  UPDATE po_session_gt psg
  SET psg.num2 = ( SELECT phi.po_header_id
                   FROM po_headers_all phi
                   WHERE clm_document_number = psg.char1
                 )
  WHERE psg.char1 IS NOT NULL
  AND   psg.num2 IS NULL;
Line: 9433

  DELETE FROM po_session_gt
  WHERE  key = p_key
  RETURNING num1, num2 BULK COLLECT INTO l_index_tbl, l_result_tbl;
Line: 9492

    INSERT INTO po_session_gt(key, num1, char1, num2, num3)
    SELECT p_key,
           p_index_tbl(i),
           p_from_line_disp_tbl(i),
           p_from_header_id_tbl(i),
           x_from_line_id_tbl(i)
    FROM dual;
Line: 9500

  UPDATE po_session_gt psg
  SET psg.num3 = ( SELECT PLI.po_line_id
                   FROM po_lines_all pli
                   WHERE PLI.po_header_id = psg.num2
                   AND   PLI.line_num_display = psg.char1
                 )
  WHERE psg.num2 IS NOT null
  AND   psg.char1 IS NOT NULL
  AND   psg.num3 IS NULL;
Line: 9511

  DELETE FROM po_session_gt
  WHERE  key = p_key
  RETURNING num1, num3 BULK COLLECT INTO l_index_tbl, l_result_tbl;
Line: 9568

    INSERT INTO po_session_gt(key, num1, num2, num3, char1)
    SELECT p_key,
           p_index_tbl(i),
           p_intf_line_id_tbl(i),
           p_clm_base_line_num_tbl(i),
           x_clm_option_indicator_tbl(i)
    FROM dual;
Line: 9576

  UPDATE po_session_gt psg1
  SET    psg1.char1 = 'B'
  WHERE  psg1.num2 IN ( SELECT psg2.num3 FROM po_session_gt psg2
                        WHERE  Nvl(psg2.char1,'*') = 'O'
                        AND    psg2.num3 IS NOT null
                      )
  AND    psg1.char1 IS NULL;
Line: 9585

  DELETE FROM po_session_gt
  WHERE  key = p_key
  RETURNING num1, char1 BULK COLLECT INTO l_index_tbl, l_result_tbl;
Line: 9646

    INSERT INTO po_session_gt(key, num1, num2, num3, num4, char1, num5)
    SELECT p_key,
           p_index_tbl(i),
           p_intf_header_id_tbl(i),
           p_intf_line_id_tbl(i),
           p_clm_base_line_num_tbl(i),
           p_clm_option_indicator_tbl(i),
           null
    FROM dual;
Line: 9656

  SELECT num1,
         Rank() over (PARTITION BY num4 ORDER BY num3)
  BULK COLLECT INTO l_index_tbl, l_option_num_tbl
  FROM   po_session_gt
  WHERE  num4 IS NOT NULL;
Line: 9663

    UPDATE po_session_gt
    SET    num5 = l_option_num_tbl(i)
    WHERE  KEY = p_key
    AND    num1 = l_index_tbl(i);
Line: 9668

  l_index_tbl.DELETE;
Line: 9671

  DELETE FROM po_session_gt
  WHERE  key = p_key
  RETURNING num1, num5 BULK COLLECT INTO l_index_tbl, l_result_tbl;
Line: 9732

    INSERT INTO po_session_gt(key, num1, num2, num3, num4)
    SELECT p_key,
           p_index_tbl(i),
           p_intf_header_id_tbl(i),
           p_intf_line_id_tbl(i),
           x_from_header_id_tbl(i)
    FROM dual;
Line: 9740

  UPDATE po_session_gt psg
  SET psg.num4 = ( SELECT phd.clm_source_document_id
                   FROM po_headers_draft_all phd, po_lines_interface PLI, po_headers_interface phi
                   WHERE PLI.interface_line_id = psg.num3
                   AND   PLI.interface_header_id = phi.interface_header_id
                   AND   phi.po_header_id = phd.po_header_id
                 )
  WHERE psg.num4 IS NULL;
Line: 9750

  DELETE FROM po_session_gt
  WHERE  key = p_key
  RETURNING num1, num4 BULK COLLECT INTO l_index_tbl, l_result_tbl;