DBA Data[Home] [Help]

PACKAGE BODY: APPS.M4U_GLOBAL_REGQRY

Source


1 PACKAGE BODY m4u_global_regqry AS
2 /* $Header: M4UQRREB.pls 120.2 2005/07/07 04:14:49 rkrishan noship $ */
3    l_debug_level        NUMBER ;
4    G_PKG_NAME CONSTANT     VARCHAR2(30)    := 'm4u_global_regqry';
5 
6 
7 
8 
9         -- Name
10         --      raise_regqry_event
11         -- Purpose
12         --      This procedure is called from a concurrent program.
13         --      The 'oracle.apps.m4u.registryquery.generate' is raised with the supplied event parameters
14         --      The sequence m4u_wlqid_sequence is used to obtain unique event key.
15         -- Arguments
16         -- Notes
17         --
18         PROCEDURE raise_regqry_event(
19                 x_errbuf                OUT NOCOPY VARCHAR2,
20                 x_retcode               OUT NOCOPY NUMBER,
21                 p_qr_ipgln              IN VARCHAR2,
22                 p_qr_gtin               IN VARCHAR2,
23                 p_qr_targtMarkt         IN VARCHAR2
24           )
25         IS
26                 l_event_key             VARCHAR2(50);
27                 l_event_parameters      wf_parameter_list_t;
28                 l_error_code            VARCHAR2(50);
29                 l_error_msg             VARCHAR2(50);
30                 l_msg_data              VARCHAR2(50);
31                 x_return_status         VARCHAR2(50);
32                 x_msg_data              VARCHAR2(100);
33 
34         BEGIN
35 
36                 IF (l_debug_Level <= 2) THEN
37                         cln_debug_pub.Add('M4U:----- Entering RAISE_REGQRY_EVENT  ------- ',2);
38                 END IF;
39 
40 
41                 -- Initialize API return status to success
42                 x_return_status         := FND_API.G_RET_STS_SUCCESS;
43                 l_msg_data              := 'Event for querying Global Registry raised';
44 
45 
46                 -- Parameters received
47                 IF (l_Debug_Level <= 1) THEN
48                         cln_debug_pub.Add('++++ PARAMETERS RECEIVED FROM CONCURRENT PROGRAM ++ ',1);
49                         cln_debug_pub.Add('p_qr_ipgln            - '||p_qr_ipgln  ,1);
50                         cln_debug_pub.Add('p_qr_gtin             - '||p_qr_gtin,1);
51                         cln_debug_pub.Add('p_qr_targtMarkt       - '||p_qr_targtMarkt,1);
52                         cln_debug_pub.Add('+++++++++++++++++++++++++++++++++++++++++++++++++++',1);
53                 END IF;
54 
55                 -- Validation of the UCCnet parameters
56 
57                 IF (l_Debug_Level <= 1) THEN
58                         cln_debug_pub.Add('++++++ VALIDATION OF THE UCCNET PARAMETERS ++++++ ',1);
59                 END IF;
60 
61                 -- 1. Validation of the GLN
62                 IF NOT m4u_ucc_utils.validate_uccnet_attr
63                                    (
64                                         x_return_status         => x_return_status,
65                                         x_msg_data              => x_msg_data,
66                                         p_attr_type             => 'GLN',
67                                         p_attr_value            => p_qr_ipgln
68                                    )THEN
69                          l_msg_data  := 'GLN validation failed';
70                          RAISE FND_API.G_EXC_ERROR;
71                 END IF;
72 
73                 -- 2. Validation of the GTIN
74                 IF NOT m4u_ucc_utils.validate_uccnet_attr(
75                                         x_return_status         => x_return_status,
76                                         x_msg_data              => x_msg_data,
77                                         p_attr_type             => 'GTIN',
78                                         p_attr_value            => p_qr_gtin
79                                     )THEN
80                          l_msg_data  := 'GTIN validation failed';
81                          RAISE FND_API.G_EXC_ERROR;
82                 END IF;
83 
84                 -- 3. Validation of the Target Market
85                 IF NOT m4u_ucc_utils.validate_uccnet_attr(
86                                         x_return_status         => x_return_status,
87                                         x_msg_data              => x_msg_data,
88                                         p_attr_type             => 'TRGMKT',
89                                         p_attr_value            => p_qr_targtMarkt
90                                     )THEN
91                          l_msg_data  := 'Target Market validation failed';
92                          RAISE FND_API.G_EXC_ERROR;
93                 END IF;
94 
95 
96 
97 
98                 IF (l_Debug_Level <= 1) THEN
99                         cln_debug_pub.Add('++++++ VALIDATION DONE WITH SUCCESS ++++++ ',1);
100                 END IF;
101 
102                 -- obtain a unique event-id
103                 SELECT  m4u_wlqid_s.NEXTVAL
104                 INTO    l_event_key
105                 FROM    dual;
106 
107                 l_event_key := 'M4U_QRYREG_' || l_event_key;
108 
109                 -- pass Concurrent program parameters as event parameters,
110                 -- to be used in outboud xml generation map.
111 
112                 l_event_parameters := wf_parameter_list_t();
113 
114                 wf_event.AddParameterToList(
115                                         p_name          => 'ECX_EVENT_KEY',
116                                         p_value         => l_event_key,
117                                         p_parameterlist => l_event_parameters   );
118                 IF (l_Debug_Level <= 1) THEN
119                         cln_debug_pub.Add('ECX_EVENT_KEY                        - '||l_event_key,1);
120                 END IF;
121 
122                 wf_event.AddParameterToList(
123                                         p_name          => 'M4U_DOC_NO',
124                                         p_value         => l_event_key,
125                                         p_parameterlist => l_event_parameters   );
126                 IF (l_Debug_Level <= 1) THEN
127                         cln_debug_pub.Add('M4U_DOC_NO                           - '||l_event_key,1);
128                 END IF;
129 
130                 IF (l_Debug_Level <= 1) THEN
131                          cln_debug_pub.Add('ECX_PARAMETER2   - IP GLN            - '||p_qr_ipgln,1);
132                 END IF;
133                 wf_event.AddParameterToList(
134                                         p_name          => 'ECX_PARAMETER2',
135                                         p_value         => p_qr_ipgln,
136                                         p_parameterlist => l_event_parameters   );
137                 IF (l_Debug_Level <= 1) THEN
138                         cln_debug_pub.Add('ECX_PARAMETER2   - IP GLN            - '||p_qr_ipgln,1);
139                 END IF;
140 
141 
142                 wf_event.AddParameterToList(
143                                         p_name          => 'ECX_PARAMETER3',
144                                         p_value         => p_qr_gtin,
145                                         p_parameterlist => l_event_parameters   );
146                 IF (l_Debug_Level <= 1) THEN
147                         cln_debug_pub.Add('ECX_PARAMETER3   - GTIN              -'||p_qr_gtin,1);
148                 END IF;
149 
150                 wf_event.AddParameterToList(
151                                         p_name          => 'ECX_PARAMETER4',
152                                         p_value         => p_qr_targtMarkt,
153                                         p_parameterlist => l_event_parameters   );
154                 IF (l_Debug_Level <= 1) THEN
155                         cln_debug_pub.Add('ECX_PARAMETER4   - Target Market     -'||p_qr_targtMarkt,1);
156                 END IF;
157 
158                 wf_event.AddParameterToList(
159                                         p_name          => 'ECX_TRANSACTION_TYPE',
160                                         p_value         => 'M4U',
161                                         p_parameterlist => l_event_parameters   );
162                 IF (l_Debug_Level <= 1) THEN
163                         cln_debug_pub.Add('ECX_TRANSACTION_TYPE                 - M4U',1);
164                 END IF;
165 
166                 wf_event.AddParameterToList(
167                                         p_name          => 'ECX_TRANSACTION_SUBTYPE',
168                                         p_value         => 'GBREGQRY',
169                                         p_parameterlist => l_event_parameters   );
170                 IF (l_Debug_Level <= 1) THEN
171                         cln_debug_pub.Add('ECX_TRANSACTION_SUBTYPE              - GBREGQRY',1);
172                 END IF;
173 
174                 wf_event.AddParameterToList(
175                                         p_name          => 'ECX_DOCUMENT_ID',
176                                         p_value         => l_event_key,
177                                         p_parameterlist => l_event_parameters   );
178                 IF (l_Debug_Level <= 1) THEN
179                         cln_debug_pub.Add('ECX_DOCUMENT_ID                      - '||l_event_key,1);
180                 END IF;
181 
182 
183                 wf_event.AddParameterToList(
184                                         p_name          => 'M4U_CLN_COLL_TYPE',
185                                         p_value         => 'M4U_REGISTRY_QUERY',
186                                         p_parameterlist => l_event_parameters   );
187                 IF (l_Debug_Level <= 1) THEN
188                         cln_debug_pub.Add('M4U_CLN_COLL_TYPE                    - M4U_REGISTRY_QUERY');
189                 END IF;
190 
191                 wf_event.AddParameterToList(
192                                         p_name          => 'M4U_CLN_DOC_TYPE',
193                                         p_value         => 'M4U_REGISTRY_QUERY',
194                                         p_parameterlist => l_event_parameters   );
195                 IF (l_Debug_Level <= 1) THEN
196                         cln_debug_pub.Add('M4U_CLN_DOC_TYPE                     - M4U_REGISTRY_QUERY');
197                 END IF;
198 
199                 wf_event.AddParameterToList(
200                                         p_name          => 'ATTRIBUTE1',
201                                         p_value         => m4u_ucc_utils.g_host_gln,
202                                         p_parameterlist => l_event_parameters   );
203                 IF (l_Debug_Level <= 1) THEN
204                         cln_debug_pub.Add('ATTRIBUTE1                           - '||m4u_ucc_utils.g_host_gln,1);
205                 END IF;
206 
207                 wf_event.AddParameterToList(
208                                         p_name          => 'ATTRIBUTE5',
209                                         p_value         => m4u_ucc_utils.g_supp_gln,
210                                         p_parameterlist => l_event_parameters   );
211                 IF (l_Debug_Level <= 1) THEN
212                         cln_debug_pub.Add('ATTRIBUTE5                           - '||m4u_ucc_utils.g_supp_gln,1);
213                 END IF;
214 
215 
216                 wf_event.AddParameterToList(
217                                         p_name          => 'ATTRIBUTE12',
218                                         p_value         => l_event_key,
219                                         p_parameterlist => l_event_parameters   );
220                 IF (l_Debug_Level <= 1) THEN
221                         cln_debug_pub.Add('ATTRIBUTE12                          - '||l_event_key,1);
222                 END IF;
223 
224 
225                 -- set event parameters, end
226 
227                 IF (l_Debug_Level <= 1) THEN
228                         cln_debug_pub.Add('--  Raising Event oracle.apps.m4u.outboundwf.generate  -- ',1);
229                         cln_debug_pub.Add('p_event_key                          - '||l_event_key ,1);
230                 END IF;
231 
232 
233                 -- raise event to trigger outbound wlq generation WF
234                 wf_event.raise(
235                                 --p_event_name            => 'oracle.apps.m4u.gbregistryqry.generate',
236                                 p_event_name            => 'oracle.apps.m4u.outboundwf.generate',
237                                 p_event_key             => l_event_key,
238                                 p_parameters            => l_event_parameters
239                               );
240 
241                 x_retcode  := 0;
242                 x_errbuf   := 'Successful';
243 
244                 -- check the message
245                 IF (l_Debug_Level <= 1) THEN
246                         cln_debug_pub.Add(l_msg_data,1);
247                 END IF;
248 
249                 IF (l_Debug_Level <= 2) THEN
250                         cln_debug_pub.Add('------- Exiting raise_regqry_event API --------- ',2);
251                 END IF;
252 
253 
254         -- Exception Handling
255         EXCEPTION
256              WHEN FND_API.G_EXC_ERROR THEN
257                     x_retcode          := 2 ;
258                     x_errbuf           := x_msg_data;
259 
260                     IF (l_Debug_Level <= 5) THEN
261                             cln_debug_pub.Add(l_msg_data,4);
262                             cln_debug_pub.Add('Details: '||x_msg_data,4);
263                             cln_debug_pub.Add('------- Exiting raise_regqry_event API --------- ',2);
264                     END IF;
265 
266 
267              WHEN OTHERS THEN
268                     l_error_code       :=SQLCODE;
269                     l_error_msg        :=SQLERRM;
270                     x_retcode          :=2 ;
271 
272                     FND_MESSAGE.SET_NAME('CLN','CLN_CH_UNEXPECTED_ERROR');
273                     FND_MESSAGE.SET_TOKEN('ERRORCODE',l_error_code);
274                     FND_MESSAGE.SET_TOKEN('ERRORMSG',l_error_msg);
275                     x_errbuf           := FND_MESSAGE.GET;
276 
277                     IF (l_Debug_Level <= 5) THEN
278                             cln_debug_pub.Add(x_errbuf,6);
279                             cln_debug_pub.Add('------- Exiting raise_regqry_event API --------- ',2);
280                     END IF;
281         END;
282 
283         -- Name
284         --      process_gtin_resp
285         -- Purpose
286         --      This procedure is called from the XGM m4u_230_resp_gbreqry_in
287         --      This procedure updates the UCCnet Registry-query collaboration with GTIN info
288         -- Arguments
289         --      RCIR Item Attributes
290         --      p_success_flag                  - Query success/failure flag
291         --      p_gtin_query_id                 - GTIN query Id
292         --      p_ucc_doc_unique_id             - UCC Doc Unique ID
293         --      p_xmlg_internal_control_no      - XMLG ICN from map
294         --      x_return_status                 - API ret status
295         --      x_msg_data                      - API ret msg
296         -- Notes
297         --      none
298         PROCEDURE process_gtin_resp(
299                 p_gtin                          IN VARCHAR2,
300                 p_data_source                   IN VARCHAR2,
304                 p_name_of_info_provider         IN VARCHAR2,
301                 p_target_market                 IN VARCHAR2,
302                 p_src_data_pool                 IN VARCHAR2,
303                 p_reg_data_pool                 IN VARCHAR2,
305                 p_brand_owner_name              IN VARCHAR2,
306                 p_brand_owner_gln               IN VARCHAR2,
307                 p_brand_name                    IN VARCHAR2,
308                 p_trade_item_unit_desc          IN VARCHAR2,
309                 p_eanucc_code                   IN VARCHAR2,
310                 p_eanucc_type                   IN VARCHAR2,
311                 p_delivery_method               IN VARCHAR2,
312                 p_consumer_unit                 IN VARCHAR2,
313                 p_ord_unit                      IN VARCHAR2,
314                 p_effective_date                IN VARCHAR2,
315                 p_next_level_cnt                IN VARCHAR2,
316                 p_gross_wt                      IN VARCHAR2,
317                 p_gross_wt_uom                  IN VARCHAR2,
318                 p_height                        IN VARCHAR2,
319                 p_height_uom                    IN VARCHAR2,
320                 p_width                         IN VARCHAR2,
321                 p_width_uom                     IN VARCHAR2,
322                 p_depth                         IN VARCHAR2,
323                 p_depth_uom                     IN VARCHAR2,
324                 p_volume                        IN VARCHAR2,
325                 p_volume_uom                    IN VARCHAR2,
326                 p_net_content                   IN VARCHAR2,
327                 p_net_content_uom               IN VARCHAR2,
328                 p_net_wt                        IN VARCHAR2,
329                 p_net_wt_uom                    IN VARCHAR2,
330                 p_is_info_pvt                   IN VARCHAR2,
331                 p_success_flag                  IN VARCHAR2,
332                 p_gtin_query_id                 IN VARCHAR2,
333                 p_ucc_doc_unique_id             IN VARCHAR2,
334                 p_xmlg_internal_control_no      IN NUMBER,
335                 x_collab_dtl_id                 OUT NOCOPY NUMBER,
336                 x_return_status                 OUT NOCOPY VARCHAR2,
337                 x_msg_data                      OUT NOCOPY VARCHAR2 )
338         IS
339                 l_error_code                    VARCHAR2(50);
340                 l_error_msg                     VARCHAR2(1000);
341                 l_disposition                   VARCHAR2(50);
342                 l_coll_status                   VARCHAR2(50);
343                 l_fnd_msg                       VARCHAR2(1000);
344                 l_doc_status                    VARCHAR2(50);
345                 l_item_measurmnts               VARCHAR2(2000);
346                 l_collab_detail_id              NUMBER;
347         BEGIN
348 
349                 -- Parameters received
350                 IF (l_Debug_Level <= 1) THEN
351                         cln_debug_pub.Add('---- m4u_global_regqry.process_gtin_resp ---- '             ,1);
352                         cln_debug_pub.Add('p_gtin                       - '|| p_gtin               ,1);
353                         cln_debug_pub.Add('p_data_source                - '|| p_data_source        ,1);
354                         cln_debug_pub.Add('p_target_market              - '|| p_target_market  ,1);
355                         cln_debug_pub.Add('p_src_data_pool              - '|| p_src_data_pool           ,1);
356                         cln_debug_pub.Add('p_reg_data_pool              - '|| p_reg_data_pool    ,1);
357                         cln_debug_pub.Add('p_name_of_info_provider      - '|| p_name_of_info_provider,1);
358                         cln_debug_pub.Add('p_brand_owner_name           - '|| p_brand_owner_name   ,1);
359                         cln_debug_pub.Add('p_brand_owner_gln            - '|| p_brand_owner_gln    ,1);
360                         cln_debug_pub.Add('p_brand_name                 - '|| p_brand_name         ,1);
361                         cln_debug_pub.Add('p_trade_item_unit_desc       - '|| p_trade_item_unit_desc,1);
362                         cln_debug_pub.Add('p_eanucc_code                - '|| p_eanucc_code        ,1);
363                         cln_debug_pub.Add('p_eanucc_type                - '|| p_eanucc_type        ,1);
364                         cln_debug_pub.Add('p_delivery_method            - '|| p_delivery_method    ,1);
365                         cln_debug_pub.Add('p_consumer_unit              - '|| p_consumer_unit      ,1);
366                         cln_debug_pub.Add('p_ord_unit                   - '|| p_ord_unit           ,1);
367                         cln_debug_pub.Add('p_effective_date             - '|| p_effective_date     ,1);
368                         cln_debug_pub.Add('p_next_level_cnt             - '|| p_next_level_cnt     ,1);
369                         cln_debug_pub.Add('p_gross_wt                   - '|| p_gross_wt           ,1);
370                         cln_debug_pub.Add('p_gross_wt_uom               - '|| p_gross_wt_uom       ,1);
371                         cln_debug_pub.Add('p_height                     - '|| p_height             ,1);
372                         cln_debug_pub.Add('p_height_uom                 - '|| p_height_uom         ,1);
373                         cln_debug_pub.Add('p_width                      - '|| p_width              ,1);
374                         cln_debug_pub.Add('p_width_uom                  - '|| p_width_uom          ,1);
375                         cln_debug_pub.Add('p_depth                      - '|| p_depth              ,1);
376                         cln_debug_pub.Add('p_depth_uom                  - '|| p_depth_uom          ,1);
377                         cln_debug_pub.Add('p_volume                     - '|| p_volume             ,1);
378                         cln_debug_pub.Add('p_volume_uom                 - '|| p_volume_uom         ,1);
379                         cln_debug_pub.Add('p_net_content                - '|| p_net_content        ,1);
380                         cln_debug_pub.Add('p_net_content_uom            - '|| p_net_content_uom    ,1);
384                         cln_debug_pub.Add('p_success_flag               - '|| p_success_flag       ,1);
381                         cln_debug_pub.Add('p_net_wt                     - '|| p_net_wt             ,1);
382                         cln_debug_pub.Add('p_net_wt_uom                 - '|| p_net_wt_uom         ,1);
383                         cln_debug_pub.Add('p_is_info_pvt                - '|| p_is_info_pvt        ,1);
385                         cln_debug_pub.Add('p_gtin_query_id              - '|| p_gtin_query_id      ,1);
386                         cln_debug_pub.Add('p_ucc_doc_unique_id          - '|| p_ucc_doc_unique_id    ,1);
387                         cln_debug_pub.Add('p_xmlg_internal_control_no   - '|| p_xmlg_internal_control_no    ,1);
388                         cln_debug_pub.Add('-------------------------------------------'           ,1);
389                 END IF;
390 
391 
392                 -- set CLN Disposition, CLN Coll Status, CLN Doc status, CLN Message Text
393                 IF (UPPER(p_success_flag)   = 'TRUE') THEN
394                         l_disposition   := 'ACCEPTED' ;
395                         l_coll_status   := 'COMPLETED';
396                         l_doc_status    := 'SUCCESS';
397                         l_fnd_msg       := 'M4U_GTINQRY_SUCCESS';
398                 ELSE
399                         l_disposition   := 'FAILED' ;
400                         l_coll_status   := 'ERROR';
401                         l_doc_status    := 'ERROR';
402                         l_fnd_msg       := 'M4U_GTINQRY_FAILURE';
403                 END IF;
404 
405                 IF (l_Debug_Level <= 1) THEN
406                         cln_debug_pub.Add('-- Update collaboration parameters set -',1);
407                         cln_debug_pub.Add('Disposition          - '|| l_disposition ,1);
408                         cln_debug_pub.Add('Collaboration Status - '|| l_coll_status ,1);
409                         cln_debug_pub.Add('Document Status      - '|| l_doc_status  ,1);
410                         cln_debug_pub.Add('FND Message          - '|| l_fnd_msg     ,1);
411                         cln_debug_pub.Add('---------------------------------------' ,1);
412                 END IF;
413 
414                 cln_ch_collaboration_pkg.update_collaboration(
415                         x_return_status                  => x_return_status,
416                         x_msg_data                       => x_msg_data,
417                         p_coll_id                        => p_gtin_query_id,
418                         p_msg_text                       => l_fnd_msg,
419                         p_xmlg_msg_id                    => NULL,
420                         p_xmlg_transaction_type          => 'M4U',
421                         p_xmlg_transaction_subtype       => 'RESP_GTIN',
422                         p_xmlg_int_transaction_type      => 'M4U',
423                         p_xmlg_int_transaction_subtype   => 'RESP_GTIN',
424                         p_doc_dir                        => 'IN',
425                         p_doc_type                       => 'M4U_RESP_GTIN',
426                         p_disposition                    => l_disposition,
427                         p_doc_status                     => l_doc_status,
428                         p_coll_status                    => l_coll_status,
429                         p_xmlg_document_id               => NULL,
430                         p_xmlg_internal_control_number   => p_xmlg_internal_control_no,
431                         p_tr_partner_type                => m4u_ucc_utils.c_party_type,
432                         p_tr_partner_id                  => m4u_ucc_utils.g_party_id,
433                         p_tr_partner_site                => m4u_ucc_utils.g_party_site_id,
434                         p_attribute2                     => p_target_market,
435                         p_attribute3                     => p_gtin,
436                         p_attribute4                     => p_name_of_info_provider,
437                         p_attribute6                     => p_brand_owner_gln,
438                         p_attribute7                     => p_brand_owner_name,
439                         p_attribute8                     => p_ucc_doc_unique_id,
440                         p_attribute9                     => p_trade_item_unit_desc,
441                         p_attribute10                    => p_eanucc_code||'-'||p_eanucc_type,
442                         p_attribute11                    => p_success_flag,
443                         p_attribute13                    => p_delivery_method,
444                         p_attribute14                    => p_is_info_pvt,
445                         p_attribute15                    => p_brand_name,
446                         p_dattribute1                    => sysdate,
447                         p_dattribute2                    => null,
448                         p_rosettanet_check_required      => false,
449                         x_dtl_coll_id                    => l_collab_detail_id  );
450 
451                 IF(x_return_status <> 'S') THEN
452                         RAISE FND_API.G_EXC_ERROR;
453                 END IF;
454 
455 
456                 IF (l_Debug_Level <= 1) THEN
457                         cln_debug_pub.Add('-- Update Collab API returns Values  -'           ,1);
458                         cln_debug_pub.Add('Collab Detail Id         - '|| l_collab_detail_id ,1);
459                         cln_debug_pub.Add('CLN API Return Status    - '|| x_return_status    ,1);
460                         cln_debug_pub.Add('CLN return msg data      - '|| x_msg_data         ,1);
461                 END IF;
462 
463                 -- assign the collab dtl id to out variable
464                 x_collab_dtl_id := l_collab_detail_id;
465 
466                 -- check for error. If the return status is failure, move out with the
467                 -- collaboration detail id
468                 IF (UPPER(p_success_flag)   <> 'TRUE') THEN
469                         IF (l_Debug_Level <= 1) THEN
470                                 cln_debug_pub.Add('-- Error Status :Returning  -'  ,1);
474                         RETURN;
471                                 cln_debug_pub.Add('Collaboration Detail ID - '||l_collab_detail_id ,1);
472                                 cln_debug_pub.Add('Exiting - m4u_global_regqry.process_gtin_resp - Response status as false',2);
473                         END IF;
475                 END IF;
476 
477                 IF (
478                    (p_gross_wt IS NULL) AND
479                    (p_gross_wt_uom IS NULL) AND
480                    (p_height_uom IS NULL) AND
481                    (p_height IS NULL) AND
482                    (p_width IS NULL) AND
483                    (p_width_uom IS NULL) AND
484                    (p_depth IS NULL) AND
485                    (p_depth_uom IS NULL) AND
486                    (p_volume IS NULL) AND
487                    (p_volume_uom IS NULL) AND
488                    (p_net_content IS NULL) AND
489                    (p_net_content_uom IS NULL) AND
490                    (p_net_wt IS NULL) AND
491                    (p_net_wt_uom IS NULL)) THEN
492                         IF (l_Debug_Level <= 1) THEN
493                                 cln_debug_pub.Add('Measurement Values all null. Information requestor different from content owner'  ,1);
494                                 cln_debug_pub.Add('Returning with success...'  ,1);
495                                 cln_debug_pub.Add('Exiting - m4u_global_regqry.process_gtin_resp Normal',2);
496                         END IF;
497 
498                         RETURN;
499                    END IF;
500 
501 
502                 l_item_measurmnts := 'Gross Wt - '||p_gross_wt
503                                      ||'( '||p_gross_wt_uom||' )'
504                                      ||' Height - '||p_height
505                                      ||'( '||p_height_uom||' )'
506                                      ||' Width  - '||p_width
507                                      ||'( '||p_width_uom||' )'
508                                      ||' Depth  - '||p_depth
509                                      ||'( '||p_depth_uom||' )'
510                                      ||' Volume - '||p_volume
511                                      ||'( '||p_volume_uom||' )'
512                                      ||' Net Content - '||p_net_content
513                                      ||'( '||p_net_content_uom||' )'
514                                      ||' Net Weight  - '||p_net_wt
515                                      ||'( '||p_net_wt_uom||' )';
516 
517                 IF (l_Debug_Level <= 1) THEN
518                         cln_debug_pub.Add('---- Item Measurements ---',1);
519                         cln_debug_pub.Add(l_item_measurmnts,1);
520                         cln_debug_pub.Add('---- ----------------- ---',1);
521                 END IF;
522 
523                 IF (l_Debug_Level <= 1) THEN
524                         cln_debug_pub.Add('----- Call to Add Collaboration Messages -----',1);
525                 END IF;
526 
527                 CLN_CH_COLLABORATION_PKG.ADD_COLLABORATION_MESSAGES(
528                      x_return_status                    => x_return_status,
529                      x_msg_data                         => x_msg_data,
530                      p_dtl_coll_id                      => l_collab_detail_id,
531                      p_ref1                             => 'Item Measurements',
532                      p_dtl_msg                          => l_item_measurmnts
533                 );
534 
535                 IF(x_return_status <> 'S') THEN
536                         RAISE FND_API.G_EXC_ERROR;
537                 END IF;
538 
539                 IF (l_Debug_Level <= 2) THEN
540                         cln_debug_pub.Add('Exiting - m4u_global_regqry.process_gtin_resp Normal',2);
541                 END IF;
542 
543         EXCEPTION
544              WHEN FND_API.G_EXC_ERROR THEN
545                 x_return_status := FND_API.G_RET_STS_ERROR ;
546                 IF (l_Debug_Level <= 4) THEN
547                       cln_debug_pub.Add(x_msg_data,4);
548                       cln_debug_pub.Add('------- Exiting m4u_global_regqry.process_gtin_resp - exception --------- ',2);
549                 END IF;
550 
551              WHEN OTHERS THEN
552                 l_error_code    := SQLCODE;
553                 l_error_msg     := SQLERRM;
554                 x_return_status := fnd_api.G_RET_STS_UNEXP_ERROR;
555 
556                 FND_MESSAGE.SET_NAME('CLN','CLN_CH_UNEXPECTED_ERROR');
557                 FND_MESSAGE.SET_TOKEN('ERRORCODE',l_error_code);
558                 FND_MESSAGE.SET_TOKEN('ERRORMSG',l_error_msg);
559 
560                 x_msg_data           := FND_MESSAGE.GET;
561 
562                 IF (l_debug_level <= 5) THEN
563                         cln_debug_pub.add(l_error_code || ':' || l_error_msg, 4);
564                 END IF;
565 
566                 IF (l_debug_level <= 2) THEN
567                         cln_debug_pub.add('Exiting m4u_global_regqry.process_gtin_resp - exception',2);
568                         cln_debug_pub.add('====================================================',2);
569                 END IF;
570 
571         END;
572 
573         BEGIN
574                 l_debug_level           := to_number(nvl(fnd_profile.value('CLN_DEBUG_LEVEL'), '5'));
575 END m4u_global_regqry;