ITPub博客

首页 > 数据库 > Oracle > Sample of API FND_PROFILE

Sample of API FND_PROFILE

原创 Oracle 作者:pan_tian 时间:2014-07-02 12:33:18 0 删除 编辑

1. FND_PROFILE.GET(‘Name of the Profile’, variable name);

SELECT fnd_profile.value(\'PROFILEOPTION\')
      ,fnd_profile.value(\'MFG_ORGANIZATION_ID\')
      ,fnd_profile.value(\'ORG_ID\')
      ,fnd_profile.value(\'LOGIN_ID\')
      ,fnd_profile.value(\'USER_ID\')
      ,fnd_profile.value(\'USERNAME\')
      ,fnd_profile.value(\'CONCURRENT_REQUEST_ID\')
      ,fnd_profile.value(\'GL_SET_OF_BKS_ID\')
      ,fnd_profile.value(\'SO_ORGANIZATION_ID\')
      ,fnd_profile.value(\'APPL_SHRT_NAME\')
      ,fnd_profile.value(\'RESP_NAME\')
      ,fnd_profile.value(\'RESP_ID\')
  FROM DUAL;

2. variable name := FND_PROFILE.VALUE(‘Name of the profile’);


3. FND_PROFILE.PUT(‘Name of the profile’, value of the profile);

SET SERVEROUTPUT ON;
DECLARE
   v_conc_login_id      NUMBER;
BEGIN
   FND_PROFILE.put (\'CONC_LOGIN_ID\',1425);
   fnd_profile.get (\'CONC_LOGIN_ID\', v_conc_login_id);
   DBMS_OUTPUT.put_line (v_conc_login_id);
END;
Output:
1425
PL/SQL procedure successfully completed

FND_PROFILE.GET is the procedure and FND_PROFILE.VALUE is the function so, it return a value. 


4.FND_PROFILE.SAVE used to set the profile values from backend.

The table fnd_profile_options_tl, profile options names are kept.  Now find the corresponding the Profileoption name for which you need to update from backend. For thisexample I took my favorite “ORG_ID”
SELECT profile_option_name
  FROM fnd_profile_options_tl
 WHERE user_profile_option_nameLIKE\'MO%\'

It returns more than one row but i can make out that "ORG_ID" is the PROFILE_OPTION_NAME for MO: Operating Unit. Now I need to know the Org_ID of the Org whose value is to be set in MO: Operating Unit. SO I use the simpleselect as below
SELECT organization_id, NAME
  FROM hr_all_organization_units;

From the organization name I find the one which will be the default Operating Unit, and I note the ID. In my case the ID for my default Operating Unit is 286. Now with the code below I set the profile option value using fnd_profile.save.
DECLARE
   stat   BOOLEAN;
BEGIN
   DBMS_OUTPUT.DISABLE;
   DBMS_OUTPUT.ENABLE(100000);
   stat := fnd_profile.SAVE(\'ORG_ID\',286,\'SITE\');
   IF stat
   THEN
      DBMS_OUTPUT.put_line(\'Stat = TRUE - profile updated\');
   ELSE
      DBMS_OUTPUT.put_line(\'Stat = FALSE - profile NOT updated\');
   END IF;
   COMMIT;
END;

5.fnd_profile.defined
IF (fnd_profile.defined(\'TRANSACTION_DATE\')) THEN
  l_profile_value := TO_NUMBER(fnd_profile.value(\'TRANSACTION_DATE\'));
  ....

source:http://www.shareoracleapps.com/2011/05/profile-options-in-oracle-apps-r12.html

<!-- Baidu Button BEGIN -->

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26687597/viewspace-1203877/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: Compile Invalid Package/Package Body,and check the error if any
下一篇: Oracle EBS APIs
请登录后发表评论 登录
全部评论
暂无介绍

注册时间:2012-02-18

最新文章