1.客户化开发中的多帐套屏蔽
(1) 得到当前OU
mo_global.get_current_org_id或者fnd_global.org_id
(2)根据组织ID得到账套ID和公司名称
DECLAREl_org_information3 VARCHAR2(150); --帐套idl_company_desc VARCHAR2(150); --公司中文描述 BEGINSELECT o3.org_information3, o3.attribute3INTO l_org_information3,l_company_descFROM hr_all_organization_units o,hr_all_organization_units_tl otl,hr_organization_information o2,hr_organization_information o3WHERE o.organization_id = o2.organization_idAND o.organization_id = o3.organization_idAND o2.org_information_context || '' = 'CLASS'AND o3.org_information_context = 'Operating Unit Information'AND o2.org_information1 = 'OPERATING_UNIT'AND o2.org_information2 = 'Y'AND o.organization_id = otl.organization_idAND otl.language = userenv('LANG')AND o.organization_id = p_org_id; --OU id END;
(3) 得到本位币
DECLAREl_local_currency_code VARCHAR2(15); --本位币 BEGINSELECT gsob.currency_codeINTO l_local_currency_codeFROM gl_sets_of_books gsob, hr_operating_units houWHERE gsob.set_of_books_id = hou.set_of_books_idAND hou.organization_id = p_org_id; --OU ID END;
(4) 在程序中加上本位币和账套的限制
2.多帐套实现扩展
--帐套定义 SELECT * FROM gl_ledgers;--账套视图 SELECT * FROM gl_sets_of_books;--法人定义 SELECT * FROM xle_entity_profiles;