DBA Data[Home] [Help]

APPS.WMS_PLAN_TASKS_PVT SQL Statements

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

Line: 49

       EXECUTE IMMEDIATE 'INSERT INTO my_temp_table VALUES ('||
                         p_message||','||i||')';
Line: 54

   INSERT INTO my_temp_table VALUES (p_message,i);
Line: 83

SELECT  we.WIP_ENTITY_NAME , wwtt.transaction_temp_id, wwtt.task_type_id
bulk collect INTO l_source_header,  l_temp_id, l_task_type_id
FROM  wip_entities we  ,
  wms_waveplan_tasks_temp wwtt
WHERE we.WIP_ENTITY_ID = wwtt.reference_id
    AND wwtt.reference = 'WIP JOB'
     AND wwtt.source_header IS NULL
     AND wwtt.reference_id IS NOT NULL;
Line: 94

	UPDATE wms_waveplan_tasks_temp wwtt
	SET source_header = l_source_header(i)
WHERE wwtt.transaction_temp_id = l_temp_id(i)
	AND wwtt.task_type_id = l_task_type_id(i);
Line: 103

   SELECT ph.segment1, pl.line_num, wwtt.transaction_temp_id, wwtt.task_type_id
     bulk collect INTO l_source_header, l_line_number, l_temp_id, l_task_type_id
     FROM po_line_locations_trx_v pll,--CLM Changes, using CLM views instead of base tables
          po_headers_trx_v ph,
          po_lines_trx_v pl,
          wms_waveplan_tasks_temp wwtt
     WHERE pll.line_location_id = wwtt.reference_id
     AND pll.po_line_id = pl.po_line_id
     AND ph.po_header_id = pl.po_header_id
     AND wwtt.reference = 'PO_LINE_LOCATION_ID'
     AND wwtt.source_header IS NULL
     AND wwtt.reference_id IS NOT NULL;
Line: 118

	UPDATE wms_waveplan_tasks_temp wwtt
	SET source_header = l_source_header(i),
	    line_number   = l_line_number(i)
	WHERE wwtt.transaction_temp_id = l_temp_id(i)
	AND wwtt.task_type_id = l_task_type_id(i);
Line: 125

   SELECT ooh.order_number, ool.line_number, wwtt.transaction_temp_id, wwtt.task_type_id
     bulk collect INTO l_source_header, l_line_number, l_temp_id, l_task_type_id
     FROM oe_order_lines_all ool,
          oe_order_headers_all ooh,
          wms_waveplan_tasks_temp wwtt
     WHERE ool.line_id = wwtt.reference_id
     AND ooh.header_id = ool.header_id
     AND wwtt.reference = 'ORDER_LINE_ID'
     AND wwtt.source_header IS NULL
     AND wwtt.reference_id IS NOT NULL;
Line: 138

	UPDATE wms_waveplan_tasks_temp wwtt
	SET source_header = l_source_header(i),
	    line_number   = l_line_number(i)
	WHERE wwtt.transaction_temp_id = l_temp_id(i)
	AND wwtt.task_type_id = l_task_type_id(i);
Line: 145

   SELECT Decode(rsl.requisition_line_id, NULL, rsh.shipment_num, prh.segment1),
          Decode(rsl.requisition_line_id, NULL, rsl.line_num, prl.line_num),
          wwtt.transaction_temp_id, wwtt.task_type_id
     bulk collect INTO l_source_header, l_line_number, l_temp_id, l_task_type_id
          -- MOAC changed po_requisition_headers and po_requisition_lines to _ALL tables
     FROM po_requisition_headers_all prh,
          po_requisition_lines_all prl,
          rcv_shipment_lines rsl,
          rcv_shipment_headers rsh,
          wms_waveplan_tasks_temp wwtt
     WHERE rsl.shipment_line_id = wwtt.reference_id
     AND prh.requisition_header_id(+) = prl.requisition_header_id
     AND rsl.requisition_line_id = prl.requisition_line_id(+)
     AND rsl.shipment_header_id = rsh.shipment_header_id
     AND wwtt.reference = 'SHIPMENT_LINE_ID'
     AND wwtt.source_header IS NULL
     AND wwtt.reference_id IS NOT NULL;
Line: 165

	UPDATE wms_waveplan_tasks_temp wwtt
	SET source_header = l_source_header(i),
	    line_number   = l_line_number(i)
	WHERE wwtt.transaction_temp_id = l_temp_id(i)
	AND wwtt.task_type_id = l_task_type_id(i);
Line: 189

     x_plans_select_str wms_plan_tasks_pvt.short_sql;
Line: 192

     l_insert_str       wms_plan_tasks_pvt.short_sql;
Line: 206

         SELECT wooi.operation_sequence,wwtt.transaction_temp_id
         FROM
  		   wms_op_operation_instances wooi,
         (SELECT transaction_temp_id
           FROM wms_waveplan_tasks_temp
           WHERE status_id = 6
           AND plans_tasks = wms_plan_tasks_pvt.g_plan_task_types(2)) wwtt
           WHERE wooi.source_task_id = wwtt.transaction_temp_id
			 UNION ALL
			 SELECT wooih.operation_sequence,wwtt.transaction_temp_id
          FROM WMS_OP_OPERTN_INSTANCES_HIST wooih,
			 (SELECT transaction_temp_id
            FROM wms_waveplan_tasks_temp
            WHERE status_id = 6
            AND plans_tasks = wms_plan_tasks_pvt.g_plan_task_types(2)) wwtt
          where  wooih.source_task_id = wwtt.transaction_temp_id;
Line: 308

   /*Get the insert stmt - Call the function get_insert_stmt -
     This stmt is used to insert records into wwtt.
     Fields not revelant for plans, but are relevant for tasks are also included
     in this insert stmt..for fetching plans, the corresponding select stmt
     will select null values. */

      get_col_list(l_insert_str);
Line: 315

      l_insert_str := 'INSERT INTO WMS_WAVEPLAN_TASKS_TEMP(' || l_insert_str || ')';
Line: 317

        debug('l_insert_str from get_col_list' || l_insert_str, 'query_inbound');
Line: 323

      This function returns the select stmt w/o the insert stmt.
      Store this string in a local variable, say l_tasks_query_str.
    */
    IF l_query_tasks THEN
       get_tasks(l_tasks_query_str,p_summary_mode); -- p_summary_mode
Line: 349

            This procedure returns the select stmt w/o insert stmt into the
            OUT variable Store the string in a local variable.
          */
         /* If plan_specific query is made, it is handled in get_plans */

          get_plans(l_plans_query_str);
Line: 361

   /*First insert tasks records into WWTT - execute the sql.
	Once tasks records are inserted now insert plans records -
   Now insert the plans records into WWTT */

     IF l_tasks_query_str IS NOT NULL THEN
       IF l_debug = 1 THEN
         debug('l_tasks_query_str is not null ','query_inbound_tasks');
Line: 372

         l_tasks_query := l_insert_str || l_tasks_query_str;
Line: 576

            select lpad(segment1,40), segment2,segment1
              INTO l_from_tonum_mso_seg1,l_from_mso_seg2,l_from_mso_seg1
              from mtl_sales_orders
             WHERE sales_order_id = wms_plan_tasks_pvt.g_from_sales_order_id;
Line: 584

               select lpad(segment1,40), segment2
                 INTO l_to_tonum_mso_seg1,l_to_mso_seg2
                 from mtl_sales_orders
                WHERE sales_order_id = wms_plan_tasks_pvt.g_to_sales_order_id;
Line: 762

      /* Now the tasks records are inserted into the table wwtt . Next insert
         the plan records if l_plans_query_str is not null */
     IF l_plans_query_str IS NOT NULL THEN
        l_plans_query := l_insert_str || l_plans_query_str;
Line: 889

     /* delete the drop-pending record from the temp table, when both independent and planned
      * task records are queried
      */
      --IF wms_plan_tasks_pvt.g_query_independent_tasks AND
      IF wms_plan_tasks_pvt.g_planned_tasks_rec.is_loaded
      THEN
      l_planned_task := wms_plan_tasks_pvt.g_plan_task_types(2);
Line: 896

         DELETE FROM wms_waveplan_tasks_temp wwtt
            WHERE EXISTS (
                     SELECT 1
                       FROM wms_op_operation_instances wooi
                      WHERE wwtt.transaction_temp_id = wooi.source_task_id
                        AND wwtt.operation_sequence = wooi.operation_sequence
                        AND wooi.operation_status IN (1,2) -- added for bug 5172443 to delete drop-active record
                        AND wooi.complete_time IS NULL)
              AND wwtt.plans_tasks = l_planned_task
              AND wwtt.status_id = 4;
Line: 907

	   DEBUG('rows deleted '|| SQL%ROWCOUNT);
Line: 937

l_plans_select_str varchar2(3000);
Line: 942

l_wdth_select_str VARCHAR2(3000);
Line: 953

   l_inline_query := ' (Select distinct parent_line_id, reference_id, ' ||
                     ' reference, source_header, line_number '||
                     ' from wms_waveplan_tasks_temp where ' ||
                     ' task_type_id in (2,8) ' ||
                     ' and operation_plan_id is not null ' ||
                     ' and parent_line_id is not null) wwtt ';
Line: 967

   l_plans_select_str := 'SELECT ''+'',' ||
                     '''' || wms_plan_tasks_pvt.g_plan_task_types(3) || ''', ' ||
                     'mmtt.transaction_temp_id, '||
                     'mmtt.parent_line_id, ' ||
                     'mmtt.inventory_item_id, ' ||
                     'msiv.concatenated_segments, ' ||
                     'msiv.description, ' ||
                     'msiv.unit_weight, ' ||
                     'msiv.weight_uom_code, ' ||
                     'msiv.unit_volume, '||
                     'msiv.volume_uom_code, ' ||
                     'mmtt.organization_id, ' ||
                     'mmtt.revision, ' ||
                     'mmtt.subinventory_code, ' ||
                     'mmtt.locator_id, ' ||
                     'decode(milv.segment19, null, milv.concatenated_segments, null), ' ||
                     'wopi.status, ' ||
                     'wopi.status, ' ||
                     'decode(wopi.status,' ||
                     '1, ''' || wms_plan_tasks_pvt.g_plan_status_codes(1)
                             || ''', 2, '''
                             || wms_plan_tasks_pvt.g_plan_status_codes(2)
                             || ''', 3, '''
                             || wms_plan_tasks_pvt.g_plan_status_codes(3)
                             || ''', 4, '''
                             || wms_plan_tasks_pvt.g_plan_status_codes(4)
                             || ''', 5, '''
                             || wms_plan_tasks_pvt.g_plan_status_codes(5)
                             || ''', 6, '''
                             || wms_plan_tasks_pvt.g_plan_status_codes(6)
                             || ''', 7, '''
                             || wms_plan_tasks_pvt.g_plan_status_codes(7)
                             || '''), ' ||
                       'mmtt.transaction_type_id, ' ||
                       'mmtt.transaction_action_id, ' ||
                       'mmtt.transaction_source_type_id, ';
Line: 1005

        l_plans_select_str  := l_plans_select_str
        || 'mtst.transaction_source_type_name, '; --transaction_source_type
Line: 1009

      l_plans_select_str  := l_plans_select_str ||
                        'mmtt.transaction_source_id, ' ||
                        'mmtt.trx_source_line_id, ' ||
                        'mmtt.transfer_organization, ';
Line: 1015

        l_plans_select_str  := l_plans_select_str || 'mp1.organization_code, ';
Line: 1018

      l_plans_select_str:=l_plans_select_str ||
                         'mmtt.transfer_subinventory, ' ||
                         'mmtt.transfer_to_location, ';
Line: 1023

        l_plans_select_str  := l_plans_select_str ||
        'decode(milv1.segment19, null, milv1.concatenated_segments, null), ';
Line: 1027

      l_plans_select_str := l_plans_select_str ||
                        'mmtt.transaction_uom, ' ||
                        'mmtt.transaction_quantity, '||
                        'mmtt.standard_operation_id, ';
Line: 1032

         l_plans_select_str  := l_plans_select_str || ' NULL, ';
Line: 1034

      l_plans_select_str  := l_plans_select_str ||
                        'mmtt.move_order_line_id, ' || /*move_order_line_id */
                        'mmtt.pick_slip_number, ' || /*pick_slip_number*/
                        'mmtt.cartonization_id, '; /*cartonization_id */
Line: 1040

        l_plans_select_str  := l_plans_select_str
           || 'wlpn2.license_plate_number, '; --cartonization_lpn
Line: 1044

      l_plans_select_str  := l_plans_select_str ||
                        'mmtt.allocated_lpn_id, '; /*allocated_lpn_id*/
Line: 1048

        l_plans_select_str  := l_plans_select_str
           || 'wlpn1.license_plate_number, '; --allocated_lpn
Line: 1052

      l_plans_select_str  := l_plans_select_str ||
                        'mmtt.container_item_id, '; --container_item_id
Line: 1056

        l_plans_select_str  := l_plans_select_str
                    || 'msiv1.concatenated_segments, '; --container_item
Line: 1060

      l_plans_select_str := l_plans_select_str ||
	                 'mmtt.lpn_id, '; --from_lpn_id
Line: 1064

	 l_plans_select_str := l_plans_select_str ||
	                 'wlpn5.license_plate_number, ';  --from_lpn
Line: 1068

      l_plans_select_str  := l_plans_select_str ||
                         'mmtt.content_lpn_id, '; --content_lpn_id
Line: 1072

        l_plans_select_str  := l_plans_select_str
           || 'wlpn3.license_plate_number, '; --content_lpn
Line: 1076

      l_plans_select_str  := l_plans_select_str ||'mmtt.transfer_lpn_id, ';
Line: 1079

        l_plans_select_str := l_plans_select_str || 'wlpn4.license_plate_number, ';
Line: 1081

      l_plans_select_str := l_plans_select_str ||
                         'mmtt.last_update_date, ' || /*mmtt_last_update_date*/
                         'mmtt.last_updated_by, ' || /*mmtt_last_updated_by*/
                         'mmtt.task_priority, ' || /*priority*/
                         'mmtt.task_priority, ' || /*priority_original */
                         'mmtt.wms_task_type, ' || /*task_type_id */
                         'decode(mmtt.wms_task_type,'
                            || '1, '''
                            || wms_plan_tasks_pvt.g_task_types(1)
                            || ''', 2, '''
                            || wms_plan_tasks_pvt.g_task_types(2)
                            || ''', 3, '''
                            || wms_plan_tasks_pvt.g_task_types(3)
                            || ''', 4, '''
                            || wms_plan_tasks_pvt.g_task_types(4)
                            || ''', 5, '''
                            || wms_plan_tasks_pvt.g_task_types(5)
                            || ''', 6, '''
                            || wms_plan_tasks_pvt.g_task_types(6)
                            || ''', 7, '''
                            || wms_plan_tasks_pvt.g_task_types(7)
                            || ''', 8, '''
                            || wms_plan_tasks_pvt.g_task_types(8)
                            || '''), ' ||
                    'mmtt.creation_date, ' || /*creation_time  */
                    'mmtt.operation_plan_id, '; /*operation_plan_id*/
Line: 1108

        l_plans_select_str := l_plans_select_str ||
                    'wop.operation_plan_name, '; /*operation_plan*/
Line: 1113

        l_plans_select_str := l_plans_select_str || 'to_number(null), '; --operation_sequence
Line: 1116

     l_plans_select_str := l_plans_select_str ||
                    'wopi.op_plan_instance_id op_plan_instance_id, '|| /*op_plan_instance_id*/
                    --'to_number(null), '|| /*operation_sequence*/
                    'to_number(null), ' || /*task_id*/
                    'to_number(null), ' || /*person_id*/
                    'to_number(null), '|| /*person_id_original*/
                    'null, ' ||     /*person*/
                    'to_date(null), ' || /*effective_start_date*/
                    'to_date(null), ' || /*effective_end_date*/
                    'to_number(null), '; /*person_resource_id*/
Line: 1127

        l_plans_select_str := l_plans_select_str ||
                    'null, ';/*person_resource_code*/
Line: 1130

     l_plans_select_str := l_plans_select_str ||
                    'to_number(null), '; /*machine_resource_id*/
Line: 1133

      l_plans_select_str := l_plans_select_str ||
                    'null, '; /*machine_resource_code*/
Line: 1136

    l_plans_select_str := l_plans_select_str ||
                    'null, ' || /*equipment_instance*/
                    'to_date(null), ' || /*dispatched_time*/
                    'to_date(null), ' || /*loaded_time*/
                    'to_date(null), ' || /*drop_off_time*/
                    'to_date(null), ' || /*wdt_last_update_date*/
                    'to_number(null), ' || /*wdt_last_updated_by*/
                    '''N'', ' ||  /*is_modified   */
                    'mmtt.secondary_uom_code, '||
                    'mmtt.secondary_transaction_quantity ';
Line: 1148

     /* If inbound specific query is made, select more fields */
     IF wms_plan_tasks_pvt.g_include_inbound THEN
      l_plans_select_str     := l_plans_select_str
                                || ', wwtt.reference_id '
                                || ', wwtt.reference ';
Line: 1156

      l_plans_select_str  := l_plans_select_str
                             || ', wwtt.source_header '
                             || ', wwtt.line_number ';
Line: 1162

     debug('l_plans_select_str ' ||l_plans_select_str,'get_plans');
Line: 1375

    This requires that the task records are already inserted into wwtt.
    We then fetch all parent records of the task records already
    inserted into wwtt.
    But now we do not check if the planned_task records are already
    inserted into wwtt or not. This validation should be taken care of
    in the calling program - In this case, it is get_inbound_tasks
  **/
IF wms_plan_tasks_pvt.g_inbound_specific_query OR
   wms_plan_tasks_pvt.g_include_inbound THEN
   l_plans_where_str :=   l_plans_where_str
                          || ' AND mmtt.transaction_temp_id = wwtt.parent_line_id ';
Line: 1388

l_plans_str := l_plans_select_str || l_plans_from_str || l_plans_where_str;
Line: 1400

    get_wdth_plan_records(l_wdth_select_str, l_wdth_from_str, l_wdth_where_str);
Line: 1403

      debug('l_wdth_select_str from get_wdth_plan_records: ' ||l_wdth_select_str,'get_plans');
Line: 1436

    l_wdth_str := l_wdth_select_str || l_wdth_from_str || l_wdth_where_str;
Line: 1476

l_tasks_select_str wms_plan_tasks_pvt.short_sql := NULL;
Line: 1481

l_completed_tasks_select_str wms_plan_tasks_pvt.long_sql:= NULL;  /* Bug 5507934  */
Line: 1486

l_completed_records_select_str wms_plan_tasks_pvt.long_sql:= NULL;
Line: 1490

l_inbound_select_str wms_plan_tasks_pvt.short_sql:= NULL;
Line: 1546

    debug('query for loaded and pending tasks. calling get_generic_select ','get_tasks');
Line: 1552

	l_tasks_select_str := ' SELECT mmtt.wms_task_type, count(*) ';
Line: 1554

	l_tasks_select_str := wms_waveplan_tasks_pvt.get_generic_select(
		  p_is_pending                 => l_is_pending
	        , p_is_loaded                  => l_is_loaded
		, p_is_completed               => FALSE
        );
Line: 1563

    debug('after calling get_generic_select :','get_tasks');
Line: 1564

    debug('l_tasks_select_str ' || l_tasks_select_str,'get_tasks');
Line: 1632

   /* If inbound specific query is made, get the inbound specific select, from
      and where clauses, append them to the final query for non-completed tasks.
    */
   IF wms_plan_tasks_pvt.g_inbound_specific_query  OR
      wms_plan_tasks_pvt.g_include_inbound OR
      wms_plan_tasks_pvt.g_include_crossdock THEN
      IF l_debug = 1 THEN
        debug('inbound specific query is made. calling get_inbound_specific_query ','get_tasks');
Line: 1641

      get_inbound_specific_query(x_inbound_select_str => l_inbound_select_str
                                ,x_inbound_from_str   => l_inbound_from_str
                                ,x_inbound_where_str  => l_inbound_where_str
                                ,p_is_completed_rec   => 0);
Line: 1666

	      l_tasks_select_str := l_tasks_select_str || l_inbound_select_str; -- only for detailed select include the inbound specific select
Line: 1671

  /* If plan specific query is made, get the plan specific select, from and
     where clauses, append them to the final query for non-completed tasks.
   */
   if wms_plan_tasks_pvt.g_op_plan_id is not null THEN
      l_tasks_where_str := l_tasks_where_str ||
         ' and mmtt.operation_plan_id = :op_plan_id ';
Line: 1683

  l_tasks_str := l_tasks_select_str || l_tasks_from_str || l_tasks_where_str;
Line: 1711

   get_completed_records(l_completed_records_select_str,
                         l_completed_records_from_str,
                         l_completed_records_where_str);
Line: 1726

          get_inbound_specific_query(x_inbound_select_str => l_inbound_select_str
                                   ,x_inbound_from_str   => l_inbound_from_str
                                   ,x_inbound_where_str  => l_inbound_where_str
                                   ,p_is_completed_rec   => 1);
Line: 1752

         l_completed_records_select_str := l_completed_records_select_str
                                           || l_inbound_select_str;
Line: 1759

         /* If plan specific query is made, get the plan specific select, from and
          * where clauses, append them to the final query for non-completed tasks.
          */
         if wms_plan_tasks_pvt.g_op_plan_id is not null THEN
            l_completed_records_where_str := l_completed_records_where_str ||
               ' and wdth.operation_plan_id = :op_plan_id ';
Line: 1830

	l_completed_records_str := l_completed_records_select_str ||
		              l_completed_records_from_str ||
		              l_completed_records_where_str;
Line: 1834

	l_completed_records_str := ' SELECT wdth.task_type,count(*) ' || l_completed_records_from_str ||
		              l_completed_records_where_str || ' GROUP BY wdth.task_type ';
Line: 1853

	l_completed_tasks_select_str := ' SELECT wdth.task_type, count(*) ';
Line: 1855

	   l_completed_tasks_select_str := wms_waveplan_tasks_pvt.get_generic_select(
		  p_is_pending                 => FALSE
	        , p_is_loaded                  => FALSE
		, p_is_completed               => l_is_completed
        );
Line: 1906

      get_inbound_specific_query(x_inbound_select_str => l_inbound_select_str
                             ,x_inbound_from_str   => l_inbound_from_str
                             ,x_inbound_where_str  => l_inbound_where_str
                             ,p_is_completed_rec   => 1);
Line: 1986

	      l_completed_tasks_select_str := l_completed_tasks_select_str || l_inbound_select_str;
Line: 1997

   l_completed_tasks_str := l_completed_tasks_select_str || l_completed_tasks_from_str ||
                         l_completed_tasks_where_str;
Line: 2152

                    || ', mmtt_last_update_date '
                    || ', mmtt_last_updated_by '
                    || ', priority '
                    || ', priority_original '
                    || ', task_type_id '
                    || ', task_type '
                    || ', creation_time '
                    || ', operation_plan_id ';
Line: 2192

                    || ', wdt_last_update_date '
                    || ', wdt_last_updated_by '
                    || ', is_modified '
                    || ', secondary_transaction_uom '
                    || ', secondary_transaction_quantity ';
Line: 2219

procedure get_completed_records(x_wdth_select_str OUT NOCOPY varchar2,
                                x_wdth_from_str OUT NOCOPY varchar2,
                                x_wdth_where_str OUT NOCOPY varchar2) is
l_wdth_select_str wms_plan_tasks_pvt.short_sql:= NULL;
Line: 2228

/**** First build the Select string ****/
  IF l_debug = 1 THEN
    debug('in get_completed_records ','get_completed_records');
Line: 2232

 l_wdth_select_str  := 'SELECT '
         || 'decode(wdth.is_parent,''N'',null,''+''), '
         || 'decode(wdth.is_parent,''N'', decode(wdth.operation_plan_id,null,'
         || 'decode(wdth.parent_transaction_id,null,'''
         || wms_plan_tasks_pvt.g_plan_task_types(1) || ''','''
         || wms_plan_tasks_pvt.g_plan_task_types(5)
         || '''),'''|| wms_plan_tasks_pvt.g_plan_task_types(2)
         || '''),decode(wdth.transaction_action_id,28,'''||wms_plan_tasks_pvt.g_plan_task_types(4)
         || ''',''' || wms_plan_tasks_pvt.g_plan_task_types(3) || ''')), ' /*plan_task */
         || 'wdth.transaction_id, ' /* transaction_temp_id */
         || 'wdth.parent_transaction_id, ' /*parent_line_id*/
         || 'wdth.inventory_item_id, ' /*inventory_item_id*/
         || 'msiv.concatenated_segments, '/*item*/
         || 'msiv.description, ' /*item description*/
         || 'msiv.unit_weight, ' /*unit_weight*/
         || 'msiv.weight_uom_code, ' /*weight_uom_code*/
         || 'msiv.unit_volume, ' /*unit_volume*/
         || 'msiv.volume_uom_code, ' /*volume_uom_code*/
         || 'wdth.organization_id, ' /*organization_id*/
         || 'wdth.revision, ' /*revision*/
         || 'wdth.source_subinventory_code, ' /*subinventory*/
         || 'wdth.source_locator_id, ' /*locator_id*/
         || 'decode(milv.segment19, null, milv.concatenated_segments, null), '/*locator*/
         || 'wdth.status, '  /*status_id*/
         || 'wdth.status, ' /*status_id_original*/
         || 'decode(wdth.status,'
         || '6, '''
         || wms_plan_tasks_pvt.g_plan_status_codes(3)
         || ''', 11, '''
         || wms_plan_tasks_pvt.g_plan_status_codes(4)
         || ''', 12, '''
         || wms_plan_tasks_pvt.g_plan_status_codes(5)/*status*/
         || '''), '
         || 'wdth.transaction_type_id, '/*transaction_type_id*/
         || 'wdth.transaction_action_id, '/*transaction_action_id*/
         || 'wdth.transaction_source_type_id, '; --transaction_source_type_id
Line: 2270

     l_wdth_select_str  := l_wdth_select_str
            || 'mtst.transaction_source_type_name, '; --transaction_source_type
Line: 2274

    l_wdth_select_str  := l_wdth_select_str
                     || 'to_number(null), '  /*transaction_source_id*/
                     || 'to_number(null), ' /*transaction_source_line_id*/
                     || 'wdth.transfer_organization_id, ';/* to_organization_id*/
Line: 2280

       l_wdth_select_str  := l_wdth_select_str
                     || 'mp1.organization_code, '; /* to_organization_code */
Line: 2283

    l_wdth_select_str  := l_wdth_select_str
                     || 'wdth.dest_subinventory_code, ' /*to_subinventory*/
                     || 'wdth.dest_locator_id,  '; /*to_locator_id*/
Line: 2288

      l_wdth_select_str  := l_wdth_select_str
        || 'decode(milv1.segment19, null, milv1.concatenated_segments, null), ';
Line: 2293

    l_wdth_select_str  := l_wdth_select_str
                     || 'wdth.transaction_uom_code, '  /* transaction_uom */
                     || 'wdth.transaction_quantity, ' /*transaction_quantity */
                     || 'wdth.user_task_type, '; /*user_task_type_id*/
Line: 2300

      l_wdth_select_str  := l_wdth_select_str
                     || 'bso.operation_code, '; --user_task_type
Line: 2306

    l_wdth_select_str  := l_wdth_select_str
                     || 'to_number(null), ' /*move_order_line_id*/
                     || 'to_number(null), ' /*pick_slip_number*/
                     || 'to_number(null), '; /*cartonization_id*/
Line: 2311

         l_wdth_select_str := l_wdth_select_str || 'null, ';
Line: 2314

         l_wdth_select_str := l_wdth_select_str
             || 'to_number(null), '; /*allocated_lpn_id*/
Line: 2319

           l_wdth_select_str  := l_wdth_select_str || 'null, '; --allocated_lpn
Line: 2321

    l_wdth_select_str  := l_wdth_select_str
                     || 'to_number(null), '; /*container_item_id*/
Line: 2325

       l_wdth_select_str := l_wdth_select_str || 'null, '; /*container item */
Line: 2328

    l_wdth_select_str := l_wdth_select_str || 'wdth.lpn_id, ' ; /*from_lpn_id*/
Line: 2331

       l_wdth_select_str := l_wdth_select_str
	 || 'wlpn5.license_plate_number, ' ; /*from_lpn*/
Line: 2335

    l_wdth_select_str := l_wdth_select_str || 'wdth.content_lpn_id, '; /*content_lpn_id*/
Line: 2338

       l_wdth_select_str  := l_wdth_select_str
	 || 'wlpn3.license_plate_number, '; --content_lpn
Line: 2342

    l_wdth_select_str  := l_wdth_select_str
                     || 'wdth.transfer_lpn_id, '; --to_lpn_id
Line: 2346

      l_wdth_select_str  :=  l_wdth_select_str
                     || 'wlpn4.license_plate_number, '; --to_lpn
Line: 2349

   l_wdth_select_str  := l_wdth_select_str
                     || 'to_date(null), ' /*mmt_last_update_date*/
                     || 'to_number(null), ' /*mmt_last_updated_by*/
                     || 'wdth.priority, '/*priority*/
                     || 'wdth.priority, ' /*priority_original*/
                     || 'wdth.task_type, ' /*task_type_id*/
                     || 'decode(wdth.task_type,'
                     || '1, '''
                     || wms_plan_tasks_pvt.g_task_types(1)
                     || ''', 2, '''
                     || wms_plan_tasks_pvt.g_task_types(2)
                     || ''', 3, '''
                     || wms_plan_tasks_pvt.g_task_types(3)
                     || ''', 4, '''
                     || wms_plan_tasks_pvt.g_task_types(4)
                     || ''', 5, '''
                     || wms_plan_tasks_pvt.g_task_types(5)
                     || ''', 6, '''
                     || wms_plan_tasks_pvt.g_task_types(6)
                     || ''', 7, '''
                     || wms_plan_tasks_pvt.g_task_types(7)
                     || ''', 8, '''
                     || wms_plan_tasks_pvt.g_task_types(8)
                     || '''), '/*task*/
                     || 'to_date(null), ' /*creation_time */
                     || 'wdth.operation_plan_id, ';/*operation_plan_id*/
Line: 2376

   l_wdth_select_str := l_wdth_select_str
                     || 'wop.operation_plan_name, ';/*operation_plan*/
Line: 2380

        l_wdth_select_str := l_wdth_select_str || ' to_number(null), '; --operation_sequence
Line: 2382

   l_wdth_select_str := l_wdth_select_str
                     || 'to_number(wdth.op_plan_instance_id), '/*operation_instance_id*/
                     --|| 'to_number(null), '/*operation_sequence*/
                     || 'wdth.task_id, '/*task_id*/
                     || 'wdth.person_id, '/*person_id*/
                     || 'wdth.person_id, ';/*person_id_original*/
Line: 2390

       l_wdth_select_str  := l_wdth_select_str || 'pap.full_name, '; --person_id
Line: 2393

    l_wdth_select_str  := l_wdth_select_str
                      || 'wdth.effective_start_date, '/*effective_start_date*/
                      || 'wdth.effective_end_date, '/*effective_end_date*/
                      || 'wdth.person_resource_id, '; /*person_resource_id*/
Line: 2399

       l_wdth_select_str  := l_wdth_select_str
                      || 'br1.resource_code, '; --person_resource_code
Line: 2403

    l_wdth_select_str  := l_wdth_select_str
                      || 'wdth.machine_resource_id, '; --machine_resource_id
Line: 2407

       l_wdth_select_str  := l_wdth_select_str
                      || 'br2.resource_code, '; --machine_resource_code
Line: 2410

    l_wdth_select_str  := l_wdth_select_str
                      || 'wdth.equipment_instance, '/*equipment_instance*/
                      || 'wdth.dispatched_time, '/*dispatched_time*/
                      || 'wdth.loaded_time, '/*loaded_time*/
                      || 'wdth.drop_off_time, '/*drop_off_time*/
                      || 'to_date(null), '/*wdt_last_update_date*/
                      || 'to_number(null), '/*wdt_last_updated_by*/
                      || '''N'', '/*is modified*/
                      || 'wdth.SECONDARY_TRANSACTION_UOM_CODE, '
                      || 'wdth.secondary_transaction_quantity ';
Line: 2631

      debug('l_wdth_select_str## ' || l_wdth_select_str, 'get_completed_records');
Line: 2636

    x_wdth_select_str := l_wdth_select_str;
Line: 2948

                   x_inbound_select_str OUT NOCOPY VARCHAR2
                   ,x_inbound_from_str   OUT NOCOPY VARCHAR2
                   ,x_inbound_where_str  OUT NOCOPY VARCHAR2
                   ,p_is_completed_rec   IN NUMBER) IS
   l_inbound_select wms_plan_tasks_pvt.short_sql;
Line: 2972

 l_inbound_select  :=',  Nvl2(mtrl.reference ,mtrl.reference_id , mtrl.TXN_SOURCE_ID)  ' ||
                     ' , Nvl( mtrl.reference , Decode (mtrl.transaction_source_type_id,5 , ' ||'''WIP JOB'' ,  NULL ) ) ';
Line: 2974

/* Original Code        l_inbound_select  := ', mtrl.reference_id ' || /*reference_id */
                             /*', mtrl.reference '; -- reference */
Line: 2995

        l_inbound_select  := ', decode(rt.source_document_code, '
                        || '''INVENTORY'', rt.shipment_line_id, '
                        || '''PO'', rt.po_line_location_id, '
                        || '''REQ'', rt.shipment_line_id, '
                        || '''RMA'', rt.oe_order_line_id '
			|| ' , NULL ' ||' , '|| '( SELECT distinct TXN_SOURCE_ID FROM    mtl_txn_request_lines '
			|| ' WHERE line_id = '|| l_mover_order_line || ' ))'  --  Code for Bug#8467334
                        || ', decode(rt.source_document_code, '
                        || '''INVENTORY'', ''SHIPMENT_LINE_ID'', '
                        || '''PO'', ''PO_LINE_LOCATION_ID'', '
                        || '''REQ'', ''SHIPMENT_LINE_ID'', '
                        || '''RMA'', ''ORDER_LINE_ID''  '
			||', NULL '||' , ' || '( SELECT Distinct (Decode (transaction_source_type_id,5 , '
			||'''WIP JOB'' ,  NULL )) FROM mtl_material_transactions WHERE MOVE_ORDER_LINE_ID =
			'|| l_mover_order_line || ' ) )';  --  Code for  Bug#8467334
Line: 3016

        l_inbound_select  := l_inbound_select || ', ph.segment1 ' || /* source_header*/
                             ', pl.line_num '; -- line_number
Line: 3020

        l_inbound_select  := l_inbound_select || ', ooh.order_number '; -- source_header
Line: 3021

        l_inbound_select  := l_inbound_select || ', ool.line_number '; -- line_number
Line: 3024

        l_inbound_select  := l_inbound_select || ', prh.segment1 '; -- source_header
Line: 3025

        l_inbound_select  := l_inbound_select || ', prl.line_num '; -- line_number
Line: 3032

          l_inbound_select := l_inbound_select || ', wnd.name '; --delivery
Line: 3256

      x_inbound_select_str := l_inbound_select;
Line: 3368

         || ', (SELECT COUNT(line_id) line_sum, header_id FROM oe_order_lines_all ';
Line: 3435

      l_where_outbound := l_where_outbound || 'AND wdd.delivery_detail_id = (select delivery_detail_id from wsh_delivery_details_ob_grp_v ';
Line: 3671

PROCEDURE get_wdth_plan_records(x_wdth_select_str OUT NOCOPY VARCHAR2,
                           x_wdth_from_str OUT NOCOPY VARCHAR2,
                           x_wdth_where_str OUT NOCOPY VARCHAR2) IS

l_wdth_str VARCHAR2(6000);
Line: 3676

l_wdth_select_str wms_plan_tasks_pvt.short_sql;
Line: 3684

 l_wdth_select_str :=
      'SELECT ' ||
      ' decode(wdth.is_parent,''N'',decode(wdth.operation_plan_id,null,null,null),''+''), ' || /* expansion_code*/
      ' ''' || wms_plan_tasks_pvt.g_plan_task_types(3) || ''',' || /*plan_task*/
      ' wdth.transaction_id, ' ||  /*transaction_temp_id*/
      ' wdth.parent_transaction_id,' || /*parent_line_id*/
      ' wdth.inventory_item_id, ' ||  /*inventory_item_id*/
      ' msiv.concatenated_segments, ' || /*item*/
      ' msiv.description, ' || /*item description*/
      ' msiv.unit_weight, ' || /*unit_weight*/
      ' msiv.weight_uom_code, ' || /*weight_uom_code*/
      ' msiv.unit_volume, ' || /*unit_volume*/
      ' msiv.volume_uom_code, ' || /*volume_uom_code*/
      ' wdth.organization_id, ' || /*organization_id*/
      ' wdth.revision, ' || /*revision*/
      ' wdth.source_subinventory_code, ' ||/* subinventory*/
      ' wdth.source_locator_id, ' || /*locator_id*/
      ' decode(milv.segment19, null, milv.concatenated_segments, null), ' || /*locator*/
      ' wdth.status, ' || /*status_id*/
      ' wdth.status, ' || /*status_id_original*/
      ' decode(wdth.status,'
       || '6, '''
       || g_status_codes(6)
       || ''', 11, '''
       || g_status_codes(11)
       || ''', 12, '''
       || g_status_codes(12)
       || '''), ' ||
      ' wdth.transaction_type_id, ' || /*transaction_type_id*/
      ' wdth.transaction_action_id, ' || /*transaction_action_id   */
      ' wdth.transaction_source_type_id, '; /*transaction_source_type_id*/
Line: 3717

      l_wdth_select_str  := l_wdth_select_str
                 || ' mtst.transaction_source_type_name, '; --transaction_source_type
Line: 3721

    l_wdth_select_str  := l_wdth_select_str
                         || ' to_number(null), ' || /*transaction_source_id*/
                            ' to_number(null), ' || /*transaction_source_line_id*/
                            ' wdth.transfer_organization_id, '; /*to_organization_id*/
Line: 3727

      l_wdth_select_str  := l_wdth_select_str
                            || 'mp1.organization_code, '; --to_organization_id
Line: 3731

    l_wdth_select_str  := l_wdth_select_str
                          || 'wdth.dest_subinventory_code, ' /*to_subinventory*/
                          || 'wdth.dest_locator_id,  '; /*to_locator_id*/
Line: 3737

      l_wdth_select_str  := l_wdth_select_str ||
         'decode(milv1.segment19, null, milv1.concatenated_segments, null), ';
Line: 3741

    l_wdth_select_str  := l_wdth_select_str ||
                          'wdth.transaction_uom_code, ' || /*transaction_uom*/
                          ' wdth.transaction_quantity, ' || /*transaction_quantity*/
                          ' wdth.user_task_type, '; /*user_task_type_id*/
Line: 3747

      l_wdth_select_str  := l_wdth_select_str
                            || 'bso.operation_code, '; --user_task_type
Line: 3751

    l_wdth_select_str  := l_wdth_select_str ||
                          ' to_number(null), ' || /*move_order_line_id*/
                          ' to_number(null), ' || /*pick_slip_number*/
                          ' to_number(null), ';/*cartonization_id*/
Line: 3756

         l_wdth_select_str := l_wdth_select_str || 'null, ';
Line: 3759

    l_wdth_select_str := l_wdth_select_str || ' to_number(null), ' ; /*allocated_lpn_id*/
Line: 3761

       l_wdth_select_str  := l_wdth_select_str || 'null, '; --allocated_lpn
Line: 3763

    l_wdth_select_str  := l_wdth_select_str || ' to_number(null), ';/*container_item_id*/
Line: 3765

      l_wdth_select_str := l_wdth_select_str || 'null, '; /*container item */
Line: 3768

     l_wdth_select_str := l_wdth_select_str || ' wdth.lpn_id, ';/*from_lpn_id*/
Line: 3771

	l_wdth_select_str := l_wdth_select_str
	  || 'wlpn5.license_plate_number, ';/*from_lpn*/
Line: 3775

     l_wdth_select_str := l_wdth_select_str || ' wdth.content_lpn_id, ';/*content_lpn_id*/
Line: 3778

	l_wdth_select_str  := l_wdth_select_str
	  || 'wlpn3.license_plate_number, '; --content_lpn
Line: 3782

    l_wdth_select_str  := l_wdth_select_str
                          || 'wdth.transfer_lpn_id, '; --to_lpn_id
Line: 3785

      l_wdth_select_str  := l_wdth_select_str
                        || 'wlpn4.license_plate_number, '; --to_lpn
Line: 3789

    l_wdth_select_str  := l_wdth_select_str ||
                          ' to_date(null), ' || /*mmt_last_update_date*/
                          ' to_number(null), ' || /*mmt_last_updated_by*/
                          ' wdth.priority, ' || /*priority*/
                          ' wdth.priority, ' || /*priority_original*/
                          ' wdth.task_type, ' || /*task_type_id*/
                          ' decode(wdth.task_type,'
                            || '1, '''
                            || wms_plan_tasks_pvt.g_task_types(1)
                            || ''', 2, '''
                            || wms_plan_tasks_pvt.g_task_types(2)
                            || ''', 3, '''
                            || wms_plan_tasks_pvt.g_task_types(3)
                            || ''', 4, '''
                            || wms_plan_tasks_pvt.g_task_types(4)
                            || ''', 5, '''
                            || wms_plan_tasks_pvt.g_task_types(5)
                            || ''', 6, '''
                            || wms_plan_tasks_pvt.g_task_types(6)
                            || ''', 7, '''
                            || wms_plan_tasks_pvt.g_task_types(7)
                            || ''', 8, '''
                            || wms_plan_tasks_pvt.g_task_types(8)
                            || '''), ' ||
                          ' to_date(null), ' || /*creation_time  */
                          ' wdth.operation_plan_id, '; /*operation_plan_id*/
Line: 3816

   l_wdth_select_str := l_wdth_select_str
                     || 'wop.operation_plan_name, ';/*operation_plan*/
Line: 3820

        l_wdth_select_str := l_wdth_select_str || ' to_number(null), ';
Line: 3822

   l_wdth_select_str := l_wdth_select_str ||
          ' to_number(wdth.op_plan_instance_id), ' || /*operation_instance_id*/
                          --' to_number(null), '|| /*operation_sequence*/
                          ' wdth.task_id, ' ||/*task_id */
                          ' wdth.person_id, ' || /*person_id*/
                          ' wdth.person_id, '; /*person_id_original*/
Line: 3830

      l_wdth_select_str  := l_wdth_select_str || 'pap.full_name, '; --person_id
Line: 3832

    l_wdth_select_str  := l_wdth_select_str ||
                          ' wdth.effective_start_date, ' || /*effective_start_date*/
                          ' wdth.effective_end_date, ' || /*effective_end_date*/
                          ' wdth.person_resource_id, '; --person_resource_id
Line: 3838

      l_wdth_select_str  :=  l_wdth_select_str
                             || 'br1.resource_code, '; --person_resource_code
Line: 3842

    l_wdth_select_str  := l_wdth_select_str ||
                          ' wdth.machine_resource_id, '; --machine_resource_id
Line: 3846

      l_wdth_select_str  := l_wdth_select_str
                            || 'br2.resource_code, '; --machine_resource_code
Line: 3850

    l_wdth_select_str  := l_wdth_select_str ||
                          ' wdth.equipment_instance, ' || /*equipment_instance*/
                          ' wdth.dispatched_time, ' || /*dispatched_time*/
                          ' wdth.loaded_time, ' || /*loaded_time*/
                          ' wdth.drop_off_time, ' || /*drop_off_time*/
                          ' to_date(null), ' || /*wdt_last_update_date*/
                          ' to_number(null), '  || /*wdt_last_updated_by*/
                          '''N'', '||     --is modified
                          'wdth.SECONDARY_TRANSACTION_UOM_CODE, '||
                          'wdth.secondary_transaction_quantity ';
Line: 3862

      l_wdth_select_str     := l_wdth_select_str
                                || ', wwtt.reference_id '
                                || ', wwtt.reference ';
Line: 3868

      l_wdth_select_str  := l_wdth_select_str
                             || ', wwtt.source_header '
                             || ', wwtt.line_number ';
Line: 4063

      debug(' l_wdth_select_str ' || l_wdth_select_str,'get_wdth_plan_records');
Line: 4068

    x_wdth_select_str := l_wdth_select_str;