DBA Data[Home] [Help]
Skip to content

PACKAGE: APPS.CTO_MATCH_CONFIG

Source


1 package CTO_MATCH_CONFIG AUTHID CURRENT_USER as
2 /* $Header: CTOMCFGS.pls 120.2.12020000.4 2013/03/29 10:02:53 abhissri ship $ */
3 /*============================================================================+
4 |  Copyright (c) 1993 Oracle Corporation    Belmont, California, USA          |
5 |                        All rights reserved.                                 |
6 |                        Oracle Manufacturing                                 |
7 +=============================================================================+
8 |									      |
9 | FILE NAME   : CTOMCFGS.pls						      |
10 | DESCRIPTION :								      |
11 |               This file creates packaged functions that check for matching  |
12 |		configurations.		                                      |
13 |               This file creates packaged functions that check for matching  |
14 |               configurations and insert unique configurations into          |
15 |               BOM_ATO_CONFIGURATIONS.                                       |
16 |                                                                             |
17 |               check_config_match - checks BOM_ATO_CONFIGURATIONS for        |
18 |               configurations that match the ordered configuration.  It      |
19 |               is called from the Match Configuration Workflow activity      |
20 |               and from the Create Configuration batch process.              |
21 |                                                                             |
22 |               can_configurations - inserts unique configurations into       |
23 |               BOM_ATO_CONFIGURATIONS.  It is called from the Create         |
24 |               Configuration batch process and the Create Configuration      |
25 |               Item and BOM workflow activity.                        	      |
26 |									      |
27 | HISTORY     :  							      |
28 |									      |
29 | ksarkar  07/02/03     Bugfix 2986192: Introduce new global variable
30 |
31 | kkonada  09/05/2003   added prcodures for pacthset-J
32 |                       ATP's (GOP) match enhancement
33 |
34 | kkonada  02/23/2003  bugfix 3259017
35 |                      added no copy chnages for new procedures added
36 |                      as part of 11.5.10
37 =============================================================================*/
38 
39 gUserID         number       ;
40 gLoginId        number       ;
41 -- new global variable for bugfix 2986192
42 -- Initialized to 0
43 -- If matched , set this to 1 in the package body
44 -- reset this to 0 in create_in_src_orgs
45 gMatch          number       := 0;
46 
47 procedure match_and_create_all_items(
48         pModelLineId         in  number,
49         xReturnStatus         out NOCOPY varchar2,
50         xMsgCount             out NOCOPY number,
51         xMsgData              out NOCOPY varchar2
52         );
53 
54 function check_config_match(
55         p_model_line_id in      number,
56         x_config_match_id out NOCOPY    number,
57         x_error_message   out NOCOPY     VARCHAR2,   /* 70 bytes to hold  msg */
58         x_message_name    out NOCOPY    VARCHAR2   /* 30 bytes to hold  name */
59         )
60 return integer;
61 
62 
63 function can_configurations(
64         p_model_line_id   in     number,
65         prg_appid       in     number,
66         prg_id          in     number,
67         req_id          in     number,
68         user_id         in     number,
69         login_id        in     number,
70         error_msg       out NOCOPY    varchar2,
71         msg_name        out NOCOPY   varchar2
72         )
73 return integer;
74 
75 
76 PROCEDURE xfer_tab_to_rec(
77                 p_match_rec_of_tab IN	       CTO_Configured_Item_GRP.CTO_MATCH_REC_TYPE,
78                 x_tab_of_rec       OUT  NOCOPY CTO_Configured_Item_GRP.TEMP_TAB_OF_REC_TYPE,
79 		x_return_status    OUT	NOCOPY       VARCHAR2,
80 		x_msg_count	   OUT	NOCOPY       NUMBER,
81 		x_msg_data         OUT	NOCOPY       VARCHAR2
82 
83                 );
84 
85 
86 PROCEDURE xfer_rec_to_tab(
87                 p_tab_of_rec       IN		 CTO_Configured_Item_GRP.TEMP_TAB_OF_REC_TYPE,
88 		p_match_rec_of_tab IN OUT NOCOPY CTO_Configured_Item_GRP.CTO_MATCH_REC_TYPE,
89 		x_return_status    OUT	  NOCOPY	VARCHAR2,
90 		x_msg_count	   OUT	  NOCOPY	NUMBER,
91 		x_msg_data         OUT	  NOCOPY	VARCHAR2
92 
93                 );
94 
95 
96 PROCEDURE prepare_bcol_temp_data(
97                 p_source           IN varchar2,
98 		p_match_rec_of_tab IN OUT NOCOPY CTO_Configured_Item_GRP.CTO_MATCH_REC_TYPE,
99                 x_return_status    OUT	  NOCOPY	VARCHAR2,
100 		x_msg_count	   OUT	  NOCOPY	NUMBER,
101 		x_msg_data         OUT	  NOCOPY	VARCHAR2
102 	       );
103 
104 PROCEDURE Insert_into_bcol_gt(
105                 p_match_rec_of_tab IN OUT NOCOPY CTO_Configured_Item_GRP.CTO_MATCH_REC_TYPE,
106 		x_return_status    OUT	  NOCOPY	VARCHAR2,
107 		x_msg_count	   OUT	  NOCOPY	NUMBER,
108 		x_msg_data         OUT	  NOCOPY	VARCHAR2
109 	       );
110 
111 
112 
113 PROCEDURE CTO_REUSE_CONFIGURATION(
114 		p_ato_line_id	   IN  number default null,
115 		X_config_change    OUT NOCOPY varchar2,
116 		X_return_status	   OUT NOCOPY varchar2,
117 		X_msg_count	   OUT NOCOPY number,
118 		X_msg_data	   OUT NOCOPY varchar2
119 
120 		 );
121 
122 --
123 -- Bug 16352937
124 --
125 PROCEDURE perform_match
126  (
127    p_ato_line_id     in number,
128    x_return_status   OUT NOCOPY	VARCHAR2,
129    x_msg_count	     OUT NOCOPY	NUMBER,
130    x_msg_data        OUT NOCOPY	VARCHAR2
131   );
132 
133 --
134 -- bug 16352937
135 -- Overloaded the API to return l_hash_value
136 --
137 PROCEDURE perform_match
138  (
139    p_ato_line_id     in number,
140  --  p_custom_match_profile  in VARCHAR2,
141    x_return_status   OUT NOCOPY	VARCHAR2,
142    x_msg_count	     OUT NOCOPY	NUMBER,
143    x_msg_data        OUT NOCOPY	VARCHAR2,
144    -- Bugfix 16531547: x_hash_value should be a varchar.
145    -- x_hash_value      OUT NOCOPY NUMBER
146    x_hash_value      OUT NOCOPY VARCHAR2
147   );
148 
149 
150 
151 TYPE MATCH_FLAG_REC_TYPE IS RECORD
152 ( LINE_ID		number,
153   PARENT_ATO_LINE_ID    number,
154   ATO_LINE_ID           number,
155   MATCH_FLAG            varchar2(1)
156 );
157 
158 
159 --Bugfix 9148706: Indexing by LONG
160 --TYPE MATCH_FLAG_TBL_TYPE IS TABLE OF  MATCH_FLAG_REC_TYPE INDEX BY BINARY_INTEGER ;
161 TYPE MATCH_FLAG_TBL_TYPE IS TABLE OF  MATCH_FLAG_REC_TYPE INDEX BY LONG;
162 
163 -- This procedure will get the Match_attribute from mtl_system_items_b
164 -- Will process those flags.
165 --Eg:
166 -- Model levels	  Match_ttribute	perform_match
167 --                (from Item form)      (calculated)
168 -- M1                 Y                  N
169 --  ---M2             N                  N
170 --      ----M3        Y                  Y
171 PROCEDURE Evaluate_N_Pop_Match_Flag
172 (
173   p_match_flag_tab        IN	     MATCH_FLAG_TBL_TYPE,
174   x_sparse_tab            OUT NOCOPY MATCH_FLAG_TBL_TYPE,
175   x_return_status	  OUT NOCOPY	     VARCHAR2,
176   x_msg_count		  OUT NOCOPY	     NUMBER,
177   x_msg_data		  OUT NOCOPY	     VARCHAR2
178 
179 );
180 
181 
182 
183 TYPE number_arr_tbl_type	 IS TABLE OF number		index by binary_integer;
184 TYPE char1_arr_tbl_type		 IS TABLE of varchar2(1)	index by binary_integer;
185 
186 TYPE Match_flag_rec_of_tab IS RECORD
187 (
188   LINE_ID	number_arr_tbl_type,
189   MATCH_FLAG    char1_arr_tbl_type
190 
191 );
192 
193 
194 
195 
196 --This will transfer sparse record to record of tables
197 PROCEDURE xfer_match_flag_to_rec_of_tab
198 (
199 
200   p_sparse_tab            IN		   MATCH_FLAG_TBL_TYPE,
201   x_match_flag_rec        OUT   NOCOPY     Match_flag_rec_of_tab,
202   x_return_status	  OUT	NOCOPY	  VARCHAR2,
203   x_msg_count		  OUT	NOCOPY	  NUMBER,
204   x_msg_data		  OUT	NOCOPY	  VARCHAR2
205 
206 );
207 
208 
209 PROCEDURE Update_BCOLGT_with_match_flag
210 (
211   x_return_status	  OUT NOCOPY  VARCHAR2,
212   x_msg_count		  OUT NOCOPY  NUMBER,
213   x_msg_data		  OUT NOCOPY  VARCHAR2
214 
215 );
216 
217 
218 end CTO_MATCH_CONFIG;