fnd_global.apps_initialise [message #218752] |
Fri, 09 February 2007 15:53 |
sparrow
Messages: 8 Registered: November 2006
|
Junior Member |
|
|
Hi all
I'm trying to retrieve the business_group_id from a session.
Here is the SQL I'm running:
SQL> exec fnd_global.apps_initialize(24678,20536,800);
PL/SQL procedure successfully completed.
SQL> select fnd_profile.value('PER_BUSINESS_GROUP_ID')
2 from dual;
FND_PROFILE.VALUE('PER_BUSINESS_GROUP_ID')
-----------------------------------------------------------
0
Problem is, business_group_id should be 41, not 0.
Anybody got any suggestions on where to start looking?
We are on 11.5.8, and are using security profiles. I have run security list maintenance.
Thanks
Alex
[Updated on: Fri, 09 February 2007 15:55] Report message to a moderator
|
|
|
|
Re: fnd_global.apps_initialise [message #218938 is a reply to message #218752] |
Mon, 12 February 2007 03:08 |
sparrow
Messages: 8 Registered: November 2006
|
Junior Member |
|
|
Yes, it's my user. It works fine through the forms.
Here are the entries in the tables:
SQL> ed
Wrote file afiedt.buf
1 select user_id
2 from fnd_user
3* where user_name = <removed for security reasons>
SQL> /
USER_ID
----------
24678
To check the business group id:
SQL> ed
Wrote file afiedt.buf
line 21 truncated.
1 SELECT spa.user_id,
2 spa.responsibility_id,
3 fr.application_id,
4 spa.business_group_id
5 FROM applsys.fnd_responsibility_tl fr,
6 applsys.fnd_user_resp_groups urg,
7 applsys.fnd_user fu,
8 hr.per_sec_profile_assignments spa,
9 hr.per_security_profiles psp
10 WHERE fr.responsibility_id = urg.responsibility_id
11 AND fu.user_id = urg.user_id
12 AND fu.user_id = spa.user_id
13 AND psp.security_profile_id = spa.security_profile_id
14 AND fr.responsibility_id = spa.responsibility_id
15 AND fr.language = 'US'
16 AND NVL(fu.end_date,TRUNC(SYSDATE)) >= TRUNC(SYSDATE)
17 AND NVL(spa.end_date,TRUNC(SYSDATE)) >= TRUNC(SYSDATE)
18 AND TRUNC(SYSDATE) BETWEEN NVL(urg.start_date,TRUNC(SYSDATE)) AND NVL(urg.end_date,TRUNC(SYSDATE))
19 AND urg.user_id = 24678
20* AND spa.responsibility_id = 78334
21 ;
USER_ID RESPONSIBILITY_ID APPLICATION_ID BUSINESS_GROUP_ID
---------- ----------------- -------------- -----------------
24678 78334 800 41
The reason for not using this script is that some companies use security profiles, and others don't. I thought FND_PROFILE.VALUE('PER_BUSINESS_GROUP_ID') would return the correct value no matter how the system is set up.
Thanks
[Updated on: Mon, 12 February 2007 03:09] Report message to a moderator
|
|
|
Re: fnd_global.apps_initialise [message #218948 is a reply to message #218843] |
Mon, 12 February 2007 03:33 |
sparrow
Messages: 8 Registered: November 2006
|
Junior Member |
|
|
Solved it. I was missing the 4th parameter from the fnd_global.apps_initilize function.
The correct format is apps_initialize(user_id, resp_id,resp_app_id,security_group_id)
Thanks
Alex
|
|
|