DBA Data[Home] [Help]

APPS.WMS_RULES_WORKBENCH_PVT SQL Statements

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

Line: 105

g_pkg_name constant VARCHAR2(50)   := 'WMS_SELECTION_CRITERIA_PVT';
Line: 114

		 SELECT criterion_name
		    INTO l_return_type_name
		 FROM wms_crossdock_criteria_vl
		 WHERE  criterion_id=p_return_type_id
		 AND criterion_type = 1  ;
Line: 121

		 SELECT criterion_name
		    INTO l_return_type_name
		 FROM wms_crossdock_criteria_vl
		 WHERE  criterion_id=p_return_type_id
		 AND criterion_type = 2;
Line: 128

		SELECT cost_group
		INTO l_return_type_name
		FROM  CST_COST_GROUPS
		WHERE cost_group_id=p_return_type_id
		AND organization_id = p_org_id;
Line: 135

      SELECT meaning
      INTO l_return_type_name
      FROM mfg_lookups_v
      WHERE lookup_type = 'WMS_CARTONIZATION_ALGORITHMS'
      AND lookup_code = p_return_type_id;
Line: 145

      select distinct name into l_return_type_name
        from wms_strategies_vl
       where organization_id in (p_org_id, -1)
          and type_code   = p_rule_type_code
          and strategy_id = p_return_type_id;
Line: 152

        select name into l_return_type_name
        from wms_rules_vl
       where organization_id in (p_org_id, -1)
         and rule_id = p_return_type_id;
Line: 175

  g_pkg_name constant VARCHAR2(50)   := 'WMS_SELECTION_CRITERIA_PVT';
Line: 181

 /*select rc.customer_name
   into l_customer_name
        from ra_customers      rc
        where rc.customer_id  = p_customer_id;*/
Line: 186

/*   SELECT  distinct substrb ( PARTY.PARTY_NAME,  1,  50 )
     INTO l_customer_name
     FROM HZ_PARTIES PARTY,
          HZ_CUST_ACCOUNTS CUST_ACCT
   WHERE  CUST_ACCT.PARTY_ID = PARTY.PARTY_ID
    AND  PARTY.PARTY_ID = p_customer_id;   */
Line: 194

    SELECT  distinct substrb ( PARTY.PARTY_NAME,  1,  50 )
     INTO l_customer_name
     FROM HZ_PARTIES PARTY,
          HZ_CUST_ACCOUNTS CUST_ACCT
   WHERE  CUST_ACCT.PARTY_ID = PARTY.PARTY_ID
    AND CUST_ACCT.CUST_ACCOUNT_ID  = p_customer_id;
Line: 214

g_pkg_name constant VARCHAR2(50)   := 'WMS_SELECTION_CRITERIA_PVT';
Line: 221

select ood.organization_code
  into l_organization_code
          from org_organization_definitions ood
         where sysdate < nvl(ood.disable_date,sysdate+1)
           and ood.organization_id = p_organization_id ;
Line: 239

 g_pkg_name constant VARCHAR2(50)   := 'WMS_SELECTION_CRITERIA_PVT';
Line: 245

 select ofv.freight_code_tl
  into l_freight_code_name
   from org_freight ofv
  where ofv.organization_id = p_org_id
    and ofv.freight_code    = p_freight_code
    and sysdate < nvl(ofv.disable_date,sysdate+1);
Line: 265

 g_pkg_name constant VARCHAR2(50)   := 'WMS_SELECTION_CRITERIA_PVT';
Line: 272

select msik.concatenated_segments into l_item
from mtl_system_items_kfv msik
where msik.organization_id = p_org_id
  and msik.inventory_item_id = p_inventory_item_id;
Line: 290

  g_pkg_name constant 	VARCHAR2(50)   := 'WMS_SELECTION_CRITERIA_PVT';
Line: 297

      select maag.assignment_group_name||' / '|| mac.abc_class_name
        into l_abc_group_class
      from mtl_abc_classes mac,
           mtl_abc_assignment_groups maag ,
           MTL_ABC_ASSGN_GROUP_CLASSES magc
      where  maag.organization_id 	= mac.organization_id
        and  magc.assignment_group_id 	= maag.assignment_group_id
        and  magc.abc_class_id 		= mac.abc_class_id
        and  mac.organization_id 	= p_org_id
        and  maag.assignment_group_id 	= p_assignment_group_id
        and  mac.abc_class_id 		= p_class_id ;
Line: 322

 g_pkg_name constant VARCHAR2(50)   := 'WMS_SELECTION_CRITERIA_PVT';
Line: 330

 Select mcs.category_set_name||' / '||mck.concatenated_segments into l_category_set_name
   From mtl_categories_kfv mck
       ,mtl_category_sets_vl mcs
       ,mtl_category_set_valid_cats mcsvc
  Where mcs.category_set_id = mcsvc.category_set_id
    and mck.category_id = mcsvc.category_id
    and mcsvc.category_set_id = p_category_set_id
    and mcsvc.category_id =  p_category_id; */
Line: 341

SELECT mcs.CATEGORY_SET_NAME||' / '|| mck.CONCATENATED_SEGMENTS  into l_category_set_name
    FROM MTL_CATEGORIES_KFV mck
    ,MTL_CATEGORIES_VL mc
    ,MTL_CATEGORY_SETS_VL mcs
    ,( SELECT mic.ORGANIZATION_ID
    ,mic.CATEGORY_SET_ID
    ,mic.CATEGORY_ID
    FROM MTL_ITEM_CATEGORIES mic
    WHERE mic.ORGANIZATION_ID = p_org_id
    GROUP BY mic.ORGANIZATION_ID
    ,mic.CATEGORY_SET_ID
    ,mic.CATEGORY_ID ) x
    WHERE mcs.CATEGORY_SET_ID = x.CATEGORY_SET_ID
    AND mc.CATEGORY_ID = mck.CATEGORY_ID
    AND mck.CATEGORY_ID = x.CATEGORY_ID
    AND x.CATEGORY_SET_ID = p_category_set_id
    AND x.CATEGORY_ID =  p_category_id;
Line: 370

 g_pkg_name constant   VARCHAR2(50)   := 'WMS_SELECTION_CRITERIA_PVT';
Line: 377

select ottv.name into l_order_type_name
  from oe_transaction_types_vl ottv
 where ottv.transaction_type_id = p_transaction_type_id;
Line: 391

 g_pkg_name constant VARCHAR2(50)   := 'WMS_SELECTION_CRITERIA_PVT';
Line: 398

 select  distinct ppov.project_name into l_project_name
  from pjm_projects_mtll_v ppov
 where ppov.project_id = p_project_id;
Line: 413

 g_pkg_name constant VARCHAR2(50)   := 'WMS_SELECTION_CRITERIA_PVT';
Line: 421

 SELECT  nvl(p.project_number, '') || ' / ' || nvl(ptev.TASK_NUMBER, '')   into l_task_name
 FROM  pjm_tasks_mtll_v  ptev,  pjm_projects_mtll_v p
 where p.project_id = ptev.project_id
   and ptev.project_id  =  p_project_id
   and ptev.task_id  = p_task_id;
Line: 427

/* select ppev.project_name||' / '||ptev.indented_task_name
  into l_task_name
  from pa_tasks_expend_v ptev
      ,pa_projects_expend_v ppev
 where ptev.project_id = ppev.project_id
   and ppev.project_id = p_project_id
   and ptev.task_id    = p_task_id; */
Line: 446

 g_pkg_name constant VARCHAR2(50)   := 'WMS_SELECTION_CRITERIA_PVT';
Line: 453

  SELECT  pv.vendor_name
    INTO  l_vendor_name
    FROM PO_VENDORS pv
	,PO_VENDOR_SITES_ALL pvsa
	,ORG_ORGANIZATION_DEFINITIONS ood
   WHERE ood.ORGANIZATION_ID =  p_org_id
     AND nvl(pvsa.ORG_ID,-99) = nvl(ood.OPERATING_UNIT,-99)
     AND pvsa.PURCHASING_SITE_FLAG = 'Y'
     AND sysdate < nvl(pvsa.INACTIVE_DATE, sysdate + 1)
     AND pv.VENDOR_ID = pvsa.VENDOR_ID
     AND pvsa.vendor_id  = p_vendor_id
   GROUP BY pv.VENDOR_NAME;
Line: 477

 g_pkg_name constant VARCHAR2(50)   := 'wms_selection_criteria_pvt';
Line: 484

  select fu.user_name
    into l_user_name
    from fnd_user fu
   where sysdate < nvl(fu.end_date,sysdate+1)
     and fu.user_id = p_user_id;
Line: 500

 g_pkg_name constant 		VARCHAR2(50)   	:= 'WMS_SELECTION_CRITERIA_PVT';
Line: 507

 select ml.meaning
   into l_transaction_action_name
   from mfg_lookups ml
  where ml.lookup_type = 'MTL_TRANSACTION_ACTION'
    and ml.lookup_code = p_transaction_action_id ;
Line: 524

 g_pkg_name constant 	VARCHAR2(50)   	:= 'WMS_SELECTION_CRITERIA_PVT';
Line: 531

  select mtr.reason_name
    into l_reason_name
  from mtl_transaction_reasons mtr
  where sysdate < nvl(mtr.disable_date,sysdate+1)
    and mtr.reason_id = p_reason_id;
Line: 547

 g_pkg_name constant 		VARCHAR2(50)   := 'WMS_SELECTION_CRITERIA_PVT';
Line: 554

   select mtst.transaction_source_type_name
     into l_transaction_source_name
     from mtl_txn_source_types mtst
    where sysdate < nvl(mtst.disable_date,sysdate+1)
      and mtst.transaction_source_type_id =  p_transaction_source_type_id;
Line: 570

 g_pkg_name constant 		VARCHAR2(50)   	:= 'WMS_SELECTION_CRITERIA_PVT';
Line: 577

  select mtt.transaction_type_name
    into l_transaction_type_name
    from mtl_transaction_types mtt
   where sysdate < nvl(mtt.disable_date,sysdate+1)
     and mtt.transaction_type_id =  p_transaction_type_id;
Line: 594

 g_pkg_name constant 	VARCHAR2(50)   := 'WMS_SELECTION_CRITERIA_PVT';
Line: 601

 select muom.unit_of_measure_tl
   into l_unit_of_measure
 from mtl_units_of_measure muom
where sysdate < nvl(muom.disable_date,sysdate+1)
  and muom.uom_code =  p_uom_code;
Line: 617

 g_pkg_name constant 	 VARCHAR2(50)   := 'WMS_SELECTION_CRITERIA_PVT';
Line: 624

  select muc.uom_class_tl
    into l_uom_class_name
    from mtl_uom_classes muc
    where muc.uom_class = p_uom_class;
Line: 640

 g_pkg_name constant 	 VARCHAR2(50)   := 'WMS_SELECTION_CRITERIA_PVT';
Line: 646

 select ml.meaning into l_item_type
   from fnd_common_lookups ml
where ml.lookup_type = 'ITEM_TYPE'
  and ml.lookup_code = p_item_type_code;
Line: 673

   g_pkg_name constant 	 VARCHAR2(50)    := 'WMS_SELECTION_CRITERIA_PVT';
Line: 680

   l_rec_wsct   WMS_SELECTION_CRITERIA_TXN%ROWTYPE;
Line: 684

   l_sequence_number 		wms_selection_criteria_txn.sequence_number%type;
Line: 685

   l_return_type_code		wms_selection_criteria_txn.return_type_code%type;
Line: 686

   l_return_type_id		wms_selection_criteria_txn.return_type_id%type;
Line: 687

   l_from_organization_id	wms_selection_criteria_txn.from_organization_id%type;
Line: 688

   l_from_subinventory_name	wms_selection_criteria_txn.from_subinventory_name%type default null;
Line: 689

   l_to_organization_id      	wms_selection_criteria_txn.to_organization_id%type;
Line: 690

   l_to_subinventory_name	wms_selection_criteria_txn.to_subinventory_name%type;
Line: 691

   l_customer_id 		wms_selection_criteria_txn.customer_id%type;
Line: 692

   l_freight_code 		wms_selection_criteria_txn.freight_code%type;
Line: 693

   l_inventory_item_id 		wms_selection_criteria_txn.inventory_item_id%type;
Line: 694

   l_item_type 			wms_selection_criteria_txn.item_type%type;
Line: 695

   l_order_type_id		wms_selection_criteria_txn.order_type_id%type;
Line: 696

   l_vendor_id			wms_selection_criteria_txn.vendor_id%type;
Line: 697

   l_project_id			wms_selection_criteria_txn.project_id%type;
Line: 698

   l_task_id			wms_selection_criteria_txn.task_id%type;
Line: 699

   l_user_id			wms_selection_criteria_txn.user_id%type;
Line: 700

   l_transaction_action_id	wms_selection_criteria_txn.transaction_action_id%type;
Line: 701

   l_reason_id 			wms_selection_criteria_txn.reason_id%type;
Line: 702

   l_transaction_source_type_id wms_selection_criteria_txn.transaction_source_type_id%type;
Line: 703

   l_transaction_type_id	wms_selection_criteria_txn.transaction_type_id%type;
Line: 704

   l_uom_code 			wms_selection_criteria_txn.uom_code%type;
Line: 705

   l_uom_class			wms_selection_criteria_txn.uom_class%type default null;
Line: 711

    cursor cur_stg_selection is
      select return_type_code, return_type_id, sequence_number
      from wms_selection_criteria_txn
     where  from_organization_id = l_from_organization_id
       	and rule_type_code = p_type_code
       	and enabled_flag = 1
       	and nvl(from_subinventory_name, l_from_subinventory_name) 	= l_from_subinventory_name
 	and nvl(to_organization_id, 	l_to_organization_id) 		= l_to_organization_id
 	and nvl(to_subinventory_name,	l_to_subinventory_name ) 	= l_to_subinventory_name
 	and nvl(customer_id,		l_customer_id) 			= l_customer_id
 	and nvl(freight_code,		l_freight_code) 		= l_freight_code
 	and nvl(inventory_item_id, 	l_inventory_item_id) 		= l_inventory_item_id
 	and nvl(item_type, 		l_item_type) 			= l_item_type
 	and nvl(order_type_id, 		l_order_type_id) 		= l_order_type_id
 	and nvl(vendor_id, 		l_vendor_id) 			= l_vendor_id
 	and nvl(project_id, 		l_project_id) 			= l_project_id
 	and nvl(task_id, 		l_task_id )			= l_task_id
 	and nvl(user_id, 		l_user_id ) 			= l_user_id
 	and nvl(transaction_action_id, 	l_transaction_action_id ) 	= l_transaction_action_id
 	and nvl(reason_id , 		l_reason_id ) 			= l_reason_id
 	and nvl(transaction_source_type_id, l_transaction_source_type_id) = l_transaction_source_type_id
 	and nvl(transaction_type_id, 	l_transaction_type_id) 		= l_transaction_type_id
 	and nvl(uom_code, 		l_uom_code) 			= l_uom_code
	and nvl(uom_class, 		l_uom_class) 			= l_uom_class
	and nvl(effective_from,to_date('01011900','ddmmyyyy')) 		<= trunc(sysdate)
        and nvl(effective_to,to_date('31124000','ddmmyyyy')) 		>= trunc(sysdate)
	and wms_datecheck_pvt.date_valid(l_from_organization_id,date_type_code,date_type_from,date_type_to,effective_from,effective_to) = 'Y' --Added bug 4081657
        and decode(category_id,null,'N', 'Y') =   decode(category_id,null,'N', WMS_RULES_WORKBENCH_PVT.get_Item_Cat(l_rec_mtrl.organization_id,
	                                                                                                            l_rec_mtrl.inventory_item_id,
	                              	                                                                            category_set_id,
	                              	                                                                            category_id )
	                              	                                                                            )
        and decode(abc_class_id,null,'N', 'Y') =  decode(abc_class_id,null,'N', WMS_RULES_WORKBENCH_PVT.get_group_class(l_rec_mtrl.inventory_item_id,
		                              	                                                 assignment_group_id,
		                              	                                                 abc_class_id)
		                              	                                                  )

	order by sequence_number;
Line: 796

          log_procedure(l_api_name,'','Start selection Criteria ');
Line: 846

     	l_user_id			:= nvl(l_rec_mtrl.last_updated_by, -999);
Line: 899

        OPEN cur_stg_selection;
Line: 900

        FETCH cur_stg_selection
        INTO l_return_type_code, l_return_type_id, l_sequence_number ;
Line: 903

        If (cur_stg_selection%NOTFOUND) Then
            --3224420close cur_stg_selection;
Line: 906

               log_event(l_api_name,'','stg_selection cursor not found ');
Line: 926

         If (cur_stg_selection%FOUND) Then

             if l_debug =1 then
                log_event(l_api_name,'',' Open/fetching stg_selection cursor');
Line: 994

             If cur_stg_selection%ISOPEN then
                CLOSE cur_stg_selection;
Line: 998

       If cur_stg_selection%ISOPEN then
                 CLOSE cur_stg_selection;
Line: 1007

          If cur_stg_selection%ISOPEN then
              CLOSE cur_stg_selection;
Line: 1015

               log_error(l_api_name, 'error', 'Error in selection Criteria - ' ||
      		x_msg_data);
Line: 1021

         If cur_stg_selection%ISOPEN then
              CLOSE cur_stg_selection;
Line: 1029

		'in selection Criteria - ' || x_msg_data);
Line: 1032

               log_event(l_api_name,'',' Exception in selection Criteria');
Line: 1036

         If cur_stg_selection%ISOPEN then
              CLOSE cur_stg_selection;
Line: 1061

     g_pkg_name constant 	 VARCHAR2(50)    := 'WMS_SELECTION_CRITERIA_PVT';
Line: 1067

     l_rec_wsct   WMS_SELECTION_CRITERIA_TXN%ROWTYPE;
Line: 1087

        last_updated_by          mtl_material_transactions_temp.last_updated_by%TYPE
      );
Line: 1092

     l_sequence_number 		wms_selection_criteria_txn.sequence_number%type;
Line: 1093

     l_return_type_code		wms_selection_criteria_txn.return_type_code%type;
Line: 1094

     l_return_type_id		wms_selection_criteria_txn.return_type_id%type;
Line: 1095

     l_from_organization_id	wms_selection_criteria_txn.from_organization_id%type;
Line: 1096

     l_from_subinventory_name	wms_selection_criteria_txn.from_subinventory_name%type default null;
Line: 1097

     l_to_organization_id      	wms_selection_criteria_txn.to_organization_id%type;
Line: 1098

     l_to_subinventory_name	wms_selection_criteria_txn.to_subinventory_name%type;
Line: 1099

     l_customer_id 		wms_selection_criteria_txn.customer_id%type;
Line: 1100

     l_freight_code 		wms_selection_criteria_txn.freight_code%type;
Line: 1101

     l_inventory_item_id 	wms_selection_criteria_txn.inventory_item_id%type;
Line: 1102

     l_item_type 		wms_selection_criteria_txn.item_type%type;
Line: 1103

     l_order_type_id		wms_selection_criteria_txn.order_type_id%type;
Line: 1104

     l_vendor_id		wms_selection_criteria_txn.vendor_id%type;
Line: 1105

     l_project_id		wms_selection_criteria_txn.project_id%type;
Line: 1106

     l_task_id			wms_selection_criteria_txn.task_id%type;
Line: 1107

     l_user_id			wms_selection_criteria_txn.user_id%type;
Line: 1108

     l_transaction_action_id	wms_selection_criteria_txn.transaction_action_id%type;
Line: 1109

     l_reason_id 		wms_selection_criteria_txn.reason_id%type;
Line: 1110

     l_transaction_source_type_id wms_selection_criteria_txn.transaction_source_type_id%type;
Line: 1111

     l_transaction_type_id	wms_selection_criteria_txn.transaction_type_id%type;
Line: 1112

     l_uom_code 		wms_selection_criteria_txn.uom_code%type;
Line: 1113

     l_uom_class		wms_selection_criteria_txn.uom_class%type default null;
Line: 1117

      cursor cur_stg_selection is
        select return_type_code, return_type_id, sequence_number
        from wms_selection_criteria_txn
      where  from_organization_id = l_from_organization_id
       	and rule_type_code = p_type_code
       	and enabled_flag = 1
   	and nvl(from_subinventory_name, l_from_subinventory_name) 	= l_from_subinventory_name
   	and nvl(to_organization_id, 	l_to_organization_id) 		= l_to_organization_id
   	and nvl(to_subinventory_name,	l_to_subinventory_name ) 	= l_to_subinventory_name
   	and nvl(customer_id,		l_customer_id) 			= l_customer_id
   	and nvl(freight_code,		l_freight_code) 		= l_freight_code
   	and nvl(inventory_item_id, 	l_inventory_item_id) 		= l_inventory_item_id
   	and nvl(item_type, 		l_item_type) 			= l_item_type
     	and nvl(order_type_id, 		l_order_type_id) 		= l_order_type_id
   	and nvl(vendor_id, 		l_vendor_id) 			= l_vendor_id
   	and nvl(project_id, 		l_project_id) 			= l_project_id
   	and nvl(task_id, 		l_task_id )			= l_task_id
   	and nvl(user_id, 		l_user_id ) 			= l_user_id
   	and nvl(transaction_action_id, 	l_transaction_action_id ) 	= l_transaction_action_id
   	and nvl(reason_id , 		l_reason_id ) 			= l_reason_id
   	and nvl(transaction_source_type_id, l_transaction_source_type_id) = l_transaction_source_type_id
   	and nvl(transaction_type_id, 	l_transaction_type_id) 		= l_transaction_type_id
   	and nvl(uom_code, 		l_uom_code) 			= l_uom_code
  	and nvl(uom_class, 		l_uom_class) 			= l_uom_class
  	and nvl(effective_from,to_date('01011900','ddmmyyyy')) 		<= trunc(sysdate)
        and nvl(effective_to,to_date('31124000','ddmmyyyy')) 		>= trunc(sysdate)
	and wms_datecheck_pvt.date_valid(l_from_organization_id,date_type_code,date_type_from,date_type_to,effective_from,effective_to) = 'Y' --Added bug 4081657
        and decode(category_id,null, 'N', 'Y') =   decode(category_id, null, 'N', WMS_RULES_WORKBENCH_PVT.get_Item_Cat(l_rec_mtrl.organization_id,
	                                                                                                              l_rec_mtrl.inventory_item_id ,
	                              	                                                                              category_set_id,
	                              	                                                                              category_id ))
  	and decode(abc_class_id,null,'N', 'Y') =   decode(abc_class_id,null,'N',  WMS_RULES_WORKBENCH_PVT.get_group_class(l_rec_mtrl.inventory_item_id,
												                          assignment_group_id,
												                          abc_class_id))
  	order by sequence_number;
Line: 1155

           SELECT
  	    mmtt.transaction_temp_id ,
            mmtt.organization_id,
  	    mmtt.inventory_item_id,
  	    mmtt.revision,
  	    decode(  mmtt.transaction_action_id,
  	           1,mmtt.subinventory_code,
  	           2,mmtt.subinventory_code,
  	           3,mmtt.subinventory_code,
  	           21,mmtt.subinventory_code,
  	           28,mmtt.subinventory_code,
  	           29,mmtt.subinventory_code,
  	           32,mmtt.subinventory_code,
  	           34,mmtt.subinventory_code,
                   NULL),
   	    decode(transaction_action_id, 1,
                                    NULL, 2,
                   transfer_subinventory, 3,
                   transfer_subinventory, 21,
                                NULL, 28,
                   transfer_subinventory,
                                      29, NULL, 32, NULL,34, NULL, subinventory_code),
  	    mmtt.transaction_uom,
  	    mmtt.reason_id,
  	    mmtt.project_id,
  	    mmtt.task_id,
  	    mmtt.transaction_type_id,
  	    mmtt.transaction_source_type_id,
  	    decode(mmtt.transaction_action_id, 3, mmtt.transfer_organization, 21, mmtt.transfer_organization, mmtt.organization_id),
  	    mmtt.transaction_reference,
	    decode(mmtt.source_code,'RCV', mmtt.rcv_transaction_id,to_number(NULL)),
	    mmtt.transaction_action_id,
  	    mmtt.last_updated_by
  	    from mtl_material_transactions_temp mmtt
  	    where mmtt.transaction_temp_id  = p_transaction_temp_id;
Line: 1274

       	l_user_id			:= nvl(l_rec_mtrl.last_updated_by, -999);
Line: 1320

           OPEN cur_stg_selection;
Line: 1321

           FETCH cur_stg_selection INTO  l_return_type_code, l_return_type_id, l_sequence_number;
Line: 1323

            If (cur_stg_selection%NOTFOUND) Then
               --commenting out for 3224420 close cur_stg_selection;
Line: 1326

                  log_event(l_api_name,'','stg_selection cursor not found ');
Line: 1339

            If (cur_stg_selection%FOUND) Then
               x_return_type      := l_return_type_code;
Line: 1346

                  log_event(l_api_name, '',' Open/fetching  stg_selection cursor');
Line: 1366

               IF cur_stg_selection%ISOPEN then
                  CLOSE cur_stg_selection;
Line: 1373

	    IF (cur_stg_selection%ISOPEN) then
	     CLOSE cur_stg_selection;
Line: 1384

              IF cur_stg_selection%ISOPEN then
                 CLOSE cur_stg_selection;
Line: 1390

              log_error(l_api_name, 'error', 'Error in selection Criteria - ' ||
        		x_msg_data);
Line: 1398

             IF cur_stg_selection%ISOPEN then
                 CLOSE cur_stg_selection;
Line: 1409

              IF cur_stg_selection%ISOPEN then
                 CLOSE cur_stg_selection;
Line: 1414

             log_event(l_api_name,'',' Exception in selection Criteria');
Line: 1427

        g_pkg_name constant VARCHAR2(50)   := 'WMS_SELECTION_CRITERIA_PVT';
Line: 1437

          select  msi.item_type into l_item_type
            from mtl_system_items msi
            where msi.inventory_item_id = p_inventory_item_id
              and msi.organization_id = p_org_id;
Line: 1459

    g_pkg_name constant VARCHAR2(50)   := 'WMS_SELECTION_CRITERIA_PVT';
Line: 1474

      select 'Y' INTO l_category_exist  FROM dual
       where  exists
       (select mic.category_id
	 from mtl_item_categories mic
	where mic.organization_id   = p_org_id
	  and mic.inventory_item_id = p_inventory_item_id
	  and mic.category_set_id   = p_category_set_id
	  and mic.category_id       = p_category_id);
Line: 1495

    g_pkg_name constant VARCHAR2(50)    := 'WMS_SELECTION_CRITERIA_PVT';
Line: 1509

      select 'Y' INTO l_group_class_exist   FROM dual
       where  exists
       (select abc_class_id
	 from mtl_abc_assignments
	where inventory_item_id    = p_inventory_item_id
	  and assignment_group_id  = p_assignment_group_id
	  and abc_class_id         = p_class_id );
Line: 1529

            g_pkg_name constant VARCHAR2(50)   := 'WMS_SELECTION_CRITERIA_PVT';
Line: 1538

	       select  muom.uom_class  into l_uom_class
	             from MTL_UNITS_OF_MEASURE muom
	            where  muom.uom_code = p_uom_code;
Line: 1553

     g_pkg_name constant VARCHAR2(50)   := 'WMS_SELECTION_CRITERIA_PVT';
Line: 1567

	    select   poh.vendor_id  into l_vendor_id
	     from po_headers_all poh,
	          po_lines_all pol,
	          po_line_locations_all pll
	              where poh.po_header_id = pol.po_header_id
	              and pll.po_header_id = pol.po_header_id
	              and pll.po_line_id   = pol.po_line_id
	              and pll.shipment_type = 'STANDARD'
                      and pll.line_location_id = p_reference_id ;
Line: 1578

           select  poh.vendor_id  into l_vendor_id
	     from po_headers_all poh,
	          po_lines_all pol,
	          po_distributions_all pod,
	          po_line_locations_all pll
	              where poh.po_header_id = pol.po_header_id
	              and pll.po_header_id = pol.po_header_id
	              and pll.po_line_id   = pol.po_line_id
	              and pod.po_header_id = pll.po_header_id
	              and pod.po_line_id   = pll.po_line_id
	              and pod.line_location_id = pll.line_location_id
	              and pll.shipment_type = 'STANDARD'
                      and pod.po_distribution_id = p_reference_id;
Line: 1592

             select  poh.vendor_id  into l_vendor_id
	       from po_headers_all poh,
	            po_lines_all pol,
	            rcv_transactions rct,
	            po_line_locations_all pll
	                where poh.po_header_id = pol.po_header_id
	                and pll.po_header_id = pol.po_header_id
	                and pll.po_line_id   = pol.po_line_id
	                and rct.po_header_id = pll.po_header_id
	                and rct.po_line_id   = pll.po_line_id
	                and rct.po_line_location_id = pll.line_location_id
	                and pll.shipment_type = 'STANDARD'
                        and rct.transaction_id  = p_reference_id;
Line: 1616

            g_pkg_name constant 	VARCHAR2(50)   := 'WMS_SELECTION_CRITERIA_PVT';
Line: 1630

      	        select nvl(mtrl.transaction_source_type_id,0) , nvl(mtrl.reference_id, 0)
      	            into  l_transaction_source_type_id, l_reference_id
	            from mtl_txn_request_lines  mtrl
	            where mtrl.line_id = p_move_order_line_id;
Line: 1645

               select /*+index (WDD WSH_DELIVERY_DETAILS_N7)*/ oh.order_type_id  into l_order_type_id
	         from oe_order_headers_all oh,
	              wsh_delivery_details wdd
	         where oh.header_id = wdd.source_header_id
	           and wdd.released_status = 'S'
	           and wdd.source_code = 'OE'
                   and wdd.move_order_line_id = p_move_order_line_id;
Line: 1660

                 select oh.order_type_id  into l_order_type_id
		   from oe_order_headers_all oh ,
		        oe_order_lines_all ol
		         where oh.header_id = ol.header_id
		         and ol.line_id =  l_reference_id ;
Line: 1680

        g_pkg_name constant 	VARCHAR2(50)   := 'WMS_SELECTION_CRITERIA_PVT';
Line: 1694

             SELECT nvl(trx_source_line_id, -999)
             INTO l_trx_source_line_id
             FROM mtl_material_Transactions_temp
             WHERE transaction_temp_id = p_transaction_temp_id
             AND transaction_source_type_id = INV_GLOBALS.G_SOURCETYPE_RMA
             AND transaction_action_id = INV_GLOBALS.G_ACTION_RECEIPT;
Line: 1710

             select customer_id, freight_carrier_code into l_customer_id, l_freight_code
             from WMS_TXN_CONTEXT_TEMP
             where line_id = p_transaction_temp_id;
Line: 1729

		 SELECT
		  hz.PARTY_ID,
		  oola.freight_carrier_code
	        INTO  l_customer_id,
	             l_freight_code
	        FROM  oe_order_lines_all oola,
		HZ_PARTIES hz
		WHERE oola.line_id = l_trx_source_line_id
		AND hz.party_id = oola.sold_to_org_id;
Line: 1772

	select location_code into l_location_code
	 from hr_locations
	 where location_id=p_location_id;
Line: 1815

	l_sequence_number 		wms_selection_criteria_txn.sequence_number%type;
Line: 1816

	l_return_type_code		wms_selection_criteria_txn.return_type_code%type;
Line: 1817

	l_return_type_id		wms_selection_criteria_txn.return_type_id%type;
Line: 1821

	CURSOR cur_crossdock_value_selection IS
	   SELECT return_type_code, return_type_id, sequence_number
	     FROM wms_selection_criteria_txn
           WHERE from_organization_id = p_organization_id
       	     AND rule_type_code = p_rule_type_code
       	     AND enabled_flag = 1
	     AND NVL(customer_id, NVL(p_customer_id, -9))     = NVL(p_customer_id, -9)
	     AND NVL(inventory_item_id, p_inventory_item_id)  = p_inventory_item_id
	     AND NVL(item_type, NVL(p_item_type, '#'))	      = NVL(p_item_type, '#')
	     AND NVL(vendor_id, NVL(p_vendor_id, -9))         = NVL(p_vendor_id, -9)
	     AND NVL(location_id, NVL(p_location_id, -9))     = NVL(p_location_id, -9)
	     AND NVL(project_id, NVL(p_project_id, -9))       = NVL(p_project_id, -9)
	     AND NVL(task_id, NVL(p_task_id, -9))             = NVL(p_task_id, -9)
	     AND NVL(user_id, NVL(p_user_id, -9))             = NVL(p_user_id, -9)
	     AND NVL(uom_code, NVL(p_uom_code, '#'))          = NVL(p_uom_code, '#')
	     AND NVL(uom_class, NVL(p_uom_class, '#'))        = NVL(p_uom_class, '#')
	     AND DECODE(abc_class_id, NULL, 'N', 'Y')         = DECODE(abc_class_id, NULL,'N',
		    WMS_RULES_WORKBENCH_PVT.get_group_class(p_inventory_item_id,
							    assignment_group_id,
							    abc_class_id))
	     ORDER BY sequence_number;
Line: 1847

      OPEN cur_crossdock_value_selection;
Line: 1848

      FETCH cur_crossdock_value_selection INTO l_return_type_code, l_return_type_id, l_sequence_number;
Line: 1850

      IF (cur_crossdock_value_selection%NOTFOUND) THEN
	 l_return_type_code := NULL;
Line: 1860

      IF cur_crossdock_value_selection%ISOPEN THEN
	 CLOSE cur_crossdock_value_selection;
Line: 1873

	 If cur_crossdock_value_selection%ISOPEN then
	    CLOSE cur_crossdock_value_selection;
Line: 1880

	 log_error(l_api_name, 'error', 'Error in Cross selection Criteria - ' ||l_msg_data);
Line: 1884

   	   If cur_crossdock_value_selection%ISOPEN then
	      CLOSE cur_crossdock_value_selection;
Line: 1890

	    log_error(l_api_name, 'unexp_error', 'Unexpected error ' ||' in selection Criteria - ' || l_msg_data);
Line: 1894

		      log_event(l_api_name,'',' Exception in cross selection Criteria');
Line: 1898

	    If cur_crossdock_value_selection%ISOPEN then
	       CLOSE cur_crossdock_value_selection;