Order Loop improvements to support using alternative routings in ERP

The Order Loop between Production Scheduling and an ERP supported changing the resource on an existing PS batch which has been exported to the ERP. This works fine when both the old resource and the newly selected resource on the PS batch belong to the same work center in the ERP.

When alternative routings are used in the ERP to make the same product, it is possible that each alternative routing uses a different work center. From PS point of view, it is the same scenario as using multiple resources from the same work center; all resources are made available to the scheduler in one resource group to select from. From ERP point of view, however, when the old resource on an existing PS batch is changed to a new resource which is part of a different work center, it is not possible to update the existing production order. In this case, instead of updating the existing production order, the order using the old resource must be first deleted and a new order must be created using the new resource.

The Order Loop is now improved to support using a new resource in PS batches which is part of a different work center in the ERP than the original resource. After a PS batch is published to SCV, the routing for the batch is determined and compared against the routing on the corresponding production order imported from the ERP. If the new routing is the same as the routing before scheduling, the batch is transferred to SCV Core plan table as open order to update in the ERP. If the routing has changed, during the transfer, one new order is created in the SCV Core plan table using the new routing, and a ’cancelled’ order is created in the same SCV Core plan table to delete the order with the old routing from the ERP.

plan_value_id is the primary key for production orders generated from PS batches. Previously this column contained the PS batch number that is unique across SCV. With the new solution, one PS batch may be split into two orders; one order using the old routing to delete from the ERP and another order using the new routing to create in the ERP. Both orders originate from the same PS batch, hence mapping the batch number to the plan_value_id column violates the PK constraints. Hence the new solution switches to dynamically generated plan_value_id values, similar to plan data generated by other SCP applications. The scp_order_number column is now used to hold the PS batch number. The purge program on Core plan tables and Business Plan logic between SCV Core and Outbox relies on header-child relationships between SC_PRODUCTION_PLAN and SC_PRODUCTION_PLAN_OP, the plan_value_id in the header table is generated and the same value is used by the records in the child table.

This change is only available when Business Plans are enabled. If production orders with old routings are now deleted from the ERP, this is to support changing resources on PS batches. The Order Loop still does not support deleting of orders or batches from within PS. The orders or batches must be deleted in PS and in the ERP simultaneously.

These SCV database views are updated in the production scheduling template to generate "New", "Open", "Cancelled" orders from PS batches:

  • SC_V_PS_PUB_PROCESS_BATCH_ORDERS
  • SC_V_PS_PUB_PROCESS_BATCH_ORDERS_RESOURCE
  • SC_V_PS_PUB_TANK_BATCH_ORDERS
  • SC_V_PS_PUB_TANK_BATCH_ORDERS_RESOURCE

These SCV views have been updated to join to header table SC_PRODUCTION_PLAN to retrieve plan_value_id:

  • SC_V_PS_PUB_PROCESS_BATCH_ORDERS_RESOURCE
  • SC_V_PS_PUB_TANK_BATCH_ORDERS_RESOURCE

This macro has been updated in the production scheduling template to add the macro steps to purge "Cancelled" orders from SCV Core plan table:

  • SCV - Production Scheduling Publish Orders (Batches) to SCV Core

These SCV mappings are updated in the production scheduling template to remove plan_value_id from mapping elements:

  • BASE_SC_V_PS_PUB_PROCESS_BATCH_ORDERS-SC_PRODUCTION_PLAN
  • BASE_SC_V_PS_PUB_PROCESS_BATCH_FIRMPLANNEDORDERS-SC_PRODUCTION_PLAN
  • BASE_SC_V_PS_PUB_TANK_BATCH_ORDERS-SC_PRODUCTION_PLAN
  • BASE_SC_V_PS_PUB_TANK_BATCH_FIRMPLANNEDORDERS-SC_PRODUCTION_PLAN

This BOI is updated in the base for M3 template to remove return field for plan_value_id:

  • PMS100MI_DltMO_ST_M3_OUT_SUPPLY_PROD_PLAN_MO_DEL

This new SCV database view is created in the base for M3 template to delete production orders from M3 with old routings:

  • ST_V_M3_SUPPLY_PRODUCTION_ORDERS_DEL

This new SCV mapping is created in the base for M3 template to delete production orders from M3 with old routings:

  • BASE_ST_V_M3_SUPPLY_PRODUCTION_ORDERS_DEL-

    ST_M3_OUT_SUPPLY_PROD_PLAN_MO_DEL

This macro has been updated in the base for M3 template to add the macro steps to delete production orders from M3 with old routings:

  • SCV_M3_Outbound_Supply_Plan_Full
  • SCV_M3_Outbound_Supply_Plan_Orders_Full
Note: This feature is available after loading the production scheduling (productionScheduling.zip) template and M3 template (base for M3.zip) for this release. You are not required a new role or privilege access to use this feature