SELECT iod.organization_code,
iod.organization_name,
iod.business_unit_name,
iod.business_unit_id,
iod.legal_entity,
xep.NAME legal_entity_name,
hla.location_code,
hla.location_name,
hla.internal_location_code ,
Concat(Concat(Concat(Concat(Concat(Concat( Concat(Concat(hla.address_line_1
|| ', ', Nvl2(hla.address_line_2, hla.address_line_2
|| ', ', hla.address_line_2)), Nvl2(hla.address_line_3, hla.address_line_3
|| ', ', hla.address_line_3)), Nvl2(hla.address_line_4, hla.address_line_4
|| ', ', hla.address_line_4)), Nvl2(hla.town_or_city, hla.town_or_city
|| ', ', hla.town_or_city)), Nvl2(hla.region_1, hla.region_1
|| ', ', hla.region_1)), Nvl2(hla.region_2, hla.region_2
|| ', ', hla.region_2)), Nvl2(hla.country, country
|| ', ', hla.country)), hla.postal_code) concatenated_address,
iod.inventory_enabled_flag,
iod.inventory_flag,
iod.distributed_organization_flag,
iod.profit_center_bu_id,
iod.mfg_plant_flag,
iod.contract_mfg_flag,
iod.eam_enabled_flag,
iod.timezone_code
FROM inv_organization_definitions_v iod,
hr_locations_all hla,
xle_entity_profiles xep
WHERE iod.location_id = hla.location_id
AND iod.legal_entity = xep.legal_entity_id
AND NVL(iod.disable_date, sysdate+1) > sysdate;
Tuesday, June 14, 2022
FA:SQL: Query to get inventory organization/inventory organization location and business unit and Legal entity
Sunday, February 27, 2022
Oracle Fusion SQL: OSQL to Extract Inventory Pending Transactions (Records stuck in Oracle inventory Interface table)
SELECT iop.organization_code,
iop.organization_name,
ittv.transaction_type_name,
flva.meaning transaction_action,
mti.tRANSACTION_SOURCE_NAME,
itst.transaction_source_type_name,
mti.transaction_interface_id txn_iface_id,
mti.transaction_header_id txn_hdr_id,
mti.inventory_item_id inv_item_id,
egp.item_number,
mti.subinventory_code subinv_code,
mti.transaction_quantity txn_qty,
mti.transaction_uom uom,
mti.transaction_type_id txn_typ_id,
mti.transaction_action_id txn_act_id,
mti.transaction_source_type_id txn_sty_id,
mti.transaction_source_id txn_src_id,
TO_CHAR(mti.transaction_date, 'DD-MON-YYYY HH24:MI:SS') txn_date,
mti.source_code src_code,
mti.process_flag pflag,
decode(to_char(nvl(mti.process_flag, 0)),'1', 'Ready', '2', 'Not Ready', '3', 'Error', to_char(mti.process_flag) ) pflag_desc,
mti.transaction_mode tmode,
decode( mti.transaction_mode, '2', 'Immediate', '3', 'Background', to_char(mti.transaction_mode) ) tmode_desc,
NVL(mti.lock_flag, 'N') lflag,
decode(mti.lock_flag, '1', 'Locked', '2', 'Not Locked', 'Not Locked') lflag_desc,
mti.error_code error_code,
mti.error_explanation error_explanation
FROM fusion.inv_transactions_interface mti,
fusion.inv_transaction_types_vl ittv,
fusion.fnd_lookup_values_vl flva,
fusion.inv_txn_source_types_vl itst,
fusion.egp_system_items_b egp,
fusion.inv_organization_definitions_v iop
WHERE 1 = 1
AND ittv.transaction_source_type_id = itst.transaction_source_type_id
AND mti.transaction_type_id = ittv.transaction_type_id
AND ittv.transaction_action_id = flva.lookup_code
AND flva.lookup_type = 'INV_TRANSACTION_ACTION'
AND flva.enabled_flag = 'Y'
AND iop.organization_id = egp.organization_id
AND mti.organization_id = egp.organization_id
AND mti.inventory_item_id = egp.inventory_item_id
AND iop.organization_code = NVL(:p_organization_code, iop.organization_code)
AND egp.item_number = NVL(:p_item_number, egp.item_number)
AND mti.error_code IS NOT NULL
ORDER BY transaction_date;
Thursday, July 1, 2021
FA:MFG: SQL's to extract Details on Manage Work Area/Resources/Work Centers/Standard Operations
SELECT iop.organization_code
, wwav.work_area_name
, wwav.work_area_code
, wwav.work_area_description
FROM fusion.wis_work_areas_vl wwav
, fusion.inv_org_parameters iop
WHERE wwav.organization_id = iop.organization_id
AND iop.organization_code = '<inv_org_code>';
SELECT resource_name
, resource_code
, resource_description
, resource_type
, resource_class_code
, uom_code
, costed_flag
FROM fusion.wis_resources_vl wrv
, fusion.inv_org_parameters iop
WHERE wrv.organization_id = iop.organization_id
AND iop.organization_code = '<inv_org_code>'
ORDER BY 1;
--Manage Work Centers
SELECT wwc.work_center_name
, wwc.work_center_code
, wwc.work_center_description
, wwav.work_area_name
, resource_name
, wwr.resource_quantity
, wwr.available_24_hours_flag
, wwr.check_ctp_flag
, wwr.utilization_percentage
, wwr.efficiency_percentage
FROM fusion.wis_work_centers_vl wwc
, fusion.wis_work_areas_vl wwav
, fusion.wis_wc_resources wwr
, fusion.wis_resources_vl wrv
, fusion.inv_org_parameters iop
WHERE wwc.work_area_id = wwav.work_area_id
AND wwc.work_center_id = wwr.work_center_id
AND wwr.resource_id = wrv.resource_id
AND wwc.organization_id = iop.organization_id
AND iop.organization_code = '<inv_org_code>'
ORDER BY 1;
-- Manage Standard Operations
SELECT iop.organization_id
, iop.organization_code
, flv.meaning operation_type
, wwo.standard_operation_name
, wwo.standard_operation_code
, wwo.standard_operation_description
, wwc.work_center_name
, wwc.work_center_code
, wwc.work_center_description
, wwo.count_point_flag
, wwo.auto_transact_flag
, wwo.inactive_date
, wwo.used_in_auto_wd_flag
, flvai.meaning addl_mtl_at_manual_issue
, flvoi.meaning op_compl_with_under_issue
, flvoe.meaning op_compl_with_open_exceptions
, wsor.resource_seq_number
, wwr.resource_name
, wsor.assigned_units
, flvb.meaning basis
, wsor.usage_rate
, wsor.inverse_usage_rate
, wsor.uom_code
, flvs.meaning schedule_type
, wsor.principal_flag
, flvc.meaning charge_type
FROM fusion.wis_standard_operations_vl wwo
, fusion.wis_std_operation_resources wsor
, fusion.wis_resources_vl wwr
, fusion.fnd_lookup_values_vl flvai
, fusion.fnd_lookup_values_vl flvoi
, fusion.fnd_lookup_values_vl flvoe
, fusion.fnd_lookup_values_vl flvc
, fusion.fnd_lookup_values_vl flvs
, fusion.fnd_lookup_values_vl flvb
, fusion.wis_work_centers_vl wwc
, fusion.fnd_lookup_values_vl flv
, fusion.inv_org_parameters iop
WHERE wwo.standard_operation_id = wsor.standard_operation_id
AND wsor.resource_id = wwr.resource_id
AND flvc.enabled_flag = 'Y'
AND flvc.lookup_code = wsor.charge_type
AND flvc.lookup_type = 'ORA_WIS_CHARGE_TYPE'
AND flvs.enabled_flag = 'Y'
AND flvs.lookup_code = wsor.schedule_type
AND flvs.lookup_type = 'ORA_WIS_RESOURCE_SCHEDULE'
AND flvb.enabled_flag = 'Y'
AND flvb.lookup_code = wsor.basis_type
AND flvb.lookup_type = 'EGP_BOM_BASIS_TYPE'
AND wwc.work_center_id = wwo.work_center_id
AND flvai.enabled_flag = 'Y'
AND flvai.lookup_code = wwo.addl_mtl_at_manual_issue
AND flvai.lookup_type = 'ORA_WIS_ADDL_MANUAL_ISSUE_OPTS'
AND flvoi.enabled_flag = 'Y'
AND flvoi.lookup_code = wwo.op_compl_with_under_issue
AND flvoi.lookup_type = 'ORA_WIS_OP_COMPLETION_VAL_OPTS'
AND flvoe.enabled_flag = 'Y'
AND flvoe.lookup_code = wwo.op_compl_with_open_exceptions
AND flvoe.lookup_type = 'ORA_WIS_OP_COMPLETION_VAL_OPTS'
AND flv.enabled_flag = 'Y'
AND flv.lookup_code = wwo.operation_type
AND flv.lookup_type = 'ORA_WIS_OPERATION_TYPE'
AND wwo.organization_id = iop.organization_id
AND iop.organization_code = '<inv_org_code>';