1 PACKAGE BODY OE_MASS_CHANGE_PVT AS
2 /* $Header: OEXVMSCB.pls 120.18.12020000.2 2013/01/07 13:31:03 sujithku ship $ */
3
4 -- 4020312
5 g_sel_rec_tbl OE_GLOBALS.Selected_Record_Tbl;
6
7 --bug4529937 start
8 G_BLK_NAME VARCHAR2(30);
9 G_NUM_OF_LINES NUMBER;
10 G_HEADER_CHANGED NUMBER; --- added for bug 6850537,7210480
11
12 Function Lines_Remaining Return Varchar2
13 IS
14 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
15 BEGIN
16 IF l_debug_level > 0 THEN
17 oe_debug_pub.add('In function Lines_Remaining',1);
18 oe_debug_pub.add('G_BLK_NAME' || G_BLK_NAME);
19 oe_debug_pub.add('G_NUM_OF_LINES' || G_NUM_OF_LINES);
20 END IF;
21
22 --Start Bug 6850537 ,7210480
23
24 IF G_BLK_NAME = 'LINES_SUMMARY' THEN
25 IF G_NUM_OF_LINES = 0 OR G_HEADER_CHANGED =1 THEN
26 IF l_debug_level>0 THEN
27 oe_debug_pub.ADD('NO more lines remains or header_id has changed');
28 END IF;
29 RETURN('N');
30 ELSE
31 IF l_debug_level >0 THEN
32 oe_debug_pub.ADD('There are some line remaining ');
33 END IF;
34 RETURN('Y');
35 END IF;
36 END IF;
37 --End Bug 6850537,7210480
38
39 IF G_BLK_NAME = 'LINE' THEN
40 IF G_NUM_OF_LINES = 0 THEN
41 IF l_debug_level > 0 THEN
42 oe_debug_pub.add('No more lines remaining');
43 END IF;
44 RETURN('N');
45 ELSE
46 IF l_debug_level > 0 THEN
47 oe_debug_pub.add('There are some more lines remaining');
48 END IF;
49 RETURN('Y');
50 END IF;
51 ELSE
52 RETURN('N');
53 END IF;
54 END Lines_Remaining;
55 --bug4529937 end
56
57 --===================================================================
58 -- PROCEDURE: Process_Order_Scalar : Performs mass change of header attributes
59 -- by calling Oe_Order_Pvt.Header for every header in p_sel_rec_tbl.
60 --
61 -- Caller : OE_MASSUPDATE.UpdateOrderAttributes (OEXOELIB.pld)
62 -- PARAMETERS:
63 -- p_sel_rec_tbl - List of selected header records for mass change.
64
65 --===================================================================
66
67 Procedure Process_Order_Scalar
68
69 ( p_num_of_records IN NUMBER
70 , p_sel_rec_tbl IN Oe_Globals.Selected_Record_Tbl
71 , p_multi_OU IN Boolean
72 --, p_record_ids IN VARCHAR2
73 , p_change_reason IN VARCHAR2
74 , p_change_comments IN VARCHAR2
75 , p_msg_count OUT NOCOPY NUMBER
76 , p_msg_data OUT NOCOPY VARCHAR2
77 , p_return_status OUT NOCOPY VARCHAR2
78 , p_mc_err_handling_flag IN NUMBER DEFAULT FND_API.G_MISS_NUM
79 , p_error_count OUT NOCOPY NUMBER
80 , p_accounting_rule_id IN NUMBER
81 , p_accounting_rule_duration IN NUMBER
82 , p_agreement_id IN NUMBER
83 , p_attribute1 IN VARCHAR2
84 , p_attribute10 IN VARCHAR2
85 , p_attribute11 IN VARCHAR2
86 , p_attribute12 IN VARCHAR2
87 , p_attribute13 IN VARCHAR2
88 , p_attribute14 IN VARCHAR2
89 , p_attribute15 IN VARCHAR2
90 , p_attribute16 IN VARCHAR2 --For bug 2184255
91 , p_attribute17 IN VARCHAR2
92 , p_attribute18 IN VARCHAR2
93 , p_attribute19 IN VARCHAR2
94 , p_attribute2 IN VARCHAR2
95 , p_attribute20 IN VARCHAR2
96 , p_attribute3 IN VARCHAR2
97 , p_attribute4 IN VARCHAR2
98 , p_attribute5 IN VARCHAR2
99 , p_attribute6 IN VARCHAR2
100 , p_attribute7 IN VARCHAR2
101 , p_attribute8 IN VARCHAR2
102 , p_attribute9 IN VARCHAR2
103 , p_blanket_number IN NUMBER
104 , p_context IN VARCHAR2
105 , p_conversion_rate IN NUMBER
106 , p_conversion_rate_date IN DATE
107 , p_conversion_type_code IN VARCHAR2
108 , p_cust_po_number IN VARCHAR2
109 , p_deliver_to_contact_id IN NUMBER
110 , p_deliver_to_org_id IN NUMBER
111 , p_demand_class_code IN VARCHAR2
112 , p_expiration_date IN DATE
113 , p_earliest_schedule_limit IN NUMBER
114 , p_fob_point_code IN VARCHAR2
115 , p_freight_carrier_code IN VARCHAR2
116 , p_freight_terms_code IN VARCHAR2
117 , p_global_attribute1 IN VARCHAR2
118 , p_global_attribute10 IN VARCHAR2
119 , p_global_attribute11 IN VARCHAR2
120 , p_global_attribute12 IN VARCHAR2
121 , p_global_attribute13 IN VARCHAR2
122 , p_global_attribute14 IN VARCHAR2
123 , p_global_attribute15 IN VARCHAR2
124 , p_global_attribute16 IN VARCHAR2
125 , p_global_attribute17 IN VARCHAR2
126 , p_global_attribute18 IN VARCHAR2
127 , p_global_attribute19 IN VARCHAR2
128 , p_global_attribute2 IN VARCHAR2
129 , p_global_attribute20 IN VARCHAR2
130 , p_global_attribute3 IN VARCHAR2
131 , p_global_attribute4 IN VARCHAR2
132 , p_global_attribute5 IN VARCHAR2
133 , p_global_attribute6 IN VARCHAR2
134 , p_global_attribute7 IN VARCHAR2
135 , p_global_attribute8 IN VARCHAR2
136 , p_global_attribute9 IN VARCHAR2
137 , p_global_attribute_category IN VARCHAR2
138 , p_header_id IN NUMBER
139 , p_invoice_to_contact_id IN NUMBER
140 , p_invoice_to_org_id IN NUMBER
141 , p_invoicing_rule_id IN NUMBER
142 , p_latest_schedule_limit IN NUMBER
143 , p_ordered_date IN DATE
144 , p_order_date_type_code IN VARCHAR2
145 , p_order_number IN NUMBER
146 , p_order_source_id IN NUMBER
147 , p_order_type_id IN NUMBER
148 , p_org_id IN NUMBER
149 , p_orig_sys_document_ref IN VARCHAR2
150 , p_partial_shipments_allowed IN VARCHAR2
151 , p_payment_term_id IN NUMBER
152 , p_price_list_id IN NUMBER
153 , p_pricing_date IN DATE
154 , p_request_date IN DATE
155 , p_shipment_priority_code IN VARCHAR2
156 , p_shipping_method_code IN VARCHAR2
157 , p_ship_from_org_id IN NUMBER
158 , p_ship_tolerance_above IN NUMBER
159 , p_ship_tolerance_below IN NUMBER
160 , p_ship_to_contact_id IN NUMBER
161 , p_ship_to_org_id IN NUMBER
162 , p_sold_to_contact_id IN NUMBER
163 , p_sold_to_org_id IN NUMBER
164 , p_source_document_id IN NUMBER
165 , p_source_document_type_id IN NUMBER
166 , p_tax_exempt_flag IN VARCHAR2
167 , p_tax_exempt_number IN VARCHAR2
168 , p_tax_exempt_reason_code IN VARCHAR2
169 , p_tax_point_code IN VARCHAR2
170 , p_transactional_curr_code IN VARCHAR2
171 , p_version_number IN NUMBER
172 , p_accounting_rule IN VARCHAR2
173 , p_agreement IN VARCHAR2
174 , p_conversion_type IN VARCHAR2
175 , p_deliver_to_address1 IN VARCHAR2
176 , p_deliver_to_address2 IN VARCHAR2
177 , p_deliver_to_address3 IN VARCHAR2
178 , p_deliver_to_address4 IN VARCHAR2
179 , p_deliver_to_contact IN VARCHAR2
180 , p_deliver_to_location IN VARCHAR2
181 , p_deliver_to_org IN VARCHAR2
182 , p_fob_point IN VARCHAR2
183 , p_freight_terms IN VARCHAR2
184 , p_invoice_to_address1 IN VARCHAR2
185 , p_invoice_to_address2 IN VARCHAR2
186 , p_invoice_to_address3 IN VARCHAR2
187 , p_invoice_to_address4 IN VARCHAR2
188 , p_invoice_to_contact IN VARCHAR2
189 , p_invoice_to_location IN VARCHAR2
190 , p_invoice_to_org IN VARCHAR2
191 , p_invoicing_rule IN VARCHAR2
192 , p_order_source IN VARCHAR2
193 , p_order_type IN VARCHAR2
194 , p_payment_term IN VARCHAR2
195 , p_price_list IN VARCHAR2
196 , p_shipment_priority IN VARCHAR2
197 , p_ship_from_address1 IN VARCHAR2
198 , p_ship_from_address2 IN VARCHAR2
199 , p_ship_from_address3 IN VARCHAR2
200 , p_ship_from_address4 IN VARCHAR2
201 , p_ship_from_location IN VARCHAR2
202 , p_ship_from_org IN VARCHAR2
203 , p_ship_to_address1 IN VARCHAR2
204 , p_ship_to_address2 IN VARCHAR2
205 , p_ship_to_address3 IN VARCHAR2
206 , p_ship_to_address4 IN VARCHAR2
207 , p_ship_to_contact IN VARCHAR2
208 , p_ship_to_location IN VARCHAR2
209 , p_ship_to_org IN VARCHAR2
210 , p_sold_to_contact IN VARCHAR2
211 , p_sold_to_org IN VARCHAR2
212 , p_tax_exempt IN VARCHAR2
213 , p_tax_exempt_reason IN VARCHAR2
214 , p_tax_point IN VARCHAR2
215 , p_salesrep_id IN NUMBER
216 , p_return_reason_code IN VARCHAR2
217 , p_salesrep IN VARCHAR2
218 , p_return_reason IN VARCHAR2
219 , p_payment_type_code IN VARCHAR2
220 , p_payment_amount IN NUMBER
221 , p_check_number IN VARCHAR2
222 , p_credit_card_code IN VARCHAR2
223 , p_credit_card_holder_name IN VARCHAR2
224 , p_credit_card_number IN VARCHAR2
225 , p_instrument_security_code IN VARCHAR2 --bug 5191301
226 , p_credit_card_expiration_date IN DATE
227 , p_credit_card_approval_date IN DATE
228 , p_credit_card_approval_code IN VARCHAR2
229 , p_payment_type IN VARCHAR2
230 , p_credit_card IN VARCHAR2
231 , p_first_ack_code IN VARCHAR2
232 , p_first_ack_date IN DATE
233 , p_last_ack_code IN VARCHAR2
234 , p_last_ack_date IN DATE
235 , p_tp_attribute1 IN VARCHAR2
236 , p_tp_attribute10 IN VARCHAR2
237 , p_tp_attribute11 IN VARCHAR2
238 , p_tp_attribute12 IN VARCHAR2
239 , p_tp_attribute13 IN VARCHAR2
240 , p_tp_attribute14 IN VARCHAR2
241 , p_tp_attribute15 IN VARCHAR2
242 , p_tp_attribute2 IN VARCHAR2
243 , p_tp_attribute3 IN VARCHAR2
244 , p_tp_attribute4 IN VARCHAR2
245 , p_tp_attribute5 IN VARCHAR2
246 , p_tp_attribute6 IN VARCHAR2
247 , p_tp_attribute7 IN VARCHAR2
248 , p_tp_attribute8 IN VARCHAR2
249 , p_tp_attribute9 IN VARCHAR2
250 , p_tp_context IN VARCHAR2
251 , p_shipping_instructions IN VARCHAR2
252 , p_packing_instructions IN VARCHAR2
253 , p_sales_channel_code IN VARCHAR2
254 --My Addition
255 , p_sold_to_address1 IN VARCHAR2
256 , p_sold_to_address2 IN VARCHAR2
257 , p_sold_to_address3 IN VARCHAR2
258 , p_sold_to_address4 IN VARCHAR2
259 , p_sold_to_location IN VARCHAR2
260 , p_sold_to_site_use_id IN NUMBER
261 --end custoemr chagnes
262 , p_end_customer_contact_id IN NUMBER
263 , p_end_customer_id IN NUMBER
264 , p_end_customer_site_use_id IN NUMBER
265 , p_end_customer_address1 IN VARCHAR2
266 , p_end_customer_address2 IN VARCHAR2
267 , p_end_customer_address3 IN VARCHAR2
268 , p_end_customer_address4 IN VARCHAR2
269 , p_end_customer_contact IN VARCHAR2
270 , p_end_customer_location IN VARCHAR2
271 , p_ib_owner IN VARCHAR2
272 , p_ib_installed_at_location IN VARCHAR2
273 , p_ib_current_location IN VARCHAR2
274 , p_cascade_header_changes IN VARCHAR2 -- Added for Cascade Header changes in Mass Change ER 7509356
275
276
277 ) IS
278 l_header_rec OE_Order_PUB.Header_Rec_Type;
279 l_old_header_rec OE_Order_PUB.Header_Rec_Type;
280 l_control_rec OE_GLOBALS.Control_Rec_Type;
281 l_x_header_rec OE_Order_PUB.Header_Rec_Type;
282 l_mc_err_handling_flag NUMBER := p_mc_err_handling_flag ;
283 l_init_msg_list VARCHAR2(1) := 'F';
284 l_return_status VARCHAR2(30);
285 l_api_name CONSTANT VARCHAR2(30) := 'Process_Order_Scalar';
286 l_line_id Number;
287 l_header_id Number;
288 l_sold_to_org_id NUMBER := p_sold_to_org_id;
289 l_ship_to_org_id NUMBER := p_ship_to_org_id;
290 l_error_count NUMBER :=0;
291 l_line_tbl oe_order_pub.line_tbl_type;
292
293 j Integer;
294 initial Integer;
295 nextpos Integer;
296 l_current_org_id Number;
297 begin
298 /*j := 1;
299 initial := 1;
300 nextpos := INSTR(p_record_ids,',',1,j) ;
301 */
302 OE_MSG_PUB.initialize;
303 --MOAC PI
304 IS_MASS_CHANGE := 'T'; -- Added for cascading header changes ER 7509356
305 FOR i IN p_sel_rec_tbl.first..p_sel_rec_tbl.last LOOP
306 --{
307 BEGIN
308 l_header_id := p_sel_rec_tbl(i).id1;
309 If p_multi_OU Then
310 If l_Current_org_id Is Null or l_current_org_id<> p_sel_rec_tbl(i).org_id THEN
311 MO_GLOBAL.SET_POLICY_CONTEXT('S',p_sel_rec_tbl(i).org_id);
312 OE_Order_Cache.Clear_Price_List(); --Added to clear price-list cache when there is org change (Bug # 5168409)
313 L_current_org_id:= p_sel_rec_tbl(i).org_id;
314 End If;
315 Else
316 If i = 1 Then
317 MO_GLOBAL.SET_POLICY_CONTEXT('S',p_sel_rec_tbl(i).org_id);
318 End If;
319 End If;
320 --MOAC PI
321 G_COUNTER:=G_COUNTER+1;
322 --dbms_output.put_line('ini='||to_char(initial)||'next='||to_char(nextpos));
323 l_header_rec := OE_Order_PUB.G_MISS_HEADER_REC;
324 l_old_header_rec := OE_Order_PUB.G_MISS_HEADER_REC;
325 -- l_header_id := to_number(substr(p_record_ids,initial, nextpos-initial));
326 --dbms_output.put_line('id='||to_char(l_header_id));
327 -- initial := nextpos + 1;
328 /* j := j + 1;
329 nextpos := INSTR(p_record_ids,',',1,j);
330 */
331 l_header_rec.operation := OE_GLOBALS.G_OPR_UPDATE;
332 l_header_rec.header_id := l_header_id;
333 -- l_old_header_rec.header_id := l_header_id;
334
335 SAVEPOINT Process_Order_Scalar;
336 OE_Header_Util.Lock_Row
337 ( x_return_status => l_return_status
338 , p_x_header_rec => l_x_header_rec
339 , p_header_id => l_header_id);
340
341 IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
342 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
343 ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
344 RAISE FND_API.G_EXC_ERROR;
345 END IF;
346
347
348
349
350 if p_accounting_rule_id is not null then
351 l_header_rec.accounting_rule_id:=p_accounting_rule_id;
352 end if;
353
354 if p_accounting_rule_duration is not null then
355 l_header_rec.accounting_rule_duration:=p_accounting_rule_duration;
356 end if;
357
358 if p_agreement_id is not null then
359 l_header_rec.agreement_id:=p_agreement_id;
360 end if;
361
362 if p_attribute1 is not null then
363 l_header_rec.attribute1:=p_attribute1;
364 end if;
365
366 if p_attribute10 is not null then
367 l_header_rec.attribute10:=p_attribute10;
368 end if;
369
370 if p_attribute11 is not null then
371 l_header_rec.attribute11:=p_attribute11;
372 end if;
373
374 if p_attribute12 is not null then
375 l_header_rec.attribute12:=p_attribute12;
376 end if;
377
378 if p_attribute13 is not null then
379 l_header_rec.attribute13:=p_attribute13;
380 end if;
381
382 if p_attribute14 is not null then
383 l_header_rec.attribute14:=p_attribute14;
384 end if;
385
386 if p_attribute15 is not null then
387 l_header_rec.attribute15:=p_attribute15;
388 end if;
389
390 -- for bug 2184255
391 if p_attribute16 is not null then
392 l_header_rec.attribute16:=p_attribute16;
393 end if;
394
395 if p_attribute17 is not null then
396 l_header_rec.attribute17:=p_attribute17;
397 end if;
398
399 if p_attribute18 is not null then
400 l_header_rec.attribute18:=p_attribute18;
401 end if;
402
403 if p_attribute19 is not null then
404 l_header_rec.attribute19:=p_attribute19;
405 end if;
406
407 if p_attribute2 is not null then
408 l_header_rec.attribute2:=p_attribute2;
409 end if;
410
411 if p_attribute20 is not null then
412 l_header_rec.attribute20:=p_attribute20;
413 end if;
414
415 if p_attribute3 is not null then
416 l_header_rec.attribute3:=p_attribute3;
417 end if;
418
419 if p_attribute4 is not null then
420 l_header_rec.attribute4:=p_attribute4;
421 end if;
422
423 if p_attribute5 is not null then
424 l_header_rec.attribute5:=p_attribute5;
425 end if;
426
427 if p_attribute6 is not null then
428 l_header_rec.attribute6:=p_attribute6;
429 end if;
430
431 if p_attribute7 is not null then
432 l_header_rec.attribute7:=p_attribute7;
433 end if;
434
435 if p_attribute8 is not null then
436 l_header_rec.attribute8:=p_attribute8;
437 end if;
438
439 if p_attribute9 is not null then
440 l_header_rec.attribute9:=p_attribute9;
441 end if;
442
443 IF p_blanket_number is not null THEN
444 l_header_rec.blanket_number:=p_blanket_number;
445 END IF;
446
447 if p_context is not null then
448 l_header_rec.context:=p_context;
449 end if;
450
451 if p_conversion_rate_date is not null then
452 l_header_rec.conversion_rate_date:=p_conversion_rate_date;
453 end if;
454
455 if p_conversion_rate is not null then
456 l_header_rec.conversion_rate:=p_conversion_rate;
457 end if;
458
459 if p_conversion_type_code is not null then
460 l_header_rec.conversion_type_code:=p_conversion_type_code;
461 end if;
462
463 if p_sales_Channel_Code is not null then
464 l_header_rec.sales_channel_code:=p_sales_channel_code;
465 end if;
466
467 if p_shipping_instructions is not null then
468 l_header_rec.shipping_instructions:=p_shipping_instructions;
469 end if;
470
471 if p_packing_instructions is not null then
472 l_header_rec.packing_instructions:=p_packing_instructions;
473 end if;
474
475 if p_cust_po_number is not null then
476 l_header_rec.cust_po_number:=p_cust_po_number;
477 end if;
478
479 if p_deliver_to_contact_id is not null then
480 l_header_rec.deliver_to_contact_id:=p_deliver_to_contact_id;
481 end if;
482
483 if p_deliver_to_org_id is not null then
484 l_header_rec.deliver_to_org_id:=p_deliver_to_org_id;
485 end if;
486
487 if p_demand_class_code is not null then
488 l_header_rec.demand_class_code:=p_demand_class_code;
489 end if;
490
491 if p_expiration_date is not null then
492 l_header_rec.expiration_date:=p_expiration_date;
493 end if;
494
495 if p_earliest_schedule_limit is not null then
496 l_header_rec.earliest_schedule_limit:=p_earliest_schedule_limit;
497 end if;
498
499 if p_fob_point_code is not null then
500 l_header_rec.fob_point_code:=p_fob_point_code;
501 end if;
502
503 if p_freight_carrier_code is not null then
504 l_header_rec.freight_carrier_code:=p_freight_carrier_code;
505 end if;
506
507 if p_freight_terms_code is not null then
508 l_header_rec.freight_terms_code:=p_freight_terms_code;
509 end if;
510
511 if p_global_attribute1 is not null then
512 l_header_rec.global_attribute1:=p_global_attribute1;
513 end if;
514
515 if p_global_attribute10 is not null then
516 l_header_rec.global_attribute10:=p_global_attribute10;
517 end if;
518
519 if p_global_attribute11 is not null then
520 l_header_rec.global_attribute11:=p_global_attribute11;
521 end if;
522
523
524 if p_global_attribute12 is not null then
525 l_header_rec.global_attribute12:=p_global_attribute12;
526 end if;
527
528 if p_global_attribute13 is not null then
529 l_header_rec.global_attribute13:=p_global_attribute13;
530 end if;
531
532 if p_global_attribute14 is not null then
533 l_header_rec.global_attribute14:=p_global_attribute14;
534 end if;
535
536 if p_global_attribute15 is not null then
537 l_header_rec.global_attribute15:=p_global_attribute15;
538 end if;
539
540 if p_global_attribute16 is not null then
541 l_header_rec.global_attribute16:=p_global_attribute16;
542 end if;
543
544 if p_global_attribute17 is not null then
545 l_header_rec.global_attribute17:=p_global_attribute17;
546 end if;
547
548 if p_global_attribute18 is not null then
549 l_header_rec.global_attribute18:=p_global_attribute18;
550 end if;
551
552 if p_global_attribute19 is not null then
553 l_header_rec.global_attribute19:=p_global_attribute19;
554 end if;
555
556 if p_global_attribute20 is not null then
557 l_header_rec.global_attribute20:=p_global_attribute20;
558 end if;
559
560 if p_global_attribute2 is not null then
561 l_header_rec.global_attribute2:=p_global_attribute2;
562 end if;
563
564 if p_global_attribute3 is not null then
565 l_header_rec.global_attribute3:=p_global_attribute3;
566 end if;
567
568 if p_global_attribute4 is not null then
569 l_header_rec.global_attribute4:=p_global_attribute4;
570 end if;
571
572 if p_global_attribute5 is not null then
573 l_header_rec.global_attribute5:=p_global_attribute5;
574 end if;
575
576 if p_global_attribute6 is not null then
577 l_header_rec.global_attribute6:=p_global_attribute6;
578 end if;
579
580 if p_global_attribute7 is not null then
581 l_header_rec.global_attribute7:=p_global_attribute7;
582 end if;
583
584 if p_global_attribute8 is not null then
585 l_header_rec.global_attribute8:=p_global_attribute8;
586 end if;
587
588 if p_global_attribute9 is not null then
589 l_header_rec.global_attribute9:=p_global_attribute9;
590 end if;
591
592 if p_global_attribute_category is not null then
593 l_header_rec.global_attribute_category:=p_global_attribute_category;
594 end if;
595
596 if p_header_id is not null then
597 l_header_rec.header_id:=p_header_id;
598 end if;
599
600 if p_invoice_to_contact_id is not null then
601 l_header_rec.invoice_to_contact_id :=p_invoice_to_contact_id ;
602 end if;
603
604 if p_invoice_to_org_id is not null then
605 l_header_rec.invoice_to_org_id:=p_invoice_to_org_id;
606 end if;
607
608 if p_invoicing_rule_id is not null then
609 l_header_rec.invoicing_rule_id:=p_invoicing_rule_id;
610 end if;
611
612 if p_latest_schedule_limit is not null then
613 l_header_rec.latest_schedule_limit:=p_latest_schedule_limit;
614 end if;
615
616 if p_ordered_date is not null then
617 l_header_rec.ordered_date:=p_ordered_date;
618 end if;
619
620 if p_order_date_type_code is not null then
621 l_header_rec.order_date_type_code:=p_order_date_type_code;
622 end if;
623
624 if p_order_number is not null then
625 l_header_rec.order_number:=p_order_number;
626 end if;
627
628 if p_order_source_id is not null then
629 l_header_rec.order_source_id:=p_order_source_id;
630 end if;
631
632 if p_order_type_id is not null then
633 l_header_rec.order_type_id:=p_order_type_id;
634 end if;
635
636 if p_org_id is not null then
637 l_header_rec.org_id:= p_org_id ;
638 end if;
639
640 if p_orig_sys_document_ref is not null then
641 l_header_rec.orig_sys_document_ref:=p_orig_sys_document_ref;
642 end if;
643
644 if p_partial_shipments_allowed is not null then
645 l_header_rec.partial_shipments_allowed:=p_partial_shipments_allowed;
646 end if;
647
648 if p_payment_term_id is not null then
649 l_header_rec.payment_term_id:=p_payment_term_id;
650 end if;
651
652 if p_price_list_id is not null then
653 l_header_rec.price_list_id:=p_price_list_id;
654 end if;
655
656 if p_pricing_date is not null then
657 l_header_rec.pricing_date:=p_pricing_date;
658 end if;
659
660 if p_request_date is not null then
661 l_header_rec.request_date:=p_request_date;
662 end if;
663
664 if p_shipment_priority_code is not null then
665 l_header_rec.shipment_priority_code:=p_shipment_priority_code;
666 end if;
667
668 if p_shipping_method_code is not null then
669 l_header_rec.shipping_method_code:=p_shipping_method_code;
670 end if;
671
672 if p_ship_from_org_id is not null then
673 l_header_rec.ship_from_org_id:=p_ship_from_org_id;
674 end if;
675
676 if p_ship_tolerance_above is not null then
677 l_header_rec.ship_tolerance_above:= p_ship_tolerance_above;
678 end if;
679
680 if p_ship_tolerance_below is not null then
681 l_header_rec.ship_tolerance_below:= p_ship_tolerance_below;
682 end if;
683
684 if p_ship_to_contact_id is not null then
685 l_header_rec.ship_to_contact_id :=p_ship_to_contact_id ;
686 end if;
687
688 if p_ship_to_org_id is not null then
689 l_header_rec.ship_to_org_id:=p_ship_to_org_id;
690 end if;
691
692 if p_sold_to_contact_id is not null then
693 l_header_rec.sold_to_contact_id:=p_sold_to_contact_id;
694 end if;
695
696 if p_sold_to_org_id is not null then
697 l_header_rec.sold_to_org_id :=p_sold_to_org_id;
698 end if;
699
700 if p_source_document_id is not null then
701 l_header_rec.source_document_id:=p_source_document_id;
702 end if;
703
704 if p_source_document_type_id is not null then
705 l_header_rec.source_document_type_id:=p_source_document_type_id;
706 end if;
707
708 if p_tax_exempt_flag is not null then
709 l_header_rec.tax_exempt_flag:=p_tax_exempt_flag;
710 end if;
711
712 if p_tax_exempt_number is not null then
713 l_header_rec.tax_exempt_number:=p_tax_exempt_number;
714 end if;
715
716 if p_tax_exempt_reason_code is not null then
717 l_header_rec.tax_exempt_reason_code:=p_tax_exempt_reason_code;
718 end if;
719
720 if p_tax_point_code is not null then
721 l_header_rec.tax_point_code:=p_tax_point_code;
722 end if;
723
724 if p_transactional_curr_code is not null then
725 l_header_rec.transactional_curr_code:=p_transactional_curr_code;
726 end if;
727
728 if p_version_number is not null then
729 l_header_rec.version_number:=p_version_number;
730 end if;
731
732 if p_salesrep_id is not null then
733 l_header_rec.salesrep_id:=p_salesrep_id;
734 end if;
735
736 if p_return_reason_code is not null then
737 l_header_rec.return_reason_code:=p_return_reason_code;
738 end if;
739
740 if p_version_number is not null then
741 l_header_rec.version_number:=p_version_number;
742 end if;
743
744 if p_payment_type_code is not null then
745 l_header_rec.payment_type_code:=p_payment_type_code;
746 end if;
747
748 if p_payment_amount is not null then
749 l_header_rec.payment_amount:=p_payment_amount;
750 end if;
751
752 if p_check_number is not null then
753 l_header_rec.check_number:=p_check_number;
754 end if;
755
756 if p_credit_card_code is not null then
757 l_header_rec.credit_card_code:=p_credit_card_code;
758 end if;
759
760 if p_credit_card_holder_name is not null then
761 l_header_rec.credit_card_holder_name:=p_credit_card_holder_name;
762 end if;
763
764 if p_credit_card_number is not null then
765 l_header_rec.credit_card_number:=p_credit_card_number;
766 l_header_rec.CC_INSTRUMENT_ID := NULL; --12673677
767 l_header_rec.CC_INSTRUMENT_ASSIGNMENT_ID :=NULL; --12673677
768 end if;
769
770 --bug 5191301
771 if p_instrument_security_code is not null then
772 l_header_rec.instrument_security_code := p_instrument_security_code;
773 end if;
774 --bug 5191301
775
776 if p_credit_card_expiration_date is not null then
777 l_header_rec.credit_card_expiration_date:=p_credit_card_expiration_date;
778 end if;
779
780 if p_credit_card_approval_date is not null then
781 l_header_rec.credit_card_approval_date :=p_credit_card_approval_date;
782 end if;
783
784 if p_credit_card_approval_code is not null then
785 l_header_rec.credit_card_approval_code:=p_credit_card_approval_code;
786 end if;
787
788 if p_credit_card_approval_code is not null then
789 l_header_rec.credit_card_approval_code:=p_credit_card_approval_code;
790 end if;
791
792 if p_first_ack_code is not null then
793 l_header_rec.first_ack_code:=p_first_ack_code;
794 end if;
795
796 if p_first_ack_date is not null then
797 l_header_rec.first_ack_date:=p_first_ack_date;
798 end if;
799
800 if p_last_ack_code is not null then
801 l_header_rec.last_ack_code:=p_last_ack_code;
802 end if;
803
804 if p_last_ack_date is not null then
805 l_header_rec.last_ack_date:=p_last_ack_date;
806 end if;
807
808 if p_tp_context is not null then
809 l_header_rec.tp_context:=p_tp_context;
810 end if;
811
812 if p_tp_attribute1 is not null then
813 l_header_rec.tp_attribute1:=p_tp_attribute1;
814 end if;
815
816 if p_tp_attribute2 is not null then
817 l_header_rec.tp_attribute2:=p_tp_attribute2;
818 end if;
819
820 if p_tp_attribute3 is not null then
821 l_header_rec.tp_attribute3:=p_tp_attribute3;
822 end if;
823
824 if p_tp_attribute4 is not null then
825 l_header_rec.tp_attribute4:=p_tp_attribute4;
826 end if;
827
828 if p_tp_attribute5 is not null then
829 l_header_rec.tp_attribute5:=p_tp_attribute5;
830 end if;
831
832 if p_tp_attribute6 is not null then
833 l_header_rec.tp_attribute6:=p_tp_attribute6;
834 end if;
835
836 if p_tp_attribute7 is not null then
837 l_header_rec.tp_attribute7:=p_tp_attribute7;
838 end if;
839
840 if p_tp_attribute8 is not null then
841 l_header_rec.tp_attribute8:=p_tp_attribute8;
842 end if;
843
844 if p_tp_attribute9 is not null then
845 l_header_rec.tp_attribute9:=p_tp_attribute9;
846 end if;
847
848 if p_tp_attribute10 is not null then
849 l_header_rec.tp_attribute10:=p_tp_attribute10;
850 end if;
851
852 if p_tp_attribute11 is not null then
853 l_header_rec.tp_attribute11:=p_tp_attribute11;
854 end if;
855
856 if p_tp_attribute12 is not null then
857 l_header_rec.tp_attribute12:=p_tp_attribute12;
858 end if;
859
860 if p_tp_attribute13 is not null then
861 l_header_rec.tp_attribute13:=p_tp_attribute13;
862 end if;
863
864 if p_tp_attribute14 is not null then
865 l_header_rec.tp_attribute14:=p_tp_attribute14;
866 end if;
867
868 if p_tp_attribute15 is not null then
869 l_header_rec.tp_attribute15:=p_tp_attribute15;
870 end if;
871
872 --My Addition
873 if p_sold_to_site_use_id is not null then
874 l_header_rec.sold_to_site_use_id:=p_sold_to_site_use_id;
875 end if;
876
877 /* Start Audit Trail */
878 if p_change_reason is not null then
879 l_header_rec.change_reason := p_change_reason;
880 end if;
881
882 if p_change_comments is not null then
883 l_header_rec.change_comments := p_change_comments;
884 end if;
885 /* End Audit Trail */
886
887 /*End Customer Changes */
888 if p_end_customer_contact_id is not null then
889 l_header_rec.end_customer_contact_id := p_end_customer_contact_id;
890 end if;
891 if p_end_customer_id is not null then
892 l_header_rec.end_customer_id := p_end_customer_id;
893 end if;
894 if p_end_customer_site_use_id is not null then
895 l_header_rec.end_customer_site_use_id := p_end_customer_site_use_id;
896 end if;
897 if p_ib_owner is not null then
898 l_header_rec.ib_owner := p_ib_owner;
899 end if;
900 if p_ib_installed_at_location is not null then
901 l_header_rec.ib_installed_at_location := p_ib_installed_at_location;
902 end if;
903 if p_ib_current_location is not null then
904 l_header_rec.ib_current_location := p_ib_current_location;
905 end if;
906
907
908 l_control_rec.controlled_operation:=TRUE;
909 l_control_rec.process:=FALSE;
910 l_control_rec.process_entity:=OE_GLOBALS.G_ENTITY_ALL;
911
912 --added for bug 4882981
913 l_control_rec.check_security := TRUE;
914 l_control_rec.clear_dependents := TRUE;
915 l_control_rec.default_attributes := TRUE;
916 l_control_rec.change_attributes := TRUE;
917 l_control_rec.validate_entity := TRUE;
918 l_control_rec.write_to_DB := TRUE;
919 --End of bug 4882981
920
921 Oe_Order_Pvt.Header
922 (
923 p_validation_level => FND_API.G_VALID_LEVEL_FULL
924 , p_init_msg_list => l_init_msg_list
925 , p_control_rec => l_control_rec
926 , p_x_header_rec => l_header_rec
927 , p_x_old_header_rec => l_old_header_rec
928 , x_return_status => l_return_status
929 );
930
931
932 p_return_status := l_return_status;
933 OE_DEBUG_PUB.Add('return_status='||l_return_status);
934 if l_return_status in(FND_API.G_RET_STS_ERROR,
935 FND_API.G_RET_STS_UNEXP_ERROR) then
936 ROLLBACK TO SAVEPOINT Process_Order_Scalar;
937 G_ERROR_COUNT := G_ERROR_COUNT + 1;
938
939 l_error_count := l_error_count + 1;
940 p_error_count := l_error_count;
941 OE_MSG_PUB.Count_And_Get
942 ( p_count => p_msg_count,
943 p_data => p_msg_data
944 );
945 if l_mc_err_handling_flag in (EXIT_FIRST_ERROR,SKIP_CONTINUE) then
946 OE_DEBUG_PUB.Add('EXIT_FIRST_ERROR SKIP_CONTINUE');
947 exit;
948 else
949 OE_DEBUG_PUB.Add('SKIP_ALL');
950 end if;
951
952 end if;
953 -- loop exception handling
954 Exception
955 WHEN FND_API.G_EXC_ERROR THEN
956 p_return_status := FND_API.G_RET_STS_ERROR ;
957 OE_MSG_PUB.Count_And_Get
958 ( p_count => p_msg_count,
959 p_data => p_msg_data
960 );
961 l_error_count := l_error_count + 1;
962 p_error_count := l_error_count;
963
964 G_ERROR_COUNT := G_ERROR_COUNT + 1;
965 ROLLBACK TO SAVEPOINT Process_Order_Scalar;
966
967 if l_mc_err_handling_flag in (EXIT_FIRST_ERROR,SKIP_CONTINUE) then
968 exit;
969 end if;
970
971 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
972 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
973 OE_MSG_PUB.Count_And_Get
974 ( p_count => p_msg_count,
975 p_data => p_msg_data
976 );
977 l_error_count := l_error_count + 1;
978 p_error_count := l_error_count;
979
980 G_ERROR_COUNT := G_ERROR_COUNT + 1;
981 ROLLBACK TO SAVEPOINT Process_Order_Scalar;
982
983 if l_mc_err_handling_flag in (EXIT_FIRST_ERROR,SKIP_CONTINUE) then
984 exit;
985 end if;
986
987
988 WHEN OTHERS THEN
989 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
990 IF OE_MSG_PUB.Check_Msg_Level
991 (OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
992 THEN
993 OE_MSG_PUB.Add_Exc_Msg
994 (G_PKG_NAME,l_api_name
995 );
996 END IF;
997 OE_MSG_PUB.Count_And_Get
998 ( p_count => p_msg_count,
999 p_data => p_msg_data);
1000 l_error_count := l_error_count + 1;
1001 p_error_count := l_error_count;
1002
1003 G_ERROR_COUNT := G_ERROR_COUNT + 1;
1004 ROLLBACK TO SAVEPOINT Process_Order_Scalar;
1005
1006 if l_mc_err_handling_flag in (EXIT_FIRST_ERROR,SKIP_CONTINUE) then
1007 exit;
1008 end if;
1009
1010 END;
1011
1012 --End LOOP; /* end of FOR loop */
1013 -- moved execution of delayed request inside the for loop for bug 4882981
1014 IF p_return_status = FND_API.G_RET_STS_SUCCESS THEN
1015 --{ SUCCESS from OE_ORDER_PVT.Header
1016 BEGIN
1017 -- call to post_line_process is not needed for headers mass change
1018 /*
1019
1020 l_control_rec.controlled_operation := TRUE;
1021 l_control_rec.process := TRUE;
1022 l_control_rec.process_entity := OE_GLOBALS.G_ENTITY_ALL;
1023
1024 l_control_rec.check_security := FALSE;
1025 l_control_rec.clear_dependents := FALSE;
1026 l_control_rec.default_attributes := FALSE;
1027 l_control_rec.change_attributes := FALSE;
1028 l_control_rec.validate_entity := FALSE;
1029 l_control_rec.write_to_DB := FALSE;
1030
1031 -- Instruct API to clear its request table
1032
1033 l_control_rec.clear_api_cache := FALSE;
1034 l_control_rec.clear_api_requests := TRUE;
1035
1036 oe_line_util.Post_Line_Process
1037 ( p_control_rec => l_control_rec
1038 , p_x_line_tbl => l_line_tbl );
1039
1040 */
1041
1042 --added call to PRN for bug 4882981
1043 OE_Order_PVT.Process_Requests_And_Notify
1044 ( p_process_requests => TRUE
1045 , p_notify => TRUE
1046 , x_return_status => l_return_status
1047 , p_old_header_rec => l_old_header_rec
1048 , p_header_rec => l_header_rec );
1049
1050
1051 /*
1052 OE_DELAYED_REQUESTS_PVT.Process_Delayed_Requests(
1053 x_return_status => l_return_status
1054 );
1055
1056 */
1057 oe_debug_pub.ADD('OEXVMSCB: Completed Process_Delayed_Requests '
1058 || ' with return status' || l_return_status, 1);
1059
1060 oe_debug_pub.add('calling count and get to display errors');
1061
1062 -- Bug 1809955
1063 -- Display any errors/messages that were caused
1064 -- as a result of the delayed request execution
1065 OE_MSG_PUB.Count_and_Get(
1066 p_count => p_msg_count,
1067 p_data => p_msg_data
1068 );
1069
1070 IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1071 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1072 ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
1073 RAISE FND_API.G_EXC_ERROR;
1074 END IF;
1075
1076
1077 oe_debug_pub.add('p_cascade_header_changes' || p_cascade_header_changes);
1078 -- Begin of Cascade Header changes in Mass Change ER 7509356
1079 IF p_cascade_header_changes = 'Y' THEN
1080 --{
1081 oe_debug_pub.add('Just before calling cascade_header_attributes from process_order_scalar for header_id :' || l_header_rec.header_id);
1082
1083 OE_OE_FORM_HEADER.CASCADE_HEADER_ATTRIBUTES
1084 (
1085 p_old_db_header_rec => l_old_header_rec
1086 ,p_header_rec => l_header_rec
1087 ,x_return_status => l_return_status
1088 ,x_msg_count => p_msg_count
1089 ,x_msg_data => p_msg_data
1090 );
1091
1092 oe_debug_pub.add('return_status from cascade_header_attributes '|| l_return_status);
1093 IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1094 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1095 ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
1096 RAISE FND_API.G_EXC_ERROR;
1097 END IF;
1098 --}
1099 END IF;
1100 -- End of Cascade Header changes in Mass Change ER 7509356
1101
1102
1103
1104 EXCEPTION
1105 WHEN FND_API.G_EXC_ERROR THEN
1106 l_error_count := l_error_count + 1;
1107 p_error_count := l_error_count;
1108 p_return_status := FND_API.G_RET_STS_ERROR ;
1109 OE_MSG_PUB.Count_And_Get
1110 ( p_count => p_msg_count,
1111 p_data => p_msg_data
1112 );
1113 l_error_count := l_error_count + 1;
1114 p_error_count := l_error_count;
1115
1116 G_ERROR_COUNT := G_ERROR_COUNT + 1;
1117 ROLLBACK TO SAVEPOINT Process_Order_Scalar;
1118
1119
1120 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
1121 l_error_count := l_error_count + 1;
1122 p_error_count := l_error_count;
1123 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1124 OE_MSG_PUB.Count_And_Get
1125 ( p_count => p_msg_count,
1126 p_data => p_msg_data
1127 );
1128 l_error_count := l_error_count + 1;
1129 p_error_count := l_error_count;
1130
1131 G_ERROR_COUNT := G_ERROR_COUNT + 1;
1132 ROLLBACK TO SAVEPOINT Process_Order_Scalar;
1133
1134 WHEN OTHERS THEN
1135 l_error_count := l_error_count + 1;
1136 p_error_count := l_error_count;
1137 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1138 IF OE_MSG_PUB.Check_Msg_Level
1139 (OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1140 THEN
1141 OE_MSG_PUB.Add_Exc_Msg
1142 (G_PKG_NAME,
1143 l_api_name
1144 );
1145 END IF;
1146 OE_MSG_PUB.Count_And_Get
1147 ( p_count => p_msg_count,
1148 p_data => p_msg_data);
1149 l_error_count := l_error_count + 1;
1150 p_error_count := l_error_count;
1151
1152 G_ERROR_COUNT := G_ERROR_COUNT + 1;
1153 ROLLBACK TO SAVEPOINT Process_Order_Scalar;
1154
1155 END ;
1156
1157 --} SUCCESS from OE_ORDER_PVT.Header
1158 END IF;
1159 --}
1160 END LOOP ; /* end for loop */ -- end bug 4882981
1161 IS_MASS_CHANGE := 'F'; -- Added for ER 7509356
1162 end Process_Order_Scalar;
1163
1164 -- 4020312
1165 -- Process_Line_Scalar has been changed to group lines together before calling
1166 -- OE_ORDER_PVT.Lines so that lines belonging together like models and sets go
1167 -- for processing at one go.
1168 Procedure Process_Line_Scalar
1169 ( p_num_of_records IN NUMBER
1170 , p_sel_rec_tbl IN Oe_Globals.Selected_Record_Tbl --MOAC PI
1171 , p_multi_OU IN Boolean --MOAC PI
1172 , p_change_reason IN VARCHAR2
1173 , p_change_comments IN VARCHAR2
1174 , p_msg_count OUT NOCOPY NUMBER
1175 , p_msg_data OUT NOCOPY VARCHAR2
1176 , p_return_status OUT NOCOPY VARCHAR2
1177 , p_mc_err_handling_flag IN NUMBER := FND_API.G_MISS_NUM
1178 , p_error_count OUT NOCOPY NUMBER
1179 , p_header_id IN NUMBER
1180 , p_accounting_rule_id IN NUMBER
1181 , p_accounting_rule_duration IN NUMBER
1182 , p_actual_arrival_date IN DATE
1183 , p_actual_shipment_date IN DATE
1184 , p_agreement_id IN NUMBER
1185 , p_ato_line_id IN NUMBER
1186 , p_attribute1 IN VARCHAR2
1187 , p_attribute10 IN VARCHAR2
1188 , p_attribute11 IN VARCHAR2
1189 , p_attribute12 IN VARCHAR2
1190 , p_attribute13 IN VARCHAR2
1191 , p_attribute14 IN VARCHAR2
1192 , p_attribute15 IN VARCHAR2
1193 , p_attribute16 IN VARCHAR2 --For bug 2184255
1194 , p_attribute17 IN VARCHAR2
1195 , p_attribute18 IN VARCHAR2
1196 , p_attribute19 IN VARCHAR2
1197 , p_attribute2 IN VARCHAR2
1198 , p_attribute20 IN VARCHAR2
1199 , p_attribute3 IN VARCHAR2
1200 , p_attribute4 IN VARCHAR2
1201 , p_attribute5 IN VARCHAR2
1202 , p_attribute6 IN VARCHAR2
1203 , p_attribute7 IN VARCHAR2
1204 , p_attribute8 IN VARCHAR2
1205 , p_attribute9 IN VARCHAR2
1206 , p_blanket_number IN NUMBER
1207 , p_blanket_line_number IN NUMBER
1208 , p_blanket_version_number IN NUMBER
1209 , p_context IN VARCHAR2
1210 , p_auto_selected_quantity IN NUMBER
1211 , p_cancelled_quantity In NUMBER
1212 , p_component_code IN VARCHAR2
1213 , p_component_number IN NUMBER
1214 , p_component_sequence_id IN NUMBER
1215 , p_config_display_sequence IN NUMBER
1216 , p_configuration_id IN NUMBER
1217 , p_config_header_id IN NUMBER
1218 , p_config_rev_nbr IN NUMBER
1219 , p_credit_invoice_line_id IN NUMBER
1220 , p_customer_dock_code IN VARCHAR2
1221 , p_customer_job IN VARCHAR2
1222 , p_customer_production_line IN VARCHAR2
1223 , p_customer_trx_line_id IN NUMBER
1224 , p_cust_model_serial_number IN VARCHAR2
1225 , p_cust_po_number IN VARCHAR2
1226 , p_delivery_lead_time IN NUMBER
1227 , p_deliver_to_contact_id IN NUMBER
1228 , p_deliver_to_org_id IN NUMBER
1229 , p_demand_bucket_type_code IN VARCHAR2
1230 , p_demand_class_code IN VARCHAR2
1231 , p_dep_plan_required_flag IN VARCHAR2
1232 , p_earliest_acceptable_date IN DATE
1233 , p_explosion_date IN DATE
1234 , p_fob_point_code IN VARCHAR2
1235 , p_freight_carrier_code IN VARCHAR2
1236 , p_freight_terms_code IN VARCHAR2
1237 , p_fulfilled_quantity IN NUMBER
1238 , p_global_attribute1 IN VARCHAR2
1239 , p_global_attribute10 IN VARCHAR2
1240 , p_global_attribute11 IN VARCHAR2
1241 , p_global_attribute12 IN VARCHAR2
1242 , p_global_attribute13 IN VARCHAR2
1243 , p_global_attribute14 IN VARCHAR2
1244 , p_global_attribute15 IN VARCHAR2
1245 , p_global_attribute16 IN VARCHAR2
1246 , p_global_attribute17 IN VARCHAR2
1247 , p_global_attribute18 IN VARCHAR2
1248 , p_global_attribute19 IN VARCHAR2
1249 , p_global_attribute2 IN VARCHAR2
1250 , p_global_attribute20 IN VARCHAR2
1251 , p_global_attribute3 IN VARCHAR2
1252 , p_global_attribute4 IN VARCHAR2
1253 , p_global_attribute5 IN VARCHAR2
1254 , p_global_attribute6 IN VARCHAR2
1255 , p_global_attribute7 IN VARCHAR2
1256 , p_global_attribute8 IN VARCHAR2
1257 , p_global_attribute9 IN VARCHAR2
1258 , p_global_attribute_category IN VARCHAR2
1259 , p_industry_attribute1 IN VARCHAR2
1260 , p_industry_attribute10 IN VARCHAR2
1261 , p_industry_attribute11 IN VARCHAR2
1262 , p_industry_attribute12 IN VARCHAR2
1263 , p_industry_attribute13 IN VARCHAR2
1264 , p_industry_attribute14 IN VARCHAR2
1265 , p_industry_attribute15 IN VARCHAR2
1266 , p_industry_attribute2 IN VARCHAR2
1267 , p_industry_attribute3 IN VARCHAR2
1268 , p_industry_attribute4 IN VARCHAR2
1269 , p_industry_attribute5 IN VARCHAR2
1270 , p_industry_attribute6 IN VARCHAR2
1271 , p_industry_attribute7 IN VARCHAR2
1272 , p_industry_attribute8 IN VARCHAR2
1273 , p_industry_attribute9 IN VARCHAR2
1274 , p_industry_context IN VARCHAR2
1275 , p_intermed_ship_to_contact_id IN NUMBER
1276 , p_intermed_ship_to_org_id IN NUMBER
1277 , p_inventory_item_id IN NUMBER
1278 , p_invoice_interface_status IN VARCHAR2
1279 , p_invoice_to_contact_id IN NUMBER
1280 , p_invoice_to_org_id IN NUMBER
1281 , p_invoicing_rule_id IN NUMBER
1282 , p_ordered_item_id IN NUMBER
1283 , p_item_identifier_type IN VARCHAR2
1284 , p_ordered_item IN VARCHAR2
1285 , p_item_revision IN VARCHAR2
1286 , p_item_type_code IN VARCHAR2
1287 , p_latest_acceptable_date IN DATE
1288 , p_line_category_code IN VARCHAR2
1289 , p_line_id IN NUMBER
1290 , p_line_number IN NUMBER
1291 , p_line_type_id IN NUMBER
1292 , p_link_to_line_id IN NUMBER
1293 , p_model_group_number IN NUMBER
1294 , p_option_flag IN VARCHAR2
1295 , p_option_number IN NUMBER
1296 , p_ordered_quantity IN NUMBER
1297 , p_order_quantity_uom IN VARCHAR2
1298 , p_org_id IN NUMBER
1299 , p_orig_sys_document_ref IN VARCHAR2
1300 , p_orig_sys_line_ref IN VARCHAR2
1301 , p_payment_term_id IN NUMBER
1302 , p_price_list_id IN NUMBER
1303 , p_pricing_attribute1 IN VARCHAR2
1304 , p_pricing_attribute10 IN VARCHAR2
1305 , p_pricing_attribute2 IN VARCHAR2
1306 , p_pricing_attribute3 IN VARCHAR2
1307 , p_pricing_attribute4 IN VARCHAR2
1308 , p_pricing_attribute5 IN VARCHAR2
1309 , p_pricing_attribute6 IN VARCHAR2
1310 , p_pricing_attribute7 IN VARCHAR2
1311 , p_pricing_attribute8 IN VARCHAR2
1312 , p_pricing_attribute9 IN VARCHAR2
1313 , p_pricing_context IN VARCHAR2
1314 , p_pricing_date IN DATE
1315 , p_pricing_quantity IN NUMBER
1316 , p_pricing_quantity_uom IN VARCHAR2
1317 , p_project_id IN NUMBER
1318 , p_promise_date IN DATE
1319 , p_reference_header_id IN NUMBER
1320 , p_reference_line_id IN NUMBER
1321 , p_reference_type IN VARCHAR2
1322 , p_request_date IN DATE
1323 , p_reserved_quantity IN NUMBER
1324 , p_return_attribute1 IN VARCHAR2
1325 , p_return_attribute10 IN VARCHAR2
1326 , p_return_attribute11 IN VARCHAR2
1327 , p_return_attribute12 IN VARCHAR2
1328 , p_return_attribute13 IN VARCHAR2
1329 , p_return_attribute14 IN VARCHAR2
1330 , p_return_attribute15 IN VARCHAR2
1331 , p_return_attribute2 IN VARCHAR2
1332 , p_return_attribute3 IN VARCHAR2
1333 , p_return_attribute4 IN VARCHAR2
1334 , p_return_attribute5 IN VARCHAR2
1335 , p_return_attribute6 IN VARCHAR2
1336 , p_return_attribute7 IN VARCHAR2
1337 , p_return_attribute8 IN VARCHAR2
1338 , p_return_attribute9 IN VARCHAR2
1339 , p_return_context IN VARCHAR2
1340 , p_rla_schedule_type_code IN VARCHAR2
1341 , p_schedule_arrival_date IN DATE
1342 , p_schedule_ship_date IN DATE
1343 , p_schedule_action_code IN VARCHAR2
1344 , p_schedule_status_code IN VARCHAR2
1345 , p_shipment_number IN NUMBER
1346 , p_shipment_priority_code IN VARCHAR2
1347 , p_shipped_quantity IN NUMBER
1348 , p_shipping_method_code IN VARCHAR2
1349 , p_shipping_quantity IN NUMBER
1350 , p_shipping_quantity_uom IN VARCHAR2
1351 , p_ship_from_org_id IN NUMBER
1352 , p_ship_tolerance_above IN NUMBER
1353 , p_ship_tolerance_below IN NUMBER
1354 , p_shipping_interfaced_flag IN VARCHAR2
1355 , p_ship_to_contact_id IN NUMBER
1356 , p_ship_to_org_id IN NUMBER
1357 , p_ship_model_complete_flag IN VARCHAR2
1358 , p_sold_to_org_id IN NUMBER
1359 , p_sort_order IN VARCHAR2
1360 , p_source_document_id IN NUMBER
1361 , p_source_document_line_id IN NUMBER
1362 , p_source_document_type_id IN NUMBER
1363 , p_source_type_code IN VARCHAR2
1364 , p_task_id IN NUMBER
1365 , p_tax_code IN VARCHAR2
1366 , p_tax_date IN DATE
1367 , p_tax_exempt_flag IN VARCHAR2
1368 , p_tax_exempt_number IN VARCHAR2
1369 , p_tax_exempt_reason_code IN VARCHAR2
1370 , p_tax_point_code IN VARCHAR2
1371 , p_tax_rate IN NUMBER
1372 , p_tax_value IN NUMBER
1373 , p_top_model_line_id IN NUMBER
1374 , p_unit_list_price IN NUMBER
1375 , p_unit_selling_price IN NUMBER
1376 , p_visible_demand_flag IN VARCHAR2
1377 , p_accounting_rule IN VARCHAR2
1378 , p_agreement IN VARCHAR2
1379 , p_customer_item IN VARCHAR2
1380 , p_deliver_to_address1 IN VARCHAR2
1381 , p_deliver_to_address2 IN VARCHAR2
1382 , p_deliver_to_address3 IN VARCHAR2
1383 , p_deliver_to_address4 IN VARCHAR2
1384 , p_deliver_to_contact IN VARCHAR2
1385 , p_deliver_to_location IN VARCHAR2
1386 , p_deliver_to_org IN VARCHAR2
1387 , p_demand_bucket_type IN VARCHAR2
1388 , p_fob_point IN VARCHAR2
1389 , p_freight_terms IN VARCHAR2
1390 , p_inventory_item IN VARCHAR2
1391 , p_invoice_to_address1 IN VARCHAR2
1392 , p_invoice_to_address2 IN VARCHAR2
1393 , p_invoice_to_address3 IN VARCHAR2
1394 , p_invoice_to_address4 IN VARCHAR2
1395 , p_invoice_to_contact IN VARCHAR2
1396 , p_invoice_to_location IN VARCHAR2
1397 , p_invoice_to_org IN VARCHAR2
1398 , p_invoicing_rule IN VARCHAR2
1399 , p_intermed_ship_to_address1 IN VARCHAR2
1400 , p_intermed_ship_to_address2 IN VARCHAR2
1401 , p_intermed_ship_to_address3 IN VARCHAR2
1402 , p_intermed_ship_to_address4 IN VARCHAR2
1403 , p_intermed_ship_to_contact IN VARCHAR2
1404 , p_intermed_ship_to_location IN VARCHAR2
1405 , p_intermed_ship_to_org IN VARCHAR2
1406 , p_item IN VARCHAR2
1407 , p_item_type IN VARCHAR2
1408 , p_line_type IN VARCHAR2
1409 , p_payment_term IN VARCHAR2
1410 , p_price_list IN VARCHAR2
1411 , p_project IN VARCHAR2
1412 , p_rla_schedule_type IN VARCHAR2
1413 , p_shipment_priority IN VARCHAR2
1414 , p_ship_from_address1 IN VARCHAR2
1415 , p_ship_from_address2 IN VARCHAR2
1416 , p_ship_from_address3 IN VARCHAR2
1417 , p_ship_from_address4 IN VARCHAR2
1418 , p_ship_from_location IN VARCHAR2
1419 , p_ship_from_org IN VARCHAR2
1420 , p_ship_to_address1 IN VARCHAR2
1421 , p_ship_to_address2 IN VARCHAR2
1422 , p_ship_to_address3 IN VARCHAR2
1423 , p_ship_to_address4 IN VARCHAR2
1424 , p_ship_to_contact IN VARCHAR2
1425 , p_ship_to_location IN VARCHAR2
1426 , p_ship_to_org IN VARCHAR2
1427 , p_sold_to_org IN VARCHAR2
1428 , p_task IN VARCHAR2
1429 , p_tax_exempt IN VARCHAR2
1430 , p_tax_exempt_reason IN VARCHAR2
1431 , p_tax_point IN VARCHAR2
1432 , p_split_from_line_id IN NUMBER
1433 , p_cust_production_seq_num IN VARCHAR2
1434 , p_authorized_to_ship_flag IN VARCHAR2
1435 , p_veh_cus_item_cum_key_id IN NUMBER
1436 , p_salesrep_id IN NUMBER
1437 , p_return_reason_code IN VARCHAR2
1438 , p_arrival_set_id IN NUMBER
1439 , p_ship_set_id IN NUMBER
1440 , p_over_ship_reason_code IN VARCHAR2
1441 , p_over_ship_resolved_flag IN VARCHAR2
1442 , p_industry_attribute16 IN VARCHAR2
1443 , p_industry_attribute17 IN VARCHAR2
1444 , p_industry_attribute18 IN VARCHAR2
1445 , p_industry_attribute19 IN VARCHAR2
1446 , p_industry_attribute20 IN VARCHAR2
1447 , p_industry_attribute21 IN VARCHAR2
1448 , p_industry_attribute22 IN VARCHAR2
1449 , p_industry_attribute23 IN VARCHAR2
1450 , p_industry_attribute24 IN VARCHAR2
1451 , p_industry_attribute25 IN VARCHAR2
1452 , p_industry_attribute26 IN VARCHAR2
1453 , p_industry_attribute27 IN VARCHAR2
1454 , p_industry_attribute28 IN VARCHAR2
1455 , p_industry_attribute29 IN VARCHAR2
1456 , p_industry_attribute30 IN VARCHAR2
1457 , p_veh_cus_item_cum_key IN VARCHAR2
1458 , p_salesrep IN VARCHAR2
1459 , p_return_reason IN VARCHAR2
1460 , p_delivery IN VARCHAR2
1461 , p_arrival_set IN VARCHAR2
1462 , p_ship_set IN VARCHAR2
1463 , p_over_ship_reason IN VARCHAR2
1464 , p_first_ack_code IN VARCHAR2
1465 , p_first_ack_date IN DATE
1466 , p_last_ack_code IN VARCHAR2
1467 , p_last_ack_date IN DATE
1468 , p_service_txn_reason_code IN VARCHAR2
1469 , p_service_txn_comments IN VARCHAR2
1470 , p_unit_selling_percent IN NUMBER
1471 , p_unit_list_percent IN NUMBER
1472 , p_unit_percent_base_price IN NUMBER
1473 , p_service_duration IN NUMBER
1474 , p_service_period IN VARCHAR2
1475 , p_service_start_date IN DATE
1476 , p_service_end_date IN DATE
1477 , p_service_coterminate_flag IN VARCHAR2
1478 , p_service_number IN NUMBER
1479 , p_service_reference_type_code IN VARCHAR2
1480 , p_service_reference_line_id IN NUMBER
1481 , p_service_reference_system_id IN NUMBER
1482 , p_tp_attribute1 IN VARCHAR2
1483 , p_tp_attribute10 IN VARCHAR2
1484 , p_tp_attribute11 IN VARCHAR2
1485 , p_tp_attribute12 IN VARCHAR2
1486 , p_tp_attribute13 IN VARCHAR2
1487 , p_tp_attribute14 IN VARCHAR2
1488 , p_tp_attribute15 IN VARCHAR2
1489 , p_tp_attribute2 IN VARCHAR2
1490 , p_tp_attribute3 IN VARCHAR2
1491 , p_tp_attribute4 IN VARCHAR2
1492 , p_tp_attribute5 IN VARCHAR2
1493 , p_tp_attribute6 IN VARCHAR2
1494 , p_tp_attribute7 IN VARCHAR2
1495 , p_tp_attribute8 IN VARCHAR2
1496 , p_tp_attribute9 IN VARCHAR2
1497 , p_tp_context IN VARCHAR2
1498 , p_shipping_instructions IN VARCHAR2
1499 , p_packing_instructions IN VARCHAR2
1500 , p_planning_priority IN VARCHAR2
1501 , p_calculate_price_flag IN VARCHAR2
1502 --end custoemr chagnes
1503 , p_end_customer_contact_id IN NUMBER
1504 , p_end_customer_id IN NUMBER
1505 , p_end_customer_site_use_id IN NUMBER
1506 , p_end_customer_address1 IN VARCHAR2
1507 , p_end_customer_address2 IN VARCHAR2
1508 , p_end_customer_address3 IN VARCHAR2
1509 , p_end_customer_address4 IN VARCHAR2
1510 , p_end_customer_contact IN VARCHAR2
1511 , p_end_customer_location IN VARCHAR2
1512 , p_ib_owner IN VARCHAR2
1513 , p_ib_installed_at_location IN VARCHAR2
1514 , p_ib_current_location IN VARCHAR2
1515 , p_block_name IN VARCHAR2 DEFAULT NULL
1516 --sol_ord_er #16014165 Start
1517 , p_service_bill_profile_id IN NUMBER DEFAULT NULL
1518 , p_service_bill_option_code IN varchar2 DEFAULT NULL
1519 , p_service_cov_template_id IN NUMBER DEFAULT NULL
1520 , p_service_subs_template_id IN NUMBER DEFAULT NULL
1521 --sol_ord_er #16014165 end
1522 ) IS
1523 initial Integer;
1524 j Integer;
1525 l_api_name CONSTANT VARCHAR2(30) := 'Process_Line_Scalar';
1526 l_arrival_set_id number;
1527 l_control_rec OE_GLOBALS.Control_Rec_Type;
1528 l_counter Integer := 0;
1529 l_current_org_id Number;
1530 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
1531 l_error_count NUMBER := 0;
1532 l_header_id Number;
1533 l_init_msg_list VARCHAR2(1) := FND_API.G_TRUE;
1534 l_line_id Number;
1535 l_line_tbl OE_ORDER_PUB.Line_Tbl_Type;
1536 l_mc_err_handling_flag NUMBER := p_mc_err_handling_flag;
1537 l_num_of_records NUMBER;
1538 l_old_arrival_set_id number;
1539 l_old_header_id number;
1540 l_old_line_tbl OE_ORDER_PUB.Line_Tbl_Type;
1541 l_old_org_id number;
1542 l_old_ship_set_id number;
1543 l_old_top_model_line_id number;
1544 l_rec number;
1545 l_return_status VARCHAR2(30);
1546 l_ship_set_id number;
1547 l_top_model_line_id number;
1548 l_x_line_rec OE_ORDER_PUB.Line_Rec_Type;
1549 nextpos Integer;
1550
1551 CURSOR c1 IS SELECT x.id1, x.org_id, l.header_id, l.arrival_set_id,
1552 l.ship_set_id, l.top_model_line_id
1553 FROM TABLE(OE_MASS_CHANGE_PVT.get_sel_rec_tbl) x,
1554 oe_order_lines_all l
1555 WHERE l.line_id = x.id1
1556 ORDER BY l.header_id,
1557 nvl(l.arrival_set_id, -1),
1558 nvl(l.ship_set_id, -1),
1559 nvl(l.top_model_line_id, -1);
1560
1561 --Bug 7566697
1562 --Will be used to set the header level savepoint
1563 l_header_changed BOOLEAN := TRUE;
1564
1565
1566 BEGIN
1567 IF l_debug_level > 0 THEN
1568 oe_debug_pub.add('Entering OE_MASS_CHANGE_PVT.Process_Line_Scalar');
1569 END IF;
1570
1571 p_error_count := l_error_count;
1572
1573 --bug4529937 start ----bug 6850537,7210480 added p_block_name ='LINES_SUMMARY'
1574 IF p_block_name = 'LINE' or p_block_name ='LINES_SUMMARY' THEN
1575 G_BLK_NAME := p_block_name;
1576 G_NUM_OF_LINES := p_num_of_records;
1577 END IF;
1578
1579 IF l_debug_level > 0 THEN
1580 oe_debug_pub.add(' block_name:'|| p_block_name);
1581 oe_debug_pub.add(' num of records:'|| p_num_of_records);
1582 END IF;
1583 --bug4529937 end
1584
1585 IS_MASS_CHANGE := 'T'; --Added for bug 4911340
1586
1587 g_sel_rec_tbl := p_sel_rec_tbl;
1588 OPEN c1;
1589 FETCH c1 into l_line_id, l_current_org_id, l_header_id, l_arrival_set_id,
1590 l_ship_set_id, l_top_model_line_id;
1591
1592 l_old_org_id := l_current_org_id;
1593
1594 MO_GLOBAL.SET_POLICY_CONTEXT('S',l_current_org_id);
1595
1596 LOOP -- Outer loop
1597 -- Setting context whenever org_id changes.
1598 IF p_multi_ou AND l_current_org_id <> l_old_org_id THEN
1599 IF l_debug_level > 0 THEN
1600 oe_debug_pub.add('Setting policy - ' || l_current_org_id);
1601 END IF;
1602
1603 MO_GLOBAL.SET_POLICY_CONTEXT('S',l_current_org_id);
1604 END IF;
1605
1606 BEGIN
1607 IF l_debug_level > 0 THEN
1608 oe_debug_pub.add('l_rec - ' || l_rec);
1609 END IF;
1610
1611 IF l_rec > 0 THEN
1612 l_init_msg_list := FND_API.G_FALSE;
1613 END IF;
1614
1615 --Bug 7566697
1616 --Will be creating new savepoint only if the header has changed
1617 --This savepoint will used to rollback changes done to the whole order, in case of pricing error
1618 IF l_header_changed
1619 THEN
1620 OE_MASS_CHANGE_PVT.G_PRICING_ERROR := 'N';
1621 SAVEPOINT Pricing_Header_Savepoint;
1622 END IF;
1623
1624 SAVEPOINT Process_Line_Scalar;
1625
1626 l_rec := 0;
1627
1628 l_line_tbl := OE_ORDER_PUB.G_MISS_LINE_TBL;
1629 l_old_line_tbl := OE_ORDER_PUB.G_MISS_LINE_TBL;
1630 l_return_status := NULL;
1631
1632 LOOP -- Inner loop
1633
1634 G_COUNTER := G_COUNTER + 1;
1635
1636 IF l_debug_level > 0 THEN
1637 oe_debug_pub.add('Line Id - ' || l_line_id);
1638 oe_debug_pub.add('Org Id - ' || l_current_org_id);
1639 oe_debug_pub.add('Header Id - ' || l_header_id);
1640 oe_debug_pub.add('Arrival Set Id - ' || l_arrival_set_id);
1641 oe_debug_pub.add('Ship Set Id - ' || l_ship_set_id);
1642 oe_debug_pub.add('Top Model Line Id - ' || l_top_model_line_id);
1643 END IF;
1644
1645 l_old_header_id := l_header_id;
1646 l_old_arrival_set_id := l_arrival_set_id;
1647 l_old_ship_set_id := l_ship_set_id;
1648 l_old_top_model_line_id := l_top_model_line_id;
1649 l_old_org_id := l_current_org_id;
1650
1651 l_rec := l_rec + 1;
1652 l_line_tbl(l_rec) := OE_ORDER_PUB.G_MISS_LINE_REC;
1653 l_line_tbl(l_rec).line_id := l_line_id;
1654 l_line_tbl(l_rec).header_id := l_header_id;
1655
1656 OE_Line_Util.Lock_Row ( x_return_status => l_return_status,
1657 p_x_line_rec => l_x_line_rec,
1658 p_line_id => l_line_id );
1659
1660 IF l_debug_level > 0 THEN
1661 OE_DEBUG_PUB.Add('After Lock Row - ' || l_return_status);
1662 END IF;
1663
1664 IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
1665 --Start of bug# 13067303
1666 loop
1667 IF l_debug_level > 0 THEN
1668 oe_debug_pub.add('another loop into inner loop, iteration'||'line id'||l_line_id);
1669 END IF;
1670 fetch c1 into l_line_id, l_current_org_id, l_header_id, l_arrival_set_id,l_ship_set_id, l_top_model_line_id;
1671 exit when c1%notfound;
1672 IF l_debug_level > 0 THEN
1673 oe_debug_pub.add('old arrival'||l_old_arrival_set_id||'old ship'||l_old_ship_set_id||'old top'||l_old_top_model_line_id);
1674 oe_debug_pub.add('header'||l_header_id||'line'||l_line_id||'arrival'||l_arrival_set_id||'ship'||l_ship_set_id||'l_top_model_line_id'||l_top_model_line_id);
1675 END IF;
1676 if ( l_old_arrival_set_id is null and l_old_ship_set_id is null and l_old_top_model_line_id is null ) then
1677 IF l_debug_level > 0 THEN
1678 oe_debug_pub.add('all are null');
1679 END IF;
1680 exit;
1681 end if;
1682
1683 -- If all old values are not null, then exit loop only when they change group.
1684 if l_header_id <> l_old_header_id or
1685 nvl(l_arrival_set_id, 0) <> nvl(l_old_arrival_set_id, 0) or
1686 nvl(l_ship_set_id, 0) <> nvl(l_old_ship_set_id, 0) or
1687 nvl(l_top_model_line_id, 0) <> nvl(l_old_top_model_line_id, 0)
1688 then
1689 IF l_debug_level > 0 THEN
1690 oe_debug_pub.add('value changed');
1691 END IF;
1692 exit;
1693 end if;
1694 IF l_debug_level > 0 THEN
1695 oe_debug_pub.add('after comparison ,assiging the new to old, going to next iteration, line_id:'||l_line_id);
1696 END IF;
1697 l_old_header_id := l_header_id;
1698 l_old_arrival_set_id := l_arrival_set_id;
1699 l_old_ship_set_id := l_ship_set_id;
1700 l_old_top_model_line_id := l_top_model_line_id;
1701
1702 l_rec := l_rec + 1;
1703 l_line_tbl(l_rec) := OE_ORDER_PUB.G_MISS_LINE_REC;
1704 l_line_tbl(l_rec).line_id := l_line_id;
1705 G_COUNTER := G_COUNTER + 1;
1706 end loop; --bug# 13067303
1707 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1708 ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
1709 --bug# 13067303
1710 loop
1711 IF l_debug_level > 0 THEN
1712 oe_debug_pub.add('another loop into inner loop, iteration'||'line id'||l_line_id);
1713 END IF;
1714 fetch c1 into l_line_id, l_current_org_id, l_header_id, l_arrival_set_id,l_ship_set_id, l_top_model_line_id;
1715 exit when c1%notfound;
1716 IF l_debug_level > 0 THEN
1717 oe_debug_pub.add('old arrival'||l_old_arrival_set_id||'old ship'||l_old_ship_set_id||'old top'||l_old_top_model_line_id);
1718 oe_debug_pub.add('header'||l_header_id||'line'||l_line_id||'arrival'||l_arrival_set_id||'ship'||l_ship_set_id||'l_top_model_line_id'||l_top_model_line_id);
1719 END IF;
1720 if ( l_old_arrival_set_id is null and l_old_ship_set_id is null and l_old_top_model_line_id is null ) then
1721 IF l_debug_level > 0 THEN
1722 oe_debug_pub.add('all are null');
1723 END IF;
1724 exit;
1725 end if;
1726
1727 -- If all old values are not null, then exit loop only when they change group.
1728 if l_header_id <> l_old_header_id or
1729 nvl(l_arrival_set_id, 0) <> nvl(l_old_arrival_set_id, 0) or
1730 nvl(l_ship_set_id, 0) <> nvl(l_old_ship_set_id, 0) or
1731 nvl(l_top_model_line_id, 0) <> nvl(l_old_top_model_line_id, 0)
1732 then
1733 IF l_debug_level > 0 THEN
1734 oe_debug_pub.add('value changed');
1735 END IF;
1736 exit;
1737 end if;
1738 IF l_debug_level > 0 THEN
1739 oe_debug_pub.add('after comparison ,assiging the new to old, going to next iteration, line_id:'||l_line_id);
1740 END IF;
1741 l_old_header_id := l_header_id;
1742 l_old_arrival_set_id := l_arrival_set_id;
1743 l_old_ship_set_id := l_ship_set_id;
1744 l_old_top_model_line_id := l_top_model_line_id;
1745
1746 l_rec := l_rec + 1;
1747 l_line_tbl(l_rec) := OE_ORDER_PUB.G_MISS_LINE_REC;
1748 l_line_tbl(l_rec).line_id := l_line_id;
1749 G_COUNTER := G_COUNTER + 1;
1750 end loop; --End of bug# 13067303
1751 RAISE FND_API.G_EXC_ERROR;
1752 END IF;
1753
1754 l_line_tbl(l_rec).operation := OE_GLOBALS.G_OPR_UPDATE;
1755
1756 if p_ordered_quantity is NOT NULL then
1757 l_line_tbl(l_rec).ordered_quantity := p_ordered_quantity;
1758 end if;
1759
1760 if p_change_reason is NOT NULL then
1761 l_line_tbl(l_rec).change_reason := p_change_reason;
1762 end if;
1763
1764 if p_change_comments is not null then
1765 l_line_tbl(l_rec).change_comments := p_change_comments;
1766 end if;
1767
1768 if p_order_quantity_uom is NOT NULL then
1769 l_line_tbl(l_rec).order_quantity_uom := p_order_quantity_uom;
1770 end if;
1771
1772 if p_promise_date is NOT NULL then
1773 l_line_tbl(l_rec).promise_date := p_promise_date;
1774 end if;
1775
1776 if p_request_date is NOT NULL then
1777 l_line_tbl(l_rec).request_date := p_request_date;
1778 end if;
1779
1780 if p_schedule_ship_date is NOT NULL then
1781 l_line_tbl(l_rec).schedule_ship_date := p_schedule_ship_date;
1782 end if;
1783
1784 if p_price_list_id is NOT NULL then
1785 l_line_tbl(l_rec).price_list_id := p_price_list_id;
1786 end if;
1787
1788 if p_inventory_item_id is NOT NULL then
1789 l_line_tbl(l_rec).inventory_item_id := p_inventory_item_id;
1790 l_line_tbl(l_rec).ordered_item := p_ordered_item;
1791 end if;
1792
1793 if p_accounting_rule_id is NOT NULL then
1794 l_line_tbl(l_rec).accounting_rule_id := p_accounting_rule_id;
1795 end if;
1796
1797 if p_accounting_rule_duration is NOT NULL then
1798 l_line_tbl(l_rec).accounting_rule_duration := p_accounting_rule_duration;
1799 end if;
1800
1801 if p_actual_arrival_date is NOT NULL then
1802 l_line_tbl(l_rec).actual_arrival_date := p_actual_arrival_date;
1803 end if;
1804
1805 if p_actual_shipment_date is NOT NULL then
1806 l_line_tbl(l_rec).actual_shipment_date := p_actual_shipment_date;
1807 end if;
1808
1809 if p_agreement_id is NOT NULL then
1810 l_line_tbl(l_rec).agreement_id := p_agreement_id;
1811 end if;
1812
1813 if p_shipping_instructions is not null then
1814 l_line_tbl(l_rec).shipping_instructions:=p_shipping_instructions;
1815 end if;
1816
1817 if p_planning_priority is not null then
1818 l_line_tbl(l_rec).planning_priority:=p_planning_priority;
1819 end if;
1820
1821 if p_packing_instructions is not null then
1822 l_line_tbl(l_rec).packing_instructions:=p_packing_instructions;
1823 end if;
1824
1825 if p_ato_line_id is NOT NULL then
1826 l_line_tbl(l_rec).ato_line_id := p_ato_line_id;
1827 end if;
1828
1829 if p_attribute1 is NOT NULL then
1830 l_line_tbl(l_rec).attribute1 := p_attribute1;
1831 end if;
1832
1833 if p_attribute10 is NOT NULL then
1834 l_line_tbl(l_rec).attribute10 := p_attribute10;
1835 end if;
1836
1837 if p_attribute11 is NOT NULL then
1838 l_line_tbl(l_rec).attribute11 := p_attribute11;
1839 end if;
1840
1841 if p_attribute12 is NOT NULL then
1842 l_line_tbl(l_rec).attribute12 := p_attribute12;
1843 end if;
1844
1845 if p_attribute13 is NOT NULL then
1846 l_line_tbl(l_rec).attribute13 := p_attribute13;
1847 end if;
1848
1849 if p_attribute14 is NOT NULL then
1850 l_line_tbl(l_rec).attribute14 := p_attribute14;
1851 end if;
1852
1853 if p_attribute15 is NOT NULL then
1854 l_line_tbl(l_rec).attribute15 := p_attribute15;
1855 end if;
1856
1857 -- For bug 2184255
1858 if p_attribute16 is NOT NULL then
1859 l_line_tbl(l_rec).attribute16 := p_attribute16;
1860 end if;
1861
1862 if p_attribute17 is NOT NULL then
1863 l_line_tbl(l_rec).attribute17 := p_attribute17;
1864 end if;
1865
1866 if p_attribute18 is NOT NULL then
1867 l_line_tbl(l_rec).attribute18 := p_attribute18;
1868 end if;
1869
1870 if p_attribute19 is NOT NULL then
1871 l_line_tbl(l_rec).attribute19 := p_attribute19;
1872 end if;
1873
1874 if p_attribute2 is NOT NULL then
1875 l_line_tbl(l_rec).attribute2 := p_attribute2;
1876 end if;
1877
1878 if p_attribute20 is NOT NULL then
1879 l_line_tbl(l_rec).attribute20 := p_attribute20;
1880 end if;
1881
1882 if p_attribute3 is NOT NULL then
1883 l_line_tbl(l_rec).attribute3 := p_attribute3;
1884 end if;
1885
1886 if p_attribute4 is NOT NULL then
1887 l_line_tbl(l_rec).attribute4 := p_attribute4;
1888 end if;
1889
1890 if p_attribute5 is NOT NULL then
1891 l_line_tbl(l_rec).attribute5 := p_attribute5;
1892 end if;
1893
1894 if p_attribute6 is NOT NULL then
1895 l_line_tbl(l_rec).attribute6 := p_attribute6;
1896 end if;
1897
1898 if p_attribute7 is NOT NULL then
1899 l_line_tbl(l_rec).attribute7 := p_attribute7;
1900 end if;
1901
1902 if p_attribute8 is NOT NULL then
1903 l_line_tbl(l_rec).attribute8 := p_attribute8;
1904 end if;
1905
1906 if p_attribute9 is NOT NULL then
1907 l_line_tbl(l_rec).attribute9 := p_attribute9;
1908 end if;
1909
1910 if p_blanket_number is not null then
1911 l_line_tbl(l_rec).blanket_number:=p_blanket_number;
1912 end if;
1913
1914 if p_blanket_line_number is not null then
1915 l_line_tbl(l_rec).blanket_line_number:=p_blanket_line_number;
1916 end if;
1917
1918 if p_blanket_version_number is not null then
1919 l_line_tbl(l_rec).blanket_version_number:=p_blanket_version_number;
1920 end if;
1921
1922 if p_context is NOT NULL then
1923 l_line_tbl(l_rec).context := p_context;
1924 end if;
1925
1926 if p_auto_selected_quantity is NOT NULL then
1927 l_line_tbl(l_rec).auto_selected_quantity := p_auto_selected_quantity;
1928 end if;
1929
1930 if p_cancelled_quantity is NOT NULL then
1931 l_line_tbl(l_rec).cancelled_quantity := p_cancelled_quantity;
1932 end if;
1933
1934 if p_component_code is NOT NULL then
1935 l_line_tbl(l_rec).component_code := p_component_code;
1936 end if;
1937
1938 if p_component_number is NOT NULL then
1939 l_line_tbl(l_rec).component_number := p_component_number;
1940 end if;
1941
1942 if p_component_sequence_id is NOT NULL then
1943 l_line_tbl(l_rec).component_sequence_id := p_component_sequence_id;
1944 end if;
1945
1946 if p_config_display_sequence is NOT NULL then
1947 l_line_tbl(l_rec).config_display_sequence := p_config_display_sequence;
1948 end if;
1949
1950 if p_configuration_id is NOT NULL then
1951 l_line_tbl(l_rec).configuration_id := p_configuration_id;
1952 end if;
1953
1954 if p_credit_invoice_line_id is NOT NULL then
1955 l_line_tbl(l_rec).credit_invoice_line_id := p_credit_invoice_line_id;
1956 end if;
1957
1958 if p_customer_dock_code is NOT NULL then
1959 l_line_tbl(l_rec).customer_dock_code := p_customer_dock_code;
1960 end if;
1961
1962 if p_customer_job is NOT NULL then
1963 l_line_tbl(l_rec).customer_job := p_customer_job;
1964 end if;
1965
1966 if p_customer_production_line is NOT NULL then
1967 l_line_tbl(l_rec).customer_production_line := p_customer_production_line;
1968 end if;
1969
1970 if p_customer_trx_line_id is NOT NULL then
1971 l_line_tbl(l_rec).customer_trx_line_id := p_customer_trx_line_id;
1972 end if;
1973
1974 if p_cust_model_serial_number is NOT NULL then
1975 l_line_tbl(l_rec).cust_model_serial_number := p_cust_model_serial_number;
1976 end if;
1977
1978 if p_cust_po_number is NOT NULL then
1979 l_line_tbl(l_rec).cust_po_number := p_cust_po_number;
1980 end if;
1981
1982 if p_delivery_lead_time is NOT NULL then
1983 l_line_tbl(l_rec).delivery_lead_time := p_delivery_lead_time;
1984 end if;
1985
1986 if p_deliver_to_contact_id is NOT NULL then
1987 l_line_tbl(l_rec).deliver_to_contact_id := p_deliver_to_contact_id;
1988 end if;
1989
1990 if p_deliver_to_org_id is NOT NULL then
1991 l_line_tbl(l_rec).deliver_to_org_id := p_deliver_to_org_id;
1992 end if;
1993
1994 if p_demand_bucket_type_code is NOT NULL then
1995 l_line_tbl(l_rec).demand_bucket_type_code := p_demand_bucket_type_code;
1996 end if;
1997
1998 if p_demand_class_code is NOT NULL then
1999 l_line_tbl(l_rec).demand_class_code := p_demand_class_code;
2000 end if;
2001
2002 if p_dep_plan_required_flag is NOT NULL then
2003 l_line_tbl(l_rec).dep_plan_required_flag := p_dep_plan_required_flag;
2004 end if;
2005
2006 if p_earliest_acceptable_date is NOT NULL then
2007 l_line_tbl(l_rec).earliest_acceptable_date := p_earliest_acceptable_date;
2008 end if;
2009
2010 if p_explosion_date is NOT NULL then
2011 l_line_tbl(l_rec).explosion_date:= p_explosion_date;
2012 end if;
2013
2014 if p_fob_point_code is NOT NULL then
2015 l_line_tbl(l_rec).fob_point_code := p_fob_point_code;
2016 end if;
2017
2018 if p_freight_carrier_code is NOT NULL then
2019 l_line_tbl(l_rec).freight_carrier_code := p_freight_carrier_code;
2020 end if;
2021
2022 if p_freight_terms_code is NOT NULL then
2023 l_line_tbl(l_rec).freight_terms_code := p_freight_terms_code;
2024 end if;
2025
2026 if p_fulfilled_quantity is NOT NULL then
2027 l_line_tbl(l_rec).fulfilled_quantity := p_fulfilled_quantity;
2028 end if;
2029
2030 if p_global_attribute1 is NOT NULL then
2031 l_line_tbl(l_rec).global_attribute1 := p_global_attribute1;
2032 end if;
2033
2034 if p_global_attribute2 is NOT NULL then
2035 l_line_tbl(l_rec).global_attribute2 :=p_global_attribute2;
2036 end if;
2037
2038 if p_global_attribute3 is NOT NULL then
2039 l_line_tbl(l_rec).global_attribute3 := p_global_attribute3;
2040 end if;
2041
2042 if p_global_attribute4 is NOT NULL then
2043 l_line_tbl(l_rec).global_attribute4 := p_global_attribute4;
2044 end if;
2045
2046 if p_global_attribute5 is NOT NULL then
2047 l_line_tbl(l_rec).global_attribute5 := p_global_attribute5;
2048 end if;
2049
2050 if p_global_attribute6 is NOT NULL then
2051 l_line_tbl(l_rec).global_attribute6 := p_global_attribute6;
2052 end if;
2053
2054 if p_global_attribute7 is NOT NULL then
2055 l_line_tbl(l_rec).global_attribute7 := p_global_attribute7;
2056 end if;
2057
2058 if p_global_attribute8 is NOT NULL then
2059 l_line_tbl(l_rec).global_attribute8 := p_global_attribute8;
2060 end if;
2061
2062 if p_global_attribute9 is NOT NULL then
2063 l_line_tbl(l_rec).global_attribute9 := p_global_attribute9;
2064 end if;
2065
2066 if p_global_attribute10 is NOT NULL then
2067 l_line_tbl(l_rec).global_attribute10 := p_global_attribute10;
2068 end if;
2069
2070 if p_global_attribute11 is NOT NULL then
2071 l_line_tbl(l_rec).global_attribute11 := p_global_attribute11;
2072 end if;
2073
2074 if p_global_attribute12 is NOT NULL then
2075 l_line_tbl(l_rec).global_attribute12 := p_global_attribute12;
2076 end if;
2077
2078 if p_global_attribute13 is NOT NULL then
2079 l_line_tbl(l_rec).global_attribute13 := p_global_attribute13;
2080 end if;
2081
2082 if p_global_attribute14 is NOT NULL then
2083 l_line_tbl(l_rec).global_attribute14 := p_global_attribute14;
2084 end if;
2085
2086 if p_global_attribute15 is NOT NULL then
2087 l_line_tbl(l_rec).global_attribute15 := p_global_attribute15;
2088 end if;
2089
2090 if p_global_attribute16 is NOT NULL then
2091 l_line_tbl(l_rec).global_attribute16 := p_global_attribute16;
2092 end if;
2093
2094 if p_global_attribute17 is NOT NULL then
2095 l_line_tbl(l_rec).global_attribute17 := p_global_attribute17;
2096 end if;
2097
2098 if p_global_attribute18 is NOT NULL then
2099 l_line_tbl(l_rec).global_attribute18 := p_global_attribute18;
2100 end if;
2101
2102 if p_global_attribute19 is NOT NULL then
2103 l_line_tbl(l_rec).global_attribute19 := p_global_attribute19;
2104 end if;
2105
2106 if p_global_attribute20 is NOT NULL then
2107 l_line_tbl(l_rec).global_attribute20 := p_global_attribute20;
2108 end if;
2109
2110 if p_global_attribute_category is NOT NULL then
2111 l_line_tbl(l_rec).global_attribute_category := p_global_attribute_category;
2112 end if;
2113
2114 if p_industry_attribute1 is NOT NULL then
2115 l_line_tbl(l_rec).industry_attribute1 := p_industry_attribute1 ;
2116 end if;
2117
2118 if p_industry_attribute2 is NOT NULL then
2119 l_line_tbl(l_rec).industry_attribute2 := p_industry_attribute2 ;
2120 end if;
2121
2122 if p_industry_attribute3 is NOT NULL then
2123 l_line_tbl(l_rec).industry_attribute3 := p_industry_attribute3 ;
2124 end if;
2125
2126 if p_industry_attribute4 is NOT NULL then
2127 l_line_tbl(l_rec).industry_attribute4 := p_industry_attribute4 ;
2128 end if;
2129
2130 if p_industry_attribute5 is NOT NULL then
2131 l_line_tbl(l_rec).industry_attribute5 := p_industry_attribute5 ;
2132 end if;
2133
2134 if p_industry_attribute6 is NOT NULL then
2135 l_line_tbl(l_rec).industry_attribute6 := p_industry_attribute6 ;
2136 end if;
2137
2138 if p_industry_attribute7 is NOT NULL then
2139 l_line_tbl(l_rec).industry_attribute7 := p_industry_attribute7 ;
2140 end if;
2141
2142 if p_industry_attribute8 is NOT NULL then
2143 l_line_tbl(l_rec).industry_attribute8 := p_industry_attribute8 ;
2144 end if;
2145
2146 if p_industry_attribute9 is NOT NULL then
2147 l_line_tbl(l_rec).industry_attribute9 := p_industry_attribute9 ;
2148 end if;
2149
2150 if p_industry_attribute10 is NOT NULL then
2151 l_line_tbl(l_rec).industry_attribute10 := p_industry_attribute10 ;
2152 end if;
2153
2154 if p_industry_attribute11 is NOT NULL then
2155 l_line_tbl(l_rec).industry_attribute11 := p_industry_attribute11 ;
2156 end if;
2157
2158 if p_industry_attribute12 is NOT NULL then
2159 l_line_tbl(l_rec).industry_attribute12 := p_industry_attribute12 ;
2160 end if;
2161
2162 if p_industry_attribute13 is NOT NULL then
2163 l_line_tbl(l_rec).industry_attribute13 := p_industry_attribute13 ;
2164 end if;
2165
2166 if p_industry_attribute14 is NOT NULL then
2167 l_line_tbl(l_rec).industry_attribute14 := p_industry_attribute14 ;
2168 end if;
2169
2170 if p_industry_attribute15 is NOT NULL then
2171 l_line_tbl(l_rec).industry_attribute15 := p_industry_attribute15 ;
2172 end if;
2173
2174 if p_industry_attribute16 is NOT NULL then
2175 l_line_tbl(l_rec).industry_attribute16 := p_industry_attribute16 ;
2176 end if;
2177
2178 if p_industry_attribute17 is NOT NULL then
2179 l_line_tbl(l_rec).industry_attribute17 := p_industry_attribute17 ;
2180 end if;
2181
2182 if p_industry_attribute18 is NOT NULL then
2183 l_line_tbl(l_rec).industry_attribute18 := p_industry_attribute18 ;
2184 end if;
2185
2186 if p_industry_attribute19 is NOT NULL then
2187 l_line_tbl(l_rec).industry_attribute19 := p_industry_attribute19 ;
2188 end if;
2189
2190 if p_industry_attribute20 is NOT NULL then
2191 l_line_tbl(l_rec).industry_attribute20 := p_industry_attribute20 ;
2192 end if;
2193
2194 if p_industry_attribute21 is NOT NULL then
2195 l_line_tbl(l_rec).industry_attribute21 := p_industry_attribute21 ;
2196 end if;
2197
2198 if p_industry_attribute22 is NOT NULL then
2199 l_line_tbl(l_rec).industry_attribute22 := p_industry_attribute22 ;
2200 end if;
2201
2202 if p_industry_attribute23 is NOT NULL then
2203 l_line_tbl(l_rec).industry_attribute23 := p_industry_attribute23 ;
2204 end if;
2205
2206 if p_industry_attribute24 is NOT NULL then
2207 l_line_tbl(l_rec).industry_attribute24 := p_industry_attribute24 ;
2208 end if;
2209
2210 if p_industry_attribute25 is NOT NULL then
2211 l_line_tbl(l_rec).industry_attribute25 := p_industry_attribute25 ;
2212 end if;
2213
2214 if p_industry_attribute26 is NOT NULL then
2215 l_line_tbl(l_rec).industry_attribute26 := p_industry_attribute26 ;
2216 end if;
2217
2218 if p_industry_attribute27 is NOT NULL then
2219 l_line_tbl(l_rec).industry_attribute27 := p_industry_attribute27 ;
2220 end if;
2221
2222 if p_industry_attribute28 is NOT NULL then
2223 l_line_tbl(l_rec).industry_attribute28 := p_industry_attribute28 ;
2224 end if;
2225
2226 if p_industry_attribute29 is NOT NULL then
2227 l_line_tbl(l_rec).industry_attribute29 := p_industry_attribute29 ;
2228 end if;
2229
2230 if p_industry_attribute30 is NOT NULL then
2231 l_line_tbl(l_rec).industry_attribute30 := p_industry_attribute30 ;
2232 end if;
2233
2234 if p_industry_context is NOT NULL then
2235 l_line_tbl(l_rec).industry_context := p_industry_context;
2236 end if;
2237
2238 if p_intermed_ship_to_contact_id is NOT NULL then
2239 l_line_tbl(l_rec).intermed_ship_to_contact_id := p_intermed_ship_to_contact_id;
2240 end if;
2241
2242 if p_intermed_ship_to_org_id is NOT NULL then
2243 l_line_tbl(l_rec).intermed_ship_to_org_id :=p_intermed_ship_to_org_id ;
2244 end if;
2245
2246 if p_inventory_item_id is NOT NULL then
2247 l_line_tbl(l_rec).inventory_item_id:= p_inventory_item_id;
2248 end if;
2249
2250 if p_invoice_interface_status is NOT NULL then
2251 l_line_tbl(l_rec).invoice_interface_status_code:= p_invoice_interface_status;
2252 end if;
2253
2254 if p_invoice_to_contact_id is NOT NULL then
2255 l_line_tbl(l_rec).invoice_to_contact_id:= p_invoice_to_contact_id;
2256 end if;
2257
2258 if p_invoice_to_org_id is NOT NULL then
2259 l_line_tbl(l_rec).invoice_to_org_id:= p_invoice_to_org_id;
2260 end if;
2261
2262 if p_invoicing_rule_id is NOT NULL then
2263 l_line_tbl(l_rec).invoicing_rule_id :=p_invoicing_rule_id;
2264 end if;
2265
2266 if p_ordered_item_id is NOT NULL then
2267 l_line_tbl(l_rec).ordered_item_id:= p_ordered_item_id;
2268 end if;
2269
2270 if p_item_identifier_type is NOT NULL then
2271 l_line_tbl(l_rec).item_identifier_type:= p_item_identifier_type;
2272 IF p_item_identifier_type NOT IN ('INT','CUST') then --Bug 8306353
2273 l_line_tbl(l_rec).ordered_item_id:= NULL;
2274 END IF;
2275
2276 end if;
2277
2278 if p_ordered_item is NOT NULL then
2279 l_line_tbl(l_rec).ordered_item := p_ordered_item;
2280 end if;
2281
2282 if p_item_revision is NOT NULL then
2283 l_line_tbl(l_rec).item_revision:= p_item_revision;
2284 end if;
2285
2286 if p_item_type_code is NOT NULL then
2287 l_line_tbl(l_rec).item_type_code :=p_item_type_code;
2288 end if;
2289
2290 if p_latest_acceptable_date is NOT NULL then
2291 l_line_tbl(l_rec).latest_acceptable_date := p_latest_acceptable_date;
2292 end if;
2293
2294 if p_line_category_code is NOT NULL then
2295 l_line_tbl(l_rec).line_category_code:= p_line_category_code;
2296 end if;
2297
2298 if p_line_id is NOT NULL then
2299 l_line_tbl(l_rec).line_id := p_line_id;
2300 end if;
2301
2302 if p_line_number is NOT NULL then
2303 l_line_tbl(l_rec).line_number :=p_line_number;
2304 end if;
2305
2306 if p_line_type_id is NOT NULL then
2307 l_line_tbl(l_rec).line_type_id :=p_line_type_id;
2308 end if;
2309
2310 if p_link_to_line_id is NOT NULL then
2311 l_line_tbl(l_rec).link_to_line_id :=p_link_to_line_id;
2312 end if;
2313
2314 if p_model_group_number is NOT NULL then
2315 l_line_tbl(l_rec).model_group_number:= p_model_group_number;
2316 end if;
2317
2318 if p_option_flag is NOT NULL then
2319 l_line_tbl(l_rec).option_flag := p_option_flag;
2320 end if;
2321
2322 if p_option_number is NOT NULL then
2323 l_line_tbl(l_rec).option_number :=p_option_number;
2324 end if;
2325
2326 if p_ordered_quantity is NOT NULL then
2327 l_line_tbl(l_rec).ordered_quantity :=p_ordered_quantity;
2328 end if;
2329
2330 if p_order_quantity_uom is NOT NULL then
2331 l_line_tbl(l_rec).order_quantity_uom :=p_order_quantity_uom;
2332 end if;
2333
2334 if p_orig_sys_document_ref is NOT NULL then
2335 l_line_tbl(l_rec).orig_sys_document_ref :=p_orig_sys_document_ref;
2336 end if;
2337
2338 if p_orig_sys_line_ref is NOT NULL then
2339 l_line_tbl(l_rec).orig_sys_line_ref :=p_orig_sys_line_ref;
2340 end if;
2341
2342 if p_payment_term_id is NOT NULL then
2343 l_line_tbl(l_rec).payment_term_id :=p_payment_term_id;
2344 end if;
2345
2346 if p_price_list_id is NOT NULL then
2347 l_line_tbl(l_rec).price_list_id :=p_price_list_id;
2348 end if;
2349
2350 if p_pricing_attribute1 is NOT NULL then
2351 l_line_tbl(l_rec).pricing_attribute1:= p_pricing_attribute1;
2352 end if;
2353
2354 if p_pricing_attribute10 is NOT NULL then
2355 l_line_tbl(l_rec).pricing_attribute10 :=p_pricing_attribute10;
2356 end if;
2357
2358 if p_pricing_attribute2 is NOT NULL then
2359 l_line_tbl(l_rec).pricing_attribute2 :=p_pricing_attribute2;
2360 end if;
2361
2362 if p_pricing_attribute3 is NOT NULL then
2363 l_line_tbl(l_rec).pricing_attribute3 :=p_pricing_attribute3;
2364 end if;
2365
2366 if p_pricing_attribute4 is NOT NULL then
2367 l_line_tbl(l_rec).pricing_attribute4 :=p_pricing_attribute4;
2368 end if;
2369
2370 if p_pricing_attribute5 is NOT NULL then
2371 l_line_tbl(l_rec).pricing_attribute5 :=p_pricing_attribute5;
2372 end if;
2373
2374 if p_pricing_attribute6 is NOT NULL then
2375 l_line_tbl(l_rec).pricing_attribute6 :=p_pricing_attribute6;
2376 end if;
2377
2378 if p_pricing_attribute7 is NOT NULL then
2379 l_line_tbl(l_rec).pricing_attribute7 :=p_pricing_attribute7;
2380 end if;
2381
2382 if p_pricing_attribute8 is NOT NULL then
2383 l_line_tbl(l_rec).pricing_attribute8 :=p_pricing_attribute8;
2384 end if;
2385
2386 if p_pricing_attribute9 is NOT NULL then
2387 l_line_tbl(l_rec).pricing_attribute9 :=p_pricing_attribute9;
2388 end if;
2389
2390 if p_pricing_context is NOT NULL then
2391 l_line_tbl(l_rec).pricing_context :=p_pricing_context;
2392 end if;
2393
2394 if p_pricing_date is NOT NULL then
2395 l_line_tbl(l_rec).pricing_date :=p_pricing_date;
2396 end if;
2397
2398 if p_pricing_quantity is NOT NULL then
2399 l_line_tbl(l_rec).pricing_quantity :=p_pricing_quantity;
2400 end if;
2401
2402 if p_pricing_quantity_uom is NOT NULL then
2403 l_line_tbl(l_rec).pricing_quantity_uom:= p_pricing_quantity_uom;
2404 end if;
2405
2406 if p_project_id is NOT NULL then
2407 l_line_tbl(l_rec).project_id:= p_project_id;
2408 end if;
2409
2410 if p_promise_date is NOT NULL then
2411 l_line_tbl(l_rec).promise_date:= p_promise_date;
2412 end if;
2413
2414 if p_reference_header_id is NOT NULL then
2415 l_line_tbl(l_rec).reference_header_id :=p_reference_header_id;
2416 end if;
2417
2418 if p_reference_line_id is NOT NULL then
2419 l_line_tbl(l_rec).reference_line_id :=p_reference_line_id;
2420 end if;
2421
2422 if p_reference_type is NOT NULL then
2423 l_line_tbl(l_rec).reference_type :=p_reference_type;
2424 end if;
2425
2426 if p_request_date is NOT NULL then
2427 l_line_tbl(l_rec).request_date :=p_request_date ;
2428 end if;
2429
2430 if p_reserved_quantity is NOT NULL then
2431 l_line_tbl(l_rec).reserved_quantity :=p_reserved_quantity;
2432 end if;
2433
2434 if p_return_attribute1 is NOT NULL then
2435 l_line_tbl(l_rec).return_attribute1 :=p_return_attribute1;
2436 end if;
2437
2438 if p_return_attribute10 is NOT NULL then
2439 l_line_tbl(l_rec).return_attribute10 :=p_return_attribute10;
2440 end if;
2441
2442 if p_return_attribute11 is NOT NULL then
2443 l_line_tbl(l_rec).return_attribute11 :=p_return_attribute11;
2444 end if;
2445
2446 if p_return_attribute12 is NOT NULL then
2447 l_line_tbl(l_rec).return_attribute12 :=p_return_attribute12;
2448 end if;
2449
2450 if p_return_attribute13 is NOT NULL then
2451 l_line_tbl(l_rec).return_attribute13 :=p_return_attribute13;
2452 end if;
2453
2454 if p_return_attribute14 is NOT NULL then
2455 l_line_tbl(l_rec).return_attribute14 :=p_return_attribute14;
2456 end if;
2457
2458 if p_return_attribute2 is NOT NULL then
2459 l_line_tbl(l_rec).return_attribute2 :=p_return_attribute2;
2460 end if;
2461
2462 if p_return_attribute3 is NOT NULL then
2463 l_line_tbl(l_rec).return_attribute3 :=p_return_attribute3;
2464 end if;
2465
2466 if p_return_attribute4 is NOT NULL then
2467 l_line_tbl(l_rec).return_attribute4 :=p_return_attribute4;
2468 end if;
2469
2470 if p_return_attribute5 is NOT NULL then
2471 l_line_tbl(l_rec).return_attribute5 :=p_return_attribute5;
2472 end if;
2473
2474 if p_return_attribute6 is NOT NULL then
2475 l_line_tbl(l_rec).return_attribute6 :=p_return_attribute6;
2476 end if;
2477
2478 if p_return_attribute7 is NOT NULL then
2479 l_line_tbl(l_rec).return_attribute7 :=p_return_attribute7;
2480 end if;
2481
2482 if p_return_attribute8 is NOT NULL then
2483 l_line_tbl(l_rec).return_attribute8 :=p_return_attribute8;
2484 end if;
2485
2486 if p_return_attribute9 is NOT NULL then
2487 l_line_tbl(l_rec).return_attribute9 :=p_return_attribute9;
2488 end if;
2489
2490 if p_return_context is NOT NULL then
2491 l_line_tbl(l_rec).return_context :=p_return_context;
2492 end if;
2493
2494 if p_rla_schedule_type_code is NOT NULL then
2495 l_line_tbl(l_rec).rla_schedule_type_code :=p_rla_schedule_type_code;
2496 end if;
2497
2498 if p_schedule_arrival_date is NOT NULL then
2499 l_line_tbl(l_rec).schedule_arrival_date :=p_schedule_arrival_date;
2500 end if;
2501
2502 if p_schedule_ship_date is NOT NULL then
2503 l_line_tbl(l_rec).schedule_ship_date :=p_schedule_ship_date;
2504 end if;
2505
2506 if p_schedule_action_code is NOT NULL then
2507 l_line_tbl(l_rec).schedule_action_code :=p_schedule_action_code;
2508 end if;
2509
2510 if p_schedule_status_code is NOT NULL then
2511 l_line_tbl(l_rec).schedule_status_code :=p_schedule_status_code;
2512 end if;
2513
2514 if p_shipped_quantity is NOT NULL then
2515 l_line_tbl(l_rec).shipped_quantity :=p_shipped_quantity;
2516 end if;
2517
2518 if p_shipment_number is NOT NULL then
2519 l_line_tbl(l_rec).shipment_number :=p_shipment_number;
2520 end if;
2521
2522 if p_shipment_priority_code is NOT NULL then
2523 l_line_tbl(l_rec).shipment_priority_code :=p_shipment_priority_code;
2524 end if;
2525
2526 if p_shipping_method_code is NOT NULL then
2527 l_line_tbl(l_rec).shipping_method_code:=p_shipping_method_code;
2528 end if;
2529
2530 if p_shipping_quantity is NOT NULL then
2531 l_line_tbl(l_rec).shipping_quantity :=p_shipping_quantity;
2532 end if;
2533
2534 if p_shipping_quantity_uom is NOT NULL then
2535 l_line_tbl(l_rec).shipping_quantity_uom :=p_shipping_quantity_uom;
2536 end if;
2537
2538 if p_ship_from_org_id is NOT NULL then
2539 l_line_tbl(l_rec).ship_from_org_id :=p_ship_from_org_id;
2540 end if;
2541
2542 if p_ship_tolerance_above is NOT NULL then
2543 l_line_tbl(l_rec).ship_tolerance_above :=p_ship_tolerance_above;
2544 end if;
2545
2546 if p_ship_tolerance_below is NOT NULL then
2547 l_line_tbl(l_rec).ship_tolerance_below :=p_ship_tolerance_below;
2548 end if;
2549
2550 if p_shipping_interfaced_flag is NOT NULL then
2551 l_line_tbl(l_rec).shipping_interfaced_flag :=p_shipping_interfaced_flag;
2552 end if;
2553
2554 if p_ship_to_contact_id is NOT NULL then
2555 l_line_tbl(l_rec).ship_to_contact_id:=p_ship_to_contact_id;
2556 end if;
2557
2558 if p_ship_to_org_id is NOT NULL then
2559 l_line_tbl(l_rec).ship_to_org_id :=p_ship_to_org_id;
2560 end if;
2561
2562 if p_ship_model_complete_flag is NOT NULL then
2563 l_line_tbl(l_rec).ship_model_complete_flag := p_ship_model_complete_flag;
2564 end if;
2565
2566 if p_sold_to_org_id is NOT NULL then
2567 l_line_tbl(l_rec).sold_to_org_id:=p_sold_to_org_id;
2568 end if;
2569
2570 if p_sort_order is NOT NULL then
2571 l_line_tbl(l_rec).sort_order :=p_sort_order;
2572 end if;
2573
2574 if p_source_document_id is NOT NULL then
2575 l_line_tbl(l_rec).source_document_id:=p_source_document_id;
2576 end if;
2577
2578 if p_source_document_line_id is NOT NULL then
2579 l_line_tbl(l_rec).source_document_line_id :=p_source_document_line_id;
2580 end if;
2581
2582 if p_source_document_type_id is NOT NULL then
2583 l_line_tbl(l_rec).source_document_type_id :=p_source_document_type_id;
2584 end if;
2585
2586 if p_source_type_code is NOT NULL then
2587 l_line_tbl(l_rec).source_type_code :=p_source_type_code;
2588 end if;
2589
2590 if p_task_id is NOT NULL then
2591 l_line_tbl(l_rec).task_id :=p_task_id;
2592 end if;
2593
2594 if p_tax_code is NOT NULL then
2595 l_line_tbl(l_rec).tax_code :=p_tax_code;
2596 end if;
2597
2598 if p_tax_date is NOT NULL then
2599 l_line_tbl(l_rec).tax_date :=p_tax_date;
2600 end if;
2601
2602 if p_tax_exempt_flag is NOT NULL then
2603 l_line_tbl(l_rec).tax_exempt_flag := p_tax_exempt_flag;
2604 end if;
2605
2606 if p_tax_exempt_number is NOT NULL then
2607 l_line_tbl(l_rec).tax_exempt_number :=p_tax_exempt_number;
2608 end if;
2609
2610 if p_tax_exempt_reason_code is NOT NULL then
2611 l_line_tbl(l_rec).tax_exempt_reason_code :=p_tax_exempt_reason_code;
2612 end if;
2613
2614 if p_tax_point_code is NOT NULL then
2615 l_line_tbl(l_rec).tax_point_code :=p_tax_point_code;
2616 end if;
2617
2618 if p_tax_rate is NOT NULL then
2619 l_line_tbl(l_rec).tax_rate :=p_tax_rate;
2620 end if;
2621
2622 if p_tax_value is NOT NULL then
2623 l_line_tbl(l_rec).tax_value :=p_tax_value;
2624 end if;
2625
2626 if p_top_model_line_id is NOT NULL then
2627 l_line_tbl(l_rec).top_model_line_id :=p_top_model_line_id;
2628 end if;
2629
2630 if p_unit_list_price is NOT NULL then
2631 l_line_tbl(l_rec).unit_list_price :=p_unit_list_price;
2632 end if;
2633
2634 if p_unit_selling_price is NOT NULL then
2635 l_line_tbl(l_rec).unit_selling_price :=p_unit_selling_price;
2636 -- bug 3926188 l_line_tbl(l_rec).calculate_price_flag := 'P';
2637 end if;
2638
2639 if p_visible_demand_flag is NOT NULL then
2640 l_line_tbl(l_rec).visible_demand_flag :=p_visible_demand_flag;
2641 end if;
2642
2643
2644 if p_split_from_line_id is NOT NULL then
2645 l_line_tbl(l_rec).split_from_line_id := p_split_from_line_id;
2646 end if;
2647
2648 if p_cust_production_seq_num is NOT NULL then
2649 l_line_tbl(l_rec).cust_production_seq_num :=p_cust_production_seq_num;
2650 end if;
2651
2652 if p_authorized_to_ship_flag is NOT NULL then
2653 l_line_tbl(l_rec).authorized_to_ship_flag :=p_authorized_to_ship_flag;
2654 end if;
2655
2656 if p_veh_cus_item_cum_key_id is NOT NULL then
2657 l_line_tbl(l_rec).veh_cus_item_cum_key_id :=p_veh_cus_item_cum_key_id;
2658 end if;
2659
2660 if p_salesrep_id is NOT NULL then
2661 l_line_tbl(l_rec).salesrep_id:= p_salesrep_id;
2662 end if;
2663
2664 if p_return_reason_code is NOT NULL then
2665 l_line_tbl(l_rec).return_reason_code :=p_return_reason_code;
2666 end if;
2667
2668 if p_arrival_set_id is NOT NULL then
2669 l_line_tbl(l_rec).arrival_set_id :=p_arrival_set_id;
2670 end if;
2671
2672 if p_ship_set_id is NOT NULL then
2673 l_line_tbl(l_rec).ship_set_id :=p_ship_set_id;
2674 end if;
2675
2676 if p_over_ship_reason_code is NOT NULL then
2677 l_line_tbl(l_rec).over_ship_reason_code :=p_over_ship_reason_code;
2678 end if;
2679
2680 if p_over_ship_resolved_flag is NOT NULL then
2681 l_line_tbl(l_rec).over_ship_resolved_flag :=p_over_ship_resolved_flag;
2682 end if;
2683
2684 if p_first_ack_code is NOT NULL then
2685 l_line_tbl(l_rec).first_ack_code := p_first_ack_code;
2686 end if;
2687
2688 if p_first_ack_date is NOT NULL then
2689 l_line_tbl(l_rec).first_ack_date:=p_first_ack_date;
2690 end if;
2691
2692 if p_last_ack_code is NOT NULL then
2693 l_line_tbl(l_rec).last_ack_code:=p_last_ack_code;
2694 end if;
2695
2696 if p_last_ack_date is NOT NULL then
2697 l_line_tbl(l_rec).last_ack_date:=p_last_ack_date;
2698 end if;
2699
2700 if p_service_txn_reason_code is NOT NULL then
2701 l_line_tbl(l_rec).service_txn_reason_code := p_service_txn_reason_code;
2702 end if;
2703
2704 if p_service_txn_comments is NOT NULL then
2705 l_line_tbl(l_rec).service_txn_comments := p_service_txn_comments;
2706 end if;
2707
2708 if p_unit_selling_percent is NOT NULL then
2709 l_line_tbl(l_rec).unit_selling_percent := p_unit_selling_percent;
2710 end if;
2711
2712 if p_unit_list_percent is NOT NULL then
2713 l_line_tbl(l_rec).unit_list_percent := p_unit_list_percent;
2714 end if;
2715
2716 if p_unit_percent_base_price is NOT NULL then
2717 l_line_tbl(l_rec).unit_percent_base_price := p_unit_percent_base_price;
2718 end if;
2719
2720 if p_service_duration is NOT NULL then
2721 l_line_tbl(l_rec).service_duration := p_service_duration;
2722 end if;
2723
2724 if p_service_start_date is NOT NULL then
2725 l_line_tbl(l_rec).service_start_date := p_service_start_date;
2726 end if;
2727
2728 if p_service_period is NOT NULL then
2729 l_line_tbl(l_rec).service_period := p_service_period;
2730 end if;
2731
2732 if p_service_end_date is NOT NULL then
2733 l_line_tbl(l_rec).service_end_date := p_service_end_date;
2734 end if;
2735
2736 if p_service_coterminate_flag is NOT NULL then
2737 l_line_tbl(l_rec).service_coterminate_flag := p_service_coterminate_flag;
2738 end if;
2739
2740 if p_service_number is NOT NULL then
2741 l_line_tbl(l_rec).service_number := p_service_number;
2742 end if;
2743
2744 if p_service_reference_type_code is NOT NULL then
2745 l_line_tbl(l_rec).service_reference_type_code := p_service_reference_type_code;
2746 end if;
2747
2748 if p_service_reference_line_id is NOT NULL then
2749 l_line_tbl(l_rec).service_reference_line_id := p_service_reference_line_id;
2750 end if;
2751
2752 if p_service_reference_system_id is NOT NULL then
2753 l_line_tbl(l_rec).service_reference_system_id := p_service_reference_system_id;
2754 end if;
2755
2756 if p_tp_context is NOT NULL then
2757 l_line_tbl(l_rec).tp_context := p_tp_context;
2758 end if;
2759
2760 if p_tp_attribute1 is NOT NULL then
2761 l_line_tbl(l_rec).tp_attribute1 := p_tp_attribute1;
2762 end if;
2763
2764 if p_tp_attribute2 is NOT NULL then
2765 l_line_tbl(l_rec).tp_attribute2 := p_tp_attribute2;
2766 end if;
2767
2768 if p_tp_attribute3 is NOT NULL then
2769 l_line_tbl(l_rec).tp_attribute3 := p_tp_attribute3;
2770 end if;
2771
2772 if p_tp_attribute4 is NOT NULL then
2773 l_line_tbl(l_rec).tp_attribute4 := p_tp_attribute4;
2774 end if;
2775
2776 if p_tp_attribute5 is NOT NULL then
2777 l_line_tbl(l_rec).tp_attribute5 := p_tp_attribute5;
2778 end if;
2779
2780 if p_tp_attribute6 is NOT NULL then
2781 l_line_tbl(l_rec).tp_attribute6 := p_tp_attribute6;
2782 end if;
2783
2784 if p_tp_attribute7 is NOT NULL then
2785 l_line_tbl(l_rec).tp_attribute7 := p_tp_attribute7;
2786 end if;
2787
2788 if p_tp_attribute8 is NOT NULL then
2789 l_line_tbl(l_rec).tp_attribute8 := p_tp_attribute8;
2790 end if;
2791
2792 if p_tp_attribute9 is NOT NULL then
2793 l_line_tbl(l_rec).tp_attribute9 := p_tp_attribute9;
2794 end if;
2795
2796 if p_tp_attribute10 is NOT NULL then
2797 l_line_tbl(l_rec).tp_attribute10 := p_tp_attribute10;
2798 end if;
2799
2800 if p_tp_attribute11 is NOT NULL then
2801 l_line_tbl(l_rec).tp_attribute11 := p_tp_attribute11;
2802 end if;
2803
2804 if p_tp_attribute12 is NOT NULL then
2805 l_line_tbl(l_rec).tp_attribute12 := p_tp_attribute12;
2806 end if;
2807
2808 if p_tp_attribute13 is NOT NULL then
2809 l_line_tbl(l_rec).tp_attribute13 := p_tp_attribute13;
2810 end if;
2811
2812 if p_tp_attribute14 is NOT NULL then
2813 l_line_tbl(l_rec).tp_attribute14 := p_tp_attribute14;
2814 end if;
2815
2816 if p_tp_attribute15 is NOT NULL then
2817 l_line_tbl(l_rec).tp_attribute15 := p_tp_attribute15;
2818 end if;
2819
2820 if p_calculate_price_flag is NOT NULL then
2821 l_line_tbl(l_rec).calculate_price_flag := p_calculate_price_flag;
2822 end if;
2823
2824 if p_end_customer_contact_id is not null then
2825 l_line_tbl(l_rec).end_customer_contact_id := p_end_customer_contact_id;
2826 end if;
2827
2828 if p_end_customer_id is not null then
2829 l_line_tbl(l_rec).end_customer_id := p_end_customer_id;
2830 end if;
2831
2832 if p_end_customer_site_use_id is not null then
2833 l_line_tbl(l_rec).end_customer_site_use_id := p_end_customer_site_use_id;
2834 end if;
2835
2836 if p_ib_owner is not null then
2837 l_line_tbl(l_rec).ib_owner := p_ib_owner;
2838 end if;
2839
2840 if p_ib_installed_at_location is not null then
2841 l_line_tbl(l_rec).ib_installed_at_location := p_ib_installed_at_location;
2842 end if;
2843
2844 if p_ib_current_location is not null then
2845 l_line_tbl(l_rec).ib_current_location := p_ib_current_location;
2846 end if;
2847
2848 --sol_ord_er #16014165
2849
2850 IF p_service_bill_profile_id IS NOT NULL THEN
2851 l_line_tbl(l_rec).service_bill_profile_id :=p_service_bill_profile_id;
2852 END IF;
2853
2854 IF p_service_bill_option_code IS NOT NULL THEN
2855 l_line_tbl(l_rec).service_bill_option_code :=p_service_bill_option_code;
2856 END IF;
2857
2858 IF p_service_cov_template_id IS NOT NULL THEN
2859 l_line_tbl(l_rec).service_cov_template_id := p_service_cov_template_id;
2860 END IF;
2861
2862 IF p_service_subs_template_id IS NOT NULL THEN
2863 l_line_tbl(l_rec).service_subs_template_id :=p_service_subs_template_id;
2864 END IF;
2865
2866 --sol_ord_er #16014165 end
2867
2868 FETCH c1 into l_line_id, l_current_org_id, l_header_id, l_arrival_set_id,
2869 l_ship_set_id, l_top_model_line_id;
2870 EXIT WHEN c1%notfound;
2871 --- Start bug 6850537,7210480
2872
2873 IF l_header_id <> l_old_header_id
2874 THEN
2875 IF l_debug_level>0 THEN
2876 oe_debug_pub.ADD('header id got changed'||l_header_id||' '||l_old_header_id);
2877 END IF;
2878 G_HEADER_CHANGED :=1;
2879
2880 --Bug 7566697
2881 l_header_changed := TRUE;
2882 ELSE
2883 l_header_changed := FALSE;
2884 END IF;
2885
2886 -- End bug 6850537 ,7210480
2887
2888 -- If all old values are null then old line was a standard line.
2889 if ( l_old_arrival_set_id is null
2890 and l_old_ship_set_id is null
2891 and l_old_top_model_line_id is null )
2892 then
2893 exit;
2894 end if;
2895
2896 if l_header_id <> l_old_header_id or
2897 nvl(l_arrival_set_id, 0) <> nvl(l_old_arrival_set_id, 0) or
2898 nvl(l_ship_set_id, 0) <> nvl(l_old_ship_set_id, 0) or
2899 nvl(l_top_model_line_id, 0) <> nvl(l_old_top_model_line_id, 0)
2900 then
2901 exit;
2902 end if;
2903
2904 END LOOP;
2905
2906 l_control_rec.controlled_operation := TRUE;
2907 l_control_rec.process := FALSE;
2908 l_control_rec.process_entity := OE_GLOBALS.G_ENTITY_ALL;
2909 l_control_rec.Process_Partial := FALSE;
2910 l_control_rec.check_security := TRUE;
2911 l_control_rec.clear_dependents := TRUE;
2912 l_control_rec.default_attributes := TRUE;
2913 l_control_rec.change_attributes := TRUE;
2914 l_control_rec.validate_entity := TRUE;
2915 l_control_rec.write_to_DB := TRUE;
2916
2917 --bug4529937 start --bug 6850537,7210480 added p_block_name='LINES_SUMMARY'
2918 IF p_block_name = 'LINE' or p_block_name='LINES_SUMMARY' THEN
2919 G_NUM_OF_LINES := G_NUM_OF_LINES - l_line_tbl.count;
2920 END IF;
2921
2922 IF l_debug_level > 0 THEN
2923 oe_debug_pub.add('Lines Remaining: ' || G_NUM_OF_LINES);
2924 OE_DEBUG_PUB.Add('Before Call to Process Order From MC');
2925 END IF;
2926 --bug4529937 end
2927
2928 -- bug 4339639
2929 OE_Versioning_Util.G_UI_CALLED := TRUE;
2930
2931 Oe_Order_Pvt.Lines
2932 ( p_validation_level => FND_API.G_VALID_LEVEL_FULL,
2933 p_init_msg_list => l_init_msg_list,
2934 p_control_rec => l_control_rec,
2935 p_x_line_tbl => l_line_tbl,
2936 p_x_old_line_tbl => l_old_line_tbl,
2937 x_return_status => l_return_status);
2938
2939 IF l_debug_level > 0 THEN
2940 OE_DEBUG_PUB.Add('After Call to Process Order From MC - ' || l_return_status);
2941 END IF;
2942
2943 IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2944 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2945 ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
2946 RAISE FND_API.G_EXC_ERROR;
2947 END IF;
2948
2949 l_control_rec.controlled_operation := TRUE;
2950 l_control_rec.process := TRUE;
2951 l_control_rec.process_entity := OE_GLOBALS.G_ENTITY_ALL;
2952
2953 l_control_rec.check_security := FALSE;
2954 l_control_rec.clear_dependents := FALSE;
2955 l_control_rec.default_attributes := FALSE;
2956 l_control_rec.change_attributes := FALSE;
2957 l_control_rec.validate_entity := FALSE;
2958 l_control_rec.write_to_DB := FALSE;
2959
2960 -- Instruct API to clear its request table
2961
2962 l_control_rec.clear_api_cache := FALSE;
2963 l_control_rec.clear_api_requests := TRUE;
2964
2965 oe_line_util.Post_Line_Process
2966 ( p_control_rec => l_control_rec,
2967 p_x_line_tbl => l_line_tbl );
2968
2969 -- added a call to PRN for bug 4882981
2970 OE_Order_PVT.Process_Requests_And_Notify
2971 ( p_process_requests => TRUE,
2972 p_notify => TRUE,
2973 x_return_status => l_return_status,
2974 p_old_line_tbl => l_old_line_tbl,
2975 p_line_tbl => l_line_tbl) ;
2976
2977 IF l_debug_level > 0 THEN
2978 oe_debug_pub.ADD('OEXVMSCB: Completed Process_Delayed_Requests '
2979 || ' with return status' || l_return_status, 2);
2980 END IF;
2981 G_HEADER_CHANGED :=NULL ; -- - bug 6850537,7210480
2982 -- Bug 1809955
2983 -- Display any errors/messages that were caused
2984 -- as a result of the delayed request execution
2985 OE_MSG_PUB.Count_and_Get(p_count => p_msg_count,
2986 p_data => p_msg_data);
2987
2988 IF l_return_status = FND_API.G_RET_STS_UNEXP_ERROR THEN
2989 RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2990 ELSIF l_return_status = FND_API.G_RET_STS_ERROR THEN
2991 RAISE FND_API.G_EXC_ERROR;
2992 END IF;
2993 EXCEPTION
2994
2995 WHEN FND_API.G_EXC_ERROR THEN
2996 IF l_debug_level > 0 THEN
2997 oe_debug_pub.ADD('Exception - FND_API.G_EXC_ERROR');
2998 END IF;
2999
3000 p_return_status := FND_API.G_RET_STS_ERROR ;
3001 OE_SET_UTIL.G_SET_TBL.delete; --bug#2428456
3002 OE_SET_UTIL.G_SET_OPT_TBL.delete; -- bug#2428456
3003
3004 oe_delayed_requests_pvt.Clear_Request(x_return_status=> l_return_status);
3005
3006 OE_ORDER_UTIL.Clear_Global_Picture(l_return_status);
3007
3008 IF l_debug_level > 0 THEN
3009 oe_debug_pub.ADD ('OE_Config_Pvt.OE_MODIFY_INC_ITEMS_TBL.COUNT - '
3010 || OE_Config_Pvt.OE_MODIFY_INC_ITEMS_TBL.COUNT);
3011 END IF;
3012
3013 IF OE_Config_Pvt.OE_MODIFY_INC_ITEMS_TBL.COUNT > 0 THEN -- moved for the bug 3726337
3014 OE_Config_Pvt.OE_MODIFY_INC_ITEMS_TBL.DELETE;
3015 END IF;
3016
3017 OE_MSG_PUB.Count_And_Get ( p_count => p_msg_count,
3018 p_data => p_msg_data);
3019
3020 l_error_count := l_error_count + 1;
3021 p_error_count := l_error_count;
3022
3023 IF l_debug_level > 0 THEN
3024 oe_debug_pub.ADD ('l_line_tbl.count - ' || l_line_tbl.count);
3025 END IF;
3026
3027 IF (l_line_tbl.count >0 ) then
3028 G_ERROR_COUNT := G_ERROR_COUNT + l_line_tbl.COUNT;
3029 END IF;
3030
3031 ROLLBACK TO SAVEPOINT Process_Line_Scalar;
3032
3033 --Bug 7566697
3034 OE_Globals.G_PRICING_RECURSION := 'N';
3035 IF OE_MASS_CHANGE_PVT.G_PRICING_ERROR = 'Y'
3036 THEN
3037 oe_debug_pub.add('Pricing error has occured. Rolling back changes done to all lines');
3038 ROLLBACK TO SAVEPOINT Pricing_Header_Savepoint;
3039 END IF;
3040
3041 IF l_debug_level > 0 THEN
3042 oe_debug_pub.ADD ('l_mc_err_handling_flag - ' || l_mc_err_handling_flag);
3043 END IF;
3044
3045 if l_mc_err_handling_flag in (EXIT_FIRST_ERROR,SKIP_CONTINUE) then
3046 OE_DEBUG_PUB.Add('EXIT_FIRST_ERROR SKIP_CONTINUE');
3047 exit;
3048 else
3049 OE_DEBUG_PUB.Add('SKIP_ALL');
3050 end if;
3051
3052 WHEN FND_API.G_EXC_UNEXPECTED_ERROR THEN
3053 IF l_debug_level > 0 THEN
3054 oe_debug_pub.ADD('Exception - FND_API.G_EXC_UNEXPECTED_ERROR');
3055 END IF;
3056
3057 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
3058 OE_SET_UTIL.G_SET_TBL.delete; --bug#2428456
3059 OE_SET_UTIL.G_SET_OPT_TBL.delete; -- bug#2428456
3060
3061 oe_delayed_requests_pvt.Clear_Request(x_return_status=> l_return_status);
3062
3063 OE_ORDER_UTIL.Clear_Global_Picture(l_return_status);
3064
3065 IF l_debug_level > 0 THEN
3066 oe_debug_pub.ADD ('OE_Config_Pvt.OE_MODIFY_INC_ITEMS_TBL.COUNT - '
3067 || OE_Config_Pvt.OE_MODIFY_INC_ITEMS_TBL.COUNT);
3068 END IF;
3069
3070 IF OE_Config_Pvt.OE_MODIFY_INC_ITEMS_TBL.COUNT > 0 THEN -- moved for the bug 3726337
3071 OE_Config_Pvt.OE_MODIFY_INC_ITEMS_TBL.DELETE;
3072 END IF;
3073
3074 OE_MSG_PUB.Count_And_Get( p_count => p_msg_count,
3075 p_data => p_msg_data);
3076
3077 l_error_count := l_error_count + 1;
3078 p_error_count := l_error_count;
3079
3080 IF l_debug_level > 0 THEN
3081 oe_debug_pub.ADD ('l_line_tbl.count - ' || l_line_tbl.count);
3082 END IF;
3083
3084 IF (l_line_tbl.count >0 ) then
3085 G_ERROR_COUNT := G_ERROR_COUNT + l_line_tbl.COUNT;
3086 END IF;
3087
3088 ROLLBACK TO SAVEPOINT Process_Line_Scalar;
3089
3090 --Bug 7566697
3091 OE_Globals.G_PRICING_RECURSION := 'N';
3092 IF OE_MASS_CHANGE_PVT.G_PRICING_ERROR = 'Y'
3093 THEN
3094 oe_debug_pub.add('Pricing error has occured. Rolling back changes done to all lines');
3095 ROLLBACK TO SAVEPOINT Pricing_Header_Savepoint;
3096 END IF;
3097
3098 IF l_debug_level > 0 THEN
3099 oe_debug_pub.ADD ('l_mc_err_handling_flag - ' || l_mc_err_handling_flag);
3100 END IF;
3101
3102 if l_mc_err_handling_flag in (EXIT_FIRST_ERROR,SKIP_CONTINUE) then
3103 OE_DEBUG_PUB.Add('EXIT_FIRST_ERROR SKIP_CONTINUE');
3104 exit;
3105 else
3106 OE_DEBUG_PUB.Add('SKIP_ALL');
3107 end if;
3108
3109 WHEN OTHERS THEN
3110 IF l_debug_level > 0 THEN
3111 oe_debug_pub.ADD('Exception - FND_API.G_EXC_ERROR');
3112 END IF;
3113
3114 p_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
3115 OE_SET_UTIL.G_SET_TBL.delete; --bug#2428456
3116 OE_SET_UTIL.G_SET_OPT_TBL.delete; -- bug#2428456
3117
3118 oe_delayed_requests_pvt.Clear_Request(x_return_status=> l_return_status);
3119
3120 OE_ORDER_UTIL.Clear_Global_Picture(l_return_status);
3121
3122 IF l_debug_level > 0 THEN
3123 oe_debug_pub.ADD ('OE_Config_Pvt.OE_MODIFY_INC_ITEMS_TBL.COUNT - '
3124 || OE_Config_Pvt.OE_MODIFY_INC_ITEMS_TBL.COUNT);
3125 END IF;
3126
3127 IF OE_Config_Pvt.OE_MODIFY_INC_ITEMS_TBL.COUNT > 0 THEN -- moved for the bug 3726337
3128 OE_Config_Pvt.OE_MODIFY_INC_ITEMS_TBL.DELETE;
3129 END IF;
3130
3131 IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) THEN
3132 OE_MSG_PUB.Add_Exc_Msg (G_PKG_NAME,
3133 l_api_name);
3134 END IF;
3135
3136 OE_MSG_PUB.Count_And_Get ( p_count => p_msg_count,
3137 p_data => p_msg_data);
3138
3139 l_error_count := l_error_count + 1;
3140 p_error_count := l_error_count;
3141
3142 IF l_debug_level > 0 THEN
3143 oe_debug_pub.ADD ('l_line_tbl.count - ' || l_line_tbl.count);
3144 END IF;
3145
3146 IF (l_line_tbl.count >0 ) then
3147 G_ERROR_COUNT := G_ERROR_COUNT + l_line_tbl.COUNT;
3148 END IF;
3149
3150 ROLLBACK TO SAVEPOINT Process_Line_Scalar;
3151
3152 --Bug 7566697
3153 OE_Globals.G_PRICING_RECURSION := 'N';
3154 IF OE_MASS_CHANGE_PVT.G_PRICING_ERROR = 'Y'
3155 THEN
3156 oe_debug_pub.add('Pricing error has occured. Rolling back changes done to all lines');
3157 ROLLBACK TO SAVEPOINT Pricing_Header_Savepoint;
3158 END IF;
3159
3160
3161 IF l_debug_level > 0 THEN
3162 oe_debug_pub.ADD ('l_mc_err_handling_flag - ' || l_mc_err_handling_flag);
3163 END IF;
3164
3165 if l_mc_err_handling_flag in (EXIT_FIRST_ERROR,SKIP_CONTINUE) then
3166 OE_DEBUG_PUB.Add('EXIT_FIRST_ERROR SKIP_CONTINUE');
3167 exit;
3168 else
3169 OE_DEBUG_PUB.Add('SKIP_ALL');
3170 end if;
3171 END;
3172
3173 exit when c1%notfound;
3174 END LOOP;
3175
3176 G_BLK_NAME := NULL;
3177 G_NUM_OF_LINES := NULL;
3178 G_HEADER_CHANGED :=NULL ; -- - bug 6850537,7210480
3179 IS_MASS_CHANGE := 'F'; --Added for bug 4911340
3180
3181 IF l_debug_level > 0 THEN
3182 oe_debug_pub.add('Exiting OE_MASS_CHANGE_PVT.Process_Line_Scalar');
3183 END IF;
3184 end Process_Line_Scalar;
3185
3186 Procedure MC_Rollback
3187 IS
3188 begin
3189 rollback;
3190 end;
3191
3192 Procedure Set_Counter
3193 IS
3194 begin
3195 G_COUNTER := 0;
3196 end;
3197
3198 Function Get_Counter return NUMBER
3199 IS
3200 begin
3201 return G_COUNTER;
3202 end;
3203
3204 Procedure Set_Error_Count
3205 IS
3206 begin
3207 G_ERROR_COUNT := 0;
3208 end;
3209
3210 Function Get_Error_Count return NUMBER
3211 IS
3212 begin
3213 return G_ERROR_COUNT;
3214 end;
3215
3216 Procedure save_messages
3217 IS
3218 l_count_msg NUMBER := OE_MSG_PUB.Count_Msg;
3219 begin
3220 OE_DEBUG_PUB.ADD('Inside save_messages',1);
3221 FOR I IN 1..l_count_msg LOOP
3222 OE_DEBUG_PUB.ADD('calling insert_message',1);
3223 insert_message(I);
3224 End Loop;
3225 OE_DEBUG_PUB.ADD('exiting save_messages',1);
3226 commit;
3227 end;
3228
3229 procedure insert_message (
3230 p_msg_index IN NUMBER )
3231 IS
3232 l_msg_data VARCHAR2(2000);
3233 l_entity_code VARCHAR2(30);
3234 l_entity_id NUMBER;
3235 l_header_id NUMBER;
3236 l_line_id NUMBER;
3237 l_orig_sys_document_ref VARCHAR2(50);
3238 l_orig_sys_document_line_ref VARCHAR2(50);
3239 l_source_document_id NUMBER;
3240 l_source_document_line_id NUMBER;
3241 l_attribute_code VARCHAR2(30);
3242
3243 BEGIN
3244 l_msg_data := OE_MSG_PUB.get(p_msg_index, 'F');
3245
3246 /*OE_MSG_PUB.get_msg_context(
3247 p_msg_index
3248 ,l_entity_code
3249 ,l_entity_id
3250 ,l_header_id
3251 ,l_line_id
3252 ,l_orig_sys_document_ref
3253 ,l_orig_sys_document_line_ref
3254 ,l_source_document_id
3255 ,l_source_document_line_id
3256 ,l_attribute_code);*/
3257
3258 OE_DEBUG_PUB.ADd('l_msg_data='||l_msg_data);
3259
3260 /*
3261 if p_msg_index IS NOT NULL then
3262 insert into OE_ERROR_MESSAGES
3263 ( Transaction_id
3264 ,batch_request_Id
3265 ,message_text
3266 ,entity_code
3267 ,entity_id
3268 ,header_id
3269 ,line_id
3270 ,original_sys_document_ref
3271 ,original_sys_document_line_ref
3272 ,source_document_id
3273 ,source_document_line_id
3274 ,attribute_code
3275 ,CREATION_DATE
3276 ,CREATED_BY
3277 ,LAST_UPDATE_DATE
3278 ,LAST_UPDATED_BY
3279 ,LAST_UPDATE_LOGIN
3280 ,PROGRAM_APPLICATION_ID
3281 ,PROGRAM_ID
3282 ,PROGRAM_UPDATE_DATE
3283 ) VALUES
3284 ( oe_msg_id_S.NEXTVAL
3285 ,NULL
3286 ,l_msg_data
3287 ,l_entity_code
3288 ,l_entity_id
3289 ,l_header_id
3290 ,l_line_id
3291 ,l_orig_sys_document_ref
3292 ,l_orig_sys_document_line_ref
3293 ,l_source_document_id
3294 ,l_source_document_line_id
3295 ,l_attribute_code
3296 ,sysdate
3297 ,-1
3298 ,sysdate
3299 ,-1
3300 ,-1
3301 ,NULL
3302 ,NULL
3303 ,NULL
3304 );
3305 end if;
3306 */
3307 End insert_message;
3308
3309 -- 4020312
3310 -- Function to pipeline the table of selected lines for mass change.
3311 FUNCTION get_sel_rec_tbl RETURN Sel_Rec_Tbl
3312 PIPELINED IS
3313 l_row OE_GLOBALS.Selected_Record_Type;
3314 BEGIN
3315 FOR i IN g_sel_rec_tbl.first..g_sel_rec_tbl.last LOOP
3316 l_row.id1 := g_sel_rec_tbl(i).id1;
3317 l_row.id2 := g_sel_rec_tbl(i).id2;
3318 l_row.id3 := g_sel_rec_tbl(i).id3;
3319 l_row.id4 := g_sel_rec_tbl(i).id4;
3320 l_row.id5 := g_sel_rec_tbl(i).id5;
3321 l_row.org_id := g_sel_rec_tbl(i).org_id;
3322 PIPE ROW (l_row);
3323 END LOOP;
3324 RETURN;
3325 END get_sel_rec_tbl;
3326
3327 end OE_MASS_CHANGE_PVT;