SQL Script For Getting The Details of Inventory Org To Business Group
SQL Script For Getting The Details of Inventory Org To Business Group
Legal Entity, Operating Unit, Ledger, Period details, Inventory Validation org and
Purchase Validation org for the Operating unit
-------------------
select mp.organization_code org_code,
org.organization_id org_id,
org.name org_name,
hl.location_id,
hl.location_code,
hl.address_line_1,
hl.address_line_2,
hl.address_line_3,
hl.town_or_city,
hl.country,
hl.postal_code,
ou.organization_id ou_id,
ou.name OU,
le.legal_entity_id le_id,
le.name LE,
gl.ledger_id,
gl.name primary_ledger,
gl.currency_code,
bg.name bg,
(select organization_code
from apps.mtl_parameters
where organization_id =
(select parameter_value
from apps.OE_SYS_PARAMETERS_ALL
where parameter_code = 'MASTER_ORGANIZATION_ID'
and org_id = ou.organization_id)) IVO,
(select organization_code
from apps.mtl_parameters
where organization_id =
(select inventory_organization_id
from AP.FINANCIALS_SYSTEM_PARAMS_ALL#
where org_id = ou.organization_id)) PVO,
(select period_name || ' : ' || open_flag
from apps.ORG_ACCT_PERIODS
where period_start_date <= trunc(sysdate)
and schedule_close_date >= trunc(sysdate)
and organization_id = mp.organization_id) inv_period,
(select period_name || ' : ' || show_status
from apps.GL_PERIOD_STATUSES_V
where start_date <= trunc(sysdate)
and end_date >= trunc(sysdate)
and ledger_id = gl.ledger_id
and application_id = 101) gl_ledger_period,
(select period_name || ' : ' || show_status
from apps.GL_PERIOD_STATUSES_V
where start_date <= trunc(sysdate)
and end_date >= trunc(sysdate)
and ledger_id = gl.ledger_id
and application_id = 200) AP_period,
(select period_name || ' : ' || show_status
from apps.GL_PERIOD_STATUSES_V
where start_date <= trunc(sysdate)
and end_date >= trunc(sysdate)
and ledger_id = gl.ledger_id
and application_id = 222) AR_period,
(select period_name || ' : ' || show_status
from apps.GL_PERIOD_STATUSES_V
where start_date <= trunc(sysdate)
and end_date >= trunc(sysdate)
and ledger_id = gl.ledger_id
and application_id = 201) PO_period