DBA Data[Home] [Help]

PACKAGE BODY: APPS.MSC_PEG_UTIL

Source


4 procedure  get_disposition_id(p_demand_id IN NUMBER,
1 PACKAGE BODY MSC_PEG_UTIL AS
2 /*  $Header: MSCPEGB.pls 120.2 2007/12/14 07:02:28 sbnaik ship $ */
3 
5                                x_disposition_id   OUT NOCOPY NUMBER,
6                                x_origination_type OUT NOCOPY NUMBER,
7                                p_sr_instance_id   IN  NUMBER,
8                                p_organization_id  IN  NUMBER,
9                                p_plan_id          IN  NUMBER)  IS
10 
11 cursor origination_22 is
12 select origination_type, disposition_id
13 from msc_demands
14 where demand_id = p_demand_id
15 and plan_id = p_plan_id
16 and organization_id = p_organization_id
17 and sr_instance_id  = p_sr_instance_id;
18 
19 
20 begin
21 
22 open origination_22;
23 fetch origination_22 into x_origination_type, x_disposition_id;
24 close origination_22;
25 
26 exception when others THEN
27 raise;
28 end get_disposition_id;
29 
30 Procedure get_suptree_sup_values(p_plan_id    IN NUMBER,
31                             p_demand_id       IN NUMBER,
32                             p_sr_instance_id  IN NUMBER,
33                             p_organization_id IN NUMBER,
34                             p_prev_peg_id     IN NUMBER,
35                   x_itemorg_pegnode_rec  OUT NOCOPY MSC_PEG_UTIL.itemorg_pegnode_rec,
36                             p_supply_pegging  IN NUMBER DEFAULT 0) -- demand pegging ( up peg)
37 IS
38 l_disposition_id   NUMBER;
39 l_origination_type NUMBER;
40 l_prev_peg_id      NUMBER;
41 BEGIN
42     get_disposition_id(p_demand_id,
43                        l_disposition_id,
44                        l_origination_type,
45                        p_sr_instance_id,
46                        p_organization_id,
47                        p_plan_id);
48 -- this case is for Demand Pegging ( peg up from children to parents)
49  IF  p_supply_pegging  = 0 THEN  -- Demand Pegging ( peg up)
50   -- This case is when you are on Production Forecast and you expand a Demand Tree meaning
51   -- u are  pegging up so the next node should be Product Family Planned Order
52    IF l_origination_type = 22  THEN
53     select  mis.item_name ||'/'||
54           msc_get_name.org_code(ms.organization_id,ms.sr_instance_id) item_org,
55           ms.new_order_quantity supply_qty,
56           ms.new_schedule_date  supply_date,
57           msc_get_name.lookup_meaning( 'MRP_ORDER_TYPE',
58                                      ms.order_type) order_name,
59           null  pegging_id,
60           null  prev_pegging_id,
61           ms.transaction_id,
62           p_demand_id demand_id,
63           ms.new_order_quantity pegged_qty,
64           ms.inventory_item_id,
65           ms.order_type,
66           null  disposition
67   bulk collect into
68        x_itemorg_pegnode_rec.Item_Org,
69        x_itemorg_pegnode_rec.Qty,
70        x_itemorg_pegnode_rec.Peg_Date,
71        x_itemorg_pegnode_rec.Order_name,
72        x_itemorg_pegnode_rec.Pegging_id,
73        x_itemorg_pegnode_rec.Prev_pegging_id,
74        x_itemorg_pegnode_rec.Transaction_id,
75        x_itemorg_pegnode_rec.Demand_id,
76        x_itemorg_pegnode_rec.Pegged_qty,
77        x_itemorg_pegnode_rec.Item_id,
78        x_itemorg_pegnode_rec.Order_type,
79        x_itemorg_pegnode_rec.Disposition
80   from    msc_items mis,
81           msc_supplies ms
82   where   mis.inventory_item_id = ms.inventory_item_id
83   and     ms.transaction_id     = l_disposition_id
84   and     ms.plan_id            = p_plan_id
85   and     ms.organization_id    = p_organization_id
86   and     ms.sr_instance_id     = p_sr_instance_id;
87 
88   ELSE
89    select distinct
90           item_org,
91           supply_qty,
92           supply_date,
93           order_name,
94           pegging_id,
95           prev_pegging_id,
96           transaction_id,
97           demand_id,
98           pegged_qty,
99           inventory_item_id,
100           order_type,
101           disposition
102   bulk collect into
103        x_itemorg_pegnode_rec.Item_Org,
104        x_itemorg_pegnode_rec.Qty,
105        x_itemorg_pegnode_rec.Peg_Date,
106        x_itemorg_pegnode_rec.Order_name,
107        x_itemorg_pegnode_rec.Pegging_id,
108        x_itemorg_pegnode_rec.Prev_pegging_id,
109        x_itemorg_pegnode_rec.Transaction_id,
110        x_itemorg_pegnode_rec.Demand_id,
111        x_itemorg_pegnode_rec.Pegged_qty,
112        x_itemorg_pegnode_rec.Item_id,
113        x_itemorg_pegnode_rec.Order_type,
114        x_itemorg_pegnode_rec.Disposition
115   from msc_flp_demand_supply_v
116   where plan_id = p_plan_id
117   and pegging_id = p_prev_peg_id
118   order by item_org, supply_date;
119 
120    END IF;
121 
122 -- This case if for Supply Pegging ( peg down from demand node of parent item to supply node of child)
123  ELSIF p_supply_pegging = 1 THEN
124 -- This case if when you are on Production Forecast Node and it is Supply Pegging
125 -- so the next node should be Planned order of the Member item
126    IF  l_origination_type = 22 and p_prev_peg_id is NULL THEN
127        l_prev_peg_id := -1 ;
131 
128    ELSE
129        l_prev_peg_id := p_prev_peg_id;
130    END IF;
132  select distinct item_org,
133                  supply_qty,
134                  supply_date,
135                  order_name,
136                  pegging_id,
137                  prev_pegging_id,
138                  transaction_id,
139                  demand_id,
140                  pegged_qty,
141                  inventory_item_id,
142                  order_type,
143                  disposition
144   bulk collect into
145        x_itemorg_pegnode_rec.Item_Org,
146        x_itemorg_pegnode_rec.Qty,
147        x_itemorg_pegnode_rec.Peg_Date,
148        x_itemorg_pegnode_rec.Order_name,
149        x_itemorg_pegnode_rec.Pegging_id,
150        x_itemorg_pegnode_rec.Prev_pegging_id,
151        x_itemorg_pegnode_rec.Transaction_id,
152        x_itemorg_pegnode_rec.Demand_id,
153        x_itemorg_pegnode_rec.Pegged_qty,
154        x_itemorg_pegnode_rec.Item_id,
155        x_itemorg_pegnode_rec.Order_type,
156        x_itemorg_pegnode_rec.Disposition
157   from      msc_flp_demand_supply_v
158   where     plan_id = p_plan_id
159         and prev_pegging_id = l_prev_peg_id
160         and demand_id = p_demand_id
161         and order_type not in (15,16,28)
162         order by item_org, supply_date;
163 
164 END IF;
165 
166 
167 END get_suptree_sup_values;
168 
169 Procedure get_suptree_dem_values(p_plan_id  IN NUMBER,
170                       p_transaction_id      IN NUMBER,
171                       x_itemorg_pegnode_rec     OUT NOCOPY  MSC_PEG_UTIL.itemorg_pegnode_rec,
172                       p_item_id             IN NUMBER,
173                       p_pegging_id          IN NUMBER,
174                       p_instance_id         IN NUMBER,
175                       p_trigger_node_type   IN NUMBER DEFAULT 2,
176                       p_condense_supply_oper IN NUMBER DEFAULT 0,
177                       p_hide_oper            IN NUMBER DEFAULT 0,
178                       p_organization_id      IN NUMBER DEFAULT NULL,
179                       p_supply_pegging        IN NUMBER DEFAULT 0) IS
180 
181 cursor bom_item_type (p_inventory_item_id in NUMBER) IS
182 select bom_item_type
183 from   msc_system_items
184 where  inventory_item_id = p_inventory_item_id
185 and    plan_id           = p_plan_id
186 and    sr_instance_id    = p_instance_id;
187 
188 -- Sometimes after button Supply Pegging is clicked  pld is not sending  item_id
189 cursor inventory_item_id IS
190 select inventory_item_id
191 from msc_supplies
192 where transaction_id = p_transaction_id
193 and   plan_id        = p_plan_id
194 and   sr_instance_id = p_instance_id
195 and   organization_id = p_organization_id;
196 
197 l_bom_item_type NUMBER;
198 PARENT          NUMBER :=1 ;
199 l_item_id       NUMBER;
200 
201 BEGIN
202 
203 if p_item_id is NULL then
204 open inventory_item_id;
205 fetch inventory_item_id INTO l_item_id;
206 close inventory_item_id;
207 else
208 l_item_id := p_item_id;
209 end if;
210 
211 open bom_item_type(l_item_id);
212 fetch bom_item_type INTO l_bom_item_type;
213 close bom_item_type;
214 
215  -- A user is on Supply Tree and button Supply Pegging has been used
216  IF p_supply_pegging = 1 and l_bom_item_type <> 5   then
217  /*
218   bug #3525195  modify a  SQL statement to get dependant demands for supply root node .
219 */
220  select  item_org,
221          demand_qty,
222          demand_date,
223          origination_name,
224          prev_pegging_id,
225          demand_id,
226          sum(pegged_qty) pegged_qty,
227          item_id,
228          order_type,
229          end_disposition order_number,
230          null pegging_id ,
231          null transaction_id,
232          null end_demand_class
233 bulk collect into
234        x_itemorg_pegnode_rec.Item_Org,
235        x_itemorg_pegnode_rec.Qty,
236        x_itemorg_pegnode_rec.Peg_date,
237        x_itemorg_pegnode_rec.Order_name,
238        x_itemorg_pegnode_rec.Prev_pegging_id,
239        x_itemorg_pegnode_rec.Demand_id,
240        x_itemorg_pegnode_rec.Pegged_qty,
241        x_itemorg_pegnode_rec.Item_id,
242        x_itemorg_pegnode_rec.order_type,
243        x_itemorg_pegnode_rec.order_number,
244        x_itemorg_pegnode_rec.Pegging_id,
245        x_itemorg_pegnode_rec.Transaction_id,
246        x_itemorg_pegnode_rec.end_demand_class
247 from msc_flp_supply_demand_v
248     where plan_id = p_plan_id
249     and prev_pegging_id in ( select pegging_id
250 				  from msc_full_pegging
251 				  where plan_id       = p_plan_id
252 				  and transaction_id  = p_transaction_id
253 				  and sr_instance_id  = p_instance_id
254 				  and allocated_quantity > 0)  ------ = p_pegging_id
255     and item_id not in (SELECT msi.inventory_item_id
256                         FROM msc_resource_requirements req,
257                         msc_routings rout,
258                         msc_routing_operations op,
259                         msc_operation_components moc,
260                         msc_bom_components mbc,
261                         msc_system_items msi
262                         WHERE req.plan_id = rout.plan_id
263                         AND req.sr_instance_id = rout.sr_instance_id
264                         AND nvl(req.routing_sequence_id,-23453) = decode(nvl(req.routing_sequence_id,-23453), -23453,-23453, rout.routing_sequence_id)
265                         AND req.plan_id = op.plan_id
266                         AND req.sr_instance_id = op.sr_instance_id
270                         and moc.plan_id = req.plan_id
267                         AND nvl(req.routing_sequence_id,-23453) = decode(nvl(req.routing_sequence_id,-23453), -23453, -23453, op.routing_sequence_id)
268                         AND req.operation_sequence_id = op.operation_sequence_id
269                         AND nvl(req.parent_id,2) = 2
271                         and moc.sr_instance_id = req.sr_instance_id
272                         and moc.operation_sequence_id = req.operation_sequence_id
273                         and nvl(req.routing_sequence_id,-23453) = decode(nvl(req.routing_sequence_id,-23453), -23453, -23453, moc.routing_sequence_id)
274                         and moc.plan_id  = mbc.plan_id
275                         and moc.sr_instance_id = mbc.sr_instance_id
276                         and moc.organization_id = mbc.organization_id
277                         and moc.component_sequence_id    = mbc.component_sequence_id
278                         and moc.bill_sequence_id   = mbc.bill_sequence_id
279                         and mbc.plan_id = msi.plan_id
280                         and mbc.sr_instance_id = msi.sr_instance_id
281                         and mbc.organization_id = msi.organization_id
282                         and mbc.inventory_item_id = msi.inventory_item_id
283                         and req.plan_id = p_plan_id
284                         and req.sr_instance_id = p_instance_id
285                         and req.organization_id = p_organization_id
286                         and req.supply_id = p_transaction_id
287                         and 0 = nvl(p_condense_supply_oper,0)
288                         and 0 = nvl(p_hide_oper,0))
289     group by demand_qty, demand_date,
290         origination_name, prev_pegging_id, demand_id,
291         item_id, item_org, order_type, end_disposition
292   order by item_org, demand_date;
293 
294  ELSIF  p_supply_pegging = 1 and l_bom_item_type = 5  then
295 -- this case is for Product Family , we need to display the Product Forecast nodes when node is expanded
296   select mis.item_name ||'/'||
297          msc_get_name.org_code(dm.organization_id,dm.sr_instance_id) item_org,
298          dm.using_requirement_quantity demand_qty,
299          dm.using_assembly_demand_date demand_date,
300          msc_get_name.lookup_meaning( 'MRP_DEMAND_ORIGINATION',
301                                      dm.origination_type) origination_name,
302          null prev_pegging_id,
303          dm.demand_id  demand_id,
304          dm.using_requirement_quantity pegged_qty,
305          mis.inventory_item_id item_id,
306          dm.origination_type,
307          null order_number,
308          null pegging_id,
309          null transaction_id,
310          null end_demand_class
311 bulk collect into
312        x_itemorg_pegnode_rec.Item_Org,
313        x_itemorg_pegnode_rec.Qty,
314        x_itemorg_pegnode_rec.Peg_date,
315        x_itemorg_pegnode_rec.Order_name,
316        x_itemorg_pegnode_rec.Prev_pegging_id,
317        x_itemorg_pegnode_rec.Demand_id,
318        x_itemorg_pegnode_rec.Pegged_qty,
319        x_itemorg_pegnode_rec.Item_id,
320        x_itemorg_pegnode_rec.order_type,
321        x_itemorg_pegnode_rec.order_number,
322        x_itemorg_pegnode_rec.Pegging_id,
323        x_itemorg_pegnode_rec.Transaction_id,
324        x_itemorg_pegnode_rec.end_demand_class
325   from  msc_items mis,
326         msc_demands dm
327   where mis.inventory_item_id = dm.inventory_item_id
328   and   dm.disposition_id     = p_transaction_id
329   and   plan_id               = p_plan_id
330   and   organization_id       = p_organization_id
331   and   sr_instance_id        = p_instance_id;
332 
333 
334  ELSIF  p_supply_pegging <> 1  then
335 
336   IF l_bom_item_type = 5 OR p_trigger_node_type = PARENT THEN
337    select distinct
338         item_org,
339         pegging_id,
340         prev_pegging_id,
341         demand_qty,
342         demand_date,
343         origination_name,
344         demand_id,
345         transaction_id,
346         item_id,
347         pegged_qty,
348         end_disposition order_number,
349         order_type,
350         end_demand_class
351 bulk collect into
352        x_itemorg_pegnode_rec.Item_Org,
353        x_itemorg_pegnode_rec.Pegging_id,
354        x_itemorg_pegnode_rec.Prev_pegging_id,
355        x_itemorg_pegnode_rec.Qty,
356        x_itemorg_pegnode_rec.Peg_Date,
357        x_itemorg_pegnode_rec.Order_name,
358        x_itemorg_pegnode_rec.demand_id,
359        x_itemorg_pegnode_rec.transaction_id,
360        x_itemorg_pegnode_rec.item_id,
361        x_itemorg_pegnode_rec.Pegged_qty,
362        x_itemorg_pegnode_rec.order_number,
363        x_itemorg_pegnode_rec.order_type,
364        x_itemorg_pegnode_rec.end_demand_class
365 from msc_flp_supply_demand_v
366 where plan_id =      p_plan_id
367 and sr_instance_id = p_instance_id
368 and transaction_id = p_transaction_id
369 order by item_org, demand_date;
370 
371 ELSE
372  select distinct
373         item_org,
374         pegging_id,
375         prev_pegging_id,
376         demand_qty,
377         demand_date,
378         origination_name,
379         demand_id,
380         transaction_id,
381         item_id,
382         pegged_qty,
383         end_disposition order_number,
384         order_type,
385         end_demand_class
386 bulk collect into
387        x_itemorg_pegnode_rec.Item_Org,
388        x_itemorg_pegnode_rec.Pegging_id,
389        x_itemorg_pegnode_rec.Prev_pegging_id,
390        x_itemorg_pegnode_rec.Qty,
391        x_itemorg_pegnode_rec.Peg_date,
392        x_itemorg_pegnode_rec.Order_name,
393        x_itemorg_pegnode_rec.Demand_id,
397        x_itemorg_pegnode_rec.order_number,
394        x_itemorg_pegnode_rec.transaction_id,
395        x_itemorg_pegnode_rec.item_id,
396        x_itemorg_pegnode_rec.Pegged_qty,
398        x_itemorg_pegnode_rec.order_type,
399        x_itemorg_pegnode_rec.end_demand_class
400 from msc_flp_supply_demand_v
401 where plan_id = p_plan_id
402 and  pegging_id  = p_pegging_id
403 order by item_org, demand_date;
404 END IF;
405 end if;
406 
407 EXCEPTION WHEN others THEN
408 raise;
409 END  get_suptree_dem_values;
410 
411 
412 Procedure get_demtree_dem_values( p_plan_id                IN NUMBER,
413                                   p_transaction_id         IN NUMBER,
414                                   x_itemorg_pegnode_rec    OUT NOCOPY  MSC_PEG_UTIL.itemorg_pegnode_rec,                                  p_instance_id            IN NUMBER,
415                                   p_organization_id        IN NUMBER,
416                                   p_bom_item_type          IN NUMBER)              IS
417 
418 BEGIN
419  IF p_bom_item_type in (1, 2)  THEN  -- this means we just want to get Prod.Forecast of Options when we
420 
421                                -- drill down from ATO Model with Forecast control set to NONE
422   select mis.item_name ||'/'||
423          msc_get_name.org_code(dm.organization_id,dm.sr_instance_id) item_org,
424          dm.using_requirement_quantity demand_qty,
425          dm.using_assembly_demand_date demand_date,
426          msc_get_name.lookup_meaning( 'MRP_DEMAND_ORIGINATION',
427                                      dm.origination_type) origination_name,
428          null prev_pegging_id,
429          dm.demand_id  demand_id,
430          dm.using_requirement_quantity pegged_qty,
431          mis.inventory_item_id item_id,
432          dm.origination_type,
433          null order_number,
434          null pegging_id,
435          null transaction_id,
436          null end_demand_class
437   bulk collect into
438        x_itemorg_pegnode_rec.Item_Org,
439        x_itemorg_pegnode_rec.Qty,
440        x_itemorg_pegnode_rec.Peg_date,
441        x_itemorg_pegnode_rec.Order_name,
442        x_itemorg_pegnode_rec.Prev_pegging_id,
443        x_itemorg_pegnode_rec.Demand_id,
444        x_itemorg_pegnode_rec.Pegged_qty,
445        x_itemorg_pegnode_rec.Item_id,
446        x_itemorg_pegnode_rec.order_type,
447        x_itemorg_pegnode_rec.order_number,
448        x_itemorg_pegnode_rec.Pegging_id,
449        x_itemorg_pegnode_rec.Transaction_id,
450        x_itemorg_pegnode_rec.end_demand_class
451   from  msc_items mis,
452         msc_demands dm
453   where mis.inventory_item_id = dm.inventory_item_id
454   and   dm.disposition_id     = p_transaction_id
455   and   plan_id               = p_plan_id
456   and   organization_id       = p_organization_id
457   and   sr_instance_id        = p_instance_id
458   and   dm.origination_type   = 22;
459 END IF;
460 
461 
462 END get_demtree_dem_values;
463 
464 
465 Procedure get_label_and_nodevalue(Item_org             IN VARCHAR2,
466                                   Qty                  IN NUMBER,
467                                   Pegged_qty           IN NUMBER,
468                                   Peg_date             IN DATE,
469                                   Order_name           IN VARCHAR2,
470                                   end_demand_class     IN VARCHAR2,
471                                   order_type           IN NUMBER,
472                                   Disposition          IN NUMBER,
473                                   Pegging_id           IN NUMBER,
474                                   Prev_pegging_id      IN NUMBER,
475                                   Demand_id            IN NUMBER,
476                                   Transaction_id       IN NUMBER,
477                                   Item_id              IN NUMBER,
478                                   x_node_value          OUT NOCOPY VARCHAR2,
479                                   x_node_label          OUT NOCOPY VARCHAR2,
480                                   p_tmp                 IN  NUMBER,
481                                   p_supply_org_id       IN  NUMBER,
482                                   pvt_so_number         IN  VARCHAR2,
483                                   pvt_l_node_number     IN  NUMBER,
484                                   p_constr_label        IN  BOOLEAN default FALSE,
485                                   p_node_type           IN  NUMBER  default 1,
486                                   p_calling_module      IN  NUMBER  default 1 ,
487 				  p_prev_pegging_value  IN  NUMBER default null  )
488 
489 -- p_calling_modele : 1- Planner WB, 2 - Allocation WB.
490 
491 -- p_type_node 1 - Demand, 2-Supply
492 IS
493 BEGIN
494 
495 
496 IF p_constr_label THEN
497    -- Constructing the label for demand nodes
498 
499    fnd_message.set_name('MSC','MSC_PEGGING_LABEL2');
500    fnd_message.set_token('ITEM_ORG',Item_org);
501    fnd_message.set_token('QTY',nvl(Qty,0));
502    fnd_message.set_token('PEGGED_QTY',nvl(Pegged_qty,0));
503    fnd_message.set_token('DATE',fnd_date.date_to_chardt(Peg_date));
504 
505    null;
506   if p_node_type = 1  then -- Demand
507     if ( p_tmp in (6,30) )   then
508      -- 6 sales orders mds
509      -- 30 sales order
510      if p_calling_module = 1 then
511      fnd_message.set_token('ORDER_TYPE',Order_name||' '||
512                                         pvt_so_number);
513      else
514      null;
515        fnd_message.set_token('ORDER_TYPE',Order_name||' '||
516                                         pvt_so_number||end_demand_class);
517      end if;
518     elsif ( p_tmp in (8,29) ) then
522 
519       -- 8 manual mds
520       -- 29 forecast
521      if p_calling_module = 1 then
523      fnd_message.set_token('ORDER_TYPE',Order_name||' '||
524                                        pvt_so_number);
525      else
526 
527         fnd_message.set_token('ORDER_TYPE',Order_name||' '||
528                                         pvt_so_number||end_demand_class);
529      end if;
530 
531     else
532      fnd_message.set_token('ORDER_TYPE',Order_name);
533     end if;
534   else  -- Supply
535      if order_type in ( 1,2,3) THEN
536       fnd_message.set_token('ORDER_TYPE',Order_name||' '||
537                                 pvt_so_number);
538      else
539        fnd_message.set_token('ORDER_TYPE',Order_name);
540      end if;
541   end if;
542    x_node_label := fnd_message.get;
543 ELSE
544    x_node_label := NULL;
545 END IF;
546    IF p_calling_module  = 1 then
547  -- Constructing the node value
548 
549      x_node_value := to_char(nvl(Pegging_id,-111))
550                     ||fnd_global.local_chr(58)||to_char(nvl(Prev_pegging_id,-111))
551                     ||fnd_global.local_chr(58)||to_char(nvl(Demand_id,-111))
552                     ||fnd_global.local_chr(58)||to_char(nvl(Transaction_id,-111))
553                     ||fnd_global.local_chr(58)||to_char(nvl(p_supply_org_id,-111))
554                     ||fnd_global.local_chr(58)|| to_char(nvl(Pegging_id,-111))
555                     ||fnd_global.local_chr(58)||to_char(nvl(Prev_pegging_id,-111));
556 
557 
558      if p_node_type = 1  then  -- demand
559 
560       x_node_value := x_node_value
561                     ||fnd_global.local_chr(58)||to_char(nvl(Demand_id,-111))
562                     ||fnd_global.local_chr(58)||to_char(nvl(Item_id,-111))
563                     ||fnd_global.local_chr(58)||' -111 '||fnd_global.local_chr(58)||to_char(pvt_l_node_number + 1);
564 
565 
566      else
567       x_node_value := x_node_value
568                     ||fnd_global.local_chr(58)||to_char(nvl(Transaction_id,-111))
569                     ||fnd_global.local_chr(58)||to_char(nvl(Item_id,-111))
570                     ||fnd_global.local_chr(58)||to_char(nvl(p_prev_pegging_value ,-111))||fnd_global.local_chr(58)||to_char(pvt_l_node_number + 1);
571 ---bug #3556405
572     end if;
573   ELSE
574     if p_node_type  = 1 then -- expanding to demands nodes
575      x_node_value :=   to_char(nvl(pegging_id,-111))
576                 ||' '||to_char(nvl(prev_pegging_id,-111))
577                 ||' '||to_char(nvl(demand_id,-111))
578                 ||' '||to_char(nvl(item_id,-111))
579                 ||' -111 '||pvt_l_node_number;
580    else
581      x_node_value := to_char(nvl(pegging_id,-111))||' '||
582                      to_char(nvl(prev_pegging_id,-111))||' '||
583                      to_char(nvl(transaction_id,-111))||' '||
584                      to_char(nvl(item_id,-111))||' ';
585    end if;
586 
587  END IF;
588 
589 end get_label_and_nodevalue;
590 
591 END MSC_PEG_UTIL ;