fnd_global与fnd_profile

fnd_global与fnd_profile都是oracle ebs系统内置的包,在做ebs二次开发的时候用的也比较多,今天本来想找找相关的资料的,结果发现网上相关的资料也不是特别详细,后来就只好去看这两个包的代码了,结果意外的发现其实看代码就已经足够详细了。下面把这两个包中的一些介绍列在这里,方便以后查阅:

fnd_global包:

Application context related APIs.
The server-side package FND_GLOBAL returns the values of system
globals, such as the login/signon or "session" type of values.
You should not use FND_GLOBAL routines in your forms (that is on
the client side). On the client side, most of the procedures in the
FND_GLOBAL package are replaced by a user profile option with the
same (or a similar) name. You should use FND_PROFILE routines in
your forms instead.
@rep:scope public
@rep:product FND
@rep:displayname Application Context APIs
@rep:lifecycle active
@rep:ihelp FND/@e_global#e_global See related online help

fnd_profile包:

APIs to manipulate values stored in client
and server user profile caches.Any changes you make to profile option
values using these routines affect only the run-time environment. The
effect of these settings end when the program ends, because the database
session (which holds the profile cache) is terminated.
@rep:scope public
@rep:product FND
@rep:displayname Profile Management APIs
@rep:category BUSINESS_ENTITY FND_PROFILE
@rep:compatibility S
@rep:lifecycle active
@rep:ihelp FND/@prof_plsql#prof_plsql See the related online help

上面都只是这两个包开头的包的介绍,具体的包中的函数及存储过程的功能可以分别打开各包去查看各个地方的介绍。fnd_profile.value后面的参数,其中一部分可以参加如下图1:

$PROFILES$的参数

图1:$PROFILES$的参数

上图1来自“帮助 -> 诊断 -> 检查”,注意其中的MFG_ORGANIZATION_ID取得是库存组织,ORG_ID取得是业务实体。

-- 取得当前的库存组织
SELECT t.organization_code
  FROM inv.mtl_parameters t
 WHERE t.organization_id = fnd_profile.value('MFG_ORGANIZATION_ID');
-- 取得当前的业务实体
SELECT hou.name
  FROM hr_operating_units hou
 WHERE hou.organization_id = fnd_profile.value('ORG_ID');
 -- 取得当前的帐套
SELECT gl.name
  FROM gl_ledgers gl
 WHERE gl.ledger_id = fnd_profile.value('GL_SET_OF_BKS_ID');

上述代码为取得库存组织和业务实体的示例。

本文标题:fnd_global与fnd_profile

本文链接:http://yedward.net/?id=87

本文版权归作者所有,欢迎转载,转载请以文字链接的形式注明文章出处。

相关文章