DBA Data[Home] [Help]

PACKAGE BODY: APPS.PO_RESERVATION_MAINTAIN_SV

Source


1 PACKAGE BODY PO_RESERVATION_MAINTAIN_SV AS
2 /* $Header: POXMRESB.pls 120.8 2006/06/23 10:45:45 scolvenk noship $ */
3 --
4 -- Purpose: To maintain reservation
5 --
6 -- MODIFICATION HISTORY
7 -- Person      Date     Comments
8 -- ---------   ------   ------------------------------------------
9 -- rsnair      08/31/01 Created Package
10 -- ksareddy	   04/29/2002 Bug fix 2341308
11 --
12 
13 
14   --------------------------------------------------------------------------------
15   --Start of Comments
16   --Name: MAINTAIN_RESERVATION
17   --Pre-reqs:
18   --  None.
19   --Modifies:
20   --  None.
21   --Locks:
22   --  None.
23   --Function:
24   --  This  would call out to INV_MAINTAIN_RESERVATION_PUB.MAINTAIN_RESERVATION
25   --  to maintain reservation for PO supply sources.
26   --Parameters:
27   --IN:
28   -- p_header_id
29   --     header id of the supply source
30   -- p_line_id
31   --     line id of the supply source
32   -- p_line_location_id
33   --      shipment id of the supply source
34   -- p_distribution_id
35   --      distribution id of the supply source
36   -- p_recreate_demand_flag
37   --       indicates whether the demand would be recreated
38   --       upon cancellation of supply source
39   --        values
40   --        'Y'   Demand would be recreated
41   --        'N'   Demand would not be recreated
42   -- p_called_from_reqimport
43   --        indicates whether it is called from req import
44   -- p_ordered_quantity
45   --        passed from OM to reflect the new ordered quantity
46   --        incase the qunatity on SO is updated
47   -- p_ordered_uom
48   --        passed from OM to reflect the uom which might have been changed on ISO
49   --OUT:
50   -- x_return_status
51   --        return status of the reservation routines
52   --End of Comments
53   -------------------------------------------------------------------------------
54   PROCEDURE MAINTAIN_RESERVATION
55   (
56    p_header_id                IN NUMBER
57   ,p_line_id                  IN NUMBER
58   ,p_line_location_id         IN NUMBER
59   ,p_distribution_id          IN NUMBER
60   ,p_action                   IN VARCHAR2
61   ,p_recreate_demand_flag     IN VARCHAR2
62   ,p_called_from_reqimport    IN VARCHAR2
63   ,p_ordered_quantity         IN NUMBER   DEFAULT NULL --<R12 PLAN CROSS DOCK>
64   ,p_transaction_id           IN NUMBER   DEFAULT NULL --<R12 PLAN CROSS DOCK>
65   ,p_ordered_uom              IN VARCHAR2 DEFAULT NULL --5253916
66   ,x_return_status            OUT NOCOPY VARCHAR2)
67   IS
68 
69 
70   l_ret_sts         VARCHAR2(1);
71   l_bool_ret_sts    BOOLEAN;
72 
73   l_msg_data        VARCHAR2(2000);
74   l_msg_count       NUMBER;
75   l_return_status VARCHAR2(1);
76 
77   d_progress        NUMBER;
78   d_module          VARCHAR2(60) := 'po.plsql.PO_RESERVATION_MAINTAIN_SV.maintain_reservation';
79 
80 BEGIN
81 
82 
83     d_progress := 0;
84     IF (PO_LOG.d_proc) THEN
85       PO_LOG.proc_begin(d_module);
86       PO_LOG.proc_begin(d_module, 'p_header_id', p_header_id);
87       PO_LOG.proc_begin(d_module, 'p_line_id',p_line_id );
88       PO_LOG.proc_begin(d_module, 'p_line_location_id',p_line_location_id );
89       PO_LOG.proc_begin(d_module, 'p_distribution_id',p_distribution_id );
90       PO_LOG.proc_begin(d_module, 'p_action',p_action );
91       PO_LOG.proc_begin(d_module, 'p_recreate_demand_flag',p_recreate_demand_flag );
92       PO_LOG.proc_begin(d_module, 'p_called_from_reqimport',p_called_from_reqimport );
93       PO_LOG.proc_begin(d_module, 'p_ordered_quantity',p_ordered_quantity );
94       PO_LOG.proc_begin(d_module, 'p_transaction_id',p_transaction_id );
95       PO_LOG.proc_begin(d_module, 'p_ordered_uom',p_ordered_uom );
96     END IF;
97 
98     d_progress := 10;
99 
100         IF (PO_LOG.d_stmt) THEN
101             PO_LOG.stmt(d_module, d_progress, 'Calling Maintain rervations');
102         END IF;
103 
104        inv_maintain_reservation_pub.maintain_reservation
105        (
106           x_return_status             => l_return_status
107         , x_msg_count                 => l_msg_count
108         , x_msg_data                  => l_msg_data
109         , p_api_version_number        => 1.0
110         , p_init_msg_lst              => fnd_api.g_true
111         , p_header_id                 => p_header_id
112         , p_line_id                   => p_line_id
113         , p_line_location_id          => p_line_location_id
114         , p_distribution_id           => p_distribution_id
115         , p_transaction_id            => p_transaction_id
116         , p_action                    => p_action
117         , p_ordered_quantity          => p_ordered_quantity
118 	, p_ordered_uom               => p_ordered_uom
119        );
120 
121         IF (l_return_status <> FND_API.G_RET_STS_SUCCESS) THEN
122           x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
123           RAISE FND_API.g_exc_unexpected_error;
124         END IF;
125 
126 
127       d_progress := 20;
128 
129        IF (PO_LOG.d_proc) THEN
130           PO_LOG.proc_end(d_module, 'x_return_status', x_return_status);
131           PO_LOG.proc_end(d_module);
132        END IF;
133 
134 
135   EXCEPTION
136      WHEN OTHERS THEN
137         x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
138        IF (PO_LOG.d_exc) THEN
139            PO_LOG.exc(d_module, d_progress, SQLCODE || SQLERRM);
140            PO_LOG.proc_end(d_module, 'x_return_status', x_return_status);
141            PO_LOG.proc_end(d_module);
142        END IF;
143 
144 END MAINTAIN_RESERVATION;
145 
146 
147 END PO_RESERVATION_MAINTAIN_SV;