DBA Data[Home] [Help]

VIEW: APPS.XLA_MO_REPORTING_ENT_MRC_V

Source

View Text - Preformatted

SELECT '1000' reporting_level , sob.name entity_name , sob.set_of_books_id entity_id , -9999 operating_unit_id , -9999 legal_entity_id , sob.set_of_books_id set_of_books_id FROM gl_sets_of_books sob WHERE sob.set_of_books_id = NVL(TO_NUMBER(SUBSTRB(USERENV('CLIENT_INFO'),45,10)),-99) UNION ALL SELECT '2000' reporting_level , o.name entity_name , o.organization_id entity_id , -9999 operating_unit_id , le.organization_id legal_entity_id , to_number(le.org_information1) set_books_id FROM hr_all_organization_units_tl o , hr_organization_information oi , hr_organization_information le , hr_organization_information ou , fnd_product_groups pg WHERE o.organization_id = le.organization_id AND o.organization_id = oi.organization_id AND oi.org_information_context = 'CLASS' AND oi.org_information1 = 'HR_LEGAL' AND oi.org_information2 = 'Y' AND le.org_information_context = 'Legal Entity Accounting' AND le.org_information1 = ou.org_information3 AND ou.org_information_context = 'Operating Unit Information' AND NVL( ou.organization_id , NVL( TO_NUMBER(DECODE( SUBSTRB(USERENV('CLIENT_INFO'),1,1) , ' ' , NULL , SUBSTRB(USERENV('CLIENT_INFO'),1,10) ) ) , -99 ) ) = NVL( TO_NUMBER(DECODE( SUBSTRB(USERENV('CLIENT_INFO'),1,1) , ' ' , NULL , SUBSTRB(USERENV('CLIENT_INFO'),1,10) ) ) , -99 ) AND NVL(pg.multi_org_flag,'N') = 'Y' AND o.language = userenv('LANG') UNION ALL SELECT '3000' reporting_level , o.name entity_name , o.organization_id entity_id , ou1.organization_id operating_unit_id , to_number(ou1.org_information2) legal_entity_id , to_number(ou1.org_information3) set_of_books_id FROM hr_all_organization_units_tl o , hr_organization_information oi , hr_organization_information ou1 , hr_organization_information ou2 , fnd_product_groups pg WHERE o.organization_id = ou1.organization_id AND o.organization_id = oi.organization_id AND oi.org_information_context = 'CLASS' AND oi.org_information1 = 'OPERATING_UNIT' AND oi.org_information2 = 'Y' AND ou1.org_information_context = 'Operating Unit Information' AND ou1.org_information3 = ou2.org_information3 AND ou2.org_information_context = 'Operating Unit Information' AND NVL( ou2.organization_id , NVL( TO_NUMBER(DECODE( SUBSTRB(USERENV('CLIENT_INFO'),1,1) , ' ' , NULL , SUBSTRB(USERENV('CLIENT_INFO'),1,10) ) ) , -99 ) ) = NVL( TO_NUMBER(DECODE( SUBSTRB(USERENV('CLIENT_INFO'),1,1) , ' ' , NULL , SUBSTRB(USERENV('CLIENT_INFO'),1,10) ) ) , -99 ) AND NVL(pg.multi_org_flag,'N') = 'Y' AND o.language = userenv('LANG')
View Text - HTML Formatted

SELECT '1000' REPORTING_LEVEL
, SOB.NAME ENTITY_NAME
, SOB.SET_OF_BOOKS_ID ENTITY_ID
, -9999 OPERATING_UNIT_ID
, -9999 LEGAL_ENTITY_ID
, SOB.SET_OF_BOOKS_ID SET_OF_BOOKS_ID
FROM GL_SETS_OF_BOOKS SOB
WHERE SOB.SET_OF_BOOKS_ID = NVL(TO_NUMBER(SUBSTRB(USERENV('CLIENT_INFO')
, 45
, 10))
, -99) UNION ALL SELECT '2000' REPORTING_LEVEL
, O.NAME ENTITY_NAME
, O.ORGANIZATION_ID ENTITY_ID
, -9999 OPERATING_UNIT_ID
, LE.ORGANIZATION_ID LEGAL_ENTITY_ID
, TO_NUMBER(LE.ORG_INFORMATION1) SET_BOOKS_ID
FROM HR_ALL_ORGANIZATION_UNITS_TL O
, HR_ORGANIZATION_INFORMATION OI
, HR_ORGANIZATION_INFORMATION LE
, HR_ORGANIZATION_INFORMATION OU
, FND_PRODUCT_GROUPS PG
WHERE O.ORGANIZATION_ID = LE.ORGANIZATION_ID
AND O.ORGANIZATION_ID = OI.ORGANIZATION_ID
AND OI.ORG_INFORMATION_CONTEXT = 'CLASS'
AND OI.ORG_INFORMATION1 = 'HR_LEGAL'
AND OI.ORG_INFORMATION2 = 'Y'
AND LE.ORG_INFORMATION_CONTEXT = 'LEGAL ENTITY ACCOUNTING'
AND LE.ORG_INFORMATION1 = OU.ORG_INFORMATION3
AND OU.ORG_INFORMATION_CONTEXT = 'OPERATING UNIT INFORMATION'
AND NVL( OU.ORGANIZATION_ID
, NVL( TO_NUMBER(DECODE( SUBSTRB(USERENV('CLIENT_INFO')
, 1
, 1)
, ' '
, NULL
, SUBSTRB(USERENV('CLIENT_INFO')
, 1
, 10) ) )
, -99 ) ) = NVL( TO_NUMBER(DECODE( SUBSTRB(USERENV('CLIENT_INFO')
, 1
, 1)
, ' '
, NULL
, SUBSTRB(USERENV('CLIENT_INFO')
, 1
, 10) ) )
, -99 )
AND NVL(PG.MULTI_ORG_FLAG
, 'N') = 'Y'
AND O.LANGUAGE = USERENV('LANG') UNION ALL SELECT '3000' REPORTING_LEVEL
, O.NAME ENTITY_NAME
, O.ORGANIZATION_ID ENTITY_ID
, OU1.ORGANIZATION_ID OPERATING_UNIT_ID
, TO_NUMBER(OU1.ORG_INFORMATION2) LEGAL_ENTITY_ID
, TO_NUMBER(OU1.ORG_INFORMATION3) SET_OF_BOOKS_ID
FROM HR_ALL_ORGANIZATION_UNITS_TL O
, HR_ORGANIZATION_INFORMATION OI
, HR_ORGANIZATION_INFORMATION OU1
, HR_ORGANIZATION_INFORMATION OU2
, FND_PRODUCT_GROUPS PG
WHERE O.ORGANIZATION_ID = OU1.ORGANIZATION_ID
AND O.ORGANIZATION_ID = OI.ORGANIZATION_ID
AND OI.ORG_INFORMATION_CONTEXT = 'CLASS'
AND OI.ORG_INFORMATION1 = 'OPERATING_UNIT'
AND OI.ORG_INFORMATION2 = 'Y'
AND OU1.ORG_INFORMATION_CONTEXT = 'OPERATING UNIT INFORMATION'
AND OU1.ORG_INFORMATION3 = OU2.ORG_INFORMATION3
AND OU2.ORG_INFORMATION_CONTEXT = 'OPERATING UNIT INFORMATION'
AND NVL( OU2.ORGANIZATION_ID
, NVL( TO_NUMBER(DECODE( SUBSTRB(USERENV('CLIENT_INFO')
, 1
, 1)
, ' '
, NULL
, SUBSTRB(USERENV('CLIENT_INFO')
, 1
, 10) ) )
, -99 ) ) = NVL( TO_NUMBER(DECODE( SUBSTRB(USERENV('CLIENT_INFO')
, 1
, 1)
, ' '
, NULL
, SUBSTRB(USERENV('CLIENT_INFO')
, 1
, 10) ) )
, -99 )
AND NVL(PG.MULTI_ORG_FLAG
, 'N') = 'Y'
AND O.LANGUAGE = USERENV('LANG')