Query 1:
select DISTINCT fpov.profile_option_value ledger_id
from apps.fnd_user_resp_groups_direct furgd,
applsys.fnd_user u,
applsys.fnd_profile_option_values fpov,
applsys.fnd_responsibility res,
applsys.fnd_responsibility_tl restl
where furgd.user_id = u.user_id
and furgd.responsibility_id = fpov.level_value
and fpov.level_value = res.responsibility_id
and res.responsibility_id = restl.responsibility_id
and restl.language = 'US'
and fpov.profile_option_id = 1201
and u.user_name = 'LLIU' -- user login name
and res.application_id = 101 and((furgd.END_DATE IS NULL) OR (furgd.END_DATE >= SYSDATE))
and((res.END_DATE IS NULL) OR (res.END_DATE >= SYSDATE))
Query 2: default ledger
select name from gl_ledgers where ledger_id = gl_access_set_security_pkg.get_default_ledger_id(:$PROFILES$.GL)