DBA Data[Home] [Help]

APPS.OE_SET_UTIL SQL Statements

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

Line: 70

select 1
into lcount
from dual
where exists (select 1
              from oe_line_sets
              where set_id = p_set_id
              and line_id = p_line_id);
Line: 127

        SELECT Enforce_Ship_Set_And_Smc
          INTO l_shipset_enforce
          FROM Wsh_Shipping_Parameters
          WHERE Organization_Id = p_line_rec.ship_from_org_Id;
Line: 144

       SELECT  count(*)
         INTO  l_ship_set
         FROM  Wsh_Delivery_Details
        WHERE  Ship_Set_Id = p_line_rec.ship_set_id
          AND  Source_Code = 'OE'
          AND  Source_Header_Id = p_line_rec.header_id
          AND  Released_Status In ('S','Y','C')
          AND  ROWNUM = 1;  -- 3229707 Removed 'B' from Released_Status check
Line: 154

        SELECT count(*)
        INTO   l_ship_set
        FROM   wsh_delivery_details wdd
        WHERE  wdd.ship_set_id = p_line_rec.ship_set_id
        AND    wdd.source_code = 'OE'
        AND    wdd.source_header_id = p_line_rec.header_id
        AND   ((wdd.released_status = 'C')
        OR EXISTS (select wda.delivery_detail_id
        FROM   wsh_delivery_assignments wda, wsh_new_deliveries wnd
        WHERE  wda.delivery_detail_id = wdd.delivery_detail_id
        AND    wda.delivery_id = wnd.delivery_id
        AND    wnd.status_code in ('CO', 'IT', 'CL', 'SA')))
        AND rownum = 1;
Line: 171

                SELECT SET_NAME
                INTO l_set_name
                FROM OE_SETS
                WHERE set_id = p_line_rec.ship_set_id;
Line: 241

        Select header_id
        Into   l_header_id
        From   oe_order_lines_all
        Where  line_id = p_line_rec.service_reference_line_id;
Line: 278

Select line_id from
oe_order_lines_all where
top_model_line_id = p_line_id and
--item_type_code = 'INCLUDED' and
nvl(cancelled_flag,'N') <> 'Y' and
nvl(model_remnant_flag,'N') <> 'Y' and
line_id not in
(select line_id from oe_line_sets where
set_id = p_set_id );
Line: 307

         SELECT set_status
	   INTO l_set_s
	   FROM oe_sets
	  WHERE set_id = p_set_id
	    FOR UPDATE NOWAIT;
Line: 334

Insert into oe_line_sets(
Line_id,
Set_id,
SYSTEM_REQUIRED_FLAG )
Values
(p_line_id,
p_set_id,
'Y');
Line: 348

      Insert into oe_line_sets(Line_id,
                               Set_id,
                               SYSTEM_REQUIRED_FLAG )
      Values (c1rec.line_id,
              p_set_id,
              'Y');
Line: 436

Procedure Delete_Fulfillment_Set(p_line_id NUMBER,
				 p_set_id  NUMBER) IS
l_return_status varchar2(30);
Line: 449

        oe_debug_pub.add(  'DELETE FULLFILLMENT SET' ) ;
Line: 452

    /* The next check is redundant and harmful if a child line is being deleted from
       set. The check has already been done in process_sets(). Commented for 2525203.
    -- See if this is already fulfilled .  if fulfilled raise error
    oe_line_util.query_row(p_line_id => p_line_id,
			   x_line_rec => l_line_rec);
Line: 464

    /*Delete oe_line_sets
      Where line_id = p_line_id
      and set_id = p_set_id;*/
Line: 488

    Delete oe_line_sets
    Where line_id = p_line_id
    and set_id = p_set_id;
Line: 494

      oe_debug_pub.add(  'EXIT - DELETE FULLFILLMENT SET' ) ;
Line: 508

             'Delete Fulfillment Set'
         );
Line: 514

End Delete_Fulfillment_Set;
Line: 550

l_api_name         CONSTANT VARCHAR2(30) := 'Insert_Into_Set';
Line: 560

Select Ordered_quantity,
       header_id,
       Line_id
       from
       oe_order_lines_all where
       top_model_line_id = l_line_id and
       --and line_id <> l_line_id and
      nvl(cancelled_flag,'N') <> 'Y' and
       nvl(model_remnant_flag,'N') <> 'Y'
       ORDER BY arrival_set_id,ship_set_id,line_number,shipment_number,nvl(option_number,-1);
Line: 593

		l_line_tbl(l_count).operation := oe_globals.g_opr_update;
Line: 624

            l_old_line_tbl.delete;
Line: 640

			g_old_line_tbl.delete;
Line: 719

		l_line_tbl.delete;
Line: 754

Select Ordered_quantity,
       header_id,
       Line_id
       from
       oe_order_lines_all where
       top_model_line_id = l_line_id
       and line_id <> l_line_id and
       nvl(cancelled_flag,'N') <> 'Y' and
       nvl(model_remnant_flag,'N') <> 'Y'
       order by line_id;
Line: 843

		p_x_line_tbl(l_count).operation := oe_globals.g_opr_update;
Line: 879

Procedure Insert_Into_arrival_Set
        (p_Set_request_tbl             oe_order_pub.Request_Tbl_Type,
         p_Push_Set_Date                IN VARCHAR2 := FND_API.G_FALSE,
X_Return_Status OUT NOCOPY VARCHAR2,

x_msg_count OUT NOCOPY NUMBER,

x_msg_data OUT NOCOPY VARCHAR2

)IS
l_line_rec		  OE_ORDER_PUB.line_rec_type;
Line: 901

l_api_name         CONSTANT VARCHAR2(30) := 'Insert_Into_Set';
Line: 931

Select set_id from
oe_sets where
set_type = 'SHIP_SET'
and header_id = l_header_id
and ship_from_org_id = l_ship_from_org_id
and ship_to_org_id = l_ship_to_org_id
and trunc(schedule_ship_date) = trunc(l_Schedule_Ship_Date)
and nvl(set_status,'X') <> 'C'
;
Line: 942

Select set_id from
oe_sets where
set_type = 'ARRIVAL_SET' and
header_id = l_header_id
and ship_to_org_id = l_ship_to_org_id
and trunc(schedule_arrival_date) = trunc(l_Schedule_arrival_Date)
and nvl(set_status,'X') <> 'C';
Line: 951

select Max(to_number(set_name)) from
oe_sets
where
set_status = 'T'
and header_id = l_header_id and
set_type = l_set_type;
Line: 959

Select Schedule_ship_date,
Ship_from_org_id,
ship_to_org_id,
schedule_arrival_date,
ship_set_id,
arrival_set_id
from
oe_order_lines_all
where
line_id = l_top_model_line_id ;
Line: 976

select Max(to_number(set_name)) from
oe_sets
where
header_id = l_header_id and
set_type = l_set_type and
set_name = lsettempname;
Line: 996

         oe_debug_pub.add(  'INSERT_INTO ARRIVAL SETSS' , 1 ) ;
Line: 1021

	l_temp_line_tbl.delete;
Line: 1022

	g_old_line_tbl.delete;
Line: 1165

			l_sch_line_tbl.delete(l_sch_count) ;
Line: 1231

         g_old_line_tbl.delete;
Line: 1244

        l_sch_line_tbl.delete;
Line: 1255

		l_temp_line_tbl.delete;
Line: 1258

		l_sch_line_tbl.delete;
Line: 1356

	l_temp_line_tbl(K).operation := oe_globals.g_opr_update;
Line: 1492

	l_line_tbl.delete;
Line: 1508

		g_auto_set_tbl.delete;
Line: 1510

         oe_debug_pub.add(  ' EXIT INSERT INTO SETS' , 1 ) ;
Line: 1515

	g_auto_set_tbl.delete;
Line: 1556

            ,   'Insert_Into_Set'
            );
Line: 1567

End Insert_Into_arrival_Set;
Line: 1571

(   p_selected_line_tbl    IN OE_GLOBALS.Selected_Record_Tbl, --(R12.MOAC)
    p_record_count         IN NUMBER,
    p_set_name             IN VARCHAR2,
    p_set_type             IN VARCHAR2 := FND_API.G_MISS_CHAR,
    p_operation            IN VARCHAR2,
    p_header_id            IN VARCHAR2 := FND_API.G_MISS_CHAR,
x_Set_Id OUT NOCOPY NUMBER,

x_return_status OUT NOCOPY VARCHAR2,

x_msg_count OUT NOCOPY NUMBER,

x_msg_data OUT NOCOPY VARCHAR2

) IS

l_num_of_records NUMBER := p_record_count;
Line: 1689

 FOR I IN 1..p_selected_line_tbl.COUNT LOOP
  l_line_id := p_selected_line_tbl(I).id1;
Line: 1828

  l_line_tbl(I).operation := OE_GLOBALS.G_OPR_UPDATE;
Line: 1949

  SELECT set_id
  INTO x_set_id
  FROM OE_SETS
  where set_name = p_set_name
  and set_type = p_set_type and
  header_id = p_header_id ;
Line: 1986

  SELECT 'Y'
  INTO row_exists
  FROM OE_SETS
  WHERE set_id = p_set_id
  and header_id = nvl(l_header_id,header_id);
Line: 2102

      SELECT OE_SETS_S.NEXTVAL
      INTO   l_set_id
      FROM   DUAL;
Line: 2118

INSERT INTO OE_SETS(
  SET_ID
, SET_NAME
, SET_TYPE
, Header_Id
, Ship_from_org_id
, Ship_to_org_id
, Schedule_Ship_Date
, Schedule_Arrival_Date
, Freight_Carrier_Code
, Shipping_Method_Code
, Shipment_priority_code
, Set_Status
, CREATED_BY
,CREATION_DATE
,UPDATE_DATE
,UPDAtED_BY
)
 VALUES(
  l_set_id
, p_set_name
, p_Set_type
, p_Header_Id
, p_Ship_from_org_id
, p_Ship_to_org_id
, p_Schedule_Ship_Date
, p_Schedule_Arrival_Date
, p_Freight_Carrier_Code
, p_Shipping_Method_Code
,p_shipment_priority_code
, lcustpref
,1
,sysdate
,sysdate
,1001
    );
Line: 2157

         oe_debug_pub.add(  'AFTERINSERT ' , 1 ) ;
Line: 2210

Procedure Insert_Into_Set
        (p_Set_request_tbl             oe_order_pub.Request_Tbl_Type,
         p_Push_Set_Date                IN VARCHAR2 := FND_API.G_FALSE,
X_Return_Status OUT NOCOPY VARCHAR2,

x_msg_count OUT NOCOPY NUMBER,

x_msg_data OUT NOCOPY VARCHAR2

)IS
l_line_rec		  OE_ORDER_PUB.line_rec_type;
Line: 2233

l_api_name         CONSTANT VARCHAR2(30) := 'Insert_Into_Set';
Line: 2261

Select set_id from
oe_sets where
set_type = 'SHIP_SET'
and header_id = l_header_id
and ship_from_org_id = l_ship_from_org_id
and ship_to_org_id = l_ship_to_org_id
and trunc(schedule_ship_date) = trunc(l_Schedule_Ship_Date)
and nvl(set_status,'X') <> 'C'
;
Line: 2272

Select set_id from
oe_sets where
set_type = 'ARRIVAL_SET' and
header_id = l_header_id
and ship_to_org_id = l_ship_to_org_id
and trunc(schedule_arrival_date) = trunc(l_Schedule_arrival_Date)
and nvl(set_status,'X') <> 'C';
Line: 2281

select Max(to_number(set_name)) from
oe_sets
where
set_status = 'T'
and header_id = l_header_id and
set_type = l_set_type;
Line: 2289

Select Schedule_ship_date,
Ship_from_org_id,
ship_to_org_id,
schedule_arrival_date
from
oe_order_lines_all
where
line_id = l_top_model_line_id ;
Line: 2304

select Max(to_number(set_name)) from
oe_sets
where
header_id = l_header_id and
set_type = l_set_type and
set_name = lsettempname;
Line: 2312

select set_id,
Schedule_ship_date,
Ship_from_org_id,
ship_to_org_id
from
oe_sets
where
header_id = l_header_id and
set_type = 'SHIP_SET' and
set_status = 'T';
Line: 2336

         oe_debug_pub.add(  'INSERT_INTO SETSS' , 1 ) ;
Line: 2360

	 Insert_Into_arrival_Set
        (p_Set_request_tbl    => p_Set_request_tbl  ,
         X_Return_Status      => l_return_status ,
         x_msg_count          => x_msg_count,
         x_msg_data           => x_msg_data);
Line: 2386

	l_temp_line_tbl.delete;
Line: 2387

	g_old_line_tbl.delete;
Line: 2524

			l_sch_line_tbl.delete(l_sch_count) ;
Line: 2548

			g_old_line_tbl.delete;
Line: 2569

		l_temp_line_tbl.delete;
Line: 2654

	l_temp_line_tbl(K).operation := oe_globals.g_opr_update;
Line: 2761

	l_line_tbl.delete;
Line: 2776

		g_auto_set_tbl.delete;
Line: 2778

         oe_debug_pub.add(  ' EXIT INSERT INTO SETS' , 1 ) ;
Line: 2783

	g_auto_set_tbl.delete;
Line: 2823

            ,   'Insert_Into_Set'
            );
Line: 2834

End Insert_Into_Set;
Line: 2838

Procedure Update_Set
        (p_Set_Id                       IN NUMBER,
         p_Ship_From_Org_Id             IN NUMBER := FND_API.G_MISS_NUM,
         p_Ship_To_Org_Id               IN NUMBER := FND_API.G_MISS_NUM,
         p_Schedule_Ship_Date           IN DATE := FND_API.G_MISS_DATE,
         p_Schedule_Arrival_Date        IN DATE := FND_API.G_MISS_DATE,
         p_Freight_Carrier_Code         IN VARCHAR2 := FND_API.G_MISS_CHAR,
         p_Shipping_Method_Code IN VARCHAR2 := FND_API.G_MISS_CHAR,
         p_shipment_priority_code       IN VARCHAR2 := FND_API.G_MISS_CHAR,
X_Return_Status OUT NOCOPY VARCHAR2,

x_msg_count OUT NOCOPY NUMBER,

x_msg_data OUT NOCOPY VARCHAR2

)IS
l_set_rec 	OE_ORDER_CACHE.set_rec_type;
Line: 2919

	UPDATE OE_SETS SET
	ship_from_org_id = l_ship_from_org_id,
	ship_to_org_id   = l_ship_to_org_id,
	Schedule_Arrival_Date = l_Schedule_Arrival_Date,
   	Schedule_Ship_Date = l_Schedule_Ship_Date,
        Freight_Carrier_Code = l_Freight_Carrier_Code ,
        Shipping_Method_Code  =  l_Shipping_Method_Code,
        shipment_priority_code  = l_shipment_priority_code
	WHERE SET_ID = P_SET_ID;
Line: 2965

            ,   'Update_set'
            );
Line: 2975

End Update_Set;
Line: 3087

(   p_selected_line_tbl    IN OE_GLOBALS.Selected_Record_Tbl, -- R12.MOAC
    p_record_count	   IN NUMBER,
    p_set_name             IN VARCHAR2,
    p_set_type             IN VARCHAR2 := FND_API.G_MISS_CHAR,
    p_operation            IN VARCHAR2,
    p_header_id            IN VARCHAR2 := FND_API.G_MISS_CHAR,
x_Set_Id OUT NOCOPY NUMBER,

x_return_status OUT NOCOPY VARCHAR2,

x_msg_count OUT NOCOPY NUMBER,

x_msg_data OUT NOCOPY VARCHAR2

) IS
l_num_of_records            NUMBER := p_record_count;
Line: 3147

   (p_selected_line_tbl => p_selected_line_tbl,
    p_record_count     => p_record_count,
    p_set_name         => p_set_name,
    p_set_type         => p_set_type,
    p_operation        => p_operation,
    p_header_id        => p_header_id ,
    x_Set_Id           => x_set_id ,
    x_return_status    => x_return_status,
    x_msg_count        => x_msg_count,
    x_msg_data         => x_msg_data );
Line: 3254

 FOR K IN 1..p_selected_line_tbl.count LOOP

    l_line_id := p_selected_line_tbl(K).id1;
Line: 3454

					l_line_opt_tbl.delete;
Line: 3497

            l_line_opt_tbl.delete;
Line: 3525

	  	    Delete_Fulfillment_Set
               (p_line_id => l_line_opt_tbl(optrec).line_id,
                p_set_id => l_Set_id);
Line: 3530

         l_line_opt_tbl.delete;
Line: 3536

         Delete_Fulfillment_Set
              (p_line_id => l_line_id,
               p_set_id => l_Set_id);
Line: 3563

  l_line_tbl(I).operation := OE_GLOBALS.G_OPR_UPDATE;
Line: 3597

  l_line_opt_temp_tbl.delete;
Line: 3616

		g_old_line_tbl.delete;
Line: 3748

			g_old_line_tbl.delete;
Line: 3870

                  l_line_opt_tbl.delete;
Line: 4095

SELECT arrival_set_id INTO
       x_arrival_set_id
FROM OE_ORDER_LINES_ALL WHERE
header_id = p_header_id AND
ship_set_id = p_ship_set_id AND
arrival_set_id IS NOT NULL AND
rownum = 1;
Line: 4115

Procedure Update_Options(p_ato_line_id IN NUMBER := FND_API.G_MISS_NUM,
	       p_config_line_id IN NUMBER := FND_API.G_MISS_NUM,
	       p_set_id IN NUMBER,
	       p_set_type IN VARCHAR2 )IS
stmt_str varchar2(2000);
Line: 4144

stmt_str := 'UPDATE OE_ORDER_LINES_ALL ' ||
	    'SET '  || column1 || ' =  ' ||  to_char(p_set_id) ||
	    'WHERE ' || column2 || ' =  ' ||to_char(parent_line_id);
Line: 4156

END Update_Options;
Line: 4499

		ELSIF p_x_line_rec.operation = oe_globals.g_opr_update THEN
			g_set_tbl(I).line_id := p_x_line_rec.line_id;
Line: 4757

		ELSIF p_x_line_rec.operation = oe_globals.g_opr_update THEN
		g_set_tbl(I).line_id := p_x_line_rec.line_id;
Line: 4913

		ELSIF p_x_line_rec.operation = oe_globals.g_opr_update THEN
		g_set_tbl(I).line_id := p_x_line_rec.line_id;
Line: 4979

		ELSIF p_x_line_rec.operation = oe_globals.g_opr_update THEN
		g_set_tbl(I).line_id := p_x_line_rec.line_id;
Line: 5158

SELECT   line_id
FROM     oe_order_lines
WHERE    header_id = l_header_id
AND      (ship_set_id = p_set_id
OR       arrival_set_id = p_set_id)
ORDER BY line_number,shipment_number,nvl(option_number,-1);
Line: 5187

   Select header_id
   Into   l_header_id
   From   Oe_sets
   Where  set_id = p_set_id;
Line: 5254

     SELECT OE_SETS_S.NEXTVAL
      INTO   l_set_id
      FROM   DUAL;
Line: 5260

INSERT INTO OE_SETS(
  SET_ID
, SET_NAME
, SET_TYPE
, Header_Id
, inventory_item_id
, ordered_quantity_uom
, line_type_id
, Ship_tolerance_above
, ship_tolerance_below
, CREATED_BY
,CREATION_DATE
,UPDATE_DATE
,UPDATED_BY
)
 VALUES(
  l_set_id
, to_char(p_x_line_rec.line_id)
, 'SPLIT'
, p_x_line_rec.Header_Id
, p_x_line_rec.inventory_item_id
, p_x_line_rec.order_quantity_uom
, p_x_line_rec.line_type_id
, p_x_line_rec.Ship_tolerance_above
, p_x_line_rec.ship_tolerance_below
,1
,sysdate
,sysdate
,1001
    );
Line: 5293

         oe_debug_pub.add(  'AFTERINSERT'||TO_CHAR ( L_SET_ID ) , 1 ) ;
Line: 5296

         oe_debug_pub.add(  'AFTERINSERT ' , 1 ) ;
Line: 5326

l_api_name         CONSTANT VARCHAR2(30) := 'Insert_Into_Set';
Line: 5820

			--g_old_line_tbl.delete;
Line: 5918

					Update oe_order_lines_all
					set ship_set_id = l_set_id where
					top_model_line_id = l_line_tbl(K).line_id and
					item_type_code = 'INCLUDED';
Line: 5926

					Update oe_order_lines_all
					set arrival_set_id = l_set_id where
					top_model_line_id = l_line_tbl(K).line_id and
					item_type_code = 'INCLUDED';
Line: 5936

l_line_tbl(K).operation := oe_globals.g_opr_update;
Line: 6043

			l_line_tbl.delete;
Line: 6044

			g_old_line_tbl.delete;
Line: 6056

	 g_set_tbl.delete;
Line: 6072

	 		g_set_opt_tbl.delete;
Line: 6108

Select os.set_name from
oe_sets os,
oe_line_sets ls
where
ls.line_id = p_line_id and
os.set_id = ls.set_id;
Line: 6143

Delete oe_line_sets
where line_id = p_line_id;
Line: 6201

select Max(to_number(set_name))
from oe_sets
where set_status = 'T'
and   header_id = p_x_line_rec.header_id and
set_type = l_set_pref_type;
Line: 6208

select Max(to_number(set_name))
from   oe_sets
where  header_id = p_x_line_rec.header_id
and set_type = l_set_pref_type
and set_name = lsettempname;
Line: 6215

select set_id
from oe_sets
where header_id = p_x_line_rec.header_id
and set_type = l_set_pref_type
and set_status = 'T';
Line: 6223

select set_id
from oe_sets, oe_order_lines_all
where line_id = p_x_line_rec.line_id
and set_type = l_set_pref_type
and set_status = 'T'
AND set_id = Nvl(ship_set_id, arrival_set_id);
Line: 6232

select set_id
from   oe_sets
where  header_id = p_x_line_rec.header_id
and set_type = 'SHIP_SET'
and set_status = 'T'
AND Nvl(ship_from_org_id,p_x_line_rec.ship_from_org_id) = p_x_line_rec.ship_from_org_id;
Line: 6240

Select line_id, shipping_interfaced_flag
 from oe_order_lines_all
where top_model_line_id = p_x_line_rec.line_id
and open_flag = 'Y';
Line: 6246

select set_name
from oe_sets
where header_id = p_x_line_rec.header_id
and set_type =  'FULFILLMENT_SET'
and set_status = 'T';
Line: 6253

select set_name
from   oe_sets
where  header_id = p_x_line_rec.header_id
and set_type = l_set_pref_type;
Line: 6260

select set_id
from oe_sets
where header_id = p_x_line_rec.header_id
and set_type = l_set_pref_type
and set_status = 'T'
and set_name = nvl(p_x_line_rec.arrival_set,p_x_line_rec.ship_set);
Line: 6268

select line_id,ship_set_id,arrival_set_id
from oe_order_lines_all
where top_model_line_id=p_x_line_rec.line_id
and line_id<>p_x_line_rec.line_id
and open_flag='Y';
Line: 6275

SELECT inventory_item_id, ship_from_org_id, item_type_code,
       line_id,top_model_line_id,source_document_type_id,  line_number,
       shipment_number, option_number, component_number, service_number,
       line_category_code					--4241385
FROM oe_order_lines_all
WHERE ship_set_id = p_x_line_rec.ship_set_id;
Line: 6283

select set_id
from oe_sets, oe_order_lines_all
where line_id = p_x_line_rec.line_id
and set_status = 'A'
AND set_id = nvl(ship_set_id,arrival_set_id); --Bug 13691678
Line: 6308

              p_x_line_rec.operation = OE_GLOBALS.G_OPR_UPDATE) or
             (p_x_line_rec.operation = OE_GLOBALS.G_OPR_CREATE and
              p_x_line_rec.split_from_line_id is NOT NULL)) then

        IF  ((p_x_line_rec.arrival_set is not null AND
              p_x_line_rec.arrival_set <> FND_API.G_MISS_CHAR) OR
             (p_x_line_rec.arrival_set_id is not null AND
              p_x_line_rec.arrival_set_id <> FND_API.G_MISS_NUM))
        AND ((p_x_line_rec.ship_set is not null AND
              p_x_line_rec.ship_set <> FND_API.G_MISS_CHAR) OR
             (p_x_line_rec.ship_set_id is not null AND
              p_x_line_rec.ship_set_id <> FND_API.G_MISS_NUM))
        THEN

            IF l_debug_level  > 0 THEN
               oe_debug_pub.add(  'INVALID SER OPR' , 2 ) ;
Line: 6354

	   OR (p_x_line_rec.operation = oe_globals.g_opr_update --2843738
	      AND NOT OE_Globals.Equal(p_x_line_rec.ship_from_org_id, p_old_line_rec.ship_from_org_id)) -- 13706641 and 13788287
           /*OR (OE_Quote_Util.G_COMPLETE_NEG = 'Y'
             AND NOT OE_GLOBALS.EQUAL(p_x_line_rec.transaction_phase_code
                                     ,p_old_line_rec.transaction_phase_code)
                 )-- Comented for  2843738 */
           THEN

              OE_Order_Cache.Load_Order_Header(p_x_line_rec.header_id);
Line: 6373

                   select Nvl(ship_set_id,arrival_set_id)
                   into l_set_id
                   from oe_order_lines_all
                   where line_id= p_x_line_rec.top_model_line_id;
Line: 6424

                         select Min(set_id) INTO l_set_id from oe_sets
                         where header_id = p_x_line_rec.header_id
                         AND   set_status = 'T'
                         AND  not exists (select line_id FROM oe_order_lines_all
                                          WHERE ship_set_id = set_id);
Line: 6453

	            SELECT ol1.ship_set_id INTO l_set_id
	            FROM   oe_order_lines_all ol1
	            WHERE  ol1.line_id = p_x_line_rec.line_id
	            AND    NOT EXISTS ( SELECT 1 FROM oe_order_lines_all ol2
	                                WHERE  ol2.ship_set_id = ol1.ship_set_id
   	                                AND    Nvl(ol2.top_model_line_id,ol2.line_id) <> ol1.line_id);
Line: 6791

	-- Create or Update based on the flags set above

/* First we will create the set if l_create_flag is set to 'Y' */
	IF l_debug_level  > 0 THEN
	    oe_debug_pub.add(  'CREATE FLAG IS - ' || L_CREATE_SET , 1 ) ;
Line: 6895

             SELECT ship_from_org_id , schedule_ship_date ,shipping_method_code
	     , set_name
             INTO l_ship_from_org_id , l_schedule_ship_Date,l_shipping_method_code
	     , l_set_name_dsp
             FROM oe_sets
             WHERE set_id=p_x_line_rec.ship_set_id;
Line: 6916

             SELECT ship_from_org_id , schedule_ship_date, set_id ,shipping_method_code
             INTO l_ship_from_org_id , l_schedule_ship_Date , l_ship_set_id ,
	     l_shipping_method_code
             FROM oe_sets
             WHERE set_name = p_x_line_rec.ship_set
             and set_type = 'SHIP_SET'
	     and header_id = p_x_line_rec.header_id ;
Line: 6956

		      SELECT 1
		      INTO   l_validate_combinition
		      FROM   mtl_system_items_b msi,
                             org_organization_definitions org
		      WHERE  msi.inventory_item_id= i.inventory_item_id
                      AND    org.organization_id=msi.organization_id
                      AND    sysdate<=nvl(org.disable_date,sysdate)
                      AND    org.organization_id=p_x_line_rec.ship_from_org_id
                      AND    rownum=1 ;
Line: 6975

		/* if the new warehouse is valid on all the lines in the set, then update
		the new warehouse on all the lines and also update the set with the new
		warehouse information*/

                UPDATE oe_order_lines_all
		SET ship_from_org_id=p_x_line_rec.ship_from_org_id
		WHERE ship_set_id= p_x_line_rec.ship_set_id
		AND open_flag='Y';
Line: 6984

		Update_Set
	       (p_Set_Id                   => p_x_line_rec.ship_set_id,
		p_Ship_From_Org_Id         => p_x_line_rec.ship_from_org_id,
		p_Ship_To_Org_Id           => p_x_line_rec.Ship_To_Org_Id,
		p_Schedule_Ship_Date       => p_x_line_rec.Schedule_Ship_Date,
		p_Schedule_Arrival_Date    => p_x_line_rec.Schedule_Arrival_Date,
		p_Freight_Carrier_Code     => p_x_line_rec.Freight_Carrier_Code,
		p_Shipping_Method_Code     => p_x_line_rec.Shipping_Method_Code,
		p_shipment_priority_code   => p_x_line_rec.shipment_priority_code,
		X_Return_Status            => l_return_status,
		x_msg_count                => x_msg_count,
		x_msg_data                 => x_msg_data
		);
Line: 7043

		      SELECT  1
                      INTO    l_validate_combinition
                      FROM    OE_SHIP_METHODS_V
                      WHERE   lookup_code = p_x_line_rec.shipping_method_code
                      AND     ENABLED_FLAG = 'Y'
                      AND     SYSDATE BETWEEN NVL(START_DATE_ACTIVE, SYSDATE)
                      AND     NVL(END_DATE_ACTIVE, SYSDATE)
                      AND     ROWNUM = 1;
Line: 7061

		/* if the new warehouse is valid on all the lines in the set, then update
		the new warehouse on all the lines and also update the set with the new
		warehouse information*/

                UPDATE oe_order_lines_all
		SET shipping_method_code=p_x_line_rec.shipping_method_code
		WHERE ship_set_id= p_x_line_rec.ship_set_id
		AND open_flag='Y';
Line: 7070

		Update_Set
	       (p_Set_Id                   => p_x_line_rec.ship_set_id,
		p_Ship_From_Org_Id         => p_x_line_rec.ship_from_org_id,
		p_Ship_To_Org_Id           => p_x_line_rec.Ship_To_Org_Id,
		p_Schedule_Ship_Date       => p_x_line_rec.Schedule_Ship_Date,
		p_Schedule_Arrival_Date    => p_x_line_rec.Schedule_Arrival_Date,
		p_Freight_Carrier_Code     => p_x_line_rec.Freight_Carrier_Code,
		p_Shipping_Method_Code     => p_x_line_rec.Shipping_Method_Code,
		p_shipment_priority_code   => p_x_line_rec.shipment_priority_code,
		X_Return_Status            => l_return_status,
		x_msg_count                => x_msg_count,
		x_msg_data                 => x_msg_data
		);
Line: 7153

	/* Update set id on the children of the top model */

/*Changes for bug 6719457 start*/
	IF l_debug_level  > 0 THEN
      oe_debug_pub.add(  'Cascade flag is yes',1);
Line: 7161

	select ol.arrival_set_id
	into l_old_set_id
	from oe_order_lines_all ol
	where ol.top_model_line_id = p_x_line_rec.line_id
	and ol.line_id<>p_x_line_rec.line_id
	and rownum=1;
Line: 7176

	select distinct(ol.ship_set_id)
	into l_old_set_id
	from oe_order_lines_all ol
	where ol.top_model_line_id = p_x_line_rec.line_id
	and ol.line_id<>p_x_line_rec.line_id
	and rownum=1;
Line: 7191

     oe_debug_pub.add(  'After selecting, old set id is:'||l_old_set_id,1);
Line: 7196

		Update oe_order_lines_all l
		set
		arrival_set_id =
		decode(l_Set_type , 'ARRIVAL_SET', l_set_id,l.arrival_set_id),
		ship_set_id =
		decode(l_Set_type , 'SHIP_SET', l_set_id,l.ship_set_id),
		ship_from_org_id =  p_x_line_rec.ship_from_org_id -- 2843738
		WHERE
		top_model_line_id = p_x_line_rec.line_id
        AND open_flag = 'Y'
        and l.item_type_code<>'SERVICE'; -- added for bug 8369694
Line: 7323

             oe_debug_pub.add(  'UPDATE SHIPPING : CHILDREN OF MODEL FOR SETS ' || TO_CHAR ( OPTIONREC.LINE_ID ) , 1 ) ;
Line: 7331

          p_request_type              =>  OE_GLOBALS.G_UPDATE_SHIPPING,
          p_request_unique_key1       =>  OE_GLOBALS.G_OPR_UPDATE,
          p_param1                     =>      FND_API.G_TRUE,
          x_return_status               =>      l_return_status);
Line: 7346

		end;-- Begin of the update
Line: 7707

PROCEDURE: Delete_Set
DESCRIPTION:This api will delete set record from oe_sets table if
            the set is not associated with any line.
*/
Procedure Delete_Set(p_request_rec   IN  OE_ORDER_PUB.request_rec_type,
                     x_return_status OUT NOCOPY VARCHAR2)
IS
l_dummy  NUMBER;
Line: 7721

     oe_debug_pub.add(  'ENTERING DELETE SET' , 3 ) ;
Line: 7729

        SELECT 1
        INTO l_dummy
        FROM oe_order_lines_all
        WHERE header_id=p_request_rec.param2
        AND ship_set_id =p_request_rec.param1
        AND ROWNUM =1;
Line: 7740

        SELECT 1
        INTO l_dummy
        FROM oe_order_lines_all
        WHERE header_id=p_request_rec.param2
        AND arrival_set_id =p_request_rec.param1
        AND ROWNUM =1;
Line: 7757

        DELETE FROM OE_SETS
        WHERE set_id = p_request_rec.param1;
Line: 7763

          oe_debug_pub.add(  'IN OTHERS EXCEPTION OF DELETE SET ' , 3 ) ;
Line: 7767

     oe_debug_pub.add(  'EXITING DELETE SET' , 3 ) ;
Line: 7783

      ,   'Delete_Set'
       );
Line: 7786

END Delete_Set;
Line: 7817

        SELECT line_type_id INTO l_line_type_id
          FROM OE_ORDER_LINES_ALL
         WHERE header_id = p_header_id
           AND ship_set_id = p_ship_set_id
           AND line_id <> p_line_id
           AND rownum=1;
Line: 7845

        SELECT line_type_id INTO l_line_type_id
          FROM OE_ORDER_LINES_ALL
         WHERE header_id = p_header_id
           AND arrival_set_id = p_arrival_set_id
           AND line_id <> p_line_id
           AND rownum=1;