Thursday, July 1, 2021

FA:MFG: SQL's to extract Details on Manage Work Area/Resources/Work Centers/Standard Operations

   --Manage work Area
   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>';


   -- Manage Resources
   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>';

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.