Multi - Org in reports [message #158695] |
Mon, 13 February 2006 22:39 |
yram
Messages: 75 Registered: February 2001
|
Member |
|
|
I have a report which is fetching the data based on org_id, how do i implement this option..
Regards
Yram
|
|
|
Re: Multi - Org in reports [message #158715 is a reply to message #158695] |
Tue, 14 February 2006 00:58 |
vban2000
Messages: 207 Registered: March 2005
|
Senior Member |
|
|
Hi Yram
In all the tables (header tables mostly) there is column ORG_ID which you can make use of it in your report as part of the where clause.
e.g PO_HEADERS_ALL table has a ORG_ID column
Once you have constructed your report. Create a LOV Flexfield using the following SQL to reterive the org_id and display the relevent organization name for user to select and pass on to the report.
SELECT organization_id, NAME
FROM hr_all_organization_units
HTH
Regards
Andy
|
|
|
|
Re: Multi - Org in reports [message #159011 is a reply to message #158695] |
Wed, 15 February 2006 09:14 |
vban2000
Messages: 207 Registered: March 2005
|
Senior Member |
|
|
Hi
Try the following.. Both give the same result.
To be on the safe side (since, I never used before.. I am not sure on which is correct and should be used...) login as different ORG user and output the ORG_ID on the report see if result is correct.
DECLARE
x_org_id NUMBER;
BEGIN
fnd_profile.get ('ORG_ID', x_org_id);
fnd_client_info.set_org_context (x_org_id);
DBMS_OUTPUT.PUT_LINE (x_org_id);
END;
or
This piece of code is from the default value of ORG_ID in PO_HEADERS_ALL.
SELECT TO_NUMBER (DECODE (SUBSTRB (USERENV ('CLIENT_INFO'), 1, 1),
' ', NULL,
SUBSTRB (USERENV ('CLIENT_INFO'), 1, 10)
)
)
FROM DUAL
let me know the result.. (thanks in advance)
regards
AnDy
[Updated on: Wed, 15 February 2006 09:19] Report message to a moderator
|
|
|