DBA Data[Home] [Help]

APPS.OPIMPXIN SQL Statements

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

Line: 17

   SELECT trunc(mmt.TRANSACTION_DATE),
          mmt.ORGANIZATION_ID,
          mmt.INVENTORY_ITEM_ID,
          mmt.COST_GROUP_ID,
          mmt.REVISION,
          mmt.SUBINVENTORY_CODE,
          mmt.LOCATOR_ID,
          sum(mmt.PRIMARY_QUANTITY)
     FROM MTL_MATERIAL_TRANSACTIONS mmt,
          MTL_SYSTEM_ITEMS  msi
    WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
      AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
      AND mmt.ORGANIZATION_ID=Org_id
      AND msi.LOT_CONTROL_CODE = 1
      AND mmt.transaction_action_id=31
      AND mmt.transaction_source_type_id=5
      AND mmt.transaction_date >= p_from_date
      AND mmt.transaction_date <= p_to_date
 GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,
          mmt.COST_GROUP_ID,mmt.REVISION,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 39

   SELECT   trunc(mmt.TRANSACTION_DATE),
          mmt.ORGANIZATION_ID,
          mmt.INVENTORY_ITEM_ID,
          mmt.COST_GROUP_ID,
          mmt.REVISION,
          mtln.LOT_NUMBER,
          mmt.SUBINVENTORY_CODE,
          mmt.LOCATOR_ID,
          sum(mtln.PRIMARY_QUANTITY)
     FROM MTL_MATERIAL_TRANSACTIONS mmt,
          MTL_SYSTEM_ITEMS  msi,
          MTL_TRANSACTION_LOT_NUMBERS mtln
    WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
      AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
      AND mmt.ORGANIZATION_ID=Org_id
      AND mmt.transaction_id = mtln.transaction_id
      AND msi.LOT_CONTROL_CODE = 2
      AND mmt.transaction_action_id=31
      AND mmt.transaction_source_type_id=5
      AND mmt.transaction_date >= p_from_date
      AND mmt.transaction_date <= p_to_date
 GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,
          mmt.COST_GROUP_ID, mmt.REVISION,mtln.lot_number,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 64

   SELECT trunc(mmt.TRANSACTION_DATE),
          mmt.ORGANIZATION_ID,
          mmt.INVENTORY_ITEM_ID,
          mmt.COST_GROUP_ID,
          mmt.REVISION,
          mmt.SUBINVENTORY_CODE,
          mmt.LOCATOR_ID,
          sum(mta.BASE_TRANSACTION_VALUE)
     FROM MTL_MATERIAL_TRANSACTIONS mmt,
          MTL_SYSTEM_ITEMS  msi,
          MTL_TRANSACTION_ACCOUNTS mta
    WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
      AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
      AND mmt.ORGANIZATION_ID=Org_id
      AND msi.LOT_CONTROL_CODE = 1
      AND mmt.transaction_id = mta.transaction_id
      AND mta.accounting_line_type = 1
      AND mmt.transaction_action_id=31
      AND mmt.transaction_source_type_id=5
      AND mmt.transaction_date >= p_from_date
      AND mmt.transaction_date <= p_to_date
 GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,
          mmt.COST_GROUP_ID,mmt.REVISION,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 90

    SELECT   trunc(mmt.TRANSACTION_DATE),
          mmt.ORGANIZATION_ID,
          mmt.INVENTORY_ITEM_ID,
          mmt.COST_GROUP_ID,
          mmt.REVISION,
          mtln.LOT_NUMBER,
          mmt.SUBINVENTORY_CODE,
          mmt.LOCATOR_ID,
          sum(mta.BASE_TRANSACTION_VALUE)
     FROM MTL_MATERIAL_TRANSACTIONS mmt,
          MTL_SYSTEM_ITEMS  msi,
          MTL_TRANSACTION_LOT_NUMBERS mtln,
          MTL_TRANSACTION_ACCOUNTS mta
    WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
      AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
      AND mmt.ORGANIZATION_ID=Org_id
      AND mmt.transaction_id = mtln.transaction_id
      AND msi.LOT_CONTROL_CODE = 2
      AND mmt.transaction_id = mta.transaction_id
      AND mta.accounting_line_type = 1
      AND mmt.transaction_action_id=31
      AND mmt.transaction_source_type_id=5
      AND mmt.transaction_date >= p_from_date
      AND mmt.transaction_date <= p_to_date
 GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,
         mmt.COST_GROUP_ID,mmt.REVISION,mtln.lot_number,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 162

      Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'wip_comp_qty',
            p_total1          => total_qty,
            selector          => 1,
            success           => status);
Line: 175

/*  edw_log.put_line('Insert_update_push_log');  */
Line: 212

        Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_lot_number      => l_lot_number,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'wip_comp_qty',
            p_total1          => total_qty,
            selector          => 1,
            success           => status);
Line: 259

        Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'wip_comp_val_b',
            p_total1          => total_value,
            selector          => 1,
            success           => status);
Line: 304

        Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_lot_number      => l_lot_number,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'wip_comp_val_b',
            p_total1          => total_value,
            selector          => 1,
            success           => status);
Line: 361

   SELECT trunc(mmt.TRANSACTION_DATE),
          mmt.ORGANIZATION_ID,
          mmt.INVENTORY_ITEM_ID,
          mmt.COST_GROUP_ID,
          mmt.REVISION,
          mmt.SUBINVENTORY_CODE,
          mmt.LOCATOR_ID,
          sum(mmt.PRIMARY_QUANTITY)
     FROM MTL_MATERIAL_TRANSACTIONS mmt,
          MTL_SYSTEM_ITEMS  msi
    WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
      AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
      AND mmt.ORGANIZATION_ID=Org_id
      AND msi.LOT_CONTROL_CODE = 1
      AND mmt.transaction_action_id in (1,27,33,34)
      AND mmt.transaction_source_type_id=5
      AND mmt.transaction_date >= p_from_date
      AND mmt.transaction_date <= p_to_date
 GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
          mmt.REVISION,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 383

   SELECT   trunc(mmt.TRANSACTION_DATE),
         mmt.ORGANIZATION_ID,
         mmt.INVENTORY_ITEM_ID,
         mmt.COST_GROUP_ID,
         mmt.REVISION,
         mtln.LOT_NUMBER,
         mmt.SUBINVENTORY_CODE,
         mmt.LOCATOR_ID,
         sum(mtln.PRIMARY_QUANTITY)
    FROM MTL_MATERIAL_TRANSACTIONS mmt,
         MTL_SYSTEM_ITEMS  msi,
         MTL_TRANSACTION_LOT_NUMBERS mtln
   WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
     AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
     AND mmt.transaction_id = mtln.transaction_id
     AND mmt.ORGANIZATION_ID=Org_id
     AND msi.LOT_CONTROL_CODE = 2
     AND mmt.transaction_action_id in (1,27,33,34)
     AND mmt.transaction_source_type_id=5
     AND mmt.transaction_date >= p_from_date
     AND mmt.transaction_date <= p_to_date
GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
         mmt.REVISION,mtln.lot_number,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 408

   SELECT trunc(mmt.TRANSACTION_DATE),
          mmt.ORGANIZATION_ID,
          mmt.INVENTORY_ITEM_ID,
          mmt.COST_GROUP_ID,
          mmt.REVISION,
          mmt.SUBINVENTORY_CODE,
          mmt.LOCATOR_ID,
          sum(mta.BASE_TRANSACTION_VALUE)
     FROM MTL_MATERIAL_TRANSACTIONS mmt,
          MTL_SYSTEM_ITEMS  msi,
	  MTL_TRANSACTION_ACCOUNTS mta
    WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
      AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
      AND mmt.ORGANIZATION_ID=Org_id
      AND msi.LOT_CONTROL_CODE = 1
      AND mmt.transaction_id = mta.transaction_id
      AND mta.accounting_line_type = 1
      AND mmt.transaction_action_id in (1,27,33,34)
      AND mmt.transaction_source_type_id=5
      AND mmt.transaction_date >= p_from_date
      AND mmt.transaction_date <= p_to_date
 GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
          mmt.REVISION,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 433

   SELECT   trunc(mmt.TRANSACTION_DATE),
         mmt.ORGANIZATION_ID,
         mmt.INVENTORY_ITEM_ID,
         mmt.COST_GROUP_ID,
         mmt.REVISION,
         mtln.LOT_NUMBER,
         mmt.SUBINVENTORY_CODE,
         mmt.LOCATOR_ID,
         sum(mta.BASE_TRANSACTION_VALUE)
    FROM MTL_MATERIAL_TRANSACTIONS mmt,
         MTL_SYSTEM_ITEMS  msi,
         MTL_TRANSACTION_LOT_NUMBERS mtln,
	 MTL_TRANSACTION_ACCOUNTS mta
   WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
     AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
     AND mmt.ORGANIZATION_ID=Org_id
     AND mmt.transaction_id = mtln.transaction_id
     AND msi.LOT_CONTROL_CODE = 2
     AND mmt.transaction_id = mta.transaction_id
     AND mta.accounting_line_type = 1
     AND mmt.transaction_action_id in (1,27,33,34)
     AND mmt.transaction_source_type_id=5
     AND mmt.transaction_date >= p_from_date
     AND mmt.transaction_date <= p_to_date
GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
         mmt.REVISION,mtln.lot_number,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 489

         Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'wip_issue_qty',
            p_total1          => total_qty,
            selector          => 1,
            success           => status);
Line: 535

        Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_lot_number      => l_lot_number,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'wip_issue_qty',
            p_total1          => total_qty,
            selector          => 1,
            success           => status);
Line: 579

         Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'wip_issue_val_b',
            p_total1          => total_value,
            selector          => 1,
            success           => status);
Line: 623

        Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_lot_number      => l_lot_number,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'wip_issue_val_b',
            p_total1          => total_value,
            selector          => 1,
            success           => status);
Line: 677

   SELECT trunc(mmt.TRANSACTION_DATE),
          mmt.ORGANIZATION_ID,
          mmt.INVENTORY_ITEM_ID,
          mmt.COST_GROUP_ID,
          mmt.REVISION,
          mmt.SUBINVENTORY_CODE,
          mmt.LOCATOR_ID,
          sum(mmt.PRIMARY_QUANTITY)
     FROM MTL_MATERIAL_TRANSACTIONS mmt,
          MTL_SYSTEM_ITEMS  msi
    WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
      AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
      AND mmt.ORGANIZATION_ID=Org_id
      AND msi.LOT_CONTROL_CODE = 1
      AND mmt.transaction_action_id=32
      AND mmt.transaction_source_type_id=5
      AND mmt.transaction_date >= p_from_date
      AND mmt.transaction_date <= p_to_date
 GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
          mmt.REVISION,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 699

   SELECT   trunc(mmt.TRANSACTION_DATE),
         mmt.ORGANIZATION_ID,
         mmt.INVENTORY_ITEM_ID,
         mmt.COST_GROUP_ID,
         mmt.REVISION,
         mtln.LOT_NUMBER,
         mmt.SUBINVENTORY_CODE,
         mmt.LOCATOR_ID,
         sum(mtln.PRIMARY_QUANTITY)
    FROM MTL_MATERIAL_TRANSACTIONS mmt,
         MTL_SYSTEM_ITEMS  msi,
         MTL_TRANSACTION_LOT_NUMBERS mtln
   WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
     AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
     AND mmt.ORGANIZATION_ID=Org_id
     AND mmt.transaction_id = mtln.transaction_id
     AND msi.LOT_CONTROL_CODE = 2
     AND mmt.transaction_action_id=32
     AND mmt.transaction_source_type_id=5
     AND mmt.transaction_date >= p_from_date
     AND mmt.transaction_date <= p_to_date
GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
         mmt.REVISION,mtln.lot_number,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 724

   SELECT trunc(mmt.TRANSACTION_DATE),
          mmt.ORGANIZATION_ID,
          mmt.INVENTORY_ITEM_ID,
          mmt.COST_GROUP_ID,
          mmt.REVISION,
          mmt.SUBINVENTORY_CODE,
          mmt.LOCATOR_ID,
          sum(mta.BASE_TRANSACTION_VALUE)
     FROM MTL_MATERIAL_TRANSACTIONS mmt,
          MTL_SYSTEM_ITEMS  msi,
	  MTL_TRANSACTION_ACCOUNTS mta
    WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
      AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
      AND mmt.ORGANIZATION_ID=Org_id
      AND msi.LOT_CONTROL_CODE = 1
      AND mmt.transaction_id = mta.transaction_id
      AND mta.accounting_line_type = 1
      AND mmt.transaction_action_id=32
      AND mmt.transaction_source_type_id=5
      AND mmt.transaction_date >= p_from_date
      AND mmt.transaction_date <= p_to_date
 GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
          mmt.REVISION,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 749

   SELECT   trunc(mmt.TRANSACTION_DATE),
         mmt.ORGANIZATION_ID,
         mmt.INVENTORY_ITEM_ID,
         mmt.COST_GROUP_ID,
         mmt.REVISION,
         mtln.LOT_NUMBER,
         mmt.SUBINVENTORY_CODE,
         mmt.LOCATOR_ID,
         sum(mta.BASE_TRANSACTION_VALUE)
    FROM MTL_MATERIAL_TRANSACTIONS mmt,
         MTL_SYSTEM_ITEMS  msi,
         MTL_TRANSACTION_LOT_NUMBERS mtln,
	 MTL_TRANSACTION_ACCOUNTS mta
   WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
     AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
     AND mmt.transaction_id = mtln.transaction_id
     AND mmt.ORGANIZATION_ID=Org_id
     AND msi.LOT_CONTROL_CODE = 2
     AND mmt.transaction_id = mta.transaction_id
     AND mta.accounting_line_type = 1
     AND mmt.transaction_action_id=32
     AND mmt.transaction_source_type_id=5
     AND mmt.transaction_date >= p_from_date
     AND mmt.transaction_date <= p_to_date
GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
         mmt.REVISION,mtln.lot_number,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 803

      Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'wip_assy_qty',
            p_total1          => total_qty,
            selector          => 1,
            success           => status);
Line: 849

        Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_lot_number      => l_lot_number,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'wip_assy_qty',
            p_total1          => total_qty,
            selector          => 1,
            success           => status);
Line: 894

      Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'wip_assy_val_b',
            p_total1          => total_value,
            selector          => 1,
            success           => status);
Line: 939

        Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_lot_number      => l_lot_number,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'wip_assy_val_b',
            p_total1          => total_value,
            selector          => 1,
            success           => status);
Line: 997

   SELECT trunc(mmt.TRANSACTION_DATE),
          mmt.ORGANIZATION_ID,
          mmt.INVENTORY_ITEM_ID,
          mmt.COST_GROUP_ID,
          mmt.REVISION,
          mmt.SUBINVENTORY_CODE,
          mmt.LOCATOR_ID,
          sum(mmt.PRIMARY_QUANTITY)
     FROM MTL_MATERIAL_TRANSACTIONS mmt,
          MTL_SYSTEM_ITEMS  msi
    WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
      AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
      AND mmt.ORGANIZATION_ID=Org_id
      AND msi.LOT_CONTROL_CODE = 1
      AND mmt.transaction_action_id in (1,27,29)
      AND mmt.transaction_source_type_id=1
      AND mmt.transaction_date >= p_from_date
      AND mmt.transaction_date <= p_to_date
      AND MMT.organization_id =  NVL(MMT.owning_organization_id, MMT.organization_id)
      AND NVL(MMT.OWNING_TP_TYPE,2) = 2
 GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
          mmt.REVISION,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 1023

   SELECT   trunc(mmt.TRANSACTION_DATE),
         mmt.ORGANIZATION_ID,
         mmt.INVENTORY_ITEM_ID,
         mmt.COST_GROUP_ID,
         mmt.REVISION,
         mtln.LOT_NUMBER,
         mmt.SUBINVENTORY_CODE,
         mmt.LOCATOR_ID,
         sum(mtln.PRIMARY_QUANTITY)
    FROM MTL_MATERIAL_TRANSACTIONS mmt,
         MTL_SYSTEM_ITEMS  msi,
         MTL_TRANSACTION_LOT_NUMBERS mtln
   WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
     AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
     AND mmt.ORGANIZATION_ID=Org_id
     AND mmt.transaction_id = mtln.transaction_id
     AND msi.LOT_CONTROL_CODE = 2
     AND mmt.transaction_action_id in (1,27,29)
     AND mmt.transaction_source_type_id=1
     AND mmt.transaction_date >= p_from_date
     AND mmt.transaction_date <= p_to_date
     AND MMT.organization_id =  NVL(MMT.owning_organization_id, MMT.organization_id)
     AND NVL(MMT.OWNING_TP_TYPE,2) = 2
GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
         mmt.REVISION,mtln.lot_number,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 1052

   SELECT trunc(mmt.TRANSACTION_DATE),
          mmt.ORGANIZATION_ID,
          mmt.INVENTORY_ITEM_ID,
          mmt.COST_GROUP_ID,
          mmt.REVISION,
          mmt.SUBINVENTORY_CODE,
          mmt.LOCATOR_ID,
          sum(mta.BASE_TRANSACTION_VALUE)
     FROM MTL_MATERIAL_TRANSACTIONS mmt,
          MTL_SYSTEM_ITEMS  msi,
	  MTL_TRANSACTION_ACCOUNTS mta
    WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
      AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
      AND mmt.ORGANIZATION_ID=Org_id
      AND msi.LOT_CONTROL_CODE = 1
      AND mmt.transaction_id = mta.transaction_id
      AND mta.accounting_line_type = 1
      AND mmt.transaction_action_id in (1,27,29)
      AND mmt.transaction_source_type_id=1
      AND mmt.transaction_date >= p_from_date
      AND mmt.transaction_date <= p_to_date
      AND MMT.organization_id =  NVL(MMT.owning_organization_id, MMT.organization_id)
      AND NVL(MMT.OWNING_TP_TYPE,2) = 2
 GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
          mmt.REVISION,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 1081

   SELECT   trunc(mmt.TRANSACTION_DATE),
         mmt.ORGANIZATION_ID,
         mmt.INVENTORY_ITEM_ID,
         mmt.COST_GROUP_ID,
         mmt.REVISION,
         mtln.LOT_NUMBER,
         mmt.SUBINVENTORY_CODE,
         mmt.LOCATOR_ID,
         sum(mta.BASE_TRANSACTION_VALUE)
    FROM MTL_MATERIAL_TRANSACTIONS mmt,
         MTL_SYSTEM_ITEMS  msi,
         MTL_TRANSACTION_LOT_NUMBERS mtln,
	 MTL_TRANSACTION_ACCOUNTS mta
   WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
     AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
     AND mmt.transaction_id = mtln.transaction_id
     AND mmt.ORGANIZATION_ID=Org_id
     AND msi.LOT_CONTROL_CODE = 2
     AND mmt.transaction_id = mta.transaction_id
     AND mta.accounting_line_type = 1
     AND mmt.transaction_action_id in (1,27,29)
     AND mmt.transaction_source_type_id=1
     AND mmt.transaction_date >= p_from_date
     AND mmt.transaction_date <= p_to_date
     AND MMT.organization_id =  NVL(MMT.owning_organization_id, MMT.organization_id)
     AND NVL(MMT.OWNING_TP_TYPE,2) = 2
GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
         mmt.REVISION,mtln.lot_number,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 1138

         Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'po_del_qty',
            p_total1          => total_qty,
            selector          => 1,
            success           => status);
Line: 1185

        Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_lot_number      => l_lot_number,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'po_del_qty',
            p_total1          => total_qty,
            selector          => 1,
            success           => status);
Line: 1229

         Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'po_del_val_b',
            p_total1          => total_value,
            selector          => 1,
            success           => status);
Line: 1274

        Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_lot_number      => l_lot_number,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'po_del_val_b',
            p_total1          => total_value,
            selector          => 1,
            success           => status);
Line: 1326

   SELECT trunc(mmt.TRANSACTION_DATE),
          mmt.ORGANIZATION_ID,
          mmt.INVENTORY_ITEM_ID,
          mmt.COST_GROUP_ID,
          mmt.REVISION,
          mmt.SUBINVENTORY_CODE,
          mmt.LOCATOR_ID,
          sum(mmt.PRIMARY_QUANTITY)
     FROM MTL_MATERIAL_TRANSACTIONS mmt,
          MTL_SYSTEM_ITEMS  msi
    WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
      AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
      AND mmt.ORGANIZATION_ID=Org_id
      AND msi.LOT_CONTROL_CODE = 1
      AND mmt.transaction_action_id in (3,12)
      AND mmt.primary_quantity > 0
      AND mmt.transaction_date >= p_from_date
      AND mmt.transaction_date <= p_to_date
 GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
          mmt.REVISION,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 1348

   SELECT   trunc(mmt.TRANSACTION_DATE),
         mmt.ORGANIZATION_ID,
         mmt.INVENTORY_ITEM_ID,
         mmt.COST_GROUP_ID,
         mmt.REVISION,
         mtln.LOT_NUMBER,
         mmt.SUBINVENTORY_CODE,
         mmt.LOCATOR_ID,
         sum(mtln.PRIMARY_QUANTITY)
    FROM MTL_MATERIAL_TRANSACTIONS mmt,
         MTL_SYSTEM_ITEMS  msi,
         MTL_TRANSACTION_LOT_NUMBERS mtln
   WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
     AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
     AND mmt.ORGANIZATION_ID=Org_id
     AND mmt.transaction_id = mtln.transaction_id
     AND msi.LOT_CONTROL_CODE = 2
     AND mmt.transaction_action_id in (3,12)
     AND mmt.primary_quantity > 0
     AND mmt.transaction_date >= p_from_date
     AND mmt.transaction_date <= p_to_date
GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
         mmt.REVISION,mtln.lot_number,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 1373

   SELECT trunc(mmt.TRANSACTION_DATE),
          mmt.ORGANIZATION_ID,
          mmt.INVENTORY_ITEM_ID,
          mmt.COST_GROUP_ID,
          mmt.REVISION,
          mmt.SUBINVENTORY_CODE,
          mmt.LOCATOR_ID,
          sum(mta.BASE_TRANSACTION_VALUE)
     FROM MTL_MATERIAL_TRANSACTIONS mmt,
          MTL_SYSTEM_ITEMS  msi,
	  MTL_TRANSACTION_ACCOUNTS mta
    WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
      AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
      AND mmt.ORGANIZATION_ID=Org_id
      AND msi.LOT_CONTROL_CODE = 1
      AND mmt.transaction_id = mta.transaction_id
      AND mta.accounting_line_type = 1
      AND mmt.transaction_action_id in (3,12)
      AND mmt.primary_quantity > 0
      AND mmt.transaction_date >= p_from_date
      AND mmt.transaction_date <= p_to_date
 GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
          mmt.REVISION,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 1398

   SELECT   trunc(mmt.TRANSACTION_DATE),
         mmt.ORGANIZATION_ID,
         mmt.INVENTORY_ITEM_ID,
         mmt.COST_GROUP_ID,
         mmt.REVISION,
         mtln.LOT_NUMBER,
         mmt.SUBINVENTORY_CODE,
         mmt.LOCATOR_ID,
         sum(mta.BASE_TRANSACTION_VALUE)
    FROM MTL_MATERIAL_TRANSACTIONS mmt,
         MTL_SYSTEM_ITEMS  msi,
         MTL_TRANSACTION_LOT_NUMBERS mtln,
	 MTL_TRANSACTION_ACCOUNTS mta
   WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
     AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
     AND mmt.ORGANIZATION_ID=Org_id
     AND mmt.transaction_id = mtln.transaction_id
     AND msi.LOT_CONTROL_CODE = 2
     AND mmt.transaction_id = mta.transaction_id
     AND mta.accounting_line_type = 1
     AND mmt.transaction_action_id in (3,12)
     AND mmt.primary_quantity > 0
     AND mmt.transaction_date >= p_from_date
     AND mmt.transaction_date <= p_to_date
GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
         mmt.REVISION,mtln.lot_number,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 1453

         Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'from_org_qty',
            p_total1          => total_qty,
            selector          => 1,
            success           => status);
Line: 1499

        Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_lot_number      => l_lot_number,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'from_org_qty',
            p_total1          => total_qty,
            selector          => 1,
            success           => status);
Line: 1544

         Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'from_org_val_b',
            p_total1          => total_value,
            selector          => 1,
            success           => status);
Line: 1589

        Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_lot_number      => l_lot_number,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'from_org_val_b',
            p_total1          => total_value,
            selector          => 1,
            success           => status);
Line: 1643

   SELECT trunc(mmt.TRANSACTION_DATE),
          mmt.ORGANIZATION_ID,
          mmt.INVENTORY_ITEM_ID,
          mmt.COST_GROUP_ID,
          mmt.REVISION,
          mmt.SUBINVENTORY_CODE,
          mmt.LOCATOR_ID,
          sum(mmt.PRIMARY_QUANTITY)
     FROM MTL_MATERIAL_TRANSACTIONS mmt,
          MTL_SYSTEM_ITEMS  msi
    WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
      AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
      AND mmt.ORGANIZATION_ID=Org_id
      AND msi.LOT_CONTROL_CODE = 1
      AND mmt.transaction_action_id in (3,21)
      AND mmt.primary_quantity < 0
      AND mmt.transaction_date >= p_from_date
      AND mmt.transaction_date <= p_to_date
 GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
          mmt.REVISION,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 1665

   SELECT   trunc(mmt.TRANSACTION_DATE),
         mmt.ORGANIZATION_ID,
         mmt.INVENTORY_ITEM_ID,
         mmt.COST_GROUP_ID,
         mmt.REVISION,
         mtln.LOT_NUMBER,
         mmt.SUBINVENTORY_CODE,
         mmt.LOCATOR_ID,
         sum(mtln.PRIMARY_QUANTITY)
    FROM MTL_MATERIAL_TRANSACTIONS mmt,
         MTL_SYSTEM_ITEMS  msi,
         MTL_TRANSACTION_LOT_NUMBERS mtln
   WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
     AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
     AND mmt.ORGANIZATION_ID=Org_id
     AND mmt.transaction_id = mtln.transaction_id
     AND msi.LOT_CONTROL_CODE = 2
     AND mmt.transaction_action_id in (3,21)
     AND mmt.primary_quantity < 0
     AND mmt.transaction_date >= p_from_date
     AND mmt.transaction_date <= p_to_date
GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
         mmt.REVISION,mtln.lot_number,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 1690

   SELECT trunc(mmt.TRANSACTION_DATE),
          mmt.ORGANIZATION_ID,
          mmt.INVENTORY_ITEM_ID,
          mmt.COST_GROUP_ID,
          mmt.REVISION,
          mmt.SUBINVENTORY_CODE,
          mmt.LOCATOR_ID,
          sum(mta.BASE_TRANSACTION_VALUE)
     FROM MTL_MATERIAL_TRANSACTIONS mmt,
          MTL_SYSTEM_ITEMS  msi,
	  MTL_TRANSACTION_ACCOUNTS mta
    WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
      AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
      AND mmt.ORGANIZATION_ID=Org_id
      AND msi.LOT_CONTROL_CODE = 1
      AND mmt.transaction_id = mta.transaction_id
      AND mmt.organization_id=mta.organization_id
      AND mta.accounting_line_type = 1
      AND mmt.transaction_action_id in (3,21)
      AND mmt.primary_quantity < 0
      AND mmt.transaction_date >= p_from_date
      AND mmt.transaction_date <= p_to_date
 GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
          mmt.REVISION,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 1716

   SELECT   trunc(mmt.TRANSACTION_DATE),
         mmt.ORGANIZATION_ID,
         mmt.INVENTORY_ITEM_ID,
         mmt.COST_GROUP_ID,
         mmt.REVISION,
         mtln.LOT_NUMBER,
         mmt.SUBINVENTORY_CODE,
         mmt.LOCATOR_ID,
         sum(mta.BASE_TRANSACTION_VALUE)
    FROM MTL_MATERIAL_TRANSACTIONS mmt,
         MTL_SYSTEM_ITEMS  msi,
         MTL_TRANSACTION_LOT_NUMBERS mtln,
	 MTL_TRANSACTION_ACCOUNTS mta
   WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
     AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
     AND mmt.ORGANIZATION_ID=Org_id
     AND mmt.transaction_id = mtln.transaction_id
     AND msi.LOT_CONTROL_CODE = 2
     AND mmt.transaction_id = mta.transaction_id
     AND mmt.organization_id=mta.organization_id
     AND mta.accounting_line_type = 1
     AND mmt.transaction_action_id in (3,21)
     AND mmt.primary_quantity < 0
     AND mmt.transaction_date >= p_from_date
     AND mmt.transaction_date <= p_to_date
GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
         mmt.REVISION,mtln.lot_number,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 1772

      Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'to_org_qty',
            p_total1          => total_qty,
            selector          => 1,
            success           => status);
Line: 1818

        Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_lot_number      => l_lot_number,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'to_org_qty',
            p_total1          => total_qty,
            selector          => 1,
            success           => status);
Line: 1863

      Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'to_org_val_b',
            p_total1          => total_value,
            selector          => 1,
            success           => status);
Line: 1908

        Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_lot_number      => l_lot_number,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'to_org_val_b',
            p_total1          => total_value,
            selector          => 1,
            success           => status);
Line: 1965

   SELECT trunc(mmt.TRANSACTION_DATE),
          mmt.ORGANIZATION_ID,
          mmt.INVENTORY_ITEM_ID,
          mmt.COST_GROUP_ID,
          mmt.REVISION,
          mmt.SUBINVENTORY_CODE,
          mmt.LOCATOR_ID,
          sum(mmt.PRIMARY_QUANTITY)
     FROM MTL_MATERIAL_TRANSACTIONS mmt,
          MTL_SYSTEM_ITEMS  msi
    WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
      AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
      AND mmt.ORGANIZATION_ID=Org_id
      AND msi.LOT_CONTROL_CODE = 1
      AND mmt.transaction_action_id in (1,27)
      AND mmt.transaction_source_type_id in (2,8,12)
      AND mmt.transaction_date >= p_from_date
      AND mmt.transaction_date <= p_to_date
 GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
          mmt.REVISION,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 1987

   SELECT   trunc(mmt.TRANSACTION_DATE),
         mmt.ORGANIZATION_ID,
         mmt.INVENTORY_ITEM_ID,
         mmt.COST_GROUP_ID,
         mmt.REVISION,
         mtln.LOT_NUMBER,
         mmt.SUBINVENTORY_CODE,
         mmt.LOCATOR_ID,
         sum(mtln.PRIMARY_QUANTITY)
    FROM MTL_MATERIAL_TRANSACTIONS mmt,
         MTL_SYSTEM_ITEMS  msi,
         MTL_TRANSACTION_LOT_NUMBERS mtln
   WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
     AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
     AND mmt.transaction_id = mtln.transaction_id
     AND mmt.ORGANIZATION_ID=Org_id
     AND msi.LOT_CONTROL_CODE = 2
      AND mmt.transaction_action_id in (1,27)
      AND mmt.transaction_source_type_id in (2,8,12)
     AND mmt.transaction_date >= p_from_date
     AND mmt.transaction_date <= p_to_date
GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
         mmt.REVISION,mtln.lot_number,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 2016

   SELECT trunc(mmt.TRANSACTION_DATE),
          mmt.ORGANIZATION_ID,
          mmt.INVENTORY_ITEM_ID,
          mmt.COST_GROUP_ID,
          mmt.REVISION,
          mmt.SUBINVENTORY_CODE,
          mmt.LOCATOR_ID,
          sum(mta.BASE_TRANSACTION_VALUE)
     FROM MTL_MATERIAL_TRANSACTIONS mmt,
          MTL_SYSTEM_ITEMS  msi,
	  MTL_TRANSACTION_ACCOUNTS mta
    WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
      AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
      AND mmt.ORGANIZATION_ID=Org_id
      AND msi.LOT_CONTROL_CODE = 1
      AND mmt.transaction_id = mta.transaction_id
      AND mta.accounting_line_type = 1
      AND mmt.transaction_action_id in (1,27)
      AND mmt.transaction_source_type_id in (2,8,12)
      AND mmt.transaction_date >= p_from_date
      AND mmt.transaction_date <= p_to_date
 GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
          mmt.REVISION,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 2041

   SELECT   trunc(mmt.TRANSACTION_DATE),
         mmt.ORGANIZATION_ID,
         mmt.INVENTORY_ITEM_ID,
         mmt.COST_GROUP_ID,
         mmt.REVISION,
         mtln.LOT_NUMBER,
         mmt.SUBINVENTORY_CODE,
         mmt.LOCATOR_ID,
         sum(mta.BASE_TRANSACTION_VALUE)
    FROM MTL_MATERIAL_TRANSACTIONS mmt,
         MTL_SYSTEM_ITEMS  msi,
         MTL_TRANSACTION_LOT_NUMBERS mtln,
	 MTL_TRANSACTION_ACCOUNTS mta
   WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
     AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
     AND mmt.ORGANIZATION_ID=Org_id
     AND mmt.transaction_id = mtln.transaction_id
     AND msi.LOT_CONTROL_CODE = 2
     AND mmt.transaction_id = mta.transaction_id
      AND mmt.transaction_action_id in (1,27)
      AND mmt.transaction_source_type_id in (2,8,12)
     AND mta.accounting_line_type = 1
     AND mmt.transaction_date >= p_from_date
     AND mmt.transaction_date <= p_to_date
GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
         mmt.REVISION,mtln.lot_number,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 2069

  SELECT  TRANSACTION_DATE,
          ORGANIZATION_ID,
          INVENTORY_ITEM_ID,
          COST_GROUP_ID,
          REVISION,
          SUBINVENTORY_CODE,
          LOCATOR_ID,
          sum(BASE_TRANSACTION_VALUE)BASE_TRANSACTION_VALUE
  FROM
  (
  /* Regular Sales Transactions (no logical flow)*/
     SELECT  trunc(mmt.TRANSACTION_DATE)TRANSACTION_DATE,
             mmt.ORGANIZATION_ID,
             mmt.INVENTORY_ITEM_ID,
             mmt.COST_GROUP_ID,
             mmt.REVISION,
             mmt.SUBINVENTORY_CODE,
             mmt.LOCATOR_ID,
             sum(mta.BASE_TRANSACTION_VALUE)BASE_TRANSACTION_VALUE
     FROM    MTL_MATERIAL_TRANSACTIONS mmt,
             MTL_SYSTEM_ITEMS  msi,
             MTL_TRANSACTION_ACCOUNTS mta
     WHERE   mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
       AND   mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
       AND   mmt.ORGANIZATION_ID=Org_id
       AND   msi.LOT_CONTROL_CODE = 1
       AND   mmt.TRANSACTION_ID = mta.TRANSACTION_ID
       AND   mta.ACCOUNTING_LINE_TYPE = 1
       AND   mmt.TRANSACTION_ACTION_ID IN (1,27)
       AND   mmt.TRANSACTION_SOURCE_TYPE_ID IN (2,8,12)
       AND   mmt.TRANSACTION_DATE >= p_from_date
       AND   mmt.TRANSACTION_DATE <= p_to_date
     GROUP BY trunc(mmt.TRANSACTION_DATE), mmt.ORGANIZATION_ID, mmt.INVENTORY_ITEM_ID,
             mmt.COST_GROUP_ID, mmt.REVISION, mmt.SUBINVENTORY_CODE, mmt.LOCATOR_ID
     UNION
     /* Sales Orders and  RMA Receipts in Internal Drop Ship to Customer*/
     SELECT  trunc(mmt1.TRANSACTION_DATE)TRANSACTION_DATE,
             mmt1.ORGANIZATION_ID,
             mmt1.INVENTORY_ITEM_ID,
             mmt1.COST_GROUP_ID,
             mmt1.REVISION,
             mmt1.SUBINVENTORY_CODE,
             mmt1.LOCATOR_ID,
             sum(mta.BASE_TRANSACTION_VALUE)BASE_TRANSACTION_VALUE
     FROM    MTL_MATERIAL_TRANSACTIONS mmt1,        --Parent Physical Txns
             MTL_MATERIAL_TRANSACTIONS mmt2,        --Logical (Child) Txns
             MTL_SYSTEM_ITEMS msi,
	     MTL_TRANSACTION_ACCOUNTS mta
     WHERE   mmt1.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
       AND   mmt1.ORGANIZATION_ID=msi.ORGANIZATION_ID
       AND   mmt1.ORGANIZATION_ID=Org_id
       AND   msi.LOT_CONTROL_CODE = 1
       AND   mmt1.TRANSACTION_ACTION_ID IN (1, 27)
       AND   mmt1.TRANSACTION_SOURCE_TYPE_ID IN (2, 12)
       AND   mmt1.TRANSACTION_DATE >= p_from_date
       AND   mmt1.TRANSACTION_DATE <= p_to_date
       AND   mmt2.TRANSACTION_ID = mta.TRANSACTION_ID
       AND   mta.ACCOUNTING_LINE_TYPE = 1
       /* logical txn triggered by this parent txn*/
       AND   mmt2.PARENT_TRANSACTION_ID = mmt1.TRANSACTION_ID
       AND   mmt2.TRANSACTION_TYPE_ID IN (11, 14)
       AND   mmt2.ORGANIZATION_ID = Org_id
     GROUP BY trunc(mmt1.TRANSACTION_DATE), mmt1.ORGANIZATION_ID, mmt1.INVENTORY_ITEM_ID,
             mmt1.COST_GROUP_ID, mmt1.REVISION, mmt1.SUBINVENTORY_CODE, mmt1.LOCATOR_ID
  )
  GROUP BY TRANSACTION_DATE, ORGANIZATION_ID, INVENTORY_ITEM_ID, COST_GROUP_ID, REVISION, SUBINVENTORY_CODE, LOCATOR_ID;
Line: 2137

  SELECT   TRANSACTION_DATE,
	   ORGANIZATION_ID,
	   INVENTORY_ITEM_ID,
	   COST_GROUP_ID,
	   REVISION,
	   LOT_NUMBER,
	   SUBINVENTORY_CODE,
	   LOCATOR_ID,
	   sum(BASE_TRANSACTION_VALUE)BASE_TRANSACTION_VALUE
  FROM
  (
           /* Regular Sales Transactions (no logical flow)*/
     SELECT   trunc(mmt.TRANSACTION_DATE)TRANSACTION_DATE,
              mmt.ORGANIZATION_ID,
              mmt.INVENTORY_ITEM_ID,
              mmt.COST_GROUP_ID,
              mmt.REVISION,
              mtln.LOT_NUMBER,
              mmt.SUBINVENTORY_CODE,
              mmt.LOCATOR_ID,
              sum(mta.BASE_TRANSACTION_VALUE)BASE_TRANSACTION_VALUE
     FROM     MTL_MATERIAL_TRANSACTIONS mmt,
              MTL_SYSTEM_ITEMS  msi,
              MTL_TRANSACTION_LOT_NUMBERS mtln,
              MTL_TRANSACTION_ACCOUNTS mta
     WHERE    mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
       AND    mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
       AND    mmt.ORGANIZATION_ID=Org_id
       AND    mmt.TRANSACTION_ID = mtln.TRANSACTION_ID
       AND    msi.LOT_CONTROL_CODE = 2
       AND    mmt.TRANSACTION_ID = mta.TRANSACTION_ID
       AND    mmt.TRANSACTION_ACTION_ID IN (1,27)
       AND    mmt.TRANSACTION_SOURCE_TYPE_ID in (2,8,12)
       AND    mta.ACCOUNTING_LINE_TYPE = 1
       AND    mmt.TRANSACTION_DATE >= p_from_date
       AND    mmt.TRANSACTION_DATE <= p_to_date
     GROUP BY trunc(mmt.TRANSACTION_DATE), mmt.ORGANIZATION_ID, mmt.INVENTORY_ITEM_ID, mmt.COST_GROUP_ID,
              mmt.REVISION, mtln.LOT_NUMBER, mmt.SUBINVENTORY_CODE, mmt.LOCATOR_ID
  UNION
     /* Sales Orders and RMA Receipts in Internal Drop Ship to Customer*/
     SELECT   trunc(mmt1.TRANSACTION_DATE)TRANSACTION_DATE,
              mmt1.ORGANIZATION_ID,
              mmt1.INVENTORY_ITEM_ID,
              mmt1.COST_GROUP_ID,
              mmt1.REVISION,
	      mtln.LOT_NUMBER,
              mmt1.SUBINVENTORY_CODE,
              mmt1.LOCATOR_ID,
	      sum(mta.BASE_TRANSACTION_VALUE)BASE_TRANSACTION_VALUE
     FROM     MTL_MATERIAL_TRANSACTIONS mmt1,   --Parent Physical Txns
              MTL_MATERIAL_TRANSACTIONS mmt2,   --Logical (Child) Txns
              MTL_SYSTEM_ITEMS  msi,
              MTL_TRANSACTION_LOT_NUMBERS mtln,
              MTL_TRANSACTION_ACCOUNTS mta
     WHERE    mmt1.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
       AND    mmt1.ORGANIZATION_ID=msi.ORGANIZATION_ID
       AND    mmt1.ORGANIZATION_ID=Org_id
       AND    mmt1.TRANSACTION_ID = mtln.TRANSACTION_ID
       AND    msi.LOT_CONTROL_CODE = 2
       AND    mmt1.TRANSACTION_ACTION_ID IN (1,27)
       AND    mmt1.TRANSACTION_SOURCE_TYPE_ID IN (2,12)
       AND    mmt1.TRANSACTION_DATE >= p_from_date
       AND    mmt1.TRANSACTION_DATE <= p_to_date
       AND    mmt2.TRANSACTION_ID = mta.TRANSACTION_ID
       AND    mta.ACCOUNTING_LINE_TYPE = 1
       /* logical txn triggered by this parent txn*/
       AND    mmt2.PARENT_TRANSACTION_ID = mmt1.TRANSACTION_ID
       AND    mmt2.ORGANIZATION_ID=Org_id
       AND    mmt2.TRANSACTION_TYPE_ID IN (11,14)
     GROUP BY trunc(mmt1.TRANSACTION_DATE), mmt1.ORGANIZATION_ID, mmt1.INVENTORY_ITEM_ID, mmt1.COST_GROUP_ID,
              mmt1.REVISION, mtln.LOT_NUMBER, mmt1.SUBINVENTORY_CODE, mmt1.LOCATOR_ID
  )
  GROUP BY TRANSACTION_DATE, ORGANIZATION_ID, INVENTORY_ITEM_ID, COST_GROUP_ID,
           REVISION, LOT_NUMBER, SUBINVENTORY_CODE, LOCATOR_ID;
Line: 2244

      Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'tot_cust_ship_qty',
            p_total1          => total_qty,
            selector          => 1,
            success           => status);
Line: 2290

        Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_lot_number      => l_lot_number,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'tot_cust_ship_qty',
            p_total1          => total_qty,
            selector          => 1,
            success           => status);
Line: 2335

      Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'tot_cust_ship_val_b',
            p_total1          => total_value,
            selector          => 1,
            success           => status);
Line: 2379

        Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_lot_number      => l_lot_number,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'tot_cust_ship_val_b',
            p_total1          => total_value,
            selector          => 1,
            success           => status);
Line: 2432

   SELECT trunc(mmt.TRANSACTION_DATE),
          mmt.ORGANIZATION_ID,
          mmt.INVENTORY_ITEM_ID,
          mmt.COST_GROUP_ID,
          mmt.REVISION,
          mmt.SUBINVENTORY_CODE,
          mmt.LOCATOR_ID,
          sum(mmt.PRIMARY_QUANTITY)
     FROM MTL_MATERIAL_TRANSACTIONS mmt,
          MTL_SYSTEM_ITEMS  msi
    WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
      AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
      AND mmt.ORGANIZATION_ID=Org_id
      AND msi.LOT_CONTROL_CODE = 1
      AND mmt.transaction_action_id in (4,8)
      AND mmt.transaction_date >= p_from_date
      AND mmt.transaction_date <= p_to_date
 GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
          mmt.REVISION,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 2453

   SELECT   trunc(mmt.TRANSACTION_DATE),
         mmt.ORGANIZATION_ID,
         mmt.INVENTORY_ITEM_ID,
         mmt.COST_GROUP_ID,
         mmt.REVISION,
         mtln.LOT_NUMBER,
         mmt.SUBINVENTORY_CODE,
         mmt.LOCATOR_ID,
         sum(mtln.PRIMARY_QUANTITY)
    FROM MTL_MATERIAL_TRANSACTIONS mmt,
         MTL_SYSTEM_ITEMS  msi,
         MTL_TRANSACTION_LOT_NUMBERS mtln
   WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
     AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
     AND mmt.transaction_id = mtln.transaction_id
     AND mmt.ORGANIZATION_ID=Org_id
     AND msi.LOT_CONTROL_CODE = 2
     AND mmt.transaction_action_id in (4,8)
     AND mmt.transaction_date >= p_from_date
     AND mmt.transaction_date <= p_to_date
GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
         mmt.REVISION,mtln.lot_number,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 2477

   SELECT trunc(mmt.TRANSACTION_DATE),
          mmt.ORGANIZATION_ID,
          mmt.INVENTORY_ITEM_ID,
          mmt.COST_GROUP_ID,
          mmt.REVISION,
          mmt.SUBINVENTORY_CODE,
          mmt.LOCATOR_ID,
          sum(mta.BASE_TRANSACTION_VALUE)
     FROM MTL_MATERIAL_TRANSACTIONS mmt,
          MTL_SYSTEM_ITEMS  msi,
	  MTL_TRANSACTION_ACCOUNTS mta
    WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
      AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
      AND mmt.ORGANIZATION_ID=Org_id
      AND msi.LOT_CONTROL_CODE = 1
      AND mmt.transaction_id = mta.transaction_id
      AND mta.accounting_line_type = 1
      AND mmt.transaction_action_id in (4,8)
      AND mmt.transaction_date >= p_from_date
      AND mmt.transaction_date <= p_to_date
 GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
          mmt.REVISION,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 2501

   SELECT   trunc(mmt.TRANSACTION_DATE),
         mmt.ORGANIZATION_ID,
         mmt.INVENTORY_ITEM_ID,
         mmt.COST_GROUP_ID,
         mmt.REVISION,
         mtln.LOT_NUMBER,
         mmt.SUBINVENTORY_CODE,
         mmt.LOCATOR_ID,
         sum(mta.BASE_TRANSACTION_VALUE)
    FROM MTL_MATERIAL_TRANSACTIONS mmt,
         MTL_SYSTEM_ITEMS  msi,
         MTL_TRANSACTION_LOT_NUMBERS mtln,
	 MTL_TRANSACTION_ACCOUNTS mta
   WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
     AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
     AND mmt.ORGANIZATION_ID=Org_id
     AND mmt.transaction_id = mtln.transaction_id
     AND msi.LOT_CONTROL_CODE = 2
     AND mmt.transaction_id = mta.transaction_id
     AND mmt.transaction_action_id in (4,8)
     AND mta.accounting_line_type = 1
     AND mmt.transaction_date >= p_from_date
     AND mmt.transaction_date <= p_to_date
GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
         mmt.REVISION,mtln.lot_number,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 2554

      Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'inv_adj_qty',
            p_total1          => total_qty,
            selector          => 1,
            success           => status);
Line: 2599

        Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_lot_number      => l_lot_number,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'inv_adj_qty',
            p_total1          => total_qty,
            selector          => 1,
            success           => status);
Line: 2643

      Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'inv_adj_val_b',
            p_total1          => total_value,
            selector          => 1,
            success           => status);
Line: 2688

        Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_lot_number      => l_lot_number,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'inv_adj_val_b',
            p_total1          => total_value,
            selector          => 1,
            success           => status);
Line: 2743

   SELECT trunc(mmt.TRANSACTION_DATE),
          mmt.ORGANIZATION_ID,
          mmt.INVENTORY_ITEM_ID,
          mmt.COST_GROUP_ID,
          mmt.REVISION,
          mmt.SUBINVENTORY_CODE,
          mmt.LOCATOR_ID,
          sum(mmt.PRIMARY_QUANTITY)
     FROM MTL_MATERIAL_TRANSACTIONS mmt,
          MTL_SYSTEM_ITEMS  msi
    WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
      AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
      AND mmt.ORGANIZATION_ID=Org_id
      AND msi.LOT_CONTROL_CODE = 1
      AND (  (mmt.transaction_action_id in (1,2,3,21)
	      AND mmt.primary_quantity < 0
	      AND mmt.transaction_source_type_id <> 1)
          OR (mmt.transaction_action_id = 27
	      AND mmt.transaction_source_type_id in (5,12))  )
      AND mmt.transaction_date >= p_from_date
      AND mmt.transaction_date <= p_to_date
      AND MMT.organization_id =  NVL(MMT.owning_organization_id,MMT.organization_id)
      AND NVL(MMT.OWNING_TP_TYPE,2) = 2
 GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
          mmt.REVISION,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 2772

   SELECT   trunc(mmt.TRANSACTION_DATE),
         mmt.ORGANIZATION_ID,
         mmt.INVENTORY_ITEM_ID,
         mmt.COST_GROUP_ID,
         mmt.REVISION,
         mtln.LOT_NUMBER,
         mmt.SUBINVENTORY_CODE,
         mmt.LOCATOR_ID,
         sum(mtln.PRIMARY_QUANTITY)
    FROM MTL_MATERIAL_TRANSACTIONS mmt,
         MTL_SYSTEM_ITEMS  msi,
         MTL_TRANSACTION_LOT_NUMBERS mtln
   WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
     AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
     AND mmt.transaction_id = mtln.transaction_id
     AND mmt.ORGANIZATION_ID=Org_id
     AND msi.LOT_CONTROL_CODE = 2
      AND (  (mmt.transaction_action_id in (1,2,3,21)
	      AND mmt.primary_quantity < 0
	      AND mmt.transaction_source_type_id <> 1)
          OR (mmt.transaction_action_id = 27
	      AND mmt.transaction_source_type_id in (5,12))  )
     AND mmt.transaction_date >= p_from_date
     AND mmt.transaction_date <= p_to_date
     AND MMT.organization_id =  NVL(MMT.owning_organization_id,MMT.organization_id)
     AND NVL(MMT.OWNING_TP_TYPE,2) = 2
GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
         mmt.REVISION,mtln.lot_number,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 2808

   SELECT trunc(mmt.TRANSACTION_DATE),
          mmt.ORGANIZATION_ID,
          mmt.INVENTORY_ITEM_ID,
          mmt.COST_GROUP_ID,
          mmt.REVISION,
          mmt.SUBINVENTORY_CODE,
          mmt.LOCATOR_ID,
          sum(mta.BASE_TRANSACTION_VALUE)
     FROM MTL_MATERIAL_TRANSACTIONS mmt,
          MTL_SYSTEM_ITEMS  msi,
	  MTL_TRANSACTION_ACCOUNTS mta
    WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
      AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
      AND mmt.ORGANIZATION_ID=Org_id
      AND msi.LOT_CONTROL_CODE = 1
      AND mmt.transaction_id = mta.transaction_id
      AND mta.accounting_line_type = 1
      AND (  (mmt.transaction_action_id in (1,2,3,21)
	      AND mmt.primary_quantity < 0
	      AND mmt.transaction_source_type_id <> 1)
          OR (mmt.transaction_action_id = 27
	      AND mmt.transaction_source_type_id in (5,12))  )
      AND mmt.transaction_date >= p_from_date
      AND mmt.transaction_date <= p_to_date
      AND MMT.organization_id =  NVL(MMT.owning_organization_id,MMT.organization_id)
      AND NVL(MMT.OWNING_TP_TYPE,2) = 2
 GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
          mmt.REVISION,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 2840

   SELECT   trunc(mmt.TRANSACTION_DATE),
         mmt.ORGANIZATION_ID,
         mmt.INVENTORY_ITEM_ID,
         mmt.COST_GROUP_ID,
         mmt.REVISION,
         mtln.LOT_NUMBER,
         mmt.SUBINVENTORY_CODE,
         mmt.LOCATOR_ID,
         sum(mta.BASE_TRANSACTION_VALUE)
    FROM MTL_MATERIAL_TRANSACTIONS mmt,
         MTL_SYSTEM_ITEMS  msi,
         MTL_TRANSACTION_LOT_NUMBERS mtln,
	 MTL_TRANSACTION_ACCOUNTS mta
   WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
     AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
     AND mmt.ORGANIZATION_ID=Org_id
     AND mmt.transaction_id = mtln.transaction_id
     AND msi.LOT_CONTROL_CODE = 2
     AND mmt.transaction_id = mta.transaction_id
     AND (  (mmt.transaction_action_id in (1,2,3,21)
	      AND mmt.primary_quantity < 0
	      AND mmt.transaction_source_type_id <> 1)
          OR (mmt.transaction_action_id = 27
	      AND mmt.transaction_source_type_id in (5,12))  )
     AND mta.accounting_line_type = 1
     AND mmt.transaction_date >= p_from_date
     AND mmt.transaction_date <= p_to_date
     AND MMT.organization_id =  NVL(MMT.owning_organization_id,MMT.organization_id)
     AND NVL(MMT.OWNING_TP_TYPE,2) = 2
GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
         mmt.REVISION,mtln.lot_number,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 2874

  SELECT   TRANSACTION_DATE,
           ORGANIZATION_ID,
           INVENTORY_ITEM_ID,
           COST_GROUP_ID,
           REVISION,
           SUBINVENTORY_CODE,
           LOCATOR_ID,
           sum(BASE_TRANSACTION_VALUE)BASE_TRANSACTION_VALUE
  FROM
  (
     /* Regular Sales Transactions (no logical flow)*/
     SELECT   trunc(mmt.TRANSACTION_DATE) TRANSACTION_DATE,
              mmt.ORGANIZATION_ID,
              mmt.INVENTORY_ITEM_ID,
              mmt.COST_GROUP_ID,
              mmt.REVISION,
              mmt.SUBINVENTORY_CODE,
              mmt.LOCATOR_ID,
              sum(mta.BASE_TRANSACTION_VALUE) BASE_TRANSACTION_VALUE
     FROM     MTL_MATERIAL_TRANSACTIONS mmt,
              MTL_SYSTEM_ITEMS  msi,
              MTL_TRANSACTION_ACCOUNTS mta
     WHERE    mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
       AND    mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
       AND    mmt.ORGANIZATION_ID=Org_id
       AND    msi.LOT_CONTROL_CODE = 1
       AND    mmt.TRANSACTION_ID = mta.TRANSACTION_ID
       AND    mta.ACCOUNTING_LINE_TYPE = 1
       AND    ((mmt.TRANSACTION_ACTION_ID IN (1,2,3,21)
                AND mmt.PRIMARY_QUANTITY < 0
                AND mmt.TRANSACTION_SOURCE_TYPE_ID <> 1)
              OR (mmt.TRANSACTION_ACTION_ID = 27
                 AND mmt.TRANSACTION_SOURCE_TYPE_ID IN (5,12)))
       AND    mmt.TRANSACTION_DATE >= p_from_date
       AND    mmt.TRANSACTION_DATE <= p_to_date
       AND    mmt.ORGANIZATION_ID = NVL(mmt.OWNING_ORGANIZATION_ID, mmt.ORGANIZATION_ID)
       AND    NVL(mmt.OWNING_TP_TYPE,2) = 2
     GROUP BY trunc(mmt.TRANSACTION_DATE), mmt.ORGANIZATION_ID, mmt.INVENTORY_ITEM_ID, mmt.COST_GROUP_ID,
              mmt.REVISION, mmt.SUBINVENTORY_CODE, mmt.LOCATOR_ID
  UNION
     /* Sales Orders and RMA Receipts in Internal Drop Ship to Customer*/
     SELECT   trunc(mmt1.TRANSACTION_DATE)TRANSACTION_DATE,
              mmt1.ORGANIZATION_ID,
              mmt1.INVENTORY_ITEM_ID,
              mmt1.COST_GROUP_ID,
              mmt1.REVISION,
              mmt1.SUBINVENTORY_CODE,
              mmt1.LOCATOR_ID,
              sum(mta.BASE_TRANSACTION_VALUE)BASE_TRANSACTION_VALUE
     FROM     MTL_MATERIAL_TRANSACTIONS mmt1,  -- Parent Physical Txns
              MTL_MATERIAL_TRANSACTIONS mmt2,  -- Logical (Child) Txns
	      MTL_SYSTEM_ITEMS msi,
	      MTL_TRANSACTION_ACCOUNTS mta
     WHERE    mmt1.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
       AND    mmt1.ORGANIZATION_ID=msi.ORGANIZATION_ID
       AND    mmt1.ORGANIZATION_ID=Org_id
       AND    msi.LOT_CONTROL_CODE = 1
       AND    mmt1.TRANSACTION_ACTION_ID IN (1, 27)
       AND    mmt1.TRANSACTION_SOURCE_TYPE_ID IN (2, 12)
       AND    mmt1.TRANSACTION_DATE >= p_from_date
       AND    mmt1.TRANSACTION_DATE <= p_to_date
       AND    mmt2.TRANSACTION_ID = mta.TRANSACTION_ID
       AND    mta.ACCOUNTING_LINE_TYPE = 1
       /* logical txn triggered by this parent txn*/
       AND    mmt2.PARENT_TRANSACTION_ID = mmt1.TRANSACTION_ID
       AND    mmt2.TRANSACTION_TYPE_ID IN (11, 14)
       AND    mmt2.ORGANIZATION_ID = Org_id
       GROUP BY trunc(mmt1.TRANSACTION_DATE), mmt1.ORGANIZATION_ID, mmt1.INVENTORY_ITEM_ID, mmt1.COST_GROUP_ID,
              mmt1.REVISION, mmt1.SUBINVENTORY_CODE, mmt1.LOCATOR_ID
  )
  GROUP BY TRANSACTION_DATE, ORGANIZATION_ID, INVENTORY_ITEM_ID, COST_GROUP_ID, REVISION, SUBINVENTORY_CODE, LOCATOR_ID;
Line: 2947

  SELECT   TRANSACTION_DATE,
           ORGANIZATION_ID,
           INVENTORY_ITEM_ID,
           COST_GROUP_ID,
           REVISION,
           LOT_NUMBER,
           SUBINVENTORY_CODE,
           LOCATOR_ID,
           sum(BASE_TRANSACTION_VALUE)BASE_TRANSACTION_VALUE
  FROM
  (
     /* Regular Sales Transactions (no logical flow)*/
     SELECT   trunc(mmt.TRANSACTION_DATE)TRANSACTION_DATE,
              mmt.ORGANIZATION_ID,
              mmt.INVENTORY_ITEM_ID,
              mmt.COST_GROUP_ID,
              mmt.REVISION,
              mtln.LOT_NUMBER,
              mmt.SUBINVENTORY_CODE,
              mmt.LOCATOR_ID,
              sum(mta.BASE_TRANSACTION_VALUE)BASE_TRANSACTION_VALUE
     FROM     MTL_MATERIAL_TRANSACTIONS mmt,
              MTL_SYSTEM_ITEMS  msi,
              MTL_TRANSACTION_LOT_NUMBERS mtln,
              MTL_TRANSACTION_ACCOUNTS mta
     WHERE    mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
       AND    mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
       AND    mmt.ORGANIZATION_ID=Org_id
       AND    mmt.TRANSACTION_ID = mtln.TRANSACTION_ID
       AND    msi.LOT_CONTROL_CODE = 2
       AND    mmt.TRANSACTION_ID = mta.TRANSACTION_ID
       AND    ((mmt.TRANSACTION_ACTION_ID IN (1,2,3,21)
                AND mmt.PRIMARY_QUANTITY < 0
                AND mmt.TRANSACTION_SOURCE_TYPE_ID <> 1)
              OR (mmt.TRANSACTION_ACTION_ID = 27
                  AND mmt.TRANSACTION_SOURCE_TYPE_ID IN (5,12)))
       AND    mta.ACCOUNTING_LINE_TYPE = 1
       AND    mmt.TRANSACTION_DATE >= p_from_date
       AND    mmt.TRANSACTION_DATE <= p_to_date
       AND    mmt.ORGANIZATION_ID =  NVL(mmt.OWNING_ORGANIZATION_ID,mmt.ORGANIZATION_ID)
       AND    NVL(mmt.OWNING_TP_TYPE,2) = 2
     GROUP BY trunc(mmt.TRANSACTION_DATE), mmt.ORGANIZATION_ID, mmt.INVENTORY_ITEM_ID, mmt.COST_GROUP_ID,
              mmt.REVISION, mtln.lot_number, mmt.SUBINVENTORY_CODE, mmt.LOCATOR_ID
  UNION
     /* Sales Orders and RMA Receipts in Internal Drop Ship to Customer*/
     SELECT   trunc(mmt1.TRANSACTION_DATE)TRANSACTION_DATE,
              mmt1.ORGANIZATION_ID,
              Mmt1.INVENTORY_ITEM_ID,
              Mmt1.COST_GROUP_ID,
              Mmt1.REVISION,
              mtln.LOT_NUMBER,
              Mmt1.SUBINVENTORY_CODE,
              Mmt1.LOCATOR_ID,
              sum(mta.BASE_TRANSACTION_VALUE)BASE_TRANSACTION_VALUE
     FROM     MTL_MATERIAL_TRANSACTIONS mmt1,   --Parent Physical Txns
              MTL_MATERIAL_TRANSACTIONS mmt2,   --Logical (Child) Txns
              MTL_SYSTEM_ITEMS  msi,
              MTL_TRANSACTION_LOT_NUMBERS mtln,
              MTL_TRANSACTION_ACCOUNTS mta
     WHERE    mmt1.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
       AND    mmt1.ORGANIZATION_ID=msi.ORGANIZATION_ID
       AND    mmt1.ORGANIZATION_ID=Org_id
       AND    mmt1.TRANSACTION_ID = mtln.TRANSACTION_ID
       AND    msi.LOT_CONTROL_CODE = 2
       AND    mmt1.TRANSACTION_ACTION_ID IN (1,27)
       AND    mmt1.TRANSACTION_SOURCE_TYPE_ID IN (2,12)
       AND    mmt1.TRANSACTION_DATE >= p_from_date
       AND    mmt1.TRANSACTION_DATE <= p_to_date
       AND    mmt2.TRANSACTION_ID = mta.TRANSACTION_ID
       AND    mta.ACCOUNTING_LINE_TYPE = 1
       /* logical txn triggered by this parent txn*/
       AND    mmt2.PARENT_TRANSACTION_ID = mmt1.TRANSACTION_ID
       AND    mmt2.TRANSACTION_TYPE_ID IN (11,14)
       AND    mmt2.ORGANIZATION_ID=org_id
     GROUP BY trunc(mmt1.TRANSACTION_DATE), mmt1.ORGANIZATION_ID, mmt1.INVENTORY_ITEM_ID, mmt1.COST_GROUP_ID,
              mmt1.REVISION,  mtln.LOT_NUMBER, mmt1.SUBINVENTORY_CODE, mmt1.LOCATOR_ID
  )
  GROUP BY TRANSACTION_DATE, ORGANIZATION_ID, INVENTORY_ITEM_ID, COST_GROUP_ID,
           LOT_NUMBER, REVISION, SUBINVENTORY_CODE, LOCATOR_ID;
Line: 3055

      Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'tot_issues_qty',
            p_total1          => total_qty,
            selector          => 1,
            success           => status);
Line: 3100

        Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_lot_number      => l_lot_number,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'tot_issues_qty',
            p_total1          => total_qty,
            selector          => 1,
            success           => status);
Line: 3145

      Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'tot_issues_val_b',
            p_total1          => total_value,
            selector          => 1,
            success           => status);
Line: 3189

        Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_lot_number      => l_lot_number,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'tot_issues_val_b',
            p_total1          => total_value,
            selector          => 1,
            success           => status);
Line: 3244

   SELECT trunc(mmt.TRANSACTION_DATE),
          mmt.ORGANIZATION_ID,
          mmt.INVENTORY_ITEM_ID,
          mmt.COST_GROUP_ID,
          mmt.REVISION,
          mmt.SUBINVENTORY_CODE,
          mmt.LOCATOR_ID,
          sum(mmt.PRIMARY_QUANTITY)
     FROM MTL_MATERIAL_TRANSACTIONS mmt,
          MTL_SYSTEM_ITEMS  msi
    WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
      AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
      AND mmt.ORGANIZATION_ID=Org_id
      AND msi.LOT_CONTROL_CODE = 1
      AND (  (mmt.transaction_action_id in (2,3,12)
	      AND mmt.primary_quantity >0 )
          OR ( mmt.transaction_action_id in (4,8))
          OR (mmt.transaction_action_id in (27,29)
	      AND mmt.transaction_source_type_id in (3,6,13,1))
          OR (mmt.transaction_action_id in (31,32)
	      AND mmt.transaction_source_type_id=5)
	  OR  (mmt.transaction_action_id =1 and mmt.transaction_source_type_id =1))
      AND mmt.transaction_date >= p_from_date
      AND mmt.transaction_date <= p_to_date
      AND MMT.organization_id =  NVL(MMT.owning_organization_id,MMT.organization_id)
      AND NVL(MMT.OWNING_TP_TYPE,2) = 2
 GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
          mmt.REVISION,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 3275

   SELECT   trunc(mmt.TRANSACTION_DATE),
         mmt.ORGANIZATION_ID,
         mmt.INVENTORY_ITEM_ID,
         mmt.COST_GROUP_ID,
         mmt.REVISION,
         mtln.LOT_NUMBER,
         mmt.SUBINVENTORY_CODE,
         mmt.LOCATOR_ID,
         sum(mtln.PRIMARY_QUANTITY)
    FROM MTL_MATERIAL_TRANSACTIONS mmt,
         MTL_SYSTEM_ITEMS  msi,
         MTL_TRANSACTION_LOT_NUMBERS mtln
   WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
     AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
     AND mmt.transaction_id = mtln.transaction_id
     AND mmt.ORGANIZATION_ID=Org_id
     AND msi.LOT_CONTROL_CODE = 2
     AND (  (mmt.transaction_action_id in (2,3,12)
	      AND mmt.primary_quantity >0 )
          OR ( mmt.transaction_action_id in (4,8))
          OR (mmt.transaction_action_id in (27,29)
	      AND mmt.transaction_source_type_id in (3,6,13,1))
          OR (mmt.transaction_action_id in (31,32)
	      AND mmt.transaction_source_type_id=5)
	  OR  (mmt.transaction_action_id =1 and mmt.transaction_source_type_id =1))
     AND mmt.transaction_date >= p_from_date
     AND mmt.transaction_date <= p_to_date
     AND MMT.organization_id =  NVL(MMT.owning_organization_id,MMT.organization_id)
     AND NVL(MMT.OWNING_TP_TYPE,2) = 2
GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
         mmt.REVISION,mtln.lot_number,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 3310

   SELECT trunc(mmt.TRANSACTION_DATE),
          mmt.ORGANIZATION_ID,
          mmt.INVENTORY_ITEM_ID,
          mmt.COST_GROUP_ID,
          mmt.REVISION,
          mmt.SUBINVENTORY_CODE,
          mmt.LOCATOR_ID,
          sum(mta.BASE_TRANSACTION_VALUE)
     FROM MTL_MATERIAL_TRANSACTIONS mmt,
          MTL_SYSTEM_ITEMS  msi,
	  MTL_TRANSACTION_ACCOUNTS mta
    WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
      AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
      AND mmt.ORGANIZATION_ID=Org_id
      AND msi.LOT_CONTROL_CODE = 1
      AND mmt.transaction_id = mta.transaction_id
      AND mta.accounting_line_type = 1
      AND (  (mmt.transaction_action_id in (2,3,12)
	      AND mmt.primary_quantity >0 )
          OR ( mmt.transaction_action_id in (4,8))
          OR (mmt.transaction_action_id in (27,29)
	      AND mmt.transaction_source_type_id in (3,6,13,1))
          OR (mmt.transaction_action_id in (31,32)
	      AND mmt.transaction_source_type_id=5)
	  OR  (mmt.transaction_action_id =1 and mmt.transaction_source_type_id =1))
      AND mmt.transaction_date >= p_from_date
      AND mmt.transaction_date <= p_to_date
      AND MMT.organization_id =  NVL(MMT.owning_organization_id,MMT.organization_id)
      AND NVL(MMT.OWNING_TP_TYPE,2) = 2
 GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
          mmt.REVISION,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 3345

   SELECT   trunc(mmt.TRANSACTION_DATE),
         mmt.ORGANIZATION_ID,
         mmt.INVENTORY_ITEM_ID,
         mmt.COST_GROUP_ID,
         mmt.REVISION,
         mtln.LOT_NUMBER,
         mmt.SUBINVENTORY_CODE,
         mmt.LOCATOR_ID,
         sum(mta.BASE_TRANSACTION_VALUE)
    FROM MTL_MATERIAL_TRANSACTIONS mmt,
         MTL_SYSTEM_ITEMS  msi,
         MTL_TRANSACTION_LOT_NUMBERS mtln,
	 MTL_TRANSACTION_ACCOUNTS mta
   WHERE mmt.INVENTORY_ITEM_ID=msi.INVENTORY_ITEM_ID
     AND mmt.ORGANIZATION_ID=msi.ORGANIZATION_ID
     AND mmt.ORGANIZATION_ID=Org_id
     AND mmt.transaction_id = mtln.transaction_id
     AND msi.LOT_CONTROL_CODE = 2
     AND mmt.transaction_id = mta.transaction_id
     AND (  (mmt.transaction_action_id in (2,3,12)
	      AND mmt.primary_quantity >0 )
          OR ( mmt.transaction_action_id in (4,8))
          OR (mmt.transaction_action_id in (27,29)
	      AND mmt.transaction_source_type_id in (3,6,13,1))
          OR (mmt.transaction_action_id in (31,32)
	      AND mmt.transaction_source_type_id=5)
	  OR  (mmt.transaction_action_id =1 and mmt.transaction_source_type_id =1))
     AND mta.accounting_line_type = 1
     AND mmt.transaction_date >= p_from_date
     AND mmt.transaction_date <= p_to_date
     AND MMT.organization_id =  NVL(MMT.owning_organization_id,MMT.organization_id)
     AND NVL(MMT.OWNING_TP_TYPE,2) = 2
GROUP BY trunc(mmt.TRANSACTION_DATE),mmt.ORGANIZATION_ID,mmt.INVENTORY_ITEM_ID,mmt.COST_GROUP_ID,
         mmt.REVISION,mtln.lot_number,mmt.SUBINVENTORY_CODE,mmt.LOCATOR_ID;
Line: 3406

        Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'total_rec_qty',
            p_total1          => total_qty,
            selector          => 1,
            success           => status);
Line: 3451

        Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_lot_number      => l_lot_number,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'total_rec_qty',
            p_total1          => total_qty,
            selector          => 1,
            success           => status);
Line: 3495

      Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'total_rec_val_b',
            p_total1          => total_value,
            selector          => 1,
            success           => status);
Line: 3539

        Insert_update_push_log(
            p_trx_date => l_trx_date ,
            p_organization_id => l_organization_id,
            p_item_id         => l_item_id,
            p_cost_group_id   => l_cost_group_id,
            p_revision        => l_revision,
            p_lot_number      => l_lot_number,
            p_subinventory    => l_subinventory,
            p_locator         => l_locator,
            p_col_name1       => 'total_rec_val_b',
            p_total1          => total_value,
            selector          => 1,
            success           => status);
Line: 3569

PROCEDURE    Insert_update_push_log
----------------------------------------------*/

  PROCEDURE Insert_update_push_log(
            p_trx_date IN Date,
            p_organization_id IN Number,
            p_item_id         IN Number default NULL,
            p_cost_group_id   IN Number default NULL,
            p_revision        IN Varchar2 default NULL,
            p_lot_number      IN Varchar2 default NULL,
            p_subinventory    IN Varchar2 default NULL,
            p_locator         IN Number default NULL,
            p_item_status     IN Varchar2 default NULL,
            p_item_type       IN Varchar2 default NULL,
            p_base_uom        IN Varchar2 default NULL,
            p_col_name1       IN Varchar2 default NULL,
            p_total1          IN Number default NULL,
            p_col_name2       IN Varchar2 default NULL,
            p_total2          IN Number default NULL,
            p_col_name3       IN Varchar2 default NULL,
            p_total3          IN Number default NULL,
            p_col_name4       IN Varchar2 default NULL,
            p_total4          IN Number default NULL,
            p_col_name5       IN Varchar2 default NULL,
            p_total5          IN Number default NULL,
            p_col_name6       IN Varchar2 default NULL,
            p_total6          IN Number default NULL,
            selector          IN Number default NULL,
            success           OUT nocopy Number)
IS

  l_pk varchar2(100):=null;
Line: 3610

     SELECT 1
       FROM opi_ids_push_log
      WHERE IDS_KEY=l_pk;
Line: 3615

        SELECT physical_location_id
          FROM mtl_item_locations
         WHERE organization_id = p_organization_id
           AND inventory_location_id <> physical_location_id
           AND inventory_location_id = p_locator;
Line: 3647

  SELECT nvl(PROJECT_REFERENCE_ENABLED,2) into pjm_org
    FROM mtl_parameters
   WHERE organization_id = p_organization_id;
Line: 3677

     IF(selector = 1) then
	l_query := 'UPDATE opi_ids_push_log SET push_flag = 1,' || p_col_name1
	  || ' = ' || 'nvl(:p_total1,0) WHERE IDS_KEY = :l_pk ';
Line: 3683

	l_query := 'UPDATE opi_ids_push_log SET  push_flag = 1, '
	  || p_col_name1 || ' = nvl(:p_total1,0),' || p_col_name2 ||
	  ' =  nvl(:p_total2,0), ' || p_col_name3 || ' = nvl( :p_total3,0), '
	  || p_col_name4 || ' = nvl(:p_total4,0), '|| p_col_name5 ||
	  ' = nvl(:p_total5,0), '|| p_col_name6 || ' = nvl(:p_total6,0) '
	  || ' WHERE IDS_KEY = :l_pk ';
Line: 3695

     l_query := 'INSERT INTO opi_ids_push_log(IDS_KEY,trx_date,organization_id,Push_flag';
Line: 3701

     IF(selector = 1) then
	l_query := l_query || ' ,' || p_col_name1;
Line: 3714

     IF(selector = 1) then
	l_query := l_query || ', Nvl(:p_total1,0) )';
Line: 3735

    edw_log.put_line('Error in Insert_update_push_log prodedure ');
Line: 3738

END Insert_update_push_log;