DBA Data[Home] [Help]

PACKAGE BODY: APPS.JMF_SHIKYU_RCV_PVT

Source


1 PACKAGE BODY JMF_SHIKYU_RCV_PVT AS
2 --$Header: JMFVSKVB.pls 120.4 2006/10/11 15:03:14 vmutyala noship $
3 --+===========================================================================+
4 --|                    Copyright (c) 2005 Oracle Corporation                  |
5 --|                       Redwood Shores, California, USA                     |
6 --|                            All rights reserved.                           |
7 --+===========================================================================+
8 --|                                                                           |
9 --|  FILENAME :           JMFVSKVB.pls                                        |
10 --|                                                                           |
11 --|  DESCRIPTION:         Body file of the Process Receiving Transactions     |
12 --|                       package.                                            |
13 --|                                                                           |
14 --|  FUNCTION/PROCEDURE:  process_rcv_header                                  |
15 --|                       process_rcv_trx                                     |
16 --|                                                                           |
17 --|  HISTORY:                                                                 |
18 --|    10-JUN-2005        jizheng   Created.                                  |
19 --|    15-JUN-2005        THE2      Add locator_id process logic              |
20 --|    27-JUN-2005        THE2      Add project_id process logic              |
21 --|    27-JUN-2005        VMUTYALA  Add from_subinventory and from_locator_id |
22 --|                                 process logic                             |
23 --|    27-JUN-2005        THE2      Add replenish_order_line_id process logic |
24 --|                                                                           |
25 --|    11/10/2006         vmutyala  Bug 5592230 adding parameter              |
26 --|                                 p_vendor_site_id to the procedure         |
27 --|                                 process_rcv_header                        |
28 --+===========================================================================+
29 
30 --========================================================================
31 -- PROCEDURE : process_rcv_header           PUBLIC
32 -- PARAMETERS: p_vendor_id          IN            NUMBER
33 --             p_ship_to_org_id     IN            NUMBER
34 --             x_rcv_header_id      OUT NOCOPY    NUMBER
35 --             x_group_id           OUT NOCOPY    NUMBER
36 
37 -- COMMENT   : This procedure inserts records in rev_header_interface for auto_receive
38 --========================================================================
39 PROCEDURE  Process_Rcv_Header
40 ( p_vendor_id         IN         NUMBER
41 , p_vendor_site_id    IN         NUMBER
42 , p_ship_to_org_id    IN         NUMBER
43 , x_rcv_header_id     OUT NOCOPY NUMBER
44 , x_group_id          OUT NOCOPY NUMBER
45 )
46 IS
47 l_api_name             VARCHAR2(50) := 'process_rcv_header';
48 
49 l_rcv_header_id        rcv_headers_interface.header_interface_id%TYPE;
50 l_group_id             rcv_headers_interface.group_id%TYPE;
51 
52 BEGIN
53   IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL)
54   THEN
55     fnd_log.STRING(fnd_log.LEVEL_PROCEDURE
56                   , G_MODULE_PREFIX || l_api_name || '.begin'
57                   ,'procedure begin');
58   END IF;
59 
60   SELECT
61     rcv_headers_interface_s.NEXTVAL
62     , rcv_interface_groups_s.NEXTVAL
63   INTO
64     l_rcv_header_id
65     , l_group_id
66   FROM
67     dual;
68 
69    INSERT INTO RCV_HEADERS_INTERFACE
70   ( header_interface_id
71    , group_id
72    , processing_status_code
73    , receipt_source_code
74    , transaction_type
75    , last_update_date
76    , last_updated_by
77    , creation_date
78    , created_by
79    , vendor_id
80    , VENDOR_SITE_ID
81    , validation_flag
82    , Ship_To_Organization_id
83    , expected_receipt_date
84    )
85   VALUES(
86     l_rcv_header_id
87     , l_group_id
88     , 'PENDING'
89     , 'VENDOR'
90     , 'NEW'
91     , SYSDATE
92     , fnd_global.LOGIN_ID
93     , SYSDATE
94     , fnd_global.CONC_LOGIN_ID
95     , p_vendor_id
96     , p_vendor_site_id
97     , 'Y'
98     , p_ship_to_org_id
99     , SYSDATE);
100   COMMIT;
101 
102   x_rcv_header_id := l_rcv_header_id;
103   x_group_id      := l_group_id;
104 
105   IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL)
106   THEN
107     fnd_log.STRING(fnd_log.LEVEL_PROCEDURE
108                      , G_MODULE_PREFIX || l_api_name || '.end'
109                      ,'END procedure. ');
110   END IF;
111 
112 EXCEPTION
113 
114   WHEN OTHERS THEN
115     IF(FND_LOG.LEVEL_UNEXPECTED >= FND_LOG.G_CURRENT_RUNTIME_LEVEL)
116     THEN
117       FND_LOG.string( FND_LOG.LEVEL_UNEXPECTED
118                     , G_MODULE_PREFIX || l_api_name || '. OTHER_EXCEPTION '
119                     , 'Unknown error'||SQLCODE||SQLERRM);
120     END IF;
121     RAISE;
122 
123 END process_rcv_header;
124 
125 --========================================================================
126 -- PROCEDURE : process_rcv_trx              PUBLIC
127 -- PARAMETERS: p_rcv_header_id              IN    NUMBER
128 --             p_group_id                   IN    NUMBER
129 --             p_quantity                   IN    NUMBER
130 --             p_unit_of_measure            IN    VARCHAR2
131 --             p_po_header_id               IN    NUMBER
132 --             p_po_line_id                 IN    NUMBER
133 --             p_po_line_location_id        IN    NUMBER
134 --             p_po_distribution_id         IN    NUMBER
135 --             p_subinventory               IN    VARCHAR2
136 --             p_transaction_type           IN    VARCHAR2
137 --             p_auto_transact_code         IN    VARCHAR2
138 --             p_parent_transaction_id      IN    NUMBER
139 
140 -- COMMENT   : This procedure inserts records in rev_transactions_interface for auto_receive
141 --========================================================================
142 PROCEDURE Process_Rcv_Trx
143 ( p_rcv_header_id            IN NUMBER
144 , p_group_id                 IN NUMBER
145 , p_quantity                 IN NUMBER
146 , p_unit_of_measure          IN VARCHAR2
147 , p_po_header_id             IN NUMBER
148 , p_po_line_id               IN NUMBER
149 , p_subinventory             IN VARCHAR2 DEFAULT NULL
150 , p_transaction_type         IN VARCHAR2
151 , p_auto_transact_code       IN VARCHAR2 DEFAULT NULL
152 , p_parent_transaction_id    IN NUMBER
153 , p_po_line_location_id      IN NUMBER
154 , p_locator_id               IN NUMBER DEFAULT NULL
155 , p_project_id               IN NUMBER DEFAULT NULL
156 , p_from_subinventory        IN VARCHAR2 DEFAULT NULL
157 , p_from_locator_id          IN NUMBER DEFAULT NULL
158 , p_replenish_order_line_id  IN NUMBER DEFAULT NULL
159 )
160 IS
161 l_api_name                     VARCHAR2(30) := 'process_rcv_trx';
162 
163 BEGIN
164 
165   IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL)
166   THEN
167     fnd_log.STRING(fnd_log.LEVEL_PROCEDURE
168                      , G_MODULE_PREFIX || l_api_name || '.begin'
169                      ,'procedure begin');
170   END IF;
171 
172   INSERT INTO RCV_TRANSACTIONS_INTERFACE
173   ( interface_transaction_id
174   , header_interface_id
175   , group_id
176   , last_update_date
177   , last_updated_by
178   , creation_date
179   , created_by
180   , transaction_type
181   , transaction_date
182   , processing_status_code
183   , processing_mode_code
184   , transaction_status_code
185   , quantity                        --quantity
186   , unit_of_measure                 --uom
187   , auto_transact_code
188   , receipt_source_code
189   , source_document_code
190   , po_header_id
191   , po_line_id
192   , validation_flag
193   , subinventory
194   , parent_transaction_id
195   , po_line_location_id
196   , locator_id
197   , project_id
198   , from_subinventory
199   , from_locator_id
200   , replenish_order_line_id
201   )
202   SELECT
203     RCV_TRANSACTIONS_INTERFACE_S.NEXTVAL
204     , p_rcv_header_id
205     , p_group_id
206     , SYSDATE
207     , fnd_global.LOGIN_ID
208     , SYSDATE
209     , fnd_global.LOGIN_ID
210     , p_transaction_type -- 'RECEIVE' --  'SHIP',
211     , SYSDATE
212     , 'PENDING'
213     , 'BATCH'
214     , 'PENDING'
215     , p_quantity
216     , p_unit_of_measure
217     , p_auto_transact_code -- 'RECEIVE',  --'DELIVER'
218     , 'VENDOR'
219     , 'PO'
220     , p_po_header_id
221     , p_po_line_id
222     , 'Y'
223     , p_subinventory
224     , p_parent_transaction_id
225     , p_po_line_location_id
226     , p_locator_id
227     , p_project_id
228     , p_from_subinventory
229     , p_from_locator_id
230     , p_replenish_order_line_id
231   FROM DUAL;
232   COMMIT;
233 
234 
235   IF (FND_LOG.LEVEL_PROCEDURE >= FND_LOG.G_CURRENT_RUNTIME_LEVEL)
236   THEN
237     fnd_log.STRING(fnd_log.LEVEL_PROCEDURE
238                      , G_MODULE_PREFIX || l_api_name || '.end'
239                      ,'END procedure. '
240                    );
241   END IF;
242 EXCEPTION
243   WHEN OTHERS THEN
244     IF(FND_LOG.LEVEL_UNEXPECTED >= FND_LOG.G_CURRENT_RUNTIME_LEVEL)
245     THEN
246       FND_LOG.string( FND_LOG.LEVEL_UNEXPECTED
247                     , G_MODULE_PREFIX || l_api_name || '. OTHER_EXCEPTION '
248                     , 'Unknown error'||SQLCODE||SQLERRM);
249     END IF;
250     RAISE;
251 
252 END process_rcv_trx;
253 
254 END JMF_SHIKYU_RCV_PVT;