查询系统已定义OU,ORG 以及相关基本信息

查询系统已定义OU,ORG 以及相关基本信息

下面的SQL可以查找到系统已定义OU,ORG 以及相关基本信息,可用来评估系统设置。
SELECT DISTINCT HOU.BUSINESS_GROUP_ID,
                HOU.BUSINESS_GROUP_NAME,
                HOU.OPERATING_UNITS_ID ORG_ID,
                OPERATING_UNIT_NAME,
                DATE_FROM,
                DATE_TO,
                LEGAL_ENTITY_ID,
                LEGAL_ENTITY_NAME,
                LOCATION_NAME,
                OOD.ORGANIZATION_CODE,
                OOD.ORGANIZATION_ID,
                OOD.ORGANIZATION_NAME,
                OOD.USER_DEFINITION_ENABLE_DATE,
                OOD.DISABLE_DATE,
                OOD.SET_OF_BOOKS_ID,
                OOD.INVENTORY_ENABLED_FLAG
  FROM APPS.HRFV_OPERATING_UNITS         HOU, --HR_OPERATING_UNITS;
       APPS.ORG_ORGANIZATION_DEFINITIONS OOD
 WHERE HOU.OPERATING_UNITS_ID = OOD.OPERATING_UNIT
 ORDER BY HOU.OPERATING_UNITS_ID, OOD.ORGANIZATION_CODE;


SELECT DISTINCT --HOU.BUSINESS_GROUP_ID,
                HOU.BUSINESS_GROUP_NAME,
                HOU.OPERATING_UNITS_ID ORG_ID,
                OPERATING_UNIT_NAME,
                DATE_FROM,
                DATE_TO,
                --   LEGAL_ENTITY_ID,
                LEGAL_ENTITY_NAME,
                LOCATION_NAME,
                OOD.ORGANIZATION_CODE,
                OOD.ORGANIZATION_ID,
                OOD.ORGANIZATION_NAME,
                OOD.USER_DEFINITION_ENABLE_DATE org_USER_DEFIN_ENABLE_DATE,
                --  OOD.DISABLE_DATE,
                --  OOD.SET_OF_BOOKS_ID,
                OOD.INVENTORY_ENABLED_FLAG,
                master_org inv_master_org,
                WMS_ENABLED_FLAG,
                organization_paramete. calendar_code,
                PRIMARY_COST_DUMMY PRIMARY_COST_METHOD,
                (SELECT cost_group
                   FROM APPS.CST_COST_GROUPS_V
                  where cost_group_id =
                        organization_paramete.DEFAULT_COST_GROUP_ID) DEFAULT_cost_group_name,
                        COST_ORGANIZATION_ID,
                sob.name SET_OF_BOOK_NAME,
                sob.CURRENCY_CODE SOB_FUNCTIONAL_CURRENCY,
                sob.CHART_OF_ACCOUNTS_NAME,
                sob.LATEST_OPENED_PERIOD_NAME
  FROM APPS.HRFV_OPERATING_UNITS HOU, --HR_OPERATING_UNITS;
       apps.Org_organization_definitions OOD,
       (select organization_id,
               organization_code,
               calendar_code,
               master_org,
               WMS_ENABLED_FLAG,
               COST_ORGANIZATION_ID,
               primary_cost_method,
               PRIMARY_COST_DUMMY,
               DEFAULT_COST_GROUP_ID
          
          from apps.MTL_PARAMETERS_VIEW) organization_paramete,
       (SELECT SET_OF_BOOKS_ID,
               CURRENCY_CODE,
               CHART_OF_ACCOUNTS_NAME,
               NAME,
               SHORT_NAME,
               DESCRIPTION,
               LATEST_OPENED_PERIOD_NAME,
               ALLOW_INTERCOMPANY_POST_FLAG
          FROM APPS.GL_SETS_OF_BOOKS_V) sob 
WHERE HOU.OPERATING_UNITS_ID = OOD.OPERATING_UNIT
   and OOD.SET_OF_BOOKS_ID = sob.SET_OF_BOOKS_ID
   and organization_paramete.organization_id = OOD.ORGANIZATION_ID
   and NVL(DATE_TO,SYSDATE) >=  sysdate 
ORDER BY HOU.OPERATING_UNITS_ID, --ORG_ID
          OOD.ORGANIZATION_CODE;

©️2020 CSDN 皮肤主题: 技术黑板 设计师:CSDN官方博客 返回首页