Ansicht
Dokumentation

ES_MPE_EXEC_SHOP_FLO - BAdI: Identifying and Converting Shop Floor Orders

ES_MPE_EXEC_SHOP_FLO - BAdI: Identifying and Converting Shop Floor Orders

CL_GUI_FRONTEND_SERVICES - Frontend Services   Vendor Master (General Section)  
This documentation is copyright by SAP AG.
SAP E-Book

You implement this Business Add-In (BAdI) to identify orders that are relevant for use as shop floor orders and to automatically generate operation activity networks, including their operation activities and work instructions, from them.

This BAdI contains the following methods:

  • SHOP_FLOOR_ORDER_CHECK
You use this method to define how the system determines which orders are shop floor orders.
  • CHANGE_DEFAULT_VALUES
You use this method to define which texts are used in the resulting work instructions and select which status and action schemas the system uses for the operation activity networks.
  • UPDATE_DOCUMENT_PRT_VERSIONS
You use this method to update the PRT document version for the operation activities in the order.
  • UPDATE_DOC_PRTS_FOR_OPER_ACT
You use this method to delete existing document PRTs from or add new document PRTs to an operation activity when the corresponding operation is released. If an error occurs while the system is deleting or inserting one of the document PRTs, the release is aborted unless you set the exporting parameter EV_RELEASE_DESPITE_ERROR to ABAP_TRUE.
  • SET_SETTLEMENT_RULE_RECEIVER
You use this method to set the receiver of the settlement rule. Possible receivers are G/L accounts, cost centers, (production) orders, or WBS elements. This method is only called if a shop floor order is created with respect to a header material for which the Material f. process checkbox is selected in the material type details and the BOM does not contain any co-products. In this case, the header material cannot be used as a settlement receiver and this method gives you the option to choose another receiver.
  • SET_GOODS_RECEIPT_STOCK_TYPE
For components in order-specific routings, you can define the stock type for by-products. However, this is not possible for components in MBOMs. This BAdI method allows you to set an appropriate stock type for by-products during order creation or re-reading of master data.
  • PUBLISH_IN_UPDATE
Whenever a shop floor order is created or changed, this method is called to enable the update of customer-specific follow-up documents or to trigger follow-up actions. The method provides information about order header, items, sequence, operations, components, PRTs, document links, operation activity network and operation activity instances, as well as component and PRT allocation to operation activity instances. As the method is called in an update task, no user interaction can be invoked.

To use this BAdI, ensure that the following requirements have been met:

  • The Extended Production Operations (EPO) features have been activated for SAP Manufacturing for Production Engineering and Operations.
  • In the routing, an operation activity network has been defined for the produce operation segment.
  • The operation is not for rework.
  • No operation trigger points are defined.
  • The operation has an operation control key that requires milestone confirmations, optional confirmations, or where no confirmations is not allowed.
  • The BOM does not contain any co-products.
  • The order must be a shop floor order.

There is no default implementation of this BAdI.

For more information about the default values that are used when generating operation activity networks, see the BAdI method.

Implement BAdI EX_MPE_EXEC_SHOP_FLOOR_ORDER.

You want to implement the BAdI to identify all orders with production version PP01 as shop floor orders. You want to keep the default values that are used to generate the operation activity networks.

You implement method SHOP_FLOOR_ORDER_CHECK with the following business logic:

  METHOD if_mpe_exec_shop_floor_order~shop_floor_order_check.

    IF iv_production_version = 'PP01'.
* Orders with production version PP01 should be shop floor orders
      cv_is_shop_floor_order = abap_true.
    ENDIF.

  ENDMETHOD.

You do not change method CHANGE_DEFAULT_VALUES.

You want to exchange a document PRT at a specific operation activity. Since the released routing can no longer be changed, you can use method UPDATE_DOC_PRTS_FOR_OPER_ACT to do this. Let us assume the internal ID of the operation activity is 123456, the document you want to remove is EXAMPLE_DOCUMENT_1 of type DRW part 001 version 01, and the document to be added is EXAMPLE_DOCUMENT_2, again of type DRW part 001, but version 02.

You implement method UPDATE_DOC_PRTS_FOR_OPER_ACT with the following business logic:

  METHOD if_mpe_exec_shop_floor_order~update_doc_prts_for_oper_act.

* Remove document EXAMPLE_DOCUMENT_1
    IF is_operation_activity-id = 123456.

      LOOP AT it_current_document_prts INTO DATA(ls_curr_doc_prt)
                                       WHERE doknr = 'EXAMPLE_DOCUMENT_1'
                                       AND   dokar = 'DRW'
                                       AND   doktl = '001'
                                       AND   dokvr = '01'.
        APPEND INITIAL LINE TO et_document_prts_remove
                         ASSIGNING FIELD-SYMBOL(
).
        -aufpl = ls_curr_doc_prt-aufpl.
        -pzlfh = ls_curr_doc_prt-pzlfh.
      ENDLOOP.

* Add document EXAMPLE_DOCUMENT_2
      APPEND INITIAL LINE TO et_document_prts_add
                       ASSIGNING FIELD-SYMBOL().
      -item_no               = '0020'.
      -document_number       = 'EXAMPLE_DOCUMENT_2'.
      -document_type         = 'DRW'.
      -document_part         = '001'.
      -document_version      = '02'.
      -ctrl_key              = '1'.
      -std_value_for_prt_qty = 1.
      -prt_measure_unit      = 'EA'.

    ENDIF.
  ENDMETHOD.

You want to set the G/L account 895000 as the receiver in the settlement rule when a shop floor order gets created for material DISASSEMBLY with planning plant 0001. The material DISASSEMBLY is of material type PROC.

Implement the following logic in method SET_SETTLEMENT_RULE_RECEIVER:

METHOD if_mpe_exec_shop_floor_order~set_settlement_rule_receiver.

    IF is_order_item-matnr = 'DISASSEMBLY' AND
      is_order_item-pwerk = ‘0001’.

      cs_settlement_receiver-account_assignment_category = 'SK'.
      cs_settlement_receiver-gl_account = '0000895000'
      cv_default_rule = 'PEO'.
    ENDIF.

  ENDMETHOD.

In the structure cs_settlement_receiver, you set the type of the settlement receiver in the account_assignment_category field as well as the key of the actual receiver. As possible receiver types, you can choose between SK for G/L account, KS for cost center, OR for order, and PR for WBS element. Besides setting the receiver data, it is mandatory to choose PEO as the default rule. Additionally, you can change the settlement profile.

You want to set the stock type for by-products with material number BY_PRODUCT_001 to blocked stock. Furthermore, for by-products with material number BY_PRODUCT_002, you want to set the stock type to undefined, which means the operator has to select the stock type manually when entering the quantity to be posted.

Implement the following logic in method SET_GOODS_RECEIPT_STOCK_TYPE:

  METHOD if_mpe_exec_shop_floor_order~set_goods_receipt_stock_type.

    CASE is_component-matnr.
      WHEN 'BY_PRODUCT_001'.
* Post goods receipt to blocked stock
        cv_stock_type = 'S'.
      WHEN 'BY_PRODUCT_002'.
* Set stock type to undefined to enable entry on worker UI
        cv_stock_type = 'U'.
      WHEN OTHERS.
* Do not change stock type
    ENDCASE.

  ENDMETHOD.






ABAP Short Reference   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.

Length: 11708 Date: 20240607 Time: 071924     sap01-206 ( 140 ms )