1 package CTO_MATCH_CONFIG as
2 /* $Header: CTOMCFGS.pls 120.1 2005/06/21 16:16:35 appldev 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 PROCEDURE perform_match
123 (
124 p_ato_line_id in number,
125 -- p_custom_match_profile in VARCHAR2,
126 x_return_status OUT NOCOPY VARCHAR2,
127 x_msg_count OUT NOCOPY NUMBER,
128 x_msg_data OUT NOCOPY VARCHAR2
129 );
130
131
132
133 TYPE MATCH_FLAG_REC_TYPE IS RECORD
134 ( LINE_ID number,
135 PARENT_ATO_LINE_ID number,
136 ATO_LINE_ID number,
137 MATCH_FLAG varchar2(1)
138 );
139
140
141 TYPE MATCH_FLAG_TBL_TYPE IS TABLE OF MATCH_FLAG_REC_TYPE INDEX BY BINARY_INTEGER ;
142
143 -- This procedure will get the Match_attribute from mtl_system_items_b
144 -- Will process those flags.
145 --Eg:
146 -- Model levels Match_ttribute perform_match
147 -- (from Item form) (calculated)
148 -- M1 Y N
149 -- ---M2 N N
150 -- ----M3 Y Y
151 PROCEDURE Evaluate_N_Pop_Match_Flag
152 (
153 p_match_flag_tab IN MATCH_FLAG_TBL_TYPE,
154 x_sparse_tab OUT NOCOPY MATCH_FLAG_TBL_TYPE,
155 x_return_status OUT NOCOPY VARCHAR2,
156 x_msg_count OUT NOCOPY NUMBER,
157 x_msg_data OUT NOCOPY VARCHAR2
158
159 );
160
161
162
163 TYPE number_arr_tbl_type IS TABLE OF number index by binary_integer;
164 TYPE char1_arr_tbl_type IS TABLE of varchar2(1) index by binary_integer;
165
166 TYPE Match_flag_rec_of_tab IS RECORD
167 (
168 LINE_ID number_arr_tbl_type,
169 MATCH_FLAG char1_arr_tbl_type
170
171 );
172
173
174
175
176 --This will transfer sparse record to record of tables
177 PROCEDURE xfer_match_flag_to_rec_of_tab
178 (
179
180 p_sparse_tab IN MATCH_FLAG_TBL_TYPE,
181 x_match_flag_rec OUT NOCOPY Match_flag_rec_of_tab,
182 x_return_status OUT NOCOPY VARCHAR2,
183 x_msg_count OUT NOCOPY NUMBER,
184 x_msg_data OUT NOCOPY VARCHAR2
185
186 );
187
188
189 PROCEDURE Update_BCOLGT_with_match_flag
190 (
191 x_return_status OUT NOCOPY VARCHAR2,
192 x_msg_count OUT NOCOPY NUMBER,
193 x_msg_data OUT NOCOPY VARCHAR2
194
195 );
196
197
198 end CTO_MATCH_CONFIG;