Oracle EBs Apps Blog of Mahfuz, OPM and OBIEE Consultant

Saturday 27 February 2016

Wrong Organization Parameters Check


Wrong Organization Parameters Check


select SEGMENT1,ORGANIZATION_CODE,ORGANIZATION_ID,ORGANIZATION_NAME,NAME,count(SEGMENT1) from
(
select distinct gc.SEGMENT1,--MATERIAL_ACCOUNT,

p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.MATERIAL_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,MATERIAL_OVERHEAD_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.MATERIAL_OVERHEAD_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,MATL_OVHD_ABSORPTION_ACCT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.MATL_OVHD_ABSORPTION_ACCT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,RESOURCE_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.RESOURCE_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,PURCHASE_PRICE_VAR_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.PURCHASE_PRICE_VAR_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,AP_ACCRUAL_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.AP_ACCRUAL_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,OVERHEAD_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.OVERHEAD_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,OUTSIDE_PROCESSING_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.OUTSIDE_PROCESSING_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,INTRANSIT_INV_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.INTRANSIT_INV_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,INTERORG_RECEIVABLES_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.INTERORG_RECEIVABLES_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,INTERORG_PRICE_VAR_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.INTERORG_PRICE_VAR_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,INTERORG_PAYABLES_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.INTERORG_PAYABLES_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,COST_OF_SALES_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.COST_OF_SALES_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,ENCUMBRANCE_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.ENCUMBRANCE_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,INTERORG_TRANSFER_CR_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.INTERORG_TRANSFER_CR_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,INVOICE_PRICE_VAR_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.INVOICE_PRICE_VAR_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,AVERAGE_COST_VAR_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.AVERAGE_COST_VAR_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,SALES_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.SALES_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,EXPENSE_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.EXPENSE_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,BORRPAY_MATL_VAR_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.BORRPAY_MATL_VAR_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,BORRPAY_MOH_VAR_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.BORRPAY_MOH_VAR_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,BORRPAY_RES_VAR_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.BORRPAY_RES_VAR_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,BORRPAY_OSP_VAR_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.BORRPAY_OSP_VAR_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,BORRPAY_OVH_VAR_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.BORRPAY_OVH_VAR_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,MO_APPROVAL_TIMEOUT_ACTION
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.MO_APPROVAL_TIMEOUT_ACTION=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,PROJECT_COST_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.PROJECT_COST_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,DEFERRED_COGS_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.DEFERRED_COGS_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,LCM_VAR_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.LCM_VAR_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
union all
select distinct gc.SEGMENT1--,CAT_WT_ACCOUNT
,p.ORGANIZATION_CODE,p.ORGANIZATION_ID , o.ORGANIZATION_NAME,u.NAME
from mtl_parameters_view p, gl_code_combinations gc, org_organization_definitions o, hr_operating_units u
where p.CAT_WT_ACCOUNT=gc.CODE_COMBINATION_ID and p.ORGANIZATION_ID=o.ORGANIZATION_ID
and o.OPERATING_UNIT=u.ORGANIZATION_ID
)
group by SEGMENT1,ORGANIZATION_CODE,ORGANIZATION_ID,ORGANIZATION_NAME,NAME
having count(SEGMENT1)<18
order by ORGANIZATION_CODE

Internal location is Already assigned to another Ship-to Address

      SELECT *   FROM hz_cust_accounts  WHERE ACCOUNT_NUMBER = 'R08'; -- CUST_ACCOUNT_ID =51401 , PARTY_ID= 235048    SELECT *   FRO...