Total Pageviews

Friday, April 19, 2013

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

5 comments:

  1. Hi!

    To get the viceversa results, I mean to get the organizations that belong to this ledger, is there a query alredy for this?

    ReplyDelete
  2. I found it:

    SELECT 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';

    ReplyDelete
  3. "select LEDGER_ID,NAME from gl_ledgers_public_v"

    Use this this will also help!!

    ReplyDelete