DBA Data[Home] [Help]

APPS.INV_LABEL_PVT2 SQL Statements

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

Line: 128

      SELECT   rti.item_id inventory_item_id
             , rti.to_organization_id organization_id
             , msn.lot_number lot_number
             , pol.project_id project_id
             , pol.task_id task_id
             , rti.item_revision revision
             , msn.serial_number serial_number
             , pha.segment1 purchase_order
             , rti.subinventory
             , rti.vendor_id
             , rti.vendor_site_id
             , rti.oe_order_header_id --Bug 4582954
             , rti.oe_order_line_id   --Bug 4582954
          FROM rcv_transactions_interface rti, mtl_serial_numbers msn,
          po_lines_trx_v pol,  -- CLM project, bug 9403291
          wms_lpn_contents wlc,
          po_headers_trx_v pha -- CLM project, bug 9403291
         WHERE wlc.parent_lpn_id = rti.lpn_id
           AND pol.po_line_id(+) = rti.po_line_id
           AND pha.po_header_id(+) = rti.po_header_id
           AND msn.lpn_id = rti.lpn_id
           AND NVL(msn.lot_number, '&&&') = NVL(wlc.lot_number, NVL(msn.lot_number, '&&&'))
           AND msn.inventory_item_id = rti.item_id
           AND msn.current_organization_id = rti.to_organization_id
           AND rti.interface_transaction_id = p_transaction_id
      ORDER BY msn.serial_number;
Line: 174

      SELECT rsl.item_id inventory_item_id   -- @@@ Bug 3472432
           , rt.organization_id organization_id
           , rss.lot_num lot_number
           --Bug# 3586116 - Get project and task id from rt
      ,      rt.project_id
           , rt.task_id
           --  , pod.project_id project_id     --Commented as part of Bug# 3586116
           -- , pod.task_id task_id          --Commented as part of Bug# 3586116
      ,      pol.item_revision revision
           , rss.serial_num
           , pha.segment1 purchase_order
           , rt.subinventory
           , rt.locator_id
           , rt.vendor_id
           , rt.vendor_site_id
           , rt.uom_code
           , rt.oe_order_header_id --Bug 4582954
           , rt.oe_order_line_id   --Bug 4582954
        FROM rcv_transactions rt, rcv_serials_supply rss,
        po_lines_trx_v pol -- CLM project, bug 9403291
             --    , po_distributions_all pod      --Commented as part of Bug# 3586116
             , po_headers_trx_v pha,  -- CLM project, bug 9403291
             rcv_shipment_lines rsl
             , wms_license_plate_numbers wlpn -- Bug 3836623
       WHERE rss.transaction_id = rt.transaction_id
         AND pol.po_line_id(+) = rt.po_line_id
         AND pha.po_header_id(+) = rt.po_header_id
         --  AND   pod.po_distribution_id(+)          = rt.po_distribution_id     --Commented as part of Bug# 3586116
         AND(
             (rt.transaction_type IN('ACCEPT', 'REJECT')
              AND p_label_type_info.business_flow_code = 2)
             OR(rt.transaction_type = 'RECEIVE'
                --AND rt.routing_header_id <> 3 Modified for Bug: 4312020
                AND p_label_type_info.business_flow_code = 1)
            )
         --AND   rsl.shipment_header_id = rt.shipment_header_id  -- @@@ Bug 3472432. Takes care of the cartesian product.
         AND rsl.shipment_line_id = rt.shipment_line_id   --Bug# 3516361. Takes care of cartesian product.
         AND rt.GROUP_ID = p_transaction_id
         -- Bug 3836623
         -- Add check for LPN context
         -- When cross docking happens, label printing are called for both cross docking and putaway
         -- To prevent duplicate labels
         -- For putaway business flow, only print if LPN Context is not Picked (11)
         AND wlpn.lpn_id(+) = rt.lpn_id
         AND ((rt.lpn_id IS NULL) OR
              (p_label_type_info.business_flow_code <> 4) OR
              (p_label_type_info.business_flow_code = 4 AND
                      wlpn.lpn_context <> 11))
      UNION ALL
      SELECT rsl.item_id inventory_item_id
           , rt.organization_id organization_id
           , mtln.lot_number
           --Bug# 3586116 - Get project and task id from rt
      ,      rt.project_id
           , rt.task_id
           --  , pod.project_id project_id     --Commented as part of Bug# 3586116
           -- , pod.task_id task_id          --Commented as part of Bug# 3586116
      ,      rsl.item_revision revision
           , mut.serial_number
           , pha.segment1 purchase_order
           , rt.subinventory
           , rt.locator_id
           , rt.vendor_id
           , rt.vendor_site_id
           , rt.uom_code
           , rt.oe_order_header_id --Bug 4582954
           , rt.oe_order_line_id   --Bug 4582954
        FROM rcv_transactions rt
           , mtl_transaction_lot_numbers mtln
           , mtl_unit_transactions mut
           -- , po_distributions_all pod     --Commented as part of Bug# 3586116
      ,      po_lines_trx_v pol -- CLM project, bug 9403291
           , po_headers_trx_v pha -- CLM project, bug 9403291
           , rcv_shipment_lines rsl
           , wms_license_plate_numbers wlpn -- Bug 3836623
           -- Bug 4179732, can not print serial number from putaway
           -- Changed to link to MUT through MMT
           , mtl_material_transactions mmt
         WHERE mmt.rcv_transaction_id = rt.transaction_id
         AND mmt.transaction_id = mtln.transaction_id (+)
         AND mut.transaction_id = nvl(mtln.serial_transaction_id, mmt.transaction_id)
       --WHERE mtln.product_transaction_id(+) = rt.transaction_id
       --  AND mut.product_transaction_id(+) = rt.transaction_id
       --  AND NVL(mut.transaction_id, -9998) = NVL(mtln.serial_transaction_id, NVL(mut.transaction_id, -9998))
       -- End of bug 4179732
         AND pol.po_line_id(+) = rt.po_line_id
         AND pha.po_header_id(+) = rt.po_header_id
         --AND   pod.po_distribution_id(+)            = rt.po_distribution_id       --Commented as part of Bug# 3586116
         AND rt.transaction_type = 'DELIVER'
         AND (p_label_type_info.business_flow_code IN(3, 4) OR
               (rt.routing_header_id = 3
                AND p_label_type_info.business_flow_code = 1)) /* Added for bug # 5219262*/
         AND rt.GROUP_ID = p_transaction_id
         AND rsl.shipment_line_id = rt.shipment_line_id
         -- Bug 3836623
         -- Add check for LPN context
         -- When cross docking happens, label printing are called for both cross docking and putaway
         -- To prevent duplicate labels
         -- For putaway business flow, only print if LPN Context is not Picked (11)
         AND wlpn.lpn_id(+) = rt.lpn_id
         AND ((rt.lpn_id IS NULL) OR
              (p_label_type_info.business_flow_code <> 4) OR
              (p_label_type_info.business_flow_code = 4 AND
                      wlpn.lpn_context <> 11))

         ;
Line: 287

      SELECT rti.item_id inventory_item_id
           , rti.to_organization_id organization_id
           , mtlt.lot_number lot_number
           , pol.project_id project_id
           , pol.task_id task_id
           , rti.item_revision revision
           , msnt.fm_serial_number fm_serial_number
           , msnt.to_serial_number to_serial_number
           , pha.segment1 purchase_order
           , rti.subinventory
           , rti.vendor_id
           , rti.vendor_site_id
           , rti.oe_order_header_id --Bug 4582954
           , rti.oe_order_line_id   --Bug 4582954
        FROM rcv_transactions_interface rti
           , mtl_serial_numbers_temp msnt
           , mtl_transaction_lots_temp mtlt
           , po_lines_trx_v pol -- CLM project, bug 9403291
           , po_headers_trx_v pha -- CLM project, bug 9403291
       WHERE mtlt.transaction_temp_id(+) = rti.interface_transaction_id
         AND msnt.transaction_temp_id = NVL(mtlt.serial_transaction_temp_id, rti.interface_transaction_id)
         AND pol.po_line_id(+) = rti.po_line_id
         AND pha.po_header_id(+) = rti.po_header_id
         AND rti.interface_transaction_id = p_transaction_id;
Line: 318

      SELECT mmtt.inventory_item_id inventory_item_id
           , mmtt.organization_id organization_id
           , mtlt.lot_number lot_number
           , mmtt.project_id project_id
           , mmtt.task_id task_id
           , mmtt.revision revision
           , msnt.fm_serial_number fm_serial_number
           , msnt.to_serial_number to_serial_number
           , mmtt.subinventory_code
           , mmtt.transaction_uom
           , mmtt.locator_id /* Added for Bug # 4672471 */
        FROM mtl_material_transactions_temp mmtt, mtl_transaction_lots_temp mtlt, mtl_serial_numbers_temp msnt
       WHERE mtlt.transaction_temp_id(+) = mmtt.transaction_temp_id
         AND msnt.transaction_temp_id = NVL(mtlt.serial_transaction_temp_id, mmtt.transaction_temp_id)
         AND mmtt.transaction_temp_id = p_transaction_id;
Line: 337

      SELECT mmtt.inventory_item_id inventory_item_id
           , mmtt.organization_id organization_id
           , msn.lot_number lot_number
           , mmtt.project_id project_id
           , mmtt.task_id task_id
           , mmtt.revision revision
           , msn.serial_number serial_number
           , mmtt.subinventory_code
           , mmtt.transaction_uom
           , mmtt.locator_id
        FROM mtl_material_transactions_temp mmtt, mtl_serial_numbers msn
       WHERE mmtt.transaction_temp_id = p_transaction_id
         AND mmtt.lpn_id = msn.lpn_id;
Line: 353

      SELECT wdd1.inventory_item_id inventory_item_id
           , wdd1.organization_id organization_id
           , wdd1.lot_number lot_number
           , NVL(wdd1.project_id, 0) project_id
           , NVL(wdd1.task_id, 0) task_id
           , wdd1.revision revision
           , wdd1.serial_number serial_number
           , wdd1.subinventory
           , wdd1.requested_quantity_uom
        FROM wsh_delivery_details wdd1, wsh_delivery_assignments_v wda, wsh_delivery_details wdd2
       WHERE wdd1.delivery_detail_id(+) = wda.delivery_detail_id
         AND wda.parent_delivery_detail_id(+) = wdd2.delivery_detail_id
         AND wdd2.delivery_detail_id = p_transaction_id;   --168158
Line: 370

      SELECT wdd.inventory_item_id inventory_item_id
           , wdd.organization_id organization_id
           , wdd.lot_number lot_number
           , NVL(wdd.project_id, 0) project_id
           , NVL(wdd.task_id, 0) task_id
           , wdd.revision revision
           , wdd.serial_number serial_number      /* If there is only one item then this sl. no will get populated
                                                     and there would not be any mtl_serial_numbers_temp record for it. */
           , msnt.fm_serial_number fm_serial_number  --Added to fix Bug# 4290536
           , NVL(msnt.to_serial_number, msnt.fm_serial_number) to_serial_number --Added to fix Bug# 4290536
           , wdd.subinventory
           , wdd.requested_quantity_uom
        FROM wsh_delivery_details wdd, wsh_delivery_assignments wda,
             wsh_new_deliveries wnd, mtl_serial_numbers_temp msnt
       WHERE wda.delivery_id = wnd.delivery_id
         AND NVL(wdd.transaction_temp_id, -1) = msnt.transaction_temp_id(+)
         AND wdd.delivery_detail_id = wda.delivery_detail_id
         AND wdd.inventory_item_id IS NOT NULL
         AND wnd.delivery_id = p_transaction_id;
Line: 394

      SELECT mmtt.inventory_item_id
           , mmtt.organization_id
           , mtlt.lot_number
           , mmtt.cost_group_id
           , mmtt.project_id
           , mmtt.task_id
           , mmtt.transaction_uom
           , mmtt.revision
           , msnt.fm_serial_number
           , msnt.to_serial_number
           , mmtt.subinventory_code
           , mmtt.locator_id
           , wnt.wip_entity_name --Added for Bug: 4642062
           , wnt.wip_entity_id
        FROM  mtl_material_transactions_temp mmtt
            , mtl_transaction_lots_temp mtlt
            , mtl_serial_numbers_temp msnt
            , wip_entities wnt --Added for Bug 4642062
       WHERE mtlt.transaction_temp_id(+) = mmtt.transaction_temp_id
         AND msnt.transaction_temp_id = NVL(mtlt.serial_transaction_temp_id, mmtt.transaction_temp_id)
         AND mmtt.transaction_temp_id = p_transaction_id
         AND wnt.wip_entity_id(+) = mmtt.transaction_source_id;--Added for Bug 4642062
Line: 422

      SELECT mti.inventory_item_id inventory_item_id
           , mti.organization_id organization_id
           , mtil.lot_number lot_number
           , mti.project_id project_id
           , mti.task_id task_id
           , mti.revision revision
           , msni.fm_serial_number fm_serial_number
           , msni.to_serial_number to_serial_number
           , mti.subinventory_code
           , mti.locator_id   -- Added for Bug #5533362
           , mti.transaction_uom
        FROM mtl_transactions_interface mti, mtl_transaction_lots_interface mtil, mtl_serial_numbers_interface msni
       WHERE mtil.transaction_interface_id(+) = mti.transaction_interface_id
         AND msni.transaction_interface_id = NVL(mtil.serial_transaction_temp_id, mti.transaction_interface_id)
         AND mti.transaction_interface_id = p_transaction_id;
Line: 439

      SELECT mol.inventory_item_id inventory_item_id
           , mol.organization_id organization_id
           , mol.lot_number lot_number
           , mol.project_id project_id
           , mol.task_id task_id
           , mol.revision revision
           , mol.serial_number_start fm_serial_number
           , mol.serial_number_end to_serial_number
           , mol.from_subinventory_code
           , mol.uom_code
        FROM mtl_txn_request_lines mol
       WHERE mol.line_id = p_transaction_id;
Line: 464

      SELECT organization_id
        FROM rcv_transactions rt
       WHERE rt.GROUP_ID = p_transaction_id;
Line: 472

    SELECT project_name, project_number
    FROM pjm_projects_mtll_v  --pa_projects
    WHERE project_id = l_project_id;
Line: 479

    SELECT task_name, task_number
    FROM pa_tasks
    WHERE task_id = l_task_id;
Line: 489

       SELECT pop.project_reference_enabled
       FROM pjm_org_parameters pop
       WHERE pop.organization_id = p_organization_id;
Line: 498

      SELECT wipent.wip_entity_name job_name
           , mfglkp.meaning job_type
           , wipdj.net_quantity job_net_quantity
           , TO_CHAR(wipdj.scheduled_start_date, g_date_format_mask) job_scheduled_start_date
           , TO_CHAR(wipdj.scheduled_completion_date, g_date_format_mask) job_scheduled_completion_date
           , wipdj.bom_revision job_bom_revision
           , wipdj.routing_revision job_routing_revision
        FROM wip_entities wipent
           , wip_discrete_jobs wipdj
           , mfg_lookups mfglkp
       WHERE wipdj.wip_entity_id = wipent.wip_entity_id
         AND wipdj.organization_id = wipent.organization_id
         AND mfglkp.lookup_code(+) = wipent.entity_type
         AND mfglkp.lookup_type(+) = 'WIP_ENTITY'
         AND wipent.wip_entity_id = l_wip_entity_id
         AND wipent.organization_id = l_organization_id;
Line: 616

     SELECT mtlt.c_attribute1
          , mtlt.c_attribute2
          , mtlt.c_attribute3
          , mtlt.c_attribute4
          , mtlt.c_attribute5
          , mtlt.c_attribute6
          , mtlt.c_attribute7
          , mtlt.c_attribute8
          , mtlt.c_attribute9
          , mtlt.c_attribute10
          , mtlt.c_attribute11
          , mtlt.c_attribute12
          , mtlt.c_attribute13
          , mtlt.c_attribute14
          , mtlt.c_attribute15
          , mtlt.c_attribute16
          , mtlt.c_attribute17
          , mtlt.c_attribute18
          , mtlt.c_attribute19
          , mtlt.c_attribute20
          , mtlt.d_attribute1
          , mtlt.d_attribute2
          , mtlt.d_attribute3
          , mtlt.d_attribute4
          , mtlt.d_attribute5
          , mtlt.d_attribute6
          , mtlt.d_attribute7
          , mtlt.d_attribute8
          , mtlt.d_attribute9
          , mtlt.d_attribute10
          , mtlt.n_attribute1
          , mtlt.n_attribute2
          , mtlt.n_attribute3
          , mtlt.n_attribute4
          , mtlt.n_attribute5
          , mtlt.n_attribute6
          , mtlt.n_attribute7
          , mtlt.n_attribute8
          , mtlt.n_attribute9
          , mtlt.n_attribute10
          , msnt.c_attribute1
          , msnt.c_attribute2
          , msnt.c_attribute3
          , msnt.c_attribute4
          , msnt.c_attribute5
          , msnt.c_attribute6
          , msnt.c_attribute7
          , msnt.c_attribute8
          , msnt.c_attribute9
          , msnt.c_attribute10
          , msnt.c_attribute11
          , msnt.c_attribute12
          , msnt.c_attribute13
          , msnt.c_attribute14
          , msnt.c_attribute15
          , msnt.c_attribute16
          , msnt.c_attribute17
          , msnt.c_attribute18
          , msnt.c_attribute19
          , msnt.c_attribute20
          , msnt.d_attribute1
          , msnt.d_attribute2
          , msnt.d_attribute3
          , msnt.d_attribute4
          , msnt.d_attribute5
          , msnt.d_attribute6
          , msnt.d_attribute7
          , msnt.d_attribute8
          , msnt.d_attribute9
          , msnt.d_attribute10
          , msnt.n_attribute1
          , msnt.n_attribute2
          , msnt.n_attribute3
          , msnt.n_attribute4
          , msnt.n_attribute5
          , msnt.n_attribute6
          , msnt.n_attribute7
          , msnt.n_attribute8
          , msnt.n_attribute9
          , msnt.n_attribute10
       FROM mtl_transaction_lots_temp mtlt
          , mtl_serial_numbers_temp msnt
          , mtl_material_transactions_temp mmtt
      WHERE mtlt.transaction_temp_id(+) = mmtt.transaction_temp_id
        AND msnt.transaction_temp_id = NVL(mtlt.serial_transaction_temp_id, mmtt.transaction_temp_id)
        AND mmtt.transaction_temp_id = p_transaction_id
        AND mtlt.lot_number(+) = l_lot_number
        AND msnt.fm_serial_number = l_fm_serial_number
        AND msnt.to_serial_number = l_to_serial_number;
Line: 710

      SELECT msn2.item item
	     , msn2.client_item client_item			-- Added for LSP Project, bug 9087971
           , msn2.inventory_item_id inventory_item_id
           , mp.organization_code ORGANIZATION
           , msn2.organization_id organization_id
           , msn2.item_description item_description
           , msn2.revision revision
           , msn2.item_hazard_class item_hazard_class
           , msn2.item_attribute_category item_attribute_category
           , msn2.item_attribute1 item_attribute1
           , msn2.item_attribute2 item_attribute2
           , msn2.item_attribute3 item_attribute3
           , msn2.item_attribute4 item_attribute4
           , msn2.item_attribute5 item_attribute5
           , msn2.item_attribute6 item_attribute6
           , msn2.item_attribute7 item_attribute7
           , msn2.item_attribute8 item_attribute8
           , msn2.item_attribute9 item_attribute9
           , msn2.item_attribute10 item_attribute10
           , msn2.item_attribute11 item_attribute11
           , msn2.item_attribute12 item_attribute12
           , msn2.item_attribute13 item_attribute13
           , msn2.item_attribute14 item_attribute14
           , msn2.item_attribute15 item_attribute15
           , msn2.serial_number serial_number
           , mmsvl1.status_code lot_status
           , msn2.serial_attribute_category serial_attribute_category
           , -- Start for bug # 4947399
             NVL(l_serial_c_attribute1, msn2.serial_c_attribute1) serial_c_attribute1
           , NVL(l_serial_c_attribute2, msn2.serial_c_attribute2) serial_c_attribute2
           , NVL(l_serial_c_attribute3, msn2.serial_c_attribute3) serial_c_attribute3
           , NVL(l_serial_c_attribute4, msn2.serial_c_attribute4) serial_c_attribute4
           , NVL(l_serial_c_attribute5, msn2.serial_c_attribute5) serial_c_attribute5
           , NVL(l_serial_c_attribute6, msn2.serial_c_attribute6) serial_c_attribute6
           , NVL(l_serial_c_attribute7, msn2.serial_c_attribute7) serial_c_attribute7
           , NVL(l_serial_c_attribute8, msn2.serial_c_attribute8) serial_c_attribute8
           , NVL(l_serial_c_attribute9, msn2.serial_c_attribute9) serial_c_attribute9
           , NVL(l_serial_c_attribute10, msn2.serial_c_attribute10) serial_c_attribute10
           , NVL(l_serial_c_attribute11, msn2.serial_c_attribute11) serial_c_attribute11
           , NVL(l_serial_c_attribute12, msn2.serial_c_attribute12) serial_c_attribute12
           , NVL(l_serial_c_attribute13, msn2.serial_c_attribute13) serial_c_attribute13
           , NVL(l_serial_c_attribute14, msn2.serial_c_attribute14) serial_c_attribute14
           , NVL(l_serial_c_attribute15, msn2.serial_c_attribute15) serial_c_attribute15
           , NVL(l_serial_c_attribute16, msn2.serial_c_attribute16) serial_c_attribute16
           , NVL(l_serial_c_attribute17, msn2.serial_c_attribute17) serial_c_attribute17
           , NVL(l_serial_c_attribute18, msn2.serial_c_attribute18) serial_c_attribute18
           , NVL(l_serial_c_attribute19, msn2.serial_c_attribute19) serial_c_attribute19
           , NVL(l_serial_c_attribute20, msn2.serial_c_attribute20) serial_c_attribute20
           , NVL(l_serial_d_attribute1, msn2.serial_d_attribute1) serial_d_attribute1
           , NVL(l_serial_d_attribute2, msn2.serial_d_attribute2) serial_d_attribute2
           , NVL(l_serial_d_attribute3, msn2.serial_d_attribute3) serial_d_attribute3
           , NVL(l_serial_d_attribute4, msn2.serial_d_attribute4) serial_d_attribute4
           , NVL(l_serial_d_attribute5, msn2.serial_d_attribute5) serial_d_attribute5
           , NVL(l_serial_d_attribute6, msn2.serial_d_attribute6) serial_d_attribute6
           , NVL(l_serial_d_attribute7, msn2.serial_d_attribute7) serial_d_attribute7
           , NVL(l_serial_d_attribute8, msn2.serial_d_attribute8) serial_d_attribute8
           , NVL(l_serial_d_attribute9, msn2.serial_d_attribute9) serial_d_attribute9
           , NVL(l_serial_d_attribute10, msn2.serial_d_attribute10) serial_d_attribute10
           , NVL(l_serial_n_attribute1, msn2.serial_n_attribute1) serial_n_attribute1
           , NVL(l_serial_n_attribute2, msn2.serial_n_attribute2) serial_n_attribute2
           , NVL(l_serial_n_attribute3, msn2.serial_n_attribute3) serial_n_attribute3
           , NVL(l_serial_n_attribute4, msn2.serial_n_attribute4) serial_n_attribute4
           , NVL(l_serial_n_attribute5, msn2.serial_n_attribute5) serial_n_attribute5
           , NVL(l_serial_n_attribute6, msn2.serial_n_attribute6) serial_n_attribute6
           , NVL(l_serial_n_attribute7, msn2.serial_n_attribute7) serial_n_attribute7
           , NVL(l_serial_n_attribute8, msn2.serial_n_attribute8) serial_n_attribute8
           , NVL(l_serial_n_attribute9, msn2.serial_n_attribute9) serial_n_attribute9
           , NVL(l_serial_n_attribute10, msn2.serial_n_attribute10) serial_n_attribute10
           , -- End for bug # 4947399
             msn2.serial_country_of_origin serial_country_of_origin
           , msn2.serial_time_since_new serial_time_since_new
           , msn2.serial_cycles_since_new serial_cycles_since_new
           , msn2.serial_time_since_overhaul serial_time_since_overhaul
           , msn2.serial_cycles_since_overhaul serial_cycles_since_overhaul
           , msn2.serial_time_since_repair serial_time_since_repair
           , msn2.serial_cycles_since_repair serial_cycles_since_repair
           , msn2.serial_time_since_visit serial_time_since_visit
           , msn2.serial_cycles_since_visit serial_cycles_since_visit
           , msn2.serial_time_since_mark serial_time_since_mark
           , msn2.serial_cycles_since_mark serial_cycles_since_mark
           , msn2.serial_num_of_repairs serial_num_of_repairs
           , msn2.serial_initialization_date serial_initialization_date
           , msn2.serial_completion_date serial_completion_date
           , msn2.serial_fixed_asset_tag serial_fixed_asset_tag
           , msn2.serial_vendor_serial serial_vendor_serial
           , msn2.project_number project_number -- Fix For Bug: 4907062
           , msn2.project project
           , msn2.task_number task_number  -- Fix For Bug: 4907062
           , msn2.task task
           , msn2.cost_group cost_group
           , NVL(l_lot_number, mln.lot_number) lot_number
           , msn2.serial_number_status serial_number_status
           , msn2.job_name job_name
           ,   -- Added as part of change for patchset "I".
             msn2.LOCATOR LOCATOR
           , TO_CHAR(mln.expiration_date, g_date_format_mask) lot_expiration_date
           ,   -- Added for Bug 2795525,
             mln.attribute_category lot_attribute_category
           , -- Start for bug # 4947399
             NVL(l_lot_c_attribute1, mln.c_attribute1) lot_c_attribute1
           , NVL(l_lot_c_attribute2, mln.c_attribute2) lot_c_attribute2
           , NVL(l_lot_c_attribute3, mln.c_attribute3) lot_c_attribute3
           , NVL(l_lot_c_attribute4, mln.c_attribute4) lot_c_attribute4
           , NVL(l_lot_c_attribute5, mln.c_attribute5) lot_c_attribute5
           , NVL(l_lot_c_attribute6, mln.c_attribute6) lot_c_attribute6
           , NVL(l_lot_c_attribute7, mln.c_attribute7) lot_c_attribute7
           , NVL(l_lot_c_attribute8, mln.c_attribute8) lot_c_attribute8
           , NVL(l_lot_c_attribute9, mln.c_attribute9) lot_c_attribute9
           , NVL(l_lot_c_attribute10, mln.c_attribute10) lot_c_attribute10
           , NVL(l_lot_c_attribute11, mln.c_attribute11) lot_c_attribute11
           , NVL(l_lot_c_attribute12, mln.c_attribute12) lot_c_attribute12
           , NVL(l_lot_c_attribute13, mln.c_attribute13) lot_c_attribute13
           , NVL(l_lot_c_attribute14, mln.c_attribute14) lot_c_attribute14
           , NVL(l_lot_c_attribute15, mln.c_attribute15) lot_c_attribute15
           , NVL(l_lot_c_attribute16, mln.c_attribute16) lot_c_attribute16
           , NVL(l_lot_c_attribute17, mln.c_attribute17) lot_c_attribute17
           , NVL(l_lot_c_attribute18, mln.c_attribute18) lot_c_attribute18
           , NVL(l_lot_c_attribute19, mln.c_attribute19) lot_c_attribute19
           , NVL(l_lot_c_attribute20, mln.c_attribute20) lot_c_attribute20
           , TO_CHAR(NVL(l_lot_d_attribute1, mln.d_attribute1), g_date_format_mask) lot_d_attribute1
           ,   -- Added for Bug 2795525,
             TO_CHAR(NVL(l_lot_d_attribute2, mln.d_attribute2), g_date_format_mask) lot_d_attribute2
           ,   -- Added for Bug 2795525,
             TO_CHAR(NVL(l_lot_d_attribute3, mln.d_attribute3), g_date_format_mask) lot_d_attribute3
           ,   -- Added for Bug 2795525,
             TO_CHAR(NVL(l_lot_d_attribute4, mln.d_attribute4), g_date_format_mask) lot_d_attribute4
           ,   -- Added for Bug 2795525,
             TO_CHAR(NVL(l_lot_d_attribute5, mln.d_attribute5), g_date_format_mask) lot_d_attribute5
           ,   -- Added for Bug 2795525,
             TO_CHAR(NVL(l_lot_d_attribute6, mln.d_attribute6), g_date_format_mask) lot_d_attribute6
           ,   -- Added for Bug 2795525,
             TO_CHAR(NVL(l_lot_d_attribute7, mln.d_attribute7), g_date_format_mask) lot_d_attribute7
           ,   -- Added for Bug 2795525,
             TO_CHAR(NVL(l_lot_d_attribute8, mln.d_attribute8), g_date_format_mask) lot_d_attribute8
           ,   -- Added for Bug 2795525,
             TO_CHAR(NVL(l_lot_d_attribute9, mln.d_attribute9), g_date_format_mask) lot_d_attribute9
           ,   -- Added for Bug 2795525,
             TO_CHAR(NVL(l_lot_d_attribute10, mln.d_attribute10), g_date_format_mask) lot_d_attribute10
           ,   -- Added for Bug 2795525,
             NVL(l_lot_n_attribute1, mln.n_attribute1) lot_n_attribute1
           , NVL(l_lot_n_attribute2, mln.n_attribute2) lot_n_attribute2
           , NVL(l_lot_n_attribute3, mln.n_attribute3) lot_n_attribute3
           , NVL(l_lot_n_attribute4, mln.n_attribute4) lot_n_attribute4
           , NVL(l_lot_n_attribute5, mln.n_attribute5) lot_n_attribute5
           , NVL(l_lot_n_attribute6, mln.n_attribute6) lot_n_attribute6
           , NVL(l_lot_n_attribute7, mln.n_attribute7) lot_n_attribute7
           , NVL(l_lot_n_attribute8, mln.n_attribute8) lot_n_attribute8
           , NVL(l_lot_n_attribute9, mln.n_attribute9) lot_n_attribute9
           , NVL(l_lot_n_attribute10, mln.n_attribute10) lot_n_attribute10
           , -- End for bug # 4947399
             mln.territory_code lot_country_of_origin
           , mln.grade_code lot_grade_code
           , TO_CHAR(mln.origination_date, g_date_format_mask) lot_origination_date
           ,   -- Added for Bug 2795525,
             mln.date_code lot_date_code
           , TO_CHAR(mln.change_date, g_date_format_mask) lot_change_date
           ,   -- Added for Bug 2795525,
             mln.age lot_age
           , TO_CHAR(mln.retest_date, g_date_format_mask) lot_retest_date
           ,   -- Added for Bug 2795525,
             TO_CHAR(mln.maturity_date, g_date_format_mask) lot_maturity_date
           ,   -- Added for Bug 2795525,
             mln.item_size lot_item_size
           , mln.color lot_color
           , mln.volume lot_volume
           , mln.volume_uom lot_volume_uom
           , mln.place_of_origin lot_place_of_origin
           , TO_CHAR(mln.best_by_date, g_date_format_mask) lot_best_by_date
           ,   -- Added for Bug 2795525,
             mln.LENGTH lot_length
           , mln.length_uom lot_length_uom
           , mln.recycled_content lot_recycled_cont
           , mln.thickness lot_thickness
           , mln.thickness_uom lot_thickness_uom
           , mln.width lot_width
           , mln.width_uom lot_width_uom
           , mln.curl_wrinkle_fold lot_curl
           , mln.vendor_name lot_vendor
        FROM mtl_lot_numbers mln
           , mtl_material_statuses_vl mmsvl1
           , mtl_parameters mp
           , (SELECT msik.concatenated_segments item
                   , WMS_DEPLOY.GET_CLIENT_ITEM(l_organization_id, msik.inventory_item_id) client_item		-- Added for LSP Project, bug 9087971
                   , msik.inventory_item_id inventory_item_id
                   , msik.organization_id organization_id
                   , msik.description item_description
                   , l_revision revision
                   , poh.hazard_class item_hazard_class
                   , msik.attribute_category item_attribute_category
                   , msik.attribute1 item_attribute1
                   , msik.attribute2 item_attribute2
                   , msik.attribute3 item_attribute3
                   , msik.attribute4 item_attribute4
                   , msik.attribute5 item_attribute5
                   , msik.attribute6 item_attribute6
                   , msik.attribute7 item_attribute7
                   , msik.attribute8 item_attribute8
                   , msik.attribute9 item_attribute9
                   , msik.attribute10 item_attribute10
                   , msik.attribute11 item_attribute11
                   , msik.attribute12 item_attribute12
                   , msik.attribute13 item_attribute13
                   , msik.attribute14 item_attribute14
                   , msik.attribute15 item_attribute15
                   , mmsvl2.status_code serial_number_status
                   , msn.attribute_category serial_attribute_category
                   , msn.c_attribute1 serial_c_attribute1
                   , msn.c_attribute2 serial_c_attribute2
                   , msn.c_attribute3 serial_c_attribute3
                   , msn.c_attribute4 serial_c_attribute4
                   , msn.c_attribute5 serial_c_attribute5
                   , msn.c_attribute6 serial_c_attribute6
                   , msn.c_attribute7 serial_c_attribute7
                   , msn.c_attribute8 serial_c_attribute8
                   , msn.c_attribute9 serial_c_attribute9
                   , msn.c_attribute10 serial_c_attribute10
                   , msn.c_attribute11 serial_c_attribute11
                   , msn.c_attribute12 serial_c_attribute12
                   , msn.c_attribute13 serial_c_attribute13
                   , msn.c_attribute14 serial_c_attribute14
                   , msn.c_attribute15 serial_c_attribute15
                   , msn.c_attribute16 serial_c_attribute16
                   , msn.c_attribute17 serial_c_attribute17
                   , msn.c_attribute18 serial_c_attribute18
                   , msn.c_attribute19 serial_c_attribute19
                   , msn.c_attribute20 serial_c_attribute20
                   , TO_CHAR(msn.d_attribute1, g_date_format_mask) serial_d_attribute1
                   ,   -- Added for Bug 2795525,
                     TO_CHAR(msn.d_attribute2, g_date_format_mask) serial_d_attribute2
                   ,   -- Added for Bug 2795525,
                     TO_CHAR(msn.d_attribute3, g_date_format_mask) serial_d_attribute3
                   ,   -- Added for Bug 2795525,
                     TO_CHAR(msn.d_attribute4, g_date_format_mask) serial_d_attribute4
                   ,   -- Added for Bug 2795525,
                     TO_CHAR(msn.d_attribute5, g_date_format_mask) serial_d_attribute5
                   ,   -- Added for Bug 2795525,
                     TO_CHAR(msn.d_attribute6, g_date_format_mask) serial_d_attribute6
                   ,   -- Added for Bug 2795525,
                     TO_CHAR(msn.d_attribute7, g_date_format_mask) serial_d_attribute7
                   ,   -- Added for Bug 2795525,
                     TO_CHAR(msn.d_attribute8, g_date_format_mask) serial_d_attribute8
                   ,   -- Added for Bug 2795525,
                     TO_CHAR(msn.d_attribute9, g_date_format_mask) serial_d_attribute9
                   ,   -- Added for Bug 2795525,
                     TO_CHAR(msn.d_attribute10, g_date_format_mask) serial_d_attribute10
                   ,   -- Added for Bug 2795525,
                     msn.n_attribute1 serial_n_attribute1
                   , msn.n_attribute2 serial_n_attribute2
                   , msn.n_attribute3 serial_n_attribute3
                   , msn.n_attribute4 serial_n_attribute4
                   , msn.n_attribute5 serial_n_attribute5
                   , msn.n_attribute6 serial_n_attribute6
                   , msn.n_attribute7 serial_n_attribute7
                   , msn.n_attribute8 serial_n_attribute8
                   , msn.n_attribute9 serial_n_attribute9
                   , msn.n_attribute10 serial_n_attribute10
                   , msn.territory_code serial_country_of_origin
                   , msn.time_since_new serial_time_since_new
                   , msn.cycles_since_new serial_cycles_since_new
                   , msn.time_since_overhaul serial_time_since_overhaul
                   , msn.cycles_since_overhaul serial_cycles_since_overhaul
                   , msn.time_since_repair serial_time_since_repair
                   , msn.cycles_since_repair serial_cycles_since_repair
                   , msn.time_since_visit serial_time_since_visit
                   , msn.cycles_since_visit serial_cycles_since_visit
                   , msn.time_since_mark serial_time_since_mark
                   , msn.cycles_since_mark serial_cycles_since_mark
                   , msn.number_of_repairs serial_num_of_repairs
                   , TO_CHAR(msn.initialization_date, g_date_format_mask) serial_initialization_date
                   -- Added for Bug 2795525,
                   , TO_CHAR(msn.completion_date, g_date_format_mask) serial_completion_date
                   -- Added for Bug 2795525,      ,
                   , msn.fixed_asset_tag serial_fixed_asset_tag
                   , msn.vendor_serial_number serial_vendor_serial
                   , l_project_number project_number -- Fix For Bug: 4907062
                   , l_project_name project
                   , l_task_number task_number -- Fix For Bug: 4907062
                   , l_task_name task
                   , ccg.cost_group cost_group
                   , msn.lot_number lot_number
                   , msn.serial_number serial_number
                   , wipent.wip_entity_name job_name
                   ,   -- Added as part of change for patchset "I".
                     wilk.concatenated_segments LOCATOR
                    --milk.concatenated_segments LOCATOR -- Modified for bug # 5015415
                FROM mtl_system_items_vl msik
                   , mtl_material_statuses_vl mmsvl2
                   , po_hazard_classes poh
                   , mtl_serial_numbers msn
                   , cst_cost_groups ccg
                   , wip_entities wipent
                   , wms_item_locations_kfv wilk  -- Modified for bug # 5015415
                  -- , mtl_item_locations_kfv milk   -- Added as part of change for patchset "I".
               WHERE msik.inventory_item_id = l_inventory_item_id
                 AND msik.organization_id = l_organization_id
                 AND poh.hazard_class_id(+) = msik.hazard_class_id
                 AND msn.current_organization_id(+) = msik.organization_id
                 AND msn.inventory_item_id(+) = msik.inventory_item_id
                 AND msn.serial_number(+) = l_serial_number
                 AND mmsvl2.status_id(+) = msn.status_id
                 AND ccg.cost_group_id(+) = msn.cost_group_id
                 AND wipent.wip_entity_id(+) = msn.wip_entity_id
         /* The following conditions have been modified for bug # 5015415.

         For PJM Org, Locator field in Material Label should not show the Project and task id's.
         This is because, the Project and Task Id's are not Bar code transactable.
         In mtl_item_locations_kfv, the cocatenated segments will have Project and
         Task Id's attached to it. Whereas in wms_item_locations_kfv, concatenated
         segments will have only the physical details (Row, Rack and Bin)
         and not the project and Task id's.

                 AND milk.inventory_location_id(+) = l_locator_id
                 AND milk.organization_id(+) = msik.organization_id
                 AND milk.subinventory_code(+) = l_subinventory*/

                 AND wilk.inventory_location_id(+) = l_locator_id
                 AND wilk.organization_id(+) = msik.organization_id
                 AND wilk.subinventory_code(+) = l_subinventory) msn2   -- Added as part of change for patchset "I".
       WHERE mln.organization_id(+) = l_organization_id
         AND mln.inventory_item_id(+) = l_inventory_item_id
         AND mmsvl1.status_id(+) = mln.status_id
         AND mln.lot_number(+) = msn2.lot_number
         AND mp.organization_id = msn2.organization_id
         AND mln.lot_number(+) = l_lot_number;
Line: 1037

	select
	parent_lot_number,
	expiration_action_date ,
	expiration_action_code,
	hold_date   ,
	supplier_lot_number,
	origination_type ,
	grade_code,
	maturity_date,
	retest_date,
	expiration_date,
	origination_date,
        sts.status_code
	FROM
	MTL_LOT_NUMBERS l,
        mtl_material_statuses_vl sts
	WHERE LOT_NUMBER = l_lot_number AND
	      INVENTORY_ITEM_ID = l_inventory_item_id AND
	      ORGANIZATION_ID = l_organization_id
              AND sts.status_id(+) = l.status_id; -- Bug 4355080
Line: 1062

	SELECT		parent_lot_number,
				expiration_action_date ,
				expiration_action_code,
				hold_date   ,
				supplier_lot_number,
				origination_type ,
				grade_code,
				maturity_date,
				retest_date,
			    lot_expiration_date,
				origination_date,
                                sts.status_code
	FROM	mtl_transaction_lots_temp t,
                mtl_material_statuses_vl sts
	WHERE	transaction_temp_id = p_input_param.transaction_temp_id AND
	  lot_number		    = l_lot_number
              AND sts.status_id(+) = t.status_id; -- Bug 4355080
Line: 1083

       select wlfs.format_id label_format_id, wlf.label_entity_type --FOR SETS
	 from wms_label_set_formats wlfs , wms_label_formats wlf
	 where WLFS.SET_ID = p_format_set_id
	 and wlfs.set_id = wlf.label_format_id
	 and wlf.label_entity_type = 1
	 AND WLF.DOCUMENT_ID = 2
	 UNION --FOR FORMATS
	 select label_format_id,nvl(wlf.label_entity_type,0)
	 from wms_label_formats wlf
	 where  wlf.label_format_id =  p_format_set_id
	 and nvl(wlf.label_entity_type,0) = 0 --for label formats only validation
	 AND WLF.DOCUMENT_ID = 2 ;
Line: 1104

    l_selected_fields       inv_label.label_field_variable_tbl_type;
Line: 1105

    l_selected_fields_count NUMBER;
Line: 1123

    selected_fields_count   NUMBER;
Line: 1737

      SELECT   wipent.wip_entity_name job_name
	, mfglkp.meaning job_type
	, wipdj.net_quantity job_net_quantity
	, wipdj.scheduled_start_date
	, wipdj.scheduled_completion_date
	, wipdj.bom_revision job_bom_revision
	, wipdj.routing_revision job_routing_revision
	INTO l_wip_entity_name
	, l_entity_type
	, l_net_quantity
	, l_scheduled_start_date
	, l_scheduled_completion_date
	, l_bom_revision
	, l_routing_revision
	FROM wip_entities wipent
	, wip_discrete_jobs wipdj
	, mfg_lookups mfglkp
	WHERE wipdj.wip_entity_id    = wipent.wip_entity_id
	  AND wipdj.organization_id  = wipent.organization_id
	  AND mfglkp.lookup_code(+)  = wipent.entity_type
	  AND mfglkp.lookup_type(+)  = 'WIP_ENTITY'
	  AND wipent.wip_entity_id   = l_wip_entity_id
	  AND wipent.organization_id = l_organization_id
	  AND rownum = 1;
Line: 1802

       x_variables       => l_selected_fields
       , x_variables_count => l_selected_fields_count
       , x_is_variable_exist      => l_is_epc_exist
       , p_format_id     => p_label_type_info.default_format_id
       , p_exist_variable_name    => 'EPC'
       );
Line: 1809

    IF (l_selected_fields_count = 0)
       OR(l_selected_fields.COUNT = 0) THEN
      IF (l_debug = 1) THEN
        TRACE('no fields defined for this format: ' || p_label_type_info.default_format_id || ',' || p_label_type_info.default_format_name);
Line: 1959

        /* insert a record into wms_label_requests entity to
         call the label rules engine to get appropriate label
	 In this call if this happens to be for the label-set, the record
	 from wms_label_request will be deleted inside following API*/

        IF (l_debug = 1) THEN
          TRACE(' 1. Apply Rules engine get label set or format');
Line: 1978

        , p_last_update_date           => SYSDATE
        , p_last_updated_by            => fnd_global.user_id
        , p_creation_date              => SYSDATE
        , p_created_by                 => fnd_global.user_id
        -- Added for Bug 2748297 Start
        , p_supplier_id                => l_vendor_id
        , p_supplier_site_id           => l_vendor_site_id
        -- End
        -- Added for bug 4582954 Start
        , p_sales_order_header_id      => l_oe_order_header_id
        , p_sales_order_line_id        => l_oe_order_line_id
        -- End bug 4582954
        , x_return_status              => l_return_status
        , x_label_format_id            => l_label_format_set_id
        , x_label_format               => l_label_format
        , x_label_request_id           => l_label_request_id
        );
Line: 2034

	   ----1 Insert record into WMS_LABEL_REQUESTS
	   ----2 get value of l_label_format_id, l_label_format, l_label_request_id
	   ----3 Do not call Rules Engine again, as we know format id
	   --else
	   ----Do not call get_format_with_rule(), just use the format-id

	   IF l_label_formats_in_set.label_entity_type = 1 THEN --IT IS LABEL SET

	      --In R12 call this API for the format AGAIN without calling Rules ENGINE
	      /* insert a record into wms_label_requests entity  */


	      IF (l_debug = 1) THEN
		 TRACE('Insert record into WMS_LABEL_REQUESTS and get label_request_id');
Line: 2060

		  , p_last_update_date           => SYSDATE
		  , p_last_updated_by            => fnd_global.user_id
		  , p_creation_date                 => SYSDATE
		  , p_created_by                 => fnd_global.user_id
		  , p_use_rule_engine            => 'N' --------------------------Rules ENgine will NOT get called
		  ,
		  -- Added for Bug 2748297 Start
		  p_supplier_id                  => l_vendor_id
		, p_supplier_site_id           => l_vendor_site_id
		,
		-- End
		x_return_status                => l_return_status
		, x_label_format_id            => l_label_format_id
		, x_label_format               => l_label_format
		, x_label_request_id           => l_label_request_id
		);
Line: 2176

	      (x_variables              => l_selected_fields
	       , x_variables_count      => l_selected_fields_count
	       , x_is_variable_exist    => l_is_epc_exist
	       , p_format_id            => l_label_format_id
	       , p_exist_variable_name  => 'EPC'
	       );
Line: 2185

            IF (l_selected_fields_count = 0)
               OR(l_selected_fields.COUNT = 0) THEN
              IF (l_debug = 1) THEN
                TRACE('no fields defined for this format: ' || l_label_format || ',' || l_label_format_id);
Line: 2196

              TRACE('   Found selected_fields for format ' || l_label_format || ', num=' || l_selected_fields_count);
Line: 2395

        FOR i IN 1 .. l_selected_fields.COUNT LOOP
          IF (l_debug = 1) THEN
            l_column_name_list  := l_column_name_list || ',' || l_selected_fields(i).column_name;
Line: 2408

          IF (l_selected_fields(i).SQL_STMT IS NOT NULL AND l_selected_fields(i).column_name = 'sql_stmt') THEN
             IF (l_debug = 1) THEN
              trace('Custom Labels Trace [INVLAP2B.pls]: ------------------------- REPORT BEGIN-------------------------------------');
Line: 2411

              trace('Custom Labels Trace [INVLAP2B.pls]: LABEL_FIELD_ID       : ' || l_selected_fields(i).label_field_id);
Line: 2412

              trace('Custom Labels Trace [INVLAP2B.pls]: FIELD_VARIABLE_NAME  : ' || l_selected_fields(i).variable_name);
Line: 2413

              trace('Custom Labels Trace [INVLAP2B.pls]: COLUMN_NAME          : ' || l_selected_fields(i).column_name);
Line: 2414

              trace('Custom Labels Trace [INVLAP2B.pls]: SQL_STMT             : ' || l_selected_fields(i).sql_stmt);
Line: 2416

             l_sql_stmt := l_selected_fields(i).sql_stmt;
Line: 2509

                               || l_selected_fields(i).variable_name
                               || '">'
                               || l_sql_stmt_result
                               || variable_e;
Line: 2521

           ELSIF LOWER(l_selected_fields(i).column_name) = 'current_date' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || inv_label.g_date || variable_e;
Line: 2523

          ELSIF LOWER(l_selected_fields(i).column_name) = 'current_time' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || inv_label.g_time || variable_e;
Line: 2525

          ELSIF LOWER(l_selected_fields(i).column_name) = 'request_user' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || inv_label.g_user || variable_e;
Line: 2527

          ELSIF LOWER(l_selected_fields(i).column_name) = 'item' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.item || variable_e;
Line: 2529

          ELSIF LOWER(l_selected_fields(i).column_name) = 'client_item' THEN			-- Added for LSP Project, bug 9087971
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.client_item || variable_e;
Line: 2531

          ELSIF LOWER(l_selected_fields(i).column_name) = 'item_description' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.item_description || variable_e;
Line: 2534

          ELSIF LOWER(l_selected_fields(i).column_name) = 'revision' THEN
            l_serial_data  :=
                             l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.revision || variable_e;
Line: 2537

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_number' THEN
            l_serial_data  :=
                           l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_number || variable_e;
Line: 2540

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_expiration_date' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || l_expiration_date || variable_e;
Line: 2543

          ELSIF LOWER(l_selected_fields(i).column_name) = 'cost_group' THEN
            l_serial_data  :=
                           l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.cost_group || variable_e;
Line: 2546

          ELSIF LOWER(l_selected_fields(i).column_name) = 'customer_purchase_order' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || l_purchase_order || variable_e;
Line: 2548

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_attribute_category' THEN
            l_serial_data  :=
               l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_attribute_category || variable_e;
Line: 2551

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_c_attribute1' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_c_attribute1 || variable_e;
Line: 2554

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_c_attribute2' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_c_attribute2 || variable_e;
Line: 2557

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_c_attribute3' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_c_attribute3 || variable_e;
Line: 2560

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_c_attribute4' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_c_attribute4 || variable_e;
Line: 2563

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_c_attribute5' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_c_attribute5 || variable_e;
Line: 2566

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_c_attribute6' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_c_attribute6 || variable_e;
Line: 2569

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_c_attribute7' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_c_attribute7 || variable_e;
Line: 2572

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_c_attribute8' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_c_attribute8 || variable_e;
Line: 2575

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_c_attribute9' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_c_attribute9 || variable_e;
Line: 2578

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_c_attribute10' THEN
            l_serial_data  :=
                    l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_c_attribute10 || variable_e;
Line: 2581

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_c_attribute11' THEN
            l_serial_data  :=
                    l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_c_attribute11 || variable_e;
Line: 2584

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_c_attribute12' THEN
            l_serial_data  :=
                    l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_c_attribute12 || variable_e;
Line: 2587

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_c_attribute13' THEN
            l_serial_data  :=
                    l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_c_attribute13 || variable_e;
Line: 2590

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_c_attribute14' THEN
            l_serial_data  :=
                    l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_c_attribute14 || variable_e;
Line: 2593

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_c_attribute15' THEN
            l_serial_data  :=
                    l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_c_attribute15 || variable_e;
Line: 2596

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_c_attribute16' THEN
            l_serial_data  :=
                    l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_c_attribute16 || variable_e;
Line: 2599

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_c_attribute17' THEN
            l_serial_data  :=
                    l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_c_attribute17 || variable_e;
Line: 2602

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_c_attribute18' THEN
            l_serial_data  :=
                    l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_c_attribute18 || variable_e;
Line: 2605

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_c_attribute19' THEN
            l_serial_data  :=
                    l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_c_attribute19 || variable_e;
Line: 2608

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_c_attribute20' THEN
            l_serial_data  :=
                    l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_c_attribute20 || variable_e;
Line: 2611

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_d_attribute1' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_d_attribute1 || variable_e;
Line: 2614

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_d_attribute2' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_d_attribute2 || variable_e;
Line: 2617

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_d_attribute3' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_d_attribute3 || variable_e;
Line: 2620

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_d_attribute4' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_d_attribute4 || variable_e;
Line: 2623

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_d_attribute5' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_d_attribute5 || variable_e;
Line: 2626

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_d_attribute6' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_d_attribute6 || variable_e;
Line: 2629

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_d_attribute7' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_d_attribute7 || variable_e;
Line: 2632

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_d_attribute8' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_d_attribute8 || variable_e;
Line: 2635

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_d_attribute9' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_d_attribute9 || variable_e;
Line: 2638

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_d_attribute10' THEN
            l_serial_data  :=
                    l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_d_attribute10 || variable_e;
Line: 2641

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_n_attribute1' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_n_attribute1 || variable_e;
Line: 2644

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_n_attribute2' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_n_attribute2 || variable_e;
Line: 2647

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_n_attribute3' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_n_attribute3 || variable_e;
Line: 2650

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_n_attribute4' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_n_attribute4 || variable_e;
Line: 2653

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_n_attribute5' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_n_attribute5 || variable_e;
Line: 2656

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_n_attribute6' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_n_attribute6 || variable_e;
Line: 2659

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_n_attribute7' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_n_attribute7 || variable_e;
Line: 2662

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_n_attribute8' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_n_attribute8 || variable_e;
Line: 2665

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_n_attribute9' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_n_attribute9 || variable_e;
Line: 2668

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_n_attribute10' THEN
            l_serial_data  :=
                    l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_n_attribute10 || variable_e;
Line: 2671

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_country_of_origin' THEN
            l_serial_data  :=
                l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_country_of_origin || variable_e;
Line: 2676

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_status' THEN
            l_serial_data  :=
                           l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || l_lot_status || variable_e;
Line: 2679

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_grade_code' THEN
            l_serial_data  :=
                       l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || l_grade_code || variable_e;
Line: 2682

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_origination_date' THEN
            l_serial_data  :=
                 l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || l_origination_date || variable_e;
Line: 2685

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_retest_date' THEN
            l_serial_data  :=
                      l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || l_retest_date || variable_e;
Line: 2688

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_maturity_date' THEN
            l_serial_data  :=
                    l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || l_maturity_date || variable_e;
Line: 2693

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_date_code' THEN
            l_serial_data  :=
                        l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_date_code || variable_e;
Line: 2696

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_change_date' THEN
            l_serial_data  :=
                      l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_change_date || variable_e;
Line: 2699

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_age' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_age || variable_e;
Line: 2701

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_item_size' THEN
            l_serial_data  :=
                        l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_item_size || variable_e;
Line: 2704

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_color' THEN
            l_serial_data  :=
                            l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_color || variable_e;
Line: 2707

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_volume' THEN
            l_serial_data  :=
                           l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_volume || variable_e;
Line: 2710

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_volume_uom' THEN
            l_serial_data  :=
                       l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_volume_uom || variable_e;
Line: 2713

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_place_of_origin' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_place_of_origin || variable_e;
Line: 2716

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_best_by_date' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_best_by_date || variable_e;
Line: 2719

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_length' THEN
            l_serial_data  :=
                           l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_length || variable_e;
Line: 2722

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_length_uom' THEN
            l_serial_data  :=
                       l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_length_uom || variable_e;
Line: 2725

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_recycled_cont' THEN
            l_serial_data  :=
                    l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_recycled_cont || variable_e;
Line: 2728

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_thickness' THEN
            l_serial_data  :=
                        l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_thickness || variable_e;
Line: 2731

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_thickness_uom' THEN
            l_serial_data  :=
                    l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_thickness_uom || variable_e;
Line: 2734

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_width' THEN
            l_serial_data  :=
                            l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_width || variable_e;
Line: 2737

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_width_uom' THEN
            l_serial_data  :=
                        l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_width_uom || variable_e;
Line: 2740

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_curl' THEN
            l_serial_data  :=
                             l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_curl || variable_e;
Line: 2743

          ELSIF LOWER(l_selected_fields(i).column_name) = 'lot_vendor' THEN
            l_serial_data  :=
                           l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.lot_vendor || variable_e;
Line: 2746

          ELSIF LOWER(l_selected_fields(i).column_name) = 'item_hazard_class' THEN
            l_serial_data  :=
                    l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.item_hazard_class || variable_e;
Line: 2749

          ELSIF LOWER(l_selected_fields(i).column_name) = 'item_attribute_category' THEN
            l_serial_data  :=
              l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.item_attribute_category || variable_e;
Line: 2752

          ELSIF LOWER(l_selected_fields(i).column_name) = 'item_attribute1' THEN
            l_serial_data  :=
                      l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.item_attribute1 || variable_e;
Line: 2755

          ELSIF LOWER(l_selected_fields(i).column_name) = 'item_attribute2' THEN
            l_serial_data  :=
                      l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.item_attribute2 || variable_e;
Line: 2758

          ELSIF LOWER(l_selected_fields(i).column_name) = 'item_attribute3' THEN
            l_serial_data  :=
                      l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.item_attribute3 || variable_e;
Line: 2761

          ELSIF LOWER(l_selected_fields(i).column_name) = 'item_attribute4' THEN
            l_serial_data  :=
                      l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.item_attribute4 || variable_e;
Line: 2764

          ELSIF LOWER(l_selected_fields(i).column_name) = 'item_attribute5' THEN
            l_serial_data  :=
                      l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.item_attribute5 || variable_e;
Line: 2767

          ELSIF LOWER(l_selected_fields(i).column_name) = 'item_attribute6' THEN
            l_serial_data  :=
                      l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.item_attribute6 || variable_e;
Line: 2770

          ELSIF LOWER(l_selected_fields(i).column_name) = 'item_attribute7' THEN
            l_serial_data  :=
                      l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.item_attribute7 || variable_e;
Line: 2773

          ELSIF LOWER(l_selected_fields(i).column_name) = 'item_attribute8' THEN
            l_serial_data  :=
                      l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.item_attribute8 || variable_e;
Line: 2776

          ELSIF LOWER(l_selected_fields(i).column_name) = 'item_attribute9' THEN
            l_serial_data  :=
                      l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.item_attribute9 || variable_e;
Line: 2779

          ELSIF LOWER(l_selected_fields(i).column_name) = 'item_attribute10' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.item_attribute10 || variable_e;
Line: 2782

          ELSIF LOWER(l_selected_fields(i).column_name) = 'item_attribute11' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.item_attribute11 || variable_e;
Line: 2785

          ELSIF LOWER(l_selected_fields(i).column_name) = 'item_attribute12' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.item_attribute12 || variable_e;
Line: 2788

          ELSIF LOWER(l_selected_fields(i).column_name) = 'item_attribute13' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.item_attribute13 || variable_e;
Line: 2791

          ELSIF LOWER(l_selected_fields(i).column_name) = 'item_attribute14' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.item_attribute14 || variable_e;
Line: 2794

          ELSIF LOWER(l_selected_fields(i).column_name) = 'item_attribute15' THEN
            l_serial_data  :=
                     l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.item_attribute15 || variable_e;
Line: 2797

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_number' THEN
            l_serial_data  :=
                        l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_number || variable_e;
Line: 2800

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_number_status' THEN
            l_serial_data  :=
                 l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_number_status || variable_e;
Line: 2803

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_attribute_category' THEN
            l_serial_data  :=
              l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_attribute_category
              || variable_e;
Line: 2807

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_c_attribute1' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_c_attribute1 || variable_e;
Line: 2810

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_c_attribute2' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_c_attribute2 || variable_e;
Line: 2813

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_c_attribute3' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_c_attribute3 || variable_e;
Line: 2816

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_c_attribute4' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_c_attribute4 || variable_e;
Line: 2819

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_c_attribute5' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_c_attribute5 || variable_e;
Line: 2822

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_c_attribute6' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_c_attribute6 || variable_e;
Line: 2825

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_c_attribute7' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_c_attribute7 || variable_e;
Line: 2828

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_c_attribute8' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_c_attribute8 || variable_e;
Line: 2831

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_c_attribute9' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_c_attribute9 || variable_e;
Line: 2834

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_c_attribute10' THEN
            l_serial_data  :=
                 l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_c_attribute10 || variable_e;
Line: 2837

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_c_attribute11' THEN
            l_serial_data  :=
                 l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_c_attribute11 || variable_e;
Line: 2840

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_c_attribute12' THEN
            l_serial_data  :=
                 l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_c_attribute12 || variable_e;
Line: 2843

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_c_attribute13' THEN
            l_serial_data  :=
                 l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_c_attribute13 || variable_e;
Line: 2846

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_c_attribute14' THEN
            l_serial_data  :=
                 l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_c_attribute14 || variable_e;
Line: 2849

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_c_attribute15' THEN
            l_serial_data  :=
                 l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_c_attribute15 || variable_e;
Line: 2852

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_c_attribute16' THEN
            l_serial_data  :=
                 l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_c_attribute16 || variable_e;
Line: 2855

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_c_attribute17' THEN
            l_serial_data  :=
                 l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_c_attribute17 || variable_e;
Line: 2858

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_c_attribute18' THEN
            l_serial_data  :=
                 l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_c_attribute18 || variable_e;
Line: 2861

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_c_attribute19' THEN
            l_serial_data  :=
                 l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_c_attribute19 || variable_e;
Line: 2864

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_c_attribute20' THEN
            l_serial_data  :=
                 l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_c_attribute20 || variable_e;
Line: 2867

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_d_attribute1' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_d_attribute1 || variable_e;
Line: 2870

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_d_attribute2' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_d_attribute2 || variable_e;
Line: 2873

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_d_attribute3' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_d_attribute3 || variable_e;
Line: 2876

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_d_attribute4' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_d_attribute4 || variable_e;
Line: 2879

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_d_attribute5' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_d_attribute5 || variable_e;
Line: 2882

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_d_attribute6' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_d_attribute6 || variable_e;
Line: 2885

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_d_attribute7' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_d_attribute7 || variable_e;
Line: 2888

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_d_attribute8' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_d_attribute8 || variable_e;
Line: 2891

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_d_attribute9' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_d_attribute9 || variable_e;
Line: 2894

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_d_attribute10' THEN
            l_serial_data  :=
                 l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_d_attribute10 || variable_e;
Line: 2897

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_n_attribute1' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_n_attribute1 || variable_e;
Line: 2900

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_n_attribute2' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_n_attribute2 || variable_e;
Line: 2903

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_n_attribute3' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_n_attribute3 || variable_e;
Line: 2906

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_n_attribute4' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_n_attribute4 || variable_e;
Line: 2909

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_n_attribute5' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_n_attribute5 || variable_e;
Line: 2912

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_n_attribute6' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_n_attribute6 || variable_e;
Line: 2915

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_n_attribute7' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_n_attribute7 || variable_e;
Line: 2918

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_n_attribute8' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_n_attribute8 || variable_e;
Line: 2921

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_n_attribute9' THEN
            l_serial_data  :=
                  l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_n_attribute9 || variable_e;
Line: 2924

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_n_attribute10' THEN
            l_serial_data  :=
                 l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_n_attribute10 || variable_e;
Line: 2927

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_country_of_origin' THEN
            l_serial_data  :=
              l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_country_of_origin
              || variable_e;
Line: 2931

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_time_since_new' THEN
            l_serial_data  :=
                l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_time_since_new || variable_e;
Line: 2934

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_cycles_since_new' THEN
            l_serial_data  :=
              l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_cycles_since_new || variable_e;
Line: 2937

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_time_since_over' THEN
            l_serial_data  :=
              l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_time_since_overhaul
              || variable_e;
Line: 2941

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_cycles_since_over' THEN
            l_serial_data  :=
              l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_cycles_since_overhaul
              || variable_e;
Line: 2945

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_time_since_repair' THEN
            l_serial_data  :=
              l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_time_since_repair
              || variable_e;
Line: 2949

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_cycles_since_repair' THEN
            l_serial_data  :=
              l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_cycles_since_repair
              || variable_e;
Line: 2953

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_time_since_visit' THEN
            l_serial_data  :=
              l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_time_since_visit || variable_e;
Line: 2956

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_cycles_since_visit' THEN
            l_serial_data  :=
              l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_cycles_since_visit
              || variable_e;
Line: 2960

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_time_since_mark' THEN
            l_serial_data  :=
               l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_time_since_mark || variable_e;
Line: 2963

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_cycles_since_mark' THEN
            l_serial_data  :=
              l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_cycles_since_mark
              || variable_e;
Line: 2967

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_num_of_repairs' THEN
            l_serial_data  :=
                l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_num_of_repairs || variable_e;
Line: 2970

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_initialization_date' THEN
            l_serial_data  :=
              l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_initialization_date
              || variable_e;
Line: 2974

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_completion_date' THEN
            l_serial_data  :=
               l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_completion_date || variable_e;
Line: 2977

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_fixed_asset_tag' THEN
            l_serial_data  :=
               l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_fixed_asset_tag || variable_e;
Line: 2980

          ELSIF LOWER(l_selected_fields(i).column_name) = 'serial_vendor_serial' THEN
            l_serial_data  :=
                 l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.serial_vendor_serial || variable_e;
Line: 2985

          ELSIF LOWER(l_selected_fields(i).column_name) = 'project_number' THEN
            l_serial_data  :=
                l_serial_data || variable_b
                                || l_selected_fields(i).variable_name
                                || '">'
                                || serial_rec.project_number
                                || variable_e;
Line: 2992

          ELSIF LOWER(l_selected_fields(i).column_name) = 'task_number' THEN
            l_serial_data  :=    l_serial_data
                                || variable_b
                                || l_selected_fields(i).variable_name
                                || '">'
                                || serial_rec.task_number
                                || variable_e;
Line: 3000

          ELSIF LOWER(l_selected_fields(i).column_name) = 'project' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.project || variable_e;
Line: 3002

          ELSIF LOWER(l_selected_fields(i).column_name) = 'task' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.task || variable_e;
Line: 3004

          ELSIF LOWER(l_selected_fields(i).column_name) = 'organization' THEN
            l_serial_data  :=
              l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.ORGANIZATION || variable_e;
Line: 3008

          ELSIF LOWER(l_selected_fields(i).column_name) = 'job_name' THEN
            -- Added for Bug 4642062.
            -- Using the value of l_wip_entity_name if job_name from serial_rec is null
            l_serial_data  :=
              l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || nvl(serial_rec.job_name, l_wip_entity_name) || variable_e;
Line: 3014

          ELSIF LOWER(l_selected_fields(i).column_name) = 'job_type' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || l_entity_type || variable_e;
Line: 3016

          ELSIF LOWER(l_selected_fields(i).column_name) = 'job_qty' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || l_net_quantity || variable_e;
Line: 3018

          ELSIF LOWER(l_selected_fields(i).column_name) = 'job_scheduled_start_date' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || l_scheduled_start_date || variable_e;
Line: 3020

          ELSIF LOWER(l_selected_fields(i).column_name) = 'job_scheduled_completion_date' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || l_scheduled_completion_date || variable_e;
Line: 3022

          ELSIF LOWER(l_selected_fields(i).column_name) = 'bom_revision' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || l_bom_revision || variable_e;
Line: 3024

          ELSIF LOWER(l_selected_fields(i).column_name) = 'routing_revision' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || l_routing_revision || variable_e;
Line: 3028

          ELSIF LOWER(l_selected_fields(i).column_name) = 'receipt_num' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || l_receipt_number || variable_e;
Line: 3031

          ELSIF LOWER(l_selected_fields(i).column_name) = 'gtin' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || l_gtin || variable_e;
Line: 3033

          ELSIF LOWER(l_selected_fields(i).column_name) = 'gtin_description' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || l_gtin_desc || variable_e;
Line: 3035

          ELSIF LOWER(l_selected_fields(i).column_name) = 'subinventory_code' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || l_subinventory || variable_e;
Line: 3037

          ELSIF LOWER(l_selected_fields(i).column_name) = 'locator' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || serial_rec.LOCATOR || variable_e;
Line: 3040

            ELSIF LOWER(l_selected_fields(i).column_name) = 'uom' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || l_uom || variable_e;
Line: 3045

            ELSIF LOWER(l_selected_fields(i).column_name) = 'parent_lot_number' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || l_parent_lot_number || variable_e;
Line: 3048

            ELSIF LOWER(l_selected_fields(i).column_name) = 'hold_date' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || l_hold_date || variable_e;
Line: 3051

            ELSIF LOWER(l_selected_fields(i).column_name) = 'expiration_action_date' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || l_expiration_action_date || variable_e;
Line: 3054

            ELSIF LOWER(l_selected_fields(i).column_name) = 'expiration_action_code' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || l_expiration_action_code || variable_e;
Line: 3057

            ELSIF LOWER(l_selected_fields(i).column_name) = 'supplier_lot_number' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || l_supplier_lot_number || variable_e;
Line: 3060

            ELSIF LOWER(l_selected_fields(i).column_name) = 'origination_type' THEN
            l_serial_data  := l_serial_data || variable_b || l_selected_fields(i).variable_name || '">' || l_origination_type || variable_e;
Line: 3067

          ELSIF LOWER(l_selected_fields(i).column_name) = 'epc' THEN
	       l_serial_data  := l_serial_data
		 || variable_b
		 || l_selected_fields(i).variable_name
		 || '">'
		 || l_epc
		 || variable_e;
Line: 3491

	      SELECT   wipent.wip_entity_name job_name
		, mfglkp.meaning job_type
		, wipdj.net_quantity job_net_quantity
		, wipdj.scheduled_start_date
		, wipdj.scheduled_completion_date
		, wipdj.bom_revision job_bom_revision
		, wipdj.routing_revision job_routing_revision
		INTO l_wip_entity_name
		, l_entity_type
		, l_net_quantity
		, l_scheduled_start_date
		, l_scheduled_completion_date
		, l_bom_revision
		, l_routing_revision
		FROM wip_entities wipent
		, wip_discrete_jobs wipdj
		, mfg_lookups mfglkp
		WHERE wipdj.wip_entity_id    = wipent.wip_entity_id
		  AND wipdj.organization_id  = wipent.organization_id
		  AND mfglkp.lookup_code(+)  = wipent.entity_type
		  AND mfglkp.lookup_type(+)  = 'WIP_ENTITY'
		  AND wipent.wip_entity_id   = l_wip_entity_id
		  AND wipent.organization_id = l_organization_id
		  AND rownum = 1;