DBA Data[Home] [Help]

PACKAGE BODY: APPS.OE_DUAL_UOM_UTIL

Source


1 PACKAGE BODY OE_DUAL_UOM_UTIL AS
2 /* $Header: OEXUDUMB.pls 120.0.12020000.8 2013/05/02 03:23:39 gabhatia noship $ */
3 
4 ------------------------------------------------------------------------------------------------------
5 ---------------------------------------------------------------------
6 -- Function get_fulfillment_eligible
7 --
8 -- API to determine whether fulfillment_base should be calculated or not for current line_id
9 -- IN parameters -
10 -- p_line_rec   : The function will take OE_Order_PUB.Line_Rec_Type record
11 --                containing line_id as input and return Boolean value Indicating, whether FB
12 --                on line should be calculated as per new functionality or not.
13 --                Boolean TRUE implies : Yes, calculate FB
14 --                Boolean FALSE implies : No, not eligible to calculate FB
15 -- OUT parameters -
16 -- p_inventory_item_rec :
17 -- A new record type structure Inventory_Item_Rec_Type is defined.
18 -- In get_fulfillment_eligible , we will query mtl_system_items to fetch property of a item,
19 -- we use thi swuery to fetch other required parameters like primary uom of item (to be used later in derive_fulfillment_base API).
20 ---------------------------------------------------------------------
21 
22 Function get_fulfillment_eligible
23             (   p_line_rec  IN OE_Order_PUB.Line_Rec_Type  ,
24                 p_inventory_item_rec OUT NOCOPY Inventory_Item_Rec_Type
25              ) RETURN BOOLEAN
26       IS
27 
28 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
29 l_org_id NUMBER;
30  --
31 BEGIN
32 
33 /* In Derive_fulfillment_base we have already verifed that
34              1. New profile(OM: Default Fulfillment Base) is set to YES.
35              2.Warehouse is not null.
36 
37 get_fulfillment_eligible will return true if all of following is true:-
38 
39              1. Ordered item is a Dual UOM
40              2. Ordered item is a  shippable OR reservable OR Inventory Item in Master item
41                  > RESERVABLE_TYPE -> 1 is Reservable, 2 is non-Reservable
42                  > INVENTORY_ITEM_FLAG -> Y is Inv item, N is not inv item
43                  > SHIPPABLE_ITEM_FLAG -> Y is shippable, N is not shippable
44              3. Ship from org is a WMS org
45 */
46 
47 
48 IF l_debug_level > 0 THEN
49 oe_debug_pub.add('Entering oe_dual_uom_util.get_fulfillment_eligible'  );
50 END IF;
51 
52 -- primary_uom_class and secondary_uom_class will be used in derive_fulfillment_base function
53 
54 SELECT  msi.inventory_item_id,
55         msi.organization_id ,
56         msi.primary_uom_code,
57         msi.secondary_uom_code  ,
58         msi.inventory_item_flag  ,
59         msi.shippable_item_flag  ,
60         msi.tracking_quantity_ind  ,
61         msi.reservable_type  ,
62         muomt1.uom_class,
63         muomt2.uom_class
64 INTO    p_inventory_item_rec.inventory_item_id,
65         p_inventory_item_rec.org_id ,
66         p_inventory_item_rec.primary_uom_code,
67         p_inventory_item_rec.secondary_uom_code  ,
68         p_inventory_item_rec.inventory_item_flag  ,
69         p_inventory_item_rec.shippable_item_flag  ,
70         p_inventory_item_rec.tracking_quantity_ind  ,
71         p_inventory_item_rec.reservable_type  ,
72         p_inventory_item_rec.primary_uom_class,
73         p_inventory_item_rec.secondary_uom_class
74 FROM   mtl_system_items msi,
75        MTL_UNITS_OF_MEASURE muomt1,
76        MTL_UNITS_OF_MEASURE muomt2
77 WHERE msi.primary_uom_code   = muomt1.uom_code
78   AND msi.secondary_uom_code = muomt2.uom_code(+)
79   AND msi.inventory_item_id  = p_line_rec.inventory_item_id
80   AND msi.organization_id    = p_line_rec.ship_from_org_id;
81 
82    IF l_debug_level > 0 THEN
83       oe_debug_pub.add(' gfe:   tracking_quantity_ind:'  ||p_inventory_item_rec.tracking_quantity_ind);
84       oe_debug_pub.add(' gfe:   shippable_item_flag:'  ||p_inventory_item_rec.shippable_item_flag);
85       oe_debug_pub.add(' gfe:   inventory_item_flag:'  ||p_inventory_item_rec.inventory_item_flag);
86       oe_debug_pub.add(' gfe:   reservable_type:'  ||p_inventory_item_rec.reservable_type);
87    END IF;
88 
89    IF (p_inventory_item_rec.tracking_quantity_ind <> 'PS')   -- 1. not a dual uom item
90        OR NOT (p_inventory_item_rec.shippable_item_flag ='Y' -- 2. ordered item is neither shippable ,NOR reservable NOR Inventory Item in Master item
91              OR p_inventory_item_rec.inventory_item_flag ='Y'
92              OR p_inventory_item_rec.reservable_type = 1) THEN
93 
94                 RETURN FALSE;
95    END IF ;
96 
97    IF l_debug_level > 0 THEN
98       oe_debug_pub.add(' gfe:   checikng wareshouse  '  );
99    END IF;
100 
101    SELECT wms_enabled_flag
102    INTO p_inventory_item_rec.wms_enabled_flag
103    FROM mtl_parameters
104    WHERE organization_id= p_line_rec.ship_from_org_id;
105 
106    IF l_debug_level > 0 THEN
107       oe_debug_pub.add(' gfe:   wms_enabled_flag:  '||p_inventory_item_rec.wms_enabled_flag  );
108    END IF;
109 
110    IF p_inventory_item_rec.wms_enabled_flag ='N'  THEN
111       RETURN FALSE ;-- 3. not a wms org
112    END IF ;
113 
114    IF l_debug_level > 0 THEN
115       oe_debug_pub.add(' gfe:    Item eligible for FULFILLMENT_BASE Calulation' );
116    END IF;
117 
118       RETURN TRUE ;
119 
120 EXCEPTION
121   WHEN OTHERS THEN
122    IF l_debug_level > 0 THEN
123       oe_debug_pub.add(' gfe:   Error in get_fulfillment_eligible API: ' ||sqlerrm);
124    END IF;
125    IF oe_msg_pub.Check_Msg_Level(oe_msg_pub.G_MSG_LVL_UNEXP_ERROR) THEN
126         oe_msg_pub.Add_Exc_Msg
127             (   'OE_DUAL_UOM_UTIL'
128               , 'get_fulfillment_eligible'
129             );
130    END IF;
131    RAISE;
132 
133 END get_fulfillment_eligible;
134 ------------------------------------------------------------------------------------------------------
135 
136 
137 ---------------------------------------------------------------------
138 -- Function get_fulfillment_base
139 --
140 -- GROUP API to return value of fulfillment_base filed on a line.
141 -- IN parameters -
142 -- p_line_rec   : The function will take line_id as input, query oe_order_lines_all table and return value of fulfillment_base field.
143 ---------------------------------------------------------------------
144 Function get_fulfillment_base
145                (   p_line_id  IN NUMBER
146                 ) RETURN VARCHAR2
147       IS
148 
149 l_fulfillment_base  oe_order_lines_all.fulfillment_base%type;
150 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
151  --
152 BEGIN
153 
154 Select fulfillment_base
155     Into l_fulfillment_base
156  From oe_order_lines_all
157 Where line_id = p_line_id  ;
158 
159    IF l_debug_level > 0 THEN
160       oe_debug_pub.add(' gfb:    l_fulfillment_base ' ||l_fulfillment_base);
161    END IF;
162 
163 Return l_fulfillment_base;
164 
165 EXCEPTION
166 WHEN NO_DATA_FOUND THEN
167    IF l_debug_level > 0 THEN
168       oe_debug_pub.add(' gfb:     NoDataFound Error ' ||sqlerrm);
169    END IF;
170  RAISE FND_API.G_EXC_ERROR;
171 
172 WHEN OTHERS THEN
173    IF l_debug_level > 0 THEN
174       oe_debug_pub.add(' gfb:    Other Error ' ||sqlerrm);
175    END IF;
176   RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
177 
178   End ;
179  ------------------------------------------------------------------------------------------------------
180 
181 ---------------------------------------------------------------------
182 -- Function derive_fulfillment_base
183 --
184 --This api will be called from oe_line_util.apply_attribute_changes procedure and to fetch value for
185 --a new database column (fulfillment_base) on the order line to store the fulfillment
186 --BASE which can be Primary (P) or Secondary(S) or NULL. This column gets populated
187 --at the time of UOM Defaulting/Change as well as change of ITEM or WAREHOUSE or Return reference line
188 --(only when new profile OM: Default Fulfillment Base is set to YES)
189 --This API will also be called from OE_Bulk_Process_Line.Populate_Internal_Fields to populate fulfillment_base
190 --column from HVOP flow (for dual uom items only when new profile OM: Default Fulfillment Base is set to YES).
191 -- IN parameters -
192 -- p_line_rec   : The function will take OE_Order_PUB.Line_Rec_Type record contains line_id , org_id ,ship_from_org_id ,
193 --                inventory_item_id etc as input and return CHAR value (Null, 'P' or 'S') .
194 --                'P' implies : Primary
195 --                'S' implies : Secondary
196 --                 Null implies: line not eligible for FB field.
197 ---------------------------------------------------------------------
198 ------------------------------------------------------------------------------------------------------
199 ---It is PVT API as per FDD 3.1.3.3
200 
201 Function derive_fulfillment_base
202 (   p_line_rec                      IN OE_Order_PUB.Line_Rec_Type
203 ) RETURN varchar2
204 IS
205 l_fulfillment_base varchar2(1);
206 l_inventory_item_rec  Inventory_Item_Rec_Type;
207 l_validate_combinition NUMBER;
208 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
209 
210 BEGIN
211 
212 IF l_debug_level > 0 THEN
213  oe_debug_pub.add('In Procedure oe_dual_uom_util.derive_fulfillment_base:   ' ||p_line_rec.fulfillment_base);
214  oe_debug_pub.add('derive_fulfillment_base: Inventory_Item_Id:   ' ||p_line_rec.Inventory_Item_Id);
215  oe_debug_pub.add('derive_fulfillment_base: order_quantity_uom:  ' ||p_line_rec.order_quantity_uom);
216  oe_debug_pub.add('derive_fulfillment_base: ship_from_org_id:    ' ||p_line_rec.ship_from_org_id);
217 END IF;
218 
219 IF      (p_line_rec.Inventory_Item_Id IS NULL  )
220     OR  (p_line_rec.order_quantity_uom IS NULL )
221     OR  (p_line_rec.ship_from_org_id IS NULL   ) THEN
222    IF l_debug_level > 0 THEN
223     oe_debug_pub.add('derive_fulfillment_base: Inventory_Item_Id or order_quantity_uom or Warehouse is null ...return FB as null' );
224    END IF;
225      RETURN NULL;
226  END IF ;
227 
228 IF (NVL(FND_PROFILE.VALUE('ONT_DEFAULT_FULFILLMENT_BASE'),'N')='Y') ---profile (OM: Default Fulfillment Base)
229      AND oe_code_control.code_release_level >= '120202' THEN
230 
231   --- Validate item/warehouse combination on line
232    BEGIN
233     IF l_debug_level  > 0 THEN
234        oe_debug_pub.add(  'derive_fulfillment_base: VALIDATE_ITEM_WAREHOUSE' , 2 ) ;
235     END IF;
236 
237     SELECT 1
238     INTO   l_validate_combinition
239     FROM   mtl_system_items_b msi,
240            org_organization_definitions org
241     WHERE  msi.inventory_item_id= p_line_rec.Inventory_Item_Id
242     AND    org.organization_id=msi.organization_id
243     AND    sysdate<=nvl(org.disable_date,sysdate)
244     AND    org.organization_id=p_line_rec.ship_from_org_id
245     AND    rownum=1 ;
246 
247    EXCEPTION
248      WHEN NO_DATA_FOUND THEN
249           IF l_debug_level > 0 THEN
250              oe_debug_pub.add('derive_fulfillment_base: INVALID ITEM WAREHOUSE COMBINATION',3);
251           END IF;
252           FND_MESSAGE.SET_NAME('ONT','OE_INVALID_ITEM_WHSE');
253           OE_MSG_PUB.Add;
254           RAISE FND_API.G_EXC_ERROR;
255     END ;
256 
257 
258 
259 
260   IF get_fulfillment_eligible(p_line_rec , l_inventory_item_rec ) THEN
261 
262 --1. If line is refrenced RMA then return FB of base order line
263 --------------------------------------------------------------
264      IF p_line_rec.line_category_code = 'RETURN'  AND p_line_rec.return_context IN ('INVOICE' ,'ORDER')
265           AND  p_line_rec.reference_line_id is not null THEN
266 
267        IF l_debug_level > 0 THEN
268           oe_debug_pub.add('derive_fulfillment_base return line code' );
269        END IF;
270 
271        SELECT fulfillment_base
272        INTO l_fulfillment_base
273        FROM oe_order_lines
274        WHERE line_id = p_line_rec.reference_line_id;
275 
276        RETURN l_fulfillment_base;
277 --------------------------------------------------------------
278 --2 .If line is a split line dont do anything  and return fulfillment_base
279 --------------------------------------------------------------
280      ELSIF  p_line_rec.split_from_line_id IS NOT NULL THEN
281 
282        IF l_debug_level > 0 THEN
283           oe_debug_pub.add('derive_fulfillment_base Split line code  ' );
284        END IF;
285 
286        SELECT fulfillment_base
287        INTO l_fulfillment_base
288        FROM oe_order_lines
289        WHERE line_id = p_line_rec.split_from_line_id;
290 
291 
292        RETURN l_fulfillment_base;
293 --------------------------------------------------------------
294 --3 .If Ordered UOM is Priary return primary, if Ordered uom = Sec return FB as sec
295 --------------------------------------------------------------
296      ELSIF  p_line_rec.order_quantity_uom = l_inventory_item_rec.primary_uom_code  THEN
297        IF l_debug_level > 0 THEN
298           oe_debug_pub.add('derive_fulfillment_base: ordered uom same as primary uom');
299        END IF;
300 
301        RETURN 'P';
302 
303      ELSIF  p_line_rec.order_quantity_uom = l_inventory_item_rec.secondary_uom_code  THEN
304        IF l_debug_level > 0 THEN
305           oe_debug_pub.add('derive_fulfillment_base: ordered uom same as secondary uom');
306        END IF;
307 
308        RETURN 'S';
309 --------------------------------------------------------------
310      ELSE
311 --------------------------------------------------------------
312 --4 . Custom Hook, if custom hook return null it means means hook api not used by Ct Or errored out for Ct.
313 -- FDD4.1Output from Custom HOOK is only applicable if it's a WMS Enabled Organization else the default is P.
314 --------------------------------------------------------------
315        IF l_debug_level > 0 THEN
316           oe_debug_pub.add('derive_fulfillment_base: call hook api in else ' ||p_line_rec.fulfillment_base);
317        END IF;
318 
319       l_fulfillment_base := OE_DUAL_UOM_HOOK.get_fulfillment_base (p_line_rec);
320 
321       IF l_fulfillment_base NOT IN ('P','S') AND l_fulfillment_base IS NOT NULL THEN
322        IF l_debug_level > 0 THEN
323           oe_debug_pub.add('derive_fulfillment_base: get_fulfillment_base hook returned invlaid status ' ||l_fulfillment_base);
324        END IF;
325             fnd_message.set_name('ONT',' OE_FB_HOOK_ERROR ');
326             OE_MSG_PUB.Add;
327             RAISE FND_API.G_EXC_ERROR;
328       ELSIF  l_fulfillment_base IS NOT NULL THEN
329            RETURN  l_fulfillment_base;
330       END IF;
331 
332 -------------------------------------------------------------
333 --5 .If Ordered UOM CLASS  is same as Secondary UOM CLASS then return FB as 'S'
334 --------------------------------------------------------------
335         SELECT UOM_CLASS
336           INTO l_inventory_item_rec.ordered_uom_class
337           FROM MTL_UNITS_OF_MEASURE
338          WHERE uom_code = p_line_rec.order_quantity_uom ;
339 
340           IF l_debug_level > 0 THEN
341              oe_debug_pub.add('derive_fulfillment_base:  ordered_uom_class   ' ||l_inventory_item_rec.ordered_uom_class );
342              oe_debug_pub.add('derive_fulfillment_base:  primary_uom_class   ' ||l_inventory_item_rec.primary_uom_class );
343              oe_debug_pub.add('derive_fulfillment_base:  secondary_uom_class ' || l_inventory_item_rec.secondary_uom_class );
344           END IF;
345 
346         IF l_inventory_item_rec.ordered_uom_class = l_inventory_item_rec.primary_uom_class THEN
347           IF l_debug_level > 0 THEN
348              oe_debug_pub.add('derive_fulfillment_base:  ordered uom CLASS same as primary  ,fb=P ' );
349           END IF;
350 
351           RETURN 'P';
352 
353        ELSIF l_inventory_item_rec.ordered_uom_class = l_inventory_item_rec.secondary_uom_class THEN
354           IF l_debug_level > 0 THEN
355              oe_debug_pub.add('derive_fulfillment_base:  ordered uom CLASS same as secondary  ,fb=S ' );
356           END IF;
357 
358           RETURN 'S';
359            --6. If none of above Matches return
360        ELSE
361 
362          IF l_debug_level > 0 THEN
363             oe_debug_pub.add('derive_fulfillment_base:   ordered uom CLASS NOT same as secondary  ,fb=P ' );
364          END IF;
365 
366           RETURN 'P';
367        END IF;
368 
369   END IF; -- p_line_rec.line_category_code
370 
371  ELSE -- IF get_fulfillment_eligible retunred false THEN
372 
373          IF l_debug_level > 0 THEN
374             oe_debug_pub.add('derive_fulfillment_base:    get_fulfillment_eligible returned FALSE ' );
375          END IF;
376 
377  END IF ;-- IF get_fulfillment_eligible THEN
378 END IF; --ONT_DEFAULT_FULFILLMENT_BASE
379 
380 IF l_debug_level > 0 THEN
381    oe_debug_pub.add(' Exiting derive_fulfillment_base with fulfillment_base as null:');
382 END IF ;
383 
384      RETURN NULL;
385   -- as per fdd. for NonWMS org FB= null,so if warehouse changed from WMS(may have fb value) to non wms , we should return FB null
386 
387 EXCEPTION
388   WHEN NO_DATA_FOUND THEN
389          IF l_debug_level > 0 THEN
390             oe_debug_pub.add(' DeriveFB:     NoDataFound Error ' ||sqlerrm);
391          END IF;
392          RAISE FND_API.G_EXC_ERROR;
393  WHEN  FND_API.G_EXC_ERROR THEN
394          IF l_debug_level > 0 THEN
395             oe_debug_pub.add(' DeriveFB:     G_EXC_ERROR ' ||sqlerrm);
396          END IF;
397          RAISE FND_API.G_EXC_ERROR;
398 
399   WHEN OTHERS THEN
400             IF l_debug_level > 0 THEN
401                oe_debug_pub.add(' DeriveFB:   Error in derive_fulfillment_base API: ' ||sqlerrm);
402             END IF;
403             IF oe_msg_pub.Check_Msg_Level(oe_msg_pub.G_MSG_LVL_UNEXP_ERROR) THEN
404                  oe_msg_pub.Add_Exc_Msg
405                      (   'OE_DUAL_UOM_UTIL'
406                        , 'derive_fulfillment_base'
407                      );
408             END IF;
409           RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
410 END derive_fulfillment_base ;
411 
412 ------------------------------------------------------------------------------------------------------
413 ---------------------------------------------------------------------
414 -- PROCEDURE validate_fulfillment_base
415 --
416 --
417 --This api will be called from oe_line_util.apply_attribute_changes procedure when
418 -- FB on a line is changing form null/P to S or vice versa. The API will validate
419 -- if the change should be allowed on FB field...if not it will raise error
420 -- IN parameters -
421 -- p_line_rec   : The proeudre will for validation of fulfillment_base field from OE_Order_PUB.Line_Rec_Type
422 ---------------------------------------------------------------------
423 PROCEDURE validate_fulfillment_base
424 (   p_line_rec                    IN OE_Order_PUB.Line_Rec_Type
425 )
426 IS
427 l_pick_status	   VARCHAR2(1);
428 l_ret_exists       VARCHAR2(1);
429 l_return_status    VARCHAR2(1);
430 l_ful_base VARCHAR2(1);
431 
432 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
433 BEGIN
434 
435 -------------------------------
436 --VALIDATIONS on new FB vlaue:
437 -------------------------------
438              IF l_debug_level > 0 THEN
439                 oe_debug_pub.add('Entering validate_fulfillment_base :' );
440              END IF;
441 
442 -- 1 VALIDATION.     IF line IS pick released AND fulfillment_base has changed the throw error ,treating null same as P.
443              BEGIN
444                   l_pick_status := NULL;
445 
446                      SELECT 'Y'
447                      INTO   l_pick_status
448                      FROM   WSH_DELIVERY_LINE_STATUS_V
449                      WHERE  SOURCE_CODE = 'OE'
450                      AND    SOURCE_LINE_ID = p_line_rec.line_id
451                      AND    PICK_STATUS IN('C','Y','S');
452 
453              EXCEPTION
454                      WHEN  NO_DATA_FOUND THEN
455                             l_pick_status := NULL ;
456                      WHEN  TOO_MANY_ROWS THEN
457                             l_pick_status :='Y';  --y for staged/picked/shipped
458                      WHEN OTHERS THEN
459                     l_pick_status := NULL ;
460              END;
461 
462              IF l_debug_level > 0 THEN
463                  oe_debug_pub.add('Validating FB: After pick query l_pick_status: ' ||l_pick_status);
464              END IF;
465 
466              IF Nvl (l_pick_status,'X') = 'Y' THEN
467                 fnd_message.set_name('ONT','OE_CANNOT_UPD_FB');
468                 OE_MSG_PUB.Add;
469                 RAISE FND_API.G_EXC_ERROR;
470              END IF;
471 
472 --- 2 VALIDATION. If an Open refernce line exists against current line and have non null and different value of FB , then cannot change FB on original line.
473 /*
474 The validation query below will only check for reference lines having non null value of FB...
475 
476  Test Case:-  line 1.1 has FB =P , return line 2.1 references line 1.1 ,but has a non wms Warehouse, so FB= null (on line 2.1)
477 Suppose there is a update(like change in UOM) on line 1.1 which causes FB on line 1.1 to change to S .... this change be allowed
478 ,since referenced RMA against the line has null FB, (which means non wms warehouse on line, so whenever in future, warehouse on line 2.1 is modified to a wms warehouse ,
479 it will take value of FB from line 1.1 and copy it to 2.1).
480 
481 */
482 
483 	     BEGIN
484                l_ret_exists:= NULL;
485 
486 
487                 SELECT DISTINCT fulfillment_base
488                 INTO  l_ful_base
489                 FROM  oe_order_lines_all
490                 WHERE line_category_code= 'RETURN'
491                 AND   return_context IN ('INVOICE' ,'ORDER')
492                 AND   fulfillment_base IS NOT NULL
493                 AND   reference_line_id = p_line_rec.line_id ;
494                 IF l_debug_level > 0 THEN
495                     oe_debug_pub.add('Validating FB: After return line query l_ful_base: ' ||l_ful_base);
496                 END IF;
497 
498 
499                 IF  l_ful_base <> Nvl(p_line_rec.fulfillment_base,'P') THEN
500                       l_ret_exists:='Y'  ;   --y as more than one refernce line exists having non null FB
501                 END IF;
502 
503              EXCEPTION
504                 WHEN  NO_DATA_FOUND THEN
505                         l_ret_exists := NULL ;
506                 WHEN  TOO_MANY_ROWS THEN
507                         l_ret_exists :='Y';  --y as more than one refernce line exists having non null FB
508              END;
509                 IF l_debug_level > 0 THEN
510                     oe_debug_pub.add('Validating FB: After return line query l_ret_exists: ' ||l_ret_exists);
511                 END IF;
512 
513                IF Nvl (l_ret_exists,'X') = 'Y' THEN
514                 fnd_message.set_name('ONT','OE_CANNOT_UPD_RET_FB');
515                 OE_MSG_PUB.Add;
516                 RAISE FND_API.G_EXC_ERROR;
517                END IF;
518 
519 ---3 VALIDATION. G_VALIDATE_LINE_SET request is also logged in oe_line_util.pre_write for p_line_rec.operation = oe_globals.g_opr_update
520 --    to ensure that fulfillment base is same on a line set...---Below condtion added for bug 16731675
521                IF l_debug_level > 0 THEN
522                 oe_debug_pub.ADD('Validating FB: p_x_line_rec.operation '|| p_line_rec.operation ,1);
523                 oe_debug_pub.ADD('Validating FB: p_x_line_rec.split_action_code '||p_line_rec.split_action_code ,1);
524                 oe_debug_pub.ADD('Validating FB: p_x_line_rec.line_set_id '||p_line_rec.line_set_id ,1);
525                END IF;
526 
527                   IF (p_line_rec.operation = oe_globals.g_opr_create) AND
528                       NOT (p_line_rec.split_action_code IS NOT NULL AND
529                            p_line_rec.split_action_code <> FND_API.G_MISS_CHAR) AND
530                       (p_line_rec.line_set_id IS NOT NULL AND
531                        p_line_rec.line_set_id <> FND_API.G_MISS_NUM) THEN
532 
533                      IF l_debug_level > 0 THEN
534                        oe_debug_pub.ADD('Validating FB: logging G_VALIDATE_LINE_SET ',1);
535                      END IF;
536 
537                       OE_Delayed_Requests_Pvt.Log_Request(
538                        p_entity_code              => OE_GLOBALS.G_ENTITY_LINE,
539                        p_entity_id                => p_line_rec.line_set_id,
540                        p_requesting_entity_code   => OE_GLOBALS.G_ENTITY_LINE,
541                        p_requesting_entity_id     => p_line_rec.line_id,
542                        p_request_type             => OE_GLOBALS.G_VALIDATE_LINE_SET,
543                        x_return_status            => l_return_status);
544                   END IF;--end of bug 16731675
545 --------------------------------------------------------------------------------------------------------------
546 
547              IF l_debug_level > 0 THEN
548                oe_debug_pub.add('validate_fulfillment_base : Exit validate_fulfillment_base ' );
549              END IF;
550  END validate_fulfillment_base;
551 
552 END OE_DUAL_UOM_UTIL;