Wednesday, 16 November 2016

Legal Entitiers & Organizations Detail Query

/* Formatted on 11/16/2016 1:50:54 PM (QP5 v5.114.809.3010) */
  SELECT   HRO.ORGANIZATION_ID,
           HRO.NAME,
           HOI.ORG_INFORMATION_CONTEXT,
           SOB2.NAME "LE SET OF BOOKS",
           HRO_LE.NAME "OU LEGAL ENT",
           HOI.ORG_INFORMATION2 "LE VAT CODES",
           SOB.NAME "OU SET OF BOOKS"
    FROM   HR_ALL_ORGANIZATION_UNITS_TL HRO,
           HR_ORGANIZATION_INFORMATION_V HOI,
           GL_SETS_OF_BOOKS SOB,
           GL_SETS_OF_BOOKS SOB2,
           HR_ALL_ORGANIZATION_UNITS_TL HRO_LE
   WHERE   HOI.ORG_INFORMATION_CONTEXT IN
                 ('Legal Entity Accounting', 'Operating Unit Information')
           AND HRO.ORGANIZATION_ID = HOI.ORGANIZATION_ID
           AND TO_CHAR (SOB.SET_OF_BOOKS_ID(+)) = HOI.ORG_INFORMATION3
           AND TO_CHAR (SOB2.SET_OF_BOOKS_ID(+)) = HOI.ORG_INFORMATION1
           AND TO_CHAR (HRO_LE.ORGANIZATION_ID(+)) = HOI.ORG_INFORMATION2
--AND SUBSTR(HRO.NAME,1,2) IN ('BE','LU','ES')
ORDER BY   2, 3

No comments:

Post a Comment