1: PACKAGE BODY ar_mo_global_cache as
2: /*$Header: ARMOGLCB.pls 120.11.12010000.2 2008/11/05 06:26:50 ankuagar ship $ */
3: PG_DEBUG varchar2(1) := NVL(FND_PROFILE.value('AFLOG_ENABLED'), 'N');
4:
5: /* ----------------------------------------------------------------------------
29:
30: BEGIN
31:
32: IF PG_DEBUG in ('Y', 'C') THEN
33: arp_util.debug('get_org_attributes: ' || 'ar_mo_global_cache.populate()+');
34: END IF;
35:
36: IF p_org_id is not null and g_cache.exists(p_org_id) THEN
37: RETURN;
235: and populate g_current_org_id
236: --------------------------------------------------------------------------- */
237:
238: mo_utils.get_default_ou(l_default_org_id,l_default_ou_name,l_count);
239: ar_mo_global_cache.set_current_org_id(l_default_org_id);
240:
241: IF PG_DEBUG in ('Y', 'C') THEN
242: arp_util.debug('get_org_attributes: ' || 'ar_mo_global_cache.populate()-');
243: END IF;
238: mo_utils.get_default_ou(l_default_org_id,l_default_ou_name,l_count);
239: ar_mo_global_cache.set_current_org_id(l_default_org_id);
240:
241: IF PG_DEBUG in ('Y', 'C') THEN
242: arp_util.debug('get_org_attributes: ' || 'ar_mo_global_cache.populate()-');
243: END IF;
244:
245: END populate;
246:
252: RETURN ar_mo_cache_utils.GlobalsRecord is
253: l_exp_flag varchar2(1);
254: BEGIN
255: IF PG_DEBUG in ('Y', 'C') THEN
256: arp_util.debug('ar_mo_global_cache.get_org_attributes()');
257: END IF;
258: --Bug 4517382 : On demand caching of OU information.
259: IF NOT(g_cache.exists(p_org_id)) THEN
260: ar_mo_global_cache.populate(p_org_id);
256: arp_util.debug('ar_mo_global_cache.get_org_attributes()');
257: END IF;
258: --Bug 4517382 : On demand caching of OU information.
259: IF NOT(g_cache.exists(p_org_id)) THEN
260: ar_mo_global_cache.populate(p_org_id);
261: END IF;
262:
263: RETURN g_cache(p_org_id);
264: EXCEPTION
275: exception
276: WHEN NO_DATA_FOUND THEN
277: IF PG_DEBUG in ('Y', 'C') THEN
278: arp_util.debug('get_org_attributes: ' || 'EXCEPTION: NO_DATA_FOUND IN SYSTEM PARAMETERS
279: - ar_mo_global_cache.get_org_attributes' );
280: END IF;
281: FND_MESSAGE.set_name('AR','AR_NO_ROW_IN_SYSTEM_PARAMETERS');
282: APP_EXCEPTION.raise_exception;
283: RAISE;
294: exception
295: when no_data_found then
296: IF PG_DEBUG in ('Y', 'C') THEN
297: arp_util.debug('get_org_attributes: ' || 'EXCEPTION: NO_DATA_FOUND IN SET OF BOOKS
298: - ar_mo_global_cache.get_org_attributes' );
299: END IF;
300: FND_MESSAGE.set_name('AR','AR_NO_ROW_IN_GL_SET_OF_BOOKS');
301: APP_EXCEPTION.raise_exception;
302: RAISE;
315: exception
316: when no_data_found then
317: IF PG_DEBUG in ('Y', 'C') THEN
318: arp_util.debug('get_org_attributes: ' || 'EXCEPTION: NO_DATA_FOUND IN CURRENCIES
319: - ar_mo_global_cache.get_org_attributes' );
320: END IF;
321: FND_MESSAGE.set_name('AR','AR_NO_ROW_IN_FND_CURRENCIES');
322: APP_EXCEPTION.raise_exception;
323: RAISE;
332:
333: FUNCTION get_current_org_id
334: RETURN number is
335: BEGIN
336: arp_util.debug('ar_mo_global_cache.get_current_org_id()');
337: RETURN ar_mo_global_cache.g_current_org_id ;
338: END get_current_org_id;
339:
340:
333: FUNCTION get_current_org_id
334: RETURN number is
335: BEGIN
336: arp_util.debug('ar_mo_global_cache.get_current_org_id()');
337: RETURN ar_mo_global_cache.g_current_org_id ;
338: END get_current_org_id;
339:
340:
341: /* --------------------------------------------------------------------------
344:
345: PROCEDURE set_current_org_id(p_org_id number) is
346: BEGIN
347: IF PG_DEBUG in ('Y', 'C') THEN
348: arp_util.debug('ar_mo_global_cache.set_current_org_id()');
349: END IF;
350: ar_mo_global_cache.g_current_org_id :=p_org_id;
351: END set_current_org_id;
352:
346: BEGIN
347: IF PG_DEBUG in ('Y', 'C') THEN
348: arp_util.debug('ar_mo_global_cache.set_current_org_id()');
349: END IF;
350: ar_mo_global_cache.g_current_org_id :=p_org_id;
351: END set_current_org_id;
352:
353: END ar_mo_global_cache;
349: END IF;
350: ar_mo_global_cache.g_current_org_id :=p_org_id;
351: END set_current_org_id;
352:
353: END ar_mo_global_cache;