To Get The Ledger id in R12 :
select (select ledger_id from gl_ledgers where name= mo_utils.Get_Ledger_Name( fnd_profile.value('ORG_ID') )) AS l_ledger_id from dual
select (select ledger_id from gl_ledgers where name= mo_utils.Get_Ledger_Name( fnd_profile.value('ORG_ID') )) AS l_ledger_id from dual
Supper Bro
ReplyDeleteHi!
ReplyDeleteTo get the viceversa results, I mean to get the organizations that belong to this ledger, is there a query alredy for this?
I found it:
ReplyDeleteSELECT gl.name, o1.organization_id
FROM hr_organization_information o1,
hr_organization_information o2,
gl_ledgers_public_v gl
WHERE O1.ORGANIZATION_ID = O2.ORGANIZATION_ID
-- AND o1.organization_id = p_operating_unit
AND o1.org_information_context = 'CLASS'
AND o2.org_information_context = 'Operating Unit Information'
AND o1.org_information1 = 'OPERATING_UNIT'
AND O1.ORG_INFORMATION2 = 'Y'
--AND O2.ORG_INFORMATION3 = &P_LEDGER_ID
and gl.name = '&p_ledger_name';
Useful
ReplyDelete"select LEDGER_ID,NAME from gl_ledgers_public_v"
ReplyDeleteUse this this will also help!!