DBA Data[Home] [Help]

PACKAGE BODY: APPS.INVPASGI

Source


1 package body INVPASGI as
2 /* $Header: INVPAG1B.pls 120.2.12020000.4 2013/01/23 09:21:11 lmai ship $ */
3 
4 --------------------------- mtl_pr_assign_item_data ---------------------------
5 
6 FUNCTION mtl_pr_assign_item_data
7 (
8 org_id          number,
9 all_org         NUMBER          := 2,
10 prog_appid      NUMBER          := -1,
11 prog_id         NUMBER          := -1,
12 request_id      NUMBER          := -1,
13 user_id         NUMBER          := -1,
14 login_id        NUMBER          := -1,
15 err_text     IN  OUT NOCOPY varchar2,
16 xset_id      IN  NUMBER    DEFAULT  -999,
17 default_flag IN  NUMBER    DEFAULT  1
18 )
19 RETURN INTEGER
20 IS
21    rtn_status     NUMBER  :=  0;
22    dumm_status    NUMBER  :=  0;
23    l_inv_debug_level	NUMBER := INVPUTLI.get_debug_level;  --Bug: 4667452
24 BEGIN
25 
26    IF l_inv_debug_level IN(101, 102) THEN
27       INVPUTLI.info('INVPASGI.mtl_pr_assign_item_data : begin');
28       INVPUTLI.info('INVPASGI.mtl_pr_assign_item_data: calling INVPAGI2.assign_item_header_recs');
29    END IF;
30 
31    rtn_status := INVPAGI2.assign_item_header_recs (
32                         org_id,
33 			all_org,
34 			prog_appid,
35 			prog_id,
36 			request_id,
37 			user_id,
38 			login_id,
39                         err_text,
40                         xset_id,
41                         default_flag);
42 
43    IF l_inv_debug_level IN(101, 102) THEN
44       INVPUTLI.info('INVPASGI.mtl_pr_assign_item_data: done INVPAGI2.assign_item_header_recs: rtn_status='||rtn_status);
45    END IF;
46 
47    IF (rtn_status <> 0) THEN
48       dumm_status := INVPUOPI.mtl_log_interface_err (
49                                 -1,
50                                 user_id,
51                                 login_id,
52                                 prog_appid,
53                                 prog_id,
54                                 request_id,
55                                 -1,
56                                 '*** BAD RETURN CODE b ***' || err_text,
57                                 null,
58 				'MTL_SYSTEM_ITEMS_INTERFACE',
59                                 'INV_IOI_ERR_ASS_ITM_HD_RVS',      --added by bug 11894684, replace INV_IOI_ERR with specific message name so we can identify error easily
60                                 err_text);
61 
62       RETURN (rtn_status);
63    END IF;
64 
65    IF l_inv_debug_level IN(101, 102) THEN
66       INVPUTLI.info('INVPASGI.mtl_pr_assign_item_data: before INVPAGI3.assign_item_revs');
67    END IF;
68 
69 
70    rtn_status := INVPAGI3.assign_item_revs (
71                       org_id,
72                       all_org,
73                       prog_appid,
74                       prog_id,
75                       request_id,
76                       user_id,
77                       login_id,
78                       err_text,
79                       xset_id,
80                       default_flag);
81 
82 
83    IF l_inv_debug_level IN(101, 102) THEN
84       INVPUTLI.info('INVPASGI.mtl_pr_assign_item_data: after INVPAGI3.assign_item_revs: rtn_status = '||rtn_status);
85    END IF;
86 
87 
88    IF (rtn_status <> 0) THEN
89       dumm_status := INVPUOPI.mtl_log_interface_err (
90                                 -1,
91                                 user_id,
92                                 login_id,
93                                 prog_appid,
94                                 prog_id,
95                                 request_id,
96                                 -1,
97                                 '*** BAD RETURN CODE e ***' || err_text,
98                                 null,
99                                 'MTL_ITEM_REVISIONS_INTERFACE',
100                                 'INV_IOI_ERR_ASS_ITM_RVS',      --added by bug 11894684, replace INV_IOI_ERR with specific message name so we can identify error easily
101                                 err_text);
102       RETURN (rtn_status);
103    END IF;
104 
105    RETURN (rtn_status);
106 
107 EXCEPTION
108 
109    WHEN others THEN
110       err_text := substr('INVPASGI.mtl_pr_assign_item_data:' || SQLERRM, 1,240);
111       RETURN (SQLCODE);
112 
113 END mtl_pr_assign_item_data;
114 
115 
116 END INVPASGI;