Ansicht
Dokumentation

EX_MPE_TOOL_MOVEMENT - BAdI: Inventory Posting for Equipment at Claim/Unclaim

EX_MPE_TOOL_MOVEMENT - BAdI: Inventory Posting for Equipment at Claim/Unclaim

Addresses (Business Address Services)   Fill RESBD Structure from EBP Component Structure  
This documentation is copyright by SAP AG.
SAP E-Book

You implement this Business Add-In (BAdI) to specify a goods movement for equipment instances. The goods movement is triggered, for example, when a piece of equipment is claimed and moved from the warehouse to a work center to perform an operation activity. It is also triggered when the equipment is unclaimed again and returned to the warehouse.

The BAdI is triggered by the following actions:

  • Claim (in the Track Tool Usage app)
  • Unclaim (in the Track Tool Usage app)
  • In addition, if the action handlers CLAIM_PRT_AT_REGISTRATION and UNCLAIM_PRT are configured and active the BAdI is also then triggered by the actions to which the action handler is assigned such as:
  • Register equipment at an operation activity in the Perform Work app (equipment is then automatically claimed to the operation activity by the action handler if it has not yet been claimed)
  • Complete operation activity in the Perform Work app (equipment is then automatically unclaimed by the action handler)

This BAdI contains the following methods:

  • SET_GOODS_MOVEMENT_PARAMETERS
You use this method to initialize all the variables related to the following exporting parameters of the BAPI_GOODSMVT_CREATE function: goodsmvt_header and goodsmvt_code. However, the receiving plant and receiving storage location values are not included.
  • SET_STOR_LOCATION_OA_CLAIM
You use this method to initialize the receiving plant and receiving storage location variables corresponding to the selected order, operations, or operation activities. The algorithm (which can be changed) initially retrieves the data as follows:
  1. Get production plant and work center from operation activity.
  2. Get supply area of work center.
  3. Get storage location from the supply area.
  • SET_STOR_LOCATION_USER_CLAIM
You use this method to initialize the receiving plant and receiving storage location variables corresponding to the selected user usage. The algorithm (which can be changed) initially retrieves the data as follows:
  1. Get work center of business partner.
  2. Get supply area of work center.
  3. Get storage location from the supply area.
  • SET_STOR_LOCATION_WC_CLAIM
You use this method to initialize the receiving plant and receiving storage location variables corresponding to the selected work center. The algorithm (which can be changed) initially retrieves the data as follows:
  1. Get supply area of work center.
  2. Get storage location from the supply area.
  • SET_STOR_LOCATION_UNCLAIM
You use this method to initialize the receiving plant and receiving storage location variables when the action Unclaimis triggered. The algorithm (which can be changed) initially retrieves the data as follows:
  1. Look for goods movement document (we get the maximum date of claim record per equipment).
  2. Get object list numbers from the goods movement document (migo).
  3. Get result set of plant and storage location data from migo and sort by DESCENDING.
  4. Get location and plant from first record of migo data.
If the data is not found, the system performs the following additional steps:
  1. Get plant for material.
  2. Get storage location from product storage location for material and plant.

Note:

The system raises errors during the execution of the BAdI. This means that the processing of the complete claim/unclaim action will be interrupted.

This is done in the method: IF_MPE_TOOL_MOVEMENT_ACTIONS~CLAIM

CATCH cx_mpe_exec_track_tools_static INTO DATA(lo_exception).

ct_message = lo_exception->get_message_table( ).

cv_error = abap_true means that raised errors will prevent the claim process from being completed. You can modify an error message in parameter CT_MESSAGE.

If you want to ignore an error and treat it as a warning without skipping the claim process, set the parameter cv_error to ABAP_FALSE.

To use this BAdI, ensure that the following requirements are fulfilled:

  • You have assigned PRTs (equipment) that have been correctly configured to the operation activities of the shop floor routing used to create the production order.

A default implementation of the BAdI is available that is executed automatically.

The BAdI is designed for multiple use. A filter is used to separate implementations.

The example class CL_MPE_TOOL_MOVEMENT_BADI_EXAM is provided.

Create your own BAdI implementation using the example class CL_MPE_TOOL_MOVEMENT_BADI_EXAM as follows:

  1. In transaction SE18, enter enhancement spot ES_MPE_TOOL_MOVEMENT and click Change.
  2. Right-click the BAdI definition and choose Create BAdI Implementation.
  3. Select the example implementation and enter the enhancement implementation name and description.
  4. Choose Creation of Enhancementto create the enhancement implementation.






ABAP Short Reference   BAL Application Log Documentation  
This documentation is copyright by SAP AG.

Length: 6079 Date: 20240523 Time: 203725     sap01-206 ( 74 ms )