DBA Data[Home] [Help]

PACKAGE BODY: APPS.OE_LINE_ACK_UTIL

Source


1 PACKAGE BODY OE_Line_Ack_Util AS
2 /* $Header: OEXULAKB.pls 120.12.12020000.2 2013/01/21 05:26:31 kadiraju ship $ */
3 
4 
5 --  Global constant holding the package name
6 
7 G_PKG_NAME                    CONSTANT VARCHAR2(30) := 'OE_LINE_ACK_UTIL';
8 
9 -- {aksingh 3a4 Start
10 -- { Start GET_ACK_CODE
11 FUNCTION GET_ACK_CODE (p_order_source_id   NUMBER   := 6,
12                        p_reject_order      VARCHAR2 := 'N',
13                        p_transaction_type  VARCHAR2 := NULL,
14                        p_booked_flag       VARCHAR2 := NULL)
15 RETURN VARCHAR
16 IS
17   l_ack_code  Varchar2(30);
18 BEGIN
19 
20   If p_reject_order    = 'N' Then
21      If p_order_source_id = 20 Then
22         If OE_CODE_CONTROL.GET_CODE_RELEASE_LEVEL >= '110510' THEN
23            If nvl(FND_PROFILE.VALUE('ONT_XML_ACCEPT_STATE'), 'ENTERED') = 'ENTERED' Then
24               Return '0';
25            Elsif nvl(p_booked_flag, 'N') = 'N' AND p_transaction_type = OE_Acknowledgment_Pub.G_TRANSACTION_POI Then
26               oe_debug_pub.add('return Pending');
27               Return '3'; -- pending
28            Else
29               oe_debug_pub.add('return Accepted - code is 0, post-110510');
30               Return '0';
31            End If;
32         Else
33            oe_debug_pub.add('return Accepted - code is 0, pre-110510');
34            Return '0';
35         End If;
36      Else
37         Return 'IA'; --Changed AT to IA for bug 4137350
38      End If;
39   Elsif p_reject_order = 'Y' Then
40      If p_order_source_id = 20 Then
41         oe_debug_pub.add('return Rejected - code is 2');
42         Return '2';
43      Else
44         Return 'RJ';
45      End If;
46   Else
47     Return Null;
48   End If;
49 END GET_ACK_CODE;
50 -- End GET_ACK_CODE }
51 -- End aksingh 3a4 }
52 
53 PROCEDURE Update_Header_Ack_Code
54 (   p_header_id         IN  NUMBER,
55     p_first_ack_code    IN  VARCHAR2,
56     p_last_ack_code     IN  VARCHAR2
57 )
58 IS
59 BEGIN
60     oe_debug_pub.add ('Entering Update_Header_Ack_Code with params: header id ' ||
61 			p_header_id || ', first_ack_code ' || p_first_ack_code
62 			|| ', last_ack_code ' || p_last_ack_code || '.');
63     IF p_first_ack_code IS NOT NULL THEN
64        UPDATE oe_header_acks
65 	SET first_ack_code = p_first_ack_code
66 	WHERE header_id = p_header_id;
67        oe_debug_pub.add ('rows updated: ' || SQL%ROWCOUNT);
68     ELSIF p_last_ack_code IS NOT NULL THEN
69 	UPDATE oe_header_acks
70 	 SET last_ack_code = p_last_ack_code
71 	 WHERE header_id = p_header_id;
72        oe_debug_pub.add ('rows updated: ' || SQL%ROWCOUNT);
73     ELSE
74 	oe_debug_pub.add ('Bad args passed to update_header_ack_code, no header records updated');
75     END IF;
76 EXCEPTION
77     WHEN OTHERS THEN
78 	oe_debug_pub.add ('When Others in Update_Header_Ack_Code');
79 END Update_Header_Ack_Code;
80 
81 
82 PROCEDURE Insert_Row
83 (   p_line_tbl            IN  OE_Order_Pub.Line_Tbl_Type
84 ,   p_line_val_tbl        IN  OE_Order_Pub.Line_Val_Tbl_Type
85 ,   p_old_line_tbl        IN  OE_Order_Pub.Line_Tbl_Type
86 ,   p_old_line_val_tbl    IN  OE_Order_Pub.Line_Val_Tbl_Type
87 ,   p_buyer_seller_flag   IN  VARCHAR2
88 ,   p_reject_order        IN  VARCHAR2
89 ,   p_ack_type            IN  VARCHAR2 := NULL
90 ,   x_return_status	  OUT NOCOPY VARCHAR2
91 )
92 IS
93 l_line_rec                OE_Order_Pub.Line_Rec_Type;
94 l_line_val_rec            OE_Order_Pub.Line_Val_Rec_Type;
95 l_order_source_id 	  NUMBER;
96 l_count			  NUMBER;
97 I   BINARY_INTEGER;
98 l_error_flag              Varchar2(1);
99 BEGIN
100 
101     l_count := p_line_tbl.COUNT;
102     l_count := p_line_val_tbl.COUNT;
103      I := p_line_tbl.FIRST;
104      WHILE I IS NOT NULL LOOP
105      --FOR I IN 1..p_line_tbl.COUNT LOOP
106 
107       IF p_reject_order = 'N' THEN
108          l_line_rec      :=  p_line_tbl(I);
109          OE_Line_Util.Convert_Miss_To_Null (l_line_rec);
110 
111 -- Bug 9685021 Start
112 	BEGIN
113 		SELECT order_source_id
114 		INTO l_order_source_id
115 		FROM oe_order_headers_all
116 		WHERE header_id = l_line_rec.header_id;
117         EXCEPTION
118 		WHEN OTHERS THEN
119 		l_order_source_id := 0;
120         END;
121 
122 -- Bug 9685021 End
123 
124        -- {Start of 3A4 change for the reject = 'N'
125       -- If l_line_rec.order_source_id = 20 Then      Bug 9685021
126        If l_order_source_id = 20 Then
127         If l_line_rec.First_Ack_Code IS NULL Then
128           If p_ack_type = oe_acknowledgment_pub.G_TRANSACTION_POA then
129             l_line_rec.FIRST_ACK_CODE :=
130             Get_Ack_Code(p_order_source_id => l_line_rec.order_source_id,
131                          p_reject_order    => p_reject_order);
132           Elsif p_ack_type = oe_acknowledgment_pub.G_TRANSACTION_CPO then
133             l_line_rec.FIRST_ACK_CODE :=
134             Get_Ack_Code(p_order_source_id => l_line_rec.order_source_id,
135                          p_reject_order    => p_reject_order);
136           -- 3A6 related
137           Elsif p_ack_type = oe_acknowledgment_pub.G_TRANSACTION_SSO then
138             If l_line_rec.last_ack_code IS NULL Then
139                l_line_rec.FIRST_ACK_CODE := 'OPEN';
140             Else
141                l_line_rec.FIRST_ACK_CODE := l_line_rec.last_ack_code;
142             End if;
143           Elsif p_ack_type = oe_acknowledgment_pub.G_TRANSACTION_CSO then
144             If l_line_rec.last_ack_code IS NULL Then
145                l_line_rec.FIRST_ACK_CODE := 'OPEN';
146             Else
147                l_line_rec.FIRST_ACK_CODE := l_line_rec.last_ack_code;
148             End if;
149 	  -- 3A4 related
150 	  Elsif  p_ack_type = oe_acknowledgment_pub.G_TRANSACTION_POI then
151             l_line_rec.FIRST_ACK_CODE :=
152              Get_Ack_Code(p_order_source_id => l_line_rec.order_source_id,
153                          p_reject_order    => p_reject_order,
154                          p_booked_flag     => l_line_rec.booked_flag,
155                          p_transaction_type => oe_acknowledgment_pub.G_TRANSACTION_POI);
156           Elsif  p_ack_type = oe_acknowledgment_pub.G_TRANSACTION_CHO then
157               l_line_rec.FIRST_ACK_CODE :=
158               Get_Ack_Code(p_order_source_id => l_line_rec.order_source_id,
159                            p_reject_order    => p_reject_order);
160 
161           End if;
162 	  l_line_rec.FIRST_ACK_DATE := '';
163 	  l_line_rec.LAST_ACK_CODE  := '';
164 	  l_line_rec.LAST_ACK_DATE  := '';
165         Else
166           l_line_rec.LAST_ACK_CODE :=
167             Get_Ack_Code(p_order_source_id => l_line_rec.order_source_id,
168                          p_reject_order    => p_reject_order);
169 	  l_line_rec.LAST_ACK_DATE  := '';
170         End If;
171        Else
172          l_line_val_rec  :=  p_line_val_tbl(I);
173 
174 	  -- Following Check will determine if this is a 855 or 865
175 	  oe_debug_pub.add('l_line_rec.SCHEDULE_SHIP_DATE :' || l_line_rec.SCHEDULE_SHIP_DATE,1);
176           oe_debug_pub.add('l_line_rec.REQUEST_DATE       :' || l_line_rec.REQUEST_DATE, 1);
177 
178 	 IF (nvl(l_line_rec.FIRST_ACK_CODE, ' ')= ' ' OR
179              l_line_rec.FIRST_ACK_CODE = FND_API.G_MISS_CHAR) THEN -- It is 855
180 	    oe_debug_pub.add('trans is 855 with first_ack_code ' ||nvl(l_line_rec.FIRST_ACK_CODE, 'NULL' ));
181 	    IF l_line_rec.SCHEDULE_SHIP_DATE is NULL THEN
182 		oe_debug_pub.add('ack code: schedule ship date is null');
183 	       l_line_rec.FIRST_ACK_CODE := 'SP';
184             END IF;
185 	    IF l_line_rec.SCHEDULE_SHIP_DATE is NOT NULL
186 	       AND trunc(l_line_rec.SCHEDULE_SHIP_DATE) <> nvl(trunc(l_line_rec.REQUEST_DATE), FND_API.G_MISS_DATE)
187 	    THEN
188 	       oe_debug_pub.add('ack code: date rescheduled');
189 	       l_line_rec.FIRST_ACK_CODE := 'DR';
190             END IF;
191 
192            --Added for bug 4771523+bug 4454400 start
193             If nvl(l_line_rec.unit_selling_price, FND_API.G_MISS_NUM) <> nvl(p_old_line_tbl(I).unit_selling_price, FND_API.G_MISS_NUM)
194             THEN
195                l_line_rec.FIRST_ACK_CODE := 'IP';
196                oe_debug_pub.add('new unit selling price: ' || l_line_rec.unit_selling_price);
197                oe_debug_pub.add('old unit selling price: ' || p_old_line_tbl(I).unit_selling_price);
198 	       oe_debug_pub.add('ack code: price changed');
199             END IF;
200             IF OE_ORDER_UTIL.g_line_tbl(I).customer_item_net_price IS NOT NULL
201              AND OE_ORDER_UTIL.g_line_tbl(I).customer_item_net_price <> FND_API.G_MISS_NUM THEN
202 
203                oe_debug_pub.add(' unit_selling_price in global : '||OE_ORDER_UTIL.g_line_tbl(I).unit_selling_price,5);
204                oe_debug_pub.add(' CUSTOMER_ITEM_NET_PRICE in global : '||OE_ORDER_UTIL.g_line_tbl(I).CUSTOMER_ITEM_NET_PRICE,5);
205 
206               IF OE_ORDER_UTIL.g_line_tbl(I).customer_item_net_price <> OE_ORDER_UTIL.g_line_tbl(I).unit_selling_price THEN
207                 l_line_rec.FIRST_ACK_CODE := 'IP';
208                 oe_debug_pub.add(' ack code: price changed : '||l_line_rec.FIRST_ACK_CODE,5);
209               END IF;
210                oe_debug_pub.add(' new unit selling price: ' || l_line_rec.unit_selling_price,5);
211                oe_debug_pub.add(' old unit selling price: ' || p_old_line_tbl(I).unit_selling_price,5);
212             END IF;
213             --Added for bug 4771523+bug 4454400 end
214 
215 
216 	    IF l_line_rec.ORDERED_QUANTITY <> p_old_line_tbl(I).ORDERED_QUANTITY
217 	    THEN
218 	       IF l_line_rec.FIRST_ACK_CODE IS NULL or l_line_rec.FIRST_ACK_CODE = FND_API.G_MISS_CHAR Then
219 	          l_line_rec.FIRST_ACK_CODE := 'IQ';
220 	       ELSE
221 		  l_line_rec.FIRST_ACK_CODE := 'IC'; -- item accepted, (multiple) changes made , refer to HLD
222 	       END IF;
223             END IF;
224 	    -- Add Below Code for Price Change - IP - once New fields are added
225 
226 	    -- ack code changes introduced to support item relationships
227             -- we change the ack code for automatic/manual substitution
228 	    -- as well as upsell or superseded items or promotional upgrades
229 	    -- For the remaining relationships, only the header ack code
230 	    -- is changed since the IS (meaning substitution) ack code is not appropriate
231 	    -- as new lines were added rather than substituting item on the orig line
232 
233             IF l_line_rec.ORIGINAL_INVENTORY_ITEM_ID is NOT NULL THEN
234 	       IF (l_line_rec.ITEM_RELATIONSHIP_TYPE is NULL
235 		   OR l_line_rec.ITEM_RELATIONSHIP_TYPE = 2
236 		   OR l_line_rec.ITEM_RELATIONSHIP_TYPE = 4
237 		   OR l_line_rec.ITEM_RELATIONSHIP_TYPE = 8
238 		   OR l_line_rec.ITEM_RELATIONSHIP_TYPE = 14) THEN
239 		   IF l_line_rec.FIRST_ACK_CODE IS NULL OR l_line_rec.FIRST_ACK_CODE = FND_API.G_MISS_CHAR Then
240 		      l_line_rec.FIRST_ACK_CODE := 'IS';
241 		   ELSE l_line_rec.FIRST_ACK_CODE := 'IC'; -- item accepted, (multiple) changes made , refer to HLD
242 		   END IF;
243 	       ELSE
244 		   IF l_line_rec.FIRST_ACK_CODE IS NULL OR l_line_rec.FIRST_ACK_CODE = FND_API.G_MISS_CHAR Then
245 		      l_line_rec.FIRST_ACK_CODE := 'IA';
246 		   END IF;
247                END IF;
248 	   END IF;
249 
250            IF l_line_rec.SPLIT_FROM_LINE_ID is not NULL  AND
251               l_line_rec.split_by = 'SYSTEM' THEN
252               l_line_rec.FIRST_ACK_CODE := 'IB';
253            END IF;
254 
255            /* added the following if condition to fix the bug 2878987 */
256             IF l_line_rec.OPEN_FLAG = 'N'  THEN
257                l_line_rec.FIRST_ACK_CODE := 'ID';
258             END IF;
259 
260 
261 	    -- If Everything Accepted as it is
262             IF l_line_rec.FIRST_ACK_CODE is NULL or l_line_rec.FIRST_ACK_CODE = FND_API.G_MISS_CHAR THEN
263 	       l_line_rec.FIRST_ACK_CODE := 'IA';
264 	    ELSIF l_line_rec.FIRST_ACK_CODE is NOT NULL THEN
265 	       -- the ack code was modified, we should update the header ack code
266                Update_Header_Ack_Code (l_line_rec.header_id, 'AC', NULL);
267 
268 	    END IF;
269 
270 	    l_line_rec.FIRST_ACK_DATE := '';
271 	    l_line_rec.LAST_ACK_CODE  := '';
272 	    l_line_rec.LAST_ACK_DATE  := '';
273 
274           ELSE -- it is 865
275 
276             IF l_line_rec.changed_lines_pocao = 'N' THEN
277                GOTO nextline;
278             END IF;
279 
280             l_line_rec.FIRST_ACK_DATE := p_old_line_tbl(I).FIRST_ACK_DATE;
281 
282 	    IF l_line_rec.SCHEDULE_SHIP_DATE is NULL THEN
283 	       l_line_rec.LAST_ACK_CODE := 'SP';
284             END IF;
285 	    IF l_line_rec.SCHEDULE_SHIP_DATE is NOT NULL
286 	       AND l_line_rec.SCHEDULE_SHIP_DATE <> nvl(p_old_line_tbl(I).SCHEDULE_SHIP_DATE, FND_API.G_MISS_DATE)
287 	       AND l_line_rec.SCHEDULE_SHIP_DATE <> nvl(l_line_rec.REQUEST_DATE, FND_API.G_MISS_DATE)
288             THEN
289 	       l_line_rec.LAST_ACK_CODE := 'DR';
290             END IF;
291            -- Added for bug 4771523 + bug 4454400 start
292            If nvl(l_line_rec.unit_selling_price, FND_API.G_MISS_NUM) <> nvl(p_old_line_tbl(I).unit_selling_price, FND_API.G_MISS_NUM)
293             THEN
294                l_line_rec.LAST_ACK_CODE := 'IP';
295                oe_debug_pub.add('new unit selling price: ' || l_line_rec.unit_selling_price);
296                oe_debug_pub.add('old unit selling price: ' || p_old_line_tbl(I).unit_selling_price);
297 	       oe_debug_pub.add('ack code: price changed');
298             END IF;
299 
300             IF OE_ORDER_UTIL.g_line_tbl(I).customer_item_net_price IS NOT NULL
301              AND OE_ORDER_UTIL.g_line_tbl(I).customer_item_net_price <> FND_API.G_MISS_NUM THEN
302 
303               oe_debug_pub.add(' unit_selling_price in global : '||OE_ORDER_UTIL.g_line_tbl(I).unit_selling_price,5);
304               oe_debug_pub.add(' CUSTOMER_ITEM_NET_PRICE in global : '||OE_ORDER_UTIL.g_line_tbl(I).CUSTOMER_ITEM_NET_PRICE,5);
305 
306               IF OE_ORDER_UTIL.g_line_tbl(I).customer_item_net_price <> OE_ORDER_UTIL.g_line_tbl(I).unit_selling_price THEN
307                 l_line_rec.LAST_ACK_CODE := 'IP';
308                 oe_debug_pub.add(' ack code: price changed : '||l_line_rec.FIRST_ACK_CODE,5);
309               END IF;
310                oe_debug_pub.add(' new unit selling price: ' || l_line_rec.unit_selling_price,5);
311                oe_debug_pub.add(' old unit selling price: ' || p_old_line_tbl(I).unit_selling_price,5);
312             END IF;
313 	   -- Added for bug 4771523 + bug 4454400 end
314 
315 	    IF l_line_rec.ORDERED_QUANTITY <> p_old_line_tbl(I).ORDERED_QUANTITY
316 	    THEN
317 	       IF l_line_rec.LAST_ACK_CODE IS NULL or l_line_rec.LAST_ACK_CODE = FND_API.G_MISS_CHAR Then
318 		  l_line_rec.LAST_ACK_CODE := 'IQ';
319 	       ELSE
320                   l_line_rec.LAST_ACK_CODE := 'IC'; -- item accepted, (multiple) changes made , refer to HLD
321 	       END IF;
322             END IF;
323 	    -- Add Below Code for Price Change - IP - once New fields are added
324 
325 
326            IF l_line_rec.SPLIT_FROM_LINE_ID is not NULL AND
327               l_line_rec.split_by = 'SYSTEM' THEN
328               l_line_rec.LAST_ACK_CODE := 'IB';
329            END IF;
330 
331             /* added the following if condition to fix the bug 2878987 */
332             IF l_line_rec.OPEN_FLAG = 'N'  THEN
333                l_line_rec.LAST_ACK_CODE := 'ID';
334             END IF;
335 
336 	    -- If Everything Accepted as it is
337             IF l_line_rec.LAST_ACK_CODE is NULL OR l_line_rec.LAST_ACK_CODE = FND_API.G_MISS_CHAR THEN
338 	       l_line_rec.LAST_ACK_CODE := 'IA';
339 	    END IF;
340 	    -- in the case of 865, the header last ack code defaults to AC, so we don't need to change it here
341             -- (unlike 855)
342 
343 	    l_line_rec.LAST_ACK_DATE := '';
344 
345           END IF;
346         END IF;
347         -- End of 3A4 for reject = 'N' }
348       ELSE -- p_reject_order = 'Y'
349 
350          l_line_rec      :=  p_old_line_tbl(I);
351          l_error_flag := 'Y';
352          OE_Line_Util.Convert_Miss_To_Null (l_line_rec);
353          -- {Start of 3A4 change for the reject = 'Y'
354          If l_line_rec.order_source_id = 20 Then
355             If l_line_rec.First_Ack_Code IS NULL Then
356                l_line_rec.FIRST_ACK_CODE :=
357                  Get_Ack_Code(p_order_source_id => l_line_rec.order_source_id,
358                               p_reject_order    => p_reject_order);
359                l_line_rec.FIRST_ACK_DATE := '';
360                l_line_rec.LAST_ACK_CODE  := '';
361                l_line_rec.LAST_ACK_DATE  := '';
362             Else
363               l_line_rec.LAST_ACK_CODE :=
364                 Get_Ack_Code(p_order_source_id => l_line_rec.order_source_id,
365                              p_reject_order    => p_reject_order);
366               l_line_rec.LAST_ACK_DATE  := '';
367             End If;
368 
369          Else
370 	 IF nvl(l_line_rec.FIRST_ACK_CODE,' ')=' ' THEN -- It is 855
371 	    l_line_rec.FIRST_ACK_CODE := 'IR';
372             oe_debug_pub.add('855 nulling first_ack_date');
373 	    l_line_rec.FIRST_ACK_DATE := '';
374 	    l_line_rec.LAST_ACK_CODE  := '';
375 	    l_line_rec.LAST_ACK_DATE  := '';
376          ELSE
377 	    l_line_rec.LAST_ACK_CODE := 'IR';
378 	    l_line_rec.LAST_ACK_DATE := '';
379          END IF;
380 
381         END IF;
382         -- End of 3A4 for reject = 'Y' }
383 
384        --Value record is not required as record is rejected
385        --The above statement is not valid as the rejected record can
386        --have the value (when customer send the value data).
387        --so, we need to check if the record exists then populate for
388        --acknowledgment
389 
390        if p_old_line_val_tbl.EXISTS(I) then
391          -- uncommented following line, because of the mentioned reason above
392          -- bug3429670
393          l_line_val_rec  :=  p_old_line_val_tbl(I);
394        end if;
395       END IF;
396 
397     BEGIN
398 
399 if p_ack_type = oe_acknowledgment_pub.G_TRANSACTION_SSO
400    Or p_ack_type = oe_acknowledgment_pub.G_TRANSACTION_CSO
401 then
402 
403           SELECT count(*) INTO l_count
404             FROM OE_LINE_ACKS
405            WHERE header_id = l_line_rec.header_id
406 	     AND line_id = l_line_rec.line_id
407              AND acknowledgment_flag Is Null
408              -- Change this condition once ack type is ins for POAO/POCAO
409              AND nvl(acknowledgment_type,'ALL') = nvl(p_ack_type,'ALL')
410              AND  nvl(sold_to_org_id, FND_API.G_MISS_NUM)
411                =  nvl(l_line_rec.sold_to_org_id, FND_API.G_MISS_NUM)
412 	     AND  nvl(sold_to_org, FND_API.G_MISS_CHAR)
413                =  nvl(l_line_val_rec.sold_to_org, FND_API.G_MISS_CHAR)
414              AND  nvl(change_sequence, FND_API.G_MISS_CHAR)
415                =  nvl(l_line_rec.change_sequence, FND_API.G_MISS_CHAR)
416              AND request_id = l_line_rec.request_id;
417 
418 
419 else
420           SELECT count(*) INTO l_count
421             FROM OE_LINE_ACKS
422            WHERE header_id = l_line_rec.header_id
423              AND line_id = l_line_rec.line_id
424              AND acknowledgment_flag Is Null
425              -- Change this condition once ack type is ins for POAO/POCAO
426              AND nvl(acknowledgment_type,'ALL') = nvl(p_ack_type,'ALL')
427              AND  nvl(sold_to_org_id, FND_API.G_MISS_NUM)
428                =  nvl(l_line_rec.sold_to_org_id, FND_API.G_MISS_NUM)
429 	     AND  nvl(sold_to_org, FND_API.G_MISS_CHAR)
430                =  nvl(l_line_val_rec.sold_to_org, FND_API.G_MISS_CHAR)
431              AND  nvl(change_sequence, FND_API.G_MISS_CHAR)
432                =  nvl(l_line_rec.change_sequence, FND_API.G_MISS_CHAR);
433 end if;
434           IF l_count > 0 THEN
435              oe_debug_pub.add('l_count > 0, Calling Delete_Row');
436              OE_Line_Ack_Util.Delete_Row (p_line_id  => l_line_rec.line_id,
437                                           p_ack_type   => p_ack_type,
438                                           p_sold_to_org_id => l_line_rec.sold_to_org_id,
439 					  p_sold_to_org => l_line_val_rec.sold_to_org,
440                                           p_change_sequence => l_line_rec.change_sequence,
441                                           p_request_id => l_line_rec.request_id,
442                                           p_header_id => l_line_rec.header_id);
443 
444 	  ELSE
445               oe_debug_pub.add('l_count <= 0 for line_id, attempting delete by doc ref, line ref and ship ref');
446               OE_Line_Ack_Util.Delete_Row (p_line_id  => NULL,
447                                            p_ack_type   => p_ack_type,
448                                            p_orig_sys_document_ref => l_line_rec.orig_sys_document_ref,
449                                            p_orig_sys_line_ref     => l_line_rec.orig_sys_line_ref,
450                                            p_orig_sys_shipment_ref => l_line_rec.orig_sys_shipment_ref,
451                                           p_sold_to_org_id => l_line_rec.sold_to_org_id,
452 					   p_sold_to_org   => l_line_val_rec.sold_to_org,
453                                           p_change_sequence => l_line_rec.change_sequence,
454                                            p_request_id => l_line_rec.request_id,
455                                            p_header_id => NULL
456 );
457           END IF;
458 
459 
460           EXCEPTION WHEN OTHERS THEN NULL;
461     END;
462 
463 
464 
465       IF       l_line_rec.order_source_id            <> FND_API.G_MISS_NUM
466       -- Changed the following condition to compare -1 instead of 0
467       -- as 0 is valid order_source_id
468       AND  nvl(l_line_rec.order_source_id,-1)        <> -1
469       AND      l_line_rec.orig_sys_document_ref      <> FND_API.G_MISS_CHAR
470       AND  nvl(l_line_rec.orig_sys_document_ref,' ') <> ' '
471       AND      l_line_rec.orig_sys_line_ref          <> FND_API.G_MISS_CHAR
472       AND  nvl(l_line_rec.orig_sys_line_ref,' ')     <> ' '
473       -- Commenting the next 2 lines for the bug 2922709 fix
474       -- As for the rejected lines line_id can be null
475       -- OR      (l_line_rec.line_id                    <> FND_API.G_MISS_NUM
476       -- AND  nvl(l_line_rec.line_id,0)                 <> 0)
477 
478       THEN
479 
480     oe_debug_pub.add('inserting line ack record for'||
481 ' source id: '   ||to_char(l_line_rec.order_source_id)||
482 ', order ref: '  ||l_line_rec.orig_sys_document_ref||
483 ', line ref: '   ||l_line_rec.orig_sys_line_ref||
484 ', line id: '    ||to_char(l_line_rec.line_id)||
485 ', line no: '    ||to_char(l_line_rec.line_number)||
486 ', shipment no: '||to_char(l_line_rec.shipment_number)||
487 ', option no: '  ||to_char(l_line_rec.option_number));
488 
489    oe_debug_pub.add('item id = '||l_line_rec.inventory_item_id);
490    oe_debug_pub.add('item nm = '||l_line_val_rec.inventory_item);
491    oe_debug_pub.add('first_ack_date = '||l_line_rec.first_ack_date);
492 
493       IF l_line_rec.split_from_line_id IS NOT NULL
494         AND l_line_rec.split_from_line_id <> FND_API.G_MISS_NUM
495       THEN
496          --bsadri get the split reference
497          oe_debug_pub.add('bsadri get the reference for split id :' ||
498             l_line_rec.split_from_line_id);
499          BEGIN
500           SELECT orig_sys_line_ref, orig_sys_shipment_ref
501           INTO l_line_rec.split_from_line_ref, l_line_rec.split_from_shipment_ref
502           FROM OE_ORDER_LINES
503           WHERE line_id = l_line_rec.split_from_line_id;
504          EXCEPTION
505           WHEN OTHERS THEN
506            oe_debug_pub.add('bsadri failed to get the refernce for split line');
507          END;
508       END IF;
509       --added end customer fields for bug 4034441
510       INSERT INTO OE_LINE_ACKS
511          (
512           ACCOUNTING_RULE
513          ,ACCOUNTING_RULE_ID
514          ,ACCOUNTING_RULE_DURATION
515          ,ACKNOWLEDGMENT_FLAG
516          ,ACTUAL_ARRIVAL_DATE
517          ,ACTUAL_SHIPMENT_DATE
518          ,AGREEMENT
519          ,AGREEMENT_ID
520          ,ARRIVAL_SET_ID
521 --       ,ARRIVAL_SET_NAME
522          ,ATO_LINE_ID
523          ,ATTRIBUTE1
524          ,ATTRIBUTE10
525          ,ATTRIBUTE11
526          ,ATTRIBUTE12
527          ,ATTRIBUTE13
528          ,ATTRIBUTE14
529          ,ATTRIBUTE15
530          ,ATTRIBUTE16    --For bug 2184255
531          ,ATTRIBUTE17
532          ,ATTRIBUTE18
533          ,ATTRIBUTE19
534          ,ATTRIBUTE2
535          ,ATTRIBUTE20
536          ,ATTRIBUTE3
537          ,ATTRIBUTE4
538          ,ATTRIBUTE5
539          ,ATTRIBUTE6
540          ,ATTRIBUTE7
541          ,ATTRIBUTE8
542          ,ATTRIBUTE9
543          ,AUTHORIZED_TO_SHIP_FLAG
544          ,BUYER_SELLER_FLAG
545          ,BOOKED_FLAG
546 --       ,CALCULATE_PRICE_FLAG
547          ,CANCELLED_FLAG
548          ,CANCELLED_QUANTITY
549          ,CHANGE_DATE
550          ,CHANGE_SEQUENCE
551 --       ,CLOSED_FLAG
552          ,COMPONENT_CODE
553          ,COMPONENT_NUMBER
554          ,COMPONENT_SEQUENCE_ID
555          ,CONFIG_DISPLAY_SEQUENCE
556 --       ,CONFIG_LINE_REF
557          ,CONFIGURATION_ID
558          ,TOP_MODEL_LINE_ID
559          ,CONTEXT
560          ,CREATED_BY
561          ,CREATION_DATE
562          ,CUST_MODEL_SERIAL_NUMBER
563          ,CUST_PO_NUMBER
564          ,CUST_PRODUCTION_SEQ_NUM
565          ,CUSTOMER_DOCK_CODE
566          ,CUSTOMER_ITEM
567          ,CUSTOMER_ITEM_ID		-- 11/03
568 	 ,ORDERED_ITEM
569 --       ,CUSTOMER_ITEM_REVISION   11/03
570          , CUSTOMER_JOB
571          ,CUSTOMER_PRODUCTION_LINE
572          ,CUSTOMER_TRX_LINE_ID
573 --       ,DELIVER_TO_CONTACT
574          ,DELIVER_TO_CONTACT_ID
575          ,DELIVER_TO_ORG
576          ,DELIVER_TO_ORG_ID
577          ,DELIVERY_LEAD_TIME
578          ,DEMAND_BUCKET_TYPE
579          ,DEMAND_BUCKET_TYPE_CODE
580 --       ,DEMAND_CLASS
581          ,DEMAND_CLASS_CODE
582 --       ,DEMAND_STREAM
583          ,DEP_PLAN_REQUIRED_FLAG
584 --       ,DPW_ASSIGNED_FLAG
585          ,EARLIEST_ACCEPTABLE_DATE
586          ,EXPLOSION_DATE
587 	 ,FIRST_ACK_CODE
588 	 ,FIRST_ACK_DATE
589          ,FOB_POINT
590          ,FOB_POINT_CODE
591          ,FREIGHT_CARRIER_CODE
592          ,FREIGHT_TERMS
593          ,FREIGHT_TERMS_CODE
594          ,FULFILLED_QUANTITY
595 --       ,FULFILLMENT_SET_ID
596 --       ,FULFILLMENT_SET_NAME
597          ,GLOBAL_ATTRIBUTE_CATEGORY
598          ,GLOBAL_ATTRIBUTE1
599          ,GLOBAL_ATTRIBUTE10
600          ,GLOBAL_ATTRIBUTE11
601          ,GLOBAL_ATTRIBUTE12
602          ,GLOBAL_ATTRIBUTE13
603          ,GLOBAL_ATTRIBUTE14
604          ,GLOBAL_ATTRIBUTE15
605          ,GLOBAL_ATTRIBUTE16
606          ,GLOBAL_ATTRIBUTE17
607          ,GLOBAL_ATTRIBUTE18
608          ,GLOBAL_ATTRIBUTE19
609          ,GLOBAL_ATTRIBUTE2
610          ,GLOBAL_ATTRIBUTE20
611          ,GLOBAL_ATTRIBUTE3
612          ,GLOBAL_ATTRIBUTE4
613          ,GLOBAL_ATTRIBUTE5
614          ,GLOBAL_ATTRIBUTE6
615          ,GLOBAL_ATTRIBUTE7
616          ,GLOBAL_ATTRIBUTE8
617          ,GLOBAL_ATTRIBUTE9
618          ,HEADER_ID
619          ,INDUSTRY_ATTRIBUTE1
620          ,INDUSTRY_ATTRIBUTE10
621          ,INDUSTRY_ATTRIBUTE11
622          ,INDUSTRY_ATTRIBUTE12
623          ,INDUSTRY_ATTRIBUTE13
624          ,INDUSTRY_ATTRIBUTE14
625          ,INDUSTRY_ATTRIBUTE15
626          ,INDUSTRY_ATTRIBUTE16
627          ,INDUSTRY_ATTRIBUTE17
628          ,INDUSTRY_ATTRIBUTE18
629          ,INDUSTRY_ATTRIBUTE19
630          ,INDUSTRY_ATTRIBUTE2
631          ,INDUSTRY_ATTRIBUTE20
632          ,INDUSTRY_ATTRIBUTE21
633          ,INDUSTRY_ATTRIBUTE22
634          ,INDUSTRY_ATTRIBUTE23
635          ,INDUSTRY_ATTRIBUTE24
636          ,INDUSTRY_ATTRIBUTE25
637          ,INDUSTRY_ATTRIBUTE26
638          ,INDUSTRY_ATTRIBUTE27
639          ,INDUSTRY_ATTRIBUTE28
640          ,INDUSTRY_ATTRIBUTE29
641          ,INDUSTRY_ATTRIBUTE3
642          ,INDUSTRY_ATTRIBUTE30
643          ,INDUSTRY_ATTRIBUTE4
644          ,INDUSTRY_ATTRIBUTE5
645          ,INDUSTRY_ATTRIBUTE6
646          ,INDUSTRY_ATTRIBUTE7
647          ,INDUSTRY_ATTRIBUTE8
648          ,INDUSTRY_ATTRIBUTE9
649          ,INDUSTRY_CONTEXT
650          ,TP_CONTEXT
651          ,TP_ATTRIBUTE1
652          ,TP_ATTRIBUTE2
653          ,TP_ATTRIBUTE3
654          ,TP_ATTRIBUTE4
655          ,TP_ATTRIBUTE5
656          ,TP_ATTRIBUTE6
657          ,TP_ATTRIBUTE7
658          ,TP_ATTRIBUTE8
659          ,TP_ATTRIBUTE9
660          ,TP_ATTRIBUTE10
661          ,TP_ATTRIBUTE11
662          ,TP_ATTRIBUTE12
663          ,TP_ATTRIBUTE13
664          ,TP_ATTRIBUTE14
665          ,TP_ATTRIBUTE15
666          ,INTMED_SHIP_TO_CONTACT_ID
667          ,INTMED_SHIP_TO_ORG_ID
668          ,INVENTORY_ITEM
669          ,INVENTORY_ITEM_ID
670 --       ,INVOICE_COMPLETE_FLAG    11/03
671 --       ,INVOICE_SET_ID
672 --       ,INVOICE_SET_NAME
673 --       ,INVOICE_NUMBER
674          ,INVOICE_TO_CONTACT
675          ,INVOICE_TO_CONTACT_ID
676          ,INVOICE_TO_ORG
677          ,INVOICE_TO_ORG_ID
678 --       ,INVOICE_TOLERANCE_ABOVE
679 --       ,INVOICE_TOLERANCE_BELOW
680          ,INVOICING_RULE
681          ,INVOICING_RULE_ID
682          ,ITEM_INPUT
683          ,ITEM_REVISION
684          ,ITEM_TYPE_CODE
685 	 ,LAST_ACK_CODE
686 	 ,LAST_ACK_DATE
687          ,LAST_UPDATE_DATE
688          ,LAST_UPDATE_LOGIN
689          ,LAST_UPDATED_BY
690          ,LATEST_ACCEPTABLE_DATE
691          ,LINE_CATEGORY_CODE
692          ,LINE_ID
693          ,LINE_NUMBER
694 --       ,LINE_PO_CONTEXT
695          ,LINE_TYPE
696          ,LINE_TYPE_ID
697          ,LINK_TO_LINE_ID
698 --       ,LINK_TO_LINE_REF
699 --       ,LOT
700          ,MODEL_GROUP_NUMBER
701          ,OPEN_FLAG
702          ,OPERATION_CODE
703          ,OPTION_FLAG
704          ,OPTION_NUMBER
705          ,ORDER_QUANTITY_UOM
706          ,ORDER_SOURCE_ID
707          ,ORDERED_QUANTITY
708          ,ORG_ID
709          ,ORIG_SYS_DOCUMENT_REF
710          ,ORIG_SYS_LINE_REF
711          ,ORIG_SYS_SHIPMENT_REF
712          ,OVER_SHIP_REASON_CODE
713          ,OVER_SHIP_RESOLVED_FLAG
714          ,PAYMENT_TERM
715          ,PAYMENT_TERM_ID
716          ,PRICE_LIST
717          ,PRICE_LIST_ID
718          ,PRICING_ATTRIBUTE1
719          ,PRICING_ATTRIBUTE10
720          ,PRICING_ATTRIBUTE2
721          ,PRICING_ATTRIBUTE3
722          ,PRICING_ATTRIBUTE4
723          ,PRICING_ATTRIBUTE5
724          ,PRICING_ATTRIBUTE6
725          ,PRICING_ATTRIBUTE7
726          ,PRICING_ATTRIBUTE8
727          ,PRICING_ATTRIBUTE9
728          ,PRICING_CONTEXT
729          ,PRICING_DATE
730          ,PRICING_QUANTITY
731          ,PRICING_QUANTITY_UOM
732 --       ,PROGRAM
733 --       ,PROGRAM_APPLICATION
734          ,PROGRAM_APPLICATION_ID
735          ,PROGRAM_ID
736          ,PROGRAM_UPDATE_DATE
737          ,PROJECT
738          ,PROJECT_ID
739          ,PROMISE_DATE
740 --       ,REFERENCE_HEADER
741          ,REFERENCE_HEADER_ID
742 --       ,REFERENCE_LINE
743          ,REFERENCE_LINE_ID
744          ,REFERENCE_TYPE
745 --       ,RELATED_PO_NUMBER
746          ,REQUEST_DATE
747          ,REQUEST_ID
748          ,RESERVED_QUANTITY
749          ,RETURN_ATTRIBUTE1
750          ,RETURN_ATTRIBUTE10
751          ,RETURN_ATTRIBUTE11
752          ,RETURN_ATTRIBUTE12
753          ,RETURN_ATTRIBUTE13
754          ,RETURN_ATTRIBUTE14
755          ,RETURN_ATTRIBUTE15
756          ,RETURN_ATTRIBUTE2
757          ,RETURN_ATTRIBUTE3
758          ,RETURN_ATTRIBUTE4
759          ,RETURN_ATTRIBUTE5
760          ,RETURN_ATTRIBUTE6
761          ,RETURN_ATTRIBUTE7
762          ,RETURN_ATTRIBUTE8
763          ,RETURN_ATTRIBUTE9
764          ,RETURN_CONTEXT
765          ,RETURN_REASON_CODE
766          ,RLA_SCHEDULE_TYPE_CODE
767          ,SALESREP_ID
768          ,SALESREP
769          ,SCHEDULE_ARRIVAL_DATE
770          ,SCHEDULE_SHIP_DATE
771 --       ,SCHEDULE_ITEM_DETAIL
772          ,SCHEDULE_STATUS_CODE
773          ,SHIP_FROM_ORG
774          ,SHIP_FROM_ORG_ID
775          ,SHIP_MODEL_COMPLETE_FLAG
776          ,SHIP_SET_ID
777 --       ,SHIP_SET_NAME
778          ,SHIP_TO_ADDRESS1
779          ,SHIP_TO_ADDRESS2
780          ,SHIP_TO_ADDRESS3
781          ,SHIP_TO_ADDRESS4
782          ,SHIP_TO_CITY
783          ,SHIP_TO_CONTACT
784 --       ,SHIP_TO_CONTACT_AREA_CODE1
785 --       ,SHIP_TO_CONTACT_AREA_CODE2
786 --       ,SHIP_TO_CONTACT_AREA_CODE3
787          ,SHIP_TO_CONTACT_FIRST_NAME
788          ,SHIP_TO_CONTACT_ID
789 --       ,SHIP_TO_CONTACT_JOB_TITLE
790          ,SHIP_TO_CONTACT_LAST_NAME
791          ,SHIP_TO_COUNTRY
792          ,SHIP_TO_COUNTY
793          ,SHIP_TO_ORG
794          ,SHIP_TO_ORG_ID
795          ,SHIP_TO_POSTAL_CODE
796          ,SHIP_TO_STATE
797          ,SHIP_TOLERANCE_ABOVE
798          ,SHIP_TOLERANCE_BELOW
799          ,SHIPMENT_NUMBER
800          ,SHIPMENT_PRIORITY
801          ,SHIPMENT_PRIORITY_CODE
802          ,SHIPPED_QUANTITY
803 --       ,SHIPPING_METHOD
804          ,SHIPPING_METHOD_CODE
805          ,SHIPPING_QUANTITY
806          ,SHIPPING_QUANTITY_UOM
807 --       ,SOLD_FROM_ORG
808 --       ,SOLD_FROM_ORG_ID
809          ,SOLD_TO_ORG
810          ,SOLD_TO_ORG_ID
811          ,SORT_ORDER
812          ,SOURCE_DOCUMENT_ID
813          ,SOURCE_DOCUMENT_LINE_ID
814          ,SOURCE_DOCUMENT_TYPE_ID
815          ,SOURCE_TYPE_CODE
816          ,SPLIT_FROM_LINE_ID
817 --       ,SUBINVENTORY
818 --       ,SUBMISSION_DATETIME
819          ,TASK
820          ,TASK_ID
821 --       ,TAX
822          ,TAX_CODE
823          ,TAX_DATE
824          ,TAX_EXEMPT_FLAG
825          ,TAX_EXEMPT_NUMBER
826          ,TAX_EXEMPT_REASON
827          ,TAX_EXEMPT_REASON_CODE
828          ,TAX_POINT
829          ,TAX_POINT_CODE
830          ,TAX_RATE
831          ,TAX_VALUE
832          ,UNIT_LIST_PRICE
833          ,UNIT_SELLING_PRICE
834          ,VEH_CUS_ITEM_CUM_KEY_ID
835          ,VISIBLE_DEMAND_FLAG
836          ,split_from_line_ref
837          ,split_from_shipment_ref
838          ,SHIP_TO_EDI_LOCATION_CODE
839          ,Service_Txn_Reason_Code
840 	 ,Service_Txn_Comments
841 	 ,Service_Duration
842 	 ,Service_Start_Date
843 	 ,Service_End_Date
844 	 ,Service_Coterminate_Flag
845 	 ,Service_Number
846 	 ,Service_Period
847 	 ,Service_Reference_Type_Code
848 	 ,Service_Reference_Line_Id
849 	 ,Service_Reference_System_Id
850 	 ,Credit_Invoice_Line_Id
851 	 ,Ship_to_Province
852 	 ,Invoice_Province
853 	 ,Bill_to_Edi_Location_Code
854 	 ,Invoice_City
855          ,ship_from_edi_location_code
856          ,SHIP_FROM_ADDRESS_1
857          ,SHIP_FROM_ADDRESS_2
858          ,SHIP_FROM_ADDRESS_3
859          ,SHIP_FROM_CITY
860          ,SHIP_FROM_POSTAL_CODE
861          ,SHIP_FROM_COUNTRY
862          ,SHIP_FROM_REGION1
863          ,SHIP_FROM_REGION2
864          ,SHIP_FROM_REGION3
865          ,SHIP_FROM_ADDRESS_ID
866          ,SHIP_TO_ADDRESS_ID
867          ,SHIP_TO_ADDRESS_CODE
868          ,service_reference_line
869          ,service_reference_order
870          ,service_reference_system
871 --       ,order_source
872          ,customer_line_number
873          ,CUSTOMER_ITEM_NET_PRICE --bug#5733732
874          ,user_item_description
875          ,acknowledgment_type
876          ,blanket_number
877          ,blanket_line_number
878          ,original_inventory_item_id
879 	 ,original_ordered_item_id
880 	 ,original_ordered_item
881 	 ,original_item_identifier_type
882          ,item_relationship_type
883          ,error_flag
884          ,customer_shipment_number
885      -- { Distributer Order related change
886         ,end_customer_id
887         ,end_customer_contact_id
888         ,end_customer_site_use_id
889         ,ib_owner
890         ,ib_current_location
891         ,ib_installed_at_location
892      -- Distributer Order related change }
893         ,charge_periodicity_code
894         ,end_customer_name
895         ,end_customer_number
896         ,end_customer_contact
897         ,end_customer_address1
898         ,end_customer_address2
899         ,end_customer_address3
900         ,end_customer_address4
901         ,end_customer_city
902         ,end_customer_state
903         ,end_customer_postal_code
904         ,end_customer_country
905 		--Sol_ord_er #16014165 start
906 		, SERVICE_BILL_PROFILE_ID
907 		, SERVICE_COV_TEMPLATE_ID
908 		, SERVICE_SUBS_TEMPLATE_ID
909 		, SERVICE_BILL_OPTION
910 		, SERVICE_BILLING_PROFILE
911 		, SERVICE_COVERAGE_TEMPLATE
912 		, SERVICE_SUBSCRIPTION_TEMPLATE
913 		, SERVICE_BILL_OPTION_CODE
914 		, SERVICE_FIRST_PERIOD_AMOUNT
915 		, SUBSCRIPTION_ENABLE_FLAG
916 		,SERVICE_FIRST_PERIOD_ENDDATE
917 		--Sol_ord_er #16014165 end
918 )
919          VALUES
920          (
921           l_line_val_rec.ACCOUNTING_RULE
922          , l_line_rec.ACCOUNTING_RULE_ID
923          , l_line_rec.ACCOUNTING_RULE_DURATION
924          , '' 		-- ACKNOWLEDGMENT_FLAG
925          , l_line_rec.ACTUAL_ARRIVAL_DATE
926          , l_line_rec.ACTUAL_SHIPMENT_DATE
927          , l_line_val_rec.AGREEMENT
928          , l_line_rec.AGREEMENT_ID
929          , l_line_rec.ARRIVAL_SET_ID
930 --       , l_line_rec.ARRIVAL_SET_NAME
931          , l_line_rec.ATO_LINE_ID
932          , l_line_rec.ATTRIBUTE1
933          , l_line_rec.ATTRIBUTE10
934          , l_line_rec.ATTRIBUTE11
935          , l_line_rec.ATTRIBUTE12
936          , l_line_rec.ATTRIBUTE13
937          , l_line_rec.ATTRIBUTE14
938          , l_line_rec.ATTRIBUTE15
939          , l_line_rec.ATTRIBUTE16    --For bug 2184255
940          , l_line_rec.ATTRIBUTE17
941          , l_line_rec.ATTRIBUTE18
942          , l_line_rec.ATTRIBUTE19
943          , l_line_rec.ATTRIBUTE2
944          , l_line_rec.ATTRIBUTE20
945          , l_line_rec.ATTRIBUTE3
946          , l_line_rec.ATTRIBUTE4
947          , l_line_rec.ATTRIBUTE5
948          , l_line_rec.ATTRIBUTE6
949          , l_line_rec.ATTRIBUTE7
950          , l_line_rec.ATTRIBUTE8
951          , l_line_rec.ATTRIBUTE9
952          , l_line_rec.AUTHORIZED_TO_SHIP_FLAG
953          , p_buyer_seller_flag
954          , l_line_rec.BOOKED_FLAG
955 --       , l_line_rec.CALCULATE_PRICE_FLAG
956          , l_line_rec.CANCELLED_FLAG
957          , l_line_rec.CANCELLED_QUANTITY
958          , ''	-- CHANGE_DATE
959          , l_line_rec.CHANGE_SEQUENCE
960 --       , l_line_rec.CLOSED_FLAG
961          , l_line_rec.COMPONENT_CODE
962          , l_line_rec.COMPONENT_NUMBER
963          , l_line_rec.COMPONENT_SEQUENCE_ID
964          , l_line_rec.CONFIG_DISPLAY_SEQUENCE
965 --       , l_line_rec.CONFIG_LINE_REF
966          , l_line_rec.CONFIGURATION_ID
967          , l_line_rec.TOP_MODEL_LINE_ID
968          , l_line_rec.CONTEXT
969          , l_line_rec.CREATED_BY
970          , l_line_rec.CREATION_DATE
971          , l_line_rec.CUST_MODEL_SERIAL_NUMBER
972          , l_line_rec.CUST_PO_NUMBER
973          , l_line_rec.CUST_PRODUCTION_SEQ_NUM
974          , l_line_rec.CUSTOMER_DOCK_CODE
975          , decode ( l_line_rec.item_identifier_type ,'CUST', l_line_rec.ORDERED_ITEM,NULL) --bug8477822
976          , decode ( l_line_rec.item_identifier_type ,'CUST', l_line_rec.ORDERED_ITEM_ID,NULL)  --bug8477822  -- CUSTOMER_ITEM_ID Added for bug 4404309
977 	 , l_line_rec.ORDERED_ITEM --bug8477822
978 
979 --       , l_line_rec.CUSTOMER_ITEM_REVISION
980          , l_line_rec.CUSTOMER_JOB
981          , l_line_rec.CUSTOMER_PRODUCTION_LINE
982          , l_line_rec.CUSTOMER_TRX_LINE_ID
983 --       , l_line_rec.DELIVER_TO_CONTACT
984          , l_line_rec.DELIVER_TO_CONTACT_ID
985          , l_line_val_rec.DELIVER_TO_ORG
986          , l_line_rec.DELIVER_TO_ORG_ID
987          , l_line_rec.DELIVERY_LEAD_TIME
988          , l_line_val_rec.DEMAND_BUCKET_TYPE
989          , l_line_rec.DEMAND_BUCKET_TYPE_CODE
990 --       , l_line_rec.DEMAND_CLASS
991          , l_line_rec.DEMAND_CLASS_CODE
992 --       , l_line_rec.DEMAND_STREAM
993          , l_line_rec.DEP_PLAN_REQUIRED_FLAG
994          , l_line_rec.EARLIEST_ACCEPTABLE_DATE
995          , l_line_rec.EXPLOSION_DATE
996 	 , l_line_rec.FIRST_ACK_CODE
997 	 , l_line_rec.FIRST_ACK_DATE
998          , l_line_val_rec.FOB_POINT
999          , l_line_rec.FOB_POINT_CODE
1000          , l_line_rec.FREIGHT_CARRIER_CODE
1001          , l_line_val_rec.FREIGHT_TERMS
1002          , l_line_rec.FREIGHT_TERMS_CODE
1003          , l_line_rec.FULFILLED_QUANTITY
1004 --       , l_line_rec.FULFILLMENT_SET_ID
1005 --       , l_line_rec.FULFILLMENT_SET_NAME
1006          , l_line_rec.GLOBAL_ATTRIBUTE_CATEGORY
1007          , l_line_rec.GLOBAL_ATTRIBUTE1
1008          , l_line_rec.GLOBAL_ATTRIBUTE10
1009          , l_line_rec.GLOBAL_ATTRIBUTE11
1010          , l_line_rec.GLOBAL_ATTRIBUTE12
1011          , l_line_rec.GLOBAL_ATTRIBUTE13
1012          , l_line_rec.GLOBAL_ATTRIBUTE14
1013          , l_line_rec.GLOBAL_ATTRIBUTE15
1014          , l_line_rec.GLOBAL_ATTRIBUTE16
1015          , l_line_rec.GLOBAL_ATTRIBUTE17
1016          , l_line_rec.GLOBAL_ATTRIBUTE18
1017          , l_line_rec.GLOBAL_ATTRIBUTE19
1018          , l_line_rec.GLOBAL_ATTRIBUTE2
1019          , l_line_rec.GLOBAL_ATTRIBUTE20
1020          , l_line_rec.GLOBAL_ATTRIBUTE3
1021          , l_line_rec.GLOBAL_ATTRIBUTE4
1022          , l_line_rec.GLOBAL_ATTRIBUTE5
1023          , l_line_rec.GLOBAL_ATTRIBUTE6
1024          , l_line_rec.GLOBAL_ATTRIBUTE7
1025          , l_line_rec.GLOBAL_ATTRIBUTE8
1026          , l_line_rec.GLOBAL_ATTRIBUTE9
1027          , l_line_rec.HEADER_ID
1028          , l_line_rec.INDUSTRY_ATTRIBUTE1
1029          , l_line_rec.INDUSTRY_ATTRIBUTE10
1030          , l_line_rec.INDUSTRY_ATTRIBUTE11
1031          , l_line_rec.INDUSTRY_ATTRIBUTE12
1032          , l_line_rec.INDUSTRY_ATTRIBUTE13
1033          , l_line_rec.INDUSTRY_ATTRIBUTE14
1034          , l_line_rec.INDUSTRY_ATTRIBUTE15
1035          , l_line_rec.INDUSTRY_ATTRIBUTE16
1036          , l_line_rec.INDUSTRY_ATTRIBUTE17
1037          , l_line_rec.INDUSTRY_ATTRIBUTE18
1038          , l_line_rec.INDUSTRY_ATTRIBUTE19
1039          , l_line_rec.INDUSTRY_ATTRIBUTE2
1040          , l_line_rec.INDUSTRY_ATTRIBUTE20
1041          , l_line_rec.INDUSTRY_ATTRIBUTE21
1042          , l_line_rec.INDUSTRY_ATTRIBUTE22
1043          , l_line_rec.INDUSTRY_ATTRIBUTE23
1044          , l_line_rec.INDUSTRY_ATTRIBUTE24
1045          , l_line_rec.INDUSTRY_ATTRIBUTE25
1046          , l_line_rec.INDUSTRY_ATTRIBUTE26
1047          , l_line_rec.INDUSTRY_ATTRIBUTE27
1048          , l_line_rec.INDUSTRY_ATTRIBUTE28
1049          , l_line_rec.INDUSTRY_ATTRIBUTE29
1050          , l_line_rec.INDUSTRY_ATTRIBUTE3
1051          , l_line_rec.INDUSTRY_ATTRIBUTE30
1052          , l_line_rec.INDUSTRY_ATTRIBUTE4
1053          , l_line_rec.INDUSTRY_ATTRIBUTE5
1054          , l_line_rec.INDUSTRY_ATTRIBUTE6
1055          , l_line_rec.INDUSTRY_ATTRIBUTE7
1056          , l_line_rec.INDUSTRY_ATTRIBUTE8
1057          , l_line_rec.INDUSTRY_ATTRIBUTE9
1058          , l_line_rec.INDUSTRY_CONTEXT
1059          , l_line_rec.TP_CONTEXT
1060          , l_line_rec.TP_ATTRIBUTE1
1061          , l_line_rec.TP_ATTRIBUTE2
1062          , l_line_rec.TP_ATTRIBUTE3
1063          , l_line_rec.TP_ATTRIBUTE4
1064          , l_line_rec.TP_ATTRIBUTE5
1065          , l_line_rec.TP_ATTRIBUTE6
1066          , l_line_rec.TP_ATTRIBUTE7
1067          , l_line_rec.TP_ATTRIBUTE8
1068          , l_line_rec.TP_ATTRIBUTE9
1069          , l_line_rec.TP_ATTRIBUTE10
1070          , l_line_rec.TP_ATTRIBUTE11
1071          , l_line_rec.TP_ATTRIBUTE12
1072          , l_line_rec.TP_ATTRIBUTE13
1073          , l_line_rec.TP_ATTRIBUTE14
1074          , l_line_rec.TP_ATTRIBUTE15
1075          , l_line_rec.INTERMED_SHIP_TO_CONTACT_ID
1076          , l_line_rec.INTERMED_SHIP_TO_ORG_ID
1077          , l_line_val_rec.INVENTORY_ITEM
1078          , l_line_rec.INVENTORY_ITEM_ID
1079 --       , l_line_rec.INVOICE_COMPLETE_FLAG    11/03
1080 --       , l_line_rec.INVOICE_SET_ID
1081 --       , l_line_rec.INVOICE_SET_NAME
1082 --       , l_line_rec.INVOICE_NUMBER
1083          , l_line_val_rec.INVOICE_TO_CONTACT
1084          , l_line_rec.INVOICE_TO_CONTACT_ID
1085          , l_line_val_rec.INVOICE_TO_ORG
1086          , l_line_rec.INVOICE_TO_ORG_ID
1087 --       , ???().INVOICE_TOLERANCE_ABOVE
1088 --       , ???().INVOICE_TOLERANCE_BELOW
1089          , l_line_val_rec.INVOICING_RULE
1090          , l_line_rec.INVOICING_RULE_ID
1091          , l_line_rec.ORDERED_ITEM
1092          , l_line_rec.ITEM_REVISION
1093          , l_line_rec.item_identifier_type             --ITEM_TYPE_CODE
1094 	 , l_line_rec.LAST_ACK_CODE
1095 	 , l_line_rec.LAST_ACK_DATE
1096          , l_line_rec.LAST_UPDATE_DATE
1097          , l_line_rec.LAST_UPDATE_LOGIN
1098          , l_line_rec.LAST_UPDATED_BY
1099          , l_line_rec.LATEST_ACCEPTABLE_DATE
1100          , l_line_rec.LINE_CATEGORY_CODE
1101          , l_line_rec.LINE_ID
1102          , l_line_rec.LINE_NUMBER
1103 --       , l_line_rec.LINE_PO_CONTEXT
1104          , l_line_val_rec.LINE_TYPE
1105          , l_line_rec.LINE_TYPE_ID
1106          , l_line_rec.LINK_TO_LINE_ID
1107 --       , l_line_rec.LINK_TO_LINE_REF
1108 --       , ???().LOT
1109          , l_line_rec.MODEL_GROUP_NUMBER
1110          , l_line_rec.OPEN_FLAG
1111          , l_line_rec.OPERATION
1112          , l_line_rec.OPTION_FLAG
1113          , l_line_rec.OPTION_NUMBER
1114          , l_line_rec.ORDER_QUANTITY_UOM
1115          , l_line_rec.ORDER_SOURCE_ID
1116          , l_line_rec.ORDERED_QUANTITY
1117          , l_line_rec.ORG_ID
1118          , l_line_rec.ORIG_SYS_DOCUMENT_REF
1119          , l_line_rec.ORIG_SYS_LINE_REF
1120          , l_line_rec.ORIG_SYS_SHIPMENT_REF
1121          , l_line_rec.OVER_SHIP_REASON_CODE
1122          , l_line_rec.OVER_SHIP_RESOLVED_FLAG
1123          , l_line_val_rec.PAYMENT_TERM
1124          , l_line_rec.PAYMENT_TERM_ID
1125          , l_line_val_rec.PRICE_LIST
1126          , l_line_rec.PRICE_LIST_ID
1127          , l_line_rec.PRICING_ATTRIBUTE1
1128          , l_line_rec.PRICING_ATTRIBUTE10
1129          , l_line_rec.PRICING_ATTRIBUTE2
1130          , l_line_rec.PRICING_ATTRIBUTE3
1131          , l_line_rec.PRICING_ATTRIBUTE4
1132          , l_line_rec.PRICING_ATTRIBUTE5
1133          , l_line_rec.PRICING_ATTRIBUTE6
1134          , l_line_rec.PRICING_ATTRIBUTE7
1135          , l_line_rec.PRICING_ATTRIBUTE8
1136          , l_line_rec.PRICING_ATTRIBUTE9
1137          , l_line_rec.PRICING_CONTEXT
1138          , l_line_rec.PRICING_DATE
1139          , l_line_rec.PRICING_QUANTITY
1140          , l_line_rec.PRICING_QUANTITY_UOM
1141 --       , ???().PROGRAM
1142 --       , ???().PROGRAM_APPLICATION
1143          , l_line_rec.PROGRAM_APPLICATION_ID
1144          , l_line_rec.PROGRAM_ID
1145          , l_line_rec.PROGRAM_UPDATE_DATE
1146          , l_line_val_rec.PROJECT
1147          , l_line_rec.PROJECT_ID
1148          , l_line_rec.PROMISE_DATE
1149 --       , l_line_rec.REFERENCE_HEADER
1150          , l_line_rec.REFERENCE_HEADER_ID
1151 --       , l_line_rec.REFERENCE_LINE
1152          , l_line_rec.REFERENCE_LINE_ID
1153          , l_line_rec.REFERENCE_TYPE
1154          , l_line_rec.REQUEST_DATE
1155          , l_line_rec.REQUEST_ID
1156          , l_line_rec.RESERVED_QUANTITY
1157          , l_line_rec.RETURN_ATTRIBUTE1
1158          , l_line_rec.RETURN_ATTRIBUTE10
1159          , l_line_rec.RETURN_ATTRIBUTE11
1160          , l_line_rec.RETURN_ATTRIBUTE12
1161          , l_line_rec.RETURN_ATTRIBUTE13
1162          , l_line_rec.RETURN_ATTRIBUTE14
1163          , l_line_rec.RETURN_ATTRIBUTE15
1164          , l_line_rec.RETURN_ATTRIBUTE2
1165          , l_line_rec.RETURN_ATTRIBUTE3
1166          , l_line_rec.RETURN_ATTRIBUTE4
1167          , l_line_rec.RETURN_ATTRIBUTE5
1168          , l_line_rec.RETURN_ATTRIBUTE6
1169          , l_line_rec.RETURN_ATTRIBUTE7
1170          , l_line_rec.RETURN_ATTRIBUTE8
1171          , l_line_rec.RETURN_ATTRIBUTE9
1172          , l_line_rec.RETURN_CONTEXT
1173          , l_line_rec.RETURN_REASON_CODE
1174          , l_line_rec.RLA_SCHEDULE_TYPE_CODE
1175          , l_line_rec.SALESREP_ID
1176          , l_line_val_rec.SALESREP
1177          , l_line_rec.SCHEDULE_ARRIVAL_DATE
1178          , l_line_rec.SCHEDULE_SHIP_DATE
1179 --       , l_line_rec.SCHEDULE_ITEM_DETAIL
1180          , l_line_rec.SCHEDULE_STATUS_CODE
1181          , l_line_val_rec.SHIP_FROM_ORG
1182          , l_line_rec.SHIP_FROM_ORG_ID
1183          , l_line_rec.SHIP_MODEL_COMPLETE_FLAG
1184          , l_line_rec.SHIP_SET_ID
1185 --       , l_line_rec.SHIP_SET_NAME
1186          , l_line_val_rec.SHIP_TO_ADDRESS1
1187          , l_line_val_rec.SHIP_TO_ADDRESS2
1188          , l_line_val_rec.SHIP_TO_ADDRESS3
1189          , l_line_val_rec.SHIP_TO_ADDRESS4
1190        , l_line_val_rec.SHIP_TO_CITY
1191          , l_line_val_rec.SHIP_TO_CONTACT
1192 --       , l_line_rec.SHIP_TO_CONTACT_AREA_CODE1
1193 --       , l_line_rec.SHIP_TO_CONTACT_AREA_CODE2
1194 --       , l_line_rec.SHIP_TO_CONTACT_AREA_CODE3
1195        , l_line_val_rec.SHIP_TO_CONTACT_FIRST_NAME
1196          , l_line_rec.SHIP_TO_CONTACT_ID
1197 --       , l_line_rec.SHIP_TO_CONTACT_JOB_TITLE
1198        , l_line_val_rec.SHIP_TO_CONTACT_LAST_NAME
1199        , l_line_val_rec.SHIP_TO_COUNTRY
1200        , l_line_val_rec.SHIP_TO_COUNTY
1201          , l_line_val_rec.SHIP_TO_ORG
1202          , l_line_rec.SHIP_TO_ORG_ID
1203        , l_line_val_rec.SHIP_TO_zip
1204        , l_line_val_rec.SHIP_TO_STATE
1205          , l_line_rec.SHIP_TOLERANCE_ABOVE
1206          , l_line_rec.SHIP_TOLERANCE_BELOW
1207          , l_line_rec.SHIPMENT_NUMBER
1208          , l_line_val_rec.SHIPMENT_PRIORITY
1209          , l_line_rec.SHIPMENT_PRIORITY_CODE
1210          , l_line_rec.SHIPPED_QUANTITY
1211 --       , l_line_rec.SHIPPING_METHOD
1212          , l_line_rec.SHIPPING_METHOD_CODE
1213          , l_line_rec.SHIPPING_QUANTITY
1214          , l_line_rec.SHIPPING_QUANTITY_UOM
1215 --       , ???().SOLD_FROM_ORG
1216 --       , ???().SOLD_FROM_ORG_ID
1217          , l_line_val_rec.SOLD_TO_ORG
1218          , l_line_rec.SOLD_TO_ORG_ID
1219          , l_line_rec.SORT_ORDER
1220          , l_line_rec.SOURCE_DOCUMENT_ID
1221          , l_line_rec.SOURCE_DOCUMENT_LINE_ID
1222          , l_line_rec.SOURCE_DOCUMENT_TYPE_ID
1223          , l_line_rec.SOURCE_TYPE_CODE
1224          , l_line_rec.SPLIT_FROM_LINE_ID
1225 --       , ???.SUBINVENTORY
1226 --       , ???.SUBMISSION_DATETIME
1227          , l_line_val_rec.TASK
1228          , l_line_rec.TASK_ID
1229 --       , l_line_rec.TAX
1230          , l_line_rec.TAX_CODE
1231          , l_line_rec.TAX_DATE
1232          , l_line_rec.TAX_EXEMPT_FLAG
1233          , l_line_rec.TAX_EXEMPT_NUMBER
1234          , l_line_val_rec.TAX_EXEMPT_REASON
1235          , l_line_rec.TAX_EXEMPT_REASON_CODE
1236          , l_line_val_rec.TAX_POINT
1237          , l_line_rec.TAX_POINT_CODE
1238          , l_line_rec.TAX_RATE
1239          , l_line_rec.TAX_VALUE
1240          , l_line_rec.UNIT_LIST_PRICE
1241          , l_line_rec.UNIT_SELLING_PRICE
1242          , l_line_rec.VEH_CUS_ITEM_CUM_KEY_ID
1243          , l_line_rec.VISIBLE_DEMAND_FLAG
1244          , l_line_rec.split_from_line_ref
1245          , l_line_rec.split_from_shipment_ref
1246          , l_line_rec.SHIP_TO_EDI_LOCATION_CODE
1247 	 , l_line_rec.Service_Txn_Reason_Code
1248 	 , l_line_rec.Service_Txn_Comments
1249 	 , l_line_rec.Service_Duration
1250 	 , l_line_rec.Service_Start_Date
1251 	 , l_line_rec.Service_End_Date
1252 	 , l_line_rec.Service_Coterminate_Flag
1253 	 , l_line_rec.Service_Number
1254 	 , l_line_rec.Service_Period
1255 	 , l_line_rec.Service_Reference_Type_Code
1256 	 , l_line_rec.Service_Reference_Line_Id
1257 	 , l_line_rec.Service_Reference_System_Id
1258 	 , l_line_rec.Credit_Invoice_Line_Id
1259 	 , l_line_val_rec.Ship_to_Province
1260 	 , l_line_val_rec.Invoice_to_Province
1261 	 , l_line_rec.Bill_to_Edi_Location_Code
1262 	 , l_line_val_rec.Invoice_To_City
1263          , l_line_rec.ship_from_edi_location_code
1264          , l_line_val_rec.SHIP_FROM_ADDRESS1
1265          , l_line_val_rec.SHIP_FROM_ADDRESS2
1266          , l_line_val_rec.SHIP_FROM_ADDRESS3
1267          , l_line_val_rec.SHIP_FROM_CITY
1268          , l_line_val_rec.SHIP_FROM_POSTAL_CODE
1269          , l_line_val_rec.SHIP_FROM_COUNTRY
1270         , l_line_val_rec.SHIP_FROM_REGION1
1271          , l_line_val_rec.SHIP_FROM_REGION2
1272          , l_line_val_rec.SHIP_FROM_REGION3
1273          , l_line_rec.SHIP_FROM_ADDRESS_ID
1274          , l_line_rec.SHIP_TO_ADDRESS_ID
1275          , l_line_val_rec.SHIP_TO_LOCATION
1276          , l_line_rec.service_reference_line
1277          , l_line_rec.service_reference_order
1278          , l_line_rec.service_reference_system
1279 --         , l_line_val_rec.order_source
1280          , l_line_rec.customer_line_number
1281          , l_line_rec.CUSTOMER_ITEM_NET_PRICE --bug#5733732
1282          , l_line_rec.user_item_description
1283          , p_ack_type
1284          , l_line_rec.blanket_number
1285          , l_line_rec.blanket_line_number
1286          , l_line_rec.original_inventory_item_id
1287 	 , l_line_rec.original_ordered_item_id
1288 	 , l_line_rec.original_ordered_item
1289 	 , l_line_rec.original_item_identifier_type
1290          , l_line_rec.item_relationship_type
1291          , l_error_flag
1292          , l_line_rec.customer_shipment_number
1293          -- { Distributer Order related change
1294         , l_line_rec.end_customer_id
1295         , l_line_rec.end_customer_contact_id
1296         , l_line_rec.end_customer_site_use_id
1297         , l_line_rec.ib_owner
1298         , l_line_rec.ib_current_location
1299         , l_line_rec.ib_installed_at_location
1300          -- Distributer Order related change }
1301         , l_line_rec.charge_periodicity_code
1302 	,l_line_val_rec.end_customer_name
1303         ,l_line_val_rec.end_customer_number
1304         ,l_line_val_rec.end_customer_contact
1305         ,l_line_val_rec.end_customer_site_address1
1306         ,l_line_val_rec.end_customer_site_address2
1307         ,l_line_val_rec.end_customer_site_address3
1308         ,l_line_val_rec.end_customer_site_address4
1309         ,l_line_val_rec.end_customer_site_city
1310         ,l_line_val_rec.end_customer_site_state
1311         ,l_line_val_rec.end_customer_site_postal_code
1312         ,l_line_val_rec.end_customer_site_country
1313 		--Sol_ord_er #16014165 start
1314 		, l_line_rec.SERVICE_BILL_PROFILE_ID
1315 		, l_line_rec.SERVICE_COV_TEMPLATE_ID
1316 		, l_line_rec.SERVICE_SUBS_TEMPLATE_ID
1317 		, l_line_val_rec.service_bill_option
1318 		, l_line_val_rec.service_bill_profile
1319 		, l_line_val_rec.service_cov_template
1320 		, l_line_val_rec.service_subs_template
1321 		, l_line_rec.SERVICE_BILL_OPTION_CODE
1322 		, l_line_rec.SERVICE_FIRST_PERIOD_AMOUNT
1323 		, l_line_rec.SUBSCRIPTION_ENABLE_FLAG
1324 		,l_line_rec.SERVICE_FIRST_PERIOD_ENDDATE
1325 		--Sol_ord_er #16014165 end
1326          );
1327       ELSE
1328         oe_debug_pub.add('Incomplete data for inserting line ack rec');
1329       END IF;
1330      <<nextline>>
1331      I := p_line_tbl.NEXT(I);
1332      END LOOP;
1333 
1334 EXCEPTION
1335 
1336     WHEN OTHERS THEN
1337 
1338         oe_debug_pub.Add('Encountered Others Error Exception in OE_Line_Ack_Util.Insert_Row: '||sqlerrm);
1339 
1340         IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
1341         THEN
1342             FND_MSG_PUB.Add_Exc_Msg
1343             (   G_PKG_NAME, 'OE_Line_Ack_Util.Insert_Row'
1344             );
1345         END IF;
1346 
1347         RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
1348 
1349 END Insert_Row;
1350 
1351 
1352 Procedure Extend_Line_Rec
1353  (p_line_rec           In Out Nocopy OE_Update_Ack_Util.Line_Rec_Type,
1354   p_count              In Number)
1355 
1356 Is
1357 
1358   l_debug_level        CONSTANT NUMBER := oe_debug_pub.g_debug_level;
1359 
1360 Begin
1361   oe_debug_pub.add('Entering Extend_Line_Rec');
1362 
1363   p_line_rec.line_id.extend(p_count);
1364   p_line_rec.header_id.extend(p_count);
1365   p_line_rec.ship_to_org_id.extend(p_count);
1366   p_line_rec.invoice_to_org_id.extend(p_count);
1367   p_line_rec.invoice_to_contact_id.extend(p_count);
1368   p_line_rec.ship_from_org_id.extend(p_count);
1369   p_line_rec.agreement_id.extend(p_count);
1370   p_line_rec.price_list_id.extend(p_count);
1371   p_line_rec.arrival_set_id.extend(p_count);
1372   p_line_rec.accounting_rule_id.extend(p_count);
1373   p_line_rec.fulfillment_set_id.extend(p_count);
1374   p_line_rec.inventory_item.extend(p_count);   --added for bug4309609
1375   p_line_rec.inventory_item_id.extend(p_count);
1376   p_line_rec.invoicing_rule_id.extend(p_count);
1377   p_line_rec.line_type_id.extend(p_count);
1378   p_line_rec.order_source_id.extend(p_count);
1379   p_line_rec.payment_term_id.extend(p_count);
1380   p_line_rec.project_id.extend(p_count);
1381   p_line_rec.salesrep_id.extend(p_count);
1382   p_line_rec.ship_set_id.extend(p_count);
1383   p_line_rec.ship_to_contact_id.extend(p_count);
1384   p_line_rec.task_id.extend(p_count);
1385   p_line_rec.fob_point_code.extend(p_count);
1386   p_line_rec.freight_terms_code.extend(p_count);
1387   p_line_rec.shipping_method_code.extend(p_count);
1388   p_line_rec.tax_code.extend(p_count);
1389   p_line_rec.tax_point_code.extend(p_count);
1390   p_line_rec.tax_exempt_reason_code.extend(p_count);
1391   p_line_rec.first_ack_code.extend(p_count);
1392 
1393   p_line_rec.accounting_rule_duration.extend(p_count);
1394   p_line_rec.actual_arrival_date.extend(p_count);
1395   p_line_rec.actual_shipment_date.extend(p_count);
1396   p_line_rec.ato_line_id.extend(p_count);
1397   p_line_rec.authorized_to_ship_flag.extend(p_count);
1398   p_line_rec.booked_flag.extend(p_count);
1399   p_line_rec.cancelled_flag.extend(p_count);
1400   p_line_rec.cancelled_quantity.extend(p_count);
1401   p_line_rec.change_sequence.extend(p_count);
1402   p_line_rec.component_code.extend(p_count);
1403   p_line_rec.component_number.extend(p_count);
1404   p_line_rec.component_sequence_id.extend(p_count);
1405   p_line_rec.config_display_sequence.extend(p_count);
1406   p_line_rec.configuration_id.extend(p_count);
1407   p_line_rec.top_model_line_id.extend(p_count);
1408   p_line_rec.created_by.extend(p_count);
1409   p_line_rec.creation_date.extend(p_count);
1410   p_line_rec.cust_model_serial_number.extend(p_count);
1411   p_line_rec.cust_po_number.extend(p_count);
1412   p_line_rec.cust_production_seq_num.extend(p_count);
1413   p_line_rec.customer_dock_code.extend(p_count);
1414   p_line_rec.ordered_item.extend(p_count);
1415   p_line_rec.ordered_item_id.extend(p_count); /* Bug # 4761560 */
1416   p_line_rec.customer_job.extend(p_count);
1417   p_line_rec.customer_production_line.extend(p_count);
1418   p_line_rec.customer_trx_line_id.extend(p_count);
1419   p_line_rec.deliver_to_contact_id.extend(p_count);
1420   p_line_rec.deliver_to_org_id.extend(p_count);
1421   p_line_rec.delivery_lead_time.extend(p_count);
1422   p_line_rec.demand_bucket_type_code.extend(p_count);
1423   p_line_rec.demand_class_code.extend(p_count);
1424   p_line_rec.dep_plan_required_flag.extend(p_count);
1425   p_line_rec.earliest_acceptable_date.extend(p_count);
1426   p_line_rec.explosion_date.extend(p_count);
1427   p_line_rec.freight_carrier_code.extend(p_count);
1428   p_line_rec.fulfilled_quantity.extend(p_count);
1429   p_line_rec.item_revision.extend(p_count);
1430   p_line_rec.item_identifier_type.extend(p_count);
1431   p_line_rec.context.extend(p_count);
1432   p_line_rec.first_ack_date.extend(p_count);
1433   p_line_rec.last_ack_code.extend(p_count);
1434   p_line_rec.last_ack_date.extend(p_count);
1435 
1436   p_line_rec.last_update_date.extend(p_count);
1437   p_line_rec.last_update_login.extend(p_count);
1438   p_line_rec.last_updated_by.extend(p_count);
1439   p_line_rec.latest_acceptable_date.extend(p_count);
1440   p_line_rec.line_category_code.extend(p_count);
1441   p_line_rec.line_number.extend(p_count);
1442   p_line_rec.link_to_line_id.extend(p_count);
1443   p_line_rec.model_group_number.extend(p_count);
1444   p_line_rec.open_flag.extend(p_count);
1445   p_line_rec.operation_code.extend(p_count);
1446   p_line_rec.option_flag.extend(p_count);
1447   p_line_rec.option_number.extend(p_count);
1448   p_line_rec.order_quantity_uom.extend(p_count);
1449   p_line_rec.ordered_quantity.extend(p_count);
1450   p_line_rec.org_id.extend(p_count);
1451   p_line_rec.orig_sys_document_ref.extend(p_count);
1452   p_line_rec.orig_sys_line_ref.extend(p_count);
1453   p_line_rec.orig_sys_shipment_ref.extend(p_count);
1454   p_line_rec.over_ship_reason_code.extend(p_count);
1455   p_line_rec.over_ship_resolved_flag.extend(p_count);
1456   p_line_rec.pricing_date.extend(p_count);
1457   p_line_rec.pricing_quantity.extend(p_count);
1458   p_line_rec.pricing_quantity_uom.extend(p_count);
1459   p_line_rec.program_application_id.extend(p_count);
1460   p_line_rec.program_id.extend(p_count);
1461   p_line_rec.program_update_date.extend(p_count);
1462   p_line_rec.promise_date.extend(p_count);
1463   p_line_rec.reference_header_id.extend(p_count);
1464   p_line_rec.reference_line_id.extend(p_count);
1465   p_line_rec.reference_type.extend(p_count);
1466   p_line_rec.request_date.extend(p_count);
1467   p_line_rec.request_id.extend(p_count);
1468   p_line_rec.reserved_quantity.extend(p_count);
1469   p_line_rec.return_reason_code.extend(p_count);
1470   p_line_rec.rla_schedule_type_code.extend(p_count);
1471   p_line_rec.schedule_arrival_date.extend(p_count);
1472   p_line_rec.schedule_ship_date.extend(p_count);
1473   p_line_rec.schedule_status_code.extend(p_count);
1474   p_line_rec.ship_model_complete_flag.extend(p_count);
1475   p_line_rec.ship_tolerance_above.extend(p_count);
1476   p_line_rec.ship_tolerance_below.extend(p_count);
1477   p_line_rec.shipment_number.extend(p_count);
1478   p_line_rec.shipment_priority_code.extend(p_count);
1479   p_line_rec.shipped_quantity.extend(p_count);
1480   p_line_rec.SHIPPING_METHOD_CODE.extend(p_count);
1481   p_line_rec.SHIPPING_QUANTITY.extend(p_count);
1482   p_line_rec.SHIPPING_QUANTITY_UOM.extend(p_count);
1483   p_line_rec.SOLD_TO_ORG_ID.extend(p_count);
1484   p_line_rec.SORT_ORDER.extend(p_count);
1485   p_line_rec.SOURCE_DOCUMENT_ID.extend(p_count);
1486   p_line_rec.SOURCE_DOCUMENT_LINE_ID.extend(p_count);
1487   p_line_rec.SOURCE_DOCUMENT_TYPE_ID.extend(p_count);
1488   p_line_rec.SOURCE_TYPE_CODE.extend(p_count);
1489   p_line_rec.SPLIT_FROM_LINE_ID.extend(p_count);
1490   p_line_rec.TAX_CODE.extend(p_count);
1491   p_line_rec.TAX_DATE.extend(p_count);
1492   p_line_rec.TAX_EXEMPT_FLAG.extend(p_count);
1493   p_line_rec.TAX_EXEMPT_NUMBER.extend(p_count);
1494   p_line_rec.TAX_EXEMPT_REASON_CODE.extend(p_count);
1495   p_line_rec.TAX_POINT_CODE.extend(p_count);
1496   p_line_rec.TAX_RATE.extend(p_count);
1497   p_line_rec.TAX_VALUE.extend(p_count);
1498   p_line_rec.UNIT_LIST_PRICE.extend(p_count);
1499   p_line_rec.UNIT_SELLING_PRICE.extend(p_count);
1500   p_line_rec.VEH_CUS_ITEM_CUM_KEY_ID.extend(p_count);
1501   p_line_rec.VISIBLE_DEMAND_FLAG.extend(p_count);
1502   p_line_rec.split_from_line_ref.extend(p_count);
1503   p_line_rec.split_from_shipment_ref.extend(p_count);
1504   p_line_rec.Service_Txn_Reason_Code.extend(p_count);
1505   p_line_rec.Service_Txn_Comments.extend(p_count);
1506   p_line_rec.Service_Duration.extend(p_count);
1507   p_line_rec.Service_Start_Date.extend(p_count);
1508   p_line_rec.Service_End_Date.extend(p_count);
1509   p_line_rec.Service_Coterminate_Flag.extend(p_count);
1510   p_line_rec.Service_Number.extend(p_count);
1511   p_line_rec.Service_Period.extend(p_count);
1512   p_line_rec.Service_Reference_Type_Code.extend(p_count);
1513   p_line_rec.service_Reference_Line_Id.extend(p_count);
1514   p_line_rec.Service_Reference_System_Id.extend(p_count);
1515   p_line_rec.Credit_Invoice_Line_Id.extend(p_count);
1516   p_line_rec.service_reference_line.extend(p_count);
1517   p_line_rec.service_reference_order.extend(p_count);
1518   p_line_rec.service_reference_system.extend(p_count);
1519   p_line_rec.customer_line_number.extend(p_count);
1520   p_line_rec.user_item_description.extend(p_count);
1521   p_line_rec.acknowledgment_type.extend(p_count);
1522   p_line_rec.blanket_number.extend(p_count);
1523   p_line_rec.blanket_line_number.extend(p_count);
1524   p_line_rec.original_inventory_item_id.extend(p_count);
1525   p_line_rec.original_ordered_item_id.extend(p_count);
1526   p_line_rec.original_ordered_item.extend(p_count);
1527   p_line_rec.original_item_identifier_type.extend(p_count);
1528   p_line_rec.item_relationship_type.extend(p_count);
1529   p_line_rec.attribute1.extend(p_count);
1530   p_line_rec.attribute10.extend(p_count);
1531  p_line_rec.attribute11.extend(p_count);
1532  p_line_rec.attribute12.extend(p_count);
1533  p_line_rec.attribute13.extend(p_count);
1534  p_line_rec.attribute14.extend(p_count);
1535  p_line_rec.attribute15.extend(p_count);
1536  p_line_rec.attribute16.extend(p_count);
1537  p_line_rec.attribute17.extend(p_count);
1538  p_line_rec.attribute18.extend(p_count);
1539  p_line_rec.attribute19.extend(p_count);
1540  p_line_rec.attribute2.extend(p_count);
1541  p_line_rec.attribute20.extend(p_count);
1542  p_line_rec.attribute3.extend(p_count);
1543  p_line_rec.attribute4.extend(p_count);
1544  p_line_rec.attribute5.extend(p_count);
1545  p_line_rec.attribute6.extend(p_count);
1546  p_line_rec.attribute7.extend(p_count);
1547  p_line_rec.attribute8.extend(p_count);
1548  p_line_rec.attribute9.extend(p_count);
1549  p_line_rec.global_attribute1.extend(p_count);
1550  p_line_rec.global_attribute10.extend(p_count);
1551  p_line_rec.global_attribute11.extend(p_count);
1552  p_line_rec.global_attribute12.extend(p_count);
1553  p_line_rec.global_attribute13.extend(p_count);
1554  p_line_rec.global_attribute14.extend(p_count);
1555  p_line_rec.global_attribute15.extend(p_count);
1556  p_line_rec.global_attribute16.extend(p_count);
1557  p_line_rec.global_attribute17.extend(p_count);
1558  p_line_rec.global_attribute18.extend(p_count);
1559  p_line_rec.global_attribute19.extend(p_count);
1560  p_line_rec.global_attribute2.extend(p_count);
1561  p_line_rec.global_attribute20.extend(p_count);
1562  p_line_rec.global_attribute3.extend(p_count);
1563  p_line_rec.global_attribute4.extend(p_count);
1564  p_line_rec.global_attribute5.extend(p_count);
1565  p_line_rec.global_attribute6.extend(p_count);
1566  p_line_rec.global_attribute7.extend(p_count);
1567  p_line_rec.global_attribute8.extend(p_count);
1568  p_line_rec.global_attribute9.extend(p_count);
1569  p_line_rec.global_attribute_category.extend(p_count);
1570  p_line_rec.industry_attribute1.extend(p_count);
1571  p_line_rec.industry_attribute10.extend(p_count);
1572  p_line_rec.industry_attribute11.extend(p_count);
1573  p_line_rec.industry_attribute12.extend(p_count);
1574  p_line_rec.industry_attribute13.extend(p_count);
1575  p_line_rec.industry_attribute14.extend(p_count);
1576  p_line_rec.industry_attribute15.extend(p_count);
1577  p_line_rec.industry_attribute16.extend(p_count);
1578  p_line_rec.industry_attribute17.extend(p_count);
1579  p_line_rec.industry_attribute18.extend(p_count);
1580  p_line_rec.industry_attribute19.extend(p_count);
1581  p_line_rec.industry_attribute20.extend(p_count);
1582  p_line_rec.industry_attribute21.extend(p_count);
1583  p_line_rec.industry_attribute22.extend(p_count);
1584  p_line_rec.industry_attribute23.extend(p_count);
1585  p_line_rec.industry_attribute24.extend(p_count);
1586  p_line_rec.industry_attribute25.extend(p_count);
1587  p_line_rec.industry_attribute26.extend(p_count);
1588  p_line_rec.industry_attribute27.extend(p_count);
1589  p_line_rec.industry_attribute28.extend(p_count);
1590  p_line_rec.industry_attribute29.extend(p_count);
1591  p_line_rec.industry_attribute30.extend(p_count);
1592  p_line_rec.industry_attribute2.extend(p_count);
1593  p_line_rec.industry_attribute3.extend(p_count);
1594  p_line_rec.industry_attribute4.extend(p_count);
1595  p_line_rec.industry_attribute5.extend(p_count);
1596  p_line_rec.industry_attribute6.extend(p_count);
1597  p_line_rec.industry_attribute7.extend(p_count);
1598  p_line_rec.industry_attribute8.extend(p_count);
1599  p_line_rec.industry_attribute9.extend(p_count);
1600  p_line_rec.industry_context.extend(p_count);
1601  p_line_rec.TP_CONTEXT.extend(p_count);
1602  p_line_rec.TP_ATTRIBUTE1.extend(p_count);
1603  p_line_rec.TP_ATTRIBUTE2.extend(p_count);
1604  p_line_rec.TP_ATTRIBUTE3.extend(p_count);
1605  p_line_rec.TP_ATTRIBUTE4.extend(p_count);
1606  p_line_rec.TP_ATTRIBUTE5.extend(p_count);
1607  p_line_rec.TP_ATTRIBUTE6.extend(p_count);
1608  p_line_rec.TP_ATTRIBUTE7.extend(p_count);
1609  p_line_rec.TP_ATTRIBUTE8.extend(p_count);
1610  p_line_rec.TP_ATTRIBUTE9.extend(p_count);
1611  p_line_rec.TP_ATTRIBUTE10.extend(p_count);
1612  p_line_rec.TP_ATTRIBUTE11.extend(p_count);
1613  p_line_rec.TP_ATTRIBUTE12.extend(p_count);
1614  p_line_rec.TP_ATTRIBUTE13.extend(p_count);
1615  p_line_rec.TP_ATTRIBUTE14.extend(p_count);
1616  p_line_rec.TP_ATTRIBUTE15.extend(p_count);
1617  p_line_rec.pricing_attribute1.extend(p_count);
1618  p_line_rec.pricing_attribute10.extend(p_count);
1619  p_line_rec.pricing_attribute2.extend(p_count);
1620  p_line_rec.pricing_attribute3.extend(p_count);
1621  p_line_rec.pricing_attribute4.extend(p_count);
1622  p_line_rec.pricing_attribute5.extend(p_count);
1623  p_line_rec.pricing_attribute6.extend(p_count);
1624  p_line_rec.pricing_attribute7.extend(p_count);
1625  p_line_rec.pricing_attribute8.extend(p_count);
1626  p_line_rec.pricing_attribute9.extend(p_count);
1627  p_line_rec.pricing_context.extend(p_count);
1628  p_line_rec.return_attribute1.extend(p_count);
1629  p_line_rec.return_attribute10.extend(p_count);
1630  p_line_rec.return_attribute11.extend(p_count);
1631  p_line_rec.return_attribute12.extend(p_count);
1632  p_line_rec.return_attribute13.extend(p_count);
1633  p_line_rec.return_attribute14.extend(p_count);
1634  p_line_rec.return_attribute15.extend(p_count);
1635  p_line_rec.return_attribute2.extend(p_count);
1636  p_line_rec.return_attribute3.extend(p_count);
1637  p_line_rec.return_attribute4.extend(p_count);
1638  p_line_rec.return_attribute5.extend(p_count);
1639  p_line_rec.return_attribute6.extend(p_count);
1640  p_line_rec.return_attribute7.extend(p_count);
1641  p_line_rec.return_attribute8.extend(p_count);
1642  p_line_rec.return_attribute9.extend(p_count);
1643  p_line_rec.return_context.extend(p_count);
1644  p_line_rec.customer_shipment_number.extend(p_count);
1645 -- { Distributer Order related change
1646  p_line_rec.end_customer_id.extend(p_count);
1647  p_line_rec.end_customer_contact_id.extend(p_count);
1648  p_line_rec.end_customer_site_use_id.extend(p_count);
1649  p_line_rec.ib_owner.extend(p_count);
1650  p_line_rec.ib_current_location.extend(p_count);
1651  p_line_rec.ib_installed_at_location.extend(p_count);
1652 -- Distributer Order related change }
1653  p_line_rec.charge_periodicity_code.extend(p_count);
1654 --Sol_ord_er #16014165 start
1655 p_line_rec.SERVICE_BILL_PROFILE_ID.extend(p_count);
1656 p_line_rec.SERVICE_COV_TEMPLATE_ID.extend(p_count);
1657 p_line_rec.SERVICE_SUBS_TEMPLATE_ID.extend(p_count);
1658 p_line_rec.SERVICE_BILL_OPTION_CODE.extend(p_count);
1659 p_line_rec.SERVICE_FIRST_PERIOD_AMOUNT.extend(p_count);
1660 p_line_rec.SUBSCRIPTION_ENABLE_FLAG.extend(p_count);
1661 p_line_rec.SERVICE_FIRST_PERIOD_ENDDATE.extend(p_count);
1662 --Sol_ord_er #16014165 end
1663   oe_debug_pub.add('Exiting Extend_Line_Rec');
1664 
1665 Exception
1666   When Others Then
1667     If l_debug_level > 0 Then
1668       Oe_Debug_Pub.Add('When Others in Extend_Line_Rec');
1669       Oe_Debug_Pub.Add('Error: '||sqlerrm);
1670     End If;
1671 
1672 End Extend_Line_Rec;
1673 
1674 
1675 Procedure Insert_Row
1676 ( p_line_tbl             In  OE_Order_Pub.Line_Tbl_Type,
1677   p_old_line_tbl         In  OE_Order_Pub.Line_Tbl_Type,
1678   x_return_status        Out NOCOPY /* file.sql.39 change */ Varchar2
1679 )
1680 
1681 Is
1682 
1683   l_line_tbl            OE_Order_Pub.Line_Tbl_Type := p_line_tbl;
1684   l_line_acks_rec       OE_Update_Ack_Util.Line_Rec_Type;
1685   l_count               Number;
1686   i                     Pls_Integer;
1687   k                     Pls_Integer := 0;
1688   l_ack_type            Varchar2(30);
1689   l_validation_org_id   number; -- bug 4309609
1690 Begin
1691 
1692   l_count     := l_line_tbl.Count;
1693   i           := l_line_tbl.First;
1694 
1695   While i Is Not Null Loop
1696     If (nvl(l_line_tbl(i).FIRST_ACK_CODE, ' ')= ' ' OR
1697         l_line_tbl(i).FIRST_ACK_CODE = FND_API.G_MISS_CHAR) Then
1698       -- Trans is 855
1699       --l_ack_type := '855'; for bug4730258
1700       If l_line_tbl(i).schedule_ship_date Is Null Then
1701         l_line_tbl(i).first_ack_code := 'SP';
1702       End If;
1703       If l_line_tbl(i).schedule_ship_date Is Not Null And
1704          trunc (l_line_tbl(i).schedule_ship_date) <> nvl(trunc (l_line_tbl(i).Request_date),FND_API.G_MISS_DATE) Then
1705         l_line_tbl(i).first_ack_code := 'DR';
1706       End If;
1707       If l_line_tbl(i).ordered_quantity <> p_old_line_tbl(i).ordered_quantity Then
1708         If l_line_tbl(i).first_ack_code Is Null Or
1709            l_line_tbl(i).first_ack_code = FND_API.G_MISS_CHAR Then
1710           l_line_tbl(i).first_ack_code := 'IQ';
1711         Else
1712           l_line_tbl(i).first_ack_code := 'IC';
1713         End If;
1714       End If;
1715       -- Added for bug 4771523 start
1716       If l_line_tbl(i).unit_selling_price <> p_old_line_tbl(i).unit_selling_price Then
1717         l_line_tbl(i).first_ack_code := 'IP';
1718       End If;
1719       IF OE_ORDER_UTIL.g_line_tbl(I).customer_item_net_price IS NOT NULL
1720       AND OE_ORDER_UTIL.g_line_tbl(I).customer_item_net_price <> FND_API.G_MISS_NUM THEN
1721          oe_debug_pub.add(' Global Unit_Selling_Price : '||OE_ORDER_UTIL.g_line_tbl(I).unit_selling_price,5);
1722          oe_debug_pub.add(' Global CUSTOMER_ITEM_NET_PRICE : '||OE_ORDER_UTIL.g_line_tbl(I).CUSTOMER_ITEM_NET_PRICE,5);
1723          IF OE_ORDER_UTIL.g_line_tbl(I).customer_item_net_price <> OE_ORDER_UTIL.g_line_tbl(I).unit_selling_price THEN
1724            l_line_tbl(i).FIRST_ACK_CODE := 'IP';
1725            oe_debug_pub.add(' ack code: price changed : '||l_line_tbl(i).FIRST_ACK_CODE,5);
1726          END IF;
1727          oe_debug_pub.add(' new unit selling price: ' || l_line_tbl(i).unit_selling_price,5);
1728          oe_debug_pub.add(' old unit selling price: ' || p_old_line_tbl(i).unit_selling_price,5);
1729       END IF;
1730       -- Added for bug 4771523 end
1731 
1732 
1733       If l_line_tbl(i).ORIGINAL_INVENTORY_ITEM_ID is NOT NULL Then
1734         If (l_line_tbl(i).ITEM_RELATIONSHIP_TYPE Is Null
1735           OR l_line_tbl(i).ITEM_RELATIONSHIP_TYPE = 2
1736           OR l_line_tbl(i).ITEM_RELATIONSHIP_TYPE = 4
1737           OR l_line_tbl(i).ITEM_RELATIONSHIP_TYPE = 8
1738           OR l_line_tbl(i).ITEM_RELATIONSHIP_TYPE = 14) Then
1739           If l_line_tbl(i).FIRST_ACK_CODE Is Null Or
1740              l_line_tbl(i).FIRST_ACK_CODE = FND_API.G_MISS_CHAR Then
1741             l_line_tbl(i).FIRST_ACK_CODE := 'IS';
1742           Else
1743             l_line_tbl(i).FIRST_ACK_CODE := 'IC';
1744           End If;
1745         Else
1746           If l_line_tbl(i).FIRST_ACK_CODE Is Null Or
1747              l_line_tbl(i).FIRST_ACK_CODE = FND_API.G_MISS_CHAR Then
1748             l_line_tbl(i).FIRST_ACK_CODE := 'IA';
1749           End If;
1750         End If;
1751       End If;
1752 
1753       If l_line_tbl(i).SPLIT_FROM_LINE_ID Is Not Null  And
1754          l_line_tbl(i).split_by = 'SYSTEM' Then
1755         l_line_tbl(i).FIRST_ACK_CODE := 'IB';
1756       End If;
1757 
1758       If l_line_tbl(i).OPEN_FLAG = 'N'  Then
1759         l_line_tbl(i).FIRST_ACK_CODE := 'ID';
1760       End If;
1761 
1762       If l_line_tbl(i).FIRST_ACK_CODE Is Null Or
1763          l_line_tbl(i).FIRST_ACK_CODE = FND_API.G_MISS_CHAR Then
1764         l_line_tbl(i).FIRST_ACK_CODE := 'IA';
1765       Elsif l_line_tbl(i).FIRST_ACK_CODE Is Not Null Then
1766         Update_Header_Ack_Code (l_line_tbl(i).header_id, 'AC', NULL);
1767       End If;
1768       l_line_tbl(i).FIRST_ACK_DATE := '';
1769       l_line_tbl(i).LAST_ACK_CODE  := '';
1770       l_line_tbl(i).LAST_ACK_DATE  := '';
1771 
1772     Else -- 865
1773       IF l_line_tbl(i).changed_lines_pocao = 'N' THEN
1774         GOTO nextline;
1775       End If;
1776       --l_ack_type := '865'; for bug4730258
1777       l_line_tbl(i).FIRST_ACK_DATE := p_old_line_tbl(I).FIRST_ACK_DATE;
1778       If l_line_tbl(i).SCHEDULE_SHIP_DATE Is Null Then
1779         l_line_tbl(i).LAST_ACK_CODE := 'SP';
1780       End If;
1781       If l_line_tbl(i).SCHEDULE_SHIP_DATE Is Not Null And
1782          l_line_tbl(i).schedule_ship_date <> nvl(p_old_line_tbl(I).schedule_ship_date,FND_API.G_MISS_DATE) And
1783          l_line_tbl(i).schedule_ship_date <> nvl(l_line_tbl(i).REQUEST_DATE, FND_API.G_MISS_DATE) Then
1784         l_line_tbl(i).LAST_ACK_CODE := 'DR';
1785       End If;
1786 
1787       -- Added for bug 4771523
1788       If l_line_tbl(i).unit_selling_price <> p_old_line_tbl(i).unit_selling_price Then
1789         l_line_tbl(i).LAST_ACK_CODE := 'IP';
1790       End If;
1791       IF OE_ORDER_UTIL.g_line_tbl(I).customer_item_net_price IS NOT NULL
1792       AND OE_ORDER_UTIL.g_line_tbl(I).customer_item_net_price <> FND_API.G_MISS_NUM THEN
1793          oe_debug_pub.add(' Global Unit_Selling_Price : '||OE_ORDER_UTIL.g_line_tbl(I).unit_selling_price,5);
1794          oe_debug_pub.add(' Global CUSTOMER_ITEM_NET_PRICE : '||OE_ORDER_UTIL.g_line_tbl(I).CUSTOMER_ITEM_NET_PRICE,5);
1795          IF OE_ORDER_UTIL.g_line_tbl(I).customer_item_net_price <> OE_ORDER_UTIL.g_line_tbl(I).unit_selling_price THEN
1796            l_line_tbl(i).LAST_ACK_CODE := 'IP';
1797            oe_debug_pub.add(' ack code: price changed : '||l_line_tbl(i).FIRST_ACK_CODE,5);
1798          END IF;
1799          oe_debug_pub.add(' new unit selling price: ' || l_line_tbl(i).unit_selling_price,5);
1800          oe_debug_pub.add(' old unit selling price: ' || p_old_line_tbl(i).unit_selling_price,5);
1801       END IF;
1802       -- Added for bug 4771523
1803 
1804       If l_line_tbl(i).ORDERED_QUANTITY <> p_old_line_tbl(I).ORDERED_QUANTITY Then
1805         If l_line_tbl(i).LAST_ACK_CODE Is Null Or
1806            l_line_tbl(i).LAST_ACK_CODE = FND_API.G_MISS_CHAR Then
1807           l_line_tbl(i).LAST_ACK_CODE := 'IQ';
1808         Else
1809           l_line_tbl(i).LAST_ACK_CODE := 'IC';
1810         End If;
1811       End If;
1812       If l_line_tbl(i).SPLIT_FROM_LINE_ID Is Not Null And
1813          l_line_tbl(i).split_by = 'SYSTEM' Then
1814         l_line_tbl(i).LAST_ACK_CODE := 'IB';
1815       End If;
1816       If l_line_tbl(i).OPEN_FLAG = 'N'  Then
1817         l_line_tbl(i).LAST_ACK_CODE := 'ID';
1818       End If;
1819 
1820       If l_line_tbl(i).LAST_ACK_CODE Is Null Or
1821          l_line_tbl(i).LAST_ACK_CODE = FND_API.G_MISS_CHAR Then
1822         l_line_tbl(i).LAST_ACK_CODE := 'IA';
1823       End If;
1824 
1825       l_line_tbl(i).LAST_ACK_DATE := '';
1826 
1827     End If;
1828 
1829     If l_line_tbl(i).split_from_line_id Is Not Null And
1830        l_line_tbl(i).split_from_line_id <> FND_API.G_MISS_NUM Then
1831          --bsadri get the split reference
1832        Begin
1833          Select orig_sys_line_ref, orig_sys_shipment_ref
1834          Into   l_line_tbl(i).split_from_line_ref, l_line_tbl(i).split_from_shipment_ref
1835          From   OE_ORDER_LINES
1836          Where  line_id = l_line_tbl(i).split_from_line_id;
1837        Exception
1838          When Others Then
1839            Null;
1840        End;
1841     End If;
1842 
1843     -- Assign to collection
1844     Extend_Line_Rec
1845      (p_line_rec      => l_line_acks_rec,
1846       p_count         => 1);
1847 
1848     k := k +1;
1849     l_line_acks_rec.line_id(k)                 := l_line_tbl(i).line_id;
1850     l_line_acks_rec.header_id(k)               := l_line_tbl(i).header_id;
1851 
1852     l_line_acks_rec.ship_to_org_id(k)          := l_line_tbl(i).ship_to_org_id;
1853     l_line_acks_rec.invoice_to_org_id(k)       := l_line_tbl(i).invoice_to_org_id;
1854     l_line_acks_rec.invoice_to_contact_id(k)   := l_line_tbl(i).invoice_to_contact_id;
1855     l_line_acks_rec.ship_from_org_id(k)        := l_line_tbl(i).ship_from_org_id;
1856     l_line_acks_rec.agreement_id(k)            := l_line_tbl(i).agreement_id;
1857     l_line_acks_rec.price_list_id(k)           := l_line_tbl(i).price_list_id;
1858     l_line_acks_rec.arrival_set_id(k)          := l_line_tbl(i).arrival_set_id;
1859     l_line_acks_rec.accounting_rule_id(k)      := l_line_tbl(i).accounting_rule_id;
1860     l_line_acks_rec.fulfillment_set_id(k)      := l_line_tbl(i).fulfillment_set_id;
1861     --Added for bug 4309609 start
1862     begin
1863        l_validation_org_id := OE_Sys_Parameters.VALUE('MASTER_ORGANIZATION_ID',l_line_tbl(i).org_id);
1864        SELECT concatenated_segments
1865            INTO l_line_acks_rec.inventory_item(k)
1866            FROM mtl_system_items_vl
1867           WHERE inventory_item_id = l_line_tbl(i).inventory_item_id
1868             AND organization_id = l_validation_org_id;
1869     exception
1870       when others then
1871            null;
1872     end ;
1873     --Added for bug 4309609 end
1874     l_line_acks_rec.inventory_item_id(k)       := l_line_tbl(i).inventory_item_id;
1875     l_line_acks_rec.invoicing_rule_id(k)       := l_line_tbl(i).invoicing_rule_id;
1876     l_line_acks_rec.line_type_id(k)            := l_line_tbl(i).line_type_id;
1877     l_line_acks_rec.order_source_id(k)         := l_line_tbl(i).order_source_id;
1878     l_line_acks_rec.payment_term_id(k)         := l_line_tbl(i).payment_term_id;
1879     l_line_acks_rec.project_id(k)              := l_line_tbl(i).project_id;
1880     l_line_acks_rec.salesrep_id(k)             := l_line_tbl(i).salesrep_id;
1881     l_line_acks_rec.ship_set_id(k)             := l_line_tbl(i).ship_set_id;
1882     l_line_acks_rec.ship_to_contact_id(k)      := l_line_tbl(i).ship_to_contact_id;
1883     l_line_acks_rec.task_id(k)                 := l_line_tbl(i).task_id;
1884     l_line_acks_rec.fob_point_code(k)          := l_line_tbl(i).fob_point_code;
1885     l_line_acks_rec.freight_terms_code(k)      := l_line_tbl(i).freight_terms_code;
1886     l_line_acks_rec.shipping_method_code(k)    := l_line_tbl(i).shipping_method_code;
1887     l_line_acks_rec.tax_code(k)                := l_line_tbl(i).tax_code;
1888     l_line_acks_rec.tax_point_code(k)          := l_line_tbl(i).tax_point_code;
1889     l_line_acks_rec.tax_exempt_reason_code(k)  := l_line_tbl(i).tax_exempt_reason_code;
1890     l_line_acks_rec.first_ack_code(k)          := l_line_tbl(i).first_ack_code;
1891 
1892   l_line_acks_rec.accounting_rule_duration(k) := l_line_tbl(i).accounting_rule_duration;
1893   l_line_acks_rec.actual_arrival_date(k)      := l_line_tbl(i).actual_arrival_date;
1894 --
1895   l_line_acks_rec.actual_shipment_date(k)     := l_line_tbl(i).actual_shipment_date;
1896   l_line_acks_rec.ato_line_id(k)              := l_line_tbl(i).ato_line_id;
1897   l_line_acks_rec.authorized_to_ship_flag(k) := l_line_tbl(i).authorized_to_ship_flag;
1898   l_line_acks_rec.booked_flag(k) := l_line_tbl(i).booked_flag;
1899   l_line_acks_rec.cancelled_flag(k) := l_line_tbl(i).cancelled_flag;
1900   l_line_acks_rec.cancelled_quantity(k) := l_line_tbl(i).cancelled_quantity;
1901   l_line_acks_rec.change_sequence(k) := l_line_tbl(i).change_sequence;
1902   l_line_acks_rec.component_code(k) := l_line_tbl(i).component_code;
1903   l_line_acks_rec.component_number(k) := l_line_tbl(i).component_number;
1904   l_line_acks_rec.component_sequence_id(k) := l_line_tbl(i).component_sequence_id;
1905   l_line_acks_rec.config_display_sequence(k) := l_line_tbl(i).config_display_sequence;
1906   l_line_acks_rec.configuration_id(k) := l_line_tbl(i).configuration_id;
1907   l_line_acks_rec.top_model_line_id(k) := l_line_tbl(i).top_model_line_id;
1908   l_line_acks_rec.created_by(k) := l_line_tbl(i).created_by;
1909   l_line_acks_rec.creation_date(k) := l_line_tbl(i).creation_date;
1910   l_line_acks_rec.cust_model_serial_number(k) := l_line_tbl(i).cust_model_serial_number;
1911   l_line_acks_rec.cust_po_number(k) := l_line_tbl(i).cust_po_number;
1912   l_line_acks_rec.cust_production_seq_num(k) := l_line_tbl(i).cust_production_seq_num;
1913   l_line_acks_rec.customer_dock_code(k) := l_line_tbl(i).customer_dock_code;
1914   l_line_acks_rec.ordered_item(k) := l_line_tbl(i).ordered_item;
1915   l_line_acks_rec.ordered_item_id(k) := l_line_tbl(i).ordered_item_id; /* Bug # 4761560 */
1916   l_line_acks_rec.customer_job(k) := l_line_tbl(i).customer_job;
1917 --
1918   l_line_acks_rec.customer_production_line(k) := l_line_tbl(i).customer_production_line;
1919   l_line_acks_rec.customer_trx_line_id(k) := l_line_tbl(i).customer_trx_line_id;
1920   l_line_acks_rec.deliver_to_contact_id(k) := l_line_tbl(i).deliver_to_contact_id;
1921   l_line_acks_rec.deliver_to_org_id(k) := l_line_tbl(i).deliver_to_org_id;
1922   l_line_acks_rec.delivery_lead_time(k) := l_line_tbl(i).delivery_lead_time;
1923   l_line_acks_rec.demand_bucket_type_code(k) := l_line_tbl(i).demand_bucket_type_code;
1924   l_line_acks_rec.demand_class_code(k) := l_line_tbl(i).demand_class_code;
1925   l_line_acks_rec.dep_plan_required_flag(k) := l_line_tbl(i).dep_plan_required_flag;
1926   l_line_acks_rec.earliest_acceptable_date(k) := l_line_tbl(i).earliest_acceptable_date;
1927   l_line_acks_rec.explosion_date(k) := l_line_tbl(i).explosion_date;
1928   l_line_acks_rec.freight_carrier_code(k) := l_line_tbl(i).freight_carrier_code;
1929   l_line_acks_rec.fulfilled_quantity(k) := l_line_tbl(i).fulfilled_quantity;
1930   l_line_acks_rec.item_revision(k) := l_line_tbl(i).item_revision;
1931   l_line_acks_rec.item_identifier_type(k) := l_line_tbl(i).item_identifier_type;
1932   l_line_acks_rec.context(k) := l_line_tbl(i).context;
1933   l_line_acks_rec.first_ack_date(k) := l_line_tbl(i).first_ack_date;
1934   l_line_acks_rec.last_ack_code(k) := l_line_tbl(i).last_ack_code;
1935   l_line_acks_rec.last_ack_date(k) := l_line_tbl(i).last_ack_date;
1936 
1937   l_line_acks_rec.last_update_date(k) := l_line_tbl(i).last_update_date;
1938   l_line_acks_rec.last_update_login(k) := l_line_tbl(i).last_update_login;
1939   l_line_acks_rec.last_updated_by(k) := l_line_tbl(i).last_updated_by;
1940   l_line_acks_rec.latest_acceptable_date(k) := l_line_tbl(i).latest_acceptable_date;
1941   l_line_acks_rec.line_category_code(k) := l_line_tbl(i).line_category_code;
1942   l_line_acks_rec.line_number(k) := l_line_tbl(i).line_number;
1943   l_line_acks_rec.link_to_line_id(k) := l_line_tbl(i).link_to_line_id;
1944   l_line_acks_rec.model_group_number(k) := l_line_tbl(i).model_group_number;
1945   l_line_acks_rec.open_flag(k) := l_line_tbl(i).open_flag;
1946   l_line_acks_rec.operation_code(k) := l_line_tbl(i).operation;
1947   l_line_acks_rec.option_flag(k) := l_line_tbl(i).option_flag;
1948   l_line_acks_rec.option_number(k) := l_line_tbl(i).option_number;
1949   l_line_acks_rec.order_quantity_uom(k) := l_line_tbl(i).order_quantity_uom;
1950   l_line_acks_rec.ordered_quantity(k) := l_line_tbl(i).ordered_quantity;
1951   l_line_acks_rec.org_id(k) := l_line_tbl(i).org_id;
1952   l_line_acks_rec.orig_sys_document_ref(k) := l_line_tbl(i).orig_sys_document_ref;
1953   l_line_acks_rec.orig_sys_line_ref(k) := l_line_tbl(i).orig_sys_line_ref;
1954   l_line_acks_rec.orig_sys_shipment_ref(k) := l_line_tbl(i).orig_sys_shipment_ref;
1955 --
1956   l_line_acks_rec.over_ship_reason_code(k) := l_line_tbl(i).over_ship_reason_code;
1957   l_line_acks_rec.over_ship_resolved_flag(k) := l_line_tbl(i).over_ship_resolved_flag;
1958   l_line_acks_rec.pricing_date(k) := l_line_tbl(i).pricing_date;
1959   l_line_acks_rec.pricing_quantity(k) := l_line_tbl(i).pricing_quantity;
1960   l_line_acks_rec.pricing_quantity_uom(k) := l_line_tbl(i).pricing_quantity_uom;
1961   l_line_acks_rec.program_application_id(k) := l_line_tbl(i).program_application_id;
1962   l_line_acks_rec.program_id(k) := l_line_tbl(i).program_id;
1963   l_line_acks_rec.program_update_date(k) := l_line_tbl(i).program_update_date;
1964   l_line_acks_rec.promise_date(k) := l_line_tbl(i).promise_date;
1965   l_line_acks_rec.reference_header_id(k) := l_line_tbl(i).reference_header_id;
1966   l_line_acks_rec.reference_line_id(k) := l_line_tbl(i).reference_line_id;
1967   l_line_acks_rec.reference_type(k) := l_line_tbl(i).reference_type;
1968   l_line_acks_rec.request_date(k) := l_line_tbl(i).request_date;
1969   l_line_acks_rec.request_id(k) := l_line_tbl(i).request_id;
1970   l_line_acks_rec.reserved_quantity(k) := l_line_tbl(i).reserved_quantity;
1971   l_line_acks_rec.return_reason_code(k) := l_line_tbl(i).return_reason_code;
1972   l_line_acks_rec.rla_schedule_type_code(k) := l_line_tbl(i).rla_schedule_type_code;
1973   l_line_acks_rec.schedule_arrival_date(k) := l_line_tbl(i).schedule_arrival_date;
1974   l_line_acks_rec.schedule_ship_date(k) := l_line_tbl(i).schedule_ship_date;
1975   l_line_acks_rec.schedule_status_code(k) := l_line_tbl(i).schedule_status_code;
1976   l_line_acks_rec.ship_model_complete_flag(k) := l_line_tbl(i).ship_model_complete_flag;
1977   l_line_acks_rec.ship_tolerance_above(k) := l_line_tbl(i).ship_tolerance_above;
1978   l_line_acks_rec.ship_tolerance_below(k) := l_line_tbl(i).ship_tolerance_below;
1979 --
1980   l_line_acks_rec.shipment_number(k) := l_line_tbl(i).shipment_number;
1981   l_line_acks_rec.shipment_priority_code(k) := l_line_tbl(i).shipment_priority_code;
1982   l_line_acks_rec.shipped_quantity(k) := l_line_tbl(i).shipped_quantity;
1983   l_line_acks_rec.SHIPPING_METHOD_CODE(k) := l_line_tbl(i).SHIPPING_METHOD_CODE;
1984   l_line_acks_rec.SHIPPING_QUANTITY(k) := l_line_tbl(i).SHIPPING_QUANTITY;
1985   l_line_acks_rec.SHIPPING_QUANTITY_UOM(k) := l_line_tbl(i).SHIPPING_QUANTITY_UOM;
1986   l_line_acks_rec.SOLD_TO_ORG_ID(k) := l_line_tbl(i).SOLD_TO_ORG_ID;
1987   l_line_acks_rec.SORT_ORDER(k) := l_line_tbl(i).SORT_ORDER;
1988   l_line_acks_rec.SOURCE_DOCUMENT_ID(k) := l_line_tbl(i).SOURCE_DOCUMENT_ID;
1989   l_line_acks_rec.SOURCE_DOCUMENT_LINE_ID(k) := l_line_tbl(i).SOURCE_DOCUMENT_LINE_ID;
1990   l_line_acks_rec.SOURCE_DOCUMENT_TYPE_ID(k) := l_line_tbl(i).SOURCE_DOCUMENT_TYPE_ID;
1991   l_line_acks_rec.SOURCE_TYPE_CODE(k) := l_line_tbl(i).SOURCE_TYPE_CODE;
1992   l_line_acks_rec.SPLIT_FROM_LINE_ID(k) := l_line_tbl(i).SPLIT_FROM_LINE_ID;
1993   l_line_acks_rec.TAX_CODE(k) := l_line_tbl(i).TAX_CODE;
1994   l_line_acks_rec.TAX_DATE(k) := l_line_tbl(i).TAX_DATE;
1995   l_line_acks_rec.TAX_EXEMPT_FLAG(k) := l_line_tbl(i).TAX_EXEMPT_FLAG;
1996   l_line_acks_rec.TAX_EXEMPT_NUMBER(k) := l_line_tbl(i).TAX_EXEMPT_NUMBER;
1997   l_line_acks_rec.TAX_EXEMPT_REASON_CODE(k) := l_line_tbl(i).TAX_EXEMPT_REASON_CODE;
1998   l_line_acks_rec.TAX_POINT_CODE(k) := l_line_tbl(i).TAX_POINT_CODE;
1999   l_line_acks_rec.TAX_RATE(k) := l_line_tbl(i).TAX_RATE;
2000   l_line_acks_rec.TAX_VALUE(k) := l_line_tbl(i).TAX_VALUE;
2001   l_line_acks_rec.UNIT_LIST_PRICE(k) := l_line_tbl(i).UNIT_LIST_PRICE;
2002   l_line_acks_rec.UNIT_SELLING_PRICE(k) := l_line_tbl(i).UNIT_SELLING_PRICE;
2003   l_line_acks_rec.VEH_CUS_ITEM_CUM_KEY_ID(k) := l_line_tbl(i).VEH_CUS_ITEM_CUM_KEY_ID;
2004   l_line_acks_rec.VISIBLE_DEMAND_FLAG(k) := l_line_tbl(i).VISIBLE_DEMAND_FLAG;
2005   l_line_acks_rec.split_from_line_ref(k) := l_line_tbl(i).split_from_line_ref;
2006   l_line_acks_rec.split_from_shipment_ref(k) := l_line_tbl(i).split_from_shipment_ref;
2007   l_line_acks_rec.Service_Txn_Reason_Code(k) := l_line_tbl(i).Service_Txn_Reason_Code;
2008   l_line_acks_rec.Service_Txn_Comments(k) := l_line_tbl(i).Service_Txn_Comments;
2009   l_line_acks_rec.Service_Duration(k) := l_line_tbl(i).Service_Duration;
2010   l_line_acks_rec.Service_Start_Date(k) := l_line_tbl(i).Service_Start_Date;
2011   l_line_acks_rec.Service_End_Date(k) := l_line_tbl(i).Service_End_Date;
2012   l_line_acks_rec.Service_Coterminate_Flag(k) := l_line_tbl(i).Service_Coterminate_Flag;
2013   l_line_acks_rec.Service_Number(k) := l_line_tbl(i).Service_Number;
2014   l_line_acks_rec.Service_Period(k) := l_line_tbl(i).Service_Period;
2015   l_line_acks_rec.Service_Reference_Type_Code(k) := l_line_tbl(i).Service_Reference_Type_Code;
2016   l_line_acks_rec.service_Reference_Line_Id(k) := l_line_tbl(i).service_Reference_Line_Id;
2017   l_line_acks_rec.Service_Reference_System_Id(k) := l_line_tbl(i).Service_Reference_System_Id;
2018   l_line_acks_rec.Credit_Invoice_Line_Id(k) := l_line_tbl(i).Credit_Invoice_Line_Id;
2019   l_line_acks_rec.service_reference_line(k) := l_line_tbl(i).service_reference_line;
2020   l_line_acks_rec.service_reference_order(k) := l_line_tbl(i).service_reference_order;
2021   l_line_acks_rec.service_reference_system(k) := l_line_tbl(i).service_reference_system;
2022   l_line_acks_rec.customer_line_number(k) := l_line_tbl(i).customer_line_number;
2023 
2024   l_line_acks_rec.user_item_description(k) := l_line_tbl(i).user_item_description;
2025   --l_line_acks_rec.acknowledgment_type(k) := l_line_tbl(i).acknowledgment_type;
2026   l_line_acks_rec.blanket_number(k) := l_line_tbl(i).blanket_number;
2027   l_line_acks_rec.blanket_line_number(k) := l_line_tbl(i).blanket_line_number;
2028   l_line_acks_rec.original_inventory_item_id(k) := l_line_tbl(i).original_inventory_item_id;
2029   l_line_acks_rec.original_ordered_item_id(k) := l_line_tbl(i).original_ordered_item_id;
2030   l_line_acks_rec.original_ordered_item(k) := l_line_tbl(i).original_ordered_item;
2031   l_line_acks_rec.original_item_identifier_type(k) := l_line_tbl(i).original_item_identifier_type;
2032   l_line_acks_rec.item_relationship_type(k) := l_line_tbl(i).item_relationship_type;
2033   l_line_acks_rec.attribute1(k) := l_line_tbl(i).attribute1;
2034   l_line_acks_rec.attribute10(k) := l_line_tbl(i).attribute10;
2035  l_line_acks_rec.attribute11(k) := l_line_tbl(i).attribute11;
2036  l_line_acks_rec.attribute12(k) := l_line_tbl(i).attribute12;
2037  l_line_acks_rec.attribute13(k) := l_line_tbl(i).attribute13;
2038  l_line_acks_rec.attribute14(k) := l_line_tbl(i).attribute14;
2039  l_line_acks_rec.attribute15(k) := l_line_tbl(i).attribute15;
2040  l_line_acks_rec.attribute16(k) := l_line_tbl(i).attribute16;
2041  l_line_acks_rec.attribute17(k) := l_line_tbl(i).attribute17;
2042  l_line_acks_rec.attribute18(k) := l_line_tbl(i).attribute18;
2043  l_line_acks_rec.attribute19(k) := l_line_tbl(i).attribute19;
2044  l_line_acks_rec.attribute2(k) := l_line_tbl(i).attribute2;
2045  l_line_acks_rec.attribute20(k) := l_line_tbl(i).attribute20;
2046  l_line_acks_rec.attribute3(k) := l_line_tbl(i).attribute3;
2047  l_line_acks_rec.attribute4(k) := l_line_tbl(i).attribute4;
2048  l_line_acks_rec.attribute5(k) := l_line_tbl(i).attribute5;
2049  l_line_acks_rec.attribute6(k) := l_line_tbl(i).attribute6;
2050  l_line_acks_rec.attribute7(k) := l_line_tbl(i).attribute7;
2051  l_line_acks_rec.attribute8(k) := l_line_tbl(i).attribute8;
2052  l_line_acks_rec.attribute9(k) := l_line_tbl(i).attribute9;
2053  l_line_acks_rec.global_attribute1(k) := l_line_tbl(i).global_attribute1;
2054  l_line_acks_rec.global_attribute10(k) := l_line_tbl(i).global_attribute10;
2055  l_line_acks_rec.global_attribute11(k) := l_line_tbl(i).global_attribute11;
2056  l_line_acks_rec.global_attribute12(k) := l_line_tbl(i).global_attribute12;
2057  l_line_acks_rec.global_attribute13(k) := l_line_tbl(i).global_attribute13;
2058  l_line_acks_rec.global_attribute14(k) := l_line_tbl(i).global_attribute14;
2059  l_line_acks_rec.global_attribute15(k) := l_line_tbl(i).global_attribute15;
2060  l_line_acks_rec.global_attribute16(k) := l_line_tbl(i).global_attribute16;
2061  l_line_acks_rec.global_attribute17(k) := l_line_tbl(i).global_attribute17;
2062  l_line_acks_rec.global_attribute18(k) := l_line_tbl(i).global_attribute18;
2063  l_line_acks_rec.global_attribute19(k) := l_line_tbl(i).global_attribute19;
2064  l_line_acks_rec.global_attribute2(k) := l_line_tbl(i).global_attribute2;
2065  l_line_acks_rec.global_attribute20(k) := l_line_tbl(i).global_attribute20;
2066  l_line_acks_rec.global_attribute3(k) := l_line_tbl(i).global_attribute3;
2067  l_line_acks_rec.global_attribute4(k) := l_line_tbl(i).global_attribute4;
2068  l_line_acks_rec.global_attribute5(k) := l_line_tbl(i).global_attribute5;
2069  l_line_acks_rec.global_attribute6(k) := l_line_tbl(i).global_attribute6;
2070  l_line_acks_rec.global_attribute7(k) := l_line_tbl(i).global_attribute7;
2071  l_line_acks_rec.global_attribute8(k) := l_line_tbl(i).global_attribute8;
2072  l_line_acks_rec.global_attribute9(k) := l_line_tbl(i).global_attribute9;
2073  l_line_acks_rec.global_attribute_category(k) := l_line_tbl(i).global_attribute_category;
2074 
2075  l_line_acks_rec.industry_attribute1(k) := l_line_tbl(i).industry_attribute1;
2076  l_line_acks_rec.industry_attribute10(k) := l_line_tbl(i).industry_attribute10;
2077  l_line_acks_rec.industry_attribute11(k) := l_line_tbl(i).industry_attribute11;
2078  l_line_acks_rec.industry_attribute12(k) := l_line_tbl(i).industry_attribute12;
2079  l_line_acks_rec.industry_attribute13(k) := l_line_tbl(i).industry_attribute13;
2080  l_line_acks_rec.industry_attribute14(k) := l_line_tbl(i).industry_attribute14;
2081  l_line_acks_rec.industry_attribute15(k) := l_line_tbl(i).industry_attribute15;
2082  l_line_acks_rec.industry_attribute16(k) := l_line_tbl(i).industry_attribute16;
2083  l_line_acks_rec.industry_attribute17(k) := l_line_tbl(i).industry_attribute17;
2084  l_line_acks_rec.industry_attribute18(k) := l_line_tbl(i).industry_attribute18;
2085  l_line_acks_rec.industry_attribute19(k) := l_line_tbl(i).industry_attribute19;
2086  l_line_acks_rec.industry_attribute20(k) := l_line_tbl(i).industry_attribute20;
2087  l_line_acks_rec.industry_attribute21(k) := l_line_tbl(i).industry_attribute21;
2088  l_line_acks_rec.industry_attribute22(k) := l_line_tbl(i).industry_attribute22;
2089  l_line_acks_rec.industry_attribute23(k) := l_line_tbl(i).industry_attribute23;
2090  l_line_acks_rec.industry_attribute24(k) := l_line_tbl(i).industry_attribute24;
2091  l_line_acks_rec.industry_attribute25(k) := l_line_tbl(i).industry_attribute25;
2092  l_line_acks_rec.industry_attribute26(k) := l_line_tbl(i).industry_attribute26;
2093  l_line_acks_rec.industry_attribute27(k) := l_line_tbl(i).industry_attribute27;
2094  l_line_acks_rec.industry_attribute28(k) := l_line_tbl(i).industry_attribute28;
2095  l_line_acks_rec.industry_attribute29(k) := l_line_tbl(i).industry_attribute29;
2096  l_line_acks_rec.industry_attribute30(k) := l_line_tbl(i).industry_attribute30;
2097  l_line_acks_rec.industry_attribute2(k) := l_line_tbl(i).industry_attribute2;
2098  l_line_acks_rec.industry_attribute3(k) := l_line_tbl(i).industry_attribute3;
2099  l_line_acks_rec.industry_attribute4(k) := l_line_tbl(i).industry_attribute4;
2100  l_line_acks_rec.industry_attribute5(k) := l_line_tbl(i).industry_attribute5;
2101  l_line_acks_rec.industry_attribute6(k) := l_line_tbl(i).industry_attribute6;
2102  l_line_acks_rec.industry_attribute7(k) := l_line_tbl(i).industry_attribute7;
2103  l_line_acks_rec.industry_attribute8(k) := l_line_tbl(i).industry_attribute8;
2104  l_line_acks_rec.industry_attribute9(k) := l_line_tbl(i).industry_attribute9;
2105  l_line_acks_rec.industry_context(k) := l_line_tbl(i).industry_context;
2106  l_line_acks_rec.TP_CONTEXT(k) := l_line_tbl(i).TP_CONTEXT;
2107  l_line_acks_rec.TP_ATTRIBUTE1(k) := l_line_tbl(i).TP_ATTRIBUTE1;
2108  l_line_acks_rec.TP_ATTRIBUTE2(k) := l_line_tbl(i).TP_ATTRIBUTE2;
2109  l_line_acks_rec.TP_ATTRIBUTE3(k) := l_line_tbl(i).TP_ATTRIBUTE3;
2110  l_line_acks_rec.TP_ATTRIBUTE4(k) := l_line_tbl(i).TP_ATTRIBUTE4;
2111  l_line_acks_rec.TP_ATTRIBUTE5(k) := l_line_tbl(i).TP_ATTRIBUTE5;
2112  l_line_acks_rec.TP_ATTRIBUTE6(k) := l_line_tbl(i).TP_ATTRIBUTE6;
2113  l_line_acks_rec.TP_ATTRIBUTE7(k) := l_line_tbl(i).TP_ATTRIBUTE7;
2114  l_line_acks_rec.TP_ATTRIBUTE8(k) := l_line_tbl(i).TP_ATTRIBUTE8;
2115  l_line_acks_rec.TP_ATTRIBUTE9(k) := l_line_tbl(i).TP_ATTRIBUTE9;
2116  l_line_acks_rec.TP_ATTRIBUTE10(k) := l_line_tbl(i).TP_ATTRIBUTE10;
2117  l_line_acks_rec.TP_ATTRIBUTE11(k) := l_line_tbl(i).TP_ATTRIBUTE11;
2118  l_line_acks_rec.TP_ATTRIBUTE12(k) := l_line_tbl(i).TP_ATTRIBUTE12;
2119  l_line_acks_rec.TP_ATTRIBUTE13(k) := l_line_tbl(i).TP_ATTRIBUTE13;
2120  l_line_acks_rec.TP_ATTRIBUTE14(k) := l_line_tbl(i).TP_ATTRIBUTE14;
2121  l_line_acks_rec.TP_ATTRIBUTE15(k) := l_line_tbl(i).TP_ATTRIBUTE15;
2122  l_line_acks_rec.pricing_attribute1(k) := l_line_tbl(i).pricing_attribute1;
2123  l_line_acks_rec.pricing_attribute10(k) := l_line_tbl(i).pricing_attribute10;
2124  l_line_acks_rec.pricing_attribute2(k) := l_line_tbl(i).pricing_attribute2;
2125  l_line_acks_rec.pricing_attribute3(k) := l_line_tbl(i).pricing_attribute3;
2126  l_line_acks_rec.pricing_attribute4(k) := l_line_tbl(i).pricing_attribute4;
2127  l_line_acks_rec.pricing_attribute5(k) := l_line_tbl(i).pricing_attribute5;
2128  l_line_acks_rec.pricing_attribute6(k) := l_line_tbl(i).pricing_attribute6;
2129  l_line_acks_rec.pricing_attribute7(k) := l_line_tbl(i).pricing_attribute7;
2130  l_line_acks_rec.pricing_attribute8(k) := l_line_tbl(i).pricing_attribute8;
2131  l_line_acks_rec.pricing_attribute9(k) := l_line_tbl(i).pricing_attribute9;
2132  l_line_acks_rec.pricing_context(k) := l_line_tbl(i).pricing_context;
2133  l_line_acks_rec.return_attribute1(k) := l_line_tbl(i).return_attribute1;
2134  l_line_acks_rec.return_attribute10(k) := l_line_tbl(i).return_attribute10;
2135  l_line_acks_rec.return_attribute11(k) := l_line_tbl(i).return_attribute11;
2136  l_line_acks_rec.return_attribute12(k) := l_line_tbl(i).return_attribute12;
2137  l_line_acks_rec.return_attribute13(k) := l_line_tbl(i).return_attribute13;
2138  l_line_acks_rec.return_attribute14(k) := l_line_tbl(i).return_attribute14;
2139  l_line_acks_rec.return_attribute15(k) := l_line_tbl(i).return_attribute15;
2140  l_line_acks_rec.return_attribute2(k) := l_line_tbl(i).return_attribute2;
2141  l_line_acks_rec.return_attribute3(k) := l_line_tbl(i).return_attribute3;
2142  l_line_acks_rec.return_attribute4(k) := l_line_tbl(i).return_attribute4;
2143  l_line_acks_rec.return_attribute5(k) := l_line_tbl(i).return_attribute5;
2144  l_line_acks_rec.return_attribute6(k) := l_line_tbl(i).return_attribute6;
2145  l_line_acks_rec.return_attribute7(k) := l_line_tbl(i).return_attribute7;
2146  l_line_acks_rec.return_attribute8(k) := l_line_tbl(i).return_attribute8;
2147  l_line_acks_rec.return_attribute9(k) := l_line_tbl(i).return_attribute9;
2148  l_line_acks_rec.return_context(k) := l_line_tbl(i).return_context;
2149  l_line_acks_rec.customer_shipment_number(k) := l_line_tbl(i).customer_shipment_number;
2150 -- { Distributer Order related change
2151  l_line_acks_rec.end_customer_id(k)  := l_line_tbl(i).end_customer_id;
2152  l_line_acks_rec.end_customer_contact_id(k) :=  l_line_tbl(i).end_customer_contact_id;
2153  l_line_acks_rec.end_customer_site_use_id(k) :=  l_line_tbl(i).end_customer_site_use_id;
2154  l_line_acks_rec.ib_owner(k) :=  l_line_tbl(i).ib_owner;
2155  l_line_acks_rec.ib_current_location(k) :=  l_line_tbl(i).ib_current_location;
2156  l_line_acks_rec.ib_installed_at_location(k) :=  l_line_tbl(i).ib_installed_at_location;
2157 -- Distributer Order related change }
2158  l_line_acks_rec.charge_periodicity_code(k) :=  l_line_tbl(i).charge_periodicity_code;
2159 --Sol_ord_er #16014165 start
2160 l_line_acks_rec.SERVICE_BILL_PROFILE_ID(k)		:=  l_line_tbl(i).SERVICE_BILL_PROFILE_ID;
2161 l_line_acks_rec.SERVICE_COV_TEMPLATE_ID(k)		:=  l_line_tbl(i).SERVICE_COV_TEMPLATE_ID;
2162 l_line_acks_rec.SERVICE_SUBS_TEMPLATE_ID(k)		:=  l_line_tbl(i).SERVICE_SUBS_TEMPLATE_ID;
2163 l_line_acks_rec.SERVICE_BILL_OPTION_CODE(k)		:=  l_line_tbl(i).SERVICE_BILL_OPTION_CODE;
2164 l_line_acks_rec.SERVICE_FIRST_PERIOD_AMOUNT(k)	:=  l_line_tbl(i).SERVICE_FIRST_PERIOD_AMOUNT;
2165 l_line_acks_rec.SUBSCRIPTION_ENABLE_FLAG(k)		:=  l_line_tbl(i).SUBSCRIPTION_ENABLE_FLAG;
2166 l_line_acks_rec.SERVICE_FIRST_PERIOD_ENDDATE(k)	:=  l_line_tbl(i).SERVICE_FIRST_PERIOD_ENDDATE;
2167 --Sol_ord_er #16014165 end
2168     <<nextline>>
2169     Exit When i = l_line_tbl.count;
2170     i   :=  l_line_tbl.Next(i);
2171 
2172   End Loop;
2173 
2174   If l_count > 0 Then
2175     --Added for bug4730258 start
2176      FORALL y in l_line_acks_rec.line_id.First..l_line_acks_rec.line_id.Last
2177        DELETE  FROM OE_LINE_ACKS
2178          WHERE   HEADER_ID = l_line_acks_rec.header_id(y)
2179          AND   LINE_ID 	= l_line_acks_rec.line_id(y)
2180          AND   ACKNOWLEDGMENT_FLAG is null
2181          -- Change this condition once a type is inserted for POAO/POCAO
2182          AND nvl(acknowledgment_type,'ALL') = nvl(l_ack_type,'ALL')
2183          AND  nvl(change_sequence, FND_API.G_MISS_CHAR)
2184            =  nvl(l_line_acks_rec.CHANGE_SEQUENCE(y), FND_API.G_MISS_CHAR) ;
2185      --Added for bug4730258 end
2186    FORALL j in l_line_acks_rec.line_id.First..l_line_acks_rec.line_id.Last
2187     Insert Into Oe_Line_Acks
2188         (
2189           ACCOUNTING_RULE_ID
2190          ,ACCOUNTING_RULE_DURATION
2191          ,ACKNOWLEDGMENT_FLAG
2192          ,ACTUAL_ARRIVAL_DATE
2193          ,ACTUAL_SHIPMENT_DATE
2194          ,AGREEMENT_ID
2195          ,ARRIVAL_SET_ID
2196 /*
2197          ,ATO_LINE_ID
2198 */
2199          ,ATTRIBUTE1
2200          ,ATTRIBUTE10
2201          ,ATTRIBUTE11
2202          ,ATTRIBUTE12
2203          ,ATTRIBUTE13
2204          ,ATTRIBUTE14
2205          ,ATTRIBUTE15
2206          ,ATTRIBUTE16    --For bug 2184255
2207          ,ATTRIBUTE17
2208          ,ATTRIBUTE18
2209          ,ATTRIBUTE19
2210          ,ATTRIBUTE2
2211          ,ATTRIBUTE20
2212          ,ATTRIBUTE3
2213          ,ATTRIBUTE4
2214          ,ATTRIBUTE5
2215          ,ATTRIBUTE6
2216          ,ATTRIBUTE7
2217          ,ATTRIBUTE8
2218          ,ATTRIBUTE9
2219 /*
2220          ,AUTHORIZED_TO_SHIP_FLAG
2221          ,BUYER_SELLER_FLAG
2222 */
2223          ,BOOKED_FLAG
2224          ,CANCELLED_FLAG
2225          ,CANCELLED_QUANTITY
2226          ,CHANGE_DATE
2227          ,CHANGE_SEQUENCE
2228          ,COMPONENT_CODE
2229          ,COMPONENT_NUMBER
2230          ,COMPONENT_SEQUENCE_ID
2231          ,CONFIG_DISPLAY_SEQUENCE
2232          ,CONFIGURATION_ID
2233          ,TOP_MODEL_LINE_ID
2234          ,CONTEXT
2235          ,CREATED_BY
2236          ,CREATION_DATE
2237          ,CUST_MODEL_SERIAL_NUMBER
2238          ,CUST_PO_NUMBER
2239          ,CUST_PRODUCTION_SEQ_NUM
2240          ,CUSTOMER_DOCK_CODE
2241          ,CUSTOMER_ITEM
2242          ,CUSTOMER_ITEM_ID /* Bug # 4761560 */
2243          ,CUSTOMER_JOB
2244          ,CUSTOMER_PRODUCTION_LINE
2245          ,CUSTOMER_TRX_LINE_ID
2246          ,DELIVER_TO_CONTACT_ID
2247          ,DELIVER_TO_ORG_ID
2248          ,DELIVERY_LEAD_TIME
2249          ,DEMAND_BUCKET_TYPE_CODE
2250          ,DEMAND_CLASS_CODE
2251          ,DEP_PLAN_REQUIRED_FLAG
2252          ,EARLIEST_ACCEPTABLE_DATE
2253          ,EXPLOSION_DATE
2254 	 ,FIRST_ACK_CODE
2255 	 ,FIRST_ACK_DATE
2256          ,FOB_POINT_CODE
2257          ,FREIGHT_CARRIER_CODE
2258          ,FREIGHT_TERMS_CODE
2259          ,FULFILLED_QUANTITY
2260          ,GLOBAL_ATTRIBUTE_CATEGORY
2261          ,GLOBAL_ATTRIBUTE1
2262          ,GLOBAL_ATTRIBUTE10
2263          ,GLOBAL_ATTRIBUTE11
2264          ,GLOBAL_ATTRIBUTE12
2265          ,GLOBAL_ATTRIBUTE13
2266          ,GLOBAL_ATTRIBUTE14
2267          ,GLOBAL_ATTRIBUTE15
2268          ,GLOBAL_ATTRIBUTE16
2269          ,GLOBAL_ATTRIBUTE17
2270          ,GLOBAL_ATTRIBUTE18
2271          ,GLOBAL_ATTRIBUTE19
2272          ,GLOBAL_ATTRIBUTE2
2273          ,GLOBAL_ATTRIBUTE20
2274          ,GLOBAL_ATTRIBUTE3
2275          ,GLOBAL_ATTRIBUTE4
2276          ,GLOBAL_ATTRIBUTE5
2277          ,GLOBAL_ATTRIBUTE6
2278          ,GLOBAL_ATTRIBUTE7
2279          ,GLOBAL_ATTRIBUTE8
2280          ,GLOBAL_ATTRIBUTE9
2281          ,HEADER_ID
2282          ,INDUSTRY_ATTRIBUTE1
2283          ,INDUSTRY_ATTRIBUTE10
2284          ,INDUSTRY_ATTRIBUTE11
2285          ,INDUSTRY_ATTRIBUTE12
2286          ,INDUSTRY_ATTRIBUTE13
2287          ,INDUSTRY_ATTRIBUTE14
2288          ,INDUSTRY_ATTRIBUTE15
2289          ,INDUSTRY_ATTRIBUTE16
2290          ,INDUSTRY_ATTRIBUTE17
2291          ,INDUSTRY_ATTRIBUTE18
2292          ,INDUSTRY_ATTRIBUTE19
2293          ,INDUSTRY_ATTRIBUTE2
2294          ,INDUSTRY_ATTRIBUTE20
2295          ,INDUSTRY_ATTRIBUTE21
2296          ,INDUSTRY_ATTRIBUTE22
2297          ,INDUSTRY_ATTRIBUTE23
2298          ,INDUSTRY_ATTRIBUTE24
2299          ,INDUSTRY_ATTRIBUTE25
2300          ,INDUSTRY_ATTRIBUTE26
2301          ,INDUSTRY_ATTRIBUTE27
2302          ,INDUSTRY_ATTRIBUTE28
2303          ,INDUSTRY_ATTRIBUTE29
2304          ,INDUSTRY_ATTRIBUTE3
2305          ,INDUSTRY_ATTRIBUTE30
2306          ,INDUSTRY_ATTRIBUTE4
2307          ,INDUSTRY_ATTRIBUTE5
2308          ,INDUSTRY_ATTRIBUTE6
2309          ,INDUSTRY_ATTRIBUTE7
2310          ,INDUSTRY_ATTRIBUTE8
2311          ,INDUSTRY_ATTRIBUTE9
2312          ,INDUSTRY_CONTEXT
2313          ,TP_CONTEXT
2314          ,TP_ATTRIBUTE1
2315          ,TP_ATTRIBUTE2
2316          ,TP_ATTRIBUTE3
2317          ,TP_ATTRIBUTE4
2318          ,TP_ATTRIBUTE5
2319          ,TP_ATTRIBUTE6
2320          ,TP_ATTRIBUTE7
2321          ,TP_ATTRIBUTE8
2322          ,TP_ATTRIBUTE9
2323          ,TP_ATTRIBUTE10
2324          ,TP_ATTRIBUTE11
2325          ,TP_ATTRIBUTE12
2326          ,TP_ATTRIBUTE13
2327          ,TP_ATTRIBUTE14
2328          ,TP_ATTRIBUTE15
2329 	 ,INVENTORY_ITEM         --added for bug 4309609
2330          ,INVENTORY_ITEM_ID
2331          ,INVOICE_TO_CONTACT_ID
2332          ,INVOICE_TO_ORG_ID
2333          ,INVOICING_RULE_ID
2334          ,ITEM_INPUT
2335          ,ITEM_REVISION
2336          ,ITEM_TYPE_CODE
2337 	 ,LAST_ACK_CODE
2338 	 ,LAST_ACK_DATE
2339          ,LAST_UPDATE_DATE
2340          ,LAST_UPDATE_LOGIN
2341          ,LAST_UPDATED_BY
2342          ,LATEST_ACCEPTABLE_DATE
2343          ,LINE_CATEGORY_CODE
2344          ,LINE_ID
2345          ,LINE_NUMBER
2346          ,LINE_TYPE_ID
2347          ,LINK_TO_LINE_ID
2348          ,MODEL_GROUP_NUMBER
2349          ,OPEN_FLAG
2350          ,OPERATION_CODE
2351          ,OPTION_FLAG
2352          ,OPTION_NUMBER
2353          ,ORDER_QUANTITY_UOM
2354          ,ORDER_SOURCE_ID
2355          ,ORDERED_QUANTITY
2356          ,ORG_ID
2357          ,ORIG_SYS_DOCUMENT_REF
2358          ,ORIG_SYS_LINE_REF
2359          ,ORIG_SYS_SHIPMENT_REF
2360          ,OVER_SHIP_REASON_CODE
2361          ,OVER_SHIP_RESOLVED_FLAG
2362          ,PAYMENT_TERM_ID
2363          ,PRICE_LIST_ID
2364          ,PRICING_ATTRIBUTE1
2365          ,PRICING_ATTRIBUTE10
2366          ,PRICING_ATTRIBUTE2
2367          ,PRICING_ATTRIBUTE3
2368          ,PRICING_ATTRIBUTE4
2369          ,PRICING_ATTRIBUTE5
2370          ,PRICING_ATTRIBUTE6
2371          ,PRICING_ATTRIBUTE7
2372          ,PRICING_ATTRIBUTE8
2373          ,PRICING_ATTRIBUTE9
2374          ,PRICING_CONTEXT
2375          ,PRICING_DATE
2376          ,PRICING_QUANTITY
2377          ,PRICING_QUANTITY_UOM
2378          ,PROGRAM_APPLICATION_ID
2379          ,PROGRAM_ID
2380          ,PROGRAM_UPDATE_DATE
2381          ,PROJECT_ID
2382          ,PROMISE_DATE
2383          ,REFERENCE_HEADER_ID
2384          ,REFERENCE_LINE_ID
2385          ,REFERENCE_TYPE
2386          ,REQUEST_DATE
2387          ,REQUEST_ID
2388          ,RESERVED_QUANTITY
2389          ,RETURN_ATTRIBUTE1
2390          ,RETURN_ATTRIBUTE10
2391          ,RETURN_ATTRIBUTE11
2392          ,RETURN_ATTRIBUTE12
2393          ,RETURN_ATTRIBUTE13
2394          ,RETURN_ATTRIBUTE14
2395          ,RETURN_ATTRIBUTE15
2396          ,RETURN_ATTRIBUTE2
2397          ,RETURN_ATTRIBUTE3
2398          ,RETURN_ATTRIBUTE4
2399          ,RETURN_ATTRIBUTE5
2400          ,RETURN_ATTRIBUTE6
2401          ,RETURN_ATTRIBUTE7
2402          ,RETURN_ATTRIBUTE8
2403          ,RETURN_ATTRIBUTE9
2404          ,RETURN_CONTEXT
2405          ,RETURN_REASON_CODE
2406          ,RLA_SCHEDULE_TYPE_CODE
2407          ,SALESREP_ID
2408          ,SCHEDULE_ARRIVAL_DATE
2409          ,SCHEDULE_SHIP_DATE
2410          ,SCHEDULE_STATUS_CODE
2411          ,SHIP_FROM_ORG_ID
2412          ,SHIP_MODEL_COMPLETE_FLAG
2413          ,SHIP_SET_ID
2414          ,SHIP_TO_CONTACT_ID
2415          ,SHIP_TO_ORG_ID
2416          ,SHIP_TOLERANCE_ABOVE
2417          ,SHIP_TOLERANCE_BELOW
2418          ,SHIPMENT_NUMBER
2419          ,SHIPMENT_PRIORITY_CODE
2420          ,SHIPPED_QUANTITY
2421          ,SHIPPING_METHOD_CODE
2422          ,SHIPPING_QUANTITY
2423          ,SHIPPING_QUANTITY_UOM
2424          ,SOLD_TO_ORG_ID
2425          ,SORT_ORDER
2426          ,SOURCE_DOCUMENT_ID
2427          ,SOURCE_DOCUMENT_LINE_ID
2428          ,SOURCE_DOCUMENT_TYPE_ID
2429          ,SOURCE_TYPE_CODE
2430          ,SPLIT_FROM_LINE_ID
2431          ,TASK_ID
2432          ,TAX_CODE
2433          ,TAX_DATE
2434          ,TAX_EXEMPT_FLAG
2435          ,TAX_EXEMPT_NUMBER
2436          ,TAX_EXEMPT_REASON_CODE
2437          ,TAX_POINT_CODE
2438          ,TAX_RATE
2439          ,TAX_VALUE
2440          ,UNIT_LIST_PRICE
2441          ,UNIT_SELLING_PRICE
2442          ,VEH_CUS_ITEM_CUM_KEY_ID
2443          ,VISIBLE_DEMAND_FLAG
2444          ,split_from_line_ref
2445          ,split_from_shipment_ref
2446          ,Service_Txn_Reason_Code
2447 	 ,Service_Txn_Comments
2448 	 ,Service_Duration
2449 	 ,Service_Start_Date
2450 	 ,Service_End_Date
2451 	 ,Service_Coterminate_Flag
2452 	 ,Service_Number
2453 	 ,Service_Period
2454 	 ,Service_Reference_Type_Code
2455 	 ,Service_Reference_Line_Id
2456 	 ,Service_Reference_System_Id
2457 	 ,Credit_Invoice_Line_Id
2458          ,service_reference_line
2459          ,service_reference_order
2460          ,service_reference_system
2461          ,customer_line_number
2462          ,user_item_description
2463          ,acknowledgment_type
2464          ,blanket_number
2465          ,blanket_line_number
2466          ,original_inventory_item_id
2467 	 ,original_ordered_item_id
2468 	 ,original_ordered_item
2469 	 ,original_item_identifier_type
2470          ,item_relationship_type
2471          ,customer_shipment_number
2472      -- { Distributer Order related change
2473          ,end_customer_id
2474          ,end_customer_contact_id
2475          ,end_customer_site_use_id
2476          ,ib_owner
2477          ,ib_current_location
2478          ,ib_installed_at_location
2479      -- Distributer Order related change }
2480          ,charge_periodicity_code
2481 		--Sol_ord_er #16014165 start
2482 		, SERVICE_BILL_PROFILE_ID
2483 		, SERVICE_COV_TEMPLATE_ID
2484 		, SERVICE_SUBS_TEMPLATE_ID
2485 		, SERVICE_BILL_OPTION_CODE
2486 		, SERVICE_FIRST_PERIOD_AMOUNT
2487 		, SUBSCRIPTION_ENABLE_FLAG
2488 		, SERVICE_FIRST_PERIOD_ENDDATE
2489 		--Sol_ord_er #16014165 end
2490        )
2491     Values
2492        (
2493           l_line_acks_rec.ACCOUNTING_RULE_ID(j)
2494          , l_line_acks_rec.ACCOUNTING_RULE_DURATION(j)
2495          , '' 		-- ACKNOWLEDGMENT_FLAG
2496          , l_line_acks_rec.ACTUAL_ARRIVAL_DATE(j)
2497          , l_line_acks_rec.ACTUAL_SHIPMENT_DATE(j)
2498          , l_line_acks_rec.AGREEMENT_ID(j)
2499          , l_line_acks_rec.ARRIVAL_SET_ID(j)
2500 /*
2501          , l_line_acks_rec.ATO_LINE_ID
2502 */
2503          , l_line_acks_rec.ATTRIBUTE1(j)
2504          , l_line_acks_rec.ATTRIBUTE10(j)
2505          , l_line_acks_rec.ATTRIBUTE11(j)
2506          , l_line_acks_rec.ATTRIBUTE12(j)
2507          , l_line_acks_rec.ATTRIBUTE13(j)
2508          , l_line_acks_rec.ATTRIBUTE14(j)
2509          , l_line_acks_rec.ATTRIBUTE15(j)
2510          , l_line_acks_rec.ATTRIBUTE16(j)    --For bug 2184255
2511          , l_line_acks_rec.ATTRIBUTE17(j)
2512          , l_line_acks_rec.ATTRIBUTE18(j)
2513          , l_line_acks_rec.ATTRIBUTE19(j)
2514          , l_line_acks_rec.ATTRIBUTE2(j)
2515          , l_line_acks_rec.ATTRIBUTE20(j)
2516          , l_line_acks_rec.ATTRIBUTE3(j)
2517          , l_line_acks_rec.ATTRIBUTE4(j)
2518          , l_line_acks_rec.ATTRIBUTE5(j)
2519          , l_line_acks_rec.ATTRIBUTE6(j)
2520          , l_line_acks_rec.ATTRIBUTE7(j)
2521          , l_line_acks_rec.ATTRIBUTE8(j)
2522          , l_line_acks_rec.ATTRIBUTE9(j)
2523 /*
2524          , l_line_acks_rec.AUTHORIZED_TO_SHIP_FLAG
2525          , p_buyer_seller_flag
2526 */
2527          , l_line_acks_rec.BOOKED_FLAG(j)
2528          , l_line_acks_rec.CANCELLED_FLAG(j)
2529          , l_line_acks_rec.CANCELLED_QUANTITY(j)
2530          , ''	-- CHANGE_DATE
2531          , l_line_acks_rec.CHANGE_SEQUENCE(j)
2532          , l_line_acks_rec.COMPONENT_CODE(j)
2533          , l_line_acks_rec.COMPONENT_NUMBER(j)
2534          , l_line_acks_rec.COMPONENT_SEQUENCE_ID(j)
2535          , l_line_acks_rec.CONFIG_DISPLAY_SEQUENCE(j)
2536          , l_line_acks_rec.CONFIGURATION_ID(j)
2537          , l_line_acks_rec.TOP_MODEL_LINE_ID(j)
2538          , l_line_acks_rec.CONTEXT(j)
2539          , l_line_acks_rec.CREATED_BY(j)
2540          , l_line_acks_rec.CREATION_DATE(j)
2541          , l_line_acks_rec.CUST_MODEL_SERIAL_NUMBER(j)
2542          , l_line_acks_rec.CUST_PO_NUMBER(j)
2543          , l_line_acks_rec.CUST_PRODUCTION_SEQ_NUM(j)
2544          , l_line_acks_rec.CUSTOMER_DOCK_CODE(j)
2545          , l_line_acks_rec.ORDERED_ITEM(j)
2546          , l_line_acks_rec.ORDERED_ITEM_ID(j) /* Bug # 4761560 */
2547          , l_line_acks_rec.CUSTOMER_JOB(j)
2548          , l_line_acks_rec.CUSTOMER_PRODUCTION_LINE(j)
2549          , l_line_acks_rec.CUSTOMER_TRX_LINE_ID(j)
2550          , l_line_acks_rec.DELIVER_TO_CONTACT_ID(j)
2551          , l_line_acks_rec.DELIVER_TO_ORG_ID(j)
2552          , l_line_acks_rec.DELIVERY_LEAD_TIME(j)
2553          , l_line_acks_rec.DEMAND_BUCKET_TYPE_CODE(j)
2554          , l_line_acks_rec.DEMAND_CLASS_CODE(j)
2555          , l_line_acks_rec.DEP_PLAN_REQUIRED_FLAG(j)
2556          , l_line_acks_rec.EARLIEST_ACCEPTABLE_DATE(j)
2557          , l_line_acks_rec.EXPLOSION_DATE(j)
2558 	 , l_line_acks_rec.FIRST_ACK_CODE(j)
2559 	 , l_line_acks_rec.FIRST_ACK_DATE(j)
2560          , l_line_acks_rec.FOB_POINT_CODE(j)
2561          , l_line_acks_rec.FREIGHT_CARRIER_CODE(j)
2562          , l_line_acks_rec.FREIGHT_TERMS_CODE(j)
2563          , l_line_acks_rec.FULFILLED_QUANTITY(j)
2564          , l_line_acks_rec.GLOBAL_ATTRIBUTE_CATEGORY(j)
2565          , l_line_acks_rec.GLOBAL_ATTRIBUTE1(j)
2566          , l_line_acks_rec.GLOBAL_ATTRIBUTE10(j)
2567          , l_line_acks_rec.GLOBAL_ATTRIBUTE11(j)
2568          , l_line_acks_rec.GLOBAL_ATTRIBUTE12(j)
2569          , l_line_acks_rec.GLOBAL_ATTRIBUTE13(j)
2570          , l_line_acks_rec.GLOBAL_ATTRIBUTE14(j)
2571          , l_line_acks_rec.GLOBAL_ATTRIBUTE15(j)
2572          , l_line_acks_rec.GLOBAL_ATTRIBUTE16(j)
2573          , l_line_acks_rec.GLOBAL_ATTRIBUTE17(j)
2574          , l_line_acks_rec.GLOBAL_ATTRIBUTE18(j)
2575          , l_line_acks_rec.GLOBAL_ATTRIBUTE19(j)
2576          , l_line_acks_rec.GLOBAL_ATTRIBUTE2(j)
2577          , l_line_acks_rec.GLOBAL_ATTRIBUTE20(j)
2578          , l_line_acks_rec.GLOBAL_ATTRIBUTE3(j)
2579          , l_line_acks_rec.GLOBAL_ATTRIBUTE4(j)
2580          , l_line_acks_rec.GLOBAL_ATTRIBUTE5(j)
2581          , l_line_acks_rec.GLOBAL_ATTRIBUTE6(j)
2582          , l_line_acks_rec.GLOBAL_ATTRIBUTE7(j)
2583          , l_line_acks_rec.GLOBAL_ATTRIBUTE8(j)
2584          , l_line_acks_rec.GLOBAL_ATTRIBUTE9(j)
2585          , l_line_acks_rec.HEADER_ID(j)
2586          , l_line_acks_rec.INDUSTRY_ATTRIBUTE1(j)
2587          , l_line_acks_rec.INDUSTRY_ATTRIBUTE10(j)
2588          , l_line_acks_rec.INDUSTRY_ATTRIBUTE11(j)
2589          , l_line_acks_rec.INDUSTRY_ATTRIBUTE12(j)
2590          , l_line_acks_rec.INDUSTRY_ATTRIBUTE13(j)
2591          , l_line_acks_rec.INDUSTRY_ATTRIBUTE14(j)
2592          , l_line_acks_rec.INDUSTRY_ATTRIBUTE15(j)
2593          , l_line_acks_rec.INDUSTRY_ATTRIBUTE16(j)
2594          , l_line_acks_rec.INDUSTRY_ATTRIBUTE17(j)
2595          , l_line_acks_rec.INDUSTRY_ATTRIBUTE18(j)
2596          , l_line_acks_rec.INDUSTRY_ATTRIBUTE19(j)
2597          , l_line_acks_rec.INDUSTRY_ATTRIBUTE2(j)
2598          , l_line_acks_rec.INDUSTRY_ATTRIBUTE20(j)
2599          , l_line_acks_rec.INDUSTRY_ATTRIBUTE21(j)
2600          , l_line_acks_rec.INDUSTRY_ATTRIBUTE22(j)
2601          , l_line_acks_rec.INDUSTRY_ATTRIBUTE23(j)
2602          , l_line_acks_rec.INDUSTRY_ATTRIBUTE24(j)
2603          , l_line_acks_rec.INDUSTRY_ATTRIBUTE25(j)
2604          , l_line_acks_rec.INDUSTRY_ATTRIBUTE26(j)
2605          , l_line_acks_rec.INDUSTRY_ATTRIBUTE27(j)
2606          , l_line_acks_rec.INDUSTRY_ATTRIBUTE28(j)
2607          , l_line_acks_rec.INDUSTRY_ATTRIBUTE29(j)
2608          , l_line_acks_rec.INDUSTRY_ATTRIBUTE3(j)
2609          , l_line_acks_rec.INDUSTRY_ATTRIBUTE30(j)
2610          , l_line_acks_rec.INDUSTRY_ATTRIBUTE4(j)
2611          , l_line_acks_rec.INDUSTRY_ATTRIBUTE5(j)
2612          , l_line_acks_rec.INDUSTRY_ATTRIBUTE6(j)
2613          , l_line_acks_rec.INDUSTRY_ATTRIBUTE7(j)
2614          , l_line_acks_rec.INDUSTRY_ATTRIBUTE8(j)
2615          , l_line_acks_rec.INDUSTRY_ATTRIBUTE9(j)
2616          , l_line_acks_rec.INDUSTRY_CONTEXT(j)
2617          , l_line_acks_rec.TP_CONTEXT(j)
2618          , l_line_acks_rec.TP_ATTRIBUTE1(j)
2619          , l_line_acks_rec.TP_ATTRIBUTE2(j)
2620          , l_line_acks_rec.TP_ATTRIBUTE3(j)
2621          , l_line_acks_rec.TP_ATTRIBUTE4(j)
2622          , l_line_acks_rec.TP_ATTRIBUTE5(j)
2623          , l_line_acks_rec.TP_ATTRIBUTE6(j)
2624          , l_line_acks_rec.TP_ATTRIBUTE7(j)
2625          , l_line_acks_rec.TP_ATTRIBUTE8(j)
2626          , l_line_acks_rec.TP_ATTRIBUTE9(j)
2627          , l_line_acks_rec.TP_ATTRIBUTE10(j)
2628          , l_line_acks_rec.TP_ATTRIBUTE11(j)
2629          , l_line_acks_rec.TP_ATTRIBUTE12(j)
2630          , l_line_acks_rec.TP_ATTRIBUTE13(j)
2631          , l_line_acks_rec.TP_ATTRIBUTE14(j)
2632          , l_line_acks_rec.TP_ATTRIBUTE15(j)
2633 	 , l_line_acks_rec.inventory_item(j)  --added for bug4309609
2634          , l_line_acks_rec.INVENTORY_ITEM_ID(j)
2635          , l_line_acks_rec.INVOICE_TO_CONTACT_ID(j)
2636          , l_line_acks_rec.INVOICE_TO_ORG_ID(j)
2637          , l_line_acks_rec.INVOICING_RULE_ID(j)
2638          , l_line_acks_rec.ORDERED_ITEM(j)
2639          , l_line_acks_rec.ITEM_REVISION(j)
2640          , l_line_acks_rec.item_identifier_type(j)
2641 	 , l_line_acks_rec.LAST_ACK_CODE(j)
2642 	 , l_line_acks_rec.LAST_ACK_DATE(j)
2643          , l_line_acks_rec.LAST_UPDATE_DATE(j)
2644          , l_line_acks_rec.LAST_UPDATE_LOGIN(j)
2645          , l_line_acks_rec.LAST_UPDATED_BY(j)
2646          , l_line_acks_rec.LATEST_ACCEPTABLE_DATE(j)
2647          , l_line_acks_rec.LINE_CATEGORY_CODE(j)
2648          , l_line_acks_rec.LINE_ID(j)
2649          , l_line_acks_rec.LINE_NUMBER(j)
2650          , l_line_acks_rec.LINE_TYPE_ID(j)
2651          , l_line_acks_rec.LINK_TO_LINE_ID(j)
2652          , l_line_acks_rec.MODEL_GROUP_NUMBER(j)
2653          , l_line_acks_rec.OPEN_FLAG(j)
2654          , l_line_acks_rec.OPERATION_CODE(j)
2655          , l_line_acks_rec.OPTION_FLAG(j)
2656          , l_line_acks_rec.OPTION_NUMBER(j)
2657          , l_line_acks_rec.ORDER_QUANTITY_UOM(j)
2658          , l_line_acks_rec.ORDER_SOURCE_ID(j)
2659          , l_line_acks_rec.ORDERED_QUANTITY(j)
2660          , l_line_acks_rec.ORG_ID(j)
2661          , l_line_acks_rec.ORIG_SYS_DOCUMENT_REF(j)
2662          , l_line_acks_rec.ORIG_SYS_LINE_REF(j)
2663          , l_line_acks_rec.ORIG_SYS_SHIPMENT_REF(j)
2664          , l_line_acks_rec.OVER_SHIP_REASON_CODE(j)
2665          , l_line_acks_rec.OVER_SHIP_RESOLVED_FLAG(j)
2666          , l_line_acks_rec.PAYMENT_TERM_ID(j)
2667          , l_line_acks_rec.PRICE_LIST_ID(j)
2668          , l_line_acks_rec.PRICING_ATTRIBUTE1(j)
2669          , l_line_acks_rec.PRICING_ATTRIBUTE10(j)
2670          , l_line_acks_rec.PRICING_ATTRIBUTE2(j)
2671          , l_line_acks_rec.PRICING_ATTRIBUTE3(j)
2672          , l_line_acks_rec.PRICING_ATTRIBUTE4(j)
2673          , l_line_acks_rec.PRICING_ATTRIBUTE5(j)
2674          , l_line_acks_rec.PRICING_ATTRIBUTE6(j)
2675          , l_line_acks_rec.PRICING_ATTRIBUTE7(j)
2676          , l_line_acks_rec.PRICING_ATTRIBUTE8(j)
2677          , l_line_acks_rec.PRICING_ATTRIBUTE9(j)
2678          , l_line_acks_rec.PRICING_CONTEXT(j)
2679          , l_line_acks_rec.PRICING_DATE(j)
2680          , l_line_acks_rec.PRICING_QUANTITY(j)
2681          , l_line_acks_rec.PRICING_QUANTITY_UOM(j)
2682          , l_line_acks_rec.PROGRAM_APPLICATION_ID(j)
2683          , l_line_acks_rec.PROGRAM_ID(j)
2684          , l_line_acks_rec.PROGRAM_UPDATE_DATE(j)
2685          , l_line_acks_rec.PROJECT_ID(j)
2686          , l_line_acks_rec.PROMISE_DATE(j)
2687          , l_line_acks_rec.REFERENCE_HEADER_ID(j)
2688          , l_line_acks_rec.REFERENCE_LINE_ID(j)
2689          , l_line_acks_rec.REFERENCE_TYPE(j)
2690          , l_line_acks_rec.REQUEST_DATE(j)
2691          , l_line_acks_rec.REQUEST_ID(j)
2692          , l_line_acks_rec.RESERVED_QUANTITY(j)
2693          , l_line_acks_rec.RETURN_ATTRIBUTE1(j)
2694          , l_line_acks_rec.RETURN_ATTRIBUTE10(j)
2695          , l_line_acks_rec.RETURN_ATTRIBUTE11(j)
2696          , l_line_acks_rec.RETURN_ATTRIBUTE12(j)
2697          , l_line_acks_rec.RETURN_ATTRIBUTE13(j)
2698          , l_line_acks_rec.RETURN_ATTRIBUTE14(j)
2699          , l_line_acks_rec.RETURN_ATTRIBUTE15(j)
2700          , l_line_acks_rec.RETURN_ATTRIBUTE2(j)
2701          , l_line_acks_rec.RETURN_ATTRIBUTE3(j)
2702          , l_line_acks_rec.RETURN_ATTRIBUTE4(j)
2703          , l_line_acks_rec.RETURN_ATTRIBUTE5(j)
2704          , l_line_acks_rec.RETURN_ATTRIBUTE6(j)
2705          , l_line_acks_rec.RETURN_ATTRIBUTE7(j)
2706          , l_line_acks_rec.RETURN_ATTRIBUTE8(j)
2707          , l_line_acks_rec.RETURN_ATTRIBUTE9(j)
2708          , l_line_acks_rec.RETURN_CONTEXT(j)
2709          , l_line_acks_rec.RETURN_REASON_CODE(j)
2710          , l_line_acks_rec.RLA_SCHEDULE_TYPE_CODE(j)
2711          , l_line_acks_rec.SALESREP_ID(j)
2712          , l_line_acks_rec.SCHEDULE_ARRIVAL_DATE(j)
2713          , l_line_acks_rec.SCHEDULE_SHIP_DATE(j)
2714          , l_line_acks_rec.SCHEDULE_STATUS_CODE(j)
2715          , l_line_acks_rec.SHIP_FROM_ORG_ID(j)
2716          , l_line_acks_rec.SHIP_MODEL_COMPLETE_FLAG(j)
2717          , l_line_acks_rec.SHIP_SET_ID(j)
2718          , l_line_acks_rec.SHIP_TO_CONTACT_ID(j)
2719          , l_line_acks_rec.SHIP_TO_ORG_ID(j)
2720          , l_line_acks_rec.SHIP_TOLERANCE_ABOVE(j)
2721          , l_line_acks_rec.SHIP_TOLERANCE_BELOW(j)
2722          , l_line_acks_rec.SHIPMENT_NUMBER(j)
2723          , l_line_acks_rec.SHIPMENT_PRIORITY_CODE(j)
2724          , l_line_acks_rec.SHIPPED_QUANTITY(j)
2725          , l_line_acks_rec.SHIPPING_METHOD_CODE(j)
2726          , l_line_acks_rec.SHIPPING_QUANTITY(j)
2727          , l_line_acks_rec.SHIPPING_QUANTITY_UOM(j)
2728          , l_line_acks_rec.SOLD_TO_ORG_ID(j)
2729          , l_line_acks_rec.SORT_ORDER(j)
2730          , l_line_acks_rec.SOURCE_DOCUMENT_ID(j)
2731          , l_line_acks_rec.SOURCE_DOCUMENT_LINE_ID(j)
2732          , l_line_acks_rec.SOURCE_DOCUMENT_TYPE_ID(j)
2733          , l_line_acks_rec.SOURCE_TYPE_CODE(j)
2734          , l_line_acks_rec.SPLIT_FROM_LINE_ID(j)
2735          , l_line_acks_rec.TASK_ID(j)
2736          , l_line_acks_rec.TAX_CODE(j)
2737          , l_line_acks_rec.TAX_DATE(j)
2738          , l_line_acks_rec.TAX_EXEMPT_FLAG(j)
2739          , l_line_acks_rec.TAX_EXEMPT_NUMBER(j)
2740          , l_line_acks_rec.TAX_EXEMPT_REASON_CODE(j)
2741          , l_line_acks_rec.TAX_POINT_CODE(j)
2742          , l_line_acks_rec.TAX_RATE(j)
2743          , l_line_acks_rec.TAX_VALUE(j)
2744          , l_line_acks_rec.UNIT_LIST_PRICE(j)
2745          , l_line_acks_rec.UNIT_SELLING_PRICE(j)
2746          , l_line_acks_rec.VEH_CUS_ITEM_CUM_KEY_ID(j)
2747          , l_line_acks_rec.VISIBLE_DEMAND_FLAG(j)
2748          , l_line_acks_rec.split_from_line_ref(j)
2749          , l_line_acks_rec.split_from_shipment_ref(j)
2750 	 , l_line_acks_rec.Service_Txn_Reason_Code(j)
2751 	 , l_line_acks_rec.Service_Txn_Comments(j)
2752 	 , l_line_acks_rec.Service_Duration(j)
2753 	 , l_line_acks_rec.Service_Start_Date(j)
2754 	 , l_line_acks_rec.Service_End_Date(j)
2755 	 , l_line_acks_rec.Service_Coterminate_Flag(j)
2756 	 , l_line_acks_rec.Service_Number(j)
2757 	 , l_line_acks_rec.Service_Period(j)
2758 	 , l_line_acks_rec.Service_Reference_Type_Code(j)
2759 	 , l_line_acks_rec.Service_Reference_Line_Id(j)
2760 	 , l_line_acks_rec.Service_Reference_System_Id(j)
2761 	 , l_line_acks_rec.Credit_Invoice_Line_Id(j)
2762          , l_line_acks_rec.service_reference_line(j)
2763          , l_line_acks_rec.service_reference_order(j)
2764          , l_line_acks_rec.service_reference_system(j)
2765          , l_line_acks_rec.customer_line_number(j)
2766          , l_line_acks_rec.user_item_description(j)
2767          , l_ack_type
2768          , l_line_acks_rec.blanket_number(j)
2769          , l_line_acks_rec.blanket_line_number(j)
2770          , l_line_acks_rec.original_inventory_item_id(j)
2771 	 , l_line_acks_rec.original_ordered_item_id(j)
2772 	 , l_line_acks_rec.original_ordered_item(j)
2773 	 , l_line_acks_rec.original_item_identifier_type(j)
2774          , l_line_acks_rec.item_relationship_type(j)
2775          , l_line_acks_rec.customer_shipment_number(j)
2776          -- { Distributer Order related change
2777          , l_line_acks_rec.end_customer_id(j)
2778          , l_line_acks_rec.end_customer_contact_id(j)
2779          , l_line_acks_rec.end_customer_site_use_id(j)
2780          , l_line_acks_rec.ib_owner(j)
2781          , l_line_acks_rec.ib_current_location(j)
2782          , l_line_acks_rec.ib_installed_at_location(j)
2783          -- Distributer Order related change }
2784          , l_line_acks_rec.charge_periodicity_code(j)
2785 		 --Sol_ord_er #16014165 start
2786 		 ,l_line_acks_rec.SERVICE_BILL_PROFILE_ID(j)
2787 		 ,l_line_acks_rec.SERVICE_COV_TEMPLATE_ID(j)
2788 		 ,l_line_acks_rec.SERVICE_SUBS_TEMPLATE_ID(j)
2789 		 ,l_line_acks_rec.SERVICE_BILL_OPTION_CODE(j)
2790 		 ,l_line_acks_rec.SERVICE_FIRST_PERIOD_AMOUNT(j)
2791 		 ,l_line_acks_rec.SUBSCRIPTION_ENABLE_FLAG(j)
2792 		 ,l_line_acks_rec.SERVICE_FIRST_PERIOD_ENDDATE(j)
2793 		 --Sol_ord_er #16014165 end
2794         );
2795   End If;
2796 
2797 
2798 Exception
2799 
2800   When Others Then
2801     If FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR) Then
2802       FND_MSG_PUB.Add_Exc_Msg
2803        (G_PKG_NAME, 'OE_Line_Ack_Util.Insert_Row');
2804     End If;
2805 
2806     RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2807 
2808 
2809 End Insert_Row;
2810 
2811 
2812 PROCEDURE Delete_Row
2813 (   p_line_id         IN  NUMBER,
2814     p_ack_type        IN  Varchar2,
2815     p_orig_sys_document_ref In Varchar2,
2816     p_orig_sys_line_ref   In Varchar2,
2817     p_orig_sys_shipment_ref In Varchar2,
2818     p_sold_to_org_id        In NUMBER,
2819     p_sold_to_org           In Varchar2,
2820     p_change_sequence       In Varchar2,
2821     p_request_id      In  NUMBER,
2822     p_header_id       In  NUMBER
2823 )
2824 IS
2825 BEGIN
2826 
2827  oe_debug_pub.add('Input Header ID: '|| p_header_id);
2828  oe_debug_pub.add('Input Line ID: '|| p_line_id);
2829  oe_debug_pub.add('Input Orig Sys Document Ref: '|| p_orig_sys_document_ref);
2830 
2831    If (p_header_id is not null AND
2832        p_line_id is not null) Then
2833 
2834 --request id is only used in where clause for 3a6
2835 
2836 if p_ack_type = oe_acknowledgment_pub.G_TRANSACTION_SSO
2837    Or p_ack_type = oe_acknowledgment_pub.G_TRANSACTION_CSO
2838 then
2839        DELETE  FROM OE_LINE_ACKS
2840        WHERE   HEADER_ID = p_header_id
2841          AND   LINE_ID   = p_line_id
2842          AND   ACKNOWLEDGMENT_FLAG is null
2843          -- Change this condition once a type is inserted for POAO/POCAO
2844          AND nvl(acknowledgment_type,'ALL') = nvl(p_ack_type,'ALL')
2845          AND  nvl(sold_to_org_id, FND_API.G_MISS_NUM)
2846            =  nvl(p_sold_to_org_id, FND_API.G_MISS_NUM)
2847 	 AND  nvl(sold_to_org, FND_API.G_MISS_CHAR)
2848            =  nvl(p_sold_to_org, FND_API.G_MISS_CHAR)
2849          AND  nvl(change_sequence, FND_API.G_MISS_CHAR)
2850            =  nvl(p_change_sequence, FND_API.G_MISS_CHAR)
2851          AND request_id = p_request_id;
2852 
2853 else
2854        DELETE  FROM OE_LINE_ACKS
2855        WHERE   HEADER_ID = p_header_id
2856          AND   LINE_ID 	= p_line_id
2857          AND   ACKNOWLEDGMENT_FLAG is null
2858          -- Change this condition once a type is inserted for POAO/POCAO
2859          AND nvl(acknowledgment_type,'ALL') = nvl(p_ack_type,'ALL')
2860          AND  nvl(sold_to_org_id, FND_API.G_MISS_NUM)
2861            =  nvl(p_sold_to_org_id, FND_API.G_MISS_NUM)
2862 	 AND  nvl(sold_to_org, FND_API.G_MISS_CHAR)
2863            =  nvl(p_sold_to_org, FND_API.G_MISS_CHAR)
2864          AND  nvl(change_sequence, FND_API.G_MISS_CHAR)
2865            =  nvl(p_change_sequence, FND_API.G_MISS_CHAR);
2866 end if;
2867        if sql%rowcount > 0 then
2868           oe_debug_pub.add('Row Deleted from the oe_line_Acks table');
2869        end If;
2870    Elsif (p_orig_sys_document_ref is not null) Then
2871        oe_debug_pub.add('before deleting line acknowledgment by orig_sys_document_Ref, line_ref and shipment_ref ',3);
2872 
2873 if p_ack_type = oe_acknowledgment_pub.G_TRANSACTION_SSO
2874    Or p_ack_type = oe_acknowledgment_pub.G_TRANSACTION_CSO
2875 then
2876 
2877        DELETE  FROM OE_LINE_ACKS
2878        WHERE   ORIG_SYS_DOCUMENT_REF    = p_orig_sys_document_ref
2879           AND  ORIG_SYS_LINE_REF        = p_orig_sys_line_ref
2880           AND  ORIG_SYS_SHIPMENT_REF    = p_orig_sys_shipment_ref
2881           AND  nvl(ACKNOWLEDGMENT_TYPE, 'ALL')  = nvl(p_ack_type,'ALL')
2882 	  AND  nvl(sold_to_org_id, FND_API.G_MISS_NUM)
2883             =  nvl(p_sold_to_org_id, FND_API.G_MISS_NUM)
2884   	  AND  nvl(sold_to_org, FND_API.G_MISS_CHAR)
2885             =  nvl(p_sold_to_org, FND_API.G_MISS_CHAR)
2886           AND  nvl(change_sequence, FND_API.G_MISS_CHAR)
2887             =  nvl(p_change_sequence, FND_API.G_MISS_CHAR)
2888           AND  REQUEST_ID               = p_request_id;
2889 
2890 else
2891 
2892        DELETE  FROM OE_LINE_ACKS
2893        WHERE   ORIG_SYS_DOCUMENT_REF    = p_orig_sys_document_ref
2894           AND  ORIG_SYS_LINE_REF        = p_orig_sys_line_ref
2895           AND  ORIG_SYS_SHIPMENT_REF    = p_orig_sys_shipment_ref
2896           AND  nvl(ACKNOWLEDGMENT_TYPE, 'ALL')  = nvl(p_ack_type,'ALL')
2897 	  AND  nvl(sold_to_org_id, FND_API.G_MISS_NUM)
2898             =  nvl(p_sold_to_org_id, FND_API.G_MISS_NUM)
2899 	   AND  nvl(sold_to_org, FND_API.G_MISS_CHAR)
2900             =  nvl(p_sold_to_org, FND_API.G_MISS_CHAR)
2901 	  AND  nvl(change_sequence, FND_API.G_MISS_CHAR)
2902             =  nvl(p_change_sequence, FND_API.G_MISS_CHAR);
2903 
2904 
2905 end if;
2906 
2907        if sql%rowcount > 0 then
2908           oe_debug_pub.add('Row(s) Deleted from the oe_line_acks table');
2909        end If;
2910     Else
2911        oe_debug_pub.add('not deleting any rows from oe_line_acks ',3);
2912 
2913     End If;
2914 
2915 
2916 EXCEPTION
2917 
2918     WHEN OTHERS THEN
2919 
2920         oe_debug_pub.Add('Encountered Others Error Exception in OE_Line_Ack_Util.Delete_Row: '||sqlerrm);
2921 
2922         IF FND_MSG_PUB.Check_Msg_Level(FND_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
2923         THEN
2924            FND_MSG_PUB.Add_Exc_Msg
2925             	(G_PKG_NAME, 'OE_Line_Ack_Util.Delete_Row');
2926         END IF;
2927 
2928         RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
2929 
2930 END Delete_Row;
2931 
2932 
2933 
2934 
2935 
2936 END OE_Line_Ack_Util;