Search This Blog

Sunday, April 5, 2015

1. Useful Profiles 2. To Initialize Apps In toad: 3. To Initialize Apps in Oracle Report: 4. Secured Tables 5. To initialize in toad based on User_name, resp_name then 6. Arabic/English in toad/pl/sql (setting nls_lang)

1. Useful Profiles
2. To Initialize Apps In toad:
3. To Initialize Apps in Oracle Report:
4. Secured Tables
5. To initialize in toad based on User_name, resp_name then
6. Arabic/English in toad/pl/sql (setting nls_lang)

1.
select FND_PROFILE.VALUE('USER_ID') from dual
select FND_PROFILE.VALUE('RESP_ID') from dual
select FND_PROFILE.VALUE('RESP_APPL_ID') from dual
FND_PROFILE.value('PER_BUSINESS_GROUP_ID')
FND_PROFILE.value('PER_SECURITY_PROFILE_ID')

2.
To Initialize Apps In toad:
fnd_global.apps_initialize
  --(l_user_id,l_responsibility_id,l_resp_appl_id);
  (FND_PROFILE.VALUE('USER_ID'),
  FND_PROFILE.VALUE('RESP_ID'),
  FND_PROFILE.VALUE('RESP_APPL_ID'));
  mo_global.init ('S');

3.
To Initialize Apps in Oracle Report:
1. Before report trigger
    srw.USER_EXIT ('FND SRWINIT');
  fnd_global.apps_initialize
  --(l_user_id,l_responsibility_id,l_resp_appl_id);
  (FND_PROFILE.VALUE('USER_ID'),
  FND_PROFILE.VALUE('RESP_ID'),
  FND_PROFILE.VALUE('RESP_APPL_ID'));
  mo_global.init ('S');

2. After Report Trigger
SRW.USER_EXIT('FND SRWEXIT');

3. Add user parameter
P_CONC_REQUEST_ID  datatype - Number, Width - 200

4.
4. Check the query tables are secured or not (it should contain without _all_)
eg: per_people_f, per_assigments_f, pay_payrolls_f, hr_organization_units.


SELECT FND_PROFILE.value('PER_BUSINESS_GROUP_ID') BUSINESS_GROUP_ID,FND_PROFILE.value('PER_SECURITY_PROFILE_ID') PER_SEC_PROF_ID INTO
&P_BUSINESS_GROUP_ID, &P_PER_SEC_PROF_ID
FROM PER_ANALYSIS_CRITERIA C
WHERE C.ID_FLEX_NUM = 50317


5.
To initialize in toad based on User_name, resp_name then

DECLARE
  CURSOR c_details(p_user IN VARCHAR2, p_resp_name IN VARCHAR2) IS
    SELECT user_id,responsibility_id,responsibility_application_id, security_group_id
      FROM fnd_user_resp_groups
     WHERE user_id = (SELECT user_id FROM fnd_user WHERE user_name = p_user)
       AND responsibility_id in (SELECT responsibility_id FROM fnd_responsibility_tl WHERE responsibility_name = p_resp_name)
         ;
  CURSOR c_application(p_application_id IN NUMBER) IS
    SELECT application_short_name
      FROM fnd_application
     WHERE application_id = p_application_id
         ;
  l_user_id                NUMBER;
  l_responsibility_id      NUMBER;
  l_resp_appl_id           NUMBER;
  l_security_group_id      NUMBER;
  v_user_name              VARCHAR2(30);
  v_responsibility_name    VARCHAR(100);
  v_application_short_name VARCHAR2(10);
BEGIN
  v_user_name := :USER;
  v_responsibility_name := :RESPONSIBILITY_NAME;
  /**/
  OPEN c_details(v_user_name, v_responsibility_name);
  fetch c_details INTO l_user_id, l_responsibility_id, l_resp_appl_id, l_security_group_id;
  CLOSE c_details;
  /**/
  OPEN c_application(l_resp_appl_id);
  fetch c_application INTO v_application_short_name;
  close c_application;
  /**/
  fnd_global.apps_initialize(l_user_id,l_responsibility_id,l_resp_appl_id);
  mo_global.init ('S');
END;

6.
Arabic/English in toad/pl/sql develolper
alter session set NLS_LANGUAGE ='AMERICAN'--'ARABIC'
COMMIT
SELECT * from FUJ_MON_YEAR_V2
select userenv('lang') from dual

No comments:

Post a Comment