Friday, June 8, 2012

Link for operating unit,inv_org & warehouse code


SELECT hou.NAME operating_unit_name,houn.internal_address_line,
         hou.short_code,
         hou.organization_id operating_unit_id,
         hou.set_of_books_id,
         hou.business_group_id,
         ood.organization_name inventory_organization_name,
         ood.organization_code Inv_organization_code,
         ood.organization_id Inv_organization_id,
         ood.chart_of_accounts_id,
         msci.secondary_inventory_name whse_code
    FROM hr_operating_units hou, org_organization_definitions ood,hr_all_organization_units houn,mtl_secondary_inventories msci
   WHERE 1 = 1 AND hou.organization_id = ood.operating_unit
   AND hou.organization_id=houn.organization_id
   AND ood.organization_id=msci.organization_id
   --AND ood.organization_code='WPO'
   AND houn.internal_address_line=NVL(:P_OPERRATING_UNIT, houn.internal_address_line) --'CCUS'
   AND ood.organization_code= NVL(:P_INVENTORY_ORG_CODE,ood.organization_code)--'WPO'
   AND msci.secondary_inventory_name=NVL(:P_WAREHOUSE_CODE,msci.secondary_inventory_name)--'WPFG'
ORDER BY hou.organization_id ASC

No comments: