1.客户化开发中的多帐套屏蔽
(1) 得到当前OU
mo_global.get_current_org_id或者fnd_global.org_id
(2)根据组织ID得到账套ID和公司名称
DECLARE l_org_information3 VARCHAR2(150); --帐套id l_company_desc VARCHAR2(150); --公司中文描述BEGIN SELECT o3.org_information3, o3.attribute3 INTO l_org_information3,l_company_desc FROM hr_all_organization_units o, hr_all_organization_units_tl otl, hr_organization_information o2, hr_organization_information o3 WHERE o.organization_id = o2.organization_id AND o.organization_id = o3.organization_id AND 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_id AND otl.language = userenv('LANG') AND o.organization_id = p_org_id; --OU idEND;
(3) 得到本位币
DECLARE l_local_currency_code VARCHAR2(15); --本位币BEGIN SELECT gsob.currency_code INTO l_local_currency_code FROM gl_sets_of_books gsob, hr_operating_units hou WHERE gsob.set_of_books_id = hou.set_of_books_id AND hou.organization_id = p_org_id; --OU IDEND;
(4) 在程序中加上本位币和账套的限制
2.多帐套实现扩展
--帐套定义SELECT * FROM gl_ledgers;--账套视图SELECT * FROM gl_sets_of_books;--法人定义SELECT * FROM xle_entity_profiles;