DBA Data[Home] [Help]

PACKAGE BODY: APPS.OE_DEPENDENCIES

Source


1 PACKAGE BODY OE_Dependencies AS
2 /* $Header: OEXUDEPB.pls 120.5.12010000.2 2008/10/30 16:43:22 cpati ship $ */
3 
4 --  Global constant holding the package name
5 
6 G_PKG_NAME      	CONSTANT    VARCHAR2(30):='OE_Dependencies';
7 
8 PROCEDURE Merge_Dependencies_Extn
9 (   p_entity_code       IN  VARCHAR2
10 )
11 IS
12 l_index                  NUMBER;
13 l_extn_dep_tbl           OE_Dependencies_Extn.Dep_Tbl_Type;
14 l_dep_index              NUMBER;
15 l_found                  BOOLEAN;
16 --
17 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
18 --
19 BEGIN
20     IF l_debug_level  > 0 THEN
21         oe_debug_pub.add(  'ENTER OE_DEPENDENCIES.MERGE_DEPENDENCIES_EXTN' , 1 ) ;
22     END IF;
23 
24     OE_Dependencies_Extn.Load_Entity_Attributes
25        (p_entity_code       => p_entity_code
26        ,x_extn_dep_tbl      => l_extn_dep_tbl
27        );
28 
29     l_index := l_extn_dep_tbl.FIRST;
30 
31     WHILE l_index IS NOT NULL LOOP
32 
33       -- Ignore if dependent attribute is one of the internal fields.
34       IF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER THEN
35          IF l_extn_dep_tbl(l_index).dependent_attribute IN
36               ( OE_HEADER_UTIL.G_ORDER_CATEGORY
37          ) THEN
38            IF l_debug_level  > 0 THEN
39                oe_debug_pub.add(  'INTERNAL FIELD DEPENDENCY' ) ;
40            END IF;
41            GOTO END_OF_LOOP;
42          END IF;
43       ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE THEN
44          IF l_extn_dep_tbl(l_index).dependent_attribute IN
45               ( OE_LINE_UTIL.G_LINE_CATEGORY
46               , OE_LINE_UTIL.G_SHIPMENT_NUMBER
47               , OE_LINE_UTIL.G_OPTION_NUMBER
48               , OE_LINE_UTIL.G_COMPONENT_NUMBER
49               , OE_LINE_UTIL.G_ITEM_TYPE
50               , OE_LINE_UTIL.G_TOP_MODEL_LINE
51               , OE_LINE_UTIL.G_SHIPPABLE
52               , OE_LINE_UTIL.G_ATO_LINE
53               , OE_LINE_UTIL.G_INVOICE_INTERFACE_STATUS
54               , OE_LINE_UTIL.G_COMPONENT
55               , OE_LINE_UTIL.G_COMPONENT_SEQUENCE
56               , OE_LINE_UTIL.G_SORT_ORDER
57               , OE_LINE_UTIL.G_SHIPPABLE
58          ) THEN
59            IF l_debug_level  > 0 THEN
60                oe_debug_pub.add(  'INTERNAL FIELD DEPENDENCY' ) ;
61            END IF;
62            GOTO END_OF_LOOP;
63          END IF;
64 --serla begin
65       ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER_PAYMENT THEN
66          IF l_extn_dep_tbl(l_index).dependent_attribute IN
67               ( OE_HEADER_PAYMENT_UTIL.G_PAYMENT_TYPE_CODE
68          ) THEN
69            IF l_debug_level  > 0 THEN
70                oe_debug_pub.add(  'INTERNAL FIELD DEPENDENCY' ) ;
71            END IF;
72            GOTO END_OF_LOOP;
73          END IF;
74       ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE_PAYMENT THEN
75          IF l_extn_dep_tbl(l_index).dependent_attribute IN
76               ( OE_LINE_PAYMENT_UTIL.G_PAYMENT_TYPE_CODE
77          ) THEN
78            IF l_debug_level  > 0 THEN
79                oe_debug_pub.add(  'INTERNAL FIELD DEPENDENCY' ) ;
80            END IF;
81            GOTO END_OF_LOOP;
82          END IF;
83 --serla end
84       END IF;
85 
86       l_dep_index := l_extn_dep_tbl(l_index).source_attribute * G_MAX;
87       l_found := FALSE;
88 
89       WHILE (NOT l_found) AND g_dep_tbl.EXISTS(l_dep_index) LOOP
90          IF g_dep_tbl(l_dep_index).attribute = l_extn_dep_tbl(l_index).dependent_attribute THEN
91             IF l_debug_level  > 0 THEN
92                 oe_debug_pub.add(  'DEPENDENCY UPDATED' ) ;
93             END IF;
94             l_found := TRUE;
95             g_dep_tbl(l_dep_index).enabled_flag := l_extn_dep_tbl(l_index).enabled_flag;
96          END IF;
97          l_dep_index := l_dep_index+1;
98       END LOOP;
99 
100       IF (NOT l_found) AND l_extn_dep_tbl(l_index).enabled_flag = 'Y' THEN
101          IF l_debug_level  > 0 THEN
102              oe_debug_pub.add(  'NEW DEPENDENCY ENABLED' ) ;
103          END IF;
104          g_dep_tbl(l_dep_index).attribute := l_extn_dep_tbl(l_index).dependent_attribute;
105       END IF;
106 
107       <<END_OF_LOOP>>
108       l_index := l_extn_dep_tbl.NEXT(l_index);
109 
110     END LOOP;
111 
112     IF l_debug_level  > 0 THEN
113         oe_debug_pub.add(  'EXIT OE_DEPENDENCIES.MERGE_DEPENDENCIES_EXTN' , 1 ) ;
114     END IF;
115 EXCEPTION
116         WHEN OTHERS THEN
117         IF OE_MSG_PUB.Check_Msg_Level(OE_MSG_PUB.G_MSG_LVL_UNEXP_ERROR)
118         THEN
119                 OE_MSG_PUB.Add_Exc_Msg
120                 (   G_PKG_NAME
121                 ,   'Merge_Dependencies_Extn'
122                 );
123         END IF;
124         RAISE FND_API.G_EXC_UNEXPECTED_ERROR;
125 END Merge_Dependencies_Extn;
126 
127 PROCEDURE   Load_Entity_Attributes
128 (   p_entity_code	IN  VARCHAR2	)
129 IS
130 l_index		NUMBER :=0;
131 --
132 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
133 --
134 BEGIN
135 
136     IF l_debug_level  > 0 THEN
137         oe_debug_pub.add(  'ENTERING OE_DEPENDENCIES.LOAD_ENTITY_ATTRIBUTES' , 1 ) ;
138     END IF;
139 
140     IF g_entity_code <> p_entity_code OR
141 	g_entity_code IS NULL
142     THEN
143 
144 	--  Load entity Attributes
145 
146        -- Need to delete table because it
147        -- could have been set by a previous
148        -- entity
149        IF (g_dep_tbl.COUNT >= 1) THEN
150 	  g_dep_tbl.DELETE;
151        END IF;
152 
153 	g_entity_code := p_entity_code;
154 
155 	IF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER THEN
156 
157 	    --  Populate dependent attributes for one source at a time.
158 
159 	    l_index := OE_HEADER_UTIL.G_ORDER_TYPE * G_MAX ;
160 	    g_dep_tbl(l_index  ).attribute  := OE_HEADER_UTIL.G_INVOICING_RULE;
161 	    g_dep_tbl(l_index +1 ).attribute  := OE_HEADER_UTIL.G_ACCOUNTING_RULE;
162 	    g_dep_tbl(l_index +2 ).attribute  := OE_HEADER_UTIL.G_PRICE_LIST;
163 	    g_dep_tbl(l_index +3 ).attribute  := OE_HEADER_UTIL.G_SHIPMENT_PRIORITY;
164 	    g_dep_tbl(l_index +4 ).attribute  := OE_HEADER_UTIL.G_SHIPPING_METHOD;
165 	    g_dep_tbl(l_index +5 ).attribute  := OE_HEADER_UTIL.G_FOB_POINT;
166 	    g_dep_tbl(l_index +6 ).attribute  := OE_HEADER_UTIL.G_FREIGHT_TERMS;
167 	    g_dep_tbl(l_index +7 ).attribute  := OE_HEADER_UTIL.G_SHIP_FROM_ORG;
168 	    g_dep_tbl(l_index + 8).attribute	    := OE_HEADER_UTIL.G_ORDER_CATEGORY;
169 	    g_dep_tbl(l_index + 9).attribute	    := OE_HEADER_UTIL.G_DEMAND_CLASS;
170 	    g_dep_tbl(l_index + 10).attribute	    := OE_HEADER_UTIL.G_REQUEST_DATE;
171 	    g_dep_tbl(l_index + 11).attribute  := OE_HEADER_UTIL.G_TRANSACTIONAL_CURR;
172 	    g_dep_tbl(l_index +12 ).attribute := OE_HEADER_UTIL.G_SHIP_TOLERANCE_BELOW;
173 	    g_dep_tbl(l_index +13 ).attribute := OE_HEADER_UTIL.G_SHIP_TOLERANCE_ABOVE;
174             g_dep_tbl(l_index +14 ).attribute := OE_HEADER_UTIL.G_DEFAULT_FULFILLMENT_SET;
175             g_dep_tbl(l_index +15).attribute  := OE_HEADER_UTIL.G_CUSTOMER_PREFERENCE_SET;
176             -- QUOTING changes
177             g_dep_tbl(l_index +16).attribute  := OE_HEADER_UTIL.G_TRANSACTION_PHASE;
178 
179 	    l_index := OE_HEADER_UTIL.G_AGREEMENT * G_MAX ;
180 	    g_dep_tbl(l_index ).attribute	    := OE_HEADER_UTIL.G_CUST_PO_NUMBER;
181 	    g_dep_tbl(l_index +1 ).attribute  := OE_HEADER_UTIL.G_INVOICING_RULE;
182 	    g_dep_tbl(l_index +2 ).attribute  := OE_HEADER_UTIL.G_ACCOUNTING_RULE;
183 	    g_dep_tbl(l_index +3 ).attribute  := OE_HEADER_UTIL.G_PAYMENT_TERM;
184 	    g_dep_tbl(l_index +4 ).attribute  := OE_HEADER_UTIL.G_INVOICE_TO_ORG;
185 	    g_dep_tbl(l_index +5 ).attribute  := OE_HEADER_UTIL.G_INVOICE_TO_CONTACT;
186 	    g_dep_tbl(l_index +6 ).attribute  := OE_HEADER_UTIL.G_PRICE_LIST;
187 	    g_dep_tbl(l_index +7 ).attribute  := OE_HEADER_UTIL.G_SALESREP;
188 
189 
190 	    l_index := OE_HEADER_UTIL.G_INVOICE_TO_ORG * G_MAX ;
191 	    g_dep_tbl(l_index ).attribute	    := OE_HEADER_UTIL.G_PAYMENT_TERM;
192 	    g_dep_tbl(l_index +1 ).attribute  := OE_HEADER_UTIL.G_INVOICE_TO_CONTACT;
193 	    g_dep_tbl(l_index +2 ).attribute  := OE_HEADER_UTIL.G_PRICE_LIST;
194 	    g_dep_tbl(l_index +3 ).attribute  := OE_HEADER_UTIL.G_FOB_POINT;
195 	    g_dep_tbl(l_index +4 ).attribute  := OE_HEADER_UTIL.G_FREIGHT_TERMS;
196 	    -- Added by Manish
197 	    g_dep_tbl(l_index +5 ).attribute  := OE_HEADER_UTIL.G_TAX_EXEMPT_NUMBER;
198 	    g_dep_tbl(l_index +6 ).attribute  := OE_HEADER_UTIL.G_TAX_EXEMPT_REASON;
199 	    -- Added by Manish
200 	    g_dep_tbl(l_index +7 ).attribute  := OE_HEADER_UTIL.G_SALESREP;
201 	    g_dep_tbl(l_index +8 ).attribute  := OE_HEADER_UTIL.G_SHIPPING_METHOD;
202 	    -- Adding for OM-iPayment - Raju
203 	    g_dep_tbl(l_index +9 ).attribute  := OE_HEADER_UTIL.G_CREDIT_CARD_NUMBER;
204 	    g_dep_tbl(l_index +10 ).attribute  := OE_HEADER_UTIL.G_CREDIT_CARD_HOLDER_NAME;
205 	    g_dep_tbl(l_index +11 ).attribute  := OE_HEADER_UTIL.G_CREDIT_CARD_EXPIRATION_DATE;
206 	    g_dep_tbl(l_index +12 ).attribute := OE_HEADER_UTIL.G_SHIP_TOLERANCE_BELOW;
207 	    g_dep_tbl(l_index +13 ).attribute := OE_HEADER_UTIL.G_SHIP_TOLERANCE_ABOVE;
208 	    g_dep_tbl(l_index +14 ).attribute := OE_HEADER_UTIL.G_ORDER_TYPE;
209             /* Fix Bug # 2297053: Added to clear Credit Card Type */
210 	    g_dep_tbl(l_index +15 ).attribute  := OE_HEADER_UTIL.G_CREDIT_CARD;
211             g_dep_tbl(l_index +16).attribute  := OE_HEADER_UTIL.G_CUSTOMER_PREFERENCE_SET;
212 
213 	    l_index := OE_HEADER_UTIL.G_SHIP_TO_ORG * G_MAX ;
214 	    g_dep_tbl(l_index  ).attribute  := OE_HEADER_UTIL.G_TAX_EXEMPT_NUMBER;
215 	    g_dep_tbl(l_index +1 ).attribute  := OE_HEADER_UTIL.G_TAX_EXEMPT_REASON;
216 	    g_dep_tbl(l_index +2 ).attribute  := OE_HEADER_UTIL.G_PRICE_LIST;
217 	    g_dep_tbl(l_index +3 ).attribute  := OE_HEADER_UTIL.G_FOB_POINT;
218 	    g_dep_tbl(l_index +4 ).attribute  := OE_HEADER_UTIL.G_FREIGHT_TERMS;
219 	    g_dep_tbl(l_index +5 ).attribute  := OE_HEADER_UTIL.G_SHIPPING_METHOD;
220 	    g_dep_tbl(l_index +6 ).attribute  := OE_HEADER_UTIL.G_DEMAND_CLASS;
221 	    g_dep_tbl(l_index +7 ).attribute  := OE_HEADER_UTIL.G_INVOICE_TO_ORG;
222 	    g_dep_tbl(l_index +8 ).attribute  := OE_HEADER_UTIL.G_SALESREP;
223 	    g_dep_tbl(l_index +9 ).attribute  := OE_HEADER_UTIL.G_PAYMENT_TERM;
224 	    g_dep_tbl(l_index +10 ).attribute  := OE_HEADER_UTIL.G_SHIP_FROM_ORG;
225 	    g_dep_tbl(l_index +11 ).attribute := OE_HEADER_UTIL.G_SHIP_TOLERANCE_BELOW;
226 	    g_dep_tbl(l_index +12 ).attribute := OE_HEADER_UTIL.G_SHIP_TOLERANCE_ABOVE;
227 	    g_dep_tbl(l_index +13 ).attribute := OE_HEADER_UTIL.G_ORDER_TYPE;
228 	    g_dep_tbl(l_index +14 ).attribute := OE_HEADER_UTIL.G_SHIP_TO_CONTACT;
229 	    g_dep_tbl(l_index +15 ).attribute := OE_HEADER_UTIL.G_ORDER_DATE_TYPE_CODE;
230 	    g_dep_tbl(l_index +16 ).attribute := OE_HEADER_UTIL.G_LATEST_SCHEDULE_LIMIT;
231             g_dep_tbl(l_index +17).attribute   := OE_HEADER_UTIL.G_CUSTOMER_PREFERENCE_SET;
232 
233 	    l_index := OE_HEADER_UTIL.G_REQUEST_DATE * G_MAX ;
234 	    g_dep_tbl(l_index  ).attribute  := OE_HEADER_UTIL.G_TAX_EXEMPT_NUMBER;
235 	    g_dep_tbl(l_index +1 ).attribute  := OE_HEADER_UTIL.G_TAX_EXEMPT_REASON;
236 
237 	    l_index := OE_HEADER_UTIL.G_TAX_EXEMPT * G_MAX ;
238 	    g_dep_tbl(l_index  ).attribute  := OE_HEADER_UTIL.G_TAX_EXEMPT_NUMBER;
239 	    g_dep_tbl(l_index +1 ).attribute  := OE_HEADER_UTIL.G_TAX_EXEMPT_REASON;
240 	    -- Added by Manish
241 
242 	    l_index := OE_HEADER_UTIL.G_SOLD_TO_ORG * G_MAX ;
243 	    g_dep_tbl(l_index ).attribute	    := OE_HEADER_UTIL.G_PAYMENT_TERM;
244 	    g_dep_tbl(l_index +1 ).attribute  := OE_HEADER_UTIL.G_INVOICE_TO_ORG;
245 	    g_dep_tbl(l_index +2 ).attribute  := OE_HEADER_UTIL.G_PRICE_LIST;
246 	    g_dep_tbl(l_index +3 ).attribute  := OE_HEADER_UTIL.G_FOB_POINT;
247 	    g_dep_tbl(l_index +4 ).attribute  := OE_HEADER_UTIL.G_FREIGHT_TERMS;
248 	    g_dep_tbl(l_index +5 ).attribute  := OE_HEADER_UTIL.G_DELIVER_TO_ORG;
249 	    g_dep_tbl(l_index +6 ).attribute  := OE_HEADER_UTIL.G_SHIP_TO_ORG;
250 	    g_dep_tbl(l_index +7 ).attribute  := OE_HEADER_UTIL.G_ORDER_TYPE;
251 	    -- Added by Manish
252 	    g_dep_tbl(l_index +8 ).attribute  := OE_HEADER_UTIL.G_TAX_EXEMPT_NUMBER;
253 	    g_dep_tbl(l_index +9 ).attribute  := OE_HEADER_UTIL.G_TAX_EXEMPT_REASON;
254 	    -- Added by Manish
255 	    g_dep_tbl(l_index +10 ).attribute  := OE_HEADER_UTIL.G_SALESREP;
256 	    g_dep_tbl(l_index +11 ).attribute  := OE_HEADER_UTIL.G_SHIPPING_METHOD;
257 	    g_dep_tbl(l_index +12 ).attribute  := OE_HEADER_UTIL.G_SHIP_FROM_ORG;
258 	    -- Adding for OM-iPayment - Raju
259 	    g_dep_tbl(l_index +13 ).attribute  := OE_HEADER_UTIL.G_CREDIT_CARD_NUMBER;
260 	    g_dep_tbl(l_index +14 ).attribute  := OE_HEADER_UTIL.G_CREDIT_CARD_HOLDER_NAME;
261 	    g_dep_tbl(l_index +15 ).attribute  := OE_HEADER_UTIL.G_CREDIT_CARD_EXPIRATION_DATE;
262 	    g_dep_tbl(l_index +16 ).attribute := OE_HEADER_UTIL.G_SHIP_TOLERANCE_BELOW;
263 	    g_dep_tbl(l_index +17 ).attribute := OE_HEADER_UTIL.G_SHIP_TOLERANCE_ABOVE;
264 	    g_dep_tbl(l_index +18 ).attribute := OE_HEADER_UTIL.G_SALES_CHANNEL;
265 	    g_dep_tbl(l_index +19 ).attribute := OE_HEADER_UTIL.G_ORDER_DATE_TYPE_CODE;
266 	    g_dep_tbl(l_index +20 ).attribute := OE_HEADER_UTIL.G_LATEST_SCHEDULE_LIMIT;
267             g_dep_tbl(l_index +21 ).attribute := OE_HEADER_UTIL.G_AGREEMENT;
268             /* Fix Bug # 2297053: Added to clear Credit Card Type */
269 	    g_dep_tbl(l_index +22 ).attribute  := OE_HEADER_UTIL.G_CREDIT_CARD;
270             g_dep_tbl(l_index +23 ).attribute  := OE_HEADER_UTIL.G_SOLD_TO_PHONE;
271             g_dep_tbl(l_index +24).attribute   := OE_HEADER_UTIL.G_CUSTOMER_PREFERENCE_SET;
272             -- QUOTING changes
273             g_dep_tbl(l_index +25).attribute   := OE_HEADER_UTIL.G_SOLD_TO_SITE_USE;
274 	    --distributed orders
275 	    g_dep_tbl(l_index +26).attribute   := OE_HEADER_UTIL.G_END_CUSTOMER;
276 
277 	    l_index := OE_HEADER_UTIL.G_PRICE_LIST * G_MAX ;
278 	    g_dep_tbl(l_index ).attribute	    := OE_HEADER_UTIL.G_PAYMENT_TERM;
279 	    g_dep_tbl(l_index +1 ).attribute  := OE_HEADER_UTIL.G_FREIGHT_TERMS;
280 	    g_dep_tbl(l_index +2 ).attribute  := OE_HEADER_UTIL.G_SHIPPING_METHOD;
281             /* Added the following if condition to fix the bug 2478334 */
282             IF  UPPER(fnd_profile.value('QP_MULTI_CURRENCY_INSTALLED'))  IN ('Y', 'YES') THEN
283                null;
284          ELSE
285 	    g_dep_tbl(l_index +3 ).attribute  := OE_HEADER_UTIL.G_TRANSACTIONAL_CURR;
286             END IF;
287 
288 	    -- Adding for OM-iPayment - Raju
289 	    l_index := OE_HEADER_UTIL.G_PAYMENT_TYPE * G_MAX ;
290 	    g_dep_tbl(l_index).attribute     := OE_HEADER_UTIL.G_CREDIT_CARD_NUMBER;
291 	    g_dep_tbl(l_index +1 ).attribute := OE_HEADER_UTIL.G_CREDIT_CARD_HOLDER_NAME;
292 	    g_dep_tbl(l_index +2 ).attribute := OE_HEADER_UTIL.G_CREDIT_CARD_EXPIRATION_DATE;
293 	    g_dep_tbl(l_index +3 ).attribute := OE_HEADER_UTIL.G_CREDIT_CARD_APPROVAL_DATE;
294 	    g_dep_tbl(l_index +4 ).attribute := OE_HEADER_UTIL.G_CREDIT_CARD_APPROVAL;
295 	    g_dep_tbl(l_index +5 ).attribute := OE_HEADER_UTIL.G_CHECK_NUMBER;
296 	    g_dep_tbl(l_index +6 ).attribute := OE_HEADER_UTIL.G_PAYMENT_AMOUNT;
297 	    g_dep_tbl(l_index +7 ).attribute := OE_HEADER_UTIL.G_CREDIT_CARD;
298 
299             /* Fix Bug # 2297053: Added to make attributes depended on CC Number */
300 	    l_index := OE_HEADER_UTIL.G_CREDIT_CARD_NUMBER * G_MAX ;
301             /*
302             ** Fix Bug # 2867744: Commented the clearing of Credit Card Type
303 	    g_dep_tbl(l_index).attribute     := OE_HEADER_UTIL.G_CREDIT_CARD;
304             */
305 	    g_dep_tbl(l_index).attribute := OE_HEADER_UTIL.G_CREDIT_CARD_HOLDER_NAME;
306 	    g_dep_tbl(l_index +1 ).attribute := OE_HEADER_UTIL.G_CREDIT_CARD_EXPIRATION_DATE;
307 	    g_dep_tbl(l_index +2 ).attribute := OE_HEADER_UTIL.G_CREDIT_CARD_APPROVAL_DATE;
308 	    g_dep_tbl(l_index +3 ).attribute := OE_HEADER_UTIL.G_CREDIT_CARD_APPROVAL;
309 	    --7337623 g_dep_tbl(l_index +4 ).attribute := OE_HEADER_UTIL.G_PAYMENT_AMOUNT;
310 
311 	    -- Adding for Currency conversion. -- Added by Aswin.
312 	    l_index := OE_HEADER_UTIL.G_TRANSACTIONAL_CURR * G_MAX ;
313 	    g_dep_tbl(l_index).attribute     := OE_HEADER_UTIL.G_CONVERSION_TYPE;
314 	    g_dep_tbl(l_index +1 ).attribute := OE_HEADER_UTIL.G_CONVERSION_RATE_DATE;
315 	    g_dep_tbl(l_index +2 ).attribute := OE_HEADER_UTIL.G_CONVERSION_RATE;
316 
317 	    -- Adding for deliver to org . -- Added by Shashi.
318 	    l_index := OE_HEADER_UTIL.G_DELIVER_TO_ORG * G_MAX ;
319 	    g_dep_tbl(l_index).attribute     := OE_HEADER_UTIL.G_DELIVER_TO_CONTACT;
320 
321 
322 	    -- Begin Fix bug 1282800: added dependencies for contact fields
323 
324 	    l_index := OE_HEADER_UTIL.G_INVOICE_TO_CONTACT * G_MAX ;
325 	    g_dep_tbl(l_index).attribute     := OE_HEADER_UTIL.G_SOLD_TO_CONTACT;
326 
327 	    l_index := OE_HEADER_UTIL.G_SHIP_TO_CONTACT * G_MAX ;
331 
328 	    g_dep_tbl(l_index).attribute    := OE_HEADER_UTIL.G_SOLD_TO_CONTACT;
329 
330 	    -- End Fix bug 1282800
332             -- bug 5127922 : added dependency for cusotmer_location
333 	    l_index := OE_HEADER_UTIL.G_SOLD_TO_SITE_USE * G_MAX ;
334 	    g_dep_tbl(l_index).attribute     := OE_HEADER_UTIL.G_PAYMENT_TERM;
335 
336             -- BLANKETS: Add dependencies on blanket number for order header
337             IF OE_CODE_CONTROL.Code_Release_Level >= '110509' THEN
338 
339 	    l_index := OE_HEADER_UTIL.G_BLANKET_NUMBER * G_MAX ;
340             -- Bug 3279125 -
341             -- Remove dependency of sold to (customer) on blanket number
342 --	    g_dep_tbl(l_index).attribute := OE_HEADER_UTIL.G_SOLD_TO_ORG;
343 	    g_dep_tbl(l_index).attribute := OE_HEADER_UTIL.G_ACCOUNTING_RULE;
344 	    g_dep_tbl(l_index+1).attribute := OE_HEADER_UTIL.G_INVOICING_RULE;
345 	    g_dep_tbl(l_index+2).attribute := OE_HEADER_UTIL.G_TRANSACTIONAL_CURR;
346 	    g_dep_tbl(l_index+3).attribute := OE_HEADER_UTIL.G_SHIP_TO_ORG;
347 	    g_dep_tbl(l_index+4).attribute := OE_HEADER_UTIL.G_INVOICE_TO_ORG;
348 	    g_dep_tbl(l_index+5).attribute := OE_HEADER_UTIL.G_DELIVER_TO_ORG;
349 	    g_dep_tbl(l_index+6).attribute := OE_HEADER_UTIL.G_SOLD_TO_CONTACT;
350 	    g_dep_tbl(l_index+7).attribute := OE_HEADER_UTIL.G_SHIP_FROM_ORG;
351 	    g_dep_tbl(l_index+8).attribute := OE_HEADER_UTIL.G_PAYMENT_TERM;
352 	    g_dep_tbl(l_index+9).attribute := OE_HEADER_UTIL.G_PRICE_LIST;
353 	    g_dep_tbl(l_index+10).attribute := OE_HEADER_UTIL.G_SHIPPING_METHOD;
354 	    g_dep_tbl(l_index+11).attribute := OE_HEADER_UTIL.G_FREIGHT_TERMS;
355 	    g_dep_tbl(l_index+12).attribute := OE_HEADER_UTIL.G_SALESREP;
356 	    g_dep_tbl(l_index+13).attribute := OE_HEADER_UTIL.G_SHIPPING_INSTRUCTIONS;
357 	    g_dep_tbl(l_index+14).attribute := OE_HEADER_UTIL.G_PACKING_INSTRUCTIONS;
358 
359             END IF;
360 
361             -- QUOTING changes
362             -- Add dependency of quote date/ordered date on transaction phase
363             IF OE_CODE_CONTROL.Code_Release_Level >= '110510' THEN
364 
365 	    l_index := OE_HEADER_UTIL.G_TRANSACTION_PHASE * G_MAX ;
366 	    g_dep_tbl(l_index).attribute := OE_HEADER_UTIL.G_QUOTE_DATE;
367 	    g_dep_tbl(l_index+1).attribute := OE_HEADER_UTIL.G_ORDERED_DATE;
368 
369             END IF;
370             -- END QUOTING changes
371 
372 	    --distributed orders
373 	    IF OE_CODE_CONTROL.Code_Release_Level >= '110510' THEN
374 	       l_index := OE_HEADER_UTIL.G_END_CUSTOMER * G_MAX ;
375 	       g_dep_tbl(l_index).attribute   := OE_HEADER_UTIL.G_END_CUSTOMER_CONTACT;
376 	       g_dep_tbl(l_index+1).attribute := OE_HEADER_UTIL.G_END_CUSTOMER_SITE_USE;
377             END IF;
378 
379             --key transaction dates
380 	    IF OE_CODE_CONTROL.Code_Release_Level >= '110509' THEN
381 		l_index := OE_HEADER_UTIL.G_ORDERED_DATE * G_MAX ;
382 		g_dep_tbl(l_index).attribute := OE_HEADER_UTIL.G_ORDER_FIRMED_DATE;
383 	    END IF;
384 
385 	ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE THEN
386 
387 	    l_index := OE_LINE_UTIL.G_LINE_NUMBER * G_MAX ;
388 	    g_dep_tbl(l_index ).attribute	    := OE_LINE_UTIL.G_SHIPMENT_NUMBER;
389 	    g_dep_tbl(l_index+1 ).attribute   := OE_LINE_UTIL.G_OPTION_NUMBER;
390 	    g_dep_tbl(l_index+2 ).attribute    := OE_LINE_UTIL.G_COMPONENT_NUMBER;
391             -- component_number and not component above.
392 
393 	    l_index := OE_LINE_UTIL.G_LINE_TYPE * G_MAX ;
394 	    g_dep_tbl(l_index ).attribute	    := OE_LINE_UTIL.G_LINE_CATEGORY;
395 	    /* Added by Manish */
396 	    g_dep_tbl(l_index +1 ).attribute   := OE_LINE_UTIL.G_TAX;
397 	    /* Added by Manish */
398 	    g_dep_tbl(l_index +2 ).attribute  := OE_LINE_UTIL.G_ACCOUNTING_RULE;
399 	    g_dep_tbl(l_index +3 ).attribute  := OE_LINE_UTIL.G_PRICE_LIST;
400 	    g_dep_tbl(l_index +4 ).attribute  := OE_LINE_UTIL.G_SHIPMENT_PRIORITY;
401 	    g_dep_tbl(l_index +5 ).attribute  := OE_LINE_UTIL.G_SHIPPING_METHOD;
402 	    g_dep_tbl(l_index +6 ).attribute  := OE_LINE_UTIL.G_FOB_POINT;
403 	    g_dep_tbl(l_index +7 ).attribute  := OE_LINE_UTIL.G_FREIGHT_TERMS;
404 	    g_dep_tbl(l_index +8 ).attribute  := OE_LINE_UTIL.G_SHIP_FROM_ORG;
405 	    g_dep_tbl(l_index +9).attribute   := OE_LINE_UTIL.G_DEMAND_CLASS;
406 	    g_dep_tbl(l_index +10 ).attribute  := OE_LINE_UTIL.G_INVOICING_RULE;
407 	    g_dep_tbl(l_index +11 ).attribute := OE_LINE_UTIL.G_SHIP_TOLERANCE_BELOW;
408 	    g_dep_tbl(l_index +12 ).attribute := OE_LINE_UTIL.G_SHIP_TOLERANCE_ABOVE;
409 	    g_dep_tbl(l_index +13 ).attribute := OE_LINE_UTIL.G_SOURCE_TYPE;
410 
411 	    l_index := OE_LINE_UTIL.G_INVENTORY_ITEM * G_MAX ;
412 	    g_dep_tbl(l_index ).attribute	    := OE_LINE_UTIL.G_ORDER_QUANTITY_UOM;
413 	    g_dep_tbl(l_index +1 ).attribute  := OE_LINE_UTIL.G_PRICING_QUANTITY_UOM;
414 	    g_dep_tbl(l_index +2 ).attribute  := OE_LINE_UTIL.G_SHIP_FROM_ORG;
415 	    g_dep_tbl(l_index +3 ).attribute  := OE_LINE_UTIL.G_INVOICING_RULE;
416 	    g_dep_tbl(l_index +4 ).attribute  := OE_LINE_UTIL.G_ACCOUNTING_RULE;
417 	    g_dep_tbl(l_index +5 ).attribute  := OE_LINE_UTIL.G_TAX_VALUE;
418 	    g_dep_tbl(l_index +6 ).attribute  := OE_LINE_UTIL.G_ITEM_TYPE;
419 	    g_dep_tbl(l_index +7 ).attribute  := OE_LINE_UTIL.G_TOP_MODEL_LINE;
420 	    g_dep_tbl(l_index +8 ).attribute  := OE_LINE_UTIL.G_SHIPPABLE;
421 	    g_dep_tbl(l_index +9 ).attribute  := OE_LINE_UTIL.G_ATO_LINE;
422 	    g_dep_tbl(l_index +10 ).attribute := OE_LINE_UTIL.G_INVOICE_INTERFACE_STATUS;
423 	    /* Added by Manish */
424 	    g_dep_tbl(l_index +11 ).attribute := OE_LINE_UTIL.G_TAX;
425 	    /* Added by Manish */
426 	    g_dep_tbl(l_index +12 ).attribute := OE_LINE_UTIL.G_SHIP_TOLERANCE_BELOW;
430 	    g_dep_tbl(l_index +16 ).attribute := OE_LINE_UTIL.G_END_ITEM_UNIT_NUMBER;
427 	    g_dep_tbl(l_index +13 ).attribute := OE_LINE_UTIL.G_SHIP_TOLERANCE_ABOVE;
428 	    g_dep_tbl(l_index +14 ).attribute := OE_LINE_UTIL.G_PAYMENT_TERM;
429 	    g_dep_tbl(l_index +15 ).attribute := OE_LINE_UTIL.G_SHIP_FROM_ORG;
431            /* OPM 02/JUN/00 - add dependencies for process attribs */
432          -- commented out for bug 1618229.
433          -- g_dep_tbl(l_index +17 ).attribute := OE_LINE_UTIL.G_COMMITMENT;
434             g_dep_tbl(l_index +17 ).attribute := OE_LINE_UTIL.G_ORDERED_QUANTITY_UOM2;
435             g_dep_tbl(l_index +18 ).attribute := OE_LINE_UTIL.G_PREFERRED_GRADE;
436 
437            /* OPM END */
438 	    g_dep_tbl(l_index +19 ).attribute := OE_LINE_UTIL.G_SERVICE_START_DATE;
439 	    g_dep_tbl(l_index +20 ).attribute := OE_LINE_UTIL.G_SERVICE_PERIOD;
440 	    g_dep_tbl(l_index +21 ).attribute := OE_LINE_UTIL.G_SERVICE_REFERENCE_TYPE_CODE;
441 	    g_dep_tbl(l_index +22 ).attribute := OE_LINE_UTIL.G_COMPONENT;
442          /* Added for Returns processing */
443          g_dep_tbl(l_index +23 ).attribute := OE_LINE_UTIL.G_RETURN_CONTEXT;
444          g_dep_tbl(l_index +24 ).attribute := OE_LINE_UTIL.G_COMPONENT_SEQUENCE;
445          g_dep_tbl(l_index +25 ).attribute := OE_LINE_UTIL.G_SORT_ORDER;
446          -- ER: 1840556
447          g_dep_tbl(l_index +26 ).attribute := OE_LINE_UTIL.G_SOURCE_TYPE;
448          g_dep_tbl(l_index +27).attribute := OE_LINE_UTIL.G_ORDERED_QUANTITY2; -- 3016136
449 	 --recurring charges
450 	     g_dep_tbl(l_index+28).attribute := OE_LINE_UTIL.G_CHARGE_PERIODICITY;
451          g_dep_tbl(l_index +29 ).attribute := OE_LINE_UTIL.G_ITEM_REVISION;
452          -- bug 4283037
453          g_dep_tbl(l_index +30 ).attribute := OE_LINE_UTIL.G_SERVICE_DURATION;
454 
455 
456 	    l_index := OE_LINE_UTIL.G_AGREEMENT * G_MAX ;
457 	    g_dep_tbl(l_index).attribute  := OE_LINE_UTIL.G_INVOICING_RULE;
458 	    g_dep_tbl(l_index +1 ).attribute  := OE_LINE_UTIL.G_ACCOUNTING_RULE;
459 	    g_dep_tbl(l_index +2 ).attribute  := OE_LINE_UTIL.G_PAYMENT_TERM;
460 	    g_dep_tbl(l_index +3 ).attribute  := OE_LINE_UTIL.G_PRICE_LIST;
461 -- added the following lines to fix bug 1766836   Begin
462             g_dep_tbl(l_index +4 ).attribute  := OE_LINE_UTIL.G_CUST_PO_NUMBER;
463 	    g_dep_tbl(l_index +5 ).attribute  := OE_LINE_UTIL.G_INVOICE_TO_ORG;
464 	    g_dep_tbl(l_index +6 ).attribute  := OE_LINE_UTIL.G_INVOICE_TO_CONTACT;
465 	    g_dep_tbl(l_index +7 ).attribute  := OE_LINE_UTIL.G_SALESREP;
466             g_dep_tbl(l_index +8 ).attribute  := OE_LINE_UTIL.G_COMMITMENT;
467 -- added the following lines to fix bug 1766836   End
468 
469             --g_dep_tbl(l_index ).attribute     := OE_LINE_UTIL.G_CUST_PO_NUMBER;
470 	    --g_dep_tbl(l_index +3 ).attribute  := OE_LINE_UTIL.G_INVOICE_TO_ORG;
471 	    --g_dep_tbl(l_index +4 ).attribute  := OE_LINE_UTIL.G_INVOICE_TO_CONTACT;
472 	    --g_dep_tbl(l_index +4 ).attribute  := OE_LINE_UTIL.G_SOLD_TO_ORG;
473 	    --g_dep_tbl(l_index +5 ).attribute  := OE_LINE_UTIL.G_SALESREP;
474 
475             /* Added dependency for Bug 2245073 */
476               l_index := OE_LINE_UTIL.G_PRICING_DATE * G_MAX;
477               g_dep_tbl(l_index).attribute := OE_LINE_UTIL.G_AGREEMENT;
478              /* End of 2245073 */
479 
480               l_index := OE_LINE_UTIL.G_ACCOUNTING_RULE * G_MAX;
481               g_dep_tbl(l_index).attribute := OE_LINE_UTIL.G_ACCOUNTING_RULE_DURATION;
482 
483 
484 	    l_index := OE_LINE_UTIL.G_INVOICE_TO_ORG * G_MAX ;
485 	    g_dep_tbl(l_index ).attribute	    := OE_LINE_UTIL.G_PAYMENT_TERM;
486 	    g_dep_tbl(l_index +1 ).attribute  := OE_LINE_UTIL.G_INVOICE_TO_CONTACT;
487 	    g_dep_tbl(l_index +2 ).attribute  := OE_LINE_UTIL.G_PRICE_LIST;
488 	    g_dep_tbl(l_index +3 ).attribute  := OE_LINE_UTIL.G_FOB_POINT;
489 	    g_dep_tbl(l_index +4 ).attribute  := OE_LINE_UTIL.G_FREIGHT_TERMS;
490 	    /* Added by Manish */
491 	    g_dep_tbl(l_index +5 ).attribute   := OE_LINE_UTIL.G_TAX;
492 	    g_dep_tbl(l_index +6 ).attribute   := OE_LINE_UTIL.G_TAX_EXEMPT_NUMBER;
493 	    g_dep_tbl(l_index +7 ).attribute   := OE_LINE_UTIL.G_TAX_EXEMPT_REASON;
494 	    /* Added by Manish */
495 	    g_dep_tbl(l_index +8).attribute    := OE_LINE_UTIL.G_SHIP_TOLERANCE_BELOW;
496 	    g_dep_tbl(l_index +9).attribute    := OE_LINE_UTIL.G_SHIP_TOLERANCE_ABOVE;
497 	    g_dep_tbl(l_index +10).attribute    := OE_LINE_UTIL.G_SALESREP;
498 
499 	    l_index := OE_LINE_UTIL.G_SOLD_TO_ORG * G_MAX ;
500 	    g_dep_tbl(l_index ).attribute	    := OE_LINE_UTIL.G_PAYMENT_TERM;
501 	    g_dep_tbl(l_index +1 ).attribute  := OE_LINE_UTIL.G_INVOICE_TO_ORG;
502 	    g_dep_tbl(l_index +2 ).attribute  := OE_LINE_UTIL.G_PRICE_LIST;
503 	    g_dep_tbl(l_index +3 ).attribute  := OE_LINE_UTIL.G_FOB_POINT;
504 	    g_dep_tbl(l_index +4 ).attribute  := OE_LINE_UTIL.G_FREIGHT_TERMS;
505 	    g_dep_tbl(l_index +5 ).attribute  := OE_LINE_UTIL.G_DELIVER_TO_ORG;
506 	    g_dep_tbl(l_index +6 ).attribute  := OE_LINE_UTIL.G_SHIP_TO_ORG;
507 	    -- Added by Manish
508 	    g_dep_tbl(l_index +7 ).attribute  := OE_LINE_UTIL.G_TAX_EXEMPT_NUMBER;
509 	    g_dep_tbl(l_index +8 ).attribute  := OE_LINE_UTIL.G_TAX_EXEMPT_REASON;
510 	    -- Added by Manish
511 	    g_dep_tbl(l_index +9 ).attribute  := OE_LINE_UTIL.G_SHIP_FROM_ORG;
512 	    g_dep_tbl(l_index +10 ).attribute  := OE_LINE_UTIL.G_SALESREP;
513 	    g_dep_tbl(l_index +11 ).attribute  := OE_LINE_UTIL.G_SHIPPING_METHOD;
514 	  --g_dep_tbl(l_index +12 ).attribute  := OE_LINE_UTIL.G_COMMITMENT;
515 	    g_dep_tbl(l_index +12 ).attribute := OE_LINE_UTIL.G_SHIP_TOLERANCE_BELOW;
516 	    g_dep_tbl(l_index +13 ).attribute := OE_LINE_UTIL.G_SHIP_TOLERANCE_ABOVE;
517 	    g_dep_tbl(l_index +14 ).attribute := OE_LINE_UTIL.G_ITEM_IDENTIFIER_TYPE;
518 
522 	    --g_dep_tbl(l_index +2 ).attribute  := OE_LINE_UTIL.G_UNIT_LIST_PRICE;
519 	    l_index := OE_LINE_UTIL.G_PRICE_LIST * G_MAX ;
520 	    g_dep_tbl(l_index ).attribute	    := OE_LINE_UTIL.G_PAYMENT_TERM;
521 	    g_dep_tbl(l_index +1 ).attribute  := OE_LINE_UTIL.G_FREIGHT_TERMS;
523 
524 	    --l_index := OE_LINE_UTIL.G_ORDERED_QUANTITY * G_MAX ;
525 --	    g_dep_tbl(l_index ).attribute	    := OE_LINE_UTIL.G_QUANTITY_OPEN;
526 	    --g_dep_tbl(l_index +1 ).attribute  := OE_LINE_UTIL.G_UNIT_LIST_PRICE;
527 	    --g_dep_tbl(l_index +2 ).attribute  := OE_LINE_UTIL.G_PRICING_QUANTITY;
528 
529 --       l_index := OE_LINE_UTIL.G_ORDER_QUANTITY_UOM * G_MAX ;
530 --	    g_dep_tbl(l_index ).attribute	    := OE_LINE_UTIL.G_QUANTITY_OPEN;
531 	    --g_dep_tbl(l_index  ).attribute  := OE_LINE_UTIL.G_UNIT_LIST_PRICE;
532 	    --g_dep_tbl(l_index +1 ).attribute  := OE_LINE_UTIL.G_PRICING_QUANTITY_UOM;
533 
534 --	    l_index := OE_LINE_UTIL.G_SHIPPING_QUANTITY_UOM * G_MAX ;
535 --	    g_dep_tbl(l_index ).attribute     := OE_LINE_UTIL.G_SHIPPING_QUANTITY;
536 
537 	    --l_index := OE_LINE_UTIL.G_PRICING_QUANTITY_UOM * G_MAX ;
538 	    --g_dep_tbl(l_index ).attribute     := OE_LINE_UTIL.G_PRICING_QUANTITY;
539 
540 	    /* Added by Manish */
541 	    l_index := OE_LINE_UTIL.G_SCHEDULE_SHIP_DATE * G_MAX ;
542 	    g_dep_tbl(l_index  ).attribute     := OE_LINE_UTIL.G_TAX_DATE;
543 	   -- g_dep_tbl(l_index +1).attribute    := OE_LINE_UTIL.G_PROMISE_DATE;
544 
545 	    l_index := OE_LINE_UTIL.G_PROMISE_DATE * G_MAX ;
546 	    g_dep_tbl(l_index  ).attribute     := OE_LINE_UTIL.G_TAX_DATE;
547 
548 	    l_index := OE_LINE_UTIL.G_REQUEST_DATE * G_MAX ;
549 	    g_dep_tbl(l_index  ).attribute     := OE_LINE_UTIL.G_TAX_DATE;
550 
551 	    l_index := OE_LINE_UTIL.G_TAX_DATE * G_MAX ;
552 	    g_dep_tbl(l_index  ).attribute     := OE_LINE_UTIL.G_TAX;
553 	    g_dep_tbl(l_index +1 ).attribute   := OE_LINE_UTIL.G_TAX_EXEMPT_NUMBER;
554 	    g_dep_tbl(l_index +2 ).attribute   := OE_LINE_UTIL.G_TAX_EXEMPT_REASON;
555 
556            -- commented out by lkxu
557 	   -- l_index := OE_LINE_UTIL.G_INVOICED_FLAG * G_MAX ;
558 	   -- g_dep_tbl(l_index  ).attribute     := OE_LINE_UTIL.G_CALCULATE_PRICE_FLAG;
559 
560 	    l_index := OE_LINE_UTIL.G_SHIP_TO_ORG * G_MAX ;
561 	    g_dep_tbl(l_index  ).attribute     := OE_LINE_UTIL.G_TAX;
562 	    g_dep_tbl(l_index +1 ).attribute   := OE_LINE_UTIL.G_TAX_EXEMPT_NUMBER;
563 	    g_dep_tbl(l_index +2 ).attribute   := OE_LINE_UTIL.G_TAX_EXEMPT_REASON;
564 	    g_dep_tbl(l_index +3).attribute    := OE_LINE_UTIL.G_SHIP_TOLERANCE_ABOVE;
565 	    g_dep_tbl(l_index +4).attribute    := OE_LINE_UTIL.G_SHIP_TOLERANCE_BELOW;
566 	    g_dep_tbl(l_index +5).attribute    := OE_LINE_UTIL.G_SALESREP;
567 	    g_dep_tbl(l_index +6).attribute    := OE_LINE_UTIL.G_DEMAND_CLASS;
568 	    g_dep_tbl(l_index +7).attribute    := OE_LINE_UTIL.G_SHIP_FROM_ORG;
569 	    g_dep_tbl(l_index +8 ).attribute  := OE_LINE_UTIL.G_PAYMENT_TERM;
570 	    g_dep_tbl(l_index +9 ).attribute  := OE_LINE_UTIL.G_PRICE_LIST;
571 	    g_dep_tbl(l_index +10 ).attribute  := OE_LINE_UTIL.G_INVOICE_TO_ORG;
572 	    g_dep_tbl(l_index +11 ).attribute  := OE_LINE_UTIL.G_FOB_POINT;
573 	    g_dep_tbl(l_index +12 ).attribute  := OE_LINE_UTIL.G_FREIGHT_TERMS;
574 	    g_dep_tbl(l_index +13 ).attribute  := OE_LINE_UTIL.G_SHIPPING_METHOD;
575 	    g_dep_tbl(l_index +14 ).attribute := OE_LINE_UTIL.G_ITEM_IDENTIFIER_TYPE;
576 	    g_dep_tbl(l_index +15 ).attribute := OE_LINE_UTIL.G_SHIP_TO_CONTACT;
577 
578 	    /* Added by Manish */
579 	    l_index := OE_LINE_UTIL.G_TAX_EXEMPT * G_MAX ;
580 	    g_dep_tbl(l_index    ).attribute   := OE_LINE_UTIL.G_TAX_EXEMPT_NUMBER;
581 	    g_dep_tbl(l_index +1 ).attribute   := OE_LINE_UTIL.G_TAX_EXEMPT_REASON;
582             -- added by linda
583 	    g_dep_tbl(l_index +2 ).attribute   := OE_LINE_UTIL.G_TAX;
584 
585 	    l_index := OE_LINE_UTIL.G_TAX * G_MAX ;
586 	    g_dep_tbl(l_index    ).attribute   := OE_LINE_UTIL.G_TAX_EXEMPT_NUMBER;
587 	    g_dep_tbl(l_index +1 ).attribute   := OE_LINE_UTIL.G_TAX_EXEMPT_REASON;
588 
589 	    l_index := OE_LINE_UTIL.G_ORDERED_ITEM_ID * G_MAX ;
590 	    g_dep_tbl(l_index  ).attribute     := OE_LINE_UTIL.G_DEP_PLAN_REQUIRED;
591             -- OPM bug3016136
592             g_dep_tbl(l_index +1 ).attribute := OE_LINE_UTIL.G_ORDERED_QUANTITY2;
593             g_dep_tbl(l_index +2 ).attribute := OE_LINE_UTIL.G_ORDERED_QUANTITY_UOM2;
594             g_dep_tbl(l_index +3).attribute := OE_LINE_UTIL.G_PREFERRED_GRADE;
595             -- OPM bug3016136
596 
597 	    -- Adding for deliver to org . -- Added by Shashi.
598 	    l_index := OE_LINE_UTIL.G_DELIVER_TO_ORG * G_MAX ;
599 	    g_dep_tbl(l_index).attribute     := OE_LINE_UTIL.G_DELIVER_TO_CONTACT;
600 
601          /* OPM 02/JUN/00 - add process dependencies on whse */
602 	    l_index := OE_LINE_UTIL.G_SHIP_FROM_ORG * G_MAX ;
603 
604 	    -- fix for bug 1773985 - comment out line below and re-order indexes.
605 --         g_dep_tbl(l_index  ).attribute     := OE_LINE_UTIL.G_PREFERRED_GRADE;
606          g_dep_tbl(l_index).attribute   := OE_LINE_UTIL.G_ORDERED_QUANTITY_UOM2;
607          g_dep_tbl(l_index +1 ).attribute   := OE_LINE_UTIL.G_SUBINVENTORY;
608          -- ## bug fix 1609895
609          g_dep_tbl(l_index +2 ).attribute   := OE_LINE_UTIL.G_SHIPPABLE;
610          g_dep_tbl(l_index +3 ).attribute   := OE_LINE_UTIL.G_TAX;
611 
612 
613          -- BLANKETS: Add dependencies on blanket fields for order line
614          IF OE_CODE_CONTROL.Code_Release_Level >= '110509' THEN
615 
616 	    l_index := OE_LINE_UTIL.G_BLANKET_NUMBER * G_MAX;
617 	    g_dep_tbl(l_index).attribute := OE_LINE_UTIL.G_SHIPPING_INSTRUCTIONS;
621 	    g_dep_tbl(l_index+4).attribute := OE_LINE_UTIL.G_SHIP_TO_ORG;
618 	    g_dep_tbl(l_index+1).attribute := OE_LINE_UTIL.G_PACKING_INSTRUCTIONS;
619 	    g_dep_tbl(l_index+2).attribute := OE_LINE_UTIL.G_ACCOUNTING_RULE;
620 	    g_dep_tbl(l_index+3).attribute := OE_LINE_UTIL.G_INVOICING_RULE;
622 	    g_dep_tbl(l_index+5).attribute := OE_LINE_UTIL.G_INVOICE_TO_ORG;
623 	    g_dep_tbl(l_index+6).attribute := OE_LINE_UTIL.G_DELIVER_TO_ORG;
624 	    g_dep_tbl(l_index+7).attribute := OE_LINE_UTIL.G_SHIP_FROM_ORG;
625 	    g_dep_tbl(l_index+8).attribute := OE_LINE_UTIL.G_PAYMENT_TERM;
626 	    g_dep_tbl(l_index+9).attribute := OE_LINE_UTIL.G_PRICE_LIST;
627 	    g_dep_tbl(l_index+10).attribute := OE_LINE_UTIL.G_SHIPPING_METHOD;
628 	    g_dep_tbl(l_index+11).attribute := OE_LINE_UTIL.G_FREIGHT_TERMS;
629 	    g_dep_tbl(l_index+12).attribute := OE_LINE_UTIL.G_SALESREP;
630             -- bug 2766005, enabled grade defaulting from blanket line
631 	    g_dep_tbl(l_index+13).attribute := OE_LINE_UTIL.G_PREFERRED_GRADE;
632 	    g_dep_tbl(l_index+14).attribute := OE_LINE_UTIL.G_BLANKET_VERSION_NUMBER;
633 
634 	    l_index := OE_LINE_UTIL.G_BLANKET_LINE_NUMBER * G_MAX;
635 	    g_dep_tbl(l_index).attribute := OE_LINE_UTIL.G_ACCOUNTING_RULE;
636 	    g_dep_tbl(l_index+1).attribute := OE_LINE_UTIL.G_INVOICING_RULE;
637 	    g_dep_tbl(l_index+2).attribute := OE_LINE_UTIL.G_SHIP_TO_ORG;
638 	    g_dep_tbl(l_index+3).attribute := OE_LINE_UTIL.G_INVOICE_TO_ORG;
639 	    g_dep_tbl(l_index+4).attribute := OE_LINE_UTIL.G_DELIVER_TO_ORG;
640 	    g_dep_tbl(l_index+5).attribute := OE_LINE_UTIL.G_SHIP_FROM_ORG;
641 	    g_dep_tbl(l_index+6).attribute := OE_LINE_UTIL.G_PAYMENT_TERM;
642 	    g_dep_tbl(l_index+7).attribute := OE_LINE_UTIL.G_PRICE_LIST;
643 	    g_dep_tbl(l_index+8).attribute := OE_LINE_UTIL.G_SHIPPING_METHOD;
644 	    g_dep_tbl(l_index+9).attribute := OE_LINE_UTIL.G_FREIGHT_TERMS;
645 	    g_dep_tbl(l_index+10).attribute := OE_LINE_UTIL.G_SALESREP;
646 	    g_dep_tbl(l_index+11).attribute := OE_LINE_UTIL.G_SHIPPING_INSTRUCTIONS;
647 	    g_dep_tbl(l_index+12).attribute := OE_LINE_UTIL.G_PACKING_INSTRUCTIONS;
648             -- bug 2766005, enabled grade defaulting from blanket line
649 	    g_dep_tbl(l_index+13).attribute := OE_LINE_UTIL.G_PREFERRED_GRADE;
650 
651          END IF; -- end of check of code level for blankets
652 
653 	 IF OE_CODE_CONTROL.Code_Release_Level >= '110510' THEN
654 	    --distributed orders
655 	    l_index := OE_LINE_UTIL.G_END_CUSTOMER * G_MAX ;
656 	    g_dep_tbl(l_index).attribute   := OE_LINE_UTIL.G_END_CUSTOMER_CONTACT;
657 	    g_dep_tbl(l_index+1).attribute := OE_LINE_UTIL.G_END_CUSTOMER_SITE_USE;
658 	 END IF;
659 
660 	 ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER_ADJ THEN
661 
662 	   null;
663 	   /*
664 	   l_index	:= OE_HEADER_ADJ_UTIL.G_DISCOUNT * G_MAX;
665 	   --g_dep_tbl(l_index).attribute := OE_HEADER_ADJ_UTIL.g_discount_line;
666 	   g_dep_tbl(l_index).attribute := OE_HEADER_ADJ_UTIL.g_percent;
667 
668 
669 	   l_index	:= OE_HEADER_ADJ_UTIL.G_DISCOUNT_line * g_max;
670 	   --g_dep_tbl(l_index).attribute := OE_HEADER_ADJ_UTIL.g_discount;
671 	   g_dep_tbl(l_index+1).attribute := OE_HEADER_ADJ_UTIL.g_percent;
672 
673 		*/
674 
675 	 ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE_ADJ THEN
676 		null;
677 
678 	   /*
679 	   l_index	:= OE_LINE_ADJ_UTIL.G_DISCOUNT * G_MAX;
680 	   --g_dep_tbl(l_index).attribute := OE_LINE_ADJ_UTIL.G_DISCOUNT_LINE;
681 	   g_dep_tbl(l_index).attribute := OE_LINE_ADJ_UTIL.G_PERCENT;
682 
683 
684 	   l_index	:= OE_LINE_ADJ_UTIL.G_DISCOUNT_line * g_max;
685 	   --g_dep_tbl(l_index).attribute := OE_LINE_ADJ_UTIL.g_discount;
686 	   g_dep_tbl(l_index+1).attribute := OE_LINE_ADJ_UTIL.g_percent;
687 
688 		*/
689 --serla begin
690          ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_HEADER_PAYMENT THEN
691 
692             l_index := OE_HEADER_PAYMENT_UTIL.G_PAYMENT_TYPE_CODE * G_MAX ;
693             g_dep_tbl(l_index ).attribute    := OE_HEADER_PAYMENT_UTIL.G_PAYMENT_TRX_ID;
694             g_dep_tbl(l_index+1 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_RECEIPT_METHOD_ID;
695             g_dep_tbl(l_index+2 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_CHECK_NUMBER;
696             g_dep_tbl(l_index+3 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_CREDIT_CARD_NUMBER;
697             g_dep_tbl(l_index+4 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_CREDIT_CARD_CODE;
698             g_dep_tbl(l_index+5 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_CREDIT_CARD_APPROVAL_CODE;
699             g_dep_tbl(l_index+6 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_CREDIT_CARD_APPROVAL_DATE;
700             g_dep_tbl(l_index+7 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_CREDIT_CARD_HOLDER_NAME;
701             g_dep_tbl(l_index+8 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_CREDIT_CARD_EXPIRATION_DATE;
702             g_dep_tbl(l_index+9 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_TANGIBLE_ID;
703 /*
704             l_index := OE_HEADER_PAYMENT_UTIL.G_PAYMENT_TRX_ID * G_MAX ;
705             --g_dep_tbl(l_index ).attribute    := OE_HEADER_PAYMENT_UTIL.G_PAYMENT_TYPE_CODE;
706             g_dep_tbl(l_index ).attribute  := OE_HEADER_PAYMENT_UTIL.G_RECEIPT_METHOD_ID;
707             g_dep_tbl(l_index+1 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_CHECK_NUMBER;
708             g_dep_tbl(l_index+2 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_CREDIT_CARD_NUMBER;
709             g_dep_tbl(l_index+3 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_CREDIT_CARD_CODE;
710             g_dep_tbl(l_index+4 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_CREDIT_CARD_APPROVAL_CODE;
711             g_dep_tbl(l_index+5 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_CREDIT_CARD_APPROVAL_DATE;
712             g_dep_tbl(l_index+6 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_CREDIT_CARD_HOLDER_NAME;
713             g_dep_tbl(l_index+7 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_CREDIT_CARD_EXPIRATION_DATE;
717             g_dep_tbl(l_index ).attribute    := OE_HEADER_PAYMENT_UTIL.G_PAYMENT_TRX_ID;
714             g_dep_tbl(l_index+8 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_TANGIBLE_ID;
715 */
716             l_index := OE_HEADER_PAYMENT_UTIL.G_CREDIT_CARD_NUMBER * G_MAX ;
718             g_dep_tbl(l_index+1 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_CREDIT_CARD_HOLDER_NAME;
719             g_dep_tbl(l_index+2 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_CREDIT_CARD_EXPIRATION_DATE;
720             g_dep_tbl(l_index+3 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_CREDIT_CARD_APPROVAL_CODE;
721             g_dep_tbl(l_index+4 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_CREDIT_CARD_APPROVAL_DATE;
722             g_dep_tbl(l_index+5 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_TANGIBLE_ID;
723 	    --R12 CC Encryption
724 	    --The dependent attributes based on credit card code is not required
725             /*l_index := OE_HEADER_PAYMENT_UTIL.G_CREDIT_CARD_CODE * G_MAX ;
726             g_dep_tbl(l_index ).attribute    := OE_HEADER_PAYMENT_UTIL.G_PAYMENT_TRX_ID;
727             g_dep_tbl(l_index+1 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_CREDIT_CARD_NUMBER;
728             g_dep_tbl(l_index+2 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_CREDIT_CARD_APPROVAL_CODE;
729             g_dep_tbl(l_index+3 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_CREDIT_CARD_APPROVAL_DATE;
730             g_dep_tbl(l_index+4 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_CREDIT_CARD_HOLDER_NAME;
731             g_dep_tbl(l_index+5 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_CREDIT_CARD_EXPIRATION_DATE;
732             g_dep_tbl(l_index+6 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_TANGIBLE_ID;*/
733 	    --R12 CC Encryption
734             l_index := OE_HEADER_PAYMENT_UTIL.G_CREDIT_CARD_APPROVAL_CODE * G_MAX ;
735             g_dep_tbl(l_index ).attribute    := OE_HEADER_PAYMENT_UTIL.G_CHECK_NUMBER;
736             g_dep_tbl(l_index+1 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_TANGIBLE_ID;
737 
738             l_index := OE_HEADER_PAYMENT_UTIL.G_CREDIT_CARD_APPROVAL_DATE * G_MAX ;
739             g_dep_tbl(l_index ).attribute    := OE_HEADER_PAYMENT_UTIL.G_CHECK_NUMBER;
740             g_dep_tbl(l_index+1 ).attribute  := OE_HEADER_PAYMENT_UTIL.G_TANGIBLE_ID;
741 
742          ELSIF p_entity_code = OE_GLOBALS.G_ENTITY_LINE_PAYMENT THEN
743 
744             l_index := OE_LINE_PAYMENT_UTIL.G_PAYMENT_TYPE_CODE * G_MAX ;
745             g_dep_tbl(l_index ).attribute    := OE_LINE_PAYMENT_UTIL.G_PAYMENT_TRX_ID;
746             g_dep_tbl(l_index+1 ).attribute  := OE_LINE_PAYMENT_UTIL.G_RECEIPT_METHOD_ID;
747             g_dep_tbl(l_index+2 ).attribute  := OE_LINE_PAYMENT_UTIL.G_CHECK_NUMBER;
748             g_dep_tbl(l_index+3 ).attribute  := OE_LINE_PAYMENT_UTIL.G_CREDIT_CARD_NUMBER;
749             g_dep_tbl(l_index+4 ).attribute  := OE_LINE_PAYMENT_UTIL.G_CREDIT_CARD_CODE;
750             g_dep_tbl(l_index+5 ).attribute  := OE_LINE_PAYMENT_UTIL.G_CREDIT_CARD_APPROVAL_CODE;
751             g_dep_tbl(l_index+6 ).attribute  := OE_LINE_PAYMENT_UTIL.G_CREDIT_CARD_APPROVAL_DATE;
752             g_dep_tbl(l_index+7 ).attribute  := OE_LINE_PAYMENT_UTIL.G_CREDIT_CARD_HOLDER_NAME;
753             g_dep_tbl(l_index+8 ).attribute  := OE_LINE_PAYMENT_UTIL.G_CREDIT_CARD_EXPIRATION_DATE;
754             g_dep_tbl(l_index+9 ).attribute  := OE_LINE_PAYMENT_UTIL.G_TANGIBLE_ID;
755 
756  /*           l_index := OE_LINE_PAYMENT_UTIL.G_PAYMENT_TRX_ID * G_MAX ;
757             --g_dep_tbl(l_index ).attribute    := OE_LINE_PAYMENT_UTIL.G_PAYMENT_TYPE_CODE;
758             g_dep_tbl(l_index ).attribute  := OE_LINE_PAYMENT_UTIL.G_RECEIPT_METHOD_ID;
759             g_dep_tbl(l_index+1 ).attribute  := OE_LINE_PAYMENT_UTIL.G_CHECK_NUMBER;
760             g_dep_tbl(l_index+2 ).attribute  := OE_LINE_PAYMENT_UTIL.G_CREDIT_CARD_NUMBER;
761             g_dep_tbl(l_index+3 ).attribute  := OE_LINE_PAYMENT_UTIL.G_CREDIT_CARD_CODE;
762             g_dep_tbl(l_index+4 ).attribute  := OE_LINE_PAYMENT_UTIL.G_CREDIT_CARD_APPROVAL_CODE;
763             g_dep_tbl(l_index+5 ).attribute  := OE_LINE_PAYMENT_UTIL.G_CREDIT_CARD_APPROVAL_DATE;
764             g_dep_tbl(l_index+6 ).attribute  := OE_LINE_PAYMENT_UTIL.G_CREDIT_CARD_HOLDER_NAME;
765             g_dep_tbl(l_index+7 ).attribute  := OE_LINE_PAYMENT_UTIL.G_CREDIT_CARD_EXPIRATION_DATE;
766             g_dep_tbl(l_index+8 ).attribute  := OE_LINE_PAYMENT_UTIL.G_TANGIBLE_ID;
767 */
768             l_index := OE_LINE_PAYMENT_UTIL.G_CREDIT_CARD_NUMBER * G_MAX ;
769             g_dep_tbl(l_index ).attribute    := OE_LINE_PAYMENT_UTIL.G_PAYMENT_TRX_ID;
770             g_dep_tbl(l_index+1 ).attribute  := OE_LINE_PAYMENT_UTIL.G_CREDIT_CARD_HOLDER_NAME;
771             g_dep_tbl(l_index+2 ).attribute  := OE_LINE_PAYMENT_UTIL.G_CREDIT_CARD_EXPIRATION_DATE;
772             g_dep_tbl(l_index+3 ).attribute  := OE_LINE_PAYMENT_UTIL.G_CREDIT_CARD_APPROVAL_CODE;
773             g_dep_tbl(l_index+4 ).attribute  := OE_LINE_PAYMENT_UTIL.G_CREDIT_CARD_APPROVAL_DATE;
774             g_dep_tbl(l_index+5 ).attribute  := OE_LINE_PAYMENT_UTIL.G_TANGIBLE_ID;
775 	    --R12 CC Encryption
776 	    /*
777             l_index := OE_LINE_PAYMENT_UTIL.G_CREDIT_CARD_CODE * G_MAX ;
778             g_dep_tbl(l_index ).attribute    := OE_LINE_PAYMENT_UTIL.G_PAYMENT_TRX_ID;
779             g_dep_tbl(l_index+1 ).attribute  := OE_LINE_PAYMENT_UTIL.G_CREDIT_CARD_NUMBER;
780             g_dep_tbl(l_index+2 ).attribute  := OE_LINE_PAYMENT_UTIL.G_CREDIT_CARD_APPROVAL_CODE;
781             g_dep_tbl(l_index+3 ).attribute  := OE_LINE_PAYMENT_UTIL.G_CREDIT_CARD_APPROVAL_DATE;
782             g_dep_tbl(l_index+4 ).attribute  := OE_LINE_PAYMENT_UTIL.G_CREDIT_CARD_HOLDER_NAME;
783             g_dep_tbl(l_index+5 ).attribute  := OE_LINE_PAYMENT_UTIL.G_CREDIT_CARD_EXPIRATION_DATE;
784             g_dep_tbl(l_index+6 ).attribute  := OE_LINE_PAYMENT_UTIL.G_TANGIBLE_ID;*/
785 
789 
786             l_index := OE_LINE_PAYMENT_UTIL.G_CREDIT_CARD_APPROVAL_CODE * G_MAX ;
787             g_dep_tbl(l_index ).attribute    := OE_LINE_PAYMENT_UTIL.G_CHECK_NUMBER;
788             g_dep_tbl(l_index+1 ).attribute  := OE_LINE_PAYMENT_UTIL.G_TANGIBLE_ID;
790             l_index := OE_LINE_PAYMENT_UTIL.G_CREDIT_CARD_APPROVAL_DATE * G_MAX ;
791             g_dep_tbl(l_index ).attribute    := OE_LINE_PAYMENT_UTIL.G_CHECK_NUMBER;
792             g_dep_tbl(l_index+1 ).attribute  := OE_LINE_PAYMENT_UTIL.G_TANGIBLE_ID;
793 
794 --serla end
795 	END IF;
796 
797         -- Merge any dependencies that user wants to enable/disable via call
798         -- to the new extension api - OE_Dependencies_Extn (OEXEDEPS/B.pls)
799         Merge_Dependencies_Extn(p_entity_code);
800 
801     END IF;
802 
803     IF l_debug_level  > 0 THEN
804         oe_debug_pub.add(  'EXITING OE_DEPENDENCIES.LOAD_ENTITY_ATTRIBUTES' , 1 ) ;
805     END IF;
806 
807 END Load_Entity_Attributes;
808 
809 --  This procedure should be modified to call itself recursively in
810 --  order to clear fields dependent on dependent fields.
811 --  kris - ask Amr why he didn't put the call in
812 --  is there something he knows that makes it not as easy as it seems?
813 
814 
815 PROCEDURE   Mark_Dependent
816 (   p_entity_code	IN  VARCHAR2				,
817     p_source_attr_tbl	IN  OE_GLOBALS.Number_Tbl_Type :=
818 				OE_GLOBALS.G_MISS_NUMBER_TBL	,
819 p_dep_attr_tbl OUT NOCOPY OE_GLOBALS.Number_Tbl_Type
820 
821 )
822 IS
823 l_index		    NUMBER;
824 l_out_index	    NUMBER;
825 l_dep_attr_tbl	    OE_GLOBALS.Number_Tbl_Type;
826 l_src_attr_tbl	    OE_GLOBALS.Number_Tbl_Type;
827 l_examined_attr_tbl OE_GLOBALS.Boolean_Tbl_Type;
828 l_out_attr_tbl	    OE_GLOBALS.Boolean_Tbl_Type;
829 --
830 l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
831 --
832 BEGIN
833 
834    IF l_debug_level  > 0 THEN
835        oe_debug_pub.add(  'ENTERING OE_DEPENDENCIES.MARK_DEPENDENT' , 1 ) ;
836    END IF;
837 
838     --	Init l_src_attr_tbl
839 
840     l_src_attr_tbl := p_source_attr_tbl;
841 
842     --	Load Entity Attributes.
843 
844     Load_Entity_Attributes ( p_entity_code );
845 
846     --  Loop throughout all attributes and mark dependent
847     --  attributes for those requested.
848 
849     WHILE l_src_attr_tbl.COUNT <> 0 LOOP
850 
851 	FOR I IN 1..l_src_attr_tbl.COUNT LOOP
852 
853 	    l_index := l_src_attr_tbl(I) * G_MAX;
854 
855             -- Bug 2318145: If a certain dependency was disabled via extn API
856             -- all subsequent dependencies were not being picked up either.
857             -- This was because the check for enabled_flag was included in
858             -- the WHILE condition and loop did not progress beyond the
859             -- disabled dependency.
860             -- With this fix, check for enabled is in a separate IF so it
861             -- should loop over all dependencies now.
862 
863 	    WHILE g_dep_tbl.EXISTS(l_index) LOOP
864 
865               IF g_dep_tbl(l_index).enabled_flag = 'Y' THEN
866                l_dep_attr_tbl(l_dep_attr_tbl.COUNT+1) :=g_dep_tbl(l_index).attribute;
867               END IF;
868 
869               l_index := l_index +1;
870 
871 	    END LOOP;
872 
873 	END LOOP;
874 
875 	--  Mark attributes that have been examined.
876 
877 	FOR I IN 1..l_src_attr_tbl.COUNT LOOP
878 	    l_examined_attr_tbl(l_src_attr_tbl(I)) := TRUE;
879 	END LOOP;
880 
881 	--  Clear source attributes table.
882 
883 	l_src_attr_tbl.DELETE;
884 
885 	--  Check dependent attributes. If they have been already
886 	--  examined then no need to re-check them.
887 
888 	FOR I IN 1..l_dep_attr_tbl.COUNT LOOP
889 
890 	    l_out_attr_tbl(l_dep_attr_tbl(I)) := TRUE;
891 
892 	    IF NOT l_examined_attr_tbl.EXISTS(l_dep_attr_tbl(I)) THEN
893 		l_src_attr_tbl(l_src_attr_tbl.COUNT+1) := l_dep_attr_tbl(I);
894 	    END IF;
895 
896 	END LOOP;
897 
898     END LOOP;
899 
900     --	Load OUT attr table.
901 
902     l_index := l_out_attr_tbl.FIRST;
903     l_out_index := 1;
904 
905     WHILE l_index IS NOT NULL LOOP
906 
907 	p_dep_attr_tbl(l_out_index) := l_index;
908 	l_index := l_out_attr_tbl.NEXT(l_index);
909 	l_out_index := l_out_index + 1;
910 
911     END LOOP;
912 
913     IF l_debug_level  > 0 THEN
914         oe_debug_pub.add(  'EXITING OE_DEPENDENCIES.MARK_DEPENDENT' , 1 ) ;
915     END IF;
916 
917 END Mark_Dependent;
918 
919 
920 PROCEDURE   clear_dependent_table
921   IS
922   --
923   l_debug_level CONSTANT NUMBER := oe_debug_pub.g_debug_level;
924   --
925 BEGIN
926 
927    IF l_debug_level  > 0 THEN
928        oe_debug_pub.add(  'ENTERING OE_DEPENDENCIES.CLEAR_DEPENDENT_TABLE' , 1 ) ;
929    END IF;
930 
931    g_dep_tbl.DELETE;
932    g_entity_code := NULL;
933 
934    IF l_debug_level  > 0 THEN
935        oe_debug_pub.add(  'EXITING OE_DEPENDENCIES.CLEAR_DEPENDENT_TABLE' , 1 ) ;
936    END IF;
937 
938 END clear_dependent_table;
939 
940 
941 END OE_Dependencies;