SELECT imt.transaction_id,iop.organization_code warehouse_code
, TO_CHAR(imt.creation_date,'DD-MON-YYYY') txn_creation_date
, ittv.transaction_type_name
, flva.meaning transaction_action
, itst.transaction_source_type_name
, esi.item_number
, imt.subinventory_code
, imt.transaction_quantity
, imt.transaction_uom
, imt.transaction_date
, imt.transaction_source_name
, iut.serial_number
FROM fusion.inv_material_txns imt
, fusion.inv_org_parameters iop
, fusion.egp_system_items_b esi
, fusion.inv_transaction_types_vl ittv
, fusion.fnd_lookup_values_vl flva
, fusion.inv_txn_source_types_vl itst
, fusion.inv_unit_transactions iut
WHERE imt.organization_id = iop.organization_id
AND imt.organization_id = esi.organization_id
AND imt.inventory_item_id = esi.inventory_item_id
AND imt.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 ittv.transaction_source_type_id = itst.transaction_source_type_id
AND imt.transaction_id = iut.transaction_id(+)
AND UPPER(ittv.transaction_type_name) IN ('WORK IN PROCESS MATERIAL ISSUE', 'WORK IN PROCESS PRODUCT COMPLETION')
AND UPPER(itst.transaction_source_type_name) = 'WORK ORDER'
AND esi.item_number = NVL(:p_item_number,esi.item_number)
AND iop.organization_code = NVL(:p_org_code,iop.organization_code)
AND imt.transaction_source_name = NVL(:p_wo_number, imt.transaction_source_name)
AND esi.item_number = NVL(:p_item_number, esi.item_number)
ORDER BY imt.creation_date desc;
Wednesday, April 13, 2022
Fusion:SCM:MFG: SQL to Validat the Componenet Issue and WO Completion transactions against Work Order
Tuesday, June 29, 2021
FA:SQL: Oralce Fusion Manufacturing Manage Scheduels/Schedule Exceptions/ Work Order Definition
REM Manage Schedules
SELECT DISTINCT cal.schedule_name
, zssp.schedule_id calendar_code
, zssv.shift_id shift_num
, zssv.shift_name
, zssv.shift_desc description
, zssv.start_time_ms_num from_time
, zssv.end_time_ms_num to_time
, zssv.shift_type_code
FROM fusion.zmm_sr_shifts_vl zssv
, fusion.zmm_sr_pattern_dtls zspd
, fusion.zmm_sr_schedule_patterns zssp
, fusion.zmm_sr_schedules_vl cal
WHERE zspd.pattern_id (+) = zssp.pattern_id
AND zspd.child_shift_id = zssv.shift_id
AND zssp.schedule_id = cal.schedule_id;
REM Manage Schedule exceptions
SELECT cal.schedule_name
, zssae.schedule_id calendar_code
, zssae.avl_exception_id
, zsaev.avl_excp_name
, zsaev.avl_excp_desc
, zsaev.start_date_time
, zsaev.end_date_time
, zsaev.short_txt
, zsaev.category_code
, zsaev.whole_day_flag
, zsaev.availability_code
FROM fusion.zmm_sr_sched_avl_excps zssae
, fusion.zmm_sr_avl_exceptions_vl zsaev
, fusion.zmm_sr_schedules_vl cal
WHERE zsaev.avl_exception_id (+) = zssae.avl_exception_id
AND zssae.schedule_id = cal.schedule_id
AND cal.schedule_name = 'US Planning Schedules';
REM Work Order Definitions
SELECT a.organization_id
, iop.organization_code
, b.inventory_item_id
, b.item_number
, f.alternate_bom_designator
, d.work_definition_name_id
, d.work_def_name
, d.work_def_name_description
, d.work_definition_code
, d.work_definition_type
, e.meaning
, a.object_version_number
, a.production_priority
, a.costing_priority
, a.work_definition_id
, a.status_code
, a.work_method_id
, c.work_method_name
, c.work_method_code
FROM fusion.wis_work_definitions a
, fusion.egp_system_items_b b
, fusion.wis_work_methods_vl c
, fusion.wis_work_definition_names_vl d
, fusion.FND_LOOKUP_VALUES_VL e
, fusion.egp_structures_b f
, fusion.inv_org_parameters iop
WHERE a.organization_id = b.organization_id
AND a.inventory_item_id = b.inventory_item_id
AND a.work_method_id = c.work_method_id
AND a.organization_id = iop.organization_id
AND iop.organization_code = 'FHK'
and a.work_definition_name_id = d.work_definition_name_id
and e.lookup_type = 'ORA_WIS_WORK_DEFINITION_TYPE'
and e.lookup_code = d.work_definition_type
and e.enabled_flag = 'Y'
and a.bill_sequence_id = f.bill_sequence_id;